Skip to content

Commit

Permalink
Fixed Rudder Dashed State / Updated Libraries
Browse files Browse the repository at this point in the history
  • Loading branch information
Fragtality committed Jul 2, 2024
1 parent 478f927 commit 9564ce1
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 129 deletions.
2 changes: 1 addition & 1 deletion Build.ps1
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
$projdir = "C:\Users\Fragtality\source\repos\FenixQuartz"
$instBinDir = $projdir + "\Installer\bin\Release\app.publish"
$version = "v1.4.0"
$version = "v1.7.0"

#Create Lock
cd $projdir
Expand Down
Binary file modified FenixQuartz-latest.zip
Binary file not shown.
120 changes: 7 additions & 113 deletions FenixQuartz/ElementManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,8 @@ public class ElementManager : IDisposable

protected Dictionary<string, IPCValue> IPCValues;
protected MemoryScanner Scanner;
//protected FenixInterface.FenixInterface FenixGateway;
public static readonly NumberFormatInfo formatInfo = new CultureInfo("en-US").NumberFormat;

//private bool firstUpdate = true;
//public float lastSwitchBaroStd;
public bool isLightTest = false;
public bool isAltManaged = false;
public bool isHdgManaged = false;
Expand All @@ -30,19 +27,13 @@ public class ElementManager : IDisposable
public bool isModeHdgVs = false;
public bool isVsDashed = false;
public bool fcuIsPowered = false;
//public int speedV1 = 0;
//public int speedVR = 0;
//public int speedV2 = 0;
//public int toFlex = 0;
public bool isBaroStd = false;

//private int appTick = 0;

public ElementManager(List<OutputDefinition> definitions)
{
IPCValues = new();
MemoryValues = new();
//FenixGateway = new();
Definitions = definitions;

//// MEMORY PATTERNS
Expand All @@ -57,22 +48,11 @@ public ElementManager(List<OutputDefinition> definitions)


//// MEMORY VALUES
//ISIS
//AddMemoryValue("isisStd1", MemoryPatterns["ISIS-1"], -0xC7, 1, "bool");
//AddMemoryValue("isisBaro1", MemoryPatterns["ISIS-1"], -0xEC, 8, "double");
//AddMemoryValue("isisStd2", MemoryPatterns["ISIS-1"], -0xDF, 1, "bool");
//AddMemoryValue("isisBaro2", MemoryPatterns["ISIS-1"], -0x104, 8, "double");
//AddMemoryValue("isisStd3", MemoryPatterns["ISIS-2"], -0x3F, 1, "bool");
//AddMemoryValue("isisBaro3", MemoryPatterns["ISIS-2"], -0x64, 8, "double");

//XPDR
//AddMemoryValue("xpdrDisplay", MemoryPatterns["XPDR-1"], -0x110, 2, "int");
//AddMemoryValue("xpdrInput", MemoryPatterns["FCU-2"], +0x714, 2, "int");
//AddMemoryValue("xpdrDigits", MemoryPatterns["FCU-2"], +0x90C, 2, "int");

//RUDDER
AddMemoryValue("rudderDashed1", MemoryPatterns["FCU-2"], -0x4D4C, 1, "bool"); //B_FC_RUDDER_TRIM_DASHED
AddMemoryValue("rudderDashed2", MemoryPatterns["FCU-2"], -0x4D64, 1, "bool");
//AddMemoryValue("rudderDashed1", MemoryPatterns["FCU-2"], -0x4D4C, 1, "bool"); //B_FC_RUDDER_TRIM_DASHED
AddMemoryValue("rudderDashed1", MemoryPatterns["FCU-2"], -0x4D1C, 1, "bool"); //B_FC_RUDDER_TRIM_DASHED
//AddMemoryValue("rudderDashed2", MemoryPatterns["FCU-2"], -0x4D64, 1, "bool");
AddMemoryValue("rudderDashed2", MemoryPatterns["FCU-2"], -0x4D1C, 1, "bool");

//// STRING VALUES - StreamDeck
if (!App.rawValues)
Expand All @@ -93,12 +73,6 @@ public ElementManager(List<OutputDefinition> definitions)
AddIpcLvar(def.ID);
}

