mirror of
https://github.com/MikaylaFischler/cc-mek-scada.git
synced 2024-08-30 18:22:34 +00:00
added type def to ppm and return a copy of the peripherals list rather than the table itself
This commit is contained in:
@ -161,10 +161,10 @@ local function peri_init(iface)
|
|||||||
|
|
||||||
setmetatable(self.device, mt)
|
setmetatable(self.device, mt)
|
||||||
|
|
||||||
return {
|
---@class ppm_entry
|
||||||
type = self.type,
|
local entry = { type = self.type, dev = self.device }
|
||||||
dev = self.device
|
|
||||||
}
|
return entry
|
||||||
end
|
end
|
||||||
|
|
||||||
----------------------
|
----------------------
|
||||||
@ -310,7 +310,11 @@ function ppm.list_avail() return peripheral.getNames() end
|
|||||||
-- list mounted peripherals
|
-- list mounted peripherals
|
||||||
---@nodiscard
|
---@nodiscard
|
||||||
---@return table mounts
|
---@return table mounts
|
||||||
function ppm.list_mounts() return ppm_sys.mounts end
|
function ppm.list_mounts()
|
||||||
|
local list = {}
|
||||||
|
for k, v in pairs(ppm_sys.mounts) do list[k] = v end
|
||||||
|
return list
|
||||||
|
end
|
||||||
|
|
||||||
-- get a mounted peripheral side/interface by device table
|
-- get a mounted peripheral side/interface by device table
|
||||||
---@nodiscard
|
---@nodiscard
|
||||||
|
@ -18,7 +18,7 @@ local type = type
|
|||||||
local util = {}
|
local util = {}
|
||||||
|
|
||||||
-- scada-common version
|
-- scada-common version
|
||||||
util.version = "1.1.6"
|
util.version = "1.1.7"
|
||||||
|
|
||||||
util.TICK_TIME_S = 0.05
|
util.TICK_TIME_S = 0.05
|
||||||
util.TICK_TIME_MS = 50
|
util.TICK_TIME_MS = 50
|
||||||
|
Reference in New Issue
Block a user