--[[
|
编码: WMS-69-04
|
名称: 站台亮点处理-初始化
|
作者:HAN
|
日期:2025-1-29
|
|
级别:固定 (说明本段代码在项目中不太会变化)
|
|
函数: Station_LPT_Test_Initial
|
|
功能:
|
|
|
更改记录:
|
|
--]]
|
|
json = require ("json")
|
mobox = require ("OILua_JavelinExt")
|
m3 = require("oi_base_mobox")
|
|
function Station_LPT_Test_Initial( strLuaDEID )
|
local nRet, strRetInfo
|
|
local station_objs, obj_attrs
|
|
strCondition = "C_ENABLE = 'Y' AND S_TYPE = 'WS(TP/SW)'"
|
nRet, station_objs = m3.QueryDataObject( strLuaDEID, "Machine_Station", strCondition, "S_CODE" )
|
if nRet ~= 0 then
|
lua.Stop( strLuaDEID, "获取【Machine_Station】信息失败! " .. station_objs )
|
return
|
end
|
|
local station_list = {}
|
for _, obj in ipairs( station_objs ) do
|
obj_attrs = m3.KeyValueAttrsToObjAttr(obj.attrs)
|
table.insert( station_list, obj_attrs.S_CODE )
|
end
|
station_enable = true
|
|
local action = {
|
{
|
action_type = "set_dlg_attr",
|
value = {
|
{ attr = "Station", value = "", choice_list = station_list }
|
}
|
}
|
}
|
nRet, strRetInfo = mobox.setAction( strLuaDEID, json.encode(action) )
|
if ( nRet ~= 0 ) then
|
lua.Stop( strLuaDEID, "setAction失败! "..strRetInfo )
|
return
|
end
|
|
end
|