Skip to content

Commit

Permalink
save CalPWM, manual pwm match auto when not used
Browse files Browse the repository at this point in the history
  • Loading branch information
SK21 committed Jan 11, 2024
1 parent 1789792 commit 66f35cd
Show file tree
Hide file tree
Showing 17 changed files with 78 additions and 58 deletions.
7 changes: 6 additions & 1 deletion RateAppSource/RateController/Classes/clsCalibrate.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class clsCalibrate
private double PulseCountTotal;
private int SetCount;
private bool ConstantUPMstart;
private int CalPWM;

public clsCalibrate(FormStart CallingFrom, int ID)
{
Expand Down Expand Up @@ -184,6 +185,7 @@ public void Load()
{
double.TryParse(mf.Tls.LoadProperty(Name() + "_Pulses"), out PulseCountTotal);
double.TryParse(mf.Tls.LoadProperty(Name() + "_Amount"), out MeasuredAmount);
int.TryParse(mf.Tls.LoadProperty(Name() + "_CalPWM"), out CalPWM);
}

public void Reset()
Expand All @@ -204,6 +206,7 @@ public void Save()
{
mf.Tls.SaveProperty(Name() + "_Pulses", PulseCountTotal.ToString());
mf.Tls.SaveProperty(Name() + "_Amount", MeasuredAmount.ToString());
mf.Tls.SaveProperty(Name() + "_CalPWM", CalPWM.ToString());

double.TryParse(cCalFactorBox.Text, out cCalFactor);
cProduct.MeterCal = cCalFactor;
Expand Down Expand Up @@ -252,13 +255,15 @@ public void Update()
case ControlTypeEnum.Motor:
case ControlTypeEnum.MotorWeights:
case ControlTypeEnum.Fan:
cProduct.ManualPWM = (int)cProduct.PWM();
//cProduct.ManualPWM = (int)cProduct.PWM();
CalPWM = (int)cProduct.PWM();
break;
}
}

cProduct.CalRun = cIsLocked;
cProduct.CalSetMeter = !cIsLocked;
cProduct.ManualPWM = CalPWM;
}
else
{
Expand Down
2 changes: 1 addition & 1 deletion RateAppSource/RateController/Classes/clsTools.cs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class clsTools
private string cPropertiesApp;
private string cPropertiesFile;
private string cSettingsDir;
private string cVersionDate = "09-Jan-2024";
private string cVersionDate = "10-Jan-2024";
private FormStart mf;

public clsTools(FormStart CallingForm)
Expand Down
14 changes: 13 additions & 1 deletion RateAppSource/RateController/PGNs/PGN32500.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,19 @@ public void Send()
}

if (Prod.UseMultiPulse) cData[9] |= 0b00100000;
if ((Prod.mf.SwitchBox.SwitchIsOn(SwIDs.Auto) || Prod.CalSetMeter) && !Prod.CalRun) cData[9] |= 0b01000000;

if ((Prod.mf.SwitchBox.SwitchIsOn(SwIDs.Auto) || Prod.CalSetMeter) && !Prod.CalRun)
{
// auto on
cData[9] |= 0b01000000;

if (Prod.ControlType != ControlTypeEnum.Valve && Prod.ControlType != ControlTypeEnum.ComboClose)
{
// keep manual motor setting the same as auto when not in use
// for smooth transition from auto to manual control
//Prod.ManualPWM = (int)Prod.PWM();
}
}

// manual cal
if (Prod.mf.SectionControl.MasterOn() && Prod.Enabled)
Expand Down
29 changes: 16 additions & 13 deletions RateAppSource/RateController/frmCalibrate.resx
Original file line number Diff line number Diff line change
Expand Up @@ -122,21 +122,24 @@
A. enter calibration speed

B. set calibration flow rate
1. switch product on
2. enter initial base rate
3. enter initial Cal Factor
4. press start, RC attempts to adjust flow to target rate
5. if successful, meter setting is locked
6. press stop
7. if not locked adjust initial cal factor, speed, PWM minium, PWM maximum, or machine metering drive range
8. start again
9. to redo a meter setting press the locked icon to unlock
10. to start from a saved setting press the unlocked icon to lock.
1. start with Master switch off
2. switch product on
3. enter initial base rate
4. enter initial Cal Factor
5. press start, RC attempts to adjust flow to target rate
6. if successful, meter setting is locked
7. press stop
8. if not locked adjust initial cal factor, speed, PWM minium, PWM maximum, or machine metering drive range
9. start step (B) again.

C. set Cal Factor (pulses/unit)
1. press start and let run to get an adequate sample amount
2. press stop and enter amount. Cal Factor is calculated.
3. press save to record new values. </value>
1. start with Master switch off
2. press start, turn Master switch on and let run to get an adequate sample amount
3. press stop and enter amount. Cal Factor is calculated.
4. press save to record new values.

