Skip to content

Commit

Permalink
- Fix AH64 double press on KU too slow
Browse files Browse the repository at this point in the history
- Makes Artillery be GS/GT for AH64 Unit Imports
- Makes C-RAM be G2 for AH64 Unit Imports
- Fixes Gepard, will now be GP for AH64 Unit Imports
- Fixes Vulcan, will now be VU for AH64 Unit Imports
- Fixes Debug message about unit importing in lua code not in DEBUGGING condition, may cause very large log files for big missions
- Adds todo for AH64 DTC
- Bump Version
  • Loading branch information
FalcoGer committed Jan 5, 2024
1 parent ffcd8c9 commit 88e568d
Show file tree
Hide file tree
Showing 6 changed files with 91 additions and 14 deletions.
11 changes: 10 additions & 1 deletion CoordinateConverter/DCS/Aircraft/AH64.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ public override List<DCSCommand> GetPointActions(CoordinateDataEntry coordinate)
}
}

// DebugCommandList commands = new DebugCommandList
List<DCSCommand> commands = new List<DCSCommand>
{
// press ADD
Expand Down Expand Up @@ -176,6 +177,7 @@ public override List<DCSCommand> GetPointActions(CoordinateDataEntry coordinate)
private List<DCSCommand> GetCommandsForKUText(string text, bool clearFirst)
{
List<DCSCommand> commands = new List<DCSCommand>();
// DebugCommandList commands = new DebugCommandList();
if (text == null)
{
return commands;
Expand All @@ -186,6 +188,7 @@ private List<DCSCommand> GetCommandsForKUText(string text, bool clearFirst)
commands.Add(new DCSCommand((int)(IsPilot ? EDeviceCode.PLT_KU : EDeviceCode.CPG_KU), (int)EKeyCode.KU_CLR));
}
// type the text
EKeyCode? prevKeyCode = null;
foreach (char ch in text.ToUpper())
{
EKeyCode? keyCode = null;
Expand Down Expand Up @@ -226,7 +229,13 @@ private List<DCSCommand> GetCommandsForKUText(string text, bool clearFirst)
}
if (keyCode != null)
{
// Double presses of the same button need to have the be slower, otherwise they don't register.
if (prevKeyCode == keyCode && prevKeyCode != null && commands.Count > 0)
{
commands.Last().Delay = 250;
}
commands.Add(new DCSCommand((int)(IsPilot ? EDeviceCode.PLT_KU : EDeviceCode.CPG_KU), (int)keyCode.Value));
prevKeyCode = keyCode;
}
}
return commands;
Expand Down Expand Up @@ -311,7 +320,7 @@ public int ClearPoints(EPointType pointType, int startIdx, int endIdx)
List<DCSCommand> commands = new List<DCSCommand>();
int deviceId = IsPilot ? (int)EDeviceCode.PLT_RMFD : (int)EDeviceCode.CPG_RMFD;

for (int pointIdx = startIdx - ((pointType == EPointType.ControlMeasure) ? 50 : 0); pointIdx <= endIdx - ((pointType == EPointType.ControlMeasure) ? 50 : 0); pointIdx++)
for (int pointIdx = startIdx; pointIdx <= endIdx ; pointIdx++)
{
commands.Add(new DCSCommand(deviceId, (int)EKeyCode.RMFD_TSD)); // Reset to TSD after every point, to avoid weirdness.
commands.Add(new DCSCommand(deviceId, (int)EKeyCode.RMFD_B6)); // Point
Expand Down
48 changes: 42 additions & 6 deletions CoordinateConverter/DCS/Aircraft/AH64SpecificData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,42 @@ public AH64SpecificData(DCSUnit unit)

switch (unit.TypeName)
{
case "rapier_fsa_launcher":
Ident = AH64.EPointIdent.TG_RA;
case "Grad_FDDM": // BMP-2, Fire Director for artillery
case "MLRS FDDM": // HUMVEE w/ MG, Fire Director for artillery
Ident = AH64.EPointIdent.TG_GU;
return;
case "M-109":
case "SAU 2-C9": // 2S9
case "SAU Akatsia": // 2S3
case "SAU Gvozdika": // 2S1
case "SAU Msta": // 2S19
case "SpGH_Dana":
case "PLZ05":
case "T155_Firtina":
// Self propelled gun
Ident = AH64.EPointIdent.TG_GS;
return;
case "Grad-URAL": // BM-21
case "HL_B8M1": // Rocket pod strapped to car
case "MLRS": // M270
case "Smerch":
case "Smerch_HE":
case "tt_B8M1": // Rocket pod strapped to car
case "Uragan_BM-27": // BM-27 (Like Smerch, diffrent vehicle)
// MLRS
// has no separate ident
Ident = AH64.EPointIdent.TG_GS;
return;
case "2B11 mortar":
Ident = AH64.EPointIdent.TG_TG;
// Towed Gun
Ident = AH64.EPointIdent.TG_GT;
return;
case "rapier_fsa_launcher":
Ident = AH64.EPointIdent.TG_RA;
return;
case "NASAMS_LN_B":
case "NASAMS_LN_C":
Ident = AH64.EPointIdent.TG_G1;
Ident = AH64.EPointIdent.TG_G1; // There isn't anything better...
return;
case "Fire Can radar":
case "SON_9":
Expand Down Expand Up @@ -157,16 +184,25 @@ public AH64SpecificData(DCSUnit unit)
return;
case "flak18":
case "bofors40":
case "Vulcan":
case "S-60_Type59_Artillery":
case "Gepard":
case "KS-19":
case "M6 Linebacker":
case "PGL_625":
case "2S38":
case "ZSU_57_2":
case "tt_ZU-23":
case "HL_ZU-23":
Ident = AH64.EPointIdent.TG_AA;
return;
case "Gepard":
Ident = AH64.EPointIdent.TG_GP;
return;
case "Vulcan":
Ident = AH64.EPointIdent.TG_VU;
return;
case "HEMTT_C-RAM_Phalanx":
Ident = AH64.EPointIdent.TG_G2; // There isn't anything better...
return;
case "M1097 Avenger":
case "Stinger comm dsr":
case "Stinger comm":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -369,7 +369,9 @@ function LuaExportAfterNextFrame()
else
unitDataStr = unitDataStr .. "]}"
end
log.write(LOG_MODNAME, log.INFO, "sending unitDataStr: \n" ..unitDataStr .. "\n")
if DEBUGGING then
log.write(LOG_MODNAME, log.INFO, "sending unitDataStr: \n" ..unitDataStr .. "\n")
end
client:send(unitDataStr)
end
end
Expand Down
2 changes: 1 addition & 1 deletion CoordinateConverter/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace CoordinateConverter
/// <seealso cref="Form" />
public partial class MainForm : Form
{
private readonly GitHub.Version VERSION = new GitHub.Version(0, 5, 16);
private readonly GitHub.Version VERSION = new GitHub.Version(0, 5, 18);

private readonly Color ERROR_COLOR = Color.Pink;
private readonly Color DCS_ERROR_COLOR = Color.Yellow;
Expand Down
38 changes: 34 additions & 4 deletions CoordinateConverter/todo.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
Unit list:
- Filter by unit type/name

FIXME:
- Fix AH64 point deleter with CM starting with 1 instead of 51?

Add support for remote (DCS) hosts
- auto switch reticle to never if ip is not localhost, because that makes no sense.

Expand Down Expand Up @@ -32,7 +29,7 @@ When saving/loading, update the default location and file name
- add a save option that just overwrites the last file loaded/saved


Add support for selection instead of camera position when something is selected
Add support for F10 map selection selection instead of camera position when something is selected
- add option for auto listing any new unit that was clicked
- alternatively use LoGetWorldObjects("units") (Exports.lua:L426)
- calculate every unit's distance from the camera ground position, if within a margin, add that unit if it isn't already in the list
Expand All @@ -57,6 +54,39 @@ Add aircraft support (https://github.com/aronCiucu/DCSTheWay/tree/main/src/modul
- general
- determine keycodes with `Eagle Dynamics\DCS World OpenBeta\Mods\aircraft\<type>\Cockpit\Scripts\clickabledata.lua`
- determine device ids with `Eagle Dynamics\DCS World OpenBeta\Mods\aircraft\<type>\Cockpit\Scripts\devices.lua`
- AH64
- DTC
- When tuning intervals fixed, Set FM Radio Interval to 0.025 instead of 0.005
- Load, Save
- Send
- Turn off ASE autopage temporarily for working on RMFD?
- Use left MFD and hope pilot doesn't cause engine autopage?
- Radio Presets
- All settings default to not overwrite with checkbox
- Name
- Make sure they are valid
- Frequencies
- Crypto settings?
- Make sure they're valid
- Primary setting (radio select)
- Cryptop options?
- Net
- Each slot enable/disable xfer
- Delete/clear option
- C/S validity check
- ID validity check
- Enable DL protocol in MODEM settings (L1-L8 only)
- Tune (using com page)
- IFF/XPNDR
- Mode 3 (Validity check)
- Mode 1, 2, etc
- Datalink Own Info
- ID (Validity check)
- C/S (Validity check)
- ASE
- Chaff program
- Autopage setting

- F18
- fetch if precise is selected (https://www.reddit.com/r/hoggit/comments/2ao01d/so_apparently_there_was_a_way_to_get_the_text_of/)
- might be impossible, this is 9 years old
Expand Down
2 changes: 1 addition & 1 deletion Installer/Installer.wixproj
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<Project Sdk="WixToolset.Sdk/4.0.2">
<PropertyGroup>
<DefineConstants>Version=0.5.16</DefineConstants>
<DefineConstants>Version=0.5.18</DefineConstants>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="WixToolset.Netfx.wixext" Version="4.0.2" />
Expand Down

0 comments on commit 88e568d

Please sign in to comment.