(1) More logging, (2) Bug fixes in Statistics, (3) Bug fixes in ErrorFlags.Errors, ver. 2.16.655
This commit is contained in:
parent
8a2287c685
commit
bed0046618
@ -254,6 +254,12 @@ namespace Results
|
||||
foreach (var cd in ComponentsList) if (cd.Id == 0) session.SaveOrUpdate(cd);
|
||||
foreach (var wd in WaterMeterDataList) if (wd.Id == 0) session.SaveOrUpdate(wd);
|
||||
|
||||
log.Debug(batch.ToString(1));
|
||||
foreach (var tstRslt in batch.TestRslts)
|
||||
{
|
||||
log.Debug(tstRslt.ToString(1));
|
||||
}
|
||||
|
||||
session.SaveOrUpdate(batch);
|
||||
|
||||
transaction.Commit();
|
||||
@ -261,7 +267,13 @@ namespace Results
|
||||
catch (Exception exc)
|
||||
{
|
||||
transaction.Rollback();
|
||||
|
||||
log.FatalFormat("Saving results of batch #{0} into the results DB failed: {1}", batch.BatchNr, exc.Message);
|
||||
if (exc.InnerException != null && !string.IsNullOrEmpty(exc.InnerException.Message))
|
||||
{
|
||||
log.FatalFormat("Inner exception message: {0}", exc.InnerException.Message);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@ -126,5 +126,14 @@ namespace Results.Entities
|
||||
{
|
||||
return string.Format("Batch #{0}, Start:{1}, End:{2}, Procedure:{3}", BatchNr, StartTime, EndTime, ProcedureName);
|
||||
}
|
||||
|
||||
public virtual string ToString(int i)
|
||||
{
|
||||
return string.Format("Batch: BatchNr={0} TestBenchId={1} ProgramVersion={2} UserName={3} UserNumber={4} ProcedureName={5} ProcedureRevision={6} ProtocolTitle={7} Remark={8} DensityCorr={9} Custom2={10} Custom3={11} StartTime={12} EndTime={13} Dirty={14} RsltsSent={15} RsltsPrinted={16}",
|
||||
BatchNr, TestBenchId, ProgramVersion, UserName, UserNumber,
|
||||
ProcedureName, ProcedureRevision, ProtocolTitle, Remark, DensityCorr,
|
||||
Custom2, Custom3, StartTime, EndTime, Dirty,
|
||||
RsltsSent, RsltsPrinted);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -255,5 +255,25 @@ namespace Results.Entities
|
||||
{
|
||||
return string.Format("batch={0}, procedure={1}, test={2}, {3} {4}", Batch.BatchNr, Batch.ProcedureName, Name(), StartTime.ToShortDateString(), StartTime.ToShortTimeString());
|
||||
}
|
||||
}
|
||||
|
||||
public virtual string ToString(int i)
|
||||
{
|
||||
return string.Format("TestRslt: Part={0} RepetitionNr={1} TestDone={2} Remark={3} StartTime={4} EndTime={5} FlowSetTime={6} TestTime={7} PulsesMaster={8} ConstMaster={9} MassStartRaw={10} MassStart={11} MassEndRaw={12} MassEnd={13} DensityIn={14} DensityOut={15} DensityDiv={16} Buoyancy={17} FlowMass={18} FlowVolume={19} VolumeCTV={20} VolumeMaster={21} ErrorMaster={22} ErrorFlags={23} ErrorFlagsMd={24} AmbTempMean={25} AmbTempStart={26} AmbTempEnd={27} AmbTempMin={28} AmbTempMax={29} AmbPressMean={30} AmbPressStart={31} AmbPressEnd={32} AmbPressMin={33} AmbPressMax={34} AmbHumiMean={35} AmbHumiStart={36} AmbHumiEnd={37} AmbHumiMin={38} AmbHumiMax={39} PressUpMean={40} PressUpStart={41} PressUpEnd={42} PressUpMin={43} PressUpMax={44} PressDownMean={45} PressDownStart={46} PressDownEnd={47} PressDownMin={48} PressDownMax={49} PressDeltaMean={50} PressDeltaStart={51} PressDeltaEnd={52} PressDeltaMin={53} PressDeltaMax={54} TempUpMean={55} TempUpStart={56} TempUpEnd={57} TempUpMin={58} TempUpMax={59} TempDownMean={60} TempDownStart={61} TempDownEnd={62} TempDownMin={63} TempDownMax={64} TempDivMean={65} TempDivStart={66} TempDivEnd={67} TempDivMin={68} TempDivMax={69} FlowMean={70} FlowStart={71} FlowEnd={72} FlowMin={73} FlowMax={74} Custom1={75} Custom2={76} Custom3={77} Custom4={78} Custom5={79} Custom6={80} Custom7={81} Custom8={82} Custom9={83} Custom10={84}",
|
||||
Part, RepetitionNr, TestDone, Remark, StartTime, EndTime, FlowSetTime, TestTime,
|
||||
PulsesMaster, ConstMaster, MassStartRaw, MassStart, MassEndRaw, MassEnd,
|
||||
DensityIn, DensityOut, DensityDiv, Buoyancy, FlowMass, FlowVolume,
|
||||
VolumeCTV, VolumeMaster, ErrorMaster, ErrorFlags, ErrorFlagsMd,
|
||||
AmbTempMean, AmbTempStart, AmbTempEnd, AmbTempMin, AmbTempMax,
|
||||
AmbPressMean, AmbPressStart, AmbPressEnd, AmbPressMin, AmbPressMax,
|
||||
AmbHumiMean, AmbHumiStart, AmbHumiEnd, AmbHumiMin, AmbHumiMax,
|
||||
PressUpMean, PressUpStart, PressUpEnd, PressUpMin, PressUpMax,
|
||||
PressDownMean, PressDownStart, PressDownEnd, PressDownMin, PressDownMax,
|
||||
PressDeltaMean, PressDeltaStart, PressDeltaEnd, PressDeltaMin, PressDeltaMax,
|
||||
TempUpMean, TempUpStart, TempUpEnd, TempUpMin, TempUpMax,
|
||||
TempDownMean, TempDownStart, TempDownEnd, TempDownMin, TempDownMax,
|
||||
TempDivMean, TempDivStart, TempDivEnd, TempDivMin, TempDivMax,
|
||||
FlowMean, FlowStart, FlowEnd, FlowMin, FlowMax,
|
||||
Custom1, Custom2, Custom3, Custom4, Custom5, Custom6, Custom7, Custom8, Custom9, Custom10);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -7,6 +7,7 @@ using System.Windows.Forms;
|
||||
using log4net;
|
||||
using TBF.Resources;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
|
||||
namespace TBF.BenchControl.Network.Camera.Display
|
||||
{
|
||||
@ -144,18 +145,21 @@ namespace TBF.BenchControl.Network.Camera.Display
|
||||
|
||||
private void okButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
log.Warn("OK clicked");
|
||||
Result = DialogResult.OK;
|
||||
CloseAfterButtonClick();
|
||||
}
|
||||
|
||||
private void abortButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
log.Warn("Abort clicked");
|
||||
Result = DialogResult.Abort;
|
||||
CloseAfterButtonClick();
|
||||
}
|
||||
|
||||
private void retryButton_Click(object sender, EventArgs e)
|
||||
{
|
||||
log.Warn("Retry clicked");
|
||||
Result = DialogResult.Retry;
|
||||
CloseAfterButtonClick();
|
||||
}
|
||||
@ -170,10 +174,17 @@ namespace TBF.BenchControl.Network.Camera.Display
|
||||
|
||||
void UpdateData()
|
||||
{
|
||||
StringBuilder sb = new StringBuilder();
|
||||
|
||||
sb.Append("1 ");
|
||||
for (int i = 0; i < Math.Min(imagesCount, boxesCount); i++)
|
||||
{
|
||||
SelectedImages[i] = checkBoxes[i].Checked;
|
||||
sb.AppendFormat("{0}", checkBoxes[i].Checked ? "x" : "-");
|
||||
}
|
||||
sb.AppendFormat(" {0}", Math.Min(imagesCount, boxesCount));
|
||||
|
||||
log.WarnFormat("Data updated: {0}", sb.ToString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -22,9 +22,9 @@ namespace TBF.BenchControl.Sequences
|
||||
|
||||
public double First { get { return first; } }
|
||||
public double Last { get { return last; } }
|
||||
public double Min { get { return min; } }
|
||||
public double Max { get { return max; } }
|
||||
public double Average { get { if (count > 0) return (sum / (double)count); else return 0; } }
|
||||
public double Min { get { return (count > 0) ? min : 0; } } /// 0 when there were no samples
|
||||
public double Max { get { return (count > 0) ? max : 0; } } /// 0 when there were no samples
|
||||
public double Average { get { return (count > 0) ? (sum / (double)count) : 0; } }
|
||||
public UInt32 Count { get { return count; } }
|
||||
|
||||
public double Sum { get { return sum; } }
|
||||
@ -88,7 +88,10 @@ namespace TBF.BenchControl.Sequences
|
||||
/// <param name="value">New value</param>
|
||||
public void Update(double value)
|
||||
{
|
||||
if (totalCount >= SkippedSamplesCount) Process(value);
|
||||
if (totalCount >= SkippedSamplesCount)
|
||||
{
|
||||
Process(value);
|
||||
}
|
||||
totalCount++;
|
||||
}
|
||||
|
||||
@ -103,11 +106,12 @@ namespace TBF.BenchControl.Sequences
|
||||
double filteredValue;
|
||||
if (ApplyFilter(value, out filteredValue))
|
||||
{
|
||||
if (count == 0) first = value;
|
||||
last = value;
|
||||
sum += value;
|
||||
if (value < min) min = value;
|
||||
if (value > max) max = value;
|
||||
sum += filteredValue;
|
||||
if (count == 0) first = filteredValue;
|
||||
last = filteredValue;
|
||||
if (value < min) min = filteredValue;
|
||||
if (value > max) max = filteredValue;
|
||||
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -29,38 +29,40 @@ namespace TBF.BenchControl.Various.ErrorFlags
|
||||
|
||||
public int GetErrorFlags(Test test, double testTime)
|
||||
{
|
||||
/// Any E# is 'true' on error, 'false' when OK
|
||||
|
||||
if (Mode != ErrorFlagsMode.Info && Mode != ErrorFlagsMode.On) return 0; /// return 0 when Mode == ErrorFlagsMode.Off
|
||||
|
||||
/// Max. and min. flow
|
||||
bool E1 = ProcessData.RefFlowStat.Min >= test.Qfrom
|
||||
&& ProcessData.RefFlowStat.Max <= test.Qto;
|
||||
bool E1 = ProcessData.RefFlowStat.Min < test.Qfrom
|
||||
|| ProcessData.RefFlowStat.Max > test.Qto;
|
||||
|
||||
/// Max. and min. up and down water temperature
|
||||
bool E2 = ProcessData.TempUpStat.Min >= test.TempLimLo
|
||||
&& ProcessData.TempUpStat.Min <= test.TempLimHi
|
||||
&& ProcessData.TempDownStat.Min >= test.TempLimLo
|
||||
&& ProcessData.TempDownStat.Min <= test.TempLimHi;
|
||||
bool E2 = ProcessData.TempUpStat.Min < test.TempLimLo
|
||||
|| ProcessData.TempUpStat.Max > test.TempLimHi
|
||||
|| ProcessData.TempDownStat.Min < test.TempLimLo
|
||||
|| ProcessData.TempDownStat.Max > test.TempLimHi;
|
||||
|
||||
/// Max. flow deviation
|
||||
bool E3 = ProcessData.RefFlowStat.Min >= ProcessData.RefFlowStat.Average * (1.0f - errorsCfg.TestParams.Delta_Q_pct / 100.0f)
|
||||
&& ProcessData.RefFlowStat.Max <= ProcessData.RefFlowStat.Average * (1.0f + errorsCfg.TestParams.Delta_Q_pct / 100.0f);
|
||||
bool E3 = ProcessData.RefFlowStat.Min < ProcessData.RefFlowStat.Average * (1.0f - errorsCfg.TestParams.Delta_Q_pct / 100.0f)
|
||||
|| ProcessData.RefFlowStat.Max > ProcessData.RefFlowStat.Average * (1.0f + errorsCfg.TestParams.Delta_Q_pct / 100.0f);
|
||||
|
||||
/// Max. up and down water temperature deviation
|
||||
bool E4 = ProcessData.TempUpStat.Min >= ProcessData.TempUpStat.Average - errorsCfg.TestParams.Delta_T
|
||||
&& ProcessData.TempUpStat.Min <= ProcessData.TempUpStat.Average + errorsCfg.TestParams.Delta_T
|
||||
&& ProcessData.TempDownStat.Min >= ProcessData.TempDownStat.Average - errorsCfg.TestParams.Delta_T
|
||||
&& ProcessData.TempDownStat.Min <= ProcessData.TempDownStat.Average + errorsCfg.TestParams.Delta_T;
|
||||
bool E4 = ProcessData.TempUpStat.Min < ProcessData.TempUpStat.Average - errorsCfg.TestParams.Delta_T
|
||||
|| ProcessData.TempUpStat.Max > ProcessData.TempUpStat.Average + errorsCfg.TestParams.Delta_T
|
||||
|| ProcessData.TempDownStat.Min < ProcessData.TempDownStat.Average - errorsCfg.TestParams.Delta_T
|
||||
|| ProcessData.TempDownStat.Max > ProcessData.TempDownStat.Average + errorsCfg.TestParams.Delta_T;
|
||||
|
||||
/// Max. absolute value of up and down water temperature difference
|
||||
bool E5 = ProcessData.TempDiffStat.Max <= errorsCfg.TestParams.Delta_Tup_Tdn;
|
||||
bool E5 = ProcessData.TempDiffStat.Max > errorsCfg.TestParams.Delta_Tup_Tdn;
|
||||
|
||||
bool E6 = false;
|
||||
|
||||
/// Test time (min)
|
||||
bool E7 = testTime >= errorsCfg.TestParams.TestTime_min;
|
||||
bool E7 = testTime < errorsCfg.TestParams.TestTime_min;
|
||||
|
||||
/// Test time (max)
|
||||
bool E8 = testTime <= errorsCfg.TestParams.TestTime_max;
|
||||
bool E8 = testTime > errorsCfg.TestParams.TestTime_max;
|
||||
|
||||
bool E9 = false;
|
||||
bool E10 = false;
|
||||
@ -68,12 +70,12 @@ namespace TBF.BenchControl.Various.ErrorFlags
|
||||
bool E12 = false;
|
||||
|
||||
/// Ambient temperature
|
||||
bool E13 = ProcessData.AmbTempStat.Min >= errorsCfg.TestParams.AmbTemp_min
|
||||
&& ProcessData.AmbTempStat.Max <= errorsCfg.TestParams.AmbTemp_max;
|
||||
bool E13 = ProcessData.AmbTempStat.Min < errorsCfg.TestParams.AmbTemp_min
|
||||
|| ProcessData.AmbTempStat.Max > errorsCfg.TestParams.AmbTemp_max;
|
||||
|
||||
/// Water pressure
|
||||
bool E14 = ProcessData.PressUpStat.Min >= errorsCfg.TestParams.Pressure_min
|
||||
&& ProcessData.PressUpStat.Max <= errorsCfg.TestParams.Pressure_max;
|
||||
bool E14 = ProcessData.PressUpStat.Min < errorsCfg.TestParams.Pressure_min
|
||||
|| ProcessData.PressUpStat.Max > errorsCfg.TestParams.Pressure_max;
|
||||
|
||||
bool E15 = false;
|
||||
bool E16 = false;
|
||||
|
||||
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("2.16.651.1")]
|
||||
[assembly: AssemblyFileVersion("2.16.651.1")]
|
||||
[assembly: AssemblyVersion("2.16.655.1")]
|
||||
[assembly: AssemblyFileVersion("2.16.655.1")]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user