changed Tz to Hz; added fixes for empty strings in gate properties
This commit is contained in:
parent
1f0b6f8629
commit
10611449bf
18
sim/main.lua
18
sim/main.lua
@ -24,12 +24,12 @@ local totalticks = 0
|
||||
sim = Simulation:new()
|
||||
|
||||
local units = {
|
||||
"uTz",
|
||||
"mTz",
|
||||
"Tz",
|
||||
"kTz",
|
||||
"MTz",
|
||||
"GTz",
|
||||
"uHz",
|
||||
"mHz",
|
||||
"Hz",
|
||||
"kHz",
|
||||
"MHz",
|
||||
"GHz",
|
||||
}
|
||||
|
||||
local function round(x)
|
||||
@ -109,7 +109,7 @@ while 1 do
|
||||
local i = 1
|
||||
line = line:gsub(";;", "; ;")
|
||||
for str in string.gmatch(line, "([^;]+)") do
|
||||
data[i] = str
|
||||
data[i] = str or ""
|
||||
i = i + 1
|
||||
end
|
||||
|
||||
@ -146,7 +146,7 @@ while 1 do
|
||||
elseif data[i] == "GD" then
|
||||
--print(table.concat(data, "\n", i, math.min(#data, i+100)))
|
||||
local objref = tonumber(data[i+1])
|
||||
local name = data[i+2] or ""
|
||||
local name = data[i+2]
|
||||
local desc = data[i+3]
|
||||
local init = data[i+4]
|
||||
local logic = data[i+5]
|
||||
@ -161,7 +161,7 @@ while 1 do
|
||||
position = vectotable(data[a+1]),
|
||||
direction = tonumber(data[a+2]),
|
||||
causeupdate = toboolean(data[a+3]),
|
||||
name = data[a+4] or "",
|
||||
name = data[a+4],
|
||||
}
|
||||
ports[#ports+1] = port
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user