added global function to gate defs
This commit is contained in:
parent
518deaca68
commit
43b4db151f
@ -123,5 +123,5 @@ function llr(){
|
|||||||
|
|
||||||
//resetAllOpCallFunc();
|
//resetAllOpCallFunc();
|
||||||
exec("./lualogic.cs");
|
exec("./lualogic.cs");
|
||||||
schedule(3000, 0, lualogic_connect, 25000);
|
schedule(1000, 0, lualogic_connect, 25000);
|
||||||
}
|
}
|
||||||
|
@ -95,7 +95,6 @@ function LuaLogicTCP::onLine(%this, %line)
|
|||||||
for(%i=0; %i<%argc; %i++){
|
for(%i=0; %i<%argc; %i++){
|
||||||
%data = nextToken(%data, av, "\t");
|
%data = nextToken(%data, av, "\t");
|
||||||
%argv[%i] = lualogic_collapseescape(%av);
|
%argv[%i] = lualogic_collapseescape(%av);
|
||||||
//talk("argv[" @ %i @ "] = " @ %argv[%i]);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(isObject(%brick)){
|
if(isObject(%brick)){
|
||||||
|
@ -5,14 +5,10 @@ function lualogic_registergatedefinition(%data){
|
|||||||
//handled automatically now
|
//handled automatically now
|
||||||
}
|
}
|
||||||
|
|
||||||
function lualogic_registergatedefinition_auto(%data)
|
function lualogic_registergatedefinition_auto(%data){
|
||||||
{
|
|
||||||
if(!isObject(%data))
|
if(!isObject(%data))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//if(%data.luaLogic_isRegistered)
|
|
||||||
//return;
|
|
||||||
|
|
||||||
%id = %data.getID();
|
%id = %data.getID();
|
||||||
|
|
||||||
if((%idx = $LuaLogic::GateDefinitionIDX[%id]) $= "")
|
if((%idx = $LuaLogic::GateDefinitionIDX[%id]) $= "")
|
||||||
@ -21,25 +17,26 @@ function lualogic_registergatedefinition_auto(%data)
|
|||||||
$LuaLogic::GateDefinitionIDX[%id] = %idx;
|
$LuaLogic::GateDefinitionIDX[%id] = %idx;
|
||||||
$LuaLogic::NumGateDefintions++;
|
$LuaLogic::NumGateDefintions++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
%numports = %data.numLogicPorts;
|
||||||
|
|
||||||
%def = %id @ ";" @
|
%def = %id @ ";" @
|
||||||
%data.logicUIName @ ";" @
|
%data.logicUIName @ ";" @
|
||||||
%data.logicUIDesc @ ";" @
|
%data.logicUIDesc @ ";" @
|
||||||
lualogic_expandescape(%data.logicInit) @ ";" @
|
lualogic_expandescape(%data.logicInit) @ ";" @
|
||||||
lualogic_expandescape(%data.logicUpdate) @ ";" @
|
lualogic_expandescape(%data.logicUpdate) @ ";" @
|
||||||
lualogic_expandescape(%data.logicInput) @ ";" @
|
lualogic_expandescape(%data.logicInput) @ ";" @
|
||||||
(%ports = %data.numLogicPorts)
|
lualogic_expandescape(%data.logicGlobal) @ ";" @
|
||||||
|
%numports
|
||||||
;
|
;
|
||||||
|
|
||||||
for(%i = 0; %i < %ports; %i++)
|
for(%i = 0; %i < %numports; %i++)
|
||||||
{
|
{
|
||||||
%def = %def @";"@ %data.logicPortType[%i] @";"@ %data.logicPortPos[%i] @";"@ %data.logicPortDir[%i]
|
%def = %def @ ";" @ %data.logicPortType[%i] @ ";" @ %data.logicPortPos[%i] @ ";" @ %data.logicPortDir[%i]
|
||||||
@";"@ (%data.logicPortCauseUpdate[%i] == true) @";"@ %data.logicPortUIName[%i];
|
@ ";" @ (%data.logicPortCauseUpdate[%i] == true) @ ";" @ %data.logicPortUIName[%i];
|
||||||
}
|
}
|
||||||
|
|
||||||
$LuaLogic::GateDefintion[%idx] = %def;
|
|
||||||
|
|
||||||
//%data.luaLogic_isRegistered = true;
|
$LuaLogic::GateDefintion[%idx] = %def;
|
||||||
}
|
}
|
||||||
|
|
||||||
function lualogic_registerAllGateDefinitions(){
|
function lualogic_registerAllGateDefinitions(){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user