'Config', 'Results' projects added, includes iPerl opto logging bug-fixes, builds OK, cannot open DB, version 2.0.158.

This commit is contained in:
Milan Hanajik
2015-12-05 14:18:36 +01:00
parent 29ece2f91c
commit f6cec9d769
360 changed files with 6406 additions and 4091 deletions
+28 -28
View File
@@ -9,7 +9,7 @@ using System.Collections.Generic;
using System.Windows.Forms;
using log4net;
using NHibernate;
using Config.Entities;
using TBF.BenchControl.Generic;
using TBF.BenchControl.GenericDevices;
using TBF.BenchControl.Sequences;
@@ -34,11 +34,11 @@ namespace TBF.BenchControl
static IList<IDevice> devices; /// list of devices
///
/// Bench paths
static IList<Entities.FeedingPath> feedingPaths;
static IList<Entities.BenchPath> benchPaths;
static IList<Entities.OutputPath> outputPaths;
static IList<Entities.MetersPath> metersPaths;
public static IList<Entities.TransitionSequence> TransitionSequences;
static IList<Config.Entities.FeedingPath> feedingPaths;
static IList<Config.Entities.BenchPath> benchPaths;
static IList<Config.Entities.OutputPath> outputPaths;
static IList<Config.Entities.MetersPath> metersPaths;
public static IList<Config.Entities.TransitionSequence> TransitionSequences;
/// Public components
public static Elde.ControlBoardDev ControlBoard;
@@ -125,8 +125,8 @@ namespace TBF.BenchControl
/// <summary>
/// Loaded by LoadProcedure() or IOperation LoadProcedureOp(...)
/// </summary>
public static Entities.Procedure Procedure; /// Procedure
public static IList<Entities.Test> Tests; /// Tests
public static Procedure Procedure; /// Procedure
public static IList<Test> Tests; /// Tests
/// Hardware devices connected to the PC controlling the bench.
@@ -224,7 +224,7 @@ namespace TBF.BenchControl
{
/// Load the list of components (entities) from the database.
/// Then create the components (derived from IComponent).
components = BenchControl.TbfComponents.LoadComponentsFromDB(FluentCommon.CreateSession(Database.Bench));
components = BenchControl.TbfComponents.LoadComponentsFromDB(Config.FluentCommon.CreateSession(Config.Database.Bench));
MasterValves = GenericDevices.ValveBase.MasterValves(components);
CoupledValves = GenericDevices.ValveBase.CoupledValves(components);
ExtendedValves = GenericDevices.ValveBase.ExtendedValves(components);
@@ -283,7 +283,7 @@ namespace TBF.BenchControl
/// Add all devices to the state machine and initialize them
foreach (var cmpnt in components)
{
if (cmpnt.DebugLevel == Entities.DebugMode.Simulate)
if (cmpnt.DebugLevel == DebugMode.Simulate)
{
inSimulMode.AppendFormat("{0}{1}", anyComponentIsInSimulMode ? ", " : "", cmpnt.Name);
anyComponentIsInSimulMode = true;
@@ -300,7 +300,7 @@ namespace TBF.BenchControl
foreach (var cmpnt in components)
{
if (cmpnt.Cfg is IChildComponentCfg && !string.IsNullOrEmpty(cmpnt.Cfg.ParentName) &&
(cmpnt.Cfg.DebugLevel == Entities.DebugMode.Inherit || cmpnt.Cfg.DebugLevel == Entities.DebugMode.AutoDetect))
(cmpnt.Cfg.DebugLevel == DebugMode.Inherit || cmpnt.Cfg.DebugLevel == DebugMode.AutoDetect))
{
foreach (var par in components)
{
@@ -331,14 +331,14 @@ namespace TBF.BenchControl
public static void LoadProcedure(bool loadPathsOnly)
{
ISession session = FluentCommon.CreateSession(Database.Procedures);
ISession session = Config.FluentCommon.CreateSession(Config.Database.Procedures);
WtSession = session;
feedingPaths = session.CreateQuery("FROM FeedingPath ORDER BY ItemNr").List<Entities.FeedingPath>();
benchPaths = session.CreateQuery("FROM BenchPath ORDER BY ItemNr").List<Entities.BenchPath>();
outputPaths = session.CreateQuery("FROM OutputPath ORDER BY ItemNr").List<Entities.OutputPath>();
metersPaths = session.CreateQuery("FROM MetersPath ORDER BY ItemNr").List<Entities.MetersPath>();
TransitionSequences = session.CreateQuery("FROM TransitionSequence ORDER BY ItemNr").List<Entities.TransitionSequence>();
feedingPaths = session.CreateQuery("FROM FeedingPath ORDER BY ItemNr").List<Config.Entities.FeedingPath>();
benchPaths = session.CreateQuery("FROM BenchPath ORDER BY ItemNr").List<Config.Entities.BenchPath>();
outputPaths = session.CreateQuery("FROM OutputPath ORDER BY ItemNr").List<Config.Entities.OutputPath>();
metersPaths = session.CreateQuery("FROM MetersPath ORDER BY ItemNr").List<Config.Entities.MetersPath>();
TransitionSequences = session.CreateQuery("FROM TransitionSequence ORDER BY ItemNr").List<TransitionSequence>();
// Automatic detection of empty tank valves
foreach (var opath in outputPaths)
@@ -359,10 +359,10 @@ namespace TBF.BenchControl
if (loadPathsOnly) return;
IList<Entities.Procedure> selectedProcs = session
IList<Procedure> selectedProcs = session
.CreateQuery("FROM Procedure WHERE ProcedureState = 'Active' AND Name = :name")
.SetParameter("name", TBF.UiBridge.Bridge.SelectedProcedureName)
.List<Entities.Procedure>();
.List<Procedure>();
if (selectedProcs.Count != 1) return;
@@ -370,7 +370,7 @@ namespace TBF.BenchControl
Tests = selectedProcs[0].Tests;
}
public static void LoadProcedureParams(Entities.Procedure procedure)
public static void LoadProcedureParams(Procedure procedure)
{
foreach (var cmpnt in components)
{
@@ -378,7 +378,7 @@ namespace TBF.BenchControl
}
}
public static void LoadTestParams(Entities.Test test)
public static void LoadTestParams(Test test)
{
foreach (var cmpnt in components)
{
@@ -391,7 +391,7 @@ namespace TBF.BenchControl
/// </summary>
/// <param name="selection">Selection.Q1, .Q2, .Q3 or .Test</param>
/// <returns>The selected test or null</returns>
public static Entities.Test GetTest(Sequences.MainSeq.Selection selection)
public static Config.Entities.Test GetTest(Sequences.MainSeq.Selection selection)
{
if ((selection == Sequences.MainSeq.Selection.Q1) && (Tests.Count >= 1))
{
@@ -427,13 +427,13 @@ namespace TBF.BenchControl
/// <param name="transitionAfter">Transition sequence entity</param>
/// <param name="errorMsg">Error message in case of incorrect configuration</param>
/// <returns>true when loaded configuration is correct (all four paths are defined !=null, etc.)</returns>
public static bool GetPaths(Entities.Test test,
public static bool GetPaths(Test test,
out FeedingPath pfeed,
out BenchPath pben,
out OutputPath pout,
out MetersPath pmtrs,
out Entities.TransitionSequence transitionBefore,
out Entities.TransitionSequence transitionAfter,
out TransitionSequence transitionBefore,
out TransitionSequence transitionAfter,
out string errorMsg)
{
pfeed = null;
@@ -491,7 +491,7 @@ namespace TBF.BenchControl
/// <summary>
/// Updates paths based on the selected test
/// </summary>
public static MetersPath GetMetersPath(Entities.Test test)
public static MetersPath GetMetersPath(Test test)
{
MetersPath pmtrs = null;
foreach (var path in metersPaths)
@@ -500,11 +500,11 @@ namespace TBF.BenchControl
}
if (pmtrs != null)
{
int count = Math.Min(Program.WMsCount, pmtrs.RegisterReaders.Length);
int count = Math.Min(Config.Data.WMsCount, pmtrs.RegisterReaders.Length);
for (int i = 0; i < count; i++)
{
if ((pmtrs.RegisterReaders[i] != null) &&
(pmtrs.RegisterReaders[i].Cfg.DebugLevel == Entities.DebugMode.DetectedOff))
(pmtrs.RegisterReaders[i].Cfg.DebugLevel == DebugMode.DetectedOff))
{
pmtrs.RegisterReaders[i] = null;
}