dofile(LockOn_Options.script_path.."command_defs.lua")
dofile(LockOn_Options.script_path.."utils.lua")
dofile(LockOn_Options.script_path.."Systems/electric_system_api.lua")
dofile(LockOn_Options.script_path.."Systems/device_header.lua")

local helmet 	    = GetSelf()

local update_time_step = 0.02  --每秒50次刷新
make_default_activity(update_time_step)

local params_h = {
    HMD_TYPE = {get_param_handle('HMD_TYPE'),0},--HMD类型,0:HMS,1:NVG
}

function post_initialize()
    helmet:listen_event(CptEvntNames.setupNVG)
    helmet:listen_event(CptEvntNames.setupHMS)

    local birth = LockOn_Options.init_conditions.birth_place
	if birth=="GROUND_HOT" or birth=="AIR_HOT" then
        helmet:performClickableAction(click_cmd.hmdBrt,1)
        helmet:performClickableAction(click_cmd.hmdPower)
    elseif birth=="GROUND_COLD" then
		helmet:performClickableAction(click_cmd.hmdBrt, 0)
    end
end


function SetCommand(command,value)

end

function update()

end

function CockpitEvent(event, val)
    if event == CptEvntNames.setupHMS then
        params_h.HMD_TYPE[2] = 0
    elseif event == CptEvntNames.setupNVG then
        params_h.HMD_TYPE[2] = 1
    end
end