-- Copyright (c) 2024 Huawei Technologies Co., Ltd.
-- openUBMC is licensed under Mulan PSL v2.
-- You can use this software according to the terms and conditions of the Mulan PSL v2.
-- You may obtain a copy of Mulan PSL v2 at: http://license.coscl.org.cn/MulanPSL2
-- THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
-- EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
-- MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
-- See the Mulan PSL v2 for more details.

-- 判断光模块8个通道是否符合告警条件，适用发送功率、接收功率、发送偏置电流告警。
local function get_channel_event_status(arr_val, channel_idx, upper, lower)
    if not arr_val or not arr_val[channel_idx] or not upper or not lower then
        return false
    end
    if arr_val[channel_idx] >= 0 and arr_val[channel_idx] < 255 and
        upper >= 0 and upper < 255 and
        lower >= 0 and lower < 255 and
        (arr_val[channel_idx] < lower or arr_val[channel_idx] > upper) then
        return true
    end
    return false
end

local function get_port_info(om_obj)
    local parent = om_obj:get_parent()
    return string.format("Port:%s", parent.ObjectName)
end

local function get_arg_rx_power(om_obj, channel_idx)
    local parent = om_obj:get_parent()
    return string.format("Port %s(Channel %s Rx Power)", parent.ObjectName, channel_idx)
end

local function get_arg_tx_power(om_obj, channel_idx)
    local parent = om_obj:get_parent()
    return string.format("Port %s(Channel %s Tx Power)", parent.ObjectName, channel_idx)
end

local function get_arg_bias(om_obj, channel_idx)
    local parent = om_obj:get_parent()
    return string.format("Port %s(Channel %s)", parent.ObjectName, channel_idx)
end

local function get_arg_bias_val(arr_val, channel_idx)
    if not arr_val or not next(arr_val) then
        return 0
    end
    return string.format("%0.4f", arr_val[channel_idx])
end

