diff --git a/dcs-dtc/New/Presets/V2/Aircrafts/F15E/Systems/MiscSystem.cs b/dcs-dtc/New/Presets/V2/Aircrafts/F15E/Systems/MiscSystem.cs index a29d7d6..b1fdf4b 100644 --- a/dcs-dtc/New/Presets/V2/Aircrafts/F15E/Systems/MiscSystem.cs +++ b/dcs-dtc/New/Presets/V2/Aircrafts/F15E/Systems/MiscSystem.cs @@ -25,6 +25,8 @@ public class MiscSystem public bool TACANToBeUpdated { get; set; } public decimal ILSFrequency { get; set; } public bool ILSToBeUpdated { get; set; } + public bool LaserSettingsToBeUpdated { get; set; } + public int TGPCode { get; set; } public MiscSystem() { @@ -33,8 +35,30 @@ public MiscSystem() TACANChannel = 1; TACANBand = TACANBands.X; ILSFrequency = 108.10M; + TGPCode = 1688; } + public string SetTGPCode(string txt) + { + if (int.TryParse(txt, out int val)) + { + if + ( + txt.Length == 4 && + (txt.Substring(0, 1) == "1" || txt.Substring(0, 1) == "2") && + int.Parse(txt.Substring(1, 1)) >= 1 && + int.Parse(txt.Substring(1, 1)) <= 8 && + int.Parse(txt.Substring(2, 1)) >= 1 && + int.Parse(txt.Substring(2, 1)) <= 8 && + int.Parse(txt.Substring(3, 1)) >= 1 && + int.Parse(txt.Substring(3, 1)) <= 8 + ) + { + TGPCode = val; + } + } + return TGPCode.ToString(); + } public string SetILSFrequency(string txt) { diff --git a/dcs-dtc/New/UI/Aircrafts/F15E/Systems/MiscPage.cs b/dcs-dtc/New/UI/Aircrafts/F15E/Systems/MiscPage.cs index 7656bbc..6a94773 100644 --- a/dcs-dtc/New/UI/Aircrafts/F15E/Systems/MiscPage.cs +++ b/dcs-dtc/New/UI/Aircrafts/F15E/Systems/MiscPage.cs @@ -102,6 +102,27 @@ public MiscPage(F15EPage parent) : base(parent, nameof(parent.Configuration.Misc })); } + //Laser settings + { + left = padding; + top += padding + rowHeight; + this.Controls.Add(DTCCheckBox.Make(left, top, chkWidth, rowHeight, this.misc.LaserSettingsToBeUpdated, (chk) => + { + this.misc.LaserSettingsToBeUpdated = chk.Checked; + this.SavePreset(); + })); + + left += padding + chkWidth; + this.Controls.Add(DTCLabel.Make("TGP Code", left, top, colWidth, rowHeight)); + + left += padding + colWidth; + this.Controls.AddRange(MakeTGPCodeControls(left, top, rowHeight, this.misc.TGPCode.ToString(), (txt) => + { + this.misc.SetTGPCode(txt); + this.SavePreset(); + })); + } + //TACAN { left = padding; diff --git a/dcs-dtc/New/Uploader/Aircrafts/F15E/F15EUploader.cs b/dcs-dtc/New/Uploader/Aircrafts/F15E/F15EUploader.cs index d27ba4e..339def9 100644 --- a/dcs-dtc/New/Uploader/Aircrafts/F15E/F15EUploader.cs +++ b/dcs-dtc/New/Uploader/Aircrafts/F15E/F15EUploader.cs @@ -19,9 +19,9 @@ public void Execute() this.BuildWaypoints(); this.BuildSmartWeapons(); - this.BuildDisplays(); this.BuildRadios(); this.BuildMisc(); + this.BuildDisplays(); Cmd(RestoreCockpitFrontRearState()); diff --git a/dcs-dtc/New/Uploader/Aircrafts/F15E/Systems/Misc.cs b/dcs-dtc/New/Uploader/Aircrafts/F15E/Systems/Misc.cs index cdffb65..ee0080f 100644 --- a/dcs-dtc/New/Uploader/Aircrafts/F15E/Systems/Misc.cs +++ b/dcs-dtc/New/Uploader/Aircrafts/F15E/Systems/Misc.cs @@ -73,6 +73,31 @@ private void BuildMisc() } EndIf(); } + + if (config.Misc.LaserSettingsToBeUpdated) + { + StartIf(InFrontCockpit()); + { + BuildTGPCode(UFC_PILOT, FLMPD); + } + EndIf(); + StartIf(InRearCockpit()); + { + BuildTGPCode(UFC_WSO, RLMPD); + } + EndIf(); + } + } + + private void BuildTGPCode(Device ufc, Device display) + { + NavigateToMainMenu(display); + Cmd(display.GetCommand("PB12")); + Cmd(ufc.GetCommand("CLR")); + Cmd(ufc.GetCommand("CLR")); + Cmd(ufc.GetCommand("MENU")); + Cmd(Digits(ufc, config.Misc.TGPCode.ToString())); + Cmd(display.GetCommand("PB19")); } private void BuildBullseye(Device ufc)