コード例 #1
0
ファイル: util.py プロジェクト: chilabot/chila
def setPostFunction(indent, valueStreamer, provsOwner, object, objectName, type, function, queue, queueName):
    ind = clmUtil.indent(indent)

    return (
        '{ind}' + provsOwner + '.' + getVarName(object) + '->connector.{type}##s.{function}.passFunAndSet(chila::lib::misc::SetPostFun({queue}));\n'
        '{ind}if (debugLogFile)\n'
        '{ind}{{\n'
                  + addDFF(indent + 1, valueStreamer, provsOwner, object, objectName, type, function, '"posted in \'{queueName}\'"') +
        '{ind}}}\n'
        ).format(**locals())
コード例 #2
0
def setPostFunction(indent, valueStreamer, provsOwner, object, objectName,
                    type, function, queue, queueName):
    ind = clmUtil.indent(indent)

    return (
        '{ind}' + provsOwner + '.' + getVarName(object) +
        '->connector.{type}##s.{function}.passFunAndSet(chila::lib::misc::SetPostFun({queue}));\n'
        '{ind}if (debugLogFile)\n'
        '{ind}{{\n' +
        addDFF(indent + 1, valueStreamer, provsOwner, object, objectName, type,
               function, '"posted in \'{queueName}\'"') +
        '{ind}}}\n').format(**locals())
コード例 #3
0
ファイル: util.py プロジェクト: chilabot/chila
def addDebugFFToConnector(indent, valueStreamer, provsOwner, object, objectName):
    ind = clmUtil.indent(indent)
    return (\
        '{ind}if (debugLogFile)\n'
        '{ind}{{\n'
        '{ind}    chila::connectionTools::lib::other::addDebugFileFunToFunctions(\n'
        '{ind}        *debugLogFile, valueStreamer, "{objectName}", "action",\n'
        '{ind}        ' + provsOwner + '.' + getVarName(object) + '->connector.actions.list(), showArguments);\n'
        '{ind}    chila::connectionTools::lib::other::addDebugFileFunToFunctions(\n'
        '{ind}        *debugLogFile, valueStreamer, "{objectName}", "event",\n'
        '{ind}        ' + provsOwner + '.' + getVarName(object) + '->connector.events.list(), showArguments);\n'
        '{ind}}}\n').format(**locals())
コード例 #4
0
def addDebugFFToConnector(indent, valueStreamer, provsOwner, object,
                          objectName):
    ind = clmUtil.indent(indent)
    return (\
        '{ind}if (debugLogFile)\n'
        '{ind}{{\n'
        '{ind}    chila::connectionTools::lib::other::addDebugFileFunToFunctions(\n'
        '{ind}        *debugLogFile, valueStreamer, "{objectName}", "action",\n'
        '{ind}        ' + provsOwner + '.' + getVarName(object) + '->connector.actions.list(), showArguments);\n'
        '{ind}    chila::connectionTools::lib::other::addDebugFileFunToFunctions(\n'
        '{ind}        *debugLogFile, valueStreamer, "{objectName}", "event",\n'
        '{ind}        ' + provsOwner + '.' + getVarName(object) + '->connector.events.list(), showArguments);\n'
        '{ind}}}\n').format(**locals())
コード例 #5
0
ファイル: util.py プロジェクト: chilabot/chila
def addDFF(indent, valueStreamer, provsOwner, object, objectName, type, function, msg):
    ind = clmUtil.indent(indent)
    fun = provsOwner + '.' + getVarName(object) + '->connector.{type}##s.{function}'.format(**locals())

    return(\
        '{ind}{fun}.passFunAndSet\n'
        '{ind}(\n'
        '{ind}    chila::connectionTools::lib::other::DebugFileFunPFS<decltype({fun})>\n'
        '{ind}    (\n'
        '{ind}        *debugLogFile, valueStreamer, "{objectName}", "{type}", showArguments, {msg}\n'
        '{ind}    )\n'
        '{ind});\n'
        ).format(**locals())
コード例 #6
0
def addDFF(indent, valueStreamer, provsOwner, object, objectName, type,
           function, msg):
    ind = clmUtil.indent(indent)
    fun = provsOwner + '.' + getVarName(
        object) + '->connector.{type}##s.{function}'.format(**locals())

    return(\
        '{ind}{fun}.passFunAndSet\n'
        '{ind}(\n'
        '{ind}    chila::connectionTools::lib::other::DebugFileFunPFS<decltype({fun})>\n'
        '{ind}    (\n'
        '{ind}        *debugLogFile, valueStreamer, "{objectName}", "{type}", showArguments, {msg}\n'
        '{ind}    )\n'
        '{ind});\n'
        ).format(**locals())
コード例 #7
0
def postInitFinishFunsToConnector(indent, valueStreamer, provsOwner, object,
                                  objectName, queue, queueName):
    ind = clmUtil.indent(indent)
    return setPostFunction(indent, valueStreamer, provsOwner, object, objectName, 'action', 'launcher_start', queue, queueName) + \
           setPostFunction(indent, valueStreamer, provsOwner, object, objectName, 'action', 'launcher_deactivate', queue, queueName) + \
           setPostFunction(indent, valueStreamer, provsOwner, object, objectName, 'action', 'launcher_finish', queue, queueName)
コード例 #8
0
ファイル: util.py プロジェクト: chilabot/chila
def postInitFinishFunsToConnector(indent, valueStreamer, provsOwner, object, objectName, queue, queueName):
    ind = clmUtil.indent(indent)
    return setPostFunction(indent, valueStreamer, provsOwner, object, objectName, 'action', 'launcher_start', queue, queueName) + \
           setPostFunction(indent, valueStreamer, provsOwner, object, objectName, 'action', 'launcher_deactivate', queue, queueName) + \
           setPostFunction(indent, valueStreamer, provsOwner, object, objectName, 'action', 'launcher_finish', queue, queueName)