make gate update use net c structT
This commit is contained in:
parent
4b69ea3055
commit
2376154957
@ -58,8 +58,7 @@ function Gate.setportstate(gate, index, state)
|
||||
gate.port_states[index] = state
|
||||
|
||||
if ((gate.port_net_state_num[index][0]>0) ~= (gate.port_net_state[index][0]==1)) and (gate.port_net_in_queue[index][0]==0) then
|
||||
local net = gate.port_nets[index]
|
||||
local cnet = net.c
|
||||
local cnet = gate.port_nets_c[index]
|
||||
Simulation.queuegroup_c(GSim, cnet)
|
||||
end
|
||||
end
|
||||
|
@ -107,6 +107,7 @@ function GateDefinition.constructgate(def, objref, position, rotation)
|
||||
gate.port_net_state [port.idx] = ffi.cast("int*", 0)
|
||||
gate.port_net_state_num[port.idx] = ffi.cast("int*", 0)
|
||||
gate.port_net_in_queue [port.idx] = ffi.cast("int*", 0)
|
||||
gate.port_nets_c [port.idx] = ffi.cast("struct Net*", 0)
|
||||
end
|
||||
|
||||
return gate
|
||||
|
@ -54,10 +54,12 @@ function Port.setgroup(port, group)
|
||||
Port.getgate(port).port_net_state [port.idx] = group.state
|
||||
Port.getgate(port).port_net_state_num[port.idx] = group.state_num
|
||||
Port.getgate(port).port_net_in_queue [port.idx] = group.in_queue
|
||||
Port.getgate(port).port_nets_c [port.idx] = group.c
|
||||
else
|
||||
Port.getgate(port).port_net_state [port.idx] = ffi.cast("int*", 0)
|
||||
Port.getgate(port).port_net_state_num[port.idx] = ffi.cast("int*", 0)
|
||||
Port.getgate(port).port_net_in_queue [port.idx] = ffi.cast("int*", 0)
|
||||
Port.getgate(port).port_nets_c [port.idx] = ffi.cast("struct Net*", 0)
|
||||
end
|
||||
end
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user