fix more oop and bugs
This commit is contained in:
parent
db7e2d06ad
commit
6c997a36fa
@ -85,7 +85,7 @@ function Group.addport(self, port)
|
||||
elseif port.type == PortTypes.input then
|
||||
self.in_ports[port] = port
|
||||
self.nin_ports = self.nin_ports + 1
|
||||
port:setinputstate(self.state)
|
||||
Port.setinputstate(port, self.state)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -290,7 +290,9 @@ while 1 do
|
||||
for a = i+3, i+3+argc-1 do
|
||||
argv[#argv+1] = collapseescape(data[a])
|
||||
end
|
||||
Simulation.queuegateinput(sim, gate, argv)
|
||||
if gate then
|
||||
Simulation.queuegateinput(sim, gate, argv)
|
||||
end
|
||||
|
||||
i = i+2+argc
|
||||
elseif data[i] == "SAVE" then
|
||||
|
18
sim/port.lua
18
sim/port.lua
@ -32,18 +32,18 @@ function Port.new(self, type, direction, position, causeupdate)
|
||||
return o
|
||||
end
|
||||
|
||||
function Port.setstate(self, state)
|
||||
if state ~= self.state then
|
||||
self.state = state
|
||||
Simulation.queuegroup(sim, self.group)
|
||||
function Port.setstate(port, state)
|
||||
if state ~= port.state then
|
||||
port.state = state
|
||||
Simulation.queuegroup(sim, port.group)
|
||||
end
|
||||
end
|
||||
|
||||
function Port.setinputstate(self, state)
|
||||
if state ~= self.state then
|
||||
self.state = state
|
||||
if self.causeupdate then
|
||||
Simulation.queuegate(sim, self.gate)
|
||||
function Port.setinputstate(port, state)
|
||||
if state ~= port.state then
|
||||
port.state = state
|
||||
if port.causeupdate then
|
||||
Simulation.queuegate(sim, port.gate)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user