local hi1825_om = {
    Events = {
        Event_OpticalModule1Die0TxFault = {
            EventKeyId = "Port.PortOpticalModuleTxFault",
            EventCode = '0x29000021',
            prop_names = {"TxFaultState"},
            trigger_fun = function(om_obj)
                return om_obj.TxFaultState
            end,
            get_args = function(om_obj)
                return table.pack(om_obj.ObjectName, get_port_info(om_obj))
            end,
            identify_arg_index = {1}
        },
        Event_OpticalModule1Die0_VoltageAlarm = {
            EventKeyId = "Port.PortOpticalModuleVoltageAlarm",
            EventCode = '0x2900000F',
            prop_names = {"SupplyVoltage", "VoltageLowerThresholdCritical", "VoltageUpperThresholdCritical"},
            trigger_fun = function(om_obj)
                if om_obj.SupplyVoltage >= 255 or om_obj.SupplyVoltage == 0 then
                    return false
                end
                if om_obj.VoltageLowerThresholdCritical ~= 65535 and om_obj.VoltageLowerThresholdCritical ~= 0 and
                    om_obj.SupplyVoltage < om_obj.VoltageLowerThresholdCritical then
                    return true
                end
                if om_obj.VoltageUpperThresholdCritical ~= 65535 and om_obj.VoltageUpperThresholdCritical ~= 0 and
                    om_obj.SupplyVoltage > om_obj.VoltageUpperThresholdCritical then
                    return true
                end
                return false
            end,
            get_args = function(om_obj)
                return table.pack(om_obj.ObjectName, '', get_port_info(om_obj), om_obj.SupplyVoltage)
            end,
            identify_arg_index = {1}
        },
        Event_OpticalModule1Die0_RxLoss = {
            EventKeyId = "Port.PortOpticalModuleSignalAlarm",
            EventCode = '0x29000013',
            prop_names = {"RxLoS", "LinkStatusNumeric"},
            trigger_fun = function(om_obj)
                if om_obj.RxLoS ~= 0 and om_obj:get_parent().LinkStatusNumeric == 1 then
                    return true
                end
                return false
            end,
            get_args = function(om_obj)
                return table.pack(om_obj.ObjectName, '', get_port_info(om_obj), 'Rx')
            end,
            identify_arg_index = {1, 4} --第4个参数作为区分
        },
        Event_OpticalModule1Die0_TxLoss = {
            EventKeyId = "Port.PortOpticalModuleSignalAlarm",
            EventCode = '0x29000013',
            prop_names = {"Presence", "TxLoS"},
            trigger_fun = function(om_obj)
                if om_obj.Presence == 0 then
                    return false
                end
                if om_obj.TxLoS ~= 0 then
                    return true
                end
                return false
            end,
            get_args = function(om_obj)
                return table.pack(om_obj.ObjectName, '', get_port_info(om_obj), 'Tx')
            end,
            identify_arg_index = {1, 4} --第4个参数作为区分
        },
        Event_OpticalModule1Die0_1_RxPowerAlarm = {
            EventKeyId = "Port.PortOpticalModulePowerAlarm",
            EventCode = '0x29000017',
            prop_names = {"RXInputPowerMilliWatts", "RXUpperThresholdCritical", "RXLowerThresholdCritical"},
            trigger_fun = function(om_obj)
                if om_obj:get_parent().LinkStatus == 'Disconnected' then
                    return false
                end
                return get_channel_event_status(om_obj.RXInputPowerMilliWatts, 1, om_obj.RXUpperThresholdCritical,
                    om_obj.RXLowerThresholdCritical)
            end,
            get_args = function(om_obj)
                return table.pack(om_obj.ObjectName, om_obj.SilkText, get_arg_rx_power(om_obj, 1))
            end,
            identify_arg_index = {1, 3} --第3个参数作为区分
        },
        Event_OpticalModule1Die0_2_RxPowerAlarm = {
            EventKeyId = "Port.PortOpticalModulePowerAlarm",
            EventCode = '0x29000017',
            prop_names = {"RXInputPowerMilliWatts", "RXUpperThresholdCritical", "RXLowerThresholdCritical"},
            trigger_fun = function(om_obj)
                if om_obj:get_parent().LinkStatus == 'Disconnected' then
                    return false
                end
                return get_channel_event_status(om_obj.RXInputPowerMilliWatts, 2, om_obj.RXUpperThresholdCritical,
                    om_obj.RXLowerThresholdCritical)
            end,
            get_args = function(om_obj)
                return table.pack(om_obj.ObjectName, om_obj.SilkText, get_arg_rx_power(om_obj, 2))
            end,
            identify_arg_index = {1, 3} --第3个参数作为区分
        },
        Event_OpticalModule1Die0_3_RxPowerAlarm = {
            EventKeyId = "Port.PortOpticalModulePowerAlarm",
            EventCode = '0x29000017',
            prop_names = {"RXInputPowerMilliWatts", "RXUpperThresholdCritical", "RXLowerThresholdCritical"},
            trigger_fun = function(om_obj)
                if om_obj:get_parent().LinkStatus == 'Disconnected' then
                    return false
                end
                return get_channel_event_status(om_obj.RXInputPowerMilliWatts, 3, om_obj.RXUpperThresholdCritical,
                    om_obj.RXLowerThresholdCritical)
            end,
            get_args = function(om_obj)
                return table.pack(om_obj.ObjectName, om_obj.SilkText, get_arg_rx_power(om_obj, 3))
            end,
            identify_arg_index = {1, 3} --第3个参数作为区分
        },
        Event_OpticalModule1Die0_4_RxPowerAlarm = {
            EventKeyId = "Port.PortOpticalModulePowerAlarm",
            EventCode = '0x29000017',
            prop_names = {"RXInputPowerMilliWatts", "RXUpperThresholdCritical", "RXLowerThresholdCritical"},
            trigger_fun = function(om_obj)
                if om_obj:get_parent().LinkStatus == 'Disconnected' then
                    return false
                end
                return get_channel_event_status(om_obj.RXInputPowerMilliWatts, 4, om_obj.RXUpperThresholdCritical,
                    om_obj.RXLowerThresholdCritical)
            end,
            get_args = function(om_obj)
                return table.pack(om_obj.ObjectName, om_obj.SilkText, get_arg_rx_power(om_obj, 4))
            end,
            identify_arg_index = {1, 3} --第3个参数作为区分
        },
        Event_OpticalModule1Die0_5_RxPowerAlarm = {
            EventKeyId = "Port.PortOpticalModulePowerAlarm",
            EventCode = '0x29000017',
            prop_names = {"RXInputPowerMilliWatts", "RXUpperThresholdCritical", "RXLowerThresholdCritical"},
            trigger_fun = function(om_obj)
                if om_obj:get_parent().LinkStatus == 'Disconnected' then
                    return false
                end
                return get_channel_event_status(om_obj.RXInputPowerMilliWatts, 5, om_obj.RXUpperThresholdCritical,
                    om_obj.RXLowerThresholdCritical)
            end,
            get_args = function(om_obj)
                return table.pack(om_obj.ObjectName, om_obj.SilkText, get_arg_rx_power(om_obj, 5))
            end,
            identify_arg_index = {1, 3} --第3个参数作为区分
        },
        Event_OpticalModule1Die0_6_RxPowerAlarm = {
            EventKeyId = "Port.PortOpticalModulePowerAlarm",
            EventCode = '0x29000017',
            prop_names = {"RXInputPowerMilliWatts", "RXUpperThresholdCritical", "RXLowerThresholdCritical"},
            trigger_fun = function(om_obj)
                if om_obj:get_parent().LinkStatus == 'Disconnected' then
                    return false
                end
                return get_channel_event_status(om_obj.RXInputPowerMilliWatts, 6, om_obj.RXUpperThresholdCritical,
                    om_obj.RXLowerThresholdCritical)
            end,
            get_args = function(om_obj)
                return table.pack(om_obj.ObjectName,
                    om_obj.SilkText, get_arg_rx_power(om_obj, 6))
            end,
            identify_arg_index = {1, 3} --第3个参数作为区分
        },
        Event_OpticalModule1Die0_7_RxPowerAlarm = {
            EventKeyId = "Port.PortOpticalModulePowerAlarm",
            EventCode = '0x29000017',
            prop_names = {"RXInputPowerMilliWatts", "RXUpperThresholdCritical", "RXLowerThresholdCritical"},
            trigger_fun = function(om_obj)
                if om_obj:get_parent().LinkStatus == 'Disconnected' then
                    return false
                end
                return get_channel_event_status(om_obj.RXInputPowerMilliWatts, 7, om_obj.RXUpperThresholdCritical,
                    om_obj.RXLowerThresholdCritical)
            end,
            get_args = function(om_obj)
                return table.pack(om_obj.ObjectName, om_obj.SilkText, get_arg_rx_power(om_obj, 7))
            end,
            identify_arg_index = {1, 3} --第3个参数作为区分
        },
        Event_OpticalModule1Die0_8_RxPowerAlarm = {
            EventKeyId = "Port.PortOpticalModulePowerAlarm",
            EventCode = '0x29000017',
            prop_names = {"RXInputPowerMilliWatts", "RXUpperThresholdCritical", "RXLowerThresholdCritical"},
            trigger_fun = function(om_obj)
                if om_obj:get_parent().LinkStatus == 'Disconnected' then
                    return false
                end
                return get_channel_event_status(om_obj.RXInputPowerMilliWatts, 8, om_obj.RXUpperThresholdCritical,
                    om_obj.RXLowerThresholdCritical)
            end,
            get_args = function(om_obj)
                return table.pack(om_obj.ObjectName, om_obj.SilkText, get_arg_rx_power(om_obj, 8))
            end,
            identify_arg_index = {1, 3} --第3个参数作为区分
        },

        Event_OpticalModule1Die0_1_TxPowerAlarm = {
            EventKeyId = "Port.PortOpticalModulePowerAlarm",
            EventCode = '0x29000017',
            prop_names = {"TXOutputPowerMilliWatts", "Power_TXUpperThresholdCritical",
                "Power_TXLowerThresholdCritical"},
            trigger_fun = function(om_obj)
                return get_channel_event_status(om_obj.TXOutputPowerMilliWatts, 1,
                    om_obj.Power_TXUpperThresholdCritical, om_obj.Power_TXLowerThresholdCritical)
            end,
            get_args = function(om_obj)
                return table.pack(om_obj.ObjectName, om_obj.SilkText, get_arg_tx_power(om_obj, 1))
            end,
            identify_arg_index = {1, 3} --第3个参数作为区分
        },
        Event_OpticalModule1Die0_2_TxPowerAlarm = {
            EventKeyId = "Port.PortOpticalModulePowerAlarm",
            EventCode = '0x29000017',
            prop_names = {"TXOutputPowerMilliWatts", "Power_TXUpperThresholdCritical",
                "Power_TXLowerThresholdCritical"},
            trigger_fun = function(om_obj)
                return get_channel_event_status(om_obj.TXOutputPowerMilliWatts, 2,
                    om_obj.Power_TXUpperThresholdCritical, om_obj.Power_TXLowerThresholdCritical)
            end,
            get_args = function(om_obj)
                return table.pack(om_obj.ObjectName, om_obj.SilkText, get_arg_tx_power(om_obj, 2))
            end,
            identify_arg_index = {1, 3} --第3个参数作为区分
        },
        Event_OpticalModule1Die0_3_TxPowerAlarm = {
            EventKeyId = "Port.PortOpticalModulePowerAlarm",
            EventCode = '0x29000017',
            prop_names = {"TXOutputPowerMilliWatts", "Power_TXUpperThresholdCritical",
                "Power_TXLowerThresholdCritical"},
            trigger_fun = function(om_obj)
                return get_channel_event_status(om_obj.TXOutputPowerMilliWatts, 3,
                    om_obj.Power_TXUpperThresholdCritical, om_obj.Power_TXLowerThresholdCritical)
            end,
            get_args = function(om_obj)
                return table.pack(om_obj.ObjectName, om_obj.SilkText, get_arg_tx_power(om_obj, 3))
            end,
            identify_arg_index = {1, 3} --第3个参数作为区分
        },
        Event_OpticalModule1Die0_4_TxPowerAlarm = {
            EventKeyId = "Port.PortOpticalModulePowerAlarm",
            EventCode = '0x29000017',
            prop_names = {"TXOutputPowerMilliWatts", "Power_TXUpperThresholdCritical",
                "Power_TXLowerThresholdCritical"},
            trigger_fun = function(om_obj)
                return get_channel_event_status(om_obj.TXOutputPowerMilliWatts, 4,
                    om_obj.Power_TXUpperThresholdCritical, om_obj.Power_TXLowerThresholdCritical)
            end,
            get_args = function(om_obj)
                return table.pack(om_obj.ObjectName, om_obj.SilkText, get_arg_tx_power(om_obj, 4))
            end,
            identify_arg_index = {1, 3} --第3个参数作为区分
        },
        Event_OpticalModule1Die0_5_TxPowerAlarm = {
            EventKeyId = "Port.PortOpticalModulePowerAlarm",
            EventCode = '0x29000017',
            prop_names = {"TXOutputPowerMilliWatts", "Power_TXUpperThresholdCritical",
                "Power_TXLowerThresholdCritical"},
            trigger_fun = function(om_obj)
                return get_channel_event_status(om_obj.TXOutputPowerMilliWatts, 5,
                    om_obj.Power_TXUpperThresholdCritical, om_obj.Power_TXLowerThresholdCritical)
            end,
            get_args = function(om_obj)
                return table.pack(om_obj.ObjectName, om_obj.SilkText, get_arg_tx_power(om_obj, 5))
            end,
            identify_arg_index = {1, 3} --第3个参数作为区分
        },
        Event_OpticalModule1Die0_6_TxPowerAlarm = {
            EventKeyId = "Port.PortOpticalModulePowerAlarm",
            EventCode = '0x29000017',
            prop_names = {"TXOutputPowerMilliWatts", "Power_TXUpperThresholdCritical",
                "Power_TXLowerThresholdCritical"},
            trigger_fun = function(om_obj)
                return get_channel_event_status(om_obj.TXOutputPowerMilliWatts, 6,
                    om_obj.Power_TXUpperThresholdCritical, om_obj.Power_TXLowerThresholdCritical)
            end,
            get_args = function(om_obj)
                return table.pack(om_obj.ObjectName, om_obj.SilkText, get_arg_tx_power(om_obj, 6))
            end,
            identify_arg_index = {1, 3} --第3个参数作为区分
        },
        Event_OpticalModule1Die0_7_TxPowerAlarm = {
            EventKeyId = "Port.PortOpticalModulePowerAlarm",
            EventCode = '0x29000017',
            prop_names = {"TXOutputPowerMilliWatts", "Power_TXUpperThresholdCritical",
                "Power_TXLowerThresholdCritical"},
            trigger_fun = function(om_obj)
                return get_channel_event_status(om_obj.TXOutputPowerMilliWatts, 7,
                    om_obj.Power_TXUpperThresholdCritical, om_obj.Power_TXLowerThresholdCritical)
            end,
            get_args = function(om_obj)
                return table.pack(om_obj.ObjectName, om_obj.SilkText, get_arg_tx_power(om_obj, 7))
            end,
            identify_arg_index = {1, 3} --第3个参数作为区分
        },
        Event_OpticalModule1Die0_8_TxPowerAlarm = {
            EventKeyId = "Port.PortOpticalModulePowerAlarm",
            EventCode = '0x29000017',
            prop_names = {"TXOutputPowerMilliWatts", "Power_TXUpperThresholdCritical",
                "Power_TXLowerThresholdCritical"},
            trigger_fun = function(om_obj)
                return get_channel_event_status(om_obj.TXOutputPowerMilliWatts, 8,
                    om_obj.Power_TXUpperThresholdCritical, om_obj.Power_TXLowerThresholdCritical)
            end,
            get_args = function(om_obj)
                return table.pack(om_obj.ObjectName, om_obj.SilkText, get_arg_tx_power(om_obj, 8))
            end,
            identify_arg_index = {1, 3} --第3个参数作为区分
        },

        Event_OpticalModule1Die0_1_TxBiasAlarm = {
            EventKeyId = "Port.PortOpticalModuleCurrentAlarm",
            EventCode = '0x29000011',
            prop_names = {"TXBiasCurrentMilliAmps", "BC_TXUpperThresholdCritical", "BC_TXLowerThresholdCritical"},
            trigger_fun = function(om_obj)
                return get_channel_event_status(om_obj.TXBiasCurrentMilliAmps, 1, om_obj.BC_TXUpperThresholdCritical,
                    om_obj.BC_TXLowerThresholdCritical)
            end,
            get_args = function(om_obj)
                return table.pack(om_obj.ObjectName,
                    om_obj.SilkText, get_arg_bias(om_obj, 1),
                    get_arg_bias_val(om_obj.TXBiasCurrentMilliAmps, 1))
            end,
            identify_arg_index = {1, 3} --第3个参数作为区分
        },
        Event_OpticalModule1Die0_2_TxBiasAlarm = {
            EventKeyId = "Port.PortOpticalModuleCurrentAlarm",
            EventCode = '0x29000011',
            prop_names = {"TXBiasCurrentMilliAmps", "BC_TXUpperThresholdCritical", "BC_TXLowerThresholdCritical"},
            trigger_fun = function(om_obj)
                return get_channel_event_status(om_obj.TXBiasCurrentMilliAmps, 2, om_obj.BC_TXUpperThresholdCritical,
                    om_obj.BC_TXLowerThresholdCritical)
            end,
            get_args = function(om_obj)
                return table.pack(om_obj.ObjectName, om_obj.SilkText,
                    get_arg_bias(om_obj, 2),
                    get_arg_bias_val(om_obj.TXBiasCurrentMilliAmps, 2))
            end,
            identify_arg_index = {1, 3} --第3个参数作为区分
        },
        Event_OpticalModule1Die0_3_TxBiasAlarm = {
            EventKeyId = "Port.PortOpticalModuleCurrentAlarm",
            EventCode = '0x29000011',
            prop_names = {"TXBiasCurrentMilliAmps", "BC_TXUpperThresholdCritical", "BC_TXLowerThresholdCritical"},
            trigger_fun = function(om_obj)
                return get_channel_event_status(om_obj.TXBiasCurrentMilliAmps, 3, om_obj.BC_TXUpperThresholdCritical,
                    om_obj.BC_TXLowerThresholdCritical)
            end,
            get_args = function(om_obj)
                return table.pack(om_obj.ObjectName, om_obj.SilkText,
                    get_arg_bias(om_obj, 3),
                    get_arg_bias_val(om_obj.TXBiasCurrentMilliAmps, 3))
            end,
            identify_arg_index = {1, 3} --第3个参数作为区分
        },
        Event_OpticalModule1Die0_4_TxBiasAlarm = {
            EventKeyId = "Port.PortOpticalModuleCurrentAlarm",
            EventCode = '0x29000011',
            prop_names = {"TXBiasCurrentMilliAmps", "BC_TXUpperThresholdCritical", "BC_TXLowerThresholdCritical"},
            trigger_fun = function(om_obj)
                return get_channel_event_status(om_obj.TXBiasCurrentMilliAmps, 4, om_obj.BC_TXUpperThresholdCritical,
                    om_obj.BC_TXLowerThresholdCritical)
            end,
            get_args = function(om_obj)
                return table.pack(om_obj.ObjectName, om_obj.SilkText,
                    get_arg_bias(om_obj, 4),
                    get_arg_bias_val(om_obj.TXBiasCurrentMilliAmps, 4))
            end,
            identify_arg_index = {1, 3} --第3个参数作为区分
        },
        Event_OpticalModule1Die0_5_TxBiasAlarm = {
            EventKeyId = "Port.PortOpticalModuleCurrentAlarm",
            EventCode = '0x29000011',
            prop_names = {"TXBiasCurrentMilliAmps", "BC_TXUpperThresholdCritical", "BC_TXLowerThresholdCritical"},
            trigger_fun = function(om_obj)
                return get_channel_event_status(om_obj.TXBiasCurrentMilliAmps, 5, om_obj.BC_TXUpperThresholdCritical,
                    om_obj.BC_TXLowerThresholdCritical)
            end,
            get_args = function(om_obj)
                return table.pack(om_obj.ObjectName, om_obj.SilkText,
                    get_arg_bias(om_obj, 5),
                    get_arg_bias_val(om_obj.TXBiasCurrentMilliAmps, 5))
            end,
            identify_arg_index = {1, 3} --第3个参数作为区分
        },
        Event_OpticalModule1Die0_6_TxBiasAlarm = {
            EventKeyId = "Port.PortOpticalModuleCurrentAlarm",
            EventCode = '0x29000011',
            prop_names = {"TXBiasCurrentMilliAmps", "BC_TXUpperThresholdCritical", "BC_TXLowerThresholdCritical"},
            trigger_fun = function(om_obj)
                return get_channel_event_status(om_obj.TXBiasCurrentMilliAmps, 6, om_obj.BC_TXUpperThresholdCritical,
                    om_obj.BC_TXLowerThresholdCritical)
            end,
            get_args = function(om_obj)
                return table.pack(om_obj.ObjectName, om_obj.SilkText,
                    get_arg_bias(om_obj, 6),
                    get_arg_bias_val(om_obj.TXBiasCurrentMilliAmps, 6))
            end,
            identify_arg_index = {1, 3} --第3个参数作为区分
        },
        Event_OpticalModule1Die0_7_TxBiasAlarm = {
            EventKeyId = "Port.PortOpticalModuleCurrentAlarm",
            EventCode = '0x29000011',
            prop_names = {"TXBiasCurrentMilliAmps", "BC_TXUpperThresholdCritical", "BC_TXLowerThresholdCritical"},
            trigger_fun = function(om_obj)
                return get_channel_event_status(om_obj.TXBiasCurrentMilliAmps, 7, om_obj.BC_TXUpperThresholdCritical,
                    om_obj.BC_TXLowerThresholdCritical)
            end,
            get_args = function(om_obj)
                return table.pack(om_obj.ObjectName, om_obj.SilkText,
                    get_arg_bias(om_obj, 7),
                    get_arg_bias_val(om_obj.TXBiasCurrentMilliAmps, 7))
            end,
            identify_arg_index = {1, 3} --第3个参数作为区分
        },
        Event_OpticalModule1Die0_8_TxBiasAlarm = {
            EventKeyId = "Port.PortOpticalModuleCurrentAlarm",
            EventCode = '0x29000011',
            prop_names = {"TXBiasCurrentMilliAmps", "BC_TXUpperThresholdCritical", "BC_TXLowerThresholdCritical"},
            trigger_fun = function(om_obj)
                return get_channel_event_status(om_obj.TXBiasCurrentMilliAmps, 8, om_obj.BC_TXUpperThresholdCritical,
                    om_obj.BC_TXLowerThresholdCritical)
            end,
            get_args = function(om_obj)
                return table.pack(om_obj.ObjectName, om_obj.SilkText,
                    get_arg_bias(om_obj, 8),
                    get_arg_bias_val(om_obj.TXBiasCurrentMilliAmps, 8))
            end,
            identify_arg_index = {1, 3} --第3个参数作为区分
        }
    }
}

hi1825_om.mock_get_port_info = get_port_info

return hi1825_om