D. 1. to redo step (B) if locked press the locked icon to unlock
2. to start from a saved setting press the unlocked icon to lock.</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2183,38 +2183,6 @@ F:\Temp\SpeedSim\RateAppSource\RateController\obj\Debug\RateController.exe
F:\Temp\SpeedSim\RateAppSource\RateController\obj\Debug\RateController.pdb
F:\Temp\SpeedSim\RateAppSource\RateController\obj\Debug\RateController.FormPIDGraph.resources
F:\Temp\SpeedSim\RateAppSource\RateController\obj\Debug\RateController.frmLargeScreen.resources
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateControllerApp\RateController.exe.config
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateControllerApp\RateController.exe
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateControllerApp\RateController.pdb
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateControllerApp\de\RateController.resources.dll
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateControllerApp\nl\RateController.resources.dll
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateControllerApp\ru\RateController.resources.dll
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.csproj.AssemblyReference.cache
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\AgOpenGPS.FormNumeric.resources
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.FormPIDGraph.resources
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.FormPressure.resources
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.FormSettings.resources
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.FormStart.resources
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.frmComm.resources
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.frmHelp.resources
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.frmLargeScreen.resources
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.frmMsgBox.resources
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.frmRelays.resources
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.frmSections.resources
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.frmSwitches.resources
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.Lang.resources
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.Properties.Resources.resources
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.Lang.de.resources
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.Lang.nl.resources
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.Lang.ru.resources
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.csproj.GenerateResource.cache
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.csproj.CoreCompileInputs.cache
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\de\RateController.resources.dll
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\nl\RateController.resources.dll
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\ru\RateController.resources.dll
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.csproj.CopyComplete
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.exe
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.pdb
C:\Users\jimcr\source\repos\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.FormPIDGraph.resources
C:\Users\jimcr\source\repos\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.frmLargeScreen.resources
C:\Users\jimcr\source\repos\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.frmSwitches.resources
Expand Down Expand Up @@ -2299,18 +2267,50 @@ C:\Users\DC\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\
C:\Users\DC\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.csproj.CopyComplete
C:\Users\DC\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.exe
C:\Users\DC\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.pdb
C:\Users\coxda\Documents\GitHub\SK21\AOG_RC\RateControllerApp\pl\RateController.resources.dll
C:\Users\coxda\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.frmCalibrate.resources
C:\Users\coxda\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.RCRestore.resources
C:\Users\coxda\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.Lang.pl.resources
C:\Users\coxda\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\pl\RateController.resources.dll
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateControllerApp\RateController.exe.config
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateControllerApp\RateController.exe
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateControllerApp\RateController.pdb
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateControllerApp\de\RateController.resources.dll
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateControllerApp\fr\RateController.resources.dll
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateControllerApp\hu\RateController.resources.dll
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.Lang.hu.resources
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\hu\RateController.resources.dll
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateControllerApp\nl\RateController.resources.dll
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateControllerApp\pl\RateController.resources.dll
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateControllerApp\ru\RateController.resources.dll
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.csproj.AssemblyReference.cache
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\AgOpenGPS.FormNumeric.resources
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.FormPIDGraph.resources
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.FormPressure.resources
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.FormSettings.resources
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.FormStart.resources
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.frmCalibrate.resources
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.frmComm.resources
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.frmHelp.resources
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.frmLargeScreen.resources
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.frmModule.resources
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateControllerApp\fr\RateController.resources.dll
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.Lang.fr.resources
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\fr\RateController.resources.dll
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.frmModuleConfig.resources
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.frmMsgBox.resources
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.frmPins.resources
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.frmPressureDisplay.resources
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.frmRelays.resources
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.frmSections.resources
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.frmSwitches.resources
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.Lang.resources
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.Properties.Resources.resources
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.RCRestore.resources
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.Lang.de.resources
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.Lang.fr.resources
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.Lang.hu.resources
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.Lang.nl.resources
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.Lang.pl.resources
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.Lang.ru.resources
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.csproj.GenerateResource.cache
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.csproj.CoreCompileInputs.cache
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\de\RateController.resources.dll
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\fr\RateController.resources.dll
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\hu\RateController.resources.dll
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\nl\RateController.resources.dll
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\pl\RateController.resources.dll
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\ru\RateController.resources.dll
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.csproj.CopyComplete
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.exe
C:\Users\CoxDa\Documents\GitHub\SK21\AOG_RC\RateAppSource\RateController\obj\Debug\RateController.pdb
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 66f35cd

Please sign in to comment.