Skip to content

Commit

Permalink
removed simtype virtualnano
Browse files Browse the repository at this point in the history
  • Loading branch information
SK21 committed Dec 1, 2024
1 parent ecd1fa8 commit d821050
Show file tree
Hide file tree
Showing 24 changed files with 30 additions and 65 deletions.
17 changes: 5 additions & 12 deletions RateAppSource/RateController/Classes/clsProduct.cs
Original file line number Diff line number Diff line change
Expand Up @@ -908,17 +908,10 @@ public bool SerialFromAruduino(string[] words, bool RealNano = true)
bool Result = false; // return true if there is good comm
try
{
if (RealNano && mf.SimMode == SimType.VirtualNano)
if (RateSensor.ParseStringData(words))
{
// block PGN32400 from real nano when simulation is with virtual nano
}
else
{
if (RateSensor.ParseStringData(words))
{
UpdateUnitsApplied();
Result = true;
}
UpdateUnitsApplied();
Result = true;
}
}
catch (Exception)
Expand Down Expand Up @@ -960,7 +953,7 @@ public double SmoothRate()
public double Speed()
{
double Result = 0;
if (mf.SimMode == SimType.Speed || mf.SectionControl.PrimeOn)
if (mf.SimMode == SimType.Sim_Speed || mf.SectionControl.PrimeOn)
{
Result = mf.SimSpeed;
}
Expand Down Expand Up @@ -1193,7 +1186,7 @@ public double WorkRate()
private double KMH()
{
double Result = 0;
if (mf.SimMode == SimType.Speed || mf.SectionControl.PrimeOn)
if (mf.SimMode == SimType.Sim_Speed || mf.SectionControl.PrimeOn)
{
if (mf.UseInches)
{
Expand Down
4 changes: 2 additions & 2 deletions RateAppSource/RateController/FormSettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1702,7 +1702,7 @@ private void UpdateDiags()
wifiBar.Value = mf.ModulesStatus.WifiStrength(CurrentProduct.ModuleID);

// product name
if (mf.SimMode != SimType.None)
if (mf.SimMode != SimType.Sim_None)
{
//lbProduct.Text = lbProduct.Text;
lbProduct.BackColor = mf.SimColor;
Expand Down Expand Up @@ -1760,7 +1760,7 @@ private void UpdateForm()
SetFanDisplay(false);
}

if (mf.SimMode != SimType.None)
if (mf.SimMode != SimType.Sim_None)
{
lbProduct.BackColor = mf.SimColor;
lbProduct.BorderStyle = BorderStyle.FixedSingle;
Expand Down
14 changes: 5 additions & 9 deletions RateAppSource/RateController/FormStart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,8 @@ namespace RateController
{
public enum SimType
{
None,
VirtualNano,
Speed
Sim_None,
Sim_Speed
}

public partial class FormStart : Form
Expand Down Expand Up @@ -73,7 +72,7 @@ public partial class FormStart : Form
private double cPressureOffset;
private bool[] cShowScale = new bool[4];
private bool cShowSwitches = false;
private SimType cSimMode = SimType.None;
private SimType cSimMode = SimType.Sim_None;
private double cSimSpeed = 0;
private DateTime cStartTime;
private int CurrentPage;
Expand Down Expand Up @@ -301,9 +300,6 @@ public double SimSpeed
}
}

public DateTime StartTime
{ get { return cStartTime; } }

public bool UseDualAuto
{ get { return cUseDualAuto; } set { cUseDualAuto = value; } }

Expand Down Expand Up @@ -498,7 +494,7 @@ public void LoadSettings()
}
else
{
cSimMode = SimType.None;
cSimMode = SimType.Sim_None;
}

if (double.TryParse(Tls.LoadProperty("PrimeTime"), out double ptime))
Expand Down Expand Up @@ -752,7 +748,7 @@ public void UpdateStatus()
{
this.Text = "RC [" + Path.GetFileNameWithoutExtension(Properties.Settings.Default.FileName) + "]";

if (cSimMode == SimType.Speed || SectionControl.PrimeOn)
if (cSimMode == SimType.Sim_Speed || SectionControl.PrimeOn)
{
btnSettings.Image = Properties.Resources.SimGear;
}
Expand Down
2 changes: 1 addition & 1 deletion RateAppSource/RateController/PGNs/PGN228.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public int ChannelCount

public void ParseByteData(byte[] Data)
{
if ((mf.SimMode == SimType.None) && (Data.Length > HeaderCount))
if ((mf.SimMode == SimType.Sim_None) && (Data.Length > HeaderCount))
{
if (Data.Length == Data[4] + HeaderCount + 1)
{
Expand Down
2 changes: 1 addition & 1 deletion RateAppSource/RateController/PGNs/PGN235.cs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public void ParseByteData(byte[] Data)
{
bool ValidData = true;
int Width;
if ((mf.SimMode == SimType.None) && (Data.Length > 5))
if ((mf.SimMode == SimType.Sim_None) && (Data.Length > 5))
{
if (Data.Length == Data[4] + 6)
{
Expand Down
2 changes: 1 addition & 1 deletion RateAppSource/RateController/PGNs/PGN238.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public byte RaiseTime

public void ParseByteData(byte[] Data)
{
if ((mf.SimMode == SimType.None) && (Data.Length > totalHeaderByteCount))
if ((mf.SimMode == SimType.Sim_None) && (Data.Length > totalHeaderByteCount))
{
if (Data.Length == Data[4] + totalHeaderByteCount + 1)
{
Expand Down
2 changes: 1 addition & 1 deletion RateAppSource/RateController/PGNs/PGN239.cs
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public bool Connected()

public void ParseByteData(byte[] Data)
{
if ((mf.SimMode == SimType.None) && (Data.Length > totalHeaderByteCount))
if ((mf.SimMode == SimType.Sim_None) && (Data.Length > totalHeaderByteCount))
{
if (Data.Length == Data[4] + totalHeaderByteCount + 1)
{
Expand Down
2 changes: 1 addition & 1 deletion RateAppSource/RateController/PGNs/PGN254.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public bool Connected()

public void ParseByteData(byte[] Data)
{
if ((mf.SimMode == SimType.None) && (Data.Length > totalHeaderByteCount))
if ((mf.SimMode == SimType.Sim_None) && (Data.Length > totalHeaderByteCount))
{
if (Data.Length == Data[4] + totalHeaderByteCount + 1)
{
Expand Down
18 changes: 2 additions & 16 deletions RateAppSource/RateController/PGNs/PGN32400.cs
Original file line number Diff line number Diff line change
Expand Up @@ -65,26 +65,12 @@ public double ElapsedTime()

public bool ModuleReceiving()
{
if (Prod.mf.SimMode == SimType.VirtualNano)
{
return true;
}
else
{
return cSensorReceiving && ModuleSending();
}
return cSensorReceiving && ModuleSending();
}

public bool ModuleSending()
{
if (Prod.mf.SimMode == SimType.VirtualNano)
{
return true;
}
else
{
return ((DateTime.Now - ReceiveTime).TotalSeconds < 4);
}
return ((DateTime.Now - ReceiveTime).TotalSeconds < 4);
}

public bool ParseByteData(byte[] Data)
Expand Down
6 changes: 3 additions & 3 deletions RateAppSource/RateController/frmCalibrate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public frmCalibrate(FormStart CalledFrom)

private void btnCalStart_Click(object sender, EventArgs e)
{
mf.SimMode = SimType.Speed;
mf.SimMode = SimType.Sim_Speed;
Running = true;
SetButtons();
Cals.Running(true);
Expand All @@ -51,7 +51,7 @@ private void btnCalStart_Click(object sender, EventArgs e)

private void btnCalStop_Click(object sender, EventArgs e)
{
mf.SimMode = SimType.None;
mf.SimMode = SimType.Sim_None;
Running = false;
SetButtons();
Cals.Running(false);
Expand Down Expand Up @@ -118,7 +118,7 @@ private void Cals_Edited(object sender, EventArgs e)
private void frmCalibrate_FormClosed(object sender, FormClosedEventArgs e)
{
mf.Tls.SaveFormData(this);
mf.SimMode = SimType.None;
mf.SimMode = SimType.Sim_None;

Cals.Close();
}
Expand Down
20 changes: 5 additions & 15 deletions RateAppSource/RateController/frmLargeScreen.cs
Original file line number Diff line number Diff line change
Expand Up @@ -801,20 +801,10 @@ private void UpdateForm()
}

// set highlight
if (mf.SimMode == SimType.VirtualNano)
{
pnlSelect0.BackColor = mf.SimColor;
pnlSelect1.BackColor = mf.SimColor;
pnlSelect2.BackColor = mf.SimColor;
pnlSelect3.BackColor = mf.SimColor;
}
else
{
pnlSelect0.BackColor = Properties.Settings.Default.DayColour;
pnlSelect1.BackColor = Properties.Settings.Default.DayColour;
pnlSelect2.BackColor = Properties.Settings.Default.DayColour;
pnlSelect3.BackColor = Properties.Settings.Default.DayColour;
}
pnlSelect0.BackColor = Properties.Settings.Default.DayColour;
pnlSelect1.BackColor = Properties.Settings.Default.DayColour;
pnlSelect2.BackColor = Properties.Settings.Default.DayColour;
pnlSelect3.BackColor = Properties.Settings.Default.DayColour;
switch (Prd.ID)
{
case 0:
Expand Down Expand Up @@ -977,7 +967,7 @@ private void UpdateForm()
lbQuantity.Text = Prd.QuantityDescription;

// aog
if (mf.SimMode == SimType.Speed)
if (mf.SimMode == SimType.Sim_Speed)
{
btnMenu.Image = Properties.Resources.SimGear;
}
Expand Down
6 changes: 3 additions & 3 deletions RateAppSource/RateController/frmOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -301,11 +301,11 @@ private void Save()

if (ckSimSpeed.Checked)
{
mf.SimMode = SimType.Speed;
mf.SimMode = SimType.Sim_Speed;
}
else
{
mf.SimMode = SimType.None;
mf.SimMode = SimType.Sim_None;
}

mf.UseLargeScreen = ckLargeScreen.Checked;
Expand Down Expand Up @@ -566,7 +566,7 @@ private void UpdateForm(bool UpdateObject = false)
ckScreenSwitches.Checked = mf.ShowSwitches;
ckWorkSwitch.Checked = mf.SwitchBox.UseWorkSwitch;
ckPressure.Checked = mf.ShowPressure;
ckSimSpeed.Checked = (mf.SimMode == SimType.Speed);
ckSimSpeed.Checked = (mf.SimMode == SimType.Sim_Speed);
ckDualAuto.Checked = mf.UseDualAuto;
ckResume.Checked = mf.ResumeAfterPrime;
ckNoMaster.Checked = mf.MasterOverride;
Expand Down
Binary file not shown.
Binary file modified RateAppSource/RateController/obj/Debug/RateController.exe
Binary file not shown.
Binary file modified RateAppSource/RateController/obj/Debug/RateController.pdb
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file modified RateControllerApp/RateController.exe
Binary file not shown.
Binary file modified RateControllerApp/de/RateController.resources.dll
Binary file not shown.
Binary file modified RateControllerApp/fr/RateController.resources.dll
Binary file not shown.
Binary file modified RateControllerApp/hu/RateController.resources.dll
Binary file not shown.
Binary file modified RateControllerApp/nl/RateController.resources.dll
Binary file not shown.
Binary file modified RateControllerApp/pl/RateController.resources.dll
Binary file not shown.
Binary file modified RateControllerApp/ru/RateController.resources.dll
Binary file not shown.

0 comments on commit d821050

Please sign in to comment.