//////TO L-Vars
//AddIpcLvar("speedV1");
//AddIpcLvar("speedVR");
//AddIpcLvar("speedV2");
//AddIpcLvar("toFlex");

IPCManager.SimConnect.SubscribeLvar("S_OH_IN_LT_ANN_LT");
IPCManager.SimConnect.SubscribeLvar("B_FCU_POWER");
IPCManager.SimConnect.SubscribeLvar("I_FCU_TRACK_FPA_MODE");
Expand Down Expand Up @@ -203,31 +177,6 @@ public void Dispose()
GC.SuppressFinalize(this);
}

//private bool CheckIsisLocation(string num)
//{
// double baro = MemoryValues[$"isisBaro{num}"].GetValue();
// return baro > 250 && baro < 4000;
//}

//private void CheckMemoryValues()
//{
// if (!(CheckIsisLocation("1") || CheckIsisLocation("2") || CheckIsisLocation("3")))
// {
// Logger.Log(LogLevel.Information, "ElementManager:CheckMemoryValues", $"Memory Locations changed! Rescanning ...");
// System.Threading.Thread.Sleep(500);
// Rescan();
// }
//}

//private void Rescan()
//{
// foreach (var pattern in MemoryPatterns.Values)
// pattern.Location = 0;
// InitializeScanner();
// PrintReport();
// Scanner.UpdateBuffers(MemoryValues);
//}

private void UpdateSimVars()
{
isLightTest = IPCManager.SimConnect.ReadLvar("S_OH_IN_LT_ANN_LT") == 2;
Expand All @@ -242,18 +191,6 @@ private void UpdateSimVars()
isVsDashed = IPCManager.SimConnect.ReadLvar("B_FCU_VERTICALSPEED_DASHED") == 1;
}

//private void UpdateFenixVars()
//{
// if (appTick % 3 == 0)
// {
// _ = int.TryParse(FenixGateway.FenixGetVariable("aircraft.fms.perf.takeOff.v1"), out speedV1);
// _ = int.TryParse(FenixGateway.FenixGetVariable("aircraft.fms.perf.takeOff.v2"), out speedV2);
// _ = int.TryParse(FenixGateway.FenixGetVariable("aircraft.fms.perf.takeOff.vr"), out speedVR);
// _ = int.TryParse(FenixGateway.FenixGetVariable("aircraft.fms.perf.takeOff.flexTemp"), out toFlex);
// }
// appTick++;
//}

public bool GenerateValues()
{
try
Expand All @@ -264,8 +201,6 @@ public bool GenerateValues()
return false;
}
UpdateSimVars();
//UpdateFenixVars();
//CheckMemoryValues();

UpdateFCU();
UpdateISIS();
Expand All @@ -275,15 +210,11 @@ public bool GenerateValues()
UpdateBatteries();
UpdateRudder();
UpdateClock();
//UpdateSpeeds();
UpdateBaro();

if (!App.useLvars)
FSUIPCConnection.Process(App.groupName);

//if (firstUpdate)
// firstUpdate = false;

return true;
}
catch (Exception ex)
Expand Down Expand Up @@ -494,19 +425,6 @@ private void UpdateRawFCU()

