Compare commits

..
28 changed files with 633 additions and 397 deletions
+2 -2
View File
@@ -19,7 +19,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;TURA_IPERL;IPERL;ORACLE_DB;LANG_SK</DefineConstants>
<DefineConstants>TRACE;DEBUG;TURA_SPECIAL;IPERL;ORACLE_DB;LANG_SK</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
@@ -30,7 +30,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;TURA_IPERL;IPERL;ORACLE_DB;LANG_SK</DefineConstants>
<DefineConstants>TRACE;TURA_SPECIAL;IPERL;ORACLE_DB;LANG_SK</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
+1 -1
View File
@@ -170,7 +170,7 @@ namespace Results.Entities
writer.Write(LastError);
#endif
writer.Write((TestRslt != null && TestRslt.Name() != null) ? TestRslt.Name() : string.Empty);
writer.Write(TestRslt != null ? TestRslt.Part : 0);
writer.Write(TestRslt.Part);
}
public virtual void ReadBinary(BinaryReader reader, IList<TestRslt> testResults)
+15 -17
View File
@@ -9,11 +9,10 @@ namespace Results.Output
{
public enum LogType
{
Just_Q3Q2Q1, /// pNrs = -1,3,2,1
Just_Q3Q2Q1_Alt, /// pNrs = -1,5,2,1
Just_Q3Q2adjQ1, /// pNrs = -1,3,2,1
Just_Q3Q2adjQ1_Alt, /// pNrs = -1,5,2,1
JustA0A4_Q3Q2adjQ1, /// pNrs = -2,-1,3,2,1 (Australia 169 MHz)
Just_Q3Q2Q1, /// pNrs = 3,2,1
Just_Q3Q2Q1_Alt, /// pNrs = 5,2,1
Just_Q3Q2adjQ1, /// pNrs = 3,2,1
Just_Q3Q2adjQ1_Alt, /// pNrs = 5,2,1
DEWA, /// Q4, Q3, Q2adj, Q2, Q1
DEWA_wo_Q2, /// Q4, Q3, Q2adj, Q1
Suez, /// Two directions, with Q2 and Q2ac
@@ -24,6 +23,7 @@ namespace Results.Output
Suez_EMP_DN32, /// EMP: 12 flow rates
Suez_EMP_DN40, /// EMP: 12 flow rates
Greece, /// Q3, Q2adj, Q2, Q1
S620, /// Q3, Q100, Q2, Q1
Count,
None,
}
@@ -264,18 +264,6 @@ namespace Results.Output
new SensusTestInfo("Q1", 1, "Q1", 1, "01", 1, "Q1", Range.R100_110),
};
case LogType.JustA0A4_Q3Q2adjQ1:
return new SensusTestInfo[]
{
/// TBF Oracle DB Opto RAW LU logfiles
new SensusTestInfo("Q2adj", 0, "", 2, "02", 0, "", Range.R100_110),
new SensusTestInfo("Qjust_A0", -1, "Just", -1, "-1", -1, "Q-1", Range.R95_105),
new SensusTestInfo("Qjust_A4", -2, "Just", -2, "-2", -2, "Q-2", Range.R95_105),
new SensusTestInfo("Q3", 3, "Q3", 3, "03", 3, "Q3", Range.R90_100),
new SensusTestInfo("Q2", 2, "Q2", 0, "", 2, "Q2", Range.R100_110),
new SensusTestInfo("Q1", 1, "Q1", 1, "01", 1, "Q1", Range.R100_110),
};
case LogType.DEWA: /// DEWA (with Q4 and Q2 after correction)
return new SensusTestInfo[]
{
@@ -427,6 +415,16 @@ namespace Results.Output
new SensusTestInfo("Q2", 2, "Q2", 2, "02", 2, "Q2", Range.R100_110),
new SensusTestInfo("Q1", 1, "Q1", 1, "01", 1, "Q1", Range.R100_110),
};
case LogType.S620:
return new SensusTestInfo[]
{
/// TBF Oracle DB Opto RAW LU logfiles
new SensusTestInfo("Q3", 5, "Q3", 5, "04", 5, "Q3", Range.R90_100),
new SensusTestInfo("Q100", 4, "Q100l", 4, "03", 4,"Q100l", Range.R100_110),
new SensusTestInfo("Q2", 2, "Q2", 2, "02", 2, "Q2", Range.R100_110),
new SensusTestInfo("Q1", 1, "Q1", 1, "01", 1, "Q1", Range.R100_110),
};
}
}
+2 -2
View File
@@ -19,7 +19,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;TURA_IPERL;IPERL;ORACLE_DB;LANG_SK</DefineConstants>
<DefineConstants>TRACE;DEBUG;TURA_SPECIAL;IPERL;ORACLE_DB;LANG_SK</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
@@ -29,7 +29,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;TURA_IPERL;IPERL;ORACLE_DB;LANG_SK</DefineConstants>
<DefineConstants>TRACE;TURA_SPECIAL;IPERL;ORACLE_DB;LANG_SK</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
+2 -2
View File
@@ -21,7 +21,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;TURA_IPERL;IPERL;ORACLE_DB;LANG_SK</DefineConstants>
<DefineConstants>TRACE;DEBUG;TURA_SPECIAL;IPERL;ORACLE_DB;LANG_SK</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
@@ -32,7 +32,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;TURA_IPERL;IPERL;ORACLE_DB;LANG_SK</DefineConstants>
<DefineConstants>TRACE;TURA_SPECIAL;IPERL;ORACLE_DB;LANG_SK</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
@@ -1,9 +1,8 @@
///
/// Copyright (c) 2015-2019 Sensus Slovensko a.s.
/// Copyright (c) 2015-2020 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using log4net;
using Oracle.DataAccess.Client; // ODP.NET Oracle managed provider
@@ -21,6 +20,23 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
Error,
}
public enum DBUsed
{
None,
Production,
Test,
Quality,
Count
}
public enum WMKind
{
Iperl,
S620,
Count
}
public class Database : ComponentBase, IOperation, GenericDevices.IResultsWriter, GenericDevices.IStartInfoReader, Generic.IDevice
{
private static readonly ILog log = LogManager.GetLogger(typeof(Database));
@@ -28,7 +44,15 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
const int Anbid_StaraTura = 4;
public DatabaseCfg dbCfg;
DatabaseCfg dbCfg;
public DBUsed DBUsed { get { return (dbCfg == null || dbCfg.ProcParams == null) ? DBUsed.None : dbCfg.ProcParams.DBUsed; } }
public WMKind WMKind { get { return (dbCfg == null || dbCfg.ProcParams == null) ? WMKind.Iperl : dbCfg.ProcParams.WMKind; } }
public int WMTypeId { get { return (dbCfg == null || dbCfg.ProcParams == null) ? 0 : dbCfg.ProcParams.WMTypeId; } }
public int YearOfManufacture { get { return (dbCfg == null || dbCfg.ProcParams == null) ? DateTime.Now.Year : dbCfg.ProcParams.YearOfManufacture; } }
public bool SaveResults { get { return (dbCfg == null || dbCfg.ProcParams == null) ? false : dbCfg.ProcParams.SaveResults; } }
public bool ReadStartInfo { get { return (dbCfg == null || dbCfg.ProcParams == null) ? true : dbCfg.ProcParams.ReadStartInfo; } }
public bool StartInfoIsRequired { get { return (dbCfg == null || dbCfg.ProcParams == null) ? false : dbCfg.ProcParams.StartInfoIsRequired; } }
enum OpState
@@ -39,16 +63,12 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
WriteResultsScheduled,
WriteResultsRunning,
}
OpState currentOpState;
bool opCompleted;
bool anyError;
///
/// iPerls to verify
///
GenericDevices.IRegReader[] iperlHeads;
/// <summary>
/// Start info is read into WaterMeter objects referenced by this array
/// </summary>
@@ -59,7 +79,29 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
/// </summary>
Results.Entities.Batch batch;
OracleConnection connection; /// Oracle database connection
OracleConnection productionDB; /// Production Oracle DB connection
OracleConnection qualityDB; /// Quality Oracle DB connection
OracleConnection testDB; /// Test Oracle DB connection
OracleConnection selectedDB
{
get
{
if (dbCfg == null || dbCfg.ProcParams == null) return null;
switch (dbCfg.ProcParams.DBUsed)
{
case DBUsed.Production: return productionDB;
case DBUsed.Quality: return qualityDB;
case DBUsed.Test: return testDB;
default:
case DBUsed.None:
return null;
}
}
}
///
/// The following 3 variables are always updated together
@@ -86,38 +128,26 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
///
public void Initialize()
{
switch (dbCfg.DBUsed)
{
case DBUsed.Production:
connection = new OracleConnection("Data Source=STARA01.WORLD;User Id=deltachef;Password=deltachef;");
break;
case DBUsed.Quality:
connection = new OracleConnection("Data Source=STARA01.WORLD;User Id=deltaqual;Password=test;");
break;
case DBUsed.Test:
connection = new OracleConnection("Data Source=STARA_TEST.WORLD;User Id=deltachef;Password=deltachef;");
break;
default:
connection = null;
break;
}
productionDB = new OracleConnection("Data Source=STARA01.WORLD;User Id=deltachef;Password=deltachef;");
qualityDB = new OracleConnection("Data Source=STARA01.WORLD;User Id=deltaqual;Password=test;");
testDB = new OracleConnection("Data Source=STARA_TEST.WORLD;User Id=deltachef;Password=deltachef;");
if (dbCfg.DebugLevel == DebugMode.Simulate) return;
///
/// Do something with the database to see if the connection works well
///
if (connection != null)
if (productionDB != null)
{
connection.Open();
productionDB.Open();
string rslt = "none";
OracleCommand cmd = new OracleCommand("select Standort from ANBIETER_SD where ANBID = 4", connection);
OracleCommand cmd = new OracleCommand("select Standort from ANBIETER_SD where ANBID = 4", productionDB);
OracleDataReader dr = cmd.ExecuteReader();
if (dr.Read()) rslt = dr.GetString(0);
dr.Close();
connection.Close();
productionDB.Close();
}
}
///
@@ -126,9 +156,11 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
///
public void StopDevice()
{
if (connection != null) connection.Dispose();
if (testDB != null) testDB.Dispose();
if (qualityDB != null) qualityDB.Dispose();
if (productionDB != null) productionDB.Dispose();
}
public void StopDevice2() { }
public void StopDevice2() {}
/// <summary>
@@ -221,7 +253,7 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
/// <returns>Reference to the operation</returns>
public IOperation ReadStartInfoOp(IList<Results.Entities.WaterMeter> waterMeters)
{
if (!dbCfg.ReadStartInfo)
if (!ReadStartInfo)
{
return null;
}
@@ -244,7 +276,7 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
/// <returns>Reference to the operation</returns>
public IOperation ProcessResultsOp(Results.Entities.Batch batch)
{
if (!dbCfg.SaveResults)
if (!SaveResults)
{
return null;
}
@@ -287,11 +319,11 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
{
if (waterMeters.Count == 0) return Event.ResultsWritten;
if ((dbCfg.DebugLevel == DebugMode.Normal) && (connection != null))
if ((dbCfg.DebugLevel == DebugMode.Normal) && (selectedDB != null))
{
log.WarnFormat("{0} : Run() : currentOp = {1}", Name, currentOpState);
#if ORACLE_DB
if (ReadStartInfoFromDB(connection) == Retv.Error) anyError = true;
if (ReadStartInfoFromDB(selectedDB) == Retv.Error) anyError = true;
#endif
}
opCompleted = true;
@@ -305,11 +337,11 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
{
if (batch.WaterMeters.Count == 0) return Event.ResultsWritten;
if ((dbCfg.DebugLevel == DebugMode.Normal) && (connection != null))
if ((dbCfg.DebugLevel == DebugMode.Normal) && (selectedDB != null))
{
log.WarnFormat("{0} : Run() : currentOp = {1}", Name, currentOpState);
#if ORACLE_DB
if (WriteResultsToDB(connection, batch, false) == Retv.Error) anyError = true;
if (WriteResultsToDB(selectedDB, batch, false) == Retv.Error) anyError = true;
#endif
}
opCompleted = true;
@@ -495,7 +527,7 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
///
log.ErrorFormat("Water meter {0} was not found in ORACLE database.", wm.SerialNr);
dr.Close();
return dbCfg.StartInfoIsRequired ? Retv.Error : Retv.OK;
return StartInfoIsRequired ? Retv.Error : Retv.OK;
}
dr.Close();
@@ -651,10 +683,17 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
SaveBatchData(conn, batch);
foreach (var wMtr in batch.WaterMeters)
{
if ((wMtr.ErrorFlags & ((int)ErrorFlagMask.E26 | (int)ErrorFlagMask.E27 | (int)ErrorFlagMask.E28)) == 0)
if (WMKind == WMKind.Iperl)
{
/// No production error => write the result of testing to Oracle DB
SaveSingleWM2DB(conn, wMtr, safeMode);
if ((wMtr.ErrorFlags & ((int)ErrorFlagMask.E26 | (int)ErrorFlagMask.E27 | (int)ErrorFlagMask.E28)) == 0)
{
/// No production error => write the result of testing to Oracle DB
SaveOneIperlToDB(conn, wMtr, safeMode);
}
}
else if (WMKind == WMKind.S620)
{
SaveOneS620ToDB(conn, wMtr, safeMode);
}
}
@@ -672,43 +711,6 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
}
}
/// <summary>
/// Write one meter results into the database
/// </summary>
/// <param name="wmNr">0-based water meter number</param>
/// <param name="results">Sorted list of results to save</param>
void SaveSingleWM2DB(OracleConnection conn, Results.Entities.WaterMeter wm, bool safeMode)
{
if (safeMode && !wm.Passed) return;
if (string.IsNullOrEmpty(wm.SerialNr)) return; /// No database activity possible w/o PCB number
int maxpruefindexLowPart = ReadMaxPruefindex(conn, wm);
TBF.BenchControl.GenericDevices.IBenchInfo benchInfo = TBF.BenchControl.Sequences.ProcessData.BenchInfo;
int testBenchID = (benchInfo != null) ? benchInfo.TestBenchId : 1;
int MAX_Pruefindex = 100 * testBenchID + maxpruefindexLowPart + 1;
int Hydr_Pruefung;
if (wm.Passed)
{
/// Passed
if (maxpruefindexLowPart == 0)
Hydr_Pruefung = 96;
else
Hydr_Pruefung = 224;
}
else
{
/// Failed
Hydr_Pruefung = 97; /// Hydr. test failed, Pressure test passed
}
wm.Pruefindex = MAX_Pruefindex;
wm.HydrPruefung = Hydr_Pruefung;
SaveOrUpdateWM(conn, wm, MAX_Pruefindex, Hydr_Pruefung);
}
/// <summary>
///
/// </summary>
@@ -894,13 +896,13 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
cmd2.ExecuteNonQuery(); /// Returns nr. of updated rows
#else
OracleCommand cmd2 = new OracleCommand("INSERT INTO VT_PRUEFDURCHFLUSS_PD(" +
"ANBID, ID_Pruefstand, ID_WzPruefreihe, PruefungsNr, " +
"PVOL, PMasse, MinDurchfluss, MaxDurchfluss, " +
"Q_ist, KFaktor, Q_VZ, F_VZ, RegelEinstellZeit, Drehzahl, " +
"BeginnDruck_Vorne, BeginnDruck_Hinten, EndDruck_Vorne, EndDruck_Hinten, " +
"TVWZ, IVWZ, Verwendeter_VZ, BeginnGewicht, EndGewicht)" +
" VALUES (:1, :2, :3, :4, :5, :6, :7, :8, :9, :10, :11, :12, :13, :14, :15, " +
":16, :17, :18, :19, :20, :21, :22, :23)", conn);
"ANBID, ID_Pruefstand, ID_WzPruefreihe, PruefungsNr, " +
"PVOL, PMasse, MinDurchfluss, MaxDurchfluss, " +
"Q_ist, KFaktor, Q_VZ, F_VZ, RegelEinstellZeit, Drehzahl, " +
"BeginnDruck_Vorne, BeginnDruck_Hinten, EndDruck_Vorne, EndDruck_Hinten, " +
"TVWZ, IVWZ, Verwendeter_VZ, BeginnGewicht, EndGewicht)" +
" VALUES (:1, :2, :3, :4, :5, :6, :7, :8, :9, :10, :11, :12, :13, :14, :15, " +
":16, :17, :18, :19, :20, :21, :22, :23)", conn);
OracleParameter parm;
parm = new OracleParameter("ANBID", OracleDbType.Int32); parm.Value = Anbid_StaraTura; cmd2.Parameters.Add(parm); ///:1
parm = new OracleParameter("ID_Pruefstand", OracleDbType.Int32); parm.Value = 18000 + b.TestBenchId; cmd2.Parameters.Add(parm); ///:2
@@ -945,7 +947,44 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
}
void SaveOrUpdateWM(OracleConnection conn, Results.Entities.WaterMeter wm, int max_Pruefindex, int hydr_Pruefung)
/// <summary>
/// Write one meter results into the database
/// </summary>
/// <param name="wmNr">0-based water meter number</param>
/// <param name="results">Sorted list of results to save</param>
void SaveOneIperlToDB(OracleConnection conn, Results.Entities.WaterMeter wm, bool safeMode)
{
if (safeMode && !wm.Passed) return;
if (string.IsNullOrEmpty(wm.SerialNr)) return; /// No database activity possible w/o PCB number
int maxpruefindexLowPart = ReadMaxPruefindex(conn, wm);
TBF.BenchControl.GenericDevices.IBenchInfo benchInfo = TBF.BenchControl.Sequences.ProcessData.BenchInfo;
int testBenchID = (benchInfo != null) ? benchInfo.TestBenchId : 1;
int MAX_Pruefindex = 100 * testBenchID + maxpruefindexLowPart + 1;
int Hydr_Pruefung;
if (wm.Passed)
{
/// Passed
if (maxpruefindexLowPart == 0)
Hydr_Pruefung = 96;
else
Hydr_Pruefung = 224;
}
else
{
/// Failed
Hydr_Pruefung = 97; /// Hydr. test failed, Pressure test passed
}
wm.Pruefindex = MAX_Pruefindex;
wm.HydrPruefung = Hydr_Pruefung;
SaveOrUpdateIperl(conn, wm, MAX_Pruefindex, Hydr_Pruefung);
}
void SaveOrUpdateIperl(OracleConnection conn, Results.Entities.WaterMeter wm, int max_Pruefindex, int hydr_Pruefung)
{
int sekundaere_Adr = wm.Passed ? 1 : 0;
int idBenutzer = 6; // = wm.Batch.UserNumber;
@@ -967,7 +1006,7 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = hydr_Pruefung });
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = idBenutzer });
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = Anbid_StaraTura });
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = dbCfg.Baujahr });
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = YearOfManufacture });
cmd.ExecuteNonQuery();
log.InfoFormat("VT_ZAEHLER_PD inserted, PcbNr={0}, pos={1}, maxPruefix={2}", wm.SerialNr, wm.WMPosition, max_Pruefindex);
@@ -988,7 +1027,7 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = max_Pruefindex });
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = hydr_Pruefung });
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = idBenutzer });
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = dbCfg.Baujahr });
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = YearOfManufacture });
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Varchar2, Value = wm.SerialNr });
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = Anbid_StaraTura });
@@ -1105,6 +1144,173 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
}
/// <summary>
/// Write one meter results into the database
/// </summary>
/// <param name="wmNr">0-based water meter number</param>
/// <param name="results">Sorted list of results to save</param>
void SaveOneS620ToDB(OracleConnection conn, Results.Entities.WaterMeter wm, bool safeMode)
{
if (safeMode && !wm.Passed) return;
if (string.IsNullOrEmpty(wm.SerialNr)) return; /// No database activity possible w/o PCB number
int maxpruefindexLowPart = ReadMaxPruefindex(conn, wm);
TBF.BenchControl.GenericDevices.IBenchInfo benchInfo = TBF.BenchControl.Sequences.ProcessData.BenchInfo;
int testBenchID = (benchInfo != null) ? benchInfo.TestBenchId : 1;
int MAX_Pruefindex = 100 * testBenchID + maxpruefindexLowPart + 1;
int Hydr_Pruefung;
if (wm.Passed)
{
/// Passed
if (maxpruefindexLowPart == 0)
Hydr_Pruefung = 96;
else
Hydr_Pruefung = 224;
}
else
{
/// Failed
Hydr_Pruefung = 97; /// Hydr. test failed, Pressure test passed
}
wm.Pruefindex = MAX_Pruefindex;
wm.HydrPruefung = Hydr_Pruefung;
SaveOrUpdateS620(conn, wm, MAX_Pruefindex, Hydr_Pruefung);
}
void SaveOrUpdateS620(OracleConnection conn, Results.Entities.WaterMeter wm, int max_Pruefindex, int hydr_Pruefung)
{
int sekundaere_Adr = wm.Passed ? 1 : 0;
int idBenutzer = 6; // = wm.Batch.UserNumber;
if (max_Pruefindex % 100 == 1)
{
if (!dbCfg.TestMode)
{
OracleCommand cmd = new OracleCommand("INSERT INTO VT_ZAEHLER_PD(Auftragsnummer, VT_Identnummer, VT_Fernum, Max_Pruefindex," +
" Zaehlernummer, Sekundaere_Adr, Hydr_Pruefung, ID_Benutzer, ANBID, Baujahr)" +
" VALUES (:1, :2, :3, :4, :5, :6, :7, :8, :9, :10)", conn);
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Varchar2, Value = wm.PurchaseOrder });
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Varchar2, Value = "IPBATMXX" });
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Varchar2, Value = wm.SerialNr });
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = max_Pruefindex });
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = -1 });
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = sekundaere_Adr });
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = hydr_Pruefung });
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = idBenutzer });
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = Anbid_StaraTura });
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = YearOfManufacture });
cmd.ExecuteNonQuery();
log.InfoFormat("VT_ZAEHLER_PD inserted, PcbNr={0}, pos={1}, maxPruefix={2}", wm.SerialNr, wm.WMPosition, max_Pruefindex);
}
else
{
log.WarnFormat("SIM: VT_ZAEHLER_PD inserted, PcbNr={0}, pos={1}, maxPruefix={2}", wm.SerialNr, wm.WMPosition, max_Pruefindex);
}
}
else
{
if (!dbCfg.TestMode)
{
OracleCommand cmd = new OracleCommand("UPDATE VT_ZAEHLER_PD SET Auftragsnummer = :1, VT_Identnummer = :2, Max_Pruefindex = :3, Hydr_Pruefung= :4, ID_Benutzer= :5, Baujahr= :6 WHERE VT_Fernum = :7 and ANBID = :8", conn);
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Varchar2, Value = wm.PurchaseOrder });
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Varchar2, Value = "IPBATMXX" });
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = max_Pruefindex });
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = hydr_Pruefung });
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = idBenutzer });
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = YearOfManufacture });
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Varchar2, Value = wm.SerialNr });
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = Anbid_StaraTura });
cmd.ExecuteNonQuery();
log.InfoFormat("VT_ZAEHLER_PD updated, PcbNr={0}, pos={1}, maxPruefix={2}", wm.SerialNr, wm.WMPosition, max_Pruefindex);
}
else
{
log.WarnFormat("SIM: VT_ZAEHLER_PD updated, PcbNr={0}, pos={1}, maxPruefix={2}", wm.SerialNr, wm.WMPosition, max_Pruefindex);
}
}
if (!dbCfg.TestMode)
{
OracleCommand cmd = new OracleCommand("INSERT INTO VT_ZAEHLER_PINDEX_PD(" +
"VT_Fernum, Pruefindex, ANBID, ID_Pruefstand, ID_WzPruefreihe, Hydr_Pruefung, " +
"ReedKontakt, ReedKontaktOK, ReedKontaktZeit, KorrImprate, FestWertWZ, PtestOK, " +
"Zaehlerstand, WT_Platz_NR, WZgut, ID_Benutzer, AnzahlPruefungen)" +
" VALUES (:1, :2, :3, :4, :5, :6, 0, 0, 0, :7, 0, :8, 0, :9, :10, :11, :12)", conn); /// ReedKontakt = ReedKontaktOK = ReedKontaktZeit = FestWertWZ = Zaehlerstand = 0
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Varchar2, Value = wm.SerialNr });
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = max_Pruefindex });
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = Anbid_StaraTura });
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = 18000 + wm.Batch.TestBenchId });
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = wm.Batch.BatchNr });
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = hydr_Pruefung });
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Double, Value = wm.OrigCalibFactor });
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = 0 }); /// TODO
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = wm.WMPosition });
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = wm.Passed ? 1 : 0 });
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = idBenutzer });
cmd.Parameters.Add(new OracleParameter { OracleDbType = OracleDbType.Int32, Value = 3 });
cmd.ExecuteNonQuery();
log.InfoFormat("VT_ZAEHLER_PINDEX_PD inserted, PcbNr={0}, pos={1}, pruefix={2}", wm.SerialNr, wm.WMPosition, max_Pruefindex % 100);
}
else
{
log.WarnFormat("SIM: VT_ZAEHLER_PINDEX_PD inserted, PcbNr={0}, pos={1}, pruefix={2}", wm.SerialNr, wm.WMPosition, max_Pruefindex % 100);
}
foreach (var testInfo in completeTestInfo)
{
if ((testInfo.PruefungsNrDB != 0) && (-20 <= testInfo.PruefungsNrDB) && (testInfo.PruefungsNrDB <= 20)) /// LU PruefungsNr-s are nonzero and between -20 and 20
{
Results.Entities.TestData tData = wm.GetTestData(testInfo.TestName);
Results.Entities.MeterTestRslt mtr;
if (tData == null)
{
throw new Exception(string.Format("'{0}' test results missing, watermeter {1}", testInfo.TestName, wm.WMPosition));
}
else if (tData.Repeats == 1)
{
mtr = wm.GetMeterTestRslt(testInfo.TestName);
if (mtr == null) throw new Exception(string.Format("'{0}' test results missing, watermeter {1}", testInfo.TestName, wm.WMPosition));
}
else
{
Results.Entities.MeterTestRslt firstMtr = wm.GetMeterTestRslt(Utils.TestTitle(tData, 1));
if (firstMtr == null) throw new Exception(string.Format("'{0}' test results missing, watermeter {1}", Utils.TestTitle(tData, 1), wm.WMPosition));
mtr = new Results.Entities.MeterTestRslt();
mtr.CopyContentFrom(firstMtr);
mtr.TestRslt = firstMtr.TestRslt;
mtr.WaterMeter = firstMtr.WaterMeter;
for (int i = 2; i <= tData.Repeats; i++)
{
Results.Entities.MeterTestRslt nextMtr = wm.GetMeterTestRslt(Utils.TestTitle(tData, i));
if (nextMtr == null) throw new Exception(string.Format("'{0}' test results missing, watermeter {1}", Utils.TestTitle(tData, i), wm.WMPosition));
mtr.TestTime += nextMtr.TestTime;
mtr.VolumeMeter += nextMtr.VolumeMeter;
mtr.VolumeRef += nextMtr.VolumeRef;
mtr.VolumeEnd = nextMtr.VolumeEnd;
mtr.Passed = (mtr.Passed && nextMtr.Passed);
}
mtr.Error = Formulas.ErrorFromVolumes(mtr.VolumeMeter, mtr.VolumeRef);
}
SaveMeterTestResult(conn, mtr, testInfo.PruefungsNrDB, max_Pruefindex, wmTypeRevision);
}
}
}
/// <summary>
/// Saves a water meter result of a single test
/// </summary>
@@ -1112,7 +1318,7 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
/// <returns>Nr. of rows updated</returns>
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 = (mtr.TestTime != 0) ? (3600.0 * mtr.VolumeMeter / mtr.TestTime) : 0; /// in [l/hour]
double Q_wm_with_upper_bound = Math.Min(2 * 1000 * mtr.TestRslt.FlowVolume, Math.Max(0.0, Q_wm));
int retv = 0;
@@ -3,29 +3,11 @@
///
using System;
using System.Xml.Serialization;
using Config.Entities;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Output.DB.SensusOracle
{
public enum DBUsed
{
None,
Production,
Test,
Quality,
Count
}
public enum Separator
{
None,
Space,
Tabulator,
Comma,
Semicolon,
Count
}
public class DatabaseCfg : ComponentCfgBase, Generic.IComponentCfg
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(DatabaseCfg) })[0];
@@ -33,44 +15,33 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
public IComponentCfgCtrl GetControl() { return new DatabaseCfgCtrl(); }
public DBUsed DBUsed;
public int Baujahr; /// Written to the database
public bool ReadStartInfo;
public bool StartInfoIsRequired;
public bool SaveResults;
/// <summary> Serialized parameters </summary>
public bool TestMode;
/// <summary> Procedure parameters </summary>
[XmlIgnore]
public ProcedureParams ProcParams;
public override IParamsProvider GetRuntimeProcParamsProvider() { return ProcParams; }
public override IParamsProvider CreateProcParamsProvider() { return new ProcedureParams(true); }
/// Private parameterless constructor invoked by all other (public) constructors
DatabaseCfg()
{
Name = "Sensus-Oracle-DB";
ParentName = string.Empty;
DBUsed = DBUsed.Test;
Baujahr = 2015;
ReadStartInfo = true;
SaveResults = true;
StartInfoIsRequired = false;
TestMode = false;
}
{
ProcParams = new ProcedureParams(true);
}
public DatabaseCfg(IComponentFactory factory)
public DatabaseCfg(string name, IComponentFactory factory)
: this()
{
this.Factory = factory;
Name = name;
Factory = factory;
ParentName = string.Empty;
TestMode = false;
}
public string ToString(int i)
{
return string.Format("Name={0}, DB={1}, Bjahr={2}, RdStartInfo={3}, SaveRslts={4}, StartInfoRqrd={5}, TestMode={6}",
Name,
DBUsed,
Baujahr,
ReadStartInfo,
SaveResults,
StartInfoIsRequired,
TestMode);
return string.Format("Name={0} TestMode={1}", Name, TestMode);
}
}
}
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2015-2018 Sensus Slovensko a.s.
/// Copyright (c) 2015-2020 Sensus Slovensko a.s.
///
using System;
using System.Windows.Forms;
@@ -30,12 +30,7 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
private void WriterCfgCtrl_Load(object sender, EventArgs e)
{
for (int i = 0; i < (int)DBUsed.Count; i++)
{
dbUsedComboBox.Items.Add(((DBUsed)i).ToString());
}
Redraw();
Redraw();
}
public void Closing()
@@ -47,49 +42,25 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
if (config == null) return; /// Control was not loaded, settings were not changed
classNameLabel.Text = config.Factory.ClassName;
nameTextBox.Text = config.Name;
dbUsedComboBox.Text = config.DBUsed.ToString();
baujahrTextBox.Text = config.Baujahr.ToString();
readStartInfoCheckBox.Checked = config.ReadStartInfo;
startInfoIsRequiredCheckBox.Checked = config.StartInfoIsRequired;
saveResultsCheckBox.Checked = config.SaveResults;
testModeCheckBox.Checked = config.TestMode;
}
public void Unlock()
{
nameTextBox.Enabled = true;
dbUsedComboBox.Enabled = true;
baujahrTextBox.Enabled = true;
readStartInfoCheckBox.Enabled = true;
startInfoIsRequiredCheckBox.Enabled = true;
saveResultsCheckBox.Enabled = true;
testModeCheckBox.Enabled = true;
}
public CfgUpdateFlags VerifyCfg(ref string message)
{
CfgUpdateFlags flags = CfgUpdateFlags.None;
int tmp;
if (!int.TryParse(baujahrTextBox.Text, out tmp) || tmp < 2015 || tmp > 2099)
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "Invalid 'Bujahr'";
}
if (!dbUsedComboBox.Items.Contains(dbUsedComboBox.Text))
{
flags |= CfgUpdateFlags.Error;
message += Environment.NewLine + "Invalid 'Database used' item";
}
return flags;
return CfgUpdateFlags.None;
}
public CfgUpdateFlags UpdateCfg()
{
CfgUpdateFlags flags = CfgUpdateFlags.None; /// <------------------- !!!
if (config == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed
if (config == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed
CfgUpdateFlags flags = CfgUpdateFlags.None;
if (config.Name != nameTextBox.Text)
{
@@ -97,34 +68,9 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
flags |= CfgUpdateFlags.RestartRqrd;
}
int baujahr = int.Parse(baujahrTextBox.Text);
if (config.Baujahr != baujahr)
{
config.Baujahr = baujahr;
flags |= CfgUpdateFlags.RestartRqrd;
}
for (int i = 0; i < (int)DBUsed.Count; i++)
{
if (((DBUsed)i).ToString().Equals(dbUsedComboBox.Text) && (config.DBUsed != (DBUsed)i))
{
config.DBUsed = (DBUsed)i;
flags |= CfgUpdateFlags.RestartRqrd;
break;
}
}
flags |= UpdateDifferent(ref config.ReadStartInfo, readStartInfoCheckBox.Checked, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
flags |= UpdateDifferent(ref config.StartInfoIsRequired, startInfoIsRequiredCheckBox.Checked, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
flags |= UpdateDifferent(ref config.SaveResults, saveResultsCheckBox.Checked, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
flags |= UpdateDifferent(ref config.TestMode, testModeCheckBox.Checked, CfgUpdateFlags.AnyChange | CfgUpdateFlags.RestartRqrd);
return flags;
}
private void logsFolderButton_Click(object sender, EventArgs e)
{
}
}
}
@@ -34,20 +34,13 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
this.nameTextBox = new System.Windows.Forms.TextBox();
this.nameLabel = new System.Windows.Forms.Label();
this.classNameLabel = new System.Windows.Forms.Label();
this.readStartInfoCheckBox = new System.Windows.Forms.CheckBox();
this.saveResultsCheckBox = new System.Windows.Forms.CheckBox();
this.dbUsedComboBox = new System.Windows.Forms.ComboBox();
this.dbUsedLabel = new System.Windows.Forms.Label();
this.baujahrTextBox = new System.Windows.Forms.TextBox();
this.baujahrLabel = new System.Windows.Forms.Label();
this.startInfoIsRequiredCheckBox = new System.Windows.Forms.CheckBox();
this.testModeCheckBox = new System.Windows.Forms.CheckBox();
this.SuspendLayout();
//
// nameTextBox
//
this.nameTextBox.Enabled = false;
this.nameTextBox.Location = new System.Drawing.Point(110, 55);
this.nameTextBox.Location = new System.Drawing.Point(123, 59);
this.nameTextBox.Name = "nameTextBox";
this.nameTextBox.Size = new System.Drawing.Size(146, 20);
this.nameTextBox.TabIndex = 2;
@@ -55,7 +48,7 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
// nameLabel
//
this.nameLabel.AutoSize = true;
this.nameLabel.Location = new System.Drawing.Point(19, 58);
this.nameLabel.Location = new System.Drawing.Point(19, 62);
this.nameLabel.Name = "nameLabel";
this.nameLabel.Size = new System.Drawing.Size(35, 13);
this.nameLabel.TabIndex = 1;
@@ -64,85 +57,17 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
// classNameLabel
//
this.classNameLabel.AutoSize = true;
this.classNameLabel.Location = new System.Drawing.Point(107, 27);
this.classNameLabel.Location = new System.Drawing.Point(120, 31);
this.classNameLabel.Name = "classNameLabel";
this.classNameLabel.Size = new System.Drawing.Size(83, 13);
this.classNameLabel.TabIndex = 0;
this.classNameLabel.Text = "ComonentName";
//
// readStartInfoCheckBox
//
this.readStartInfoCheckBox.AutoSize = true;
this.readStartInfoCheckBox.Enabled = false;
this.readStartInfoCheckBox.Location = new System.Drawing.Point(111, 145);
this.readStartInfoCheckBox.Name = "readStartInfoCheckBox";
this.readStartInfoCheckBox.Size = new System.Drawing.Size(95, 17);
this.readStartInfoCheckBox.TabIndex = 9;
this.readStartInfoCheckBox.Text = "Read start info";
this.readStartInfoCheckBox.UseVisualStyleBackColor = true;
//
// saveResultsCheckBox
//
this.saveResultsCheckBox.AutoSize = true;
this.saveResultsCheckBox.Enabled = false;
this.saveResultsCheckBox.Location = new System.Drawing.Point(111, 200);
this.saveResultsCheckBox.Name = "saveResultsCheckBox";
this.saveResultsCheckBox.Size = new System.Drawing.Size(84, 17);
this.saveResultsCheckBox.TabIndex = 11;
this.saveResultsCheckBox.Text = "Save results";
this.saveResultsCheckBox.UseVisualStyleBackColor = true;
//
// dbUsedComboBox
//
this.dbUsedComboBox.Enabled = false;
this.dbUsedComboBox.FormattingEnabled = true;
this.dbUsedComboBox.Location = new System.Drawing.Point(110, 79);
this.dbUsedComboBox.Name = "dbUsedComboBox";
this.dbUsedComboBox.Size = new System.Drawing.Size(145, 21);
this.dbUsedComboBox.TabIndex = 6;
//
// dbUsedLabel
//
this.dbUsedLabel.AutoSize = true;
this.dbUsedLabel.Location = new System.Drawing.Point(19, 81);
this.dbUsedLabel.Name = "dbUsedLabel";
this.dbUsedLabel.Size = new System.Drawing.Size(79, 13);
this.dbUsedLabel.TabIndex = 5;
this.dbUsedLabel.Text = "Database used";
//
// baujahrTextBox
//
this.baujahrTextBox.Enabled = false;
this.baujahrTextBox.Location = new System.Drawing.Point(110, 104);
this.baujahrTextBox.Name = "baujahrTextBox";
this.baujahrTextBox.Size = new System.Drawing.Size(57, 20);
this.baujahrTextBox.TabIndex = 8;
//
// baujahrLabel
//
this.baujahrLabel.AutoSize = true;
this.baujahrLabel.Location = new System.Drawing.Point(19, 107);
this.baujahrLabel.Name = "baujahrLabel";
this.baujahrLabel.Size = new System.Drawing.Size(43, 13);
this.baujahrLabel.TabIndex = 7;
this.baujahrLabel.Text = "Baujahr";
//
// startInfoIsRequiredCheckBox
//
this.startInfoIsRequiredCheckBox.AutoSize = true;
this.startInfoIsRequiredCheckBox.Enabled = false;
this.startInfoIsRequiredCheckBox.Location = new System.Drawing.Point(130, 168);
this.startInfoIsRequiredCheckBox.Name = "startInfoIsRequiredCheckBox";
this.startInfoIsRequiredCheckBox.Size = new System.Drawing.Size(119, 17);
this.startInfoIsRequiredCheckBox.TabIndex = 10;
this.startInfoIsRequiredCheckBox.Text = "Start info is required";
this.startInfoIsRequiredCheckBox.UseVisualStyleBackColor = true;
//
// testModeCheckBox
//
this.testModeCheckBox.AutoSize = true;
this.testModeCheckBox.Enabled = false;
this.testModeCheckBox.Location = new System.Drawing.Point(130, 223);
this.testModeCheckBox.Location = new System.Drawing.Point(123, 113);
this.testModeCheckBox.Name = "testModeCheckBox";
this.testModeCheckBox.Size = new System.Drawing.Size(155, 17);
this.testModeCheckBox.TabIndex = 12;
@@ -154,13 +79,6 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.testModeCheckBox);
this.Controls.Add(this.startInfoIsRequiredCheckBox);
this.Controls.Add(this.baujahrTextBox);
this.Controls.Add(this.baujahrLabel);
this.Controls.Add(this.dbUsedComboBox);
this.Controls.Add(this.dbUsedLabel);
this.Controls.Add(this.saveResultsCheckBox);
this.Controls.Add(this.readStartInfoCheckBox);
this.Controls.Add(this.nameTextBox);
this.Controls.Add(this.nameLabel);
this.Controls.Add(this.classNameLabel);
@@ -177,13 +95,6 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
private System.Windows.Forms.TextBox nameTextBox;
private System.Windows.Forms.Label nameLabel;
private System.Windows.Forms.Label classNameLabel;
private System.Windows.Forms.CheckBox readStartInfoCheckBox;
private System.Windows.Forms.CheckBox saveResultsCheckBox;
private System.Windows.Forms.ComboBox dbUsedComboBox;
private System.Windows.Forms.Label dbUsedLabel;
private System.Windows.Forms.TextBox baujahrTextBox;
private System.Windows.Forms.Label baujahrLabel;
private System.Windows.Forms.CheckBox startInfoIsRequiredCheckBox;
private System.Windows.Forms.CheckBox testModeCheckBox;
}
}
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2015-2018 Sensus Slovensko a.s.
/// Copyright (c) 2015-2020 Sensus Slovensko a.s.
///
using System.Collections.Generic;
using TBF.BenchControl.Generic;
@@ -16,7 +16,7 @@ namespace TBF.BenchControl.Output.DB.SensusOracle
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Database(cfg); }
public IComponentCfg DefaultConfig() { return new DatabaseCfg(this); }
public IComponentCfg DefaultConfig() { return new DatabaseCfg("Sensus-Oracle-DB", this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
@@ -0,0 +1,245 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
using System;
using System.IO;
using System.Text;
using System.Xml.Serialization;
using Config.Entities;
using TBF.BenchControl.Generic;
using TBF.Resources;
using System.Collections.Generic;
namespace TBF.BenchControl.Output.DB.SensusOracle
{
public class ProcedureParams : ProcedureParamsBase, IParamsProvider, IProcedureParams
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(ProcedureParams) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
public DBUsed DBUsed; /// 0
public WMKind WMKind; /// 1
public int WMTypeId; /// 2
public int YearOfManufacture; /// 3
public bool SaveResults; /// 4
public bool ReadStartInfo; /// 5
public bool StartInfoIsRequired; /// 6
public override void InitializeAll()
{
DBUsed = DBUsed.Production; /// 0
WMKind = WMKind.Iperl; /// 1
WMTypeId = 2; /// 2
YearOfManufacture = DateTime.Now.Year; /// 3
#if TURA_SPECIAL
SaveResults = false; /// 4
#else
SaveResults = true; /// 4
#endif
ReadStartInfo = true; /// 5
StartInfoIsRequired = false; /// 6
}
string[] paramNames = new string[]
{
"Database", /// 0
"Kind of WMs", /// 1
"WM type ID", /// 2
"Year of manufacture", /// 3
"Save results", /// 4
"Read start info", /// 5
"Start info is required", /// 6
};
public override string ParamName(int i) { return paramNames[i]; }
public override int ParamsCount() { return paramNames.Length; }
public override IList<string> ParamValues(int i)
{
if (i == 0)
{
IList<string> retVal = new List<string>();
for (DBUsed db = 0; db < DBUsed.Count; db++) retVal.Add(db.ToString());
return retVal;
}
if (i == 1)
{
IList<string> retVal = new List<string>();
for (WMKind wm = 0; wm < WMKind.Count; wm++) retVal.Add(wm.ToString());
return retVal;
}
if (i == 3)
{
IList<string> retVal = new List<string>();
int year = DateTime.Now.Year;
retVal.Add(year.ToString());
retVal.Add((year + 1).ToString());
return retVal;
}
if (i == 4 || i == 5 || i == 6)
{
IList<string> retVal = new List<string>();
retVal.Add(Strings.yes);
retVal.Add(Strings.no);
return retVal;
}
return null;
}
public override string ToString(int i)
{
switch (i)
{
case 0: return DBUsed.ToString();
case 1: return WMKind.ToString();
case 2: return WMTypeId.ToString();
case 3: return YearOfManufacture.ToString();
case 4: return SaveResults ? Strings.yes : Strings.no;
case 5: return ReadStartInfo ? Strings.yes : Strings.no;
case 6: return StartInfoIsRequired ? Strings.yes : Strings.no;
default: return string.Empty;
}
}
/// Retrieves parameters from UI controls
public CfgUpdateFlags UpdateParam(int i, string strValue)
{
switch (i)
{
case 0:
for (DBUsed db = 0; db < DBUsed.Count; db++)
{
if (db.ToString() == strValue)
{
DBUsed = db;
return CfgUpdateFlags.None;
}
}
break;
case 1:
for (WMKind wm = 0; wm < WMKind.Count; wm++)
{
if (wm.ToString() == strValue)
{
WMKind = wm;
return CfgUpdateFlags.None;
}
}
break;
case 2: WMTypeId = int.Parse(strValue); break;
case 3: YearOfManufacture = int.Parse(strValue); break;
case 4: SaveResults = (strValue == Strings.yes); break;
case 5: ReadStartInfo = (strValue == Strings.yes); break;
case 6: StartInfoIsRequired = (strValue == Strings.yes); break;
}
return CfgUpdateFlags.None;
}
/// Verifies whether strings in UI controls represent valid parameters
public bool ValidateParam(int i, string strValue, out string message)
{
message = string.Empty;
int idummy;
switch (i)
{
case 0:
for (DBUsed db = 0; db < DBUsed.Count; db++)
{
if (db.ToString() == strValue) return true;
}
break;
case 1:
for (WMKind wm = 0; wm < WMKind.Count; wm++)
{
if (wm.ToString() == strValue) return true;
}
break;
case 2:
if (int.TryParse(strValue, out idummy) && idummy >= 0)
return true;
break;
case 3:
if (int.TryParse(strValue, out idummy) && idummy >= DateTime.Now.Year && idummy <= DateTime.Now.Year + 1)
return true;
break;
case 4:
case 5:
case 6:
if (strValue == Strings.yes || strValue == Strings.no)
return true;
break;
default:
message = "Invalid index";
return false;
}
message = ParamName(i) + " is invalid";
return false;
}
void CopyContentTo(ProcedureParams prms)
{
prms.DBUsed = this.DBUsed;
prms.WMKind = this.WMKind;
prms.WMTypeId = this.WMTypeId;
prms.YearOfManufacture = this.YearOfManufacture;
prms.SaveResults = this.SaveResults;
prms.ReadStartInfo = this.ReadStartInfo;
prms.StartInfoIsRequired = this.StartInfoIsRequired;
}
public IParamsProvider Clone()
{
ProcedureParams pars = new ProcedureParams();
CopyContentTo(pars);
return pars;
}
public override void UpdateFromDbEntity(ComponentProcedure dbEntity)
{
if (dbEntity == null) return;
try
{
ProcedureParams tmp = Serializer.Deserialize(new StringReader(dbEntity.Parameters)) as ProcedureParams;
procedureParamsEntity = dbEntity;
componentName = dbEntity.CmpntName;
procedure = dbEntity.Procedure;
if (tmp != null) tmp.CopyContentTo(this);
}
catch
{
}
}
public ProcedureParams()
{
}
public ProcedureParams(bool initialize)
{
if (initialize) InitializeAll();
}
public ProcedureParams(ComponentProcedure procedureParamsEntity, string componentName, Procedure procedure)
{
this.procedureParamsEntity = procedureParamsEntity;
this.componentName = componentName;
this.procedure = procedure;
}
}
}
+1 -5
View File
@@ -567,10 +567,6 @@ namespace TBF.BenchControl.Sequences
int[] waterMeterParts = new int[waterMetersCount];
for (int wmNr = 0; wmNr < waterMetersCount; wmNr++)
{
/// WR10 .. WR15 configuration specific code (iPerl head component name)
TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead.IperlHead iHead =
TbfComponents.FindComponent(string.Format("iPerl{0}", wmNr + 1)) as TBF.BenchControl.TestMethods.iPerlCommunication.iPerlHead.IperlHead;
int ix = compound ? (2 * wmNr) : wmNr;
if (WaterMeters.Count > ix)
{
@@ -610,7 +606,7 @@ namespace TBF.BenchControl.Sequences
Compound = compound,
HeatMeter = heatMeters,
#if ORACLE_DB
WMTypeId = (iHead != null) ? iHead.WMType_ID : 0,
WMTypeId = (ProcessData.OracleDB != null) ? ProcessData.OracleDB.WMTypeId : 0,
#endif
};
}
+3 -7
View File
@@ -1302,7 +1302,7 @@ namespace TBF.BenchControl.Sequences
{
bool isCamera = (mtrRslt.RegReaderType == (int)RegisterReaderType.Camera);
sb.Append(";"); sb.Append(ProcessData.BatchRslts.Batch.WaterMeters[i].SerialNr);/// CE WM Ser.No.
sb.Append(";"); sb.Append(ProcessData.BatchRslts.Batch.WaterMeters[i].SerialNr); /// CE WM Ser.No.
sb.Append(";"); sb.Append(mtrRslt.VolumeStart); /// CF WM Vstart - pociatocny stav pri pevnom starte alebo zachyteny pri data streame
sb.Append(";"); sb.Append(mtrRslt.VolumeEnd); /// CG WM Vend - konecny stav pri pevnom starte alebo zachyteny pri data streame
sb.Append(";"); sb.Append(mtrRslt.VolumeMeter); /// CH WM Vmer - objem namerany vodomerom
@@ -1322,12 +1322,8 @@ namespace TBF.BenchControl.Sequences
#else
sb.Append(";"); sb.Append(mtrRslt.PulsesPerLiter); /// CP Pulses per liter
#endif
sb.Append(";"); sb.Append(isCamera
? mtrRslt.VolumeStart * mtrRslt.PulsesPerLiter /// CQ WM Phi_start (pri hodnotach z kamery)
: ProcessData.BatchRslts.Batch.WaterMeters[i].WMPosition); /// CQ WMPosition (normalne)
sb.Append(";"); sb.Append(isCamera
? mtrRslt.VolumeEnd * mtrRslt.PulsesPerLiter /// CR WM Phi_end (pri hodnotach z kamery)
: 0); /// CR not used/spare (normalne)
sb.Append(";"); sb.Append(isCamera ? mtrRslt.VolumeStart * mtrRslt.PulsesPerLiter : 0); /// CQ WM Phi_start - pri hodnotach z kamery
sb.Append(";"); sb.Append(isCamera ? mtrRslt.VolumeEnd * mtrRslt.PulsesPerLiter : 0); /// CR WM Phi_end - ' ' -
sb.Append(";"); sb.Append(mtrRslt.TimestampStart); /// CS WM Time_start - ' ' -
sb.Append(";"); sb.Append(mtrRslt.TimestampEnd); /// CT WM Time_end - ' ' -
@@ -70,18 +70,13 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
public const string ResetQ2CorrectionStr = "Reset Q2 correction";
public const string WriteDefaultQ2CorrectionsStr = "Write default Q2 corrections";
public const string InitOrReadQ2CorrectionsStr = "Init or read Q2 corrections";
public const string WriteQ2CorrectionStr = "Write Q2 correction"; /// No arguments
public const string WriteQ2CorrectionAltStr = "Write Q2 correction Alt"; /// No arguments
public const string WriteQ2CorrectionGreeceStr = "Write Q2 correction Greece"; /// Arguments: test_name
public const string WriteQ2CorrectionRLStr = "Write Q2 correction R-L"; /// Arguments: test_name
public const string WriteQ2CorrectionLRStr = "Write Q2 correction L-R"; /// Arguments: test_name
public const string WriteQ2CorrectionIncl05Str = "Write_Q2_correction_incl.-0,5..0,5%"; /// No arguments
public const string WriteQ2CorrectionAltIncl05Str = "Write_Q2_correction_Alt_incl.-0,5..0,5%"; /// No arguments
public const string WriteQ2CorrectionGreeceIncl05Str = "Write_Q2_correction_Greece_incl.-0,5..0,5%"; /// Arguments: test_name
public const string WriteQ2CorrectionRLIncl05Str = "Write_Q2_correction_R-L_incl.-0,5..0,5%"; /// Arguments: test_name
public const string WriteQ2CorrectionLRIncl05Str = "Write_Q2_correction_L-R_incl.-0,5..0,5%"; /// Arguments: test_name
public const string UpdateQ2CorrectionsStr = "Update Q2 corrections"; /// Arguments: R-L_test_name L-R_test_name
public const string ConditnlUpdateQ2CorrectionsStr = "Conditional update of Q2 corrections"; /// Arguments: R-L_test_name L-R_test_name
public const string WriteQ2CorrectionStr = "Write Q2 correction"; /// No arguments
public const string WriteQ2CorrectionAltStr = "Write Q2 correction Alt"; /// No arguments
public const string WriteQ2CorrectionGreeceStr = "Write Q2 correction Greece"; /// Arguments: test_name
public const string WriteQ2CorrectionRLStr = "Write Q2 correction R-L"; /// Arguments: test_name
public const string WriteQ2CorrectionLRStr = "Write Q2 correction L-R"; /// Arguments: test_name
public const string UpdateQ2CorrectionsStr = "Update Q2 corrections"; /// Arguments: R-L_test_name L-R_test_name
public const string ConditnlUpdateQ2CorrectionsStr = "Conditional update of Q2 corrections"; /// Arguments: R-L_test_name L-R_test_name
public const string Reset2HzCorrectionStr = "Reset 2Hz correction";
public const string Write2HzCorrectionStr = "Write 2Hz correction";
@@ -865,11 +860,6 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
else if (currentActivity.ToLower().Contains(WriteQ2CorrectionGreeceStr.ToLower())) error = WriteQ2Correction(threadID, ihead, wm, currentTest, ref resultStr, Q2CorrType.Greece, currentActivity.Substring(WriteQ2CorrectionGreeceStr.Length).Trim());
else if (currentActivity.ToLower().Contains(WriteQ2CorrectionRLStr.ToLower())) error = WriteQ2Correction(threadID, ihead, wm, currentTest, ref resultStr, Q2CorrType.RL, currentActivity.Substring(WriteQ2CorrectionRLStr.Length).Trim());
else if (currentActivity.ToLower().Contains(WriteQ2CorrectionLRStr.ToLower())) error = WriteQ2Correction(threadID, ihead, wm, currentTest, ref resultStr, Q2CorrType.LR, currentActivity.Substring(WriteQ2CorrectionLRStr.Length).Trim());
else if (currentActivity.ToLower() == WriteQ2CorrectionIncl05Str.ToLower()) error = WriteQ2Correction(threadID, ihead, wm, currentTest, ref resultStr, Q2CorrType.Standard_incl_05, null);
else if (currentActivity.ToLower() == WriteQ2CorrectionAltIncl05Str.ToLower()) error = WriteQ2Correction(threadID, ihead, wm, currentTest, ref resultStr, Q2CorrType.Dewa_incl_05, null);
else if (currentActivity.ToLower().Contains(WriteQ2CorrectionGreeceIncl05Str.ToLower()))error = WriteQ2Correction(threadID, ihead, wm, currentTest, ref resultStr, Q2CorrType.Greece_incl_05, currentActivity.Substring(WriteQ2CorrectionGreeceIncl05Str.Length).Trim());
else if (currentActivity.ToLower().Contains(WriteQ2CorrectionRLIncl05Str.ToLower())) error = WriteQ2Correction(threadID, ihead, wm, currentTest, ref resultStr, Q2CorrType.RL_incl_05, currentActivity.Substring(WriteQ2CorrectionRLIncl05Str.Length).Trim());
else if (currentActivity.ToLower().Contains(WriteQ2CorrectionLRIncl05Str.ToLower())) error = WriteQ2Correction(threadID, ihead, wm, currentTest, ref resultStr, Q2CorrType.LR_incl_05, currentActivity.Substring(WriteQ2CorrectionLRIncl05Str.Length).Trim());
else if (currentActivity.ToLower().Contains(UpdateQ2CorrectionsStr.ToLower())) error = WriteQ2Correction(threadID, ihead, wm, currentTest, ref resultStr, Q2CorrType.Update, currentActivity.Substring(UpdateQ2CorrectionsStr.Length).Trim());
else if (currentActivity.ToLower().Contains(ConditnlUpdateQ2CorrectionsStr.ToLower())) error = WriteQ2Correction(threadID, ihead, wm, currentTest, ref resultStr, Q2CorrType.ConditionalUpdate, currentActivity.Substring(ConditnlUpdateQ2CorrectionsStr.Length).Trim());
else if (currentActivity.ToLower() == Reset2HzCorrectionStr.ToLower()) error = Reset2HzCorrection(threadID, ihead, wm, ref resultStr);
@@ -2233,12 +2223,12 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
Byte q2CorrRL = 0;
Byte q2CorrLR = 0;
///
if (q2CorrType == Q2CorrType.Standard || q2CorrType == Q2CorrType.Standard_incl_05)
if (q2CorrType == Q2CorrType.Standard)
{
///
/// Standard process
///
if (q2CorrType == Q2CorrType.Standard && Math.Abs(q2adjResult.Error - ihead.CalibTargetQ2) <= 0.5)
if (Math.Abs(q2adjResult.Error - ihead.CalibTargetQ2) <= 0.5)
{
resultStr = string.Format("Q2 correction = 0 (writing bypassed)");
return CommErr.None;
@@ -2247,12 +2237,12 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
q2CorrRL = (byte)((int)Math.Round(1.1 * q2Correction) & 0x000000FF);
q2CorrLR = (byte)((int)Math.Round(0.5 * q2Correction) & 0x000000FF);
}
else if (q2CorrType == Q2CorrType.Dewa || q2CorrType == Q2CorrType.Dewa_incl_05)
else if (q2CorrType == Q2CorrType.Dewa)
{
///
/// Process for DEWA
///
if (q2CorrType == Q2CorrType.Dewa && Math.Abs(q2adjResult.Error - ihead.CalibTargetQ2) <= 0.5)
if (Math.Abs(q2adjResult.Error - ihead.CalibTargetQ2) <= 0.5)
{
resultStr = string.Format("Q2 correction = 0 (writing bypassed)");
return CommErr.None;
@@ -2262,23 +2252,23 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
q2CorrRL = (byte)((int)Math.Round(1.1 * q2Correction) & 0x000000FF);
q2CorrLR = (byte)((int)Math.Round(1.1 * q2Correction) & 0x000000FF);
}
else if (q2CorrType == Q2CorrType.Greece || q2CorrType == Q2CorrType.Greece_incl_05)
else if (q2CorrType == Q2CorrType.Greece)
{
///
/// Process for Greece
///
if (q2CorrType == Q2CorrType.Greece && Math.Abs(q2adjResult.Error - ihead.CalibTargetQ2) <= 0.5)
if (Math.Abs(q2adjResult.Error - ihead.CalibTargetQ2) <= 0.5)
{
resultStr = string.Format("Q2 correction = 0 (writing bypassed)");
return CommErr.None;
}
q2CorrRL = (byte)((int)Math.Round(2.0 * q2Correction) & 0x000000FF);
q2CorrRL = (byte)((int)Math.Round(2.2 * q2Correction) & 0x000000FF);
q2CorrLR = (byte)((int)Math.Round(1.1 * q2Correction) & 0x000000FF);
}
else if (q2CorrType == Q2CorrType.RL || q2CorrType == Q2CorrType.RL_incl_05) /// SUEZ RL only
else if (q2CorrType == Q2CorrType.RL) /// SUEZ
{
if (q2CorrType == Q2CorrType.RL && Math.Abs(q2adjResult.Error - ihead.CalibTargetQ2) <= 0.5)
if (Math.Abs(q2adjResult.Error - ihead.CalibTargetQ2) <= 0.5)
{
resultStr = string.Format("Q2 correction = 0 (writing bypassed)");
return CommErr.None;
@@ -2286,9 +2276,9 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
q2CorrRL = (byte)((int)Math.Round(q2Correction) & 0x000000FF);
}
else if (q2CorrType == Q2CorrType.LR || q2CorrType == Q2CorrType.LR_incl_05) /// SUEZ LR only
else if (q2CorrType == Q2CorrType.LR) /// SUEZ
{
if (q2CorrType == Q2CorrType.LR && Math.Abs(q2adjResult.Error - ihead.CalibTargetQ2) <= 0.5)
if (Math.Abs(q2adjResult.Error - ihead.CalibTargetQ2) <= 0.5)
{
resultStr = string.Format("Q2 correction = 0 (writing bypassed)");
return CommErr.None;
@@ -63,11 +63,6 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
retVal.Add(iPerlCommunicationForm.WriteQ2CorrectionGreeceStr);
retVal.Add(iPerlCommunicationForm.WriteQ2CorrectionRLStr);
retVal.Add(iPerlCommunicationForm.WriteQ2CorrectionLRStr);
retVal.Add(iPerlCommunicationForm.WriteQ2CorrectionIncl05Str);
retVal.Add(iPerlCommunicationForm.WriteQ2CorrectionAltIncl05Str);
retVal.Add(iPerlCommunicationForm.WriteQ2CorrectionGreeceIncl05Str);
retVal.Add(iPerlCommunicationForm.WriteQ2CorrectionRLIncl05Str);
retVal.Add(iPerlCommunicationForm.WriteQ2CorrectionLRIncl05Str);
retVal.Add(iPerlCommunicationForm.UpdateQ2CorrectionsStr);
retVal.Add(iPerlCommunicationForm.ConditnlUpdateQ2CorrectionsStr);
retVal.Add("Q2 corrected from Q2adj");
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2017-2020 Sensus Slovensko a.s.
/// Copyright (c) 2017-2019 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
@@ -16,11 +16,6 @@ namespace TBF.BenchControl.TestMethods.iPerlCommunication
Greece,
RL,
LR,
Standard_incl_05,
Dewa_incl_05,
Greece_incl_05,
RL_incl_05,
LR_incl_05,
Update,
ConditionalUpdate,
Count,
+2 -2
View File
@@ -29,5 +29,5 @@ using System.Runtime.InteropServices;
// Build Number
// Revision
//
[assembly: AssemblyVersion("2.26.1598.0")]
[assembly: AssemblyFileVersion("2.26.1598.0")]
[assembly: AssemblyVersion("2.26.1542.0")]
[assembly: AssemblyFileVersion("2.26.1542.0")]
+8 -24
View File
@@ -39,7 +39,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;TURA_IPERL;IPERL;ORACLE_DB;LANG_SK;STABLE_MASS_EXTRAS</DefineConstants>
<DefineConstants>TRACE;DEBUG;TURA_SPECIAL;IPERL;ORACLE_DB;LANG_SK;CAMERA</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
@@ -50,7 +50,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;TURA_IPERL;IPERL;ORACLE_DB;LANG_SK;STABLE_MASS_EXTRAS</DefineConstants>
<DefineConstants>TRACE;TURA_SPECIAL;IPERL;ORACLE_DB;LANG_SK;CAMERA</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
@@ -60,7 +60,7 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x86'">
<DebugSymbols>true</DebugSymbols>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;TURA_IPERL;IPERL;ORACLE_DB;LANG_SK;STABLE_MASS_EXTRAS</DefineConstants>
<DefineConstants>TRACE;DEBUG;TURA_SPECIAL;IPERL;ORACLE_DB;LANG_SK;CAMERA</DefineConstants>
<DebugType>full</DebugType>
<PlatformTarget>x86</PlatformTarget>
<ErrorReport>prompt</ErrorReport>
@@ -70,7 +70,7 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x86'">
<OutputPath>bin\x86\Release\</OutputPath>
<DefineConstants>TRACE;TURA_IPERL;IPERL;ORACLE_DB;LANG_SK;STABLE_MASS_EXTRAS</DefineConstants>
<DefineConstants>TRACE;TURA_SPECIAL;IPERL;ORACLE_DB;LANG_SK;CAMERA</DefineConstants>
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<PlatformTarget>x86</PlatformTarget>
@@ -101,8 +101,9 @@
<SignManifests>false</SignManifests>
</PropertyGroup>
<ItemGroup>
<Reference Include="ControlComponent3U">
<HintPath>..\packages\ControlBoard\iPerlST\ControlComponent3U.dll</HintPath>
<Reference Include="ControlComponent3U, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\packages\ControlBoard\iPerlST-special\ControlComponent3U.dll</HintPath>
</Reference>
<Reference Include="FluentNHibernate">
<HintPath>..\packages\FluentNHibernate.2.0.3.0\lib\net40\FluentNHibernate.dll</HintPath>
@@ -921,6 +922,7 @@
<DependentUpon>DatabaseCfgCtrl.cs</DependentUpon>
</Compile>
<Compile Include="BenchControl\Output\DB\SensusOracle\Factory.cs" />
<Compile Include="BenchControl\Output\DB\SensusOracle\ProcedureParams.cs" />
<Compile Include="BenchControl\Output\Enums.cs" />
<Compile Include="BenchControl\Output\EventTriggers\Iperl\Factory.cs" />
<Compile Include="BenchControl\Output\EventTriggers\Iperl\Trigger.cs" />
@@ -3534,24 +3536,6 @@
<None Include="Resources\RoiStyle1.bmp" />
<None Include="Resources\RoiStyle2.bmp" />
<None Include="Resources\RoiStyle3.bmp" />
<Content Include="libgcc_s_dw2-1.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="libRfid1.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="libRfid2.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="libRfid3.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="libRfid4.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="libstdc++-6.dll">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<Content Include="Pictures\forward_dir_left.jpg">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
+2 -2
View File
@@ -54,9 +54,9 @@ namespace TBF.UI
this.horizontalSplitContainer = new System.Windows.Forms.SplitContainer();
this.mainTabControl = new System.Windows.Forms.TabControl();
this.homeTabPage = new System.Windows.Forms.TabPage();
this.ctrlBrdComponent = new ControlComponent_Torino2015.UserControl1();
this.ctrlBrdComponent = new ControlComponent_Torino2015.UserControl1();
this.processTabPage = new System.Windows.Forms.TabPage();
this.processTabPageCtrl = new TBF.UI.Process.ProcessTabPageCtrl48();
this.processTabPageCtrl = new TBF.UI.Process.ProcessTabPageExCtrl();
this.insertTabPage = new System.Windows.Forms.TabPage();
this.resultsTabPage = new System.Windows.Forms.TabPage();
this.resultsTabPageCtrl = new TBF.UI.ResultsMI.ResultsTabPageCtrl();
+4 -3
View File
@@ -315,15 +315,16 @@ namespace TBF.UI.Procedures
IList<IComponent> other = new List<IComponent>();
foreach (var cmpnt in TbfComponents)
{
if (cmpnt is TBF.BenchControl.Modbus.Easytherm.Easytherm) other.Add(cmpnt);
}
if (cmpnt is TBF.BenchControl.Output.DB.SensusOracle.Database) other.Add(cmpnt);
if (cmpnt is TBF.BenchControl.Modbus.Easytherm.Easytherm) other.Add(cmpnt);
}
if (other.Count > 0)
{
ProcedureParamsCtrl newCtrl = new ProcedureParamsCtrl(this, other, false);
procedureParamsCtrls.Add(newCtrl);
TabPage newTab = new TabPage(Strings.Temperature);
TabPage newTab = new TabPage("More...");
newTab.Controls.Add(newCtrl);
newTab.Tag = newCtrl;
tabControl.TabPages.Add(newTab);
+4 -2
View File
@@ -172,13 +172,14 @@ namespace TBF.UI.ResultsMI
TBF.BenchControl.Output.DB.SensusOracle.DatabaseCfg cfg = TBF.BenchControl.ComponentCfgBase.CreateFromDbEntity(DatabaseCfg.Serializer, cmpntEntities[0], null)
as TBF.BenchControl.Output.DB.SensusOracle.DatabaseCfg;
MessageBox.Show(string.Format("Výsledky budú zapísané do '{0}' databázy", cfg.DBUsed),
/// TODO: Implement database selection
MessageBox.Show(string.Format("Výsledky budú zapísané do produkčnej databázy"),
Strings.Information,
MessageBoxButtons.OK,
MessageBoxIcon.Information);
OracleConnection conn;
switch (cfg.DBUsed)
switch (DBUsed.Production)
{
default:
case DBUsed.Production:
@@ -192,6 +193,7 @@ namespace TBF.UI.ResultsMI
break;
}
if ((TBF.BenchControl.Sequences.ProcessData.OracleDB != null) &&
(TBF.BenchControl.Sequences.ProcessData.OracleDB.WriteResultsToDB(conn, b, true) == Retv.OK))
{
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
BIN
View File
Binary file not shown.
Binary file not shown.
Binary file not shown.
+2 -2
View File
@@ -19,7 +19,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;TURA_IPERL;LANG_SK</DefineConstants>
<DefineConstants>TRACE;DEBUG;TURA_SPECIAL</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>
@@ -28,7 +28,7 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;TURA_IPERL;LANG_SK</DefineConstants>
<DefineConstants>TRACE;TURA_SPECIAL</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<Prefer32Bit>false</Prefer32Bit>