--[[
|
版本: Version 2.1
|
创建日期: 2025-3-26
|
创建人: HAN
|
|
WMS-Basis-Model-Version: V15.5
|
|
名称: 机台、站台相关的一些标准函数
|
作者:HAN
|
日期:2025-1-29
|
|
级别:固定
|
|
函数:
|
-- TaskSimulate 模拟出N个Task,一般用于一些出入库货位算法执行时的数据铺垫
|
-- Batch_Set_LocInfo 批量设置货位中当前容器数量,前提是这些货位的 cur_num = 0
|
更改记录:
|
|
--]]
|
|
wms_base = require ("wms_base")
|
|
local wms_station = {_version = "0.2.1"}
|
|
-- 获取 ‘机台-XX’ 常量并且解析成一个 站台扩展属性的 table
|
function wms_station.Get_Station_ExtData( strLuaDEID, station_code )
|
if ( station_code == nil or station_code == '') then
|
return 1, "wms_station.Get_Station_ExtData 函数中 station_code 不能为空!"
|
end
|
-- 通过盘点站台获取出库终点货位
|
local nRet, station_info
|
nRet, station_info = wms_base.Get_sConst2( strLuaDEID, "机台-"..station_code)
|
if ( nRet ~= 0 ) then
|
return 1, "系统无法获取常量'机台-"..station_code.."'"
|
end
|
|
if ( station_info == '' ) then
|
return 1, "机台-"..station_code.." 常量中没有定义信息, 或没定义这个机台常量!"
|
end
|
local staion_attr = json.decode( station_info )
|
|
return 0, staion_attr
|
end
|
|
-- 获取 ‘机台-XX’ 所在货位
|
function wms_station.Get_Station_Loc( strLuaDEID, station_code )
|
local nRet, station_data
|
nRet, station_data = wms_station.Get_Station_ExtData( strLuaDEID, station_code )
|
if ( nRet ~= 0 ) then return 1, station_data end
|
return 0, station_data.loc_code
|
end
|
|
return wms_station
|