Clean-up, Q2Corretion and Q2CorrectionDone removed from Results DB, ver.2.18.1183
This commit is contained in:
parent
b235f9ae20
commit
809b067260
@ -62,8 +62,6 @@ namespace Results.Entities
|
||||
public virtual double OrigCalibFactorLNA{ get; set; } /// Original iPerl LNA calibration factor used during the test
|
||||
public virtual double CalibFactorLNA { get; set; } /// iPerl LNA calibration factor used during the test
|
||||
public virtual double Q2ErrWOCorrection { get; set; }
|
||||
public virtual bool Q2CorrectionDone { get; set; } /// true = iPerl Q2 correction was done
|
||||
public virtual double Q2Correction { get; set; } /// !!! obsolete
|
||||
public virtual int Q2CorrRL { get; set; } /// iPerl Q2 correction for the R-flow written to iPerl
|
||||
public virtual int Q2CorrLR { get; set; } /// iPerl Q2 correction for the L-flow written to iPerl
|
||||
public virtual int Q2CorrFlowRight { get; set; } /// 1 = right to left
|
||||
@ -386,8 +384,6 @@ namespace Results.Entities
|
||||
OrigCalibFactor = src.OrigCalibFactor;
|
||||
CalibFactor = src.CalibFactor;
|
||||
Q2ErrWOCorrection = src.Q2ErrWOCorrection;
|
||||
Q2CorrectionDone = src.Q2CorrectionDone;
|
||||
Q2Correction = src.Q2Correction;
|
||||
Q2CorrRL = src.Q2CorrRL;
|
||||
Q2CorrLR = src.Q2CorrLR;
|
||||
Q2CorrFlowRight = src.Q2CorrFlowRight;
|
||||
|
||||
@ -33,8 +33,6 @@ namespace Results.Mappings
|
||||
Map(x => x.OrigCalibFactorLNA);
|
||||
Map(x => x.CalibFactorLNA);
|
||||
Map(x => x.Q2ErrWOCorrection);
|
||||
Map(x => x.Q2CorrectionDone);
|
||||
Map(x => x.Q2Correction);
|
||||
Map(x => x.Q2CorrRL);
|
||||
Map(x => x.Q2CorrLR);
|
||||
Map(x => x.Q2CorrFlowRight);
|
||||
|
||||
@ -420,7 +420,7 @@ namespace Results
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.OrigCalibFactorLNA,"iPerl OrigCalibFactorLNA",Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", w.OrigCalibFactorLNA)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.CalibFactorLNA, "iPerl CalibFactorLNA", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", w.CalibFactorLNA)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2ErrWOCorrection, "iPerl Q2ErrWOCorrection", Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => FormatDbl(u, f, p, "V3", w.Q2ErrWOCorrection)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrectionDone, "iPerl Q2CorrectionDone", Quantity.Boolean,ItemCategory.MeterResult, (w, t, u, f, p) => (w.Q2CorrectionDone ? Strings.Yes : Strings.No)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrectionDone, "iPerl Q2CorrectionDone", Quantity.Boolean,ItemCategory.MeterResult, (w, t, u, f, p) => (((w.Q2CorrRL != 0) || (w.Q2CorrLR != 0)) ? Strings.Yes : Strings.No)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrRFlow, "iPerl Q2Corr RL", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.Q2CorrRL)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrLFlow, "iPerl Q2Corr LR", Quantity.Number, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.Q2CorrLR)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q2CorrFlowRight, "iPerl Q2CorrFlowRight", Quantity.Volume, ItemCategory.MeterResult, (w, t, u, f, p) => FormatInt(f, w.Q2CorrFlowRight)));
|
||||
|
||||
@ -1015,7 +1015,7 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
|
||||
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = wm.Hz2CorrectionDone ? 1 : 0 });
|
||||
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Double, Value = wm.Hz2Correction });
|
||||
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Double, Value = Math.Min(99.0, Math.Max(-99.0, wm.Diff2Hz8Hz)) });
|
||||
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = wm.Q2CorrectionDone ? 1 : 0 });
|
||||
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = ((wm.Q2CorrRL != 0) || (wm.Q2CorrLR != 0)) ? 1 : 0 });
|
||||
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = wm.Q2CorrLR });
|
||||
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Double, Value = q2ErrWOCorrection });
|
||||
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = wm.Q2CorrFlowRight }); /// 1 = R->L
|
||||
|
||||
@ -354,8 +354,9 @@ namespace TBF.BenchControl.Output.FileWriters.IperlLogger
|
||||
logger.WriteLine(string.Format("ZeitImpulse{0}={1}", flID, mtr.TestTime.ToString(Program.AltCulture)));
|
||||
logger.WriteLine(string.Format("Impulse{0}={1}", flID, 0));
|
||||
logger.WriteLine(string.Format("Volumen{0}={1}", flID, mtr.VolumeMeter.ToString(Program.AltCulture)));
|
||||
logger.WriteLine(string.Format("KorrFehler{0}={1}", flID, ((testInfos[j].TestName == "Q2") && mtr.WaterMeter.Q2CorrectionDone) ? mtr.WaterMeter.Q2ErrWOCorrection.ToString(Program.AltCulture)
|
||||
: mtr.Error.ToString(Program.AltCulture)));
|
||||
logger.WriteLine(string.Format("KorrFehler{0}={1}", flID, (testInfos[j].TestName == "Q2") && ((mtr.WaterMeter.Q2CorrRL != 0) || (mtr.WaterMeter.Q2CorrLR != 0))
|
||||
? mtr.WaterMeter.Q2ErrWOCorrection.ToString(Program.AltCulture)
|
||||
: mtr.Error.ToString(Program.AltCulture)));
|
||||
logger.WriteLine(string.Format("KorrDurchfluss{0}={1}", flID, 0));
|
||||
logger.WriteLine(string.Format("Q{0}KorrBestanden={1}", flID, 0));
|
||||
logger.WriteLine(string.Format("Anfangsstand{0}={1}", flID, 0)); /// TODO
|
||||
@ -385,7 +386,7 @@ namespace TBF.BenchControl.Output.FileWriters.IperlLogger
|
||||
logger.WriteLine(string.Format("FlexFlowAuftrag={0}", 0)); /// 4248189
|
||||
logger.WriteLine(string.Format("JustierWert=0,2")); /// 0,2
|
||||
logger.WriteLine(string.Format("Corrected2Hz={0}", wMtr.Hz2CorrectionDone ? 1 : 0));
|
||||
logger.WriteLine(string.Format("Q2Corrected={0}", wMtr.Q2CorrectionDone ? 1 : 0));
|
||||
logger.WriteLine(string.Format("Q2Corrected={0}", ((wMtr.Q2CorrRL != 0) || (wMtr.Q2CorrLR != 0)) ? 1 : 0));
|
||||
logger.WriteLine(string.Format("Q2CorrectionRight={0}", wMtr.Q2CorrLR));
|
||||
logger.WriteLine(string.Format("Q2CorrectionLeft={0}", wMtr.Q2CorrRL));
|
||||
logger.WriteLine(string.Format("Q2CorrectionFlowRight={0}", wMtr.Q2CorrFlowRight));
|
||||
|
||||
@ -1116,7 +1116,7 @@ namespace TBF.BenchControl.Sequences
|
||||
sb.Append(";"); sb.Append(mtrRslt.TestTime); /// CN WM Tmet - cas merania (obmedzany pri synchro skuske)
|
||||
sb.Append(";"); sb.Append(mtrRslt.Passed ? "OK" : "NOK"); /// CO WM Vysledok (t.j. ci je v hraniciach chyb) - OK/NOK
|
||||
#if IPERL
|
||||
sb.Append(";"); sb.Append(mtrRslt.WaterMeter.Q2Correction.ToString("F1")); /// CP iPerl Q2 correction factor used during the test / AN value - hodnota z analogoveho prevodnika
|
||||
sb.Append(";"); sb.Append(mtrRslt.WaterMeter.Q2CorrRL); /// CP iPerl Q2 correction factor used during the test / AN value - hodnota z analogoveho prevodnika
|
||||
#else
|
||||
sb.Append(";"); sb.Append(mtrRslt.PulsesPerLiter); /// CP Pulses per liter
|
||||
#endif
|
||||
@ -1208,7 +1208,7 @@ namespace TBF.BenchControl.Sequences
|
||||
sb.Append(";"); sb.Append(volumeMtr.TestTime); /// WM Tmet - cas merania (obmedzany pri synchro skuske)
|
||||
sb.Append(";"); sb.Append(volumeMtr.Passed ? "OK" : "NOK"); /// WM Vysledok (t.j. ci je v hraniciach chyb) - OK/NOK
|
||||
#if IPERL
|
||||
sb.Append(";"); sb.Append(volumeMtr.WaterMeter.Q2Correction.ToString("F1")); /// iPerl Q2 correction factor used during the test / AN value - hodnota z analogoveho prevodnika
|
||||
sb.Append(";"); sb.Append(volumeMtr.WaterMeter.Q2CorrRL); /// iPerl Q2 correction factor used during the test / AN value - hodnota z analogoveho prevodnika
|
||||
#else
|
||||
sb.Append(";"); sb.Append(" "); /// nechat prazdne
|
||||
#endif
|
||||
@ -1236,7 +1236,7 @@ namespace TBF.BenchControl.Sequences
|
||||
sb.Append(";"); sb.Append(energyMtr.TestTime); /// WM Tmet - cas merania (obmedzany pri synchro skuske)
|
||||
sb.Append(";"); sb.Append(energyMtr.Passed ? "OK" : "NOK"); /// WM Vysledok (t.j. ci je v hraniciach chyb) - OK/NOK
|
||||
#if IPERL
|
||||
sb.Append(";"); sb.Append(energyMtr.WaterMeter.Q2Correction.ToString("F1")); /// iPerl Q2 correction factor used during the test / AN value - hodnota z analogoveho prevodnika
|
||||
sb.Append(";"); sb.Append(energyMtr.WaterMeter.Q2CorrRL); /// iPerl Q2 correction factor used during the test / AN value - hodnota z analogoveho prevodnika
|
||||
#else
|
||||
sb.Append(";"); sb.Append(" "); /// nechat prazdne
|
||||
#endif
|
||||
|
||||
@ -757,7 +757,8 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
///
|
||||
/// RFID communication activity call
|
||||
///
|
||||
if (ihead.Disabled || !ckbState[wmNr0]) error = CommErr.HeadDisabledByUser;
|
||||
if ((ihead == null) || ihead.Disabled || !ckbState[wmNr0]) error = CommErr.HeadDisabledByUser;
|
||||
else if (wm == null || ihead.CommFailed) error = CommErr.CommFailed;
|
||||
#if IPERL
|
||||
else if (currentActivity.ToLower().Contains(ReadConfigurationStr.ToLower())) error = ReadConfiguration(threadID, ihead, wm, ref resultStr);
|
||||
else if (currentActivity.ToLower().Contains(SetTestModeStr.ToLower())) error = SetTestMode(threadID, ihead, wm, ref resultStr);
|
||||
@ -845,6 +846,8 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
|
||||
#region Communication functions
|
||||
|
||||
#if IPERL
|
||||
|
||||
/// <summary>
|
||||
/// Read a complete configuration structure of the watermeter
|
||||
/// </summary>
|
||||
@ -1086,13 +1089,13 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
if (readRetVal == 0)
|
||||
{
|
||||
ihead.CalibrationStruct = CalibrationStruct.FromByteArray(calib);
|
||||
#if IPERL
|
||||
if (wm != null && wm.OrigCalibFactor == 0)
|
||||
|
||||
if (wm.OrigCalibFactor == 0)
|
||||
{
|
||||
wm.OrigCalibFactor = ihead.CalibrationStruct.Calibration;
|
||||
wm.FWVersion = ihead.CalibrationStruct.FWVersionStr();
|
||||
}
|
||||
#endif
|
||||
|
||||
resultStr = ihead.CalibrationStruct.ToString();
|
||||
error = ihead.VerifyIPerlType() ? CommErr.None : CommErr.WrongIPerlType;
|
||||
break;
|
||||
@ -1128,14 +1131,14 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
if (readRetVal == 0)
|
||||
{
|
||||
ihead.CalibrationStructV4 = CalibrationStructV4.FromByteArray(calib);
|
||||
#if IPERL
|
||||
if (wm != null && wm.OrigCalibFactor == 0 && wm.OrigCalibFactorLNA == 0)
|
||||
|
||||
if ((wm.OrigCalibFactor == 0) && (wm.OrigCalibFactorLNA == 0))
|
||||
{
|
||||
wm.OrigCalibFactor = ihead.CalibrationStructV4.Calibration;
|
||||
wm.OrigCalibFactorLNA = ihead.CalibrationStructV4.CalibrationLNA;
|
||||
wm.FWVersion = ihead.CalibrationStructV4.FWVersionStr();
|
||||
}
|
||||
#endif
|
||||
|
||||
resultStr = ihead.CalibrationStructV4.ToString();
|
||||
error = ihead.VerifyIPerlType() ? CommErr.None : CommErr.WrongIPerlType;
|
||||
break;
|
||||
@ -1262,9 +1265,7 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
{
|
||||
error = CommErr.None;
|
||||
ihead.CalibrationStruct.Update(data, 2);
|
||||
#if IPERL
|
||||
if (wm != null) wm.CalibFactor = newCalibFactor;
|
||||
#endif
|
||||
wm.CalibFactor = newCalibFactor;
|
||||
resultStr = ihead.CalibrationStruct.ToString();
|
||||
break;
|
||||
}
|
||||
@ -1436,13 +1437,8 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
error = CommErr.None;
|
||||
ihead.CalibrationStructV4.Update(data, 2);
|
||||
ihead.CalibrationStructV4.Update(dataLNA, 34);
|
||||
#if IPERL
|
||||
if (wm != null)
|
||||
{
|
||||
wm.CalibFactor = newCalibFactor;
|
||||
wm.CalibFactorLNA = newCalibFactorLNA;
|
||||
}
|
||||
#endif
|
||||
wm.CalibFactor = newCalibFactor;
|
||||
wm.CalibFactorLNA = newCalibFactorLNA;
|
||||
resultStr = ihead.CalibrationStructV4.ToString();
|
||||
break;
|
||||
}
|
||||
@ -1492,8 +1488,6 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
return avgTestRslt;
|
||||
}
|
||||
|
||||
#if IPERL
|
||||
|
||||
/// <summary>
|
||||
/// Normalize calibration factor in case ti is close to value 8000.
|
||||
/// </summary>
|
||||
@ -1668,16 +1662,9 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
if ((error == CommErr.None) && (rdData != null) && (rdData.Length == 2))
|
||||
{
|
||||
resultStr = "Q2 corrections successfully read";
|
||||
ihead.Q2CorrLR = (int)((SByte)rdData[0]);
|
||||
ihead.Q2CorrRL = (int)((SByte)rdData[1]);
|
||||
wm.Q2CorrLR = ihead.Q2CorrLR = (int)((SByte)rdData[0]);
|
||||
wm.Q2CorrRL = ihead.Q2CorrRL = (int)((SByte)rdData[1]);
|
||||
ihead.Q2CorrectionDone = (ihead.Q2CorrRL != 0) || (ihead.Q2CorrLR != 0);
|
||||
|
||||
if (wm != null)
|
||||
{
|
||||
wm.Q2CorrLR = ihead.Q2CorrLR;
|
||||
wm.Q2CorrRL = ihead.Q2CorrRL;
|
||||
wm.Q2CorrectionDone = ihead.Q2CorrectionDone;
|
||||
}
|
||||
}
|
||||
|
||||
ClosePort(threadId, ihead); /// Close RFID port
|
||||
@ -1720,17 +1707,10 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
{
|
||||
if (0 == WriteRequestPort(threadId, ihead, MessageID.MetrologyMemory, Q2CorrFactorsAddr, wrData.Length, wrData, cfg.CommTimeout))
|
||||
{
|
||||
ihead.Q2CorrRL = factorRL;
|
||||
ihead.Q2CorrLR = factorLR;
|
||||
wm.Q2CorrRL = ihead.Q2CorrRL = factorRL;
|
||||
wm.Q2CorrLR = ihead.Q2CorrLR = factorLR;
|
||||
ihead.Q2CorrectionDone = (factorRL != 0) || (factorLR != 0);
|
||||
|
||||
if (wm != null)
|
||||
{
|
||||
wm.Q2CorrRL = ihead.Q2CorrRL;
|
||||
wm.Q2CorrLR = ihead.Q2CorrLR;
|
||||
wm.Q2CorrectionDone = ihead.Q2CorrectionDone;
|
||||
}
|
||||
|
||||
error = CommErr.None;
|
||||
break;
|
||||
}
|
||||
@ -1873,20 +1853,16 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
return CommErr.None; /// No Q2 correction when doing conditional update and WM passed
|
||||
}
|
||||
|
||||
if ((wm == null) || (ihead == null) || ihead.CommFailed) return CommErr.CommFailed;
|
||||
|
||||
Results.Entities.MeterTestRslt q2adjResult; /// The only test or the 1st test (the test in R-L direction)
|
||||
Results.Entities.TestData q2adjTestData;
|
||||
|
||||
Results.Entities.MeterTestRslt q2adjResult2 = null; /// 2nd test name for a test in L-R direction
|
||||
Results.Entities.TestData q2adjTestData2 = null;
|
||||
|
||||
string[] args = new string[0];
|
||||
if (!string.IsNullOrEmpty(restOfLine))
|
||||
{
|
||||
args = restOfLine.Split(new char[] { ' ' });
|
||||
}
|
||||
|
||||
|
||||
Results.Entities.MeterTestRslt q2adjResult; /// The only test or the 1st test (the test in R-L direction)
|
||||
Results.Entities.TestData q2adjTestData;
|
||||
///
|
||||
if (args.Length == 0)
|
||||
{
|
||||
/// In case of no test name argument, ihead.LastTestResult is used (if it exists)
|
||||
@ -1929,6 +1905,10 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Results.Entities.MeterTestRslt q2adjResult2 = null; /// 2nd test name for a test in L-R direction
|
||||
Results.Entities.TestData q2adjTestData2 = null;
|
||||
///
|
||||
if (args.Length >= 2)
|
||||
{
|
||||
/// Get the 2nd test data from the 2nd test name
|
||||
@ -1965,12 +1945,16 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
}
|
||||
|
||||
|
||||
if (q2adjResult == null) return CommErr.MissingTest; /// This should never happen
|
||||
if (q2adjResult == null)
|
||||
{
|
||||
return CommErr.MissingTest; /// This should never happen
|
||||
}
|
||||
if ((q2CorrType == Q2CorrType.Update || q2CorrType == Q2CorrType.ConditionalUpdate) && (q2adjResult2 == null))
|
||||
{
|
||||
return CommErr.MissingTest; /// This should never happen, 2 test names required as activity arguments
|
||||
return CommErr.MissingTest; /// This should never happen, 2 test names required as activity arguments
|
||||
}
|
||||
|
||||
|
||||
///
|
||||
/// Calculate Q2 correction factor(s) from an error measured at Q2
|
||||
///
|
||||
@ -1991,7 +1975,7 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
}
|
||||
else
|
||||
{
|
||||
/// At least one of Q2 errors is out of range for the Q2 correction
|
||||
/// At least one of Q2 errors is out of range for Q2 correction
|
||||
/// Q2 error is out of range for the Q2 correction
|
||||
log.WarnFormat("OoR => no Q2 correction: Pos={0}, PCB#={1}, ***Q2_RL err={2}%***, ***Q2_LR err={3}%***, CalTarget={4}%, [Lo={5}%, Hi={6}%]",
|
||||
ihead.Name,
|
||||
@ -2022,7 +2006,7 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
}
|
||||
else
|
||||
{
|
||||
/// Q2 error is out of range for the Q2 correction
|
||||
/// Q2 error is out of range for Q2 correction
|
||||
log.WarnFormat("OoR => no Q2 correction: Pos={0}, PCB#={1}, ***Q2adj err={2}%***, CalTarget={3}%, [Lo={4}%, Hi={5}%]",
|
||||
ihead.Name,
|
||||
ihead.SerialNr,
|
||||
@ -2048,7 +2032,7 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
///
|
||||
/// Standard process
|
||||
///
|
||||
if (Math.Abs(ihead.Q2ErrWOCorrection) <= 0.5)
|
||||
if (Math.Abs(q2adjResult.Error) <= 0.5)
|
||||
{
|
||||
resultStr = string.Format("Q2 correction = 0 (writing bypassed)");
|
||||
return CommErr.None;
|
||||
@ -2062,18 +2046,18 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
///
|
||||
/// Process for DEWA
|
||||
///
|
||||
if (ihead.Q2ErrWOCorrection >= 0 && ihead.Q2ErrWOCorrection <= 1.0)
|
||||
if ((q2adjResult.Error >= 0) && (q2adjResult.Error <= 1.0))
|
||||
{
|
||||
resultStr = string.Format("Q2 correction = 0 (writing bypassed)");
|
||||
return CommErr.None;
|
||||
}
|
||||
|
||||
if (ihead.Q2ErrWOCorrection < 0)
|
||||
if (q2adjResult.Error < 0)
|
||||
{
|
||||
q2CorrRL = (byte)((int)Math.Round(1.1 * q2Correction) & 0x000000FF);
|
||||
q2CorrLR = (byte)((int)Math.Round(1.1 * q2Correction) & 0x000000FF);
|
||||
}
|
||||
else /// if (wm.Q2ErrorWOCorrection > 1.0)
|
||||
else /// if (q2adjResult.Error > 1.0)
|
||||
{
|
||||
q2CorrRL = (byte)((int)Math.Round(0.5 * q2Correction) & 0x000000FF);
|
||||
q2CorrLR = (byte)((int)Math.Round(0.5 * q2Correction) & 0x000000FF);
|
||||
@ -2086,7 +2070,7 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
}
|
||||
else if (q2CorrType == Q2CorrType.RL) /// SUEZ
|
||||
{
|
||||
if (Math.Abs(ihead.Q2ErrWOCorrection) <= 0.5)
|
||||
if (Math.Abs(q2adjResult.Error) <= 0.5)
|
||||
{
|
||||
resultStr = string.Format("Q2 correction = 0 (writing bypassed)");
|
||||
return CommErr.None;
|
||||
@ -2096,7 +2080,7 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
}
|
||||
else if (q2CorrType == Q2CorrType.LR) /// SUEZ
|
||||
{
|
||||
if (Math.Abs(ihead.Q2ErrWOCorrection) <= 0.5)
|
||||
if (Math.Abs(q2adjResult.Error) <= 0.5)
|
||||
{
|
||||
resultStr = string.Format("Q2 correction = 0 (writing bypassed)");
|
||||
return CommErr.None;
|
||||
@ -2208,17 +2192,9 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
rfidDataLogger.WarnFormat("{0}: {1}", ihead.Name, resultStr);
|
||||
ihead.Q2CorrectionDone = true;
|
||||
ihead.Q2Correction = q2Correction;
|
||||
if (q2CorrType != Q2CorrType.LR) ihead.Q2CorrRL = (int)(sbyte)q2CorrRL;
|
||||
if (q2CorrType != Q2CorrType.RL) ihead.Q2CorrLR = (int)(sbyte)q2CorrLR;
|
||||
|
||||
if (wm != null)
|
||||
{
|
||||
wm.Q2ErrWOCorrection = ihead.Q2ErrWOCorrection;
|
||||
wm.Q2CorrectionDone = ihead.Q2CorrectionDone;
|
||||
wm.Q2Correction = ihead.Q2Correction;
|
||||
if (q2CorrType != Q2CorrType.LR) wm.Q2CorrRL = ihead.Q2CorrRL;
|
||||
if (q2CorrType != Q2CorrType.RL) wm.Q2CorrLR = ihead.Q2CorrLR;
|
||||
}
|
||||
wm.Q2ErrWOCorrection = ihead.Q2ErrWOCorrection;
|
||||
if (q2CorrType != Q2CorrType.LR) wm.Q2CorrRL = ihead.Q2CorrRL = (int)(sbyte)q2CorrRL;
|
||||
if (q2CorrType != Q2CorrType.RL) wm.Q2CorrLR = ihead.Q2CorrLR = (int)(sbyte)q2CorrLR;
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -2261,15 +2237,8 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
if (0 == WriteRequestPort(threadId, ihead, MessageID.MetrologyMemory, Hz2CorrFactorsAddr, wrData.Length, wrData, cfg.CommTimeout))
|
||||
{
|
||||
error = CommErr.None;
|
||||
ihead.Hz2Correction = hz2CorrectionFactor;
|
||||
ihead.Hz2CorrectionDone = true;
|
||||
|
||||
if (wm != null)
|
||||
{
|
||||
wm.Hz2CorrectionDone = ihead.Hz2CorrectionDone;
|
||||
wm.Hz2Correction = ihead.Hz2Correction;
|
||||
}
|
||||
|
||||
wm.Hz2Correction = ihead.Hz2Correction = hz2CorrectionFactor;
|
||||
wm.Hz2CorrectionDone = ihead.Hz2CorrectionDone = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
@ -2292,33 +2261,21 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
error = CommErr.None;
|
||||
resultStr = string.Format("2Hz factor = {0}", (SByte)hz2CorrectionByte);
|
||||
rfidDataLogger.Warn(ihead.Name + ": " + resultStr);
|
||||
ihead.Hz2CorrectionFactor = hz2CorrectionFactor;
|
||||
|
||||
if (wm != null)
|
||||
{
|
||||
wm.Diff2Hz8Hz = ihead.Diff2Hz8Hz;
|
||||
wm.Hz2CorrectionDone = ihead.Hz2CorrectionDone;
|
||||
wm.Hz2Correction = ihead.Hz2CorrectionFactor;
|
||||
}
|
||||
|
||||
wm.Hz2Correction = ihead.Hz2CorrectionFactor = hz2CorrectionFactor;
|
||||
wm.Diff2Hz8Hz = ihead.Diff2Hz8Hz;
|
||||
wm.Hz2CorrectionDone = ihead.Hz2CorrectionDone;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
if (error == CommErr.None)
|
||||
if (error == CommErr.None)
|
||||
{
|
||||
resultStr = string.Format("2Hz correction = {0}", (SByte)hz2CorrectionByte);
|
||||
rfidDataLogger.Warn(ihead.Name + ": " + resultStr);
|
||||
ihead.Hz2CorrectionDone = true;
|
||||
ihead.Hz2Correction = hz2CorrectionFactor;
|
||||
|
||||
if (wm != null)
|
||||
{
|
||||
wm.Diff2Hz8Hz = ihead.Diff2Hz8Hz;
|
||||
wm.Hz2CorrectionDone = ihead.Hz2CorrectionDone;
|
||||
wm.Hz2Correction = ihead.Hz2Correction;
|
||||
}
|
||||
wm.Diff2Hz8Hz = ihead.Diff2Hz8Hz;
|
||||
wm.Hz2CorrectionDone = ihead.Hz2CorrectionDone = true;
|
||||
wm.Hz2Correction = ihead.Hz2Correction = hz2CorrectionFactor;
|
||||
}
|
||||
#endif
|
||||
|
||||
@ -2326,7 +2283,9 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
#endif /// IPERL
|
||||
|
||||
#endregion
|
||||
|
||||
/// <summary>
|
||||
|
||||
@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
[assembly: AssemblyVersion("2.18.1182.0")]
|
||||
[assembly: AssemblyFileVersion("2.18.1182.0")]
|
||||
[assembly: AssemblyVersion("2.18.1183.0")]
|
||||
[assembly: AssemblyFileVersion("2.18.1183.0")]
|
||||
|
||||
Loading…
Reference in New Issue
Block a user