1
Jianw
9 天以前 70f29da38121b9a467841253e3268feb5df02902
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
--[[
    编码: 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