private void UpdateISIS()
{
//double baro = MemoryValues["isisBaro1"].GetValue();
//bool std = MemoryValues["isisStd1"].GetValue();
//if (baro < 800 || baro > 1200)
//{
// baro = MemoryValues["isisBaro2"].GetValue();
// std = MemoryValues["isisStd2"].GetValue();
// if (baro < 800 || baro > 1200)
// {
// baro = MemoryValues["isisBaro3"].GetValue();
// std = MemoryValues["isisStd3"].GetValue();
// }
//}

double hpa = IPCManager.SimConnect.ReadLvar("N_MIP_ISFD_BARO_HPA");
double inhg = IPCManager.SimConnect.ReadLvar("N_MIP_ISFD_BARO_INCH");
bool isInch = IPCManager.SimConnect.ReadLvar("B_MIP_ISFD_BARO_INCH") == 1;
Expand All @@ -516,11 +434,12 @@ private void UpdateISIS()
if (!App.rawValues)
{
string result;
if (std)
if (!fcuIsPowered)
result = "";
else if (std)
result = "STD";
else
{
//bool isHpa = IPCManager.SimConnect.ReadLvar("S_FCU_EFIS1_BARO_MODE") == 1;
if (!isInch)
{
baro = Math.Round(hpa, 0);
Expand Down Expand Up @@ -632,7 +551,6 @@ private void UpdateCom(string com)
private void UpdateXpdr()
{
string result;
//int input = MemoryValues["xpdrInput"].GetValue() ?? 0;
int input = (int)IPCManager.SimConnect.ReadLvar("N_FREQ_STANDBY_XPDR_SELECTED");
int disp = (int)IPCManager.SimConnect.ReadLvar("N_FREQ_XPDR_SELECTED");
int digits = (int)IPCManager.SimConnect.ReadLvar("N_PED_XPDR_CHAR_DISPLAYED");
Expand Down Expand Up @@ -774,32 +692,8 @@ private void UpdateClock(string lvar, string strName, string numName)
}
}

//private void UpdateSpeeds()
//{
// IPCValues["speedV1"].SetValue(speedV1);
// IPCValues["speedVR"].SetValue(speedVR);
// IPCValues["speedV2"].SetValue(speedV2);
// IPCValues["toFlex"].SetValue(toFlex);
//}

public void UpdateBaro()
{
//if (firstUpdate)
//{
// lastSwitchBaroStd = IPCManager.SimConnect.ReadLvar("S_FCU_EFIS1_BARO_STD");
// return;
//}

//float switchBaroStd = IPCManager.SimConnect.ReadLvar("S_FCU_EFIS1_BARO_STD");
//if (switchBaroStd != lastSwitchBaroStd)
//{
// if (switchBaroStd > lastSwitchBaroStd)
// isBaroStd = true;
// else
// isBaroStd = false;
// Logger.Log(LogLevel.Information, "ElementManager:UpdateBaro", $"Baro-Std changed: isBaroStd {isBaroStd}");
// lastSwitchBaroStd = switchBaroStd;
//}
isBaroStd = IPCManager.SimConnect.ReadLvar("B_FCU_EFIS1_BARO_STD") == 1;

float pressure = IPCManager.SimConnect.ReadSimVar("KOHLSMAN SETTING MB:1", "Millibars");
Expand Down
10 changes: 5 additions & 5 deletions FenixQuartz/FenixQuartz.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
<SignAssembly>False</SignAssembly>
<AssemblyVersion></AssemblyVersion>
<FileVersion></FileVersion>
<Version>1.6</Version>
<Version>1.7</Version>
<Copyright>Fragtality © 2024</Copyright>
<Authors>Fragtality</Authors>
<UseWPF>True</UseWPF>
Expand All @@ -33,11 +33,11 @@

<ItemGroup>
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.2.2" />
<PackageReference Include="FSUIPCClientDLL" Version="3.3.9" />
<PackageReference Include="H.NotifyIcon.Wpf" Version="2.0.124" />
<PackageReference Include="FSUIPCClientDLL" Version="3.3.11" />
<PackageReference Include="H.NotifyIcon.Wpf" Version="2.0.131" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
<PackageReference Include="Serilog" Version="3.1.1" />
<PackageReference Include="Serilog.Sinks.File" Version="5.0.0" />
<PackageReference Include="Serilog" Version="4.0.0" />
<PackageReference Include="Serilog.Sinks.File" Version="6.0.0" />
<PackageReference Include="System.Configuration.ConfigurationManager" Version="8.0.0" />
</ItemGroup>

Expand Down
Binary file modified FenixQuartz/Microsoft.FlightSimulator.SimConnect.dll
Binary file not shown.
Binary file modified FenixQuartz/SimConnect.dll
Binary file not shown.
Binary file modified Installer/AppPackage.zip
Binary file not shown.
2 changes: 1 addition & 1 deletion Installer/Installer.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.6.0.0</ApplicationVersion>
<ApplicationVersion>1.7.0.0</ApplicationVersion>
<UseApplicationTrust>false</UseApplicationTrust>
<PublishWizardCompleted>true</PublishWizardCompleted>
<BootstrapperEnabled>true</BootstrapperEnabled>
Expand Down
14 changes: 7 additions & 7 deletions Installer/Parameters.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,21 +17,21 @@ public static class Parameters

public static readonly int netMajor = 7;
public static readonly int netMinor = 0;
public static readonly int netPatch = 14;
public static readonly int netPatch = 19;
public static readonly string netVersion = $"{netMajor}.{netMinor}.{netPatch}";
public static readonly string netUrl = "https://download.visualstudio.microsoft.com/download/pr/8f5b0079-2bb4-49cd-874e-0f58703eff6e/7010b5f213a2c436a307eb385dbb16ff/windowsdesktop-runtime-7.0.14-win-x64.exe";
public static readonly string netUrlFile = "windowsdesktop-runtime-7.0.14-win-x64.exe";
public static readonly string netUrl = "https://download.visualstudio.microsoft.com/download/pr/59f35686-7985-4356-9ed6-45bb943bd923/1d04faf7a23c79a5aa5edb6894245baa/windowsdesktop-runtime-7.0.19-win-x64.exe";
public static readonly string netUrlFile = "windowsdesktop-runtime-7.0.19-win-x64.exe";

public static readonly string ipcRegPath = @"HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Windows\CurrentVersion\Uninstall\FSUIPC7";
public static readonly string ipcRegInstallDirValue = "InstallDir";
public static readonly string ipcRegValue = "DisplayVersion";
public static readonly string ipcVersion = "7.3.24";
public static readonly string ipcVersion = "7.4.12";

public static readonly Regex wasmRegex = new Regex("^\\s*\"package_version\":\\s*\"([0-9\\.]+)\"\\s*,\\s*$", RegexOptions.Compiled);
public static readonly string wasmMobiName = "mobiflight-event-module";
public static readonly string wasmMobiVersion = "0.7.1";
public static readonly string wasmUrl = "https://github.com/MobiFlight/MobiFlight-WASM-Module/releases/download/0.7.1/mobiflight-event-module-0.7.1.zip";
public static readonly string wasmUrlFile = "mobiflight-event-module-0.7.1.zip";
public static readonly string wasmMobiVersion = "1.0.1";
public static readonly string wasmUrl = "https://github.com/MobiFlight/MobiFlight-WASM-Module/releases/download/1.0.1/mobiflight-event-module.1.0.1.zip";
public static readonly string wasmUrlFile = "mobiflight-event-module.1.0.1.zip";

public static readonly string msConfigStore = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) + @"\Packages\Microsoft.FlightSimulator_8wekyb3d8bbwe\LocalCache\UserCfg.opt";
public static readonly string msConfigSteam = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + @"\Microsoft Flight Simulator\UserCfg.opt";
Expand Down
4 changes: 2 additions & 2 deletions Installer/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,5 @@
// Sie können alle Werte angeben oder Standardwerte für die Build- und Revisionsnummern verwenden,
// indem Sie "*" wie unten gezeigt eingeben:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.6.0.0")]
[assembly: AssemblyFileVersion("1.6.0.0")]
[assembly: AssemblyVersion("1.7.0.0")]
[assembly: AssemblyFileVersion("1.7.0.0")]

0 comments on commit 9564ce1

Please sign in to comment.