// overhead probe heat // left public void ProbeHeatLeftOn() { if (FSUIPCConnection.ReadLVar("switch_140_73X") != 100) { FSUIPCConnection.SendControlToFS(PMDG_737_NGX_Control.EVT_OH_ICE_PROBE_HEAT_1, ClkL); } }
public void ProbeHeatRightOff() { if (FSUIPCConnection.ReadLVar("switch_141_73X") != 0) { FSUIPCConnection.SendControlToFS(PMDG_737_NGX_Control.EVT_OH_ICE_PROBE_HEAT_2, ClkR); } }
// right forward public void WindowHeatRightForwardOn() { if (FSUIPCConnection.ReadLVar("switch_138_73X") != 100) { FSUIPCConnection.SendControlToFS(PMDG_737_NGX_Control.EVT_OH_ICE_WINDOW_HEAT_3, ClkL); } }
public void WindowHeatRightSideOff() { if (FSUIPCConnection.ReadLVar("switch_139_73X") != 0) { FSUIPCConnection.SendControlToFS(PMDG_737_NGX_Control.EVT_OH_ICE_WINDOW_HEAT_4, ClkR); } }
// engine 1 anti-ice public void Engine1AntiIceOn() { if (FSUIPCConnection.ReadLVar("switch_157_73X") != 100) { FSUIPCConnection.SendControlToFS(PMDG_737_NGX_Control.EVT_OH_ICE_ENGINE_ANTIICE_1, ClkL); } }
public void WindowHeatLeftForwardOff() { if (FSUIPCConnection.ReadLVar("switch_136_73X") != 0) { FSUIPCConnection.SendControlToFS(PMDG_737_NGX_Control.EVT_OH_ICE_WINDOW_HEAT_2, ClkR); } }
public void Eng2FuelCutOff() { if (FSUIPCConnection.ReadLVar("switch_689_73X") != 100) { FSUIPCConnection.SendControlToFS(PMDG_737_NGX_Control.EVT_CONTROL_STAND_ENG2_START_LEVER, ClkL); } }
// Overhead window heat // left side public void WindowHeatLeftSideOn() { if (FSUIPCConnection.ReadLVar("switch_135_73X") != 100) { FSUIPCConnection.SendControlToFS(PMDG_737_NGX_Control.EVT_OH_ICE_WINDOW_HEAT_1, ClkL); } }
public void Engine2AntiIceOff() { if (FSUIPCConnection.ReadLVar("switch_158_73X") != 0) { FSUIPCConnection.SendControlToFS(PMDG_737_NGX_Control.EVT_OH_ICE_ENGINE_ANTIICE_2, ClkR); } }
// Pedestal - Fuel Cut off public void Eng1FuelIdle() { if (FSUIPCConnection.ReadLVar("switch_688_73X") != 0) { FSUIPCConnection.SendControlToFS(PMDG_737_NGX_Control.EVT_CONTROL_STAND_ENG1_START_LEVER, ClkR); } }
public void WingAntiIceOff() { if (FSUIPCConnection.ReadLVar("switch_156_73X") != 0) { FSUIPCConnection.SendControlToFS(PMDG_737_NGX_Control.EVT_OH_ICE_WING_ANTIICE, ClkR); } }
public void ElecBusTransferAuto() { if (FSUIPCConnection.ReadLVar("switch_18_73X") != 100) { if (FSUIPCConnection.ReadLVar("switch_19_73X") != 100) { FSUIPCConnection.SendControlToFS(PMDG_737_NGX_Control.EVT_OH_ELEC_BUS_TRANSFER_GUARD, ClkR); } } }
public void ElecBatteryToggle() { if (FSUIPCConnection.ReadLVar("switch_01_73X") != 100) { ElecBatteryOn(); } else { ElecBatteryOff(); } }
public void ElecStandbyAuto() { if (FSUIPCConnection.ReadLVar("switch_10_73X") != 100) { if (FSUIPCConnection.ReadLVar("switch_11_73X") != 100) { FSUIPCConnection.SendControlToFS(PMDG_737_NGX_Control.EVT_OH_ELEC_STBY_PWR_GUARD, ClkR); } FSUIPCConnection.SendControlToFS(PMDG_737_NGX_Control.EVT_OH_ELEC_STBY_PWR_SWITCH, ClkR); Thread.Sleep(250); FSUIPCConnection.SendControlToFS(PMDG_737_NGX_Control.EVT_OH_ELEC_STBY_PWR_SWITCH, ClkR); } }
private void tmrAntiIce_Tick(object sender, EventArgs e) { Aircraft.pmdg737.RefreshData(); UpdateToggleControl(Aircraft.pmdg737.ICE_WindowHeatSw[0].Value > 0, chkLeftSide); UpdateToggleControl(Aircraft.pmdg737.ICE_WindowHeatSw[1].Value > 0, chkLeftForward); UpdateToggleControl(Aircraft.pmdg737.ICE_WindowHeatSw[2].Value > 0, chkRightForward); UpdateToggleControl(Aircraft.pmdg737.ICE_WindowHeatSw[3].Value > 0, chkRightSide); // the .net library is missing the offsets for the probe heat switches, so we need to get these using l:vars UpdateToggleControl(FSUIPCConnection.ReadLVar("switch_140_73X") == 100, chkProbeHeatLeft); UpdateToggleControl(FSUIPCConnection.ReadLVar("switch_141_73X") == 100, chkProbeHeatRight); UpdateToggleControl(Aircraft.pmdg737.ICE_WingAntiIceSw.Value > 0, chkWingAntiIce); UpdateToggleControl(Aircraft.pmdg737.ICE_EngAntiIceSw[0].Value > 0, chkEng1AntiIce); UpdateToggleControl(Aircraft.pmdg737.ICE_EngAntiIceSw[1].Value > 0, chkEng2AntiIce); }
public void ElecBatteryOff() { // battery switch if (FSUIPCConnection.ReadLVar("switch_01_73X") != 0) { // battery switch guard if (FSUIPCConnection.ReadLVar("switch_02_73X") != 100) { FSUIPCConnection.SendControlToFS(PMDG_737_NGX_Control.EVT_OH_ELEC_BATTERY_GUARD, ClkR); Thread.Sleep(50); } FSUIPCConnection.SendControlToFS(PMDG_737_NGX_Control.EVT_OH_ELEC_BATTERY_SWITCH, ClkR); } }
public override void Process() { try { double result = FSUIPCConnection.ReadLVar(Address); isChanged = currentValue != result; if (isChanged) { currentValue = result; } } catch { Log.Logger.Error($"Exception while Reading LVar {Address}"); } }
private void TimerMain_Tick(Object sender, EventArgs e) { // Call process() to read/ write data to/ from FSUIPC // We do this in a Try/Catch block incase something goes wrong try { FSUIData.DME_SWITCH.Value = (ushort)FSUIPCConnection.ReadLVar("DME_Switch"); FSUIPCConnection.Process(); // 有这句就可以更新数据了 chkAvionicsMaster.IsChecked = (FSUIData.AvionicsMaster.Value > 0); FieldInfo[] myField = typeof(FSUIData).GetFields(BindingFlags.Public | BindingFlags.Static); foreach(var fd in myField) { var obj = fd.GetValue(null); // 获取静态 Field, 否则用 Instance 最为参数 UpdateDeltaObject(fd.Name, GetOffsetValue(obj)); } if (chkShowValues.IsChecked == true) { txtPrevious.Text = JsonConvert.SerializeObject(previousValues, Formatting.Indented); txtJson.Text = JsonConvert.SerializeObject(deltaValues, Formatting.Indented); } else { txtPrevious.Text = ""; txtJson.Text = ""; } if (JsonConvert.SerializeObject(deltaValues, Formatting.None) != "{}") { // 请求更新数据内容 if (chkSendFull.IsChecked == true) wssv.WebSocketServices.Broadcast(JsonConvert.SerializeObject(previousValues, Formatting.None)); else wssv.WebSocketServices.Broadcast(JsonConvert.SerializeObject(deltaValues, Formatting.None)); } } catch(Exception ex) { timerMain.Stop(); txtJson.Text = ex.Message; } }
private void tmrEngines_Tick(object sender, EventArgs e) { Aircraft.pmdg737.RefreshData(); // engine 1 starter utility.UpdateControl(Aircraft.pmdg737.ENG_StartSelector[0].Value == 0, radEng1Grd); utility.UpdateControl(Aircraft.pmdg737.ENG_StartSelector[0].Value == 1, radEng1Auto); utility.UpdateControl(Aircraft.pmdg737.ENG_StartSelector[0].Value == 2, radEng1Cont); utility.UpdateControl(Aircraft.pmdg737.ENG_StartSelector[0].Value == 3, radEng1Flt); // engine 2 starter utility.UpdateControl(Aircraft.pmdg737.ENG_StartSelector[1].Value == 0, radEng2Grd); utility.UpdateControl(Aircraft.pmdg737.ENG_StartSelector[1].Value == 1, radEng2Auto); utility.UpdateControl(Aircraft.pmdg737.ENG_StartSelector[1].Value == 2, radEng2Cont); utility.UpdateControl(Aircraft.pmdg737.ENG_StartSelector[1].Value == 3, radEng2Flt); // engine 1 fuel utility.UpdateControl(FSUIPCConnection.ReadLVar("switch_688_73X") == 100, radEng1CutOff); utility.UpdateControl(FSUIPCConnection.ReadLVar("switch_688_73X") == 0, radEng1Idle); // engine 2 fuel utility.UpdateControl(FSUIPCConnection.ReadLVar("switch_689_73X") == 100, radEng2CutOff); utility.UpdateControl(FSUIPCConnection.ReadLVar("switch_689_73X") == 0, radEng2Idle); }