IRegisterReader extended, ReadReferenceForRegisterOp removed, ReadRegisteOp integrated into RegisterReader class, ProcessTabPages updated.
This commit is contained in:
@@ -400,63 +400,82 @@ namespace TBF.Screens
|
||||
|
||||
massLabel.Text = ProcessData.Mass.ToString();
|
||||
|
||||
///
|
||||
/// Available when setting the flow
|
||||
///
|
||||
refFreqLabel.Text = ProcessData.RefFreq.ToString();
|
||||
refFlowLabel.Text = Utils.FloatToStr(ProcessData.RefFlow.Val, 4);
|
||||
|
||||
|
||||
///
|
||||
/// Available during a test
|
||||
///
|
||||
refPulsesLabel.Text = ProcessData.RefCount.ToString();
|
||||
double refVolume = ProcessData.LtrPerRefPulse * (double)ProcessData.RefCount.Val;
|
||||
|
||||
float massDiff = ProcessData.Mass.Val - ProcessData.StartMass.Val;
|
||||
massDiffLabel.Text = massDiff.ToString("F3");
|
||||
float volumeCtv = 1001.03f * massDiff / (float)TBF.BenchControl.Formulas.WaterDensityFromTemp(ProcessData.TempOut.Val);
|
||||
volumeCtvLabel.Text = volumeCtv.ToString("F2");
|
||||
double refError = TBF.BenchControl.Formulas.ErrorFromVolumes(refVolume, volumeCtv);
|
||||
refErrorLabel.Text = refError.ToString("F3");
|
||||
|
||||
if (currentMetersKind == MetersKind.Single)
|
||||
if (args.TestPhase == Config.Entities.Progress.FlowSetting)
|
||||
{
|
||||
for (int i = 0; i < textBoxesCount; i++)
|
||||
///
|
||||
/// Available when setting the flow
|
||||
///
|
||||
refFreqLabel.Text = ProcessData.RefFreq.ToString();
|
||||
refFlowLabel.Text = Utils.FloatToStr(ProcessData.RefFlow.Val, 4);
|
||||
}
|
||||
|
||||
if (args.TestPhase == Config.Entities.Progress.FlowSetting ||
|
||||
args.TestPhase == Config.Entities.Progress.Test)
|
||||
{
|
||||
///
|
||||
/// Available during a test
|
||||
///
|
||||
refPulsesLabel.Text = ProcessData.RefCount.ToString();
|
||||
double refVolume = ProcessData.LtrPerRefPulse * (double)ProcessData.RefCount.Val;
|
||||
|
||||
float massDiff = ProcessData.Mass.Val - ProcessData.StartMass.Val;
|
||||
massDiffLabel.Text = massDiff.ToString("F3");
|
||||
float volumeCtv = 1001.03f * massDiff / (float)TBF.BenchControl.Formulas.WaterDensityFromTemp(ProcessData.TempOut.Val);
|
||||
volumeCtvLabel.Text = volumeCtv.ToString("F2");
|
||||
double refError = TBF.BenchControl.Formulas.ErrorFromVolumes(refVolume, volumeCtv);
|
||||
refErrorLabel.Text = refError.ToString("F3");
|
||||
|
||||
if (currentMetersKind == MetersKind.Single)
|
||||
{
|
||||
/// TODO: Reimplement
|
||||
//pulses[i].Text = args.TestResult.Meters[i].PulsesMeter.ToString();
|
||||
//refPulses[i].Text = args.TestResult.Meters[i].PulsesMaster.ToString();
|
||||
//volume[i].Text = args.TestResult.Meters[i].VolumeMeter.ToString();
|
||||
//error[i].Text = args.TestResult.Meters[i].VolumeErrorPct.ToString("F2");
|
||||
for (int i = 0; i < Math.Min(textBoxesCount, ProcessData.RegisterReaders.Length); i++)
|
||||
{
|
||||
BenchControl.GenericDevices.IRegisterReader rr = ProcessData.RegisterReaders[i];
|
||||
if (rr != null)
|
||||
{
|
||||
pulses[i].Text = rr.WMPulses.ToString();
|
||||
refPulses[i].Text = rr.WMRefPulses.ToString();
|
||||
volume[i].Text = rr.WMVolume.ToString("F1");
|
||||
error[i].Text = BenchControl.Formulas.ErrorFromVolumes(rr.WMVolume, refVolume).ToString("F1");
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (currentMetersKind == MetersKind.Combined)
|
||||
{
|
||||
for (int compMtr = 0; compMtr < Config.Data.CompoundWMsCount; compMtr++)
|
||||
{
|
||||
int end = Math.Min(2 * compMtr + 2, Math.Min(textBoxesCount, ProcessData.RegisterReaders.Length));
|
||||
|
||||
double compoundVolume = 0;
|
||||
for (int i = 2 * compMtr; i < end; i++)
|
||||
{
|
||||
BenchControl.GenericDevices.IRegisterReader rr = ProcessData.RegisterReaders[i];
|
||||
if (rr != null)
|
||||
{
|
||||
pulses[i].Text = rr.WMPulses.ToString();
|
||||
refPulses[i].Text = rr.WMRefPulses.ToString();
|
||||
volume[i].Text = rr.WMVolume.ToString("F1");
|
||||
error[i].Text = BenchControl.Formulas.ErrorFromVolumes(rr.WMVolume, refVolume).ToString("F1");
|
||||
compoundVolume += rr.WMVolume;
|
||||
}
|
||||
}
|
||||
|
||||
volume1zLabel.Text = compoundVolume.ToString("F1");
|
||||
error1zLabel.Text = BenchControl.Formulas.ErrorFromVolumes(compoundVolume, refVolume).ToString("F1");
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (currentMetersKind == MetersKind.Combined)
|
||||
{
|
||||
for (int i = 0; i < 2; i++)
|
||||
{
|
||||
/// TODO: Reimplement
|
||||
//pulses[i].Text = args.TestResult.Meters[i].PulsesMeter.ToString();
|
||||
//refPulses[i].Text = args.TestResult.Meters[i].PulsesMaster.ToString();
|
||||
//volume[i].Text = args.TestResult.Meters[i].VolumeMeter.ToString();
|
||||
//error[i].Text = args.TestResult.Meters[i].VolumeErrorPct.ToString("F2");
|
||||
}
|
||||
/// TODO: Reimplement
|
||||
//volume1zLabel.Text = args.TestResult.CombinedMeters[0].VolumeMeter.ToString();
|
||||
//error1zLabel.Text = args.TestResult.CombinedMeters[0].VolumeErrorPct.ToString("F2");
|
||||
}
|
||||
|
||||
//if (pumpOn != args.PumpOn || diverterToTank != args.DivToTank)
|
||||
//{
|
||||
// //if (pumpOn != args.PumpOn)
|
||||
// //{
|
||||
// // if (pumpOn) pumpPictureBox.Image = System.Resources.
|
||||
// // else pumpPictureBox.Image = System.Resources.
|
||||
// //}
|
||||
// pumpOn = args.PumpOn;
|
||||
// diverterToTank = args.DivToTank;
|
||||
// Invalidate();
|
||||
//}
|
||||
//if (pumpOn != args.PumpOn || diverterToTank != args.DivToTank)
|
||||
//{
|
||||
// //if (pumpOn != args.PumpOn)
|
||||
// //{
|
||||
// // if (pumpOn) pumpPictureBox.Image = System.Resources.
|
||||
// // else pumpPictureBox.Image = System.Resources.
|
||||
// //}
|
||||
// pumpOn = args.PumpOn;
|
||||
// diverterToTank = args.DivToTank;
|
||||
// Invalidate();
|
||||
//}
|
||||
}
|
||||
|
||||
void OnTestCompleted(object sender, TestCompletedEventArgs args)
|
||||
|
||||
Reference in New Issue
Block a user