/*@!Encoding:1252*/
// -------------------------------------------------------------------------
// Module: FuelPanel.can
// Interfaces: -
// -------------------------------------------------------------------------
// Example Configuration: Fuel Panel
// -------------------------------------------------------------------------
// Copyright (c) Vector Informatik GmbH. All rights reserved.
// -------------------------------------------------------------------------
/*@!Encoding:1252*/
includes
{
  #include "A429/a429utils.cin"
}

variables
{
  a429Word Pump_Contactor_And_Pushbutton_States sndButtonStates;
}

on start
{
  // initialize all sysvars 
  ResetSysVars();
  
  //send the scheduled messages to the driver
  output(sndButtonStates);
}



on preStop
{
  // initialize all sysvars 
  ResetSysVars();
}



on sysvar_update sysvar::A429::FCMS::OVHD_Fuel_Panel
{
  // update the signals when a button is pressed
  $Main_Pump_1_Pushbutton = @A429::FCMS::OVHD_Fuel_Panel.Panel_Buttons[0];
  $Main_Pump_2_Pushbutton = @A429::FCMS::OVHD_Fuel_Panel.Panel_Buttons[1];
  $Main_Pump_3_Pushbutton = @A429::FCMS::OVHD_Fuel_Panel.Panel_Buttons[2];
  $Main_Pump_4_Pushbutton = @A429::FCMS::OVHD_Fuel_Panel.Panel_Buttons[3];
  $Center_Tank_Left_Aft_Transfer_Pump_PSHBTN = @A429::FCMS::OVHD_Fuel_Panel.Panel_Buttons[4];
  $Center_Tank_Left_Transfer_Pump_Pushbutton = @A429::FCMS::OVHD_Fuel_Panel.Panel_Buttons[5];
  $Trim_Tank_Left_Transfer_Pump_Pushbutton = @A429::FCMS::OVHD_Fuel_Panel.Panel_Buttons[6];;
  $Trim_Tank_Right_Transfer_Pump_Pushbutton = @A429::FCMS::OVHD_Fuel_Panel.Panel_Buttons[7];;
  $Center_Tank_Right_Transfer_Pump_Pushbutton = @A429::FCMS::OVHD_Fuel_Panel.Panel_Buttons[8];
  $Center_Tank_Right_Aft_Transfer_Pump_PSHBTN = @A429::FCMS::OVHD_Fuel_Panel.Panel_Buttons[9];
  $Standby_Pump_1_Pushbutton = @A429::FCMS::OVHD_Fuel_Panel.Panel_Buttons[10];
  $Standby_Pump_2_Pushbutton = @A429::FCMS::OVHD_Fuel_Panel.Panel_Buttons[11];
  $RCT_Transfer_Pump_A_Front_Pushbutton = @A429::FCMS::OVHD_Fuel_Panel.Panel_Buttons[12];
  $RCT_Transfer_Pump_B_Rear_Contactor = @A429::FCMS::OVHD_Fuel_Panel.Panel_Buttons[13];
  $Standby_Pump_3_Pushbutton = @A429::FCMS::OVHD_Fuel_Panel.Panel_Buttons[14];
  $Standby_Pump_4_Pushbutton = @A429::FCMS::OVHD_Fuel_Panel.Panel_Buttons[15];
  $SSM_141 = 0;
}

// set the SSM to No Computed Data (NCD) when no new data is set, after new data is set
on signal_update SSM_141
{
  $SSM_141 = 1;
}

// initialize the button sysvars
void ResetSysVars()
{
  @A429::FCMS::OVHD_Fuel_Panel.Panel_Buttons[0] = 0;
  @A429::FCMS::OVHD_Fuel_Panel.Panel_Buttons[1] = 0;
  @A429::FCMS::OVHD_Fuel_Panel.Panel_Buttons[2] = 0;
  @A429::FCMS::OVHD_Fuel_Panel.Panel_Buttons[3] = 0;
  @A429::FCMS::OVHD_Fuel_Panel.Panel_Buttons[4] = 0;
  @A429::FCMS::OVHD_Fuel_Panel.Panel_Buttons[5] = 0;
  @A429::FCMS::OVHD_Fuel_Panel.Panel_Buttons[6] = 0;
  @A429::FCMS::OVHD_Fuel_Panel.Panel_Buttons[7] = 0;
  @A429::FCMS::OVHD_Fuel_Panel.Panel_Buttons[8] = 0;
  @A429::FCMS::OVHD_Fuel_Panel.Panel_Buttons[9] = 0;
  @A429::FCMS::OVHD_Fuel_Panel.Panel_Buttons[10] = 0;
  @A429::FCMS::OVHD_Fuel_Panel.Panel_Buttons[11] = 0;
  @A429::FCMS::OVHD_Fuel_Panel.Panel_Buttons[12] = 0;
  @A429::FCMS::OVHD_Fuel_Panel.Panel_Buttons[13] = 0;
  @A429::FCMS::OVHD_Fuel_Panel.Panel_Buttons[14] = 0;
  @A429::FCMS::OVHD_Fuel_Panel.Panel_Buttons[15] = 0;
}