Compare commits

...
19 changed files with 160 additions and 145 deletions
+2 -2
View File
@@ -18,7 +18,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;MUNICH</DefineConstants>
<DefineConstants>TRACE;DEBUG;BAHRAIN_50</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
@@ -28,7 +28,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;MUNICH</DefineConstants>
<DefineConstants>TRACE;BAHRAIN_50</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
+8
View File
@@ -25,6 +25,14 @@ namespace Config.Entities
Count
}
public enum Counting
{
Arbitrary,
Positive,
Negative,
Count
}
public enum OptoHeadState
{
Disabled,
+8
View File
@@ -93,6 +93,8 @@ namespace Results.Entities
#if ORACLE_DB
public virtual int Pruefindex { get; set; } /// Not mapped to DB !!! 0=unknown (saving to Oracle failed), >=1 ... pruefindex
public virtual int HydrPruefung { get; set; } /// Not mapped to DB !!!
public virtual int WMTypeRevision { get; set; } /// Not mapped to DB !!!
public virtual object TestInfos { get; set; } /// SensusTestInfo[] array fetched at the beginning of the cycle, not mapped to DB !!!
#endif
public virtual WaterMeterData WaterMeterData { get; set; }
public virtual Batch Batch { get; set; }
@@ -341,6 +343,10 @@ namespace Results.Entities
public WaterMeter()
{
MeterTestRslts = new List<MeterTestRslt>();
#if ORACLE_DB
WMTypeRevision = 0;
TestInfos = null;
#endif
}
@@ -394,6 +400,8 @@ namespace Results.Entities
#if ORACLE_DB
Pruefindex = src.Pruefindex;
HydrPruefung = src.HydrPruefung;
WMTypeRevision = src.WMTypeRevision;
TestInfos = src.TestInfos;
#endif
foreach (var mtr in MeterTestRslts)
{
-2
View File
@@ -54,7 +54,6 @@ namespace Results.Entities
#if ORACLE_DB
public virtual int WMTypeId { get; set; }
public virtual int WMTypeRev { get; set; }
#endif
public WaterMeterData()
@@ -111,7 +110,6 @@ namespace Results.Entities
#if ORACLE_DB
if (WMTypeId != wmd.WMTypeId) return false;
if (WMTypeRev != wmd.WMTypeRev) return false;
#endif
return true;
}
-1
View File
@@ -54,7 +54,6 @@ namespace Results.Mappings
#endif
#if ORACLE_DB
Map(x => x.WMTypeId);
Map(x => x.WMTypeRev);
#endif
}
}
+2 -2
View File
@@ -18,7 +18,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;MUNICH</DefineConstants>
<DefineConstants>TRACE;DEBUG;BAHRAIN_50</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
@@ -27,7 +27,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;MUNICH</DefineConstants>
<DefineConstants>TRACE;BAHRAIN_50</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
+2 -2
View File
@@ -21,7 +21,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;MUNICH</DefineConstants>
<DefineConstants>TRACE;DEBUG;BAHRAIN_50</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
@@ -31,7 +31,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;MUNICH</DefineConstants>
<DefineConstants>TRACE;BAHRAIN_50</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
@@ -61,7 +61,6 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
/// The following 3 variables are always update together
///
int id_WZTyp;
int rev_WZTyp;
SensusTestInfo[] completeTestInfos; /// Contains (1) range (90-100/100-110), (2) TBF test name, (3) string form of the flowId ...
/// ... in addition to incomplete test info from Oracle
@@ -136,19 +135,36 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
/// <param name="wmTypeId">Water meter type Id</param>
/// <param name="wmTypeRevision">Water meter type revision</param>
/// <returns>SensusTestInfos array</returns>
SensusTestInfo[] GetMatchingTestInfo(OracleConnection conn, int wmTypeId, int wmTypeRevision)
SensusTestInfo[] GetMatchingTestInfo(OracleConnection conn, int wmTypeId, out int wmTypeRevision)
{
///
/// Read 'incomplete' TestInfo from Oracle database containing only flowId-s ad qBezeichnung-s
///
IList<SensusTestInfo> oraDbTinfos = new List<SensusTestInfo>();
OracleCommand cmd = new OracleCommand("SELECT PruefungsNr, PosFehlerKalt, QBezeichnung FROM VT_PRUEFPUNKT_SOLL_SD WHERE ANBID=4 AND ID_WZTyp=:1 AND Rev_WZTyp=:2", conn);
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = wmTypeId }); ///:1
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = wmTypeRevision }); ///:2
///
/// For a given 'wmTypeId' find the most recent active 'wmTypeRevision'
///
wmTypeRevision = -1;
OracleCommand cmd = new OracleCommand("select REV_WZTYP from VT_WZTYP_SD where ANBID=4 and ID_WZTyp=:1 and AKTIV=:2", conn);
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = wmTypeId }); ///:1
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = 1 }); ///:2
///
OracleDataReader dr = cmd.ExecuteReader();
while (dr.Read())
{
wmTypeRevision = dr.GetInt32(0);
}
dr.Close();
if (wmTypeRevision == -1) return null; /// No 'wmTypeRevision' found
cmd = new OracleCommand("select PruefungsNr, PosFehlerKalt, QBezeichnung from VT_PRUEFPUNKT_SOLL_SD where ANBID=4 and ID_WZTyp=:1 and Rev_WZTyp=:2", conn);
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = wmTypeId }); ///:1
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = wmTypeRevision }); ///:2
///
dr = cmd.ExecuteReader();
while (dr.Read())
{
int pruefungsNr = dr.GetInt32(0);
double errLimHi = dr.GetDouble(1);
@@ -402,15 +418,18 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
try
{
if (completeTestInfos == null || (id_WZTyp != wm.WaterMeterData.WMTypeId) || (rev_WZTyp != wm.WaterMeterData.WMTypeRev))
if (completeTestInfos == null || (id_WZTyp != wm.WaterMeterData.WMTypeId))
{
SensusTestInfo[] ti = GetMatchingTestInfo(conn, wm.WaterMeterData.WMTypeId, wm.WaterMeterData.WMTypeRev);
int wmTypeRev;
SensusTestInfo[] ti = GetMatchingTestInfo(conn, wm.WaterMeterData.WMTypeId, out wmTypeRev);
if (ti != null)
{
completeTestInfos = ti;
id_WZTyp = wm.WaterMeterData.WMTypeId;
rev_WZTyp = wm.WaterMeterData.WMTypeRev;
completeTestInfos = ti;
wm.TestInfos = ti;
wm.WMTypeRevision = wmTypeRev;
Sequences.ProcessData.TestInfos = ti;
}
else
{
@@ -609,9 +628,11 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
transaction = conn.BeginTransaction();
SaveBatchData(conn, batch);
int wmTypeRev = SaveBatchData(conn, batch);
foreach (var wMtr in batch.WaterMeters)
{
if (wMtr.WMTypeRevision == 0) { wMtr.WMTypeRevision = wmTypeRev; }
SaveSingleWM2DB(conn, wMtr, safeMode);
}
@@ -726,17 +747,21 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
/// Save common batch data
/// </summary>
/// <param name="b">Batch</param>
void SaveBatchData(OracleConnection conn, Results.Entities.Batch b)
/// <returns>WM type revision</returns>
int SaveBatchData(OracleConnection conn, Results.Entities.Batch b)
{
if ((completeTestInfos == null) || (id_WZTyp != b.WaterMeters[0].WaterMeterData.WMTypeId) || (rev_WZTyp != b.WaterMeters[0].WaterMeterData.WMTypeRev))
int wmTypeRev = b.WaterMeters[0].WMTypeRevision;
if ((completeTestInfos == null) || (id_WZTyp != b.WaterMeters[0].WaterMeterData.WMTypeId))
{
SensusTestInfo[] ti = GetMatchingTestInfo(conn, b.WaterMeters[0].WaterMeterData.WMTypeId, b.WaterMeters[0].WaterMeterData.WMTypeRev);
int wmTR = 0;
SensusTestInfo[] ti = GetMatchingTestInfo(conn, b.WaterMeters[0].WaterMeterData.WMTypeId, out wmTR);
if (ti != null)
{
completeTestInfos = ti;
wmTypeRev = wmTR;
id_WZTyp = b.WaterMeters[0].WaterMeterData.WMTypeId;
rev_WZTyp = b.WaterMeters[0].WaterMeterData.WMTypeRev;
}
else
{
@@ -744,6 +769,11 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
}
}
if (completeTestInfos == null || wmTypeRev == 0)
{
throw new Exception("No matching test infos found");
}
OracleCommand cmd = new OracleCommand("INSERT INTO VT_PRUEFREIHE_PD(ANBID, ID_Pruefstand, ID_WzPruefreihe, ID_WZTyp, " +
"Rev_WZTyp, Rev_Pruefstand_WZTyp, StartDatumZeit, EndDatumZeit, Betriebsart, " +
"QVzKontakt, FuellenBegDruck, DruckEvakVorne, DruckEvakHinten, DruckBeiAbpressen, " +
@@ -754,7 +784,7 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = 18000 + b.TestBenchId });
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = b.BatchNr });
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = b.WaterMeters[0].WaterMeterData.WMTypeId });
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = b.WaterMeters[0].WaterMeterData.WMTypeRev });
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = wmTypeRev });
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = 1 });
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.TimeStamp, Value = b.StartTime });
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.TimeStamp, Value = b.EndTime });
@@ -813,6 +843,8 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
}
log.InfoFormat("Batch data saved, batchNr={0}", b.BatchNr);
return wmTypeRev;
}
@@ -919,7 +951,7 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
mtr.Error = Formulas.ErrorFromVolumes(mtr.VolumeMeter, mtr.VolumeRef);
}
SaveMeterTestResult(conn, mtr, testInfo.PruefungsNr, max_Pruefindex);
SaveMeterTestResult(conn, mtr, testInfo.PruefungsNr, max_Pruefindex, wm.WMTypeRevision);
}
@@ -954,7 +986,7 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
/// </summary>
/// <param name="q">q = 0, 1, 2 or 3 (Adj., Q1, Q2, Q3)</param>
/// <returns>Nr. of rows updated</returns>
int SaveMeterTestResult(OracleConnection conn, Results.Entities.MeterTestRslt mtr, int pruefungsNr, int max_Pruefindex) ///
int SaveMeterTestResult(OracleConnection conn, Results.Entities.MeterTestRslt mtr, int pruefungsNr, int max_Pruefindex, int wmTypeRevision) ///
{
double Q_wm = 3600.0 * mtr.VolumeMeter / mtr.TestTime; /// in [l/hour]
double Q_wm_with_upper_bound = Math.Min(2 * 1000 * mtr.TestRslt.FlowVolume, Math.Max(0.0, Q_wm));
@@ -970,7 +1002,7 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = pruefungsNr });
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = Anbid_StaraTura });
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = mtr.WaterMeter.WaterMeterData.WMTypeId });
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = mtr.WaterMeter.WaterMeterData.WMTypeRev });
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = wmTypeRevision });
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = 1 });
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Double, Value = Q_wm_with_upper_bound });
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Double, Value = Math.Min(100.0, Math.Max(-100.0, mtr.Error)) });
@@ -23,8 +23,6 @@ namespace TBF.BenchControl.Output.FileWriters.IperlLogger
WriterCfg writerCfg;
SensusTestInfo[] testInfos;
enum CurrentOp
{
None,
@@ -51,8 +49,6 @@ namespace TBF.BenchControl.Output.FileWriters.IperlLogger
writerCfg = cfg as WriterCfg;
currentOp = CurrentOp.None;
testInfos = SensusTestInfo.GetTestInfos(writerCfg.LogType);
log.Debug(this.ToString());
}
@@ -176,13 +172,22 @@ namespace TBF.BenchControl.Output.FileWriters.IperlLogger
return Retv.Error; /// No logger
}
Results.Entities.WaterMeter wm0 = null;
foreach (var m in batch.WaterMeters) if (m != null) { wm0 = m; break; }
if (wm0 == null)
{
return Retv.Error; /// Not a single watermeter in the batch
}
SensusTestInfo[] testInfos = wm0.TestInfos as SensusTestInfo[];
if (testInfos == null)
{
return Retv.Error; /// No test infos
}
Results.Entities.WaterMeterData wmData = wm0.WaterMeterData;
Results.Entities.MeterTestRslt[] wm0trs = new Results.Entities.MeterTestRslt[testInfos.Length];
@@ -213,11 +218,11 @@ namespace TBF.BenchControl.Output.FileWriters.IperlLogger
logger.WriteLine(string.Format("Qn={0}", wmData.Q3_Qn.ToString("F1", Program.AltCulture)));
logger.WriteLine(string.Format("Impulsrate=1"));
logger.WriteLine(string.Format("WZid={0}", wmData.WMTypeId));
logger.WriteLine(string.Format("RevWzTyp={0}", wmData.WMTypeRev));
logger.WriteLine(string.Format("RevWzTyp={0}", wm0.WMTypeRevision));
logger.WriteLine(string.Format("RevPruefstandWzTyp=2"));
for (int j = 0; j < testInfos.Length; j++)
{
{
string fId = testInfos[j].PruefungsNrStr;
string qBz = testInfos[j].QBezeichnung;
Results.Entities.MeterTestRslt wm0r = wm0trs[j];
@@ -225,7 +230,7 @@ namespace TBF.BenchControl.Output.FileWriters.IperlLogger
if (wm0r != null)
{
logger.WriteLine(string.Format("Durchfluss{0}={1}", fId, Units.ConvertTo(Unit.lph, wm0r.Qfrom()).ToString("F1", Program.AltCulture)));
logger.WriteLine(string.Format("Durchfluss{0}={1}", fId, Units.ConvertTo(Unit.lph, (wm0r.Qfrom() + wm0r.Qto()) / 2).ToString("F1", Program.AltCulture)));
logger.WriteLine(string.Format("Prüfzeit{0}={1}", fId, wm0r.TargetTime().ToString("F0")));
logger.WriteLine(string.Format("Prüfbereich100_110{0}={1}", fId, (pb_100_110 ? 1 : 0)));
logger.WriteLine(string.Format("PrüfbereichMin{0}={1}", fId, (pb_100_110 ? 100 : 90)));
@@ -233,8 +238,8 @@ namespace TBF.BenchControl.Output.FileWriters.IperlLogger
logger.WriteLine(string.Format("QBezeichnung{0}={1}", fId, qBz));
if (fId != "-1")
{
logger.WriteLine(string.Format("PosFehlergrenze{0}={1}", fId, wm0r.ErrLimHi().ToString("F1", Program.AltCulture)));
logger.WriteLine(string.Format("NegFehlergrenze{0}={1}", fId, wm0r.ErrLimLo().ToString("F1", Program.AltCulture)));
logger.WriteLine(string.Format("PosFehlergrenze{0}={1}", fId, (wm0r.ErrLimHi() - wm0r.Uncertainty()).ToString("F1", Program.AltCulture)));
logger.WriteLine(string.Format("NegFehlergrenze{0}={1}", fId, (wm0r.ErrLimLo() + wm0r.Uncertainty()).ToString("F1", Program.AltCulture)));
logger.WriteLine(string.Format("PosFehlergrenzeWarm{0}=0,0", fId));
logger.WriteLine(string.Format("NegFehlergrenzeWarm{0}=0,0", fId));
}
@@ -17,7 +17,6 @@ namespace TBF.BenchControl.Output.FileWriters.IperlLogger
public IComponentCfgCtrl GetControl() { return new Configs.ParamsProvider.ComponentCfgCtrl(this, null); }
public LogType LogType;
public string DestinationPath; /// Directory path into which the logs will be saved
public bool YearFolders;
public bool MonthFolders;
@@ -42,7 +41,6 @@ namespace TBF.BenchControl.Output.FileWriters.IperlLogger
public void InitializeAll()
{
LogType = LogType.Just_Q1Q2Q3;
DestinationPath = Program.HomeDir + "Logs\\";
YearFolders = true;
MonthFolders = true;
@@ -51,7 +49,6 @@ namespace TBF.BenchControl.Output.FileWriters.IperlLogger
string[] paramNames = new string[]
{
"Log type",
"Destination path",
"Year folders",
"Month folders",
@@ -64,14 +61,9 @@ namespace TBF.BenchControl.Output.FileWriters.IperlLogger
{
switch (i)
{
case 0:
IList<string> list1 = new List<string>();
for (LogType lt = 0; lt < LogType.Count; lt++) list1.Add(lt.ToString());
return list1;
case 1:
case 2:
case 3:
case 4:
IList<string> list2 = new List<string>();
list2.Add(Strings.yes);
list2.Add(Strings.no);
@@ -85,9 +77,8 @@ namespace TBF.BenchControl.Output.FileWriters.IperlLogger
{
if (i == -1)
{
return string.Format("{0}: LogType={1}, Dest.={2}, Y={3}, M={4}, D={5}",
return string.Format("{0}: Dest.={1}, Y={2}, M={3}, D={4}",
Name,
LogType,
DestinationPath,
YearFolders,
MonthFolders,
@@ -96,11 +87,10 @@ namespace TBF.BenchControl.Output.FileWriters.IperlLogger
switch (i)
{
case 0: return LogType.ToString();
case 1: return DestinationPath;
case 2: return YearFolders ? Strings.yes : Strings.no;
case 3: return MonthFolders ? Strings.yes : Strings.no;
case 4: return DayFolders ? Strings.yes : Strings.no;
case 0: return DestinationPath;
case 1: return YearFolders ? Strings.yes : Strings.no;
case 2: return MonthFolders ? Strings.yes : Strings.no;
case 3: return DayFolders ? Strings.yes : Strings.no;
default: return string.Empty;
}
}
@@ -109,21 +99,10 @@ namespace TBF.BenchControl.Output.FileWriters.IperlLogger
{
switch (i)
{
case 0:
for (LogType lt = 0; lt < LogType.Count; lt++)
{
if (lt.ToString() == strValue)
{
LogType = lt;
return CfgUpdateFlags.RestartRqrd;
}
}
return CfgUpdateFlags.None;
case 1: DestinationPath = strValue; return CfgUpdateFlags.RestartRqrd;
case 2: YearFolders = (strValue == Strings.yes); return CfgUpdateFlags.RestartRqrd;
case 3: MonthFolders = (strValue == Strings.yes); return CfgUpdateFlags.RestartRqrd;
case 4: DayFolders = (strValue == Strings.yes); return CfgUpdateFlags.RestartRqrd;
case 0: DestinationPath = strValue; return CfgUpdateFlags.RestartRqrd;
case 1: YearFolders = (strValue == Strings.yes); return CfgUpdateFlags.RestartRqrd;
case 2: MonthFolders = (strValue == Strings.yes); return CfgUpdateFlags.RestartRqrd;
case 3: DayFolders = (strValue == Strings.yes); return CfgUpdateFlags.RestartRqrd;
default: return CfgUpdateFlags.None;
}
@@ -136,16 +115,10 @@ namespace TBF.BenchControl.Output.FileWriters.IperlLogger
switch (i)
{
case 0:
for (LogType lt = 0; lt < LogType.Count; lt++)
{
if (lt.ToString() == strValue) return true;
}
break;
case 1:
return true;
case 1:
case 2:
case 3:
case 4:
if (strValue == Strings.yes || strValue == Strings.no) return true;
break;
default:
@@ -159,7 +132,6 @@ namespace TBF.BenchControl.Output.FileWriters.IperlLogger
void CopyContentTo(WriterCfg prms)
{
prms.LogType = this.LogType;
prms.DestinationPath = this.DestinationPath;
prms.YearFolders = this.YearFolders;
prms.MonthFolders = this.MonthFolders;
+17 -6
View File
@@ -8,8 +8,9 @@ namespace TBF.BenchControl.Output
{
public enum LogType
{
Auto,
Just_Q1Q2Q3,
Just_Q1Q2Q2adjQ3, /// Greece
Just_Q1Q2Q2adjQ3, /// Greece
Just_Q1Q2__Q3,
DEWA, /// Q1, Q2adj, Q2, Q3, Q4
Suez, /// two directions
@@ -56,9 +57,9 @@ namespace TBF.BenchControl.Output
/// <returns>true when two test info-s are compatible</returns>
public static bool AreCompatible(IList<SensusTestInfo> oraDbTInfo, SensusTestInfo[] myCompleteTInfo)
{
if (oraDbTInfo.Count != myCompleteTInfo.Length) return false;
if (oraDbTInfo.Count > myCompleteTInfo.Length) return false;
for (int i = 0; i < myCompleteTInfo.Length; i++)
for (int i = 0; i < oraDbTInfo.Count; i++)
{
if (oraDbTInfo[i].PruefungsNr != myCompleteTInfo[i].PruefungsNr)
{
@@ -84,15 +85,15 @@ namespace TBF.BenchControl.Output
{
switch (logType)
{
default:
case LogType.Just_Q1Q2Q3:
return new SensusTestInfo[]
{
new SensusTestInfo(-1, "-1", "Just", Range.R90_100, "Adjustment"),
new SensusTestInfo( 1, "01", "Q1", Range.R100_110, "Q1"),
new SensusTestInfo( 2, "02", "Q2", Range.R100_110, "Q2"),
new SensusTestInfo( 2, "", "Q2", Range.R100_110, "Q2"),
new SensusTestInfo( 3, "03", "Q3", Range.R90_100, "Q3"),
new SensusTestInfo( 9, "02", "Q2", Range.R100_110, "Q2adj"), /// <-- This is to generate opto-data
};
case LogType.Just_Q1Q2Q2adjQ3:
@@ -112,8 +113,9 @@ namespace TBF.BenchControl.Output
{
new SensusTestInfo(-1, "-1", "Just", Range.R90_100, "Adjustment"),
new SensusTestInfo( 1, "01", "Q1", Range.R100_110, "Q1"),
new SensusTestInfo( 2, "02", "Q2", Range.R100_110, "Q2"),
new SensusTestInfo( 2, "", "Q2", Range.R100_110, "Q2"),
new SensusTestInfo( 5, "05", "Q3", Range.R90_100, "Q3"),
new SensusTestInfo( 9, "02", "Q2", Range.R100_110, "Q2adj"), /// <-- This is to generate opto-data
};
case LogType.DEWA:
@@ -176,7 +178,16 @@ namespace TBF.BenchControl.Output
new SensusTestInfo(11, "11", "Q3", Range.R90_100, "Q3"),
new SensusTestInfo(12, "12", "Q4", Range.R90_100, "Q4"),
};
default:
return null;
}
}
public override string ToString()
{
return string.Format("{0}-'{1}'-'{2}'-'{3}'-{4}", PruefungsNr, PruefungsNrStr, QBezeichnung, TestName, Range);
}
}
}
-2
View File
@@ -1523,7 +1523,6 @@ namespace TBF.BenchControl.Sequences
HeatMeter = heatMeters,
#if ORACLE_DB
WMTypeId = 0, /// <--------------------------- TODO
WMTypeRev = 0,
#endif
};
}
@@ -1601,7 +1600,6 @@ namespace TBF.BenchControl.Sequences
wm.Disabled = false;
#if ORACLE_DB
wm.WaterMeterData.WMTypeId = wm2.WaterMeterData.WMTypeId;
wm.WaterMeterData.WMTypeRev = wm2.WaterMeterData.WMTypeRev;
#endif
break;
}
@@ -9,6 +9,7 @@ namespace TBF.BenchControl.Sequences
public static IBenchInfo BenchInfo;
public static IErrorFlags ErrorFlagsComp;
public static Output.DB.SensusOracle.Database OracleDB;
public static Output.SensusTestInfo[] TestInfos;
public static FloatBox AmbTemp = new FloatBox() { Name = "Ambient Temperature", Format = "F1" }; /// [Celsius]
public static FloatBox AmbPress = new FloatBox() { Name = "Ambient Pressure", Format = "F0", Factor = 1000 }; /// [bar], printed by ToString() in [mbar]
@@ -2330,7 +2330,6 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
{
#if ORACLE_DB
meterRslt.WaterMeter.WaterMeterData.WMTypeId = iperlHeads[i].WMType_ID;
meterRslt.WaterMeter.WaterMeterData.WMTypeRev = iperlHeads[i].WMType_Rev;
#endif
meterRslt.WaterMeter.SerialNr = iperlHeads[i].SerialNr;
meterRslt.Passed = (!iperlHeads[i].CommFailed && !iperlHeads[i].Disabled);
@@ -109,7 +109,7 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead
/// Verify whether the flow direction is correct
/// </summary>
/// <returns>OptoHeadState.OptoAndDirOK, OptoHeadState.OptoNok or OptoHeadState.DirNok</returns>
public OptoHeadState CheckFlowDirection(FlowDir flowDir)
public OptoHeadState CheckFlowDirection(Counting counting)
{
if (!AreFifoDataValid()) return OptoHeadState.OptoNok;
@@ -123,11 +123,11 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead
if (slope > maxSlope) maxSlope = slope;
if (slope < minSlope) minSlope = slope;
if ((flowDir == FlowDir.R_L) && (maxSlope > -2 * minSlope))
if ((counting == Counting.Positive) && (maxSlope > -2 * minSlope))
{
return OptoHeadState.OptoAndDirOK;
}
else if ((flowDir == FlowDir.L_R) && (minSlope < -2 * maxSlope))
else if ((counting == Counting.Negative) && (minSlope < -2 * maxSlope))
{
return OptoHeadState.OptoAndDirOK;
}
@@ -38,11 +38,9 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead
public float CalibTarget { get { return iperlHeadCfg.ProcParams.CalibTarget; } }
public ushort FactorLimitLo { get { return (ushort)iperlHeadCfg.ProcParams.FactorLimitLo; } }
public ushort FactorLimitHi { get { return (ushort)iperlHeadCfg.ProcParams.FactorLimitHi; } }
public FlowDir InitFlowDir { get { return (iperlHeadCfg != null && iperlHeadCfg.ProcParams != null) ? iperlHeadCfg.ProcParams.FlowDir : FlowDir.R_L; } }
public LogType LogType { get { return iperlHeadCfg.ProcParams.LogType; } }
public Counting InitFlowDir { get { return (iperlHeadCfg != null && iperlHeadCfg.ProcParams != null) ? iperlHeadCfg.ProcParams.Counting : Counting.Arbitrary; } }
#if ORACLE_DB
public int WMType_ID { get { return iperlHeadCfg.ProcParams.WMType_ID; } } /// Required by Oracle DB
public int WMType_Rev { get { return iperlHeadCfg.ProcParams.WMType_Rev; } } /// Required by Oracle DB
#endif
/// Properties set by the Begin and the End form
@@ -459,7 +457,7 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead
}
FlowDir currentFlowDir;
Counting currentFlowDir;
///
public OptoHeadState CheckFlowDirection()
{
@@ -468,7 +466,22 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead
///
public void ChangeFlowDirection()
{
currentFlowDir = (InitFlowDir == FlowDir.R_L) ? FlowDir.L_R : FlowDir.R_L;
switch (InitFlowDir)
{
case Counting.Positive:
currentFlowDir = Counting.Negative;
break;
case Counting.Negative:
currentFlowDir = Counting.Positive;
break;
case Counting.Arbitrary:
default:
currentFlowDir = Counting.Arbitrary;
break;
}
if (flowDirectionDetection != null) flowDirectionDetection.ClearFifo(); /// Clear FIFO for flow direction detection
}
@@ -567,13 +580,13 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead
string wmPosition = Name.Substring(5);
if (wmPosition.Length == 1) wmPosition = "0" + wmPosition;
SensusTestInfo[] testInfos = SensusTestInfo.GetTestInfos(LogType);
SensusTestInfo[] testInfos = Sequences.ProcessData.TestInfos;
optoDataLogFileName = null;
///
foreach (var ti in testInfos)
{
if ((testName != null) && (testName == ti.TestName))
if ((testName != null) && (testName == ti.TestName) && !string.IsNullOrEmpty(ti.PruefungsNrStr))
{
optoDataLogFileName = string.Format("{0}_{1}_{2}_{3}.txt",
(ConfigStruct != null) ? ConfigStruct.GetPcbNrString() : "UnknownPcbNr",
@@ -3,12 +3,9 @@
///
using System;
using System.IO;
using System.Text;
using System.Xml.Serialization;
using Config.Entities;
using TBF.BenchControl.Generic;
using TBF.BenchControl.Output;
using TBF.Resources;
using System.Collections.Generic;
namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead
@@ -22,11 +19,9 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead
public float CalibTarget; /// Target error after calibration in [%]
public int FactorLimitLo; /// Lower limit for the calibration factor
public int FactorLimitHi; /// Upper limit for the calibration factor
public FlowDir FlowDir; /// Initial iPerl flow direction (R_L or L_R)
public LogType LogType;
public Counting Counting; /// Initial iPerl counting (Artbitrary, Positive or Negative)
#if ORACLE_DB
public int WMType_ID; /// Required for Oracle DB: ID_WZTyp in table VT_PRUEFPUNKT_SOLL_SD
public int WMType_Rev; /// Required for Oracle DB: Rev_WZTyp in table VT_PRUEFPUNKT_SOLL_SD
#endif
@@ -36,11 +31,9 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead
CalibTarget = 0;
FactorLimitLo = 1000;
FactorLimitHi = 8000;
FlowDir = FlowDir.R_L;
LogType = LogType.Just_Q1Q2Q3;
Counting = Counting.Arbitrary;
#if ORACLE_DB
WMType_ID = 2; /// Value for iPerl DN15
WMType_Rev = 1; /// Value for iPerl DN15
#endif
}
@@ -50,11 +43,9 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead
"Calib. target [%]",
"Calib. factor Lo",
"Calib. factor Hi",
"Flow direction",
"Log type",
"Counting",
#if ORACLE_DB
"WMType ID",
"WMType Rev.",
"WM type ID",
#endif
};
public override string ParamName(int i) { return paramNames[i]; }
@@ -74,12 +65,6 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead
for (FlowDir fd = 0; fd < FlowDir.Count; fd++) retVal.Add(fd.ToString());
return retVal;
}
else if (i == 5)
{
IList<string> retVal = new List<string>();
for (LogType lt = 0; lt < LogType.Count; lt++) retVal.Add(lt.ToString());
return retVal;
}
return null;
}
@@ -91,11 +76,9 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead
case 1: return CalibTarget.ToString();
case 2: return FactorLimitLo.ToString();
case 3: return FactorLimitHi.ToString();
case 4: return FlowDir.ToString();
case 5: return LogType.ToString();
case 4: return Counting.ToString();
#if ORACLE_DB
case 6: return WMType_ID.ToString();
case 7: return WMType_Rev.ToString();
case 5: return WMType_ID.ToString();
#endif
default: return string.Empty;
}
@@ -115,20 +98,13 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead
case 2: FactorLimitLo = int.Parse(strValue); return CfgUpdateFlags.None;
case 3: FactorLimitHi = int.Parse(strValue); return CfgUpdateFlags.None;
case 4:
for (FlowDir fd = 0; fd < FlowDir.Count; fd++)
for (Counting c = 0; c < Counting.Count; c++)
{
if (fd.ToString().Equals(strValue)) { FlowDir = fd; return CfgUpdateFlags.None; }
}
break;
case 5:
for (LogType lt = 0; lt < LogType.Count; lt++)
{
if (lt.ToString().Equals(strValue)) { LogType = lt; return CfgUpdateFlags.None; }
if (c.ToString().Equals(strValue)) { Counting = c; return CfgUpdateFlags.None; }
}
break;
#if ORACLE_DB
case 6: WMType_ID = int.Parse(strValue); return CfgUpdateFlags.None;
case 7: WMType_Rev = int.Parse(strValue); return CfgUpdateFlags.None;
case 5: WMType_ID = int.Parse(strValue); return CfgUpdateFlags.None;
#endif
default: return CfgUpdateFlags.None;
}
@@ -156,14 +132,10 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead
if (int.TryParse(strValue, out iDummy) && iDummy >= 1000 && iDummy <= 8000) return true;
break;
case 4:
for (FlowDir fd = 0; fd < FlowDir.Count; fd++) if (fd.ToString().Equals(strValue)) return true;
break;
case 5:
for (LogType lt = 0; lt < LogType.Count; lt++) if (lt.ToString().Equals(strValue)) return true;
for (Counting c = 0; c < Counting.Count; c++) if (c.ToString().Equals(strValue)) return true;
break;
#if ORACLE_DB
case 6: /// WMType_ID
case 7: /// WMType_Rev
case 5: /// WMType_ID
if (int.TryParse(strValue, out iDummy)) return true;
break;
#endif
@@ -182,11 +154,9 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead
prms.CalibTarget = this.CalibTarget;
prms.FactorLimitLo = this.FactorLimitLo;
prms.FactorLimitHi = this.FactorLimitHi;
prms.FlowDir = this.FlowDir;
prms.LogType = this.LogType;
prms.Counting = this.Counting;
#if ORACLE_DB
prms.WMType_ID = this.WMType_ID;
prms.WMType_Rev = this.WMType_Rev;
#endif
}
+2 -2
View File
@@ -54,9 +54,9 @@ namespace TBF
this.horizontalSplitContainer = new System.Windows.Forms.SplitContainer();
this.mainTabControl = new System.Windows.Forms.TabControl();
this.homeTabPage = new System.Windows.Forms.TabPage();
this.ctrlBrdComponent = new ControlComponent3Munich.UserControl1();
this.ctrlBrdComponent = new ControlComponent_Torino2015.UserControl1();
this.processTabPage = new System.Windows.Forms.TabPage();
this.processTabPageCtrl = new TBF.Screens.ProcessTabPageCtrl6();
this.processTabPageCtrl = new TBF.Screens.ProcessTabPageCtrl24();
this.insertTabPage = new System.Windows.Forms.TabPage();
this.resultsTabPage = new System.Windows.Forms.TabPage();
this.resultsTabPageCtrl = new TBF.Screens.ResultsTabPageCtrl();
+7 -6
View File
@@ -39,7 +39,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;MUNICH;CAMERA</DefineConstants>
<DefineConstants>TRACE;DEBUG;BAHRAIN_50;CAMERA;STABLE_MASS_EXTRAS</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
@@ -49,7 +49,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;MUNICH;CAMERA</DefineConstants>
<DefineConstants>TRACE;BAHRAIN_50;CAMERA;STABLE_MASS_EXTRAS</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
@@ -58,7 +58,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;MUNICH;CAMERA</DefineConstants>
<DefineConstants>TRACE;DEBUG;BAHRAIN_50;CAMERA;STABLE_MASS_EXTRAS</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
@@ -67,7 +67,7 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE;MUNICH;CAMERA</DefineConstants>
<DefineConstants>TRACE;BAHRAIN_50;CAMERA;STABLE_MASS_EXTRAS</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
@@ -97,8 +97,9 @@
<SignManifests>false</SignManifests>
</PropertyGroup>
<ItemGroup>
<Reference Include="ControlComponent3Munich">
<HintPath>..\packages\ControlBoard\Munich\ControlComponent3Munich.dll</HintPath>
<Reference Include="ControlComponent3U, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\ControlBoard\Bahrain50\ControlComponent3U.dll</HintPath>
</Reference>
<Reference Include="FluentNHibernate">
<HintPath>..\packages\FluentNHibernate.2.0.3.0\lib\net40\FluentNHibernate.dll</HintPath>