'Config', 'Results' projects added, includes iPerl opto logging bug-fixes, builds OK, cannot open DB, version 2.0.158.
This commit is contained in:
parent
29ece2f91c
commit
f6cec9d769
4
.gitignore
vendored
4
.gitignore
vendored
@ -1,5 +1,9 @@
|
||||
TestBenchFramework/bin/
|
||||
TestBenchFramework/obj/
|
||||
Config/bin/
|
||||
Config/obj/
|
||||
Results/bin/
|
||||
Results/obj/
|
||||
ResultsBrowser/bin/
|
||||
ResultsBrowser/obj/
|
||||
TBFSetup/Debug/
|
||||
|
||||
130
Config/Config.csproj
Normal file
130
Config/Config.csproj
Normal file
@ -0,0 +1,130 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{743DF7DB-C7B6-42EB-986D-0F485E5588E4}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Config</RootNamespace>
|
||||
<AssemblyName>Config</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG;MUNICH</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;MUNICH</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="FluentNHibernate">
|
||||
<HintPath>..\packages\FluentNHibernate.1.3.0.733\lib\FluentNHibernate.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Iesi.Collections">
|
||||
<HintPath>..\packages\Iesi.Collections.3.2.0.4000\lib\Net35\Iesi.Collections.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MySql.Data">
|
||||
<HintPath>..\packages\MySql.Data.6.6.5\lib\net20\MySql.Data.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="NHibernate">
|
||||
<HintPath>..\packages\NHibernate.3.3.3.4001\lib\Net35\NHibernate.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Data.cs" />
|
||||
<Compile Include="DatabaseSettings.cs" />
|
||||
<Compile Include="DatabaseSettingsDlg.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="DatabaseSettingsDlg.designer.cs">
|
||||
<DependentUpon>DatabaseSettingsDlg.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="DBSettings.cs" />
|
||||
<Compile Include="Entities\BenchPath.cs" />
|
||||
<Compile Include="Entities\Component.cs" />
|
||||
<Compile Include="Entities\ComponentProcedure.cs" />
|
||||
<Compile Include="Entities\ComponentTest.cs" />
|
||||
<Compile Include="Entities\Enums.cs" />
|
||||
<Compile Include="Entities\FeedingPath.cs" />
|
||||
<Compile Include="Entities\Group.cs" />
|
||||
<Compile Include="Entities\IHasItemNr.cs" />
|
||||
<Compile Include="Entities\IHasValves.cs" />
|
||||
<Compile Include="Entities\MeasurementCorrection.cs" />
|
||||
<Compile Include="Entities\MetersPath.cs" />
|
||||
<Compile Include="Entities\MeterTestResult.cs" />
|
||||
<Compile Include="Entities\OutputPath.cs" />
|
||||
<Compile Include="Entities\Procedure.cs" />
|
||||
<Compile Include="Entities\ProcedureHistory.cs" />
|
||||
<Compile Include="Entities\Test.cs" />
|
||||
<Compile Include="Entities\TestResult.cs" />
|
||||
<Compile Include="Entities\TransitionSequence.cs" />
|
||||
<Compile Include="Entities\TransitionStep.cs" />
|
||||
<Compile Include="Entities\User.cs" />
|
||||
<Compile Include="Entities\VirtualBenchSequence.cs" />
|
||||
<Compile Include="Entities\VirtualBenchStep.cs" />
|
||||
<Compile Include="Entities\Watermeter.cs" />
|
||||
<Compile Include="Entities\WMType.cs" />
|
||||
<Compile Include="FluentCommon.cs" />
|
||||
<Compile Include="Grp.cs" />
|
||||
<Compile Include="Mappings\BenchPathMap.cs" />
|
||||
<Compile Include="Mappings\ComponentMap.cs" />
|
||||
<Compile Include="Mappings\ComponentProcedureMap.cs" />
|
||||
<Compile Include="Mappings\ComponentTestMap.cs" />
|
||||
<Compile Include="Mappings\FeedingPathMap.cs" />
|
||||
<Compile Include="Mappings\GroupMap.cs" />
|
||||
<Compile Include="Mappings\MeasurementCorrectionMap.cs" />
|
||||
<Compile Include="Mappings\MetersPathMap.cs" />
|
||||
<Compile Include="Mappings\MeterTestResultMap.cs" />
|
||||
<Compile Include="Mappings\OutputPathMap.cs" />
|
||||
<Compile Include="Mappings\ProcedureMap.cs" />
|
||||
<Compile Include="Mappings\TestMap.cs" />
|
||||
<Compile Include="Mappings\TestResultMap.cs" />
|
||||
<Compile Include="Mappings\TransitionSequenceMap.cs" />
|
||||
<Compile Include="Mappings\TransitionStepMap.cs" />
|
||||
<Compile Include="Mappings\UserMap.cs" />
|
||||
<Compile Include="Mappings\VirtualBenchSequenceMap.cs" />
|
||||
<Compile Include="Mappings\VirtualBenchStepMap.cs" />
|
||||
<Compile Include="Mappings\WatermeterMap.cs" />
|
||||
<Compile Include="Mappings\WMTypeMap.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Resources\Strings.Designer.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="DatabaseSettingsDlg.resx">
|
||||
<DependentUpon>DatabaseSettingsDlg.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="Resources\Strings.resx">
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@ -3,7 +3,7 @@
|
||||
///
|
||||
using System;
|
||||
|
||||
namespace TBF
|
||||
namespace Config
|
||||
{
|
||||
/// <summary>
|
||||
/// Database settings required to make a connection
|
||||
42
Config/Data.cs
Normal file
42
Config/Data.cs
Normal file
@ -0,0 +1,42 @@
|
||||
using System;
|
||||
|
||||
namespace Config
|
||||
{
|
||||
public class Data
|
||||
{
|
||||
public const string AdminUsername = "admin";
|
||||
public const string AdminPassword = "staratura";
|
||||
public const string SQLiteDbFName = "SQLite.db";
|
||||
|
||||
#if MUNICH
|
||||
public const int WMsCount = 3;
|
||||
public const int LineSize = 1;
|
||||
public const int CompoundWMsCount = 1;
|
||||
#elif DN100 || BADGER_VELKA_TRAT
|
||||
public const int WMsCount = 3;
|
||||
public const int LineSize = 3;
|
||||
public const int CompoundWMsCount = 1;
|
||||
#elif FUZHOU300 || FUZHOU150 || PT200IL
|
||||
public const int WMsCount = 6;
|
||||
public const int LineSize = 6;
|
||||
public const int CompoundWMsCount = 3;
|
||||
#elif TORINO50 || BADGER_MALA_TRAT
|
||||
public const int WMsCount = 6;
|
||||
public const int LineSize = 6;
|
||||
public const int CompoundWMsCount = 1;
|
||||
#elif TORUN_PT50_2015 || CEVAK_PT40_272 || MURES_PT40 || FUZHOU_40
|
||||
public const int WMsCount = 20;
|
||||
public const int LineSize = 10;
|
||||
public const int CompoundWMsCount = 1;
|
||||
#elif IPERLST
|
||||
public const int WMsCount = 40;
|
||||
public const int LineSize = 20;
|
||||
public const int CompoundWMsCount = 1;
|
||||
#endif
|
||||
|
||||
///
|
||||
/// Database related: This object reference is set after a successful user login
|
||||
///
|
||||
public static DatabaseSettings CurrentBench;
|
||||
}
|
||||
}
|
||||
@ -5,7 +5,7 @@ using System;
|
||||
using System.Text;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace TBF
|
||||
namespace Config
|
||||
{
|
||||
/// <summary>
|
||||
/// Test bench database settings, contains bench name and settings od several databases
|
||||
@ -1,7 +1,7 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
///
|
||||
namespace TBF
|
||||
namespace Config
|
||||
{
|
||||
partial class DatabaseSettingsDlg
|
||||
{
|
||||
@ -69,7 +69,6 @@ namespace TBF
|
||||
// okButton
|
||||
//
|
||||
this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK;
|
||||
this.okButton.ImageKey = global::TBF.Resources.Strings.String1;
|
||||
resources.ApplyResources(this.okButton, "okButton");
|
||||
this.okButton.Name = "okButton";
|
||||
this.okButton.UseVisualStyleBackColor = true;
|
||||
@ -78,7 +77,6 @@ namespace TBF
|
||||
// cancelButton
|
||||
//
|
||||
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.cancelButton.ImageKey = global::TBF.Resources.Strings.String1;
|
||||
resources.ApplyResources(this.cancelButton, "cancelButton");
|
||||
this.cancelButton.Name = "cancelButton";
|
||||
this.cancelButton.UseVisualStyleBackColor = true;
|
||||
@ -87,7 +85,6 @@ namespace TBF
|
||||
// label1
|
||||
//
|
||||
resources.ApplyResources(this.label1, "label1");
|
||||
this.label1.ImageKey = global::TBF.Resources.Strings.String1;
|
||||
this.label1.Name = "label1";
|
||||
//
|
||||
// benchNameTextBox
|
||||
@ -103,7 +100,6 @@ namespace TBF
|
||||
// connectionStringLabel
|
||||
//
|
||||
resources.ApplyResources(this.connectionStringLabel, "connectionStringLabel");
|
||||
this.connectionStringLabel.ImageKey = global::TBF.Resources.Strings.String1;
|
||||
this.connectionStringLabel.Name = "connectionStringLabel";
|
||||
//
|
||||
// benchConnectionStringTextBox
|
||||
@ -129,37 +125,31 @@ namespace TBF
|
||||
// label2
|
||||
//
|
||||
resources.ApplyResources(this.label2, "label2");
|
||||
this.label2.ImageKey = global::TBF.Resources.Strings.String1;
|
||||
this.label2.Name = "label2";
|
||||
//
|
||||
// label3
|
||||
//
|
||||
resources.ApplyResources(this.label3, "label3");
|
||||
this.label3.ImageKey = global::TBF.Resources.Strings.String1;
|
||||
this.label3.Name = "label3";
|
||||
//
|
||||
// label4
|
||||
//
|
||||
resources.ApplyResources(this.label4, "label4");
|
||||
this.label4.ImageKey = global::TBF.Resources.Strings.String1;
|
||||
this.label4.Name = "label4";
|
||||
//
|
||||
// label5
|
||||
//
|
||||
resources.ApplyResources(this.label5, "label5");
|
||||
this.label5.ImageKey = global::TBF.Resources.Strings.String1;
|
||||
this.label5.Name = "label5";
|
||||
//
|
||||
// label6
|
||||
//
|
||||
resources.ApplyResources(this.label6, "label6");
|
||||
this.label6.ImageKey = global::TBF.Resources.Strings.String1;
|
||||
this.label6.Name = "label6";
|
||||
//
|
||||
// testConnUsersBtn
|
||||
//
|
||||
this.testConnUsersBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.testConnUsersBtn.ImageKey = global::TBF.Resources.Strings.String1;
|
||||
resources.ApplyResources(this.testConnUsersBtn, "testConnUsersBtn");
|
||||
this.testConnUsersBtn.Name = "testConnUsersBtn";
|
||||
this.testConnUsersBtn.UseVisualStyleBackColor = true;
|
||||
@ -168,7 +158,6 @@ namespace TBF
|
||||
// createUsersDbBtn
|
||||
//
|
||||
this.createUsersDbBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.createUsersDbBtn.ImageKey = global::TBF.Resources.Strings.String1;
|
||||
resources.ApplyResources(this.createUsersDbBtn, "createUsersDbBtn");
|
||||
this.createUsersDbBtn.Name = "createUsersDbBtn";
|
||||
this.createUsersDbBtn.UseVisualStyleBackColor = true;
|
||||
@ -177,14 +166,12 @@ namespace TBF
|
||||
// realBenchCheckBox
|
||||
//
|
||||
resources.ApplyResources(this.realBenchCheckBox, "realBenchCheckBox");
|
||||
this.realBenchCheckBox.ImageKey = global::TBF.Resources.Strings.String1;
|
||||
this.realBenchCheckBox.Name = "realBenchCheckBox";
|
||||
this.realBenchCheckBox.UseVisualStyleBackColor = true;
|
||||
//
|
||||
// dbTypeLabel
|
||||
//
|
||||
resources.ApplyResources(this.dbTypeLabel, "dbTypeLabel");
|
||||
this.dbTypeLabel.ImageKey = global::TBF.Resources.Strings.String1;
|
||||
this.dbTypeLabel.Name = "dbTypeLabel";
|
||||
//
|
||||
// usersDbTypeComboBox
|
||||
@ -220,7 +207,6 @@ namespace TBF
|
||||
// testConnBenchBtn
|
||||
//
|
||||
this.testConnBenchBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.testConnBenchBtn.ImageKey = global::TBF.Resources.Strings.String1;
|
||||
resources.ApplyResources(this.testConnBenchBtn, "testConnBenchBtn");
|
||||
this.testConnBenchBtn.Name = "testConnBenchBtn";
|
||||
this.testConnBenchBtn.UseVisualStyleBackColor = true;
|
||||
@ -229,7 +215,6 @@ namespace TBF
|
||||
// testConnProceduresBtn
|
||||
//
|
||||
this.testConnProceduresBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.testConnProceduresBtn.ImageKey = global::TBF.Resources.Strings.String1;
|
||||
resources.ApplyResources(this.testConnProceduresBtn, "testConnProceduresBtn");
|
||||
this.testConnProceduresBtn.Name = "testConnProceduresBtn";
|
||||
this.testConnProceduresBtn.UseVisualStyleBackColor = true;
|
||||
@ -238,7 +223,6 @@ namespace TBF
|
||||
// testConnWMTypesBtn
|
||||
//
|
||||
this.testConnWMTypesBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.testConnWMTypesBtn.ImageKey = global::TBF.Resources.Strings.String1;
|
||||
resources.ApplyResources(this.testConnWMTypesBtn, "testConnWMTypesBtn");
|
||||
this.testConnWMTypesBtn.Name = "testConnWMTypesBtn";
|
||||
this.testConnWMTypesBtn.UseVisualStyleBackColor = true;
|
||||
@ -247,7 +231,6 @@ namespace TBF
|
||||
// testConnWaterMetersBtn
|
||||
//
|
||||
this.testConnWaterMetersBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.testConnWaterMetersBtn.ImageKey = global::TBF.Resources.Strings.String1;
|
||||
resources.ApplyResources(this.testConnWaterMetersBtn, "testConnWaterMetersBtn");
|
||||
this.testConnWaterMetersBtn.Name = "testConnWaterMetersBtn";
|
||||
this.testConnWaterMetersBtn.UseVisualStyleBackColor = true;
|
||||
@ -256,7 +239,6 @@ namespace TBF
|
||||
// createBenchDbBtn
|
||||
//
|
||||
this.createBenchDbBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.createBenchDbBtn.ImageKey = global::TBF.Resources.Strings.String1;
|
||||
resources.ApplyResources(this.createBenchDbBtn, "createBenchDbBtn");
|
||||
this.createBenchDbBtn.Name = "createBenchDbBtn";
|
||||
this.createBenchDbBtn.UseVisualStyleBackColor = true;
|
||||
@ -265,7 +247,6 @@ namespace TBF
|
||||
// createProceduresDbBtn
|
||||
//
|
||||
this.createProceduresDbBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.createProceduresDbBtn.ImageKey = global::TBF.Resources.Strings.String1;
|
||||
resources.ApplyResources(this.createProceduresDbBtn, "createProceduresDbBtn");
|
||||
this.createProceduresDbBtn.Name = "createProceduresDbBtn";
|
||||
this.createProceduresDbBtn.UseVisualStyleBackColor = true;
|
||||
@ -274,7 +255,6 @@ namespace TBF
|
||||
// createWMTypesDbBtn
|
||||
//
|
||||
this.createWMTypesDbBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.createWMTypesDbBtn.ImageKey = global::TBF.Resources.Strings.String1;
|
||||
resources.ApplyResources(this.createWMTypesDbBtn, "createWMTypesDbBtn");
|
||||
this.createWMTypesDbBtn.Name = "createWMTypesDbBtn";
|
||||
this.createWMTypesDbBtn.UseVisualStyleBackColor = true;
|
||||
@ -283,7 +263,6 @@ namespace TBF
|
||||
// createWaterMetersDbBtn
|
||||
//
|
||||
this.createWaterMetersDbBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel;
|
||||
this.createWaterMetersDbBtn.ImageKey = global::TBF.Resources.Strings.String1;
|
||||
resources.ApplyResources(this.createWaterMetersDbBtn, "createWaterMetersDbBtn");
|
||||
this.createWaterMetersDbBtn.Name = "createWaterMetersDbBtn";
|
||||
this.createWaterMetersDbBtn.UseVisualStyleBackColor = true;
|
||||
@ -2,15 +2,10 @@
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Drawing;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using TBF.Resources;
|
||||
using Config.Resources;
|
||||
|
||||
namespace TBF
|
||||
namespace Config
|
||||
{
|
||||
/// <summary>
|
||||
/// Dialog to process test bench name and database settings (BenchSettings)
|
||||
@ -4,7 +4,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace TBF.Entities
|
||||
namespace Config.Entities
|
||||
{
|
||||
public class BenchPath : IHasItemNr, IHasValves
|
||||
{
|
||||
@ -26,7 +26,9 @@ namespace TBF.Entities
|
||||
|
||||
public BenchPath()
|
||||
{
|
||||
}
|
||||
ValvesOpen = string.Empty;
|
||||
ValvesClose = string.Empty;
|
||||
}
|
||||
|
||||
public BenchPath(string name, int itemNr)
|
||||
: this()
|
||||
@ -35,33 +37,6 @@ namespace TBF.Entities
|
||||
ItemNr = itemNr;
|
||||
}
|
||||
|
||||
public BenchPath(BenchControl.BenchPath path)
|
||||
: this(path.Name, path.ItemNr)
|
||||
{
|
||||
Qfrom = path.Qfrom;
|
||||
Qto = path.Qto;
|
||||
TempIn = (path.TempIn != null) ? path.TempIn.Cfg.Name : null;
|
||||
TempOut = (path.TempOut != null) ? path.TempOut.Cfg.Name : null;
|
||||
PressIn = (path.PressIn != null) ? path.PressIn.Cfg.Name : null;
|
||||
PressOut = (path.PressOut != null) ? path.PressOut.Cfg.Name : null;
|
||||
|
||||
string vOpen = string.Empty;
|
||||
foreach (var valve in path.ValvesOpen)
|
||||
{
|
||||
if (vOpen != string.Empty) vOpen += ";";
|
||||
vOpen += valve.Cfg.Name;
|
||||
}
|
||||
ValvesOpen = vOpen;
|
||||
|
||||
string vClose = string.Empty;
|
||||
foreach (var valve in path.ValvesClose)
|
||||
{
|
||||
if (vClose != string.Empty) vClose += ";";
|
||||
vClose += valve.Cfg.Name;
|
||||
}
|
||||
ValvesClose = vClose;
|
||||
}
|
||||
|
||||
public virtual BenchPath Clone(string name, int itemNr)
|
||||
{
|
||||
BenchPath result = new BenchPath(name, itemNr);
|
||||
@ -4,7 +4,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace TBF.Entities
|
||||
namespace Config.Entities
|
||||
{
|
||||
public class Component : IHasItemNr
|
||||
{
|
||||
@ -1,7 +1,7 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
///
|
||||
namespace TBF.Entities
|
||||
namespace Config.Entities
|
||||
{
|
||||
public class ComponentProcedure
|
||||
{
|
||||
@ -1,7 +1,7 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
///
|
||||
namespace TBF.Entities
|
||||
namespace Config.Entities
|
||||
{
|
||||
public class ComponentTest
|
||||
{
|
||||
@ -4,7 +4,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace TBF.Entities
|
||||
namespace Config.Entities
|
||||
{
|
||||
public enum ProcedureState
|
||||
{
|
||||
@ -105,5 +105,20 @@ namespace TBF.Entities
|
||||
All,
|
||||
Count,
|
||||
}
|
||||
|
||||
|
||||
/// Arrangement of tests
|
||||
public enum TestsArrangement
|
||||
{
|
||||
Rows,
|
||||
Columns,
|
||||
}
|
||||
|
||||
/// Arrangement of meters
|
||||
public enum MetersArrangement
|
||||
{
|
||||
Vertically,
|
||||
Horizontally,
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,7 +4,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace TBF.Entities
|
||||
namespace Config.Entities
|
||||
{
|
||||
public class FeedingPath : IHasItemNr, IHasValves
|
||||
{
|
||||
@ -23,7 +23,9 @@ namespace TBF.Entities
|
||||
|
||||
public FeedingPath()
|
||||
{
|
||||
}
|
||||
ValvesOpen = string.Empty;
|
||||
ValvesClose = string.Empty;
|
||||
}
|
||||
|
||||
public FeedingPath(string name, int itemNr)
|
||||
: this()
|
||||
@ -32,30 +34,6 @@ namespace TBF.Entities
|
||||
ItemNr = itemNr;
|
||||
}
|
||||
|
||||
public FeedingPath(BenchControl.FeedingPath path)
|
||||
: this(path.Name, path.ItemNr)
|
||||
{
|
||||
Qfrom = path.Qfrom;
|
||||
Qto = path.Qto;
|
||||
Pump = (path.Pump != null) ? path.Pump.Cfg.Name : null;
|
||||
|
||||
string vOpen = string.Empty;
|
||||
foreach (var valve in path.ValvesOpen)
|
||||
{
|
||||
if (vOpen != string.Empty) vOpen += ";";
|
||||
vOpen += valve.Cfg.Name;
|
||||
}
|
||||
ValvesOpen = vOpen;
|
||||
|
||||
string vClose = string.Empty;
|
||||
foreach (var valve in path.ValvesClose)
|
||||
{
|
||||
if (vClose != string.Empty) vClose += ";";
|
||||
vClose += valve.Cfg.Name;
|
||||
}
|
||||
ValvesClose = vClose;
|
||||
}
|
||||
|
||||
public virtual FeedingPath Clone(string name, int itemNr)
|
||||
{
|
||||
FeedingPath result = new FeedingPath(name, itemNr);
|
||||
@ -4,7 +4,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace TBF.Entities
|
||||
namespace Config.Entities
|
||||
{
|
||||
public class Group
|
||||
{
|
||||
@ -1,9 +1,9 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
///
|
||||
namespace TBF.Entities
|
||||
namespace Config.Entities
|
||||
{
|
||||
interface IHasItemNr
|
||||
public interface IHasItemNr
|
||||
{
|
||||
int Id { get; }
|
||||
int ItemNr { get; set; }
|
||||
@ -1,7 +1,7 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
///
|
||||
namespace TBF.Entities
|
||||
namespace Config.Entities
|
||||
{
|
||||
public interface IHasValves
|
||||
{
|
||||
@ -3,7 +3,7 @@
|
||||
///
|
||||
using System;
|
||||
|
||||
namespace TBF.Entities
|
||||
namespace Config.Entities
|
||||
{
|
||||
public class MeasurementCorrection
|
||||
{
|
||||
@ -3,7 +3,7 @@
|
||||
///
|
||||
using System;
|
||||
|
||||
namespace TBF.Entities
|
||||
namespace Config.Entities
|
||||
{
|
||||
public class MeterTestResult
|
||||
{
|
||||
@ -4,7 +4,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace TBF.Entities
|
||||
namespace Config.Entities
|
||||
{
|
||||
public class MetersPath : IHasItemNr
|
||||
{
|
||||
@ -71,57 +71,6 @@ namespace TBF.Entities
|
||||
ItemNr = itemNr;
|
||||
}
|
||||
|
||||
public MetersPath(BenchControl.MetersPath path)
|
||||
: this(path.Name, path.ItemNr)
|
||||
{
|
||||
Qfrom = path.Qfrom;
|
||||
Qto = path.Qto;
|
||||
Sensor1 = (path.RegisterReaders[0] != null) ? path.RegisterReaders[0].Cfg.Name : null;
|
||||
#pragma warning disable
|
||||
if (Program.WMsCount >= 2) Sensor2 = (path.RegisterReaders[1] != null) ? path.RegisterReaders[1].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 3) Sensor3 = (path.RegisterReaders[2] != null) ? path.RegisterReaders[2].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 4) Sensor4 = (path.RegisterReaders[3] != null) ? path.RegisterReaders[3].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 5) Sensor5 = (path.RegisterReaders[4] != null) ? path.RegisterReaders[4].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 6) Sensor6 = (path.RegisterReaders[5] != null) ? path.RegisterReaders[5].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 7) Sensor7 = (path.RegisterReaders[6] != null) ? path.RegisterReaders[6].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 8) Sensor8 = (path.RegisterReaders[7] != null) ? path.RegisterReaders[7].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 9) Sensor9 = (path.RegisterReaders[8] != null) ? path.RegisterReaders[8].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 10) Sensor10 = (path.RegisterReaders[9] != null) ? path.RegisterReaders[9].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 11) Sensor11 = (path.RegisterReaders[10] != null) ? path.RegisterReaders[10].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 12) Sensor12 = (path.RegisterReaders[11] != null) ? path.RegisterReaders[11].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 13) Sensor13 = (path.RegisterReaders[12] != null) ? path.RegisterReaders[12].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 14) Sensor14 = (path.RegisterReaders[13] != null) ? path.RegisterReaders[13].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 15) Sensor15 = (path.RegisterReaders[14] != null) ? path.RegisterReaders[14].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 16) Sensor16 = (path.RegisterReaders[15] != null) ? path.RegisterReaders[15].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 17) Sensor17 = (path.RegisterReaders[16] != null) ? path.RegisterReaders[16].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 18) Sensor18 = (path.RegisterReaders[17] != null) ? path.RegisterReaders[17].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 19) Sensor19 = (path.RegisterReaders[18] != null) ? path.RegisterReaders[18].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 20) Sensor20 = (path.RegisterReaders[19] != null) ? path.RegisterReaders[19].Cfg.Name : null;
|
||||
#if IPERLST
|
||||
if (Program.WMsCount >= 21) Sensor21 = (path.RegisterReaders[20] != null) ? path.RegisterReaders[20].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 22) Sensor22 = (path.RegisterReaders[21] != null) ? path.RegisterReaders[21].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 23) Sensor23 = (path.RegisterReaders[22] != null) ? path.RegisterReaders[22].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 24) Sensor24 = (path.RegisterReaders[23] != null) ? path.RegisterReaders[23].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 25) Sensor25 = (path.RegisterReaders[24] != null) ? path.RegisterReaders[24].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 26) Sensor26 = (path.RegisterReaders[25] != null) ? path.RegisterReaders[25].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 27) Sensor27 = (path.RegisterReaders[26] != null) ? path.RegisterReaders[26].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 28) Sensor28 = (path.RegisterReaders[27] != null) ? path.RegisterReaders[27].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 29) Sensor29 = (path.RegisterReaders[28] != null) ? path.RegisterReaders[28].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 30) Sensor30 = (path.RegisterReaders[29] != null) ? path.RegisterReaders[29].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 31) Sensor31 = (path.RegisterReaders[30] != null) ? path.RegisterReaders[30].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 32) Sensor32 = (path.RegisterReaders[31] != null) ? path.RegisterReaders[31].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 33) Sensor33 = (path.RegisterReaders[32] != null) ? path.RegisterReaders[32].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 34) Sensor34 = (path.RegisterReaders[33] != null) ? path.RegisterReaders[33].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 35) Sensor35 = (path.RegisterReaders[34] != null) ? path.RegisterReaders[34].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 36) Sensor36 = (path.RegisterReaders[35] != null) ? path.RegisterReaders[35].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 37) Sensor37 = (path.RegisterReaders[36] != null) ? path.RegisterReaders[36].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 38) Sensor38 = (path.RegisterReaders[37] != null) ? path.RegisterReaders[37].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 39) Sensor39 = (path.RegisterReaders[38] != null) ? path.RegisterReaders[38].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 40) Sensor40 = (path.RegisterReaders[39] != null) ? path.RegisterReaders[39].Cfg.Name : null;
|
||||
#endif
|
||||
#pragma warning restore
|
||||
}
|
||||
|
||||
public virtual MetersPath Clone(string name, int itemNr)
|
||||
{
|
||||
MetersPath result = new MetersPath(name, itemNr);
|
||||
@ -4,7 +4,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace TBF.Entities
|
||||
namespace Config.Entities
|
||||
{
|
||||
public class OutputPath : IHasItemNr, IHasValves
|
||||
{
|
||||
@ -30,6 +30,8 @@ namespace TBF.Entities
|
||||
|
||||
public OutputPath()
|
||||
{
|
||||
ValvesOpen = string.Empty;
|
||||
ValvesClose = string.Empty;
|
||||
}
|
||||
|
||||
public OutputPath(string name, int itemNr)
|
||||
@ -39,37 +41,6 @@ namespace TBF.Entities
|
||||
ItemNr = itemNr;
|
||||
}
|
||||
|
||||
public OutputPath(BenchControl.OutputPath path)
|
||||
: this(path.Name, path.ItemNr)
|
||||
{
|
||||
Qfrom = path.Qfrom;
|
||||
Qto = path.Qto;
|
||||
RegulValve = (path.RegulValve != null) ? path.RegulValve.Cfg.Name : null;
|
||||
FlowMeter = (path.FlowMeter != null) ? path.FlowMeter.Cfg.Name : null;
|
||||
PidCoef = path.PidCoef;
|
||||
StartValve = (path.StartValve != null) ? path.StartValve.Cfg.Name : null;
|
||||
Diverter = (path.Diverter != null) ? path.Diverter.Cfg.Name : null;
|
||||
TempDiv = (path.TempDiv != null) ? path.TempDiv.Cfg.Name : null;
|
||||
Balance = (path.Balance != null) ? path.Balance.Cfg.Name : null;
|
||||
EmptyTankValve = (path.EmptyTankValve != null) ? path.EmptyTankValve.Cfg.Name : null;
|
||||
|
||||
string vOpen = string.Empty;
|
||||
foreach (var valve in path.ValvesOpen)
|
||||
{
|
||||
if (vOpen != string.Empty) vOpen += ";";
|
||||
vOpen += valve.Cfg.Name;
|
||||
}
|
||||
ValvesOpen = vOpen;
|
||||
|
||||
string vClose = string.Empty;
|
||||
foreach (var valve in path.ValvesClose)
|
||||
{
|
||||
if (vClose != string.Empty) vClose += ";";
|
||||
vClose += valve.Cfg.Name;
|
||||
}
|
||||
ValvesClose = vClose;
|
||||
}
|
||||
|
||||
public virtual OutputPath Clone(string name, int itemNr)
|
||||
{
|
||||
OutputPath result = new OutputPath(name, itemNr);
|
||||
@ -3,9 +3,8 @@
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace TBF.Entities
|
||||
namespace Config.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// Stores one test procedure, supports revisions and history log
|
||||
@ -4,7 +4,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace TBF.Entities
|
||||
namespace Config.Entities
|
||||
{
|
||||
public class ProcedureHistory
|
||||
{
|
||||
@ -5,7 +5,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace TBF.Entities
|
||||
namespace Config.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// Test, consisting of one or more repetitions of the test 'SingleTest'.
|
||||
@ -4,7 +4,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace TBF.Entities
|
||||
namespace Config.Entities
|
||||
{
|
||||
public class TestResult
|
||||
{
|
||||
@ -113,12 +113,12 @@ namespace TBF.Entities
|
||||
|
||||
if (kind == MetersKind.Single)
|
||||
{
|
||||
for (int i = 0; i < Program.WMsCount; i++) Meters.Add(new MeterTestResult(this));
|
||||
for (int i = 0; i < Config.Data.WMsCount; i++) Meters.Add(new MeterTestResult(this));
|
||||
}
|
||||
else if (kind == MetersKind.Combined)
|
||||
{
|
||||
for (int i = 0; i < 2 * Program.CompoundWMsCount; i++) Meters.Add(new MeterTestResult(this));
|
||||
for (int i = 0; i < Program.CompoundWMsCount; i++) CombinedMeters.Add(new MeterTestResult(this));
|
||||
for (int i = 0; i < 2 * Config.Data.CompoundWMsCount; i++) Meters.Add(new MeterTestResult(this));
|
||||
for (int i = 0; i < Config.Data.CompoundWMsCount; i++) CombinedMeters.Add(new MeterTestResult(this));
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
///
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace TBF.Entities
|
||||
namespace Config.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// Stores one transition sequence containing a list of transition steps
|
||||
@ -4,7 +4,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace TBF.Entities
|
||||
namespace Config.Entities
|
||||
{
|
||||
public class TransitionStep : IHasItemNr, IHasValves
|
||||
{
|
||||
@ -6,9 +6,9 @@ using System.Collections.Generic;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Diagnostics;
|
||||
using TBF.Resources;
|
||||
using Config.Resources;
|
||||
|
||||
namespace TBF.Entities
|
||||
namespace Config.Entities
|
||||
{
|
||||
public class User
|
||||
{
|
||||
@ -123,7 +123,7 @@ namespace TBF.Entities
|
||||
/// <param name="password"></param>
|
||||
/// <param name="requiredGrupMembership"></param>
|
||||
/// <returns>true = authorized</returns>
|
||||
public virtual bool Authorize(string userName, string password, TBF.Grp.GID requiredGroupMembership)
|
||||
public virtual bool Authorize(string userName, string password, Grp.GID requiredGroupMembership)
|
||||
{
|
||||
if (Entities.User.IsPowerUser(userName, password))
|
||||
{
|
||||
@ -4,7 +4,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace TBF.Entities
|
||||
namespace Config.Entities
|
||||
{
|
||||
public class VirtualBenchSequence : IHasItemNr
|
||||
{
|
||||
@ -4,7 +4,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace TBF.Entities
|
||||
namespace Config.Entities
|
||||
{
|
||||
public class VirtualBenchStep : IHasItemNr
|
||||
{
|
||||
@ -9,7 +9,7 @@ using System.Text;
|
||||
/// This class holds the watermeter type specific data
|
||||
/// that have all watermaters of the same type in common
|
||||
|
||||
namespace TBF.Entities
|
||||
namespace Config.Entities
|
||||
{
|
||||
public class WMType
|
||||
{
|
||||
@ -6,11 +6,10 @@ using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
using TBF;
|
||||
using NHibernate;
|
||||
using FluentNHibernate;
|
||||
|
||||
namespace TBF.Entities
|
||||
namespace Config.Entities
|
||||
{
|
||||
public class Watermeter
|
||||
{
|
||||
@ -7,9 +7,9 @@ using FluentNHibernate.Cfg.Db;
|
||||
using NHibernate;
|
||||
using NHibernate.Cfg;
|
||||
using NHibernate.Tool.hbm2ddl;
|
||||
using TBF.Resources;
|
||||
using Config.Resources;
|
||||
|
||||
namespace TBF
|
||||
namespace Config
|
||||
{
|
||||
/// <summary>
|
||||
/// Identifies the content of a database
|
||||
@ -54,20 +54,20 @@ namespace TBF
|
||||
{
|
||||
default:
|
||||
case Database.Users:
|
||||
dbType = Program.CurrentBench.UsersDBSettings.DbType;
|
||||
connectionString = Program.CurrentBench.UsersDBSettings.ConnectionString;
|
||||
dbType = Data.CurrentBench.UsersDBSettings.DbType;
|
||||
connectionString = Data.CurrentBench.UsersDBSettings.ConnectionString;
|
||||
break;
|
||||
case Database.Bench:
|
||||
dbType = Program.CurrentBench.BenchDBSettings.DbType;
|
||||
connectionString = Program.CurrentBench.BenchDBSettings.ConnectionString;
|
||||
dbType = Data.CurrentBench.BenchDBSettings.DbType;
|
||||
connectionString = Data.CurrentBench.BenchDBSettings.ConnectionString;
|
||||
break;
|
||||
case Database.Procedures:
|
||||
dbType = Program.CurrentBench.ProceduresDBSettings.DbType;
|
||||
connectionString = Program.CurrentBench.ProceduresDBSettings.ConnectionString;
|
||||
dbType = Data.CurrentBench.ProceduresDBSettings.DbType;
|
||||
connectionString = Data.CurrentBench.ProceduresDBSettings.ConnectionString;
|
||||
break;
|
||||
case Database.WaterMeters:
|
||||
dbType = Program.CurrentBench.WaterMetersDBSettings.DbType;
|
||||
connectionString = Program.CurrentBench.WaterMetersDBSettings.ConnectionString;
|
||||
dbType = Data.CurrentBench.WaterMetersDBSettings.DbType;
|
||||
connectionString = Data.CurrentBench.WaterMetersDBSettings.ConnectionString;
|
||||
break;
|
||||
}
|
||||
|
||||
@ -99,16 +99,16 @@ namespace TBF
|
||||
{
|
||||
default:
|
||||
case Database.Users:
|
||||
cfg = cfg.Mappings(m => m.FluentMappings.AddFromAssemblyOf<Program>());
|
||||
cfg = cfg.Mappings(m => m.FluentMappings.AddFromAssemblyOf<Data>());
|
||||
break;
|
||||
case Database.Bench:
|
||||
cfg = cfg.Mappings(m => m.FluentMappings.AddFromAssemblyOf<Program>());
|
||||
cfg = cfg.Mappings(m => m.FluentMappings.AddFromAssemblyOf<Data>());
|
||||
break;
|
||||
case Database.Procedures:
|
||||
cfg = cfg.Mappings(m => m.FluentMappings.AddFromAssemblyOf<Program>());
|
||||
cfg = cfg.Mappings(m => m.FluentMappings.AddFromAssemblyOf<Data>());
|
||||
break;
|
||||
case Database.WaterMeters:
|
||||
cfg = cfg.Mappings(m => m.FluentMappings.AddFromAssemblyOf<Program>());
|
||||
cfg = cfg.Mappings(m => m.FluentMappings.AddFromAssemblyOf<Data>());
|
||||
break;
|
||||
}
|
||||
|
||||
@ -205,22 +205,22 @@ namespace TBF
|
||||
///
|
||||
/// Prepare all groups
|
||||
///
|
||||
var testers = new Entities.Group { Gid = (int)TBF.Grp.GID.Testers, Name = Strings.Tester };
|
||||
var testingSpecialists = new Entities.Group { Gid = (int)TBF.Grp.GID.TestingSpecialists, Name = Strings.Testing_Specialist };
|
||||
var headOfLab = new Entities.Group { Gid = (int)TBF.Grp.GID.HeadOfLab, Name = Strings.Head_of_Lab };
|
||||
var maintenanceSpecialists = new Entities.Group { Gid = (int)TBF.Grp.GID.MaintenanceSpecialists, Name = Strings.Maintenance_Specialist };
|
||||
var metrologists = new Entities.Group { Gid = (int)TBF.Grp.GID.Metrologists, Name = Strings.Metrologist };
|
||||
var calibrationSpecialists = new Entities.Group { Gid = (int)TBF.Grp.GID.CalibrationSpecialists, Name = Strings.Calibration_Specialist };
|
||||
var administrators = new Entities.Group { Gid = (int)TBF.Grp.GID.Administrators, Name = Strings.Administrator };
|
||||
var testers = new Entities.Group { Gid = (int)Grp.GID.Testers, Name = Strings.Tester };
|
||||
var testingSpecialists = new Entities.Group { Gid = (int)Grp.GID.TestingSpecialists, Name = Strings.Testing_Specialist };
|
||||
var headOfLab = new Entities.Group { Gid = (int)Grp.GID.HeadOfLab, Name = Strings.Head_of_Lab };
|
||||
var maintenanceSpecialists = new Entities.Group { Gid = (int)Grp.GID.MaintenanceSpecialists, Name = Strings.Maintenance_Specialist };
|
||||
var metrologists = new Entities.Group { Gid = (int)Grp.GID.Metrologists, Name = Strings.Metrologist };
|
||||
var calibrationSpecialists = new Entities.Group { Gid = (int)Grp.GID.CalibrationSpecialists, Name = Strings.Calibration_Specialist };
|
||||
var administrators = new Entities.Group { Gid = (int)Grp.GID.Administrators, Name = Strings.Administrator };
|
||||
|
||||
/// Create the user 'admin' add his groups
|
||||
var admin = new Entities.User
|
||||
{
|
||||
Name = Program.AdminUsername,
|
||||
Name = Data.AdminUsername,
|
||||
Description = "Administrator",
|
||||
LastPwChange = DateTime.Now
|
||||
};
|
||||
admin.SetPassword(Program.AdminPassword);
|
||||
admin.SetPassword(Data.AdminPassword);
|
||||
admin.AddGroup(testers);
|
||||
admin.AddGroup(testingSpecialists);
|
||||
admin.AddGroup(headOfLab);
|
||||
@ -231,9 +231,9 @@ namespace TBF
|
||||
|
||||
session.SaveOrUpdate(admin);
|
||||
|
||||
/// Create the control board component
|
||||
var cmpnt = (new BenchControl.Elde.ControlBoardCfg(new BenchControl.Elde.ControlBoardFactory())).CreateDbEntity();
|
||||
session.SaveOrUpdate(cmpnt);
|
||||
///// Create the control board component
|
||||
//var cmpnt = (new BenchControl.Elde.ControlBoardCfg(new BenchControl.Elde.ControlBoardFactory())).CreateDbEntity();
|
||||
//session.SaveOrUpdate(cmpnt);
|
||||
|
||||
transaction.Commit();
|
||||
}
|
||||
@ -5,11 +5,11 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
using TBF.Entities;
|
||||
using Config.Entities;
|
||||
using NHibernate;
|
||||
using FluentNHibernate;
|
||||
|
||||
namespace TBF
|
||||
namespace Config
|
||||
{
|
||||
/// <summary>
|
||||
/// Enum Grp.GID specifies GID-s of user groups.
|
||||
@ -2,9 +2,9 @@
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
///
|
||||
using FluentNHibernate.Mapping;
|
||||
using TBF.Entities;
|
||||
using Config.Entities;
|
||||
|
||||
namespace TBF.Mappings
|
||||
namespace Config.Mappings
|
||||
{
|
||||
class BenchPathMap : ClassMap<BenchPath>
|
||||
{
|
||||
@ -2,9 +2,9 @@
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
///
|
||||
using FluentNHibernate.Mapping;
|
||||
using TBF.Entities;
|
||||
using Config.Entities;
|
||||
|
||||
namespace TBF.Mappings
|
||||
namespace Config.Mappings
|
||||
{
|
||||
class ComponentMap : ClassMap<Component>
|
||||
{
|
||||
@ -2,9 +2,9 @@
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
///
|
||||
using FluentNHibernate.Mapping;
|
||||
using TBF.Entities;
|
||||
using Config.Entities;
|
||||
|
||||
namespace TBF.Mappings
|
||||
namespace Config.Mappings
|
||||
{
|
||||
class ComponentProcedureMap : ClassMap<ComponentProcedure>
|
||||
{
|
||||
@ -2,9 +2,9 @@
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
///
|
||||
using FluentNHibernate.Mapping;
|
||||
using TBF.Entities;
|
||||
using Config.Entities;
|
||||
|
||||
namespace TBF.Mappings
|
||||
namespace Config.Mappings
|
||||
{
|
||||
class ComponentTestMap : ClassMap<ComponentTest>
|
||||
{
|
||||
@ -2,9 +2,9 @@
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
///
|
||||
using FluentNHibernate.Mapping;
|
||||
using TBF.Entities;
|
||||
using Config.Entities;
|
||||
|
||||
namespace TBF.Mappings
|
||||
namespace Config.Mappings
|
||||
{
|
||||
class FeedingPathMap : ClassMap<FeedingPath>
|
||||
{
|
||||
@ -3,7 +3,7 @@
|
||||
///
|
||||
using FluentNHibernate.Mapping;
|
||||
|
||||
namespace TBF.Mappings
|
||||
namespace Config.Mappings
|
||||
{
|
||||
class GroupMap : ClassMap<Entities.Group>
|
||||
{
|
||||
@ -2,9 +2,9 @@
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
///
|
||||
using FluentNHibernate.Mapping;
|
||||
using TBF.Entities;
|
||||
using Config.Entities;
|
||||
|
||||
namespace TBF.Mappings
|
||||
namespace Config.Mappings
|
||||
{
|
||||
class MeasurementCorrectionMap : ClassMap<MeasurementCorrection>
|
||||
{
|
||||
@ -2,9 +2,9 @@
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
///
|
||||
using FluentNHibernate.Mapping;
|
||||
using TBF.Entities;
|
||||
using Config.Entities;
|
||||
|
||||
namespace TBF.Mappings
|
||||
namespace Config.Mappings
|
||||
{
|
||||
class MeterTestResultMap : ClassMap<MeterTestResult>
|
||||
{
|
||||
64
Config/Mappings/MetersPathMap.cs
Normal file
64
Config/Mappings/MetersPathMap.cs
Normal file
@ -0,0 +1,64 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
///
|
||||
using FluentNHibernate.Mapping;
|
||||
using Config.Entities;
|
||||
|
||||
namespace Config.Mappings
|
||||
{
|
||||
class MetersPathMap : ClassMap<MetersPath>
|
||||
{
|
||||
public MetersPathMap()
|
||||
{
|
||||
Id(x => x.Id);
|
||||
Map(x => x.ItemNr);
|
||||
Map(x => x.Name);
|
||||
Map(x => x.Qfrom);
|
||||
Map(x => x.Qto);
|
||||
Map(x => x.Sensor1);
|
||||
#pragma warning disable
|
||||
if (Config.Data.WMsCount >= 2) Map(x => x.Sensor2);
|
||||
if (Config.Data.WMsCount >= 3) Map(x => x.Sensor3);
|
||||
if (Config.Data.WMsCount >= 4) Map(x => x.Sensor4);
|
||||
if (Config.Data.WMsCount >= 5) Map(x => x.Sensor5);
|
||||
if (Config.Data.WMsCount >= 6) Map(x => x.Sensor6);
|
||||
if (Config.Data.WMsCount >= 7) Map(x => x.Sensor7);
|
||||
if (Config.Data.WMsCount >= 8) Map(x => x.Sensor8);
|
||||
if (Config.Data.WMsCount >= 9) Map(x => x.Sensor9);
|
||||
if (Config.Data.WMsCount >= 10) Map(x => x.Sensor10);
|
||||
if (Config.Data.WMsCount >= 11) Map(x => x.Sensor11);
|
||||
if (Config.Data.WMsCount >= 12) Map(x => x.Sensor12);
|
||||
if (Config.Data.WMsCount >= 13) Map(x => x.Sensor13);
|
||||
if (Config.Data.WMsCount >= 14) Map(x => x.Sensor14);
|
||||
if (Config.Data.WMsCount >= 15) Map(x => x.Sensor15);
|
||||
if (Config.Data.WMsCount >= 16) Map(x => x.Sensor16);
|
||||
if (Config.Data.WMsCount >= 17) Map(x => x.Sensor17);
|
||||
if (Config.Data.WMsCount >= 18) Map(x => x.Sensor18);
|
||||
if (Config.Data.WMsCount >= 19) Map(x => x.Sensor19);
|
||||
if (Config.Data.WMsCount >= 20) Map(x => x.Sensor20);
|
||||
#if IPERLST
|
||||
if (Config.Data.WMsCount >= 21) Map(x => x.Sensor21);
|
||||
if (Config.Data.WMsCount >= 22) Map(x => x.Sensor22);
|
||||
if (Config.Data.WMsCount >= 23) Map(x => x.Sensor23);
|
||||
if (Config.Data.WMsCount >= 24) Map(x => x.Sensor24);
|
||||
if (Config.Data.WMsCount >= 25) Map(x => x.Sensor25);
|
||||
if (Config.Data.WMsCount >= 26) Map(x => x.Sensor26);
|
||||
if (Config.Data.WMsCount >= 27) Map(x => x.Sensor27);
|
||||
if (Config.Data.WMsCount >= 28) Map(x => x.Sensor28);
|
||||
if (Config.Data.WMsCount >= 29) Map(x => x.Sensor29);
|
||||
if (Config.Data.WMsCount >= 30) Map(x => x.Sensor30);
|
||||
if (Config.Data.WMsCount >= 31) Map(x => x.Sensor31);
|
||||
if (Config.Data.WMsCount >= 32) Map(x => x.Sensor32);
|
||||
if (Config.Data.WMsCount >= 33) Map(x => x.Sensor33);
|
||||
if (Config.Data.WMsCount >= 34) Map(x => x.Sensor34);
|
||||
if (Config.Data.WMsCount >= 35) Map(x => x.Sensor35);
|
||||
if (Config.Data.WMsCount >= 36) Map(x => x.Sensor36);
|
||||
if (Config.Data.WMsCount >= 37) Map(x => x.Sensor37);
|
||||
if (Config.Data.WMsCount >= 38) Map(x => x.Sensor38);
|
||||
if (Config.Data.WMsCount >= 39) Map(x => x.Sensor39);
|
||||
if (Config.Data.WMsCount >= 40) Map(x => x.Sensor40);
|
||||
#endif
|
||||
#pragma warning restore
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -2,9 +2,9 @@
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
///
|
||||
using FluentNHibernate.Mapping;
|
||||
using TBF.Entities;
|
||||
using Config.Entities;
|
||||
|
||||
namespace TBF.Mappings
|
||||
namespace Config.Mappings
|
||||
{
|
||||
class OutputPathMap : ClassMap<OutputPath>
|
||||
{
|
||||
@ -2,9 +2,9 @@
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
///
|
||||
using FluentNHibernate.Mapping;
|
||||
using TBF.Entities;
|
||||
using Config.Entities;
|
||||
|
||||
namespace TBF.Mappings
|
||||
namespace Config.Mappings
|
||||
{
|
||||
class ProcedureMap : ClassMap<Procedure>
|
||||
{
|
||||
@ -3,9 +3,9 @@
|
||||
/// Author: Milan Hanajik
|
||||
///
|
||||
using FluentNHibernate.Mapping;
|
||||
using TBF.Entities;
|
||||
using Config.Entities;
|
||||
|
||||
namespace TBF.Mappings
|
||||
namespace Config.Mappings
|
||||
{
|
||||
class TestMap : ClassMap<Test>
|
||||
{
|
||||
@ -2,9 +2,9 @@
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
///
|
||||
using FluentNHibernate.Mapping;
|
||||
using TBF.Entities;
|
||||
using Config.Entities;
|
||||
|
||||
namespace TBF.Mappings
|
||||
namespace Config.Mappings
|
||||
{
|
||||
class TestResultMap : ClassMap<TestResult>
|
||||
{
|
||||
@ -2,9 +2,9 @@
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
///
|
||||
using FluentNHibernate.Mapping;
|
||||
using TBF.Entities;
|
||||
using Config.Entities;
|
||||
|
||||
namespace TBF.Mappings
|
||||
namespace Config.Mappings
|
||||
{
|
||||
class TransitionSequenceMap : ClassMap<TransitionSequence>
|
||||
{
|
||||
@ -2,9 +2,9 @@
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
///
|
||||
using FluentNHibernate.Mapping;
|
||||
using TBF.Entities;
|
||||
using Config.Entities;
|
||||
|
||||
namespace TBF.Mappings
|
||||
namespace Config.Mappings
|
||||
{
|
||||
class TransitionStepMap : ClassMap<TransitionStep>
|
||||
{
|
||||
@ -3,7 +3,7 @@
|
||||
///
|
||||
using FluentNHibernate.Mapping;
|
||||
|
||||
namespace TBF.Mappings
|
||||
namespace Config.Mappings
|
||||
{
|
||||
class UserMap : ClassMap<Entities.User>
|
||||
{
|
||||
@ -2,9 +2,9 @@
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
///
|
||||
using FluentNHibernate.Mapping;
|
||||
using TBF.Entities;
|
||||
using Config.Entities;
|
||||
|
||||
namespace TBF.Mappings
|
||||
namespace Config.Mappings
|
||||
{
|
||||
class VirtualBenchSequenceMap : ClassMap<VirtualBenchSequence>
|
||||
{
|
||||
@ -2,9 +2,9 @@
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
///
|
||||
using FluentNHibernate.Mapping;
|
||||
using TBF.Entities;
|
||||
using Config.Entities;
|
||||
|
||||
namespace TBF.Mappings
|
||||
namespace Config.Mappings
|
||||
{
|
||||
class VirtualBenchStepMap : ClassMap<VirtualBenchStep>
|
||||
{
|
||||
@ -3,7 +3,7 @@
|
||||
///
|
||||
using FluentNHibernate.Mapping;
|
||||
|
||||
namespace TBF.Mappings
|
||||
namespace Config.Mappings
|
||||
{
|
||||
class WMTypeMap : ClassMap<Entities.WMType>
|
||||
{
|
||||
@ -3,7 +3,7 @@
|
||||
///
|
||||
using FluentNHibernate.Mapping;
|
||||
|
||||
namespace TBF.Mappings
|
||||
namespace Config.Mappings
|
||||
{
|
||||
class WatermeterMap : ClassMap<Entities.Watermeter>
|
||||
{
|
||||
36
Config/Properties/AssemblyInfo.cs
Normal file
36
Config/Properties/AssemblyInfo.cs
Normal file
@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Config")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Config")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2015")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("3fc3ff67-7386-4aff-9855-bef33d5fa0d3")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
3168
Config/Resources/Strings.Designer.cs
generated
Normal file
3168
Config/Resources/Strings.Designer.cs
generated
Normal file
File diff suppressed because it is too large
Load Diff
1156
Config/Resources/Strings.resx
Normal file
1156
Config/Resources/Strings.resx
Normal file
File diff suppressed because it is too large
Load Diff
11
Results/Class1.cs
Normal file
11
Results/Class1.cs
Normal file
@ -0,0 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace Results
|
||||
{
|
||||
public class Class1
|
||||
{
|
||||
}
|
||||
}
|
||||
@ -1,26 +1,36 @@
|
||||
using System;
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
|
||||
namespace ResultsBrowser.Entities
|
||||
namespace Results.Entities
|
||||
{
|
||||
public class MeterTestResult
|
||||
{
|
||||
public virtual int Id { get; protected set; }
|
||||
public virtual TestResult TestResult { get; set; } /// reference to the TestResult entity
|
||||
|
||||
public virtual string SerialNr { get; set; }
|
||||
public virtual bool Disabled { get; set; } /// true = this meter was disabled and the results should be disregarded
|
||||
public virtual string SerialNr { get; set; }
|
||||
public virtual string EndState { get; set; }
|
||||
public virtual float VolumeStart { get; set; } /// liter
|
||||
public virtual float VolumeEnd { get; set; } /// liter
|
||||
public virtual float VolumeMeter { get; set; } /// liter
|
||||
public virtual float VolumeRef { get; set; } /// liter
|
||||
public virtual float VolumeErrorPct { get; set; } /// %
|
||||
public virtual float PulsesMeter { get; set; } /// Not applicable for a combined meter
|
||||
public virtual float PulsesMeter { get; set; } /// # of pulses
|
||||
public virtual float PulsesPerLiter { get; set; } /// Pulses per liter
|
||||
public virtual float PulsesMaster { get; set; }
|
||||
public virtual float Time { get; set; } /// sec.
|
||||
public virtual bool Passed { get; set; } /// true = test passed
|
||||
public virtual float TimeStart { get; set; } /// sec. - Not mapped to DB !!!
|
||||
public virtual float TimeEnd { get; set; } /// sec. - Not mapped to DB !!!
|
||||
public virtual int CalibFactor { get; set; } /// iPerl calibration factor used during the test - Not mapped to DB !!!
|
||||
public virtual double Q2Correction { get; set; } /// iPerl Q2 correction used during the test - Not mapped to DB !!!
|
||||
public virtual bool Passed { get; set; } /// true=test passed - Not mapped to DB !!!
|
||||
|
||||
public MeterTestResult()
|
||||
{
|
||||
PulsesPerLiter = 1.0f;
|
||||
}
|
||||
|
||||
public MeterTestResult(TestResult testResult)
|
||||
@ -33,7 +43,8 @@ namespace ResultsBrowser.Entities
|
||||
{
|
||||
MeterTestResult result = new MeterTestResult(testResult);
|
||||
|
||||
result.SerialNr = SerialNr;
|
||||
result.Disabled = Disabled;
|
||||
result.SerialNr = SerialNr;
|
||||
result.EndState = EndState;
|
||||
result.VolumeStart = VolumeStart;
|
||||
result.VolumeEnd = VolumeEnd;
|
||||
@ -41,8 +52,13 @@ namespace ResultsBrowser.Entities
|
||||
result.VolumeRef = VolumeRef;
|
||||
result.VolumeErrorPct = VolumeErrorPct;
|
||||
result.PulsesMeter = PulsesMeter;
|
||||
result.PulsesPerLiter = PulsesPerLiter;
|
||||
result.PulsesMaster = PulsesMaster;
|
||||
result.Time = Time;
|
||||
result.TimeStart = TimeStart;
|
||||
result.TimeEnd = TimeEnd;
|
||||
result.CalibFactor = CalibFactor;
|
||||
result.Q2Correction = Q2Correction;
|
||||
result.Passed = Passed;
|
||||
|
||||
return result;
|
||||
167
Results/Entities/TestResult.cs
Normal file
167
Results/Entities/TestResult.cs
Normal file
@ -0,0 +1,167 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Config.Entities;
|
||||
|
||||
namespace Results.Entities
|
||||
{
|
||||
public class TestResult
|
||||
{
|
||||
public virtual int Id { get; protected set; }
|
||||
public virtual string Name { get; set; }
|
||||
public virtual int BatchNr { get; set; }
|
||||
public virtual string PurchaseOrder { get; set; }
|
||||
public virtual MetersKind MetersKind { get; set; }
|
||||
public virtual IList<MeterTestResult> Meters { get; set; }
|
||||
public virtual IList<MeterTestResult> CombinedMeters { get; set; }
|
||||
|
||||
/// Value copied from the procedure (Entities.Procedure)
|
||||
public virtual string ProcedureName { get; set; }
|
||||
public virtual string ProtocolTitle { get; set; }
|
||||
|
||||
/// Values copied from the test (Entities.Test)
|
||||
public virtual int TestId { get; set; } /// Test entity ID to distinguish between tests with the same name
|
||||
public virtual string TestName { get; set; }
|
||||
public virtual int Part { get; set; }
|
||||
public virtual bool DoNotEvaluate { get; set; } /// Not mapped to the database
|
||||
public virtual bool DoNotPublish { get; set; } /// Not mapped to the database
|
||||
public virtual float Qfrom { get; set; } /// [m3/h] Water flow low limit
|
||||
public virtual float Qto { get; set; } /// [m3/h] Water flow high limit
|
||||
public virtual float Volume { get; set; } /// [l] Target test volume
|
||||
public virtual float TstTime { get; set; } /// [s] Test time estimate
|
||||
public virtual int Repeats { get; set; }
|
||||
public virtual bool Emptying { get; set; }
|
||||
public virtual bool Zeroing { get; set; }
|
||||
public virtual float PumpPower { get; set; } /// Power of the pump in [%] in the range 0 .. 100.0f, use values 0% and 100% for non-FM pumps
|
||||
public virtual int Time2MassMsrmt { get; set; }
|
||||
public virtual string Method { get; set; }
|
||||
public virtual float ErrLimLo { get; set; } /// [%] Lower error limit (usually < 0)
|
||||
public virtual float ErrLimHi { get; set; } /// [%] Upper error limit (usually > 0)
|
||||
public virtual float Uncertainty { get; set; } /// [%] Makes error limits tighter: 0 <= Uncertainty <= abs(ErrLimXx)
|
||||
|
||||
/// To be replaced by the virtual bench component parameters
|
||||
public virtual string FeedingPath { get; set; }
|
||||
public virtual string BenchPath { get; set; }
|
||||
public virtual string OutputPath { get; set; }
|
||||
public virtual string MetersPath { get; set; }
|
||||
|
||||
/// Results
|
||||
public virtual DateTime TimeStart { get; set; } /// Date and time of the test start
|
||||
public virtual DateTime TimeEnd { get; set; } /// Date and time of the test end
|
||||
public virtual int RepetitionNr { get; set; } /// Repetition number from the set of repeated tests (1...)
|
||||
public virtual float AmbientTempAve { get; set; } /// [deg.C] Average ambient air temperature
|
||||
public virtual float AmbientPressAve { get; set; } /// Average ambient air pressure
|
||||
public virtual float AmbientHumiAve { get; set; } /// [%] Average ambient air relative humidity
|
||||
public virtual float PressInAvrg { get; set; } /// [Bar] Input water pressure (average)
|
||||
public virtual float PressInStart { get; set; } /// [Bar]
|
||||
public virtual float PressInEnd { get; set; } /// [Bar]
|
||||
public virtual float PressOutAvrg { get; set; } /// [Bar]
|
||||
public virtual float PressOutStart { get; set; } /// [Bar]
|
||||
public virtual float PressOutEnd { get; set; } /// [Bar]
|
||||
public virtual float TempInAvrg { get; set; } /// [deg.C]
|
||||
public virtual float TempInStart { get; set; } /// [deg.C]
|
||||
public virtual float TempInEnd { get; set; } /// [deg.C]
|
||||
public virtual float TempOutAvrg { get; set; } /// [deg.C]
|
||||
public virtual float TempOutStart { get; set; } /// [deg.C]
|
||||
public virtual float TempOutEnd { get; set; } /// [deg.C]
|
||||
public virtual float TempDivAvrg { get; set; } /// [deg.C]
|
||||
public virtual float TempDivStart { get; set; } /// [deg.C]
|
||||
public virtual float TempDivEnd { get; set; } /// [deg.C]
|
||||
public virtual float MassStartRaw { get; set; } /// [kg]
|
||||
public virtual float MassStart { get; set; } /// [kg]
|
||||
public virtual float MassEndRaw { get; set; } /// [kg]
|
||||
public virtual float MassEnd { get; set; } /// [kg]
|
||||
public virtual float MassDiff { get; set; } /// [kg]
|
||||
public virtual float DensityIn { get; set; } /// [kg/m3]
|
||||
public virtual float DensityOut { get; set; } /// [kg/m3]
|
||||
public virtual float DensityDiv { get; set; } /// [kg/m3]
|
||||
public virtual float Buoyancy { get; set; } ///TODO -> map
|
||||
public virtual float FlowMass { get; set; } /// [kg/h] calculated from conventional true value
|
||||
public virtual float FlowVolume { get; set; } /// [l/h] calculated from conventional true value
|
||||
public virtual float VolumeCTV { get; set; } /// [l] Volume conventional true value
|
||||
public virtual float VolumeMaster { get; set; } /// [l] Volume from the master flow meter
|
||||
public virtual float Time { get; set; } /// [s] Measurement time in seconds
|
||||
public virtual float ErrorMaster { get; set; } /// [%]
|
||||
public virtual float PulsesMaster { get; set; }
|
||||
public virtual float ConstMaster { get; set; } /// [pls/l] Pulses per liter master flow meter
|
||||
public virtual float QRise { get; set; } /// Detected Q_rise of a composed meter
|
||||
public virtual float QFall { get; set; } /// Detected Q_fall of a composed meter
|
||||
public virtual float TimeDivStart0 { get; set; }
|
||||
public virtual float TimeDivStart1 { get; set; }
|
||||
public virtual float TimeDivStart2 { get; set; }
|
||||
public virtual float TimeDivStart3 { get; set; }
|
||||
public virtual float TimeDivStart4 { get; set; }
|
||||
public virtual float TimeDivStart5 { get; set; }
|
||||
public virtual float TimeDivEnd0 { get; set; }
|
||||
public virtual float TimeDivEnd1 { get; set; }
|
||||
public virtual float TimeDivEnd2 { get; set; }
|
||||
public virtual float TimeDivEnd3 { get; set; }
|
||||
public virtual float TimeDivEnd4 { get; set; }
|
||||
public virtual float TimeDivEnd5 { get; set; }
|
||||
|
||||
public TestResult()
|
||||
{
|
||||
Meters = new List<MeterTestResult>();
|
||||
CombinedMeters = new List<MeterTestResult>();
|
||||
}
|
||||
|
||||
public TestResult(MetersKind kind)
|
||||
: this()
|
||||
{
|
||||
MetersKind = kind;
|
||||
|
||||
if (kind == MetersKind.Single)
|
||||
{
|
||||
for (int i = 0; i < Config.Data.WMsCount; i++) Meters.Add(new MeterTestResult(this));
|
||||
}
|
||||
else if (kind == MetersKind.Combined)
|
||||
{
|
||||
for (int i = 0; i < 2 * Config.Data.CompoundWMsCount; i++) Meters.Add(new MeterTestResult(this));
|
||||
for (int i = 0; i < Config.Data.CompoundWMsCount; i++) CombinedMeters.Add(new MeterTestResult(this));
|
||||
}
|
||||
}
|
||||
|
||||
public TestResult(Test test, int repetitionNr, MetersKind kind)
|
||||
: this(kind)
|
||||
{
|
||||
if (test.Repeats == 1)
|
||||
{
|
||||
Name = test.Name;
|
||||
}
|
||||
else
|
||||
{
|
||||
Name = string.Format("{0} ({1}/{2})", test.Name, repetitionNr, test.Repeats);
|
||||
}
|
||||
RepetitionNr = repetitionNr;
|
||||
|
||||
/// Copy test parameters from Entities.Procedure object
|
||||
ProcedureName = test.Procedure.Name;
|
||||
ProtocolTitle = test.Procedure.ProtocolTitle;
|
||||
|
||||
/// Copy test parameters from Entities.Test object
|
||||
TestId = test.Id;
|
||||
TestName = test.Name;
|
||||
Part = test.Part;
|
||||
Qfrom = test.Qfrom;
|
||||
Qto = test.Qto;
|
||||
Volume = test.Volume;
|
||||
TstTime = test.TstTime;
|
||||
Repeats = test.Repeats;
|
||||
Emptying = test.Emptying;
|
||||
Zeroing = test.Zeroing;
|
||||
PumpPower = PumpPower;
|
||||
Time2MassMsrmt = test.TimeStop2Mass;
|
||||
Method = test.Method;
|
||||
ErrLimLo = test.ErrLimLo;
|
||||
ErrLimHi = test.ErrLimHi;
|
||||
Uncertainty = test.Uncertainty;
|
||||
|
||||
FeedingPath = test.FeedingPath;
|
||||
BenchPath = test.BenchPath;
|
||||
OutputPath = test.OutputPath;
|
||||
MetersPath = test.MetersPath;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,7 +1,10 @@
|
||||
using FluentNHibernate.Mapping;
|
||||
using ResultsBrowser.Entities;
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
///
|
||||
using FluentNHibernate.Mapping;
|
||||
using Results.Entities;
|
||||
|
||||
namespace ResultsBrowser.Mappings
|
||||
namespace Results.Mappings
|
||||
{
|
||||
class MeterTestResultMap : ClassMap<MeterTestResult>
|
||||
{
|
||||
@ -9,7 +12,8 @@ namespace ResultsBrowser.Mappings
|
||||
{
|
||||
Id(x => x.Id);
|
||||
References(x => x.TestResult);
|
||||
Map(x => x.SerialNr);
|
||||
Map(x => x.Disabled);
|
||||
Map(x => x.SerialNr);
|
||||
Map(x => x.EndState);
|
||||
Map(x => x.VolumeStart);
|
||||
Map(x => x.VolumeEnd);
|
||||
@ -17,6 +21,7 @@ namespace ResultsBrowser.Mappings
|
||||
Map(x => x.VolumeRef);
|
||||
Map(x => x.VolumeErrorPct);
|
||||
Map(x => x.PulsesMeter);
|
||||
Map(x => x.PulsesPerLiter);
|
||||
Map(x => x.PulsesMaster);
|
||||
Map(x => x.Time);
|
||||
}
|
||||
@ -1,7 +1,10 @@
|
||||
using FluentNHibernate.Mapping;
|
||||
using ResultsBrowser.Entities;
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
///
|
||||
using FluentNHibernate.Mapping;
|
||||
using Results.Entities;
|
||||
|
||||
namespace ResultsBrowser.Mappings
|
||||
namespace Results.Mappings
|
||||
{
|
||||
class TestResultMap : ClassMap<TestResult>
|
||||
{
|
||||
@ -9,9 +12,9 @@ namespace ResultsBrowser.Mappings
|
||||
{
|
||||
Id(x => x.Id);
|
||||
Map(x => x.Name);
|
||||
Map(x => x.BatchNr)
|
||||
.Column("CycleNr");
|
||||
Map(x => x.MetersKind);
|
||||
Map(x => x.BatchNr);
|
||||
Map(x => x.PurchaseOrder);
|
||||
Map(x => x.MetersKind);
|
||||
HasMany(x => x.Meters)
|
||||
.Cascade.All();
|
||||
HasMany(x => x.CombinedMeters)
|
||||
@ -35,6 +38,7 @@ namespace ResultsBrowser.Mappings
|
||||
Map(x => x.Method);
|
||||
Map(x => x.ErrLimLo);
|
||||
Map(x => x.ErrLimHi);
|
||||
Map(x => x.Uncertainty);
|
||||
|
||||
Map(x => x.FeedingPath)
|
||||
.CustomType("StringClob")
|
||||
36
Results/Properties/AssemblyInfo.cs
Normal file
36
Results/Properties/AssemblyInfo.cs
Normal file
@ -0,0 +1,36 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Results")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Results")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2015")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("5da980c4-8924-4762-9b72-91e011e08f6c")]
|
||||
|
||||
// Version information for an assembly consists of the following four values:
|
||||
//
|
||||
// Major Version
|
||||
// Minor Version
|
||||
// Build Number
|
||||
// Revision
|
||||
//
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("1.0.0.0")]
|
||||
[assembly: AssemblyFileVersion("1.0.0.0")]
|
||||
76
Results/Results.csproj
Normal file
76
Results/Results.csproj
Normal file
@ -0,0 +1,76 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>8.0.30703</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{9D0DCC88-DC81-47EB-9FDD-4C3907871BFB}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Results</RootNamespace>
|
||||
<AssemblyName>Results</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="FluentNHibernate">
|
||||
<HintPath>..\packages\FluentNHibernate.1.3.0.733\lib\FluentNHibernate.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Iesi.Collections">
|
||||
<HintPath>..\packages\Iesi.Collections.3.2.0.4000\lib\Net35\Iesi.Collections.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MySql.Data, Version=6.6.5.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\MySql.Data.6.6.5\lib\net20\MySql.Data.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="NHibernate, Version=3.3.1.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\NHibernate.3.3.3.4001\lib\Net35\NHibernate.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Class1.cs" />
|
||||
<Compile Include="Entities\MeterTestResult.cs" />
|
||||
<Compile Include="Entities\TestResult.cs" />
|
||||
<Compile Include="Mappings\MeterTestResultMap.cs" />
|
||||
<Compile Include="Mappings\TestResultMap.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\Config\Config.csproj">
|
||||
<Project>{743DF7DB-C7B6-42EB-986D-0F485E5588E4}</Project>
|
||||
<Name>Config</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@ -1,28 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace ResultsBrowser
|
||||
{
|
||||
/// <summary>
|
||||
/// Database settings required to make a connection
|
||||
/// </summary>
|
||||
public class DBSettings : ICloneable
|
||||
{
|
||||
public DBType DbType;
|
||||
public string ConnectionString;
|
||||
|
||||
public DBSettings()
|
||||
{
|
||||
}
|
||||
|
||||
public DBSettings(DBType dbType, string connectionString)
|
||||
{
|
||||
this.DbType = dbType;
|
||||
this.ConnectionString = connectionString;
|
||||
}
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
return new DBSettings(DbType, ConnectionString);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,48 +0,0 @@
|
||||
using System;
|
||||
using System.Text;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace ResultsBrowser
|
||||
{
|
||||
/// <summary>
|
||||
/// Test bench database settings, contains bench name and settings od several databases
|
||||
/// </summary>
|
||||
public class DatabaseSettings : ICloneable
|
||||
{
|
||||
// Public fields
|
||||
public string BenchName;
|
||||
public bool IsRealBench;
|
||||
public DBSettings UsersDBSettings;
|
||||
public DBSettings BenchDBSettings;
|
||||
public DBSettings ProceduresDBSettings;
|
||||
public DBSettings WMTypesDBSettings;
|
||||
public DBSettings WaterMetersDBSettings;
|
||||
|
||||
// Constructor
|
||||
public DatabaseSettings()
|
||||
{
|
||||
BenchName = String.Empty; /// Empty string to avoid null
|
||||
IsRealBench = false;
|
||||
UsersDBSettings = new DBSettings(DBType.MySql, "SERVER=localhost; DATABASE=tbf_users; UID=root; PASSWORD=;");
|
||||
BenchDBSettings = new DBSettings(DBType.MySql, "SERVER=localhost; DATABASE=tbf_bench; UID=root; PASSWORD=;");
|
||||
ProceduresDBSettings = new DBSettings(DBType.MySql, "SERVER=localhost; DATABASE=tbf_procedures; UID=root; PASSWORD=;");
|
||||
WMTypesDBSettings = new DBSettings(DBType.MySql, "SERVER=localhost; DATABASE=tbf_wmtypes; UID=root; PASSWORD=;");
|
||||
WaterMetersDBSettings = new DBSettings(DBType.MySql, "SERVER=localhost; DATABASE=tbf_watermeters; UID=root; PASSWORD=;");
|
||||
}
|
||||
|
||||
public object Clone()
|
||||
{
|
||||
DatabaseSettings result = new DatabaseSettings();
|
||||
|
||||
result.BenchName = BenchName;
|
||||
result.IsRealBench = IsRealBench;
|
||||
result.UsersDBSettings = (DBSettings)UsersDBSettings.Clone();
|
||||
result.BenchDBSettings = (DBSettings)BenchDBSettings.Clone();
|
||||
result.ProceduresDBSettings = (DBSettings)ProceduresDBSettings.Clone();
|
||||
result.WMTypesDBSettings = (DBSettings)WMTypesDBSettings.Clone();
|
||||
result.WaterMetersDBSettings = (DBSettings)WaterMetersDBSettings.Clone();
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,78 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ResultsBrowser.Entities
|
||||
{
|
||||
public class BenchPath : IHasItemNr, IHasValves
|
||||
{
|
||||
public virtual int Id { get; protected set; }
|
||||
public virtual int ItemNr { get; set; }
|
||||
public virtual string Name { get; set; }
|
||||
public virtual float Qfrom { get; set; } /// Water flow in [m3/h]
|
||||
public virtual float Qto { get; set; } /// Water flow in [m3/h]
|
||||
public virtual string TempIn { get; set; }
|
||||
public virtual string TempOut { get; set; }
|
||||
public virtual string PressIn { get; set; }
|
||||
public virtual string PressOut { get; set; }
|
||||
|
||||
/// Valves
|
||||
public virtual string ValvesOpen { get; set; }
|
||||
public virtual string ValvesClose { get; set; }
|
||||
|
||||
/// ------------- Additional stuff not mapped into the database -------------
|
||||
|
||||
public BenchPath()
|
||||
{
|
||||
}
|
||||
|
||||
public BenchPath(string name, int itemNr)
|
||||
: this()
|
||||
{
|
||||
Name = name;
|
||||
ItemNr = itemNr;
|
||||
}
|
||||
|
||||
public BenchPath(BenchControl.BenchPath path)
|
||||
: this(path.Name, path.ItemNr)
|
||||
{
|
||||
Qfrom = path.Qfrom;
|
||||
Qto = path.Qto;
|
||||
TempIn = (path.TempIn != null) ? path.TempIn.Cfg.Name : null;
|
||||
TempOut = (path.TempOut != null) ? path.TempOut.Cfg.Name : null;
|
||||
PressIn = (path.PressIn != null) ? path.PressIn.Cfg.Name : null;
|
||||
PressOut = (path.PressOut != null) ? path.PressOut.Cfg.Name : null;
|
||||
|
||||
string vOpen = string.Empty;
|
||||
foreach (var valve in path.ValvesOpen)
|
||||
{
|
||||
if (vOpen != string.Empty) vOpen += ";";
|
||||
vOpen += valve.Cfg.Name;
|
||||
}
|
||||
ValvesOpen = vOpen;
|
||||
|
||||
string vClose = string.Empty;
|
||||
foreach (var valve in path.ValvesClose)
|
||||
{
|
||||
if (vClose != string.Empty) vClose += ";";
|
||||
vClose += valve.Cfg.Name;
|
||||
}
|
||||
ValvesClose = vClose;
|
||||
}
|
||||
|
||||
public virtual BenchPath Clone(string name, int itemNr)
|
||||
{
|
||||
BenchPath result = new BenchPath(name, itemNr);
|
||||
|
||||
result.Qfrom = Qfrom;
|
||||
result.Qto = Qto;
|
||||
result.TempIn = TempIn;
|
||||
result.TempOut = TempOut;
|
||||
result.PressIn = PressIn;
|
||||
result.PressOut = PressOut;
|
||||
result.ValvesOpen = ValvesOpen;
|
||||
result.ValvesClose = ValvesClose;
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,71 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ResultsBrowser.Entities
|
||||
{
|
||||
public class Component : IHasItemNr
|
||||
{
|
||||
public virtual int Id { get; protected set; }
|
||||
public virtual int ItemNr { get; set; }
|
||||
public virtual string Name { get; set; }
|
||||
public virtual string ClassName { get; set; }
|
||||
public virtual string ParentName { get; set; }
|
||||
public virtual DebugMode Mode { get; set; }
|
||||
public virtual LogLevel Logging { get; set; }
|
||||
public virtual string Parameters { get; set; }
|
||||
public virtual IList<MeasurementCorrection> Corrections { get; set; }
|
||||
|
||||
/// ------------- Additional stuff not mapped into the database -------------
|
||||
|
||||
public Component()
|
||||
{
|
||||
Corrections = new List<MeasurementCorrection>();
|
||||
}
|
||||
|
||||
public static Component CreateFromCfg(string name, string className, string parentName, int itemNr,
|
||||
DebugMode debugLevel, LogLevel logLevel, string parameters)
|
||||
{
|
||||
Component result = new Component();
|
||||
result.ItemNr = itemNr;
|
||||
result.Name = name;
|
||||
result.ClassName = className;
|
||||
result.ParentName = parentName;
|
||||
result.Mode = debugLevel;
|
||||
result.Logging = logLevel;
|
||||
result.Parameters = parameters;
|
||||
return result;
|
||||
}
|
||||
|
||||
// Makes a new copy of this object (not just a reference)
|
||||
public virtual Component Clone()
|
||||
{
|
||||
Component result = new Component();
|
||||
result.ItemNr = ItemNr;
|
||||
result.Name = Name;
|
||||
result.ClassName = ClassName;
|
||||
result.ParentName = ParentName;
|
||||
result.Mode = Mode;
|
||||
result.Logging = Logging;
|
||||
result.Parameters = Parameters;
|
||||
return result;
|
||||
}
|
||||
|
||||
public virtual string ToString(string indent)
|
||||
{
|
||||
string result = string.Empty;
|
||||
|
||||
result += indent + "ItemNr = " + (ItemNr + 1).ToString() + Environment.NewLine;
|
||||
result += indent + "Name = " + Name + Environment.NewLine;
|
||||
result += indent + "ClassName = " + ClassName + Environment.NewLine;
|
||||
if (ParentName != null)
|
||||
{
|
||||
result += indent + "ParentName = " + ParentName + Environment.NewLine;
|
||||
}
|
||||
result += indent + "DebugLevel = " + Mode.ToString() + Environment.NewLine;
|
||||
result += indent + "LogLevel = " + Logging.ToString() + Environment.NewLine;
|
||||
result += indent + "Parameters = " + Parameters + Environment.NewLine;
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,20 +0,0 @@
|
||||
|
||||
namespace ResultsBrowser.Entities
|
||||
{
|
||||
public class ComponentProcedure
|
||||
{
|
||||
public virtual int Id { get; protected set; }
|
||||
public virtual string CmpntName { get; set; } /// Component name
|
||||
public virtual string Parameters { get; set; }
|
||||
public virtual Procedure Procedure { get; set; }
|
||||
|
||||
public virtual ComponentProcedure Clone()
|
||||
{
|
||||
ComponentProcedure result = new ComponentProcedure();
|
||||
result.CmpntName = CmpntName;
|
||||
result.Parameters = Parameters;
|
||||
result.Procedure = Procedure;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,20 +0,0 @@
|
||||
|
||||
namespace ResultsBrowser.Entities
|
||||
{
|
||||
public class ComponentTest
|
||||
{
|
||||
public virtual int Id { get; protected set; }
|
||||
public virtual string CmpntName { get; set; } /// Component name
|
||||
public virtual string Parameters { get; set; }
|
||||
public virtual Test Test { get; set; }
|
||||
|
||||
public virtual ComponentTest Clone()
|
||||
{
|
||||
ComponentTest result = new ComponentTest();
|
||||
result.CmpntName = CmpntName;
|
||||
result.Parameters = Parameters;
|
||||
result.Test = Test;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,85 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ResultsBrowser.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// Kind of meters for the procedure / test
|
||||
/// </summary>
|
||||
public enum MetersKind
|
||||
{
|
||||
Single,
|
||||
Combined,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Flow set method Std/ComposedMeter
|
||||
/// </summary>
|
||||
public enum QSetMethod
|
||||
{
|
||||
Std,
|
||||
ComposedMeter,
|
||||
Count,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Procedure method FSS/SSS
|
||||
/// </summary>
|
||||
public enum TestMethod2
|
||||
{
|
||||
FSS,
|
||||
SSS,
|
||||
Count,
|
||||
}
|
||||
|
||||
public enum TestRedType
|
||||
{
|
||||
Fix,
|
||||
/// etc.
|
||||
Count,
|
||||
}
|
||||
|
||||
public enum FQC1
|
||||
{
|
||||
FQC1,
|
||||
FQP1,
|
||||
Count,
|
||||
}
|
||||
|
||||
public enum Device
|
||||
{
|
||||
Screen,
|
||||
Printer,
|
||||
Disk,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Possible modes of operation of components and devices.
|
||||
/// </summary>
|
||||
public enum DebugMode
|
||||
{
|
||||
DetectedOff = -2,
|
||||
DetectedOn = -1,
|
||||
Normal = 0, /// Normal operation
|
||||
AutoDetect, /// The component (device) will be auto-detected
|
||||
Off, /// The component is off
|
||||
Record,
|
||||
Reply,
|
||||
Simulate, /// Test bench simulation, this mode does not require any hardware
|
||||
Inherit,
|
||||
Count,
|
||||
}
|
||||
|
||||
public enum LogLevel
|
||||
{
|
||||
Off,
|
||||
Fatal,
|
||||
Error,
|
||||
Warn,
|
||||
Info,
|
||||
Debug,
|
||||
All,
|
||||
Count,
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,69 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ResultsBrowser.Entities
|
||||
{
|
||||
public class FeedingPath : IHasItemNr, IHasValves
|
||||
{
|
||||
public virtual int Id { get; protected set; }
|
||||
public virtual int ItemNr { get; set; }
|
||||
public virtual string Name { get; set; }
|
||||
public virtual float Qfrom { get; set; } /// Water flow in [m3/h]
|
||||
public virtual float Qto { get; set; } /// Water flow in [m3/h]
|
||||
public virtual string Pump { get; set; }
|
||||
|
||||
/// Valves
|
||||
public virtual string ValvesOpen { get; set; }
|
||||
public virtual string ValvesClose { get; set; }
|
||||
|
||||
/// ------------- Additional stuff not mapped into the database -------------
|
||||
|
||||
public FeedingPath()
|
||||
{
|
||||
}
|
||||
|
||||
public FeedingPath(string name, int itemNr)
|
||||
: this()
|
||||
{
|
||||
Name = name;
|
||||
ItemNr = itemNr;
|
||||
}
|
||||
|
||||
public FeedingPath(BenchControl.FeedingPath path)
|
||||
: this(path.Name, path.ItemNr)
|
||||
{
|
||||
Qfrom = path.Qfrom;
|
||||
Qto = path.Qto;
|
||||
Pump = (path.Pump != null) ? path.Pump.Cfg.Name : null;
|
||||
|
||||
string vOpen = string.Empty;
|
||||
foreach (var valve in path.ValvesOpen)
|
||||
{
|
||||
if (vOpen != string.Empty) vOpen += ";";
|
||||
vOpen += valve.Cfg.Name;
|
||||
}
|
||||
ValvesOpen = vOpen;
|
||||
|
||||
string vClose = string.Empty;
|
||||
foreach (var valve in path.ValvesClose)
|
||||
{
|
||||
if (vClose != string.Empty) vClose += ";";
|
||||
vClose += valve.Cfg.Name;
|
||||
}
|
||||
ValvesClose = vClose;
|
||||
}
|
||||
|
||||
public virtual FeedingPath Clone(string name, int itemNr)
|
||||
{
|
||||
FeedingPath result = new FeedingPath(name, itemNr);
|
||||
|
||||
result.Qfrom = Qfrom;
|
||||
result.Qto = Qto;
|
||||
result.Pump = Pump;
|
||||
result.ValvesOpen = ValvesOpen;
|
||||
result.ValvesClose = ValvesClose;
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,12 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ResultsBrowser.Entities
|
||||
{
|
||||
public class Group
|
||||
{
|
||||
public virtual int Id { get; protected set; }
|
||||
public virtual int Gid { get; set; }
|
||||
public virtual string Name { get; set; }
|
||||
}
|
||||
}
|
||||
@ -1,9 +0,0 @@
|
||||
|
||||
namespace ResultsBrowser.Entities
|
||||
{
|
||||
interface IHasItemNr
|
||||
{
|
||||
int Id { get; }
|
||||
int ItemNr { get; set; }
|
||||
}
|
||||
}
|
||||
@ -1,9 +0,0 @@
|
||||
|
||||
namespace ResultsBrowser.Entities
|
||||
{
|
||||
public interface IHasValves
|
||||
{
|
||||
string ValvesOpen { get; set; } /// List of valves to be opened
|
||||
string ValvesClose { get; set; } /// List of valves to be closed
|
||||
}
|
||||
}
|
||||
@ -1,11 +0,0 @@
|
||||
using System;
|
||||
|
||||
namespace ResultsBrowser.Entities
|
||||
{
|
||||
public class MeasurementCorrection
|
||||
{
|
||||
public virtual int Id { get; protected set; }
|
||||
public virtual float Measurement { get; set; }
|
||||
public virtual float Correction { get; set; }
|
||||
}
|
||||
}
|
||||
@ -1,157 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ResultsBrowser.Entities
|
||||
{
|
||||
public class MetersPath : IHasItemNr
|
||||
{
|
||||
public virtual int Id { get; protected set; }
|
||||
public virtual int ItemNr { get; set; }
|
||||
public virtual string Name { get; set; }
|
||||
public virtual float Qfrom { get; set; } /// Water flow in [m3/h]
|
||||
public virtual float Qto { get; set; } /// Water flow in [m3/h]
|
||||
|
||||
/// Sensors
|
||||
public virtual string Sensor1 { get; set; }
|
||||
public virtual string Sensor2 { get; set; }
|
||||
public virtual string Sensor3 { get; set; }
|
||||
public virtual string Sensor4 { get; set; }
|
||||
public virtual string Sensor5 { get; set; }
|
||||
public virtual string Sensor6 { get; set; }
|
||||
public virtual string Sensor7 { get; set; }
|
||||
public virtual string Sensor8 { get; set; }
|
||||
public virtual string Sensor9 { get; set; }
|
||||
public virtual string Sensor10 { get; set; }
|
||||
public virtual string Sensor11 { get; set; }
|
||||
public virtual string Sensor12 { get; set; }
|
||||
public virtual string Sensor13 { get; set; }
|
||||
public virtual string Sensor14 { get; set; }
|
||||
public virtual string Sensor15 { get; set; }
|
||||
public virtual string Sensor16 { get; set; }
|
||||
public virtual string Sensor17 { get; set; }
|
||||
public virtual string Sensor18 { get; set; }
|
||||
public virtual string Sensor19 { get; set; }
|
||||
public virtual string Sensor20 { get; set; }
|
||||
|
||||
/// ------------- Additional stuff not mapped into the database -------------
|
||||
|
||||
public MetersPath()
|
||||
{
|
||||
}
|
||||
|
||||
public MetersPath(string name, int itemNr)
|
||||
: this()
|
||||
{
|
||||
Name = name;
|
||||
ItemNr = itemNr;
|
||||
}
|
||||
|
||||
public MetersPath(BenchControl.MetersPath path)
|
||||
: this(path.Name, path.ItemNr)
|
||||
{
|
||||
Qfrom = path.Qfrom;
|
||||
Qto = path.Qto;
|
||||
Sensor1 = (path.RegisterReaders[0] != null) ? path.RegisterReaders[0].Cfg.Name : null;
|
||||
#pragma warning disable
|
||||
if (Program.WMsCount >= 2) Sensor2 = (path.RegisterReaders[1] != null) ? path.RegisterReaders[1].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 3) Sensor3 = (path.RegisterReaders[2] != null) ? path.RegisterReaders[2].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 4) Sensor4 = (path.RegisterReaders[3] != null) ? path.RegisterReaders[3].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 5) Sensor5 = (path.RegisterReaders[4] != null) ? path.RegisterReaders[4].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 6) Sensor6 = (path.RegisterReaders[5] != null) ? path.RegisterReaders[5].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 7) Sensor7 = (path.RegisterReaders[6] != null) ? path.RegisterReaders[6].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 8) Sensor8 = (path.RegisterReaders[7] != null) ? path.RegisterReaders[7].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 9) Sensor9 = (path.RegisterReaders[8] != null) ? path.RegisterReaders[8].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 10) Sensor10 = (path.RegisterReaders[9] != null) ? path.RegisterReaders[9].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 11) Sensor11 = (path.RegisterReaders[10] != null) ? path.RegisterReaders[10].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 12) Sensor12 = (path.RegisterReaders[11] != null) ? path.RegisterReaders[11].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 13) Sensor13 = (path.RegisterReaders[12] != null) ? path.RegisterReaders[12].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 14) Sensor14 = (path.RegisterReaders[13] != null) ? path.RegisterReaders[13].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 15) Sensor15 = (path.RegisterReaders[14] != null) ? path.RegisterReaders[14].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 16) Sensor16 = (path.RegisterReaders[15] != null) ? path.RegisterReaders[15].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 17) Sensor17 = (path.RegisterReaders[16] != null) ? path.RegisterReaders[16].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 18) Sensor18 = (path.RegisterReaders[17] != null) ? path.RegisterReaders[17].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 19) Sensor19 = (path.RegisterReaders[18] != null) ? path.RegisterReaders[18].Cfg.Name : null;
|
||||
if (Program.WMsCount >= 20) Sensor20 = (path.RegisterReaders[19] != null) ? path.RegisterReaders[19].Cfg.Name : null;
|
||||
#pragma warning restore
|
||||
}
|
||||
|
||||
public virtual MetersPath Clone(string name, int itemNr)
|
||||
{
|
||||
MetersPath result = new MetersPath(name, itemNr);
|
||||
result.Qfrom = Qfrom;
|
||||
result.Qto = Qto;
|
||||
result.Sensor1 = Sensor1;
|
||||
result.Sensor2 = Sensor2;
|
||||
result.Sensor3 = Sensor3;
|
||||
result.Sensor4 = Sensor4;
|
||||
result.Sensor5 = Sensor5;
|
||||
result.Sensor6 = Sensor6;
|
||||
result.Sensor7 = Sensor7;
|
||||
result.Sensor8 = Sensor8;
|
||||
result.Sensor9 = Sensor9;
|
||||
result.Sensor10 = Sensor10;
|
||||
result.Sensor11 = Sensor11;
|
||||
result.Sensor12 = Sensor12;
|
||||
result.Sensor13 = Sensor13;
|
||||
result.Sensor14 = Sensor14;
|
||||
result.Sensor15 = Sensor15;
|
||||
result.Sensor16 = Sensor16;
|
||||
result.Sensor17 = Sensor17;
|
||||
result.Sensor18 = Sensor18;
|
||||
result.Sensor19 = Sensor19;
|
||||
result.Sensor20 = Sensor20;
|
||||
return result;
|
||||
}
|
||||
|
||||
/// Returns the component name
|
||||
public virtual string GetSensor(int i)
|
||||
{
|
||||
if (i == 0) return Sensor1;
|
||||
else if (i == 1) return Sensor2;
|
||||
else if (i == 2) return Sensor3;
|
||||
else if (i == 3) return Sensor4;
|
||||
else if (i == 4) return Sensor5;
|
||||
else if (i == 5) return Sensor6;
|
||||
else if (i == 6) return Sensor7;
|
||||
else if (i == 7) return Sensor8;
|
||||
else if (i == 8) return Sensor9;
|
||||
else if (i == 9) return Sensor10;
|
||||
else if (i == 10) return Sensor11;
|
||||
else if (i == 11) return Sensor12;
|
||||
else if (i == 12) return Sensor13;
|
||||
else if (i == 13) return Sensor14;
|
||||
else if (i == 14) return Sensor15;
|
||||
else if (i == 15) return Sensor16;
|
||||
else if (i == 16) return Sensor17;
|
||||
else if (i == 17) return Sensor18;
|
||||
else if (i == 18) return Sensor19;
|
||||
else if (i == 19) return Sensor20;
|
||||
else return null;
|
||||
}
|
||||
|
||||
/// Sets the component name
|
||||
public virtual void SetSensor(int i, string cmpntName)
|
||||
{
|
||||
if (i == 0) Sensor1 = cmpntName;
|
||||
else if (i == 1) Sensor2 = cmpntName;
|
||||
else if (i == 2) Sensor3 = cmpntName;
|
||||
else if (i == 3) Sensor4 = cmpntName;
|
||||
else if (i == 4) Sensor5 = cmpntName;
|
||||
else if (i == 5) Sensor6 = cmpntName;
|
||||
else if (i == 6) Sensor7 = cmpntName;
|
||||
else if (i == 7) Sensor8 = cmpntName;
|
||||
else if (i == 8) Sensor9 = cmpntName;
|
||||
else if (i == 9) Sensor10 = cmpntName;
|
||||
else if (i == 10) Sensor11 = cmpntName;
|
||||
else if (i == 11) Sensor12 = cmpntName;
|
||||
else if (i == 12) Sensor13 = cmpntName;
|
||||
else if (i == 13) Sensor14 = cmpntName;
|
||||
else if (i == 14) Sensor15 = cmpntName;
|
||||
else if (i == 15) Sensor16 = cmpntName;
|
||||
else if (i == 16) Sensor17 = cmpntName;
|
||||
else if (i == 17) Sensor18 = cmpntName;
|
||||
else if (i == 18) Sensor19 = cmpntName;
|
||||
else if (i == 19) Sensor20 = cmpntName;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,91 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ResultsBrowser.Entities
|
||||
{
|
||||
public class OutputPath : IHasItemNr, IHasValves
|
||||
{
|
||||
public virtual int Id { get; protected set; }
|
||||
public virtual int ItemNr { get; set; }
|
||||
public virtual string Name { get; set; }
|
||||
public virtual float Qfrom { get; set; } /// Water flow in [m3/h]
|
||||
public virtual float Qto { get; set; } /// Water flow in [m3/h]
|
||||
public virtual string RegulValve { get; set; }
|
||||
public virtual string FlowMeter { get; set; }
|
||||
public virtual float PidCoef { get; set; } /// PID coefficient for the regulation path
|
||||
public virtual string StartValve { get; set; }
|
||||
public virtual string Diverter { get; set; }
|
||||
public virtual string TempDiv { get; set; }
|
||||
public virtual string Balance { get; set; }
|
||||
public virtual string EmptyTankValve { get; set; }
|
||||
|
||||
/// Valves
|
||||
public virtual string ValvesOpen { get; set; }
|
||||
public virtual string ValvesClose { get; set; }
|
||||
|
||||
/// ------------- Additional stuff not mapped into the database -------------
|
||||
|
||||
public OutputPath()
|
||||
{
|
||||
}
|
||||
|
||||
public OutputPath(string name, int itemNr)
|
||||
: this()
|
||||
{
|
||||
Name = name;
|
||||
ItemNr = itemNr;
|
||||
}
|
||||
|
||||
public OutputPath(BenchControl.OutputPath path)
|
||||
: this(path.Name, path.ItemNr)
|
||||
{
|
||||
Qfrom = path.Qfrom;
|
||||
Qto = path.Qto;
|
||||
RegulValve = (path.RegulValve != null) ? path.RegulValve.Cfg.Name : null;
|
||||
FlowMeter = (path.FlowMeter != null) ? path.FlowMeter.Cfg.Name : null;
|
||||
PidCoef = path.PidCoef;
|
||||
StartValve = (path.StartValve != null) ? path.StartValve.Cfg.Name : null;
|
||||
Diverter = (path.Diverter != null) ? path.Diverter.Cfg.Name : null;
|
||||
TempDiv = (path.TempDiv != null) ? path.TempDiv.Cfg.Name : null;
|
||||
Balance = (path.Balance != null) ? path.Balance.Cfg.Name : null;
|
||||
EmptyTankValve = (path.EmptyTankValve != null) ? path.EmptyTankValve.Cfg.Name : null;
|
||||
|
||||
string vOpen = string.Empty;
|
||||
foreach (var valve in path.ValvesOpen)
|
||||
{
|
||||
if (vOpen != string.Empty) vOpen += ";";
|
||||
vOpen += valve.Cfg.Name;
|
||||
}
|
||||
ValvesOpen = vOpen;
|
||||
|
||||
string vClose = string.Empty;
|
||||
foreach (var valve in path.ValvesClose)
|
||||
{
|
||||
if (vClose != string.Empty) vClose += ";";
|
||||
vClose += valve.Cfg.Name;
|
||||
}
|
||||
ValvesClose = vClose;
|
||||
}
|
||||
|
||||
public virtual OutputPath Clone(string name, int itemNr)
|
||||
{
|
||||
OutputPath result = new OutputPath(name, itemNr);
|
||||
|
||||
result.Name = Name;
|
||||
result.Qfrom = Qfrom;
|
||||
result.Qto = Qto;
|
||||
result.RegulValve = RegulValve;
|
||||
result.FlowMeter = FlowMeter;
|
||||
result.PidCoef = PidCoef;
|
||||
result.StartValve = StartValve;
|
||||
result.Diverter = Diverter;
|
||||
result.TempDiv = TempDiv;
|
||||
result.Balance = Balance;
|
||||
result.EmptyTankValve = EmptyTankValve;
|
||||
result.ValvesOpen = ValvesOpen;
|
||||
result.ValvesClose = ValvesClose;
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,90 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace ResultsBrowser.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// Stores one test procedure, supports revisions and history log
|
||||
/// </summary>
|
||||
public class Procedure : IHasItemNr
|
||||
{
|
||||
public virtual int Id { get; protected set; }
|
||||
public virtual int ItemNr { get; set; }
|
||||
public virtual string Name { get; set; }
|
||||
public virtual MetersKind MetersKind { get; set; }
|
||||
public virtual string Description { get; set; } /// Short description
|
||||
public virtual string CreationUser { get; set; } /// Name of the user who has created or changed this procedure
|
||||
public virtual DateTime CreationTime { get; set; } /// Date and time of the creation or change
|
||||
public virtual string LastChgUser { get; set; } /// Name of the user who has created or changed this procedure
|
||||
public virtual DateTime LastChgTime { get; set; } /// Date and time of the creation or change
|
||||
public virtual string LongDescription { get; set; } /// Long description (notes)
|
||||
public virtual string Watermeters { get; set; } /// Water meter name or Id
|
||||
public virtual string ProtocolTitle { get; set; } /// Title of the printed and saved protocol
|
||||
|
||||
public virtual string DataEntry { get; set; } /// Component to use for data entry
|
||||
public virtual string ResultsPrinter { get; set; } /// Component to use for printing the results
|
||||
public virtual string ResultsWriter { get; set; } /// Component to use for saving the results into the file
|
||||
public virtual string TransitionStart { get; set; }
|
||||
public virtual string TransitionEnd { get; set; }
|
||||
|
||||
public virtual IList<ComponentProcedure> MoreParams { get; set; }
|
||||
public virtual IList<Test> Tests { get; set; }
|
||||
|
||||
////public virtual string MetrologicalClass { get; set; }
|
||||
////public virtual IList<WMType> WMTypes { get; set; }
|
||||
|
||||
/// ------------- Additional stuff not mapped into the database -------------
|
||||
|
||||
public Procedure()
|
||||
{
|
||||
MoreParams = new List<ComponentProcedure>();
|
||||
Tests = new List<Test>();
|
||||
|
||||
///
|
||||
/// Default values
|
||||
///
|
||||
CreationUser = (User.CurrentUser != null) ? User.CurrentUser.Name : null;
|
||||
CreationTime = DateTime.Now;
|
||||
LastChgUser = CreationUser;
|
||||
LastChgTime = CreationTime;
|
||||
MetersKind = Entities.MetersKind.Single;
|
||||
ProtocolTitle = "Watermeter test protocol";
|
||||
}
|
||||
|
||||
public Procedure(string name, int itemNr)
|
||||
: this()
|
||||
{
|
||||
Name = name;
|
||||
ItemNr = itemNr;
|
||||
}
|
||||
|
||||
public virtual Procedure Clone()
|
||||
{
|
||||
Procedure result = new Procedure();
|
||||
|
||||
result.Name = Name;
|
||||
result.MetersKind = MetersKind;
|
||||
result.Description = Description;
|
||||
result.CreationUser = CreationUser;
|
||||
result.CreationTime = CreationTime;
|
||||
result.LastChgUser = LastChgUser;
|
||||
result.LastChgTime = LastChgTime;
|
||||
result.LongDescription = LongDescription;
|
||||
result.Watermeters = Watermeters;
|
||||
result.DataEntry = DataEntry;
|
||||
result.ResultsPrinter = ResultsPrinter;
|
||||
result.ResultsWriter = ResultsWriter;
|
||||
result.TransitionStart = TransitionStart;
|
||||
result.TransitionEnd = TransitionEnd;
|
||||
|
||||
foreach (var prms in MoreParams) { result.MoreParams.Add(prms.Clone()); }
|
||||
foreach (var test in Tests) { result.Tests.Add(test.Clone()); }
|
||||
|
||||
//result.MetrologicalClass = MetrologicalClass;
|
||||
//result.WMType = WMType.Clone();
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,28 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ResultsBrowser.Entities
|
||||
{
|
||||
public class ProcedureHistory
|
||||
{
|
||||
public virtual int Id { get; protected set; }
|
||||
public virtual Procedure Current { get; set; }
|
||||
public virtual IList<Procedure> OldProcedures { get; set; }
|
||||
|
||||
/// ------------- Additional stuff not mapped into the database -------------
|
||||
|
||||
public ProcedureHistory()
|
||||
{
|
||||
Current = new Procedure();
|
||||
OldProcedures = new List<Procedure>();
|
||||
}
|
||||
|
||||
public virtual ProcedureHistory Clone()
|
||||
{
|
||||
ProcedureHistory result = new ProcedureHistory();
|
||||
result.Current = Current.Clone();
|
||||
foreach (Procedure p in OldProcedures) result.OldProcedures.Add(p.Clone());
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,97 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ResultsBrowser.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// Test, consisting of one or more repetitions of the test 'SingleTest'.
|
||||
/// </summary>
|
||||
public class Test : IHasItemNr
|
||||
{
|
||||
public virtual int Id { get; protected set; }
|
||||
public virtual int ItemNr { get; set; }
|
||||
public virtual string Name { get; set; }
|
||||
public virtual int Part { get; set; } /// Part=0 ... test of all WM-s
|
||||
/// Part>0 ... part of a set of tests with the same Name: subset of WM-s is given by MetersPath
|
||||
public virtual float Qfrom { get; set; } /// Water flow low limit in [m3/h]
|
||||
public virtual float Qto { get; set; } /// Water flow high limit in [m3/h]
|
||||
public virtual float Volume { get; set; } /// Test volume (target) in [l]
|
||||
public virtual float TstTime { get; set; } /// Test time (estimate) in [s]
|
||||
public virtual int Repeats { get; set; }
|
||||
public virtual bool Emptying { get; set; }
|
||||
public virtual bool Zeroing { get; set; }
|
||||
public virtual float PumpPower { get; set; } /// Power of the pump in [%] in the range 0 .. 100.0f, use values 0% and 100% for non-FM pumps
|
||||
public virtual int Time2MassMsrmt { get; set; } /// Delay time from the test end (diverted) to the 2nd mass measuremen in [s]
|
||||
public virtual string Method { get; set; }
|
||||
public virtual float ErrLimLo { get; set; } /// in [%] (usually < 0)
|
||||
public virtual float ErrLimHi { get; set; } /// in [%] (usually > 0)
|
||||
public virtual double TolerRed { get; set; } /// = Filter
|
||||
public virtual TestRedType RedType { get; set; }
|
||||
public virtual string FeedingPath { get; set; }
|
||||
public virtual string BenchPath { get; set; }
|
||||
public virtual string OutputPath { get; set; }
|
||||
public virtual string MetersPath { get; set; }
|
||||
public virtual string TransitionStart { get; set; }
|
||||
public virtual string TransitionEnd { get; set; }
|
||||
|
||||
public virtual IList<ComponentTest> MoreParams { get; set; }
|
||||
|
||||
public virtual Procedure Procedure { get; set; }
|
||||
|
||||
/// ------------- Additional stuff not mapped into the database -------------
|
||||
|
||||
public Test()
|
||||
{
|
||||
MoreParams = new List<ComponentTest>();
|
||||
|
||||
///
|
||||
/// Default values
|
||||
///
|
||||
Repeats = 1;
|
||||
Emptying = false;
|
||||
Zeroing = false;
|
||||
PumpPower = 60.0f; /// [%]
|
||||
Time2MassMsrmt = 5; /// [s] between the test end and the final mass measurement
|
||||
ErrLimLo = -2.0f; /// [%] lower error limit
|
||||
ErrLimHi = 2.0f; /// [%] upper error limit
|
||||
TolerRed = 5.0; /// = Filter parameter
|
||||
}
|
||||
|
||||
public Test(string name, int itemNr, Procedure procedure)
|
||||
: this()
|
||||
{
|
||||
Name = name;
|
||||
ItemNr = itemNr;
|
||||
Procedure = procedure;
|
||||
}
|
||||
|
||||
// Makes a new copy of this object (not just a reference)
|
||||
public virtual Test Clone()
|
||||
{
|
||||
Test result = new Test(Name, ItemNr, Procedure);
|
||||
|
||||
result.Part = Part;
|
||||
result.Qfrom = Qfrom;
|
||||
result.Qto = Qto;
|
||||
result.Volume = Volume;
|
||||
result.TstTime = TstTime;
|
||||
result.Repeats = Repeats;
|
||||
result.Emptying = Emptying;
|
||||
result.Zeroing = Zeroing;
|
||||
result.PumpPower = PumpPower;
|
||||
result.Time2MassMsrmt = Time2MassMsrmt;
|
||||
result.Method = Method;
|
||||
result.ErrLimLo = ErrLimLo;
|
||||
result.ErrLimHi = ErrLimHi;
|
||||
result.TolerRed = TolerRed;
|
||||
result.RedType = RedType;
|
||||
result.FeedingPath = FeedingPath;
|
||||
result.BenchPath = BenchPath;
|
||||
result.OutputPath = OutputPath;
|
||||
result.MetersPath = MetersPath;
|
||||
foreach (var prms in MoreParams) { result.MoreParams.Add(prms.Clone()); }
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,161 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ResultsBrowser.Entities
|
||||
{
|
||||
public class TestResult
|
||||
{
|
||||
public virtual int Id { get; protected set; }
|
||||
public virtual string Name { get; set; }
|
||||
public virtual int BatchNr { get; set; }
|
||||
public virtual MetersKind MetersKind { get; set; }
|
||||
public virtual IList<MeterTestResult> Meters { get; set; }
|
||||
public virtual IList<MeterTestResult> CombinedMeters { get; set; }
|
||||
|
||||
/// Value copied from the procedure (Entities.Procedure)
|
||||
public virtual string ProcedureName { get; set; }
|
||||
public virtual string ProtocolTitle { get; set; }
|
||||
|
||||
/// Values copied from the test (Entities.Test)
|
||||
public virtual int TestId { get; set; } /// Test entity ID to distinguish between tests with the same name
|
||||
public virtual string TestName { get; set; }
|
||||
public virtual int Part { get; set; }
|
||||
public virtual bool DoNotEvaluate { get; set; } /// Not mapped to the database
|
||||
public virtual bool DoNotPublish { get; set; } /// Not mapped to the database
|
||||
public virtual float Qfrom { get; set; } /// Water flow low limit in [m3/h]
|
||||
public virtual float Qto { get; set; } /// Water flow high limit in [m3/h]
|
||||
public virtual float Volume { get; set; } /// Test volume (target) in [l]
|
||||
public virtual float TstTime { get; set; } /// Test time (estimate) in [s]
|
||||
public virtual int Repeats { get; set; }
|
||||
public virtual bool Emptying { get; set; }
|
||||
public virtual bool Zeroing { get; set; }
|
||||
public virtual float PumpPower { get; set; } /// Power of the pump in [%] in the range 0 .. 100.0f, use values 0% and 100% for non-FM pumps
|
||||
public virtual int Time2MassMsrmt { get; set; }
|
||||
public virtual string Method { get; set; }
|
||||
public virtual float ErrLimLo { get; set; } /// in [%] (usually < 0)
|
||||
public virtual float ErrLimHi { get; set; } /// in [%] (usually > 0)
|
||||
|
||||
/// To be replaced by the virtual bench component parameters
|
||||
public virtual string FeedingPath { get; set; }
|
||||
public virtual string BenchPath { get; set; }
|
||||
public virtual string OutputPath { get; set; }
|
||||
public virtual string MetersPath { get; set; }
|
||||
|
||||
/// Results
|
||||
public virtual DateTime TimeStart { get; set; } /// Date and time of the test start
|
||||
public virtual DateTime TimeEnd { get; set; } /// Date and time of the test end
|
||||
public virtual int RepetitionNr { get; set; } /// Repetition number from the set of repeated tests (1...)
|
||||
public virtual float AmbientTempAve { get; set; } /// Average ambient air temperature [degC]
|
||||
public virtual float AmbientPressAve { get; set; } /// Average ambient air pressure
|
||||
public virtual float AmbientHumiAve { get; set; } /// Average ambient air relative humidity [%]
|
||||
public virtual float PressInAvrg { get; set; } /// Input water pressure (average) [Bar]
|
||||
public virtual float PressInStart { get; set; }
|
||||
public virtual float PressInEnd { get; set; }
|
||||
public virtual float PressOutAvrg { get; set; }
|
||||
public virtual float PressOutStart { get; set; }
|
||||
public virtual float PressOutEnd { get; set; }
|
||||
public virtual float TempInAvrg { get; set; }
|
||||
public virtual float TempInStart { get; set; }
|
||||
public virtual float TempInEnd { get; set; }
|
||||
public virtual float TempOutAvrg { get; set; }
|
||||
public virtual float TempOutStart { get; set; }
|
||||
public virtual float TempOutEnd { get; set; }
|
||||
public virtual float TempDivAvrg { get; set; }
|
||||
public virtual float TempDivStart { get; set; }
|
||||
public virtual float TempDivEnd { get; set; }
|
||||
public virtual float MassStartRaw { get; set; }
|
||||
public virtual float MassStart { get; set; }
|
||||
public virtual float MassEndRaw { get; set; }
|
||||
public virtual float MassEnd { get; set; }
|
||||
public virtual float MassDiff { get; set; }
|
||||
public virtual float DensityIn { get; set; }
|
||||
public virtual float DensityOut { get; set; }
|
||||
public virtual float DensityDiv { get; set; }
|
||||
public virtual float Buoyancy { get; set; } ///TODO -> map
|
||||
public virtual float FlowMass { get; set; } /// from conventional true value
|
||||
public virtual float FlowVolume { get; set; } /// from conventional true value
|
||||
public virtual float VolumeCTV { get; set; } /// volume conventional true value
|
||||
public virtual float VolumeMaster { get; set; } /// volume from the master flow meter
|
||||
public virtual float Time { get; set; } /// measurement time in seconds
|
||||
public virtual float ErrorMaster { get; set; }
|
||||
public virtual float PulsesMaster { get; set; }
|
||||
public virtual float ConstMaster { get; set; } /// Pulses per liter master flow meter
|
||||
public virtual float QRise { get; set; } /// Detected Q_rise of a composed meter
|
||||
public virtual float QFall { get; set; } /// Detected Q_fall of a composed meter
|
||||
public virtual float TimeDivStart0 { get; set; }
|
||||
public virtual float TimeDivStart1 { get; set; }
|
||||
public virtual float TimeDivStart2 { get; set; }
|
||||
public virtual float TimeDivStart3 { get; set; }
|
||||
public virtual float TimeDivStart4 { get; set; }
|
||||
public virtual float TimeDivStart5 { get; set; }
|
||||
public virtual float TimeDivEnd0 { get; set; }
|
||||
public virtual float TimeDivEnd1 { get; set; }
|
||||
public virtual float TimeDivEnd2 { get; set; }
|
||||
public virtual float TimeDivEnd3 { get; set; }
|
||||
public virtual float TimeDivEnd4 { get; set; }
|
||||
public virtual float TimeDivEnd5 { get; set; }
|
||||
|
||||
public TestResult()
|
||||
{
|
||||
Meters = new List<MeterTestResult>();
|
||||
CombinedMeters = new List<MeterTestResult>();
|
||||
}
|
||||
|
||||
public TestResult(MetersKind kind)
|
||||
: this()
|
||||
{
|
||||
MetersKind = kind;
|
||||
|
||||
if (kind == MetersKind.Single)
|
||||
{
|
||||
for (int i = 0; i < Program.WMsCount; i++) Meters.Add(new MeterTestResult(this));
|
||||
}
|
||||
else if (kind == MetersKind.Combined)
|
||||
{
|
||||
int combinedCount = Program.WMsCount / 2;
|
||||
for (int i = 0; i < 2 * combinedCount; i++) Meters.Add(new MeterTestResult(this));
|
||||
for (int i = 0; i < combinedCount; i++) CombinedMeters.Add(new MeterTestResult(this));
|
||||
}
|
||||
}
|
||||
|
||||
public TestResult(Test test, int repetitionNr, MetersKind kind)
|
||||
: this(kind)
|
||||
{
|
||||
if (test.Repeats == 1)
|
||||
{
|
||||
Name = test.Name;
|
||||
}
|
||||
else
|
||||
{
|
||||
Name = string.Format("{0} ({1}/{2})", test.Name, repetitionNr, test.Repeats);
|
||||
}
|
||||
RepetitionNr = repetitionNr;
|
||||
|
||||
/// Copy test parameters from Entities.Procedure object
|
||||
ProcedureName = test.Procedure.Name;
|
||||
ProtocolTitle = test.Procedure.ProtocolTitle;
|
||||
|
||||
/// Copy test parameters from Entities.Test object
|
||||
TestId = test.Id;
|
||||
TestName = test.Name;
|
||||
Part = test.Part;
|
||||
Qfrom = test.Qfrom;
|
||||
Qto = test.Qto;
|
||||
Volume = test.Volume;
|
||||
TstTime = test.TstTime;
|
||||
Repeats = test.Repeats;
|
||||
Emptying = test.Emptying;
|
||||
Zeroing = test.Zeroing;
|
||||
PumpPower = PumpPower;
|
||||
Time2MassMsrmt = test.Time2MassMsrmt;
|
||||
Method = test.Method;
|
||||
ErrLimLo = test.ErrLimLo;
|
||||
ErrLimHi = test.ErrLimHi;
|
||||
|
||||
FeedingPath = test.FeedingPath;
|
||||
BenchPath = test.BenchPath;
|
||||
OutputPath = test.OutputPath;
|
||||
MetersPath = test.MetersPath;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,37 +0,0 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ResultsBrowser.Entities
|
||||
{
|
||||
/// <summary>
|
||||
/// Stores one transition sequence containing a list of transition steps
|
||||
/// </summary>
|
||||
public class TransitionSequence : IHasItemNr
|
||||
{
|
||||
public virtual int Id { get; protected set; }
|
||||
public virtual int ItemNr { get; set; }
|
||||
public virtual string Name { get; set; }
|
||||
public virtual string Description { get; set; } /// Short description
|
||||
public virtual IList<TransitionStep> TransitionSteps { get; set; }
|
||||
|
||||
public TransitionSequence()
|
||||
{
|
||||
TransitionSteps = new List<TransitionStep>();
|
||||
}
|
||||
|
||||
public TransitionSequence(string name, int itemNr)
|
||||
: this()
|
||||
{
|
||||
Name = name;
|
||||
ItemNr = itemNr;
|
||||
}
|
||||
|
||||
public virtual TransitionSequence Clone()
|
||||
{
|
||||
TransitionSequence result = new TransitionSequence();
|
||||
result.Name = Name;
|
||||
result.Description = Description;
|
||||
foreach (var step in TransitionSteps) { result.TransitionSteps.Add(step.Clone()); }
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,58 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ResultsBrowser.Entities
|
||||
{
|
||||
public class TransitionStep : IHasItemNr, IHasValves
|
||||
{
|
||||
public virtual int Id { get; protected set; }
|
||||
public virtual int ItemNr { get; set; } /// Order of the preparation step
|
||||
public virtual int Duration { get; set; } /// Duration in seconds
|
||||
public virtual string Message { get; set; } /// Message
|
||||
public virtual string ValvesOpen { get; set; } /// List of valves to be opened
|
||||
public virtual string ValvesClose { get; set; } /// List of valves to be closed
|
||||
public virtual string RegulValvesPct { get; set; } /// Positions of regulation valves in % separated by ';'
|
||||
public virtual string PumpWithFMPcts { get; set; } /// Power of FM controlled pumps in % separated by ';'
|
||||
|
||||
public virtual TransitionSequence TransitionSequence { get; set; }
|
||||
|
||||
/// ------------- Additional stuff not mapped into the database -------------
|
||||
|
||||
public TransitionStep()
|
||||
{
|
||||
Duration = 5; /// sec.
|
||||
}
|
||||
|
||||
public TransitionStep(int itemNr, TransitionSequence sequence)
|
||||
: this()
|
||||
{
|
||||
ItemNr = itemNr;
|
||||
TransitionSequence = sequence;
|
||||
}
|
||||
|
||||
public virtual TransitionStep Clone()
|
||||
{
|
||||
TransitionStep result = new TransitionStep(ItemNr, TransitionSequence);
|
||||
result.Duration = Duration;
|
||||
result.Message = Message;
|
||||
result.ValvesOpen = ValvesOpen;
|
||||
result.ValvesClose = ValvesClose;
|
||||
result.RegulValvesPct = RegulValvesPct;
|
||||
result.PumpWithFMPcts = PumpWithFMPcts;
|
||||
return result;
|
||||
}
|
||||
|
||||
public virtual string ToString(string indent)
|
||||
{
|
||||
string result = "";
|
||||
result += indent + "ItemNr = " + ItemNr.ToString() + ", ";
|
||||
result += indent + "Duration = " + Duration.ToString() + ", ";
|
||||
result += indent + "Message = " + Message + ", ";
|
||||
result += indent + "ValvesOpen = " + ValvesOpen.ToString() + ", ";
|
||||
result += indent + "ValvesClose = " + ValvesClose.ToString() + ", ";
|
||||
result += indent + "RegulValvesPct = " + RegulValvesPct.ToString() + ", ";
|
||||
result += indent + "PumpsWithFMPct = " + RegulValvesPct.ToString() + Environment.NewLine;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,257 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Security.Cryptography;
|
||||
using System.Text;
|
||||
using System.Diagnostics;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace ResultsBrowser.Entities
|
||||
{
|
||||
public class User
|
||||
{
|
||||
public virtual int Id { get; protected set; }
|
||||
public virtual string Name { get; set; }
|
||||
public virtual string Password { get; set; }
|
||||
public virtual string Description { get; set; }
|
||||
public virtual DateTime LastPwChange { get; set; }
|
||||
public virtual IList<Group> Groups { get; set; } //User can be a member of a list of groups
|
||||
|
||||
private bool powerUser; /// Set to tue for built-in users, power users have full access even with empty Groups
|
||||
|
||||
public User()
|
||||
{
|
||||
this.powerUser = false;
|
||||
Groups = new List<Group>();
|
||||
}
|
||||
|
||||
public virtual void AddGroup(Group group)
|
||||
{
|
||||
Groups.Add(group);
|
||||
}
|
||||
|
||||
|
||||
public User(string name)
|
||||
{
|
||||
this.powerUser = true;
|
||||
Name = name;
|
||||
Groups = new List<Group>();
|
||||
Description = "Power user";
|
||||
}
|
||||
|
||||
/// ------------- Additional stuff not mapped into the database -------------
|
||||
|
||||
///
|
||||
/// Authorized user (static)
|
||||
///
|
||||
private static User currentUser = null; /// Updated by instance methods Authorize, Unauthorize
|
||||
public static User CurrentUser
|
||||
{
|
||||
get { return currentUser; }
|
||||
set { currentUser = value; }
|
||||
}
|
||||
|
||||
private static DateTime lastAuthorization = DateTime.Now;
|
||||
public static DateTime LastAuthorization { get { return lastAuthorization; } }
|
||||
|
||||
/// <summary>
|
||||
/// Check whether user is a member of a group.
|
||||
/// </summary>
|
||||
/// <param name="groupId">Group GID</param>
|
||||
/// <returns>true is user is a member of the specified group</returns>
|
||||
public virtual bool IsMemberOf(Grp.GID groupId)
|
||||
{
|
||||
if (groupId == Grp.GID.None || powerUser)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else if (groupId >= 0 && (int)groupId < Grp.Count)
|
||||
{
|
||||
// for all group elements in User.groups
|
||||
for (int i = 0; i < Groups.Count; ++i)
|
||||
{
|
||||
// element GID = parameter GroupId ?
|
||||
if (((Group)Groups[i]).Gid == (int)groupId)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Sets users password. It then will be encrypted.
|
||||
/// </summary>
|
||||
/// <param name="password">Password</param>
|
||||
public virtual void SetPassword(string password)
|
||||
{
|
||||
this.Password = EncryptedPassword(password);
|
||||
LastPwChange = DateTime.Now;
|
||||
}
|
||||
|
||||
|
||||
public virtual string EncryptedPassword(string password)
|
||||
{
|
||||
return getHash(password);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Verifies users password. Used by static bool Authorisation(...)
|
||||
/// </summary>
|
||||
/// <param name="password">Password</param>
|
||||
/// <returns>true if password is correct</returns>
|
||||
public virtual bool CheckPassword(string password)
|
||||
{
|
||||
return (Password == EncryptedPassword(password));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The FIRST of TWO possible user authorization method to be used
|
||||
/// when a specific group membership is required (you can use Grp.GID.None).
|
||||
/// If the user is not authorized, the current user remains to be a current user
|
||||
/// (i.e. the access rights were not risen to a higher level).
|
||||
/// If you require different behavior, use Unauthorize() before calling Authorize().
|
||||
/// </summary>
|
||||
/// <param name="userName"></param>
|
||||
/// <param name="password"></param>
|
||||
/// <param name="requiredGrupMembership"></param>
|
||||
/// <returns>true = authorized</returns>
|
||||
public virtual bool Authorize(string userName, string password, TBF.Grp.GID requiredGroupMembership)
|
||||
{
|
||||
if (Entities.User.IsPowerUser(userName, password))
|
||||
{
|
||||
currentUser = this;
|
||||
lastAuthorization = DateTime.Now;
|
||||
return true;
|
||||
}
|
||||
|
||||
if (Name.ToLower() == userName.ToLower())
|
||||
{
|
||||
if (IsMemberOf(requiredGroupMembership) && CheckPassword(password))
|
||||
{
|
||||
currentUser = this;
|
||||
lastAuthorization = DateTime.Now;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// The SECOND of TWO possible user authorization method to be used when
|
||||
/// no specific group membership is required.
|
||||
/// If the user is not authorized, the current user remains to be a current user
|
||||
/// (i.e. the access rights were not risen to a higher level).
|
||||
/// If you require different behavior, use Unauthorize() before calling Authorize().
|
||||
/// </summary>
|
||||
/// <param name="userName"></param>
|
||||
/// <param name="password"></param>
|
||||
/// <param name="requiredGroupMembership"></param>
|
||||
/// <returns>true = authorized</returns>
|
||||
public virtual bool Authorize(string userName, string password)
|
||||
{
|
||||
return Authorize(userName, password, Grp.GID.None);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a 'User' with a given username from a database.
|
||||
/// </summary>
|
||||
/// <param name="username">User name for the query</param>
|
||||
/// <returns>reference to a 'User' (if it exists) or null</returns>
|
||||
public static User AuthorizeDummyUser(string username)
|
||||
{
|
||||
User user = new User();
|
||||
user.Name = username;
|
||||
currentUser = user;
|
||||
return user;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a 'User' with a given username from an ARBITRARY database.
|
||||
/// </summary>
|
||||
/// <param name="username">User name for the query</param>
|
||||
/// <returns>reference to a 'User' (if it exists) or null</returns>
|
||||
public static User LoadUserByName(string username, DBSettings dbSettings)
|
||||
{
|
||||
IList<User> listOfUsers = FluentCommon.CreateSessionFactory(Database.Users, dbSettings, false)
|
||||
.OpenSession()
|
||||
.CreateQuery("FROM User WHERE LOWER(Name) = :username")
|
||||
.SetParameter("username", username.ToLower())
|
||||
.List<User>();
|
||||
if (listOfUsers.Count > 0) return listOfUsers[0];
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a 'User' with a given username from the users database.
|
||||
/// </summary>
|
||||
/// <param name="username">User name for the query</param>
|
||||
/// <returns>reference to a 'User' (if it exists) or null</returns>
|
||||
public static User LoadUserByName(string username)
|
||||
{
|
||||
IList<User> listOfUsers = FluentCommon.CreateSession(Database.Users)
|
||||
.CreateQuery("FROM User WHERE LOWER(Name) = :username")
|
||||
.SetParameter("username", username.ToLower())
|
||||
.List<User>();
|
||||
if (listOfUsers.Count > 0) return listOfUsers[0];
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// returns an IList of all Users
|
||||
/// </summary>
|
||||
public static IList<User> GetAllUsers()
|
||||
{
|
||||
return FluentCommon.CreateSession(Database.Users)
|
||||
.CreateQuery("FROM User")
|
||||
.List<User>();
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Unauthorize, abandon current users authorization.
|
||||
/// </summary>
|
||||
public static void Unauthorize()
|
||||
{
|
||||
currentUser = null;
|
||||
lastAuthorization = DateTime.Now;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// getHash encrypts a string
|
||||
/// </summary>
|
||||
/// <param name="text">the string to encrypt</param>
|
||||
/// <returns></returns>
|
||||
public static string getHash(string text)
|
||||
{
|
||||
byte[] bytes = Encoding.Unicode.GetBytes(text);
|
||||
SHA512Managed hashstring = new SHA512Managed();
|
||||
byte[] hash = hashstring.ComputeHash(bytes);
|
||||
string hashString = string.Empty;
|
||||
foreach (byte x in hash)
|
||||
{
|
||||
hashString += String.Format("{0:x2}", x);
|
||||
}
|
||||
return hashString;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns 'true' when authentication data are valid for a power user.
|
||||
/// </summary>
|
||||
/// <param name="userName">User name</param>
|
||||
/// <param name="password">Password</param>
|
||||
/// <returns>true = authenticated, false = refused</returns>
|
||||
public static bool IsPowerUser(string userName, string password)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,35 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ResultsBrowser.Entities
|
||||
{
|
||||
public class VirtualBenchSequence : IHasItemNr
|
||||
{
|
||||
public virtual int Id { get; protected set; }
|
||||
public virtual int ItemNr { get; set; }
|
||||
public virtual string Name { get; set; }
|
||||
public virtual string Description { get; set; } /// Short description
|
||||
public virtual IList<VirtualBenchStep> VirtualBenchSteps { get; set; }
|
||||
|
||||
public VirtualBenchSequence()
|
||||
{
|
||||
VirtualBenchSteps = new List<VirtualBenchStep>();
|
||||
}
|
||||
|
||||
public VirtualBenchSequence(string name, int itemNr)
|
||||
: this()
|
||||
{
|
||||
Name = name;
|
||||
ItemNr = itemNr;
|
||||
}
|
||||
|
||||
public virtual VirtualBenchSequence Clone()
|
||||
{
|
||||
VirtualBenchSequence result = new VirtualBenchSequence();
|
||||
result.Name = Name;
|
||||
result.Description = Description;
|
||||
foreach (var step in VirtualBenchSteps) { result.VirtualBenchSteps.Add(step.Clone()); }
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,36 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace ResultsBrowser.Entities
|
||||
{
|
||||
public class VirtualBenchStep : IHasItemNr
|
||||
{
|
||||
public virtual int Id { get; protected set; }
|
||||
public virtual int ItemNr { get; set; } /// Order of the preparation step
|
||||
public virtual int Duration { get; set; } /// Duration in seconds
|
||||
///
|
||||
|
||||
public virtual VirtualBenchSequence VirtualBenchSequence { get; set; }
|
||||
|
||||
/// ------------- Additional stuff not mapped into the database -------------
|
||||
|
||||
public VirtualBenchStep()
|
||||
{
|
||||
Duration = 5; /// sec.
|
||||
}
|
||||
|
||||
public VirtualBenchStep(int itemNr, VirtualBenchSequence sequence)
|
||||
: this()
|
||||
{
|
||||
ItemNr = itemNr;
|
||||
VirtualBenchSequence = sequence;
|
||||
}
|
||||
|
||||
public virtual VirtualBenchStep Clone()
|
||||
{
|
||||
VirtualBenchStep result = new VirtualBenchStep(ItemNr, VirtualBenchSequence);
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,75 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
/// This class holds the watermeter type specific data
|
||||
/// that have all watermaters of the same type in common
|
||||
|
||||
namespace ResultsBrowser.Entities
|
||||
{
|
||||
public class WMType
|
||||
{
|
||||
// mapped
|
||||
public virtual int Id { get; protected set; } /// primary key
|
||||
public virtual DateTime CreateTime { get; set; } /// Date and time of the creation or change
|
||||
public virtual string CreateUserName { get; set; } /// Name of the user who has created or changed this procedure
|
||||
public virtual string CreateDescription { get; set; } /// Description\
|
||||
|
||||
public virtual string Name { get; set; } /// type name
|
||||
public virtual float PulseRate { get; set; } /// Pulses per Liter
|
||||
|
||||
// not yet mapped
|
||||
public virtual int IdentNr { get; protected set; } /// identification number of watermeter tzpe
|
||||
public virtual int Diameter { get; set; } /// nominal diameter
|
||||
public virtual int Pressure { get; set; } /// nominal pressure
|
||||
public virtual int Length { get; set; } /// construction length
|
||||
public virtual int Temperatur { get; set; } /// nominal temperature in C
|
||||
public virtual float NominalFlow { get; set; } /// nominal flow Qn
|
||||
|
||||
/// ------------- Additional stuff not mapped into the database -------------
|
||||
|
||||
public WMType()
|
||||
{
|
||||
}
|
||||
|
||||
public static WMType DefaultWMType()
|
||||
{
|
||||
WMType procedure = new WMType()
|
||||
{
|
||||
CreateTime = DateTime.Now,
|
||||
CreateUserName = User.CurrentUser.Name,
|
||||
CreateDescription = "A default water meter created.",
|
||||
Name = "Watermeter",
|
||||
PulseRate = 1000,
|
||||
};
|
||||
return procedure;
|
||||
}
|
||||
|
||||
public virtual WMType Clone()
|
||||
{
|
||||
WMType result = new WMType();
|
||||
|
||||
result.CreateTime = CreateTime;
|
||||
result.CreateUserName = CreateUserName;
|
||||
result.CreateDescription = CreateDescription;
|
||||
result.Name = Name;
|
||||
result.PulseRate = PulseRate;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public override string ToString()
|
||||
{
|
||||
string result = "";
|
||||
result += "WMTpe: " + Environment.NewLine;
|
||||
result += " Name = " + Name + Environment.NewLine;
|
||||
result += " Created by = " + CreateUserName + Environment.NewLine;
|
||||
result += " Created on = " + CreateTime.ToString() + Environment.NewLine;
|
||||
result += " Description = " + CreateDescription + Environment.NewLine;
|
||||
result += " Pulse rate = " + PulseRate.ToString() + Environment.NewLine;
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,38 +0,0 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
using TBF;
|
||||
using NHibernate;
|
||||
using FluentNHibernate;
|
||||
|
||||
namespace ResultsBrowser.Entities
|
||||
{
|
||||
public class Watermeter
|
||||
{
|
||||
public virtual int Id { get; protected set; } /// primary key
|
||||
|
||||
public virtual DateTime CreateTime { get; set; } /// Date and time of the creation or change
|
||||
public virtual string CreateUserName { get; set; } /// Name of the user who has created or changed this procedure
|
||||
public virtual string CreateDescription { get; set; } /// Description
|
||||
|
||||
/// mapped
|
||||
public virtual string Serial { get; set; } /// serial number
|
||||
public virtual WMType WMType { get; set; } /// type of watermeter
|
||||
///
|
||||
|
||||
/// <summary>
|
||||
/// Load a watermeter from the database
|
||||
/// </summary>
|
||||
public static Watermeter LoadBySerialnr(string SerialNr)
|
||||
{
|
||||
IList<Watermeter> ListOfWatermeters = FluentCommon.CreateSession(Database.WaterMeters)
|
||||
.CreateQuery("FROM Watermeter WHERE Serial = :SerialNrParameter")
|
||||
.SetParameter("SerialNrParameter", SerialNr)
|
||||
.List<Watermeter>();
|
||||
if (ListOfWatermeters.Count > 0) return ListOfWatermeters.ElementAt(0);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,316 +0,0 @@
|
||||
using System;
|
||||
using FluentNHibernate.Cfg;
|
||||
using FluentNHibernate.Cfg.Db;
|
||||
using NHibernate;
|
||||
using NHibernate.Cfg;
|
||||
using NHibernate.Tool.hbm2ddl;
|
||||
|
||||
namespace ResultsBrowser
|
||||
{
|
||||
/// <summary>
|
||||
/// Identifies the content of a database
|
||||
/// </summary>
|
||||
public enum Database
|
||||
{
|
||||
Users,
|
||||
Bench,
|
||||
Procedures,
|
||||
WaterMeters,
|
||||
Count,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Identifies the type of a database
|
||||
/// </summary>
|
||||
public enum DBType
|
||||
{
|
||||
SQLite, /// SQLite
|
||||
MySql, /// MySQL database
|
||||
DbTypesCount,
|
||||
}
|
||||
|
||||
|
||||
public static class FluentCommon
|
||||
{
|
||||
/// <summary>
|
||||
/// Session factories for regular sessions.
|
||||
/// </summary>
|
||||
public static ISessionFactory[] SessionFactories = new ISessionFactory[(int)Database.Count];
|
||||
|
||||
/// <summary>
|
||||
/// NHibernate session factory (to create the database session 'SessionFactory')
|
||||
/// </summary>
|
||||
/// <returns>A database session</returns>
|
||||
static ISessionFactory CreateSessionFactory(Database database)
|
||||
{
|
||||
DBType dbType;
|
||||
string connectionString;
|
||||
|
||||
switch (database)
|
||||
{
|
||||
default:
|
||||
case Database.Users:
|
||||
dbType = Program.CurrentBench.UsersDBSettings.DbType;
|
||||
connectionString = Program.CurrentBench.UsersDBSettings.ConnectionString;
|
||||
break;
|
||||
case Database.Bench:
|
||||
dbType = Program.CurrentBench.BenchDBSettings.DbType;
|
||||
connectionString = Program.CurrentBench.BenchDBSettings.ConnectionString;
|
||||
break;
|
||||
case Database.Procedures:
|
||||
dbType = Program.CurrentBench.ProceduresDBSettings.DbType;
|
||||
connectionString = Program.CurrentBench.ProceduresDBSettings.ConnectionString;
|
||||
break;
|
||||
case Database.WaterMeters:
|
||||
dbType = Program.CurrentBench.WaterMetersDBSettings.DbType;
|
||||
connectionString = Program.CurrentBench.WaterMetersDBSettings.ConnectionString;
|
||||
break;
|
||||
}
|
||||
|
||||
return CreateSessionFactory(database, new DBSettings(dbType, connectionString), false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// NHibernate session factory (to create the database session 'SessionFactory')
|
||||
/// </summary>
|
||||
/// <returns>A database session</returns>
|
||||
public static ISessionFactory CreateSessionFactory(Database database, DBSettings dbSettings, bool createDB)
|
||||
{
|
||||
try
|
||||
{
|
||||
FluentConfiguration cfg = Fluently.Configure();
|
||||
|
||||
switch (dbSettings.DbType)
|
||||
{
|
||||
default:
|
||||
case DBType.SQLite:
|
||||
cfg = cfg.Database(SQLiteConfiguration.Standard.UsingFile(dbSettings.ConnectionString));
|
||||
break;
|
||||
case DBType.MySql:
|
||||
cfg = cfg.Database(MySQLConfiguration.Standard.ConnectionString(dbSettings.ConnectionString));
|
||||
break;
|
||||
}
|
||||
|
||||
switch (database)
|
||||
{
|
||||
default:
|
||||
case Database.Users:
|
||||
cfg = cfg.Mappings(m => m.FluentMappings.AddFromAssemblyOf<Program>());
|
||||
break;
|
||||
case Database.Bench:
|
||||
cfg = cfg.Mappings(m => m.FluentMappings.AddFromAssemblyOf<Program>());
|
||||
break;
|
||||
case Database.Procedures:
|
||||
cfg = cfg.Mappings(m => m.FluentMappings.AddFromAssemblyOf<Program>());
|
||||
break;
|
||||
case Database.WaterMeters:
|
||||
cfg = cfg.Mappings(m => m.FluentMappings.AddFromAssemblyOf<Program>());
|
||||
break;
|
||||
}
|
||||
|
||||
if (createDB)
|
||||
{
|
||||
return cfg.ExposeConfiguration(BuildSchemaCreate).BuildSessionFactory();
|
||||
}
|
||||
else
|
||||
{
|
||||
return cfg.ExposeConfiguration(BuildSchema).BuildSessionFactory();
|
||||
}
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public delegate void BuildSchemaDlgt(Configuration config);
|
||||
|
||||
static void BuildSchema(Configuration config)
|
||||
{
|
||||
/// This NHibernate tool takes a configuration (with mapping info in)
|
||||
/// and exports a database schema from it
|
||||
new SchemaExport(config).SetOutputFile("db_schema");
|
||||
}
|
||||
|
||||
static void BuildSchemaCreate(Configuration config)
|
||||
{
|
||||
/// This NHibernate tool takes a configuration (with mapping info in)
|
||||
/// and exports a database schema from it
|
||||
new SchemaExport(config).Create(true, true);
|
||||
}
|
||||
|
||||
/// Create a NHibernate session for the given database
|
||||
public static ISession CreateSession(Database database)
|
||||
{
|
||||
int ix = (int)database;
|
||||
if (ix < 0 || ix >= (int)Database.Count) return null;
|
||||
|
||||
if (SessionFactories[ix] == null) SessionFactories[ix] = CreateSessionFactory(database);
|
||||
|
||||
return SessionFactories[ix].OpenSession();
|
||||
}
|
||||
|
||||
public static void SaveToDb(Database database, object obj)
|
||||
{
|
||||
ISession session = FluentCommon.CreateSession(database);
|
||||
SaveToDb(session, obj);
|
||||
}
|
||||
|
||||
public static void SaveToDb(ISession session, object obj)
|
||||
{
|
||||
using (var transaction = session.BeginTransaction())
|
||||
{
|
||||
session.SaveOrUpdate(obj);
|
||||
try { transaction.Commit(); }
|
||||
catch { }
|
||||
}
|
||||
}
|
||||
|
||||
public static void DeleteFromDb(Database database, object obj)
|
||||
{
|
||||
ISession session = FluentCommon.CreateSession(database);
|
||||
SaveToDb(session, obj);
|
||||
}
|
||||
|
||||
public static void DeleteFromDb(ISession session, object obj)
|
||||
{
|
||||
using (var transaction = session.BeginTransaction())
|
||||
{
|
||||
session.Delete(obj);
|
||||
transaction.Commit();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create an empty users database.
|
||||
/// Database contains only the user 'admin' and the control board component 'CB'.
|
||||
/// </summary>
|
||||
/// <param name="dbType">DBType.SQLite or DBType.MySql</param>
|
||||
/// <param name="connectionString">Connection string</param>
|
||||
/// <returns>true=success, false=error</returns>
|
||||
public static bool CreateEmptyUsersDB(DBSettings dbSettings)
|
||||
{
|
||||
ISessionFactory sessionFactory = CreateSessionFactory(Database.Users, dbSettings, true);
|
||||
if (sessionFactory == null) return false;
|
||||
|
||||
/// Populate the database
|
||||
using (var session = sessionFactory.OpenSession())
|
||||
{
|
||||
using (var transaction = session.BeginTransaction())
|
||||
{
|
||||
///
|
||||
/// Prepare all groups
|
||||
///
|
||||
var testers = new Entities.Group { Gid = (int)TBF.Grp.GID.Testers, Name = Strings.Tester };
|
||||
var testingSpecialists = new Entities.Group { Gid = (int)TBF.Grp.GID.TestingSpecialists, Name = Strings.Testing_Specialist };
|
||||
var headOfLab = new Entities.Group { Gid = (int)TBF.Grp.GID.HeadOfLab, Name = Strings.Head_of_Lab };
|
||||
var maintenanceSpecialists = new Entities.Group { Gid = (int)TBF.Grp.GID.MaintenanceSpecialists, Name = Strings.Maintenance_Specialist };
|
||||
var metrologists = new Entities.Group { Gid = (int)TBF.Grp.GID.Metrologists, Name = Strings.Metrologist };
|
||||
var calibrationSpecialists = new Entities.Group { Gid = (int)TBF.Grp.GID.CalibrationSpecialists, Name = Strings.Calibration_Specialist };
|
||||
var administrators = new Entities.Group { Gid = (int)TBF.Grp.GID.Administrators, Name = Strings.Administrator };
|
||||
|
||||
/// Create the user 'admin' add his groups
|
||||
var admin = new Entities.User
|
||||
{
|
||||
Name = Program.AdminUsername,
|
||||
Description = "Administrator",
|
||||
LastPwChange = DateTime.Now
|
||||
};
|
||||
admin.SetPassword(Program.AdminPassword);
|
||||
admin.AddGroup(testers);
|
||||
admin.AddGroup(testingSpecialists);
|
||||
admin.AddGroup(headOfLab);
|
||||
admin.AddGroup(maintenanceSpecialists);
|
||||
admin.AddGroup(metrologists);
|
||||
admin.AddGroup(calibrationSpecialists);
|
||||
admin.AddGroup(administrators);
|
||||
|
||||
session.SaveOrUpdate(admin);
|
||||
|
||||
/// Create the control board component
|
||||
var cmpnt = (new BenchControl.Elde.ControlBoardCfg(new BenchControl.Elde.ControlBoardFactory())).CreateDbEntity();
|
||||
session.SaveOrUpdate(cmpnt);
|
||||
|
||||
transaction.Commit();
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create an empty bench database
|
||||
/// </summary>
|
||||
/// <param name="dbType">DBType.SQLite or DBType.MySql</param>
|
||||
/// <param name="connectionString">Connection string</param>
|
||||
/// <returns>true=success, false=error</returns>
|
||||
public static bool CreateEmptyBenchDB(DBSettings dbSettings)
|
||||
{
|
||||
ISessionFactory sessionFactory = CreateSessionFactory(Database.Users, dbSettings, true);
|
||||
if (sessionFactory == null) return false;
|
||||
|
||||
/// Populate the database
|
||||
//using (var session = sessionFactory.OpenSession())
|
||||
//{
|
||||
// using (var transaction = session.BeginTransaction())
|
||||
// {
|
||||
// /// Create one component
|
||||
// var cmpnt = (new BenchControl.Elde.ControlBoardCfg("CB", 1)).CreateDbEntity();
|
||||
// session.SaveOrUpdate(cmpnt);
|
||||
// transaction.Commit();
|
||||
// }
|
||||
//}
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create an empty procedures database
|
||||
/// </summary>
|
||||
/// <param name="dbType">DBType.SQLite or DBType.MySql</param>
|
||||
/// <param name="connectionString">Connection string</param>
|
||||
/// <returns>true=success, false=error</returns>
|
||||
public static bool CreateEmptyProceduresDB(DBSettings dbSettings)
|
||||
{
|
||||
ISessionFactory sessionFactory = CreateSessionFactory(Database.Users, dbSettings, true);
|
||||
if (sessionFactory == null) return false;
|
||||
|
||||
/// Populate the database
|
||||
//using (var session = sessionFactory.OpenSession())
|
||||
//{
|
||||
// using (var transaction = session.BeginTransaction())
|
||||
// {
|
||||
// /// Create one component
|
||||
// var cmpnt = (new BenchControl.Elde.ControlBoardCfg("CB", 1)).CreateDbEntity();
|
||||
// session.SaveOrUpdate(cmpnt);
|
||||
// transaction.Commit();
|
||||
// }
|
||||
//}
|
||||
return true;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Create an empty water meters database
|
||||
/// </summary>
|
||||
/// <param name="dbType">DBType.SQLite or DBType.MySql</param>
|
||||
/// <param name="connectionString">Connection string</param>
|
||||
/// <returns>true=success, false=error</returns>
|
||||
public static bool CreateEmptyWaterMetersDB(DBSettings dbSettings)
|
||||
{
|
||||
ISessionFactory sessionFactory = CreateSessionFactory(Database.Users, dbSettings, true);
|
||||
if (sessionFactory == null) return false;
|
||||
|
||||
/// Populate the database
|
||||
//using (var session = sessionFactory.OpenSession())
|
||||
//{
|
||||
// using (var transaction = session.BeginTransaction())
|
||||
// {
|
||||
// /// Create one component
|
||||
// var cmpnt = (new BenchControl.Elde.ControlBoardCfg("CB", 1)).CreateDbEntity();
|
||||
// session.SaveOrUpdate(cmpnt);
|
||||
// transaction.Commit();
|
||||
// }
|
||||
//}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -37,10 +37,10 @@ namespace ResultsBrowser
|
||||
/// Names and database settings of test benches.
|
||||
/// </summary>
|
||||
[XmlArrayAttribute("TestBenches")]
|
||||
public DatabaseSettings[] testBenches;
|
||||
public Config.DatabaseSettings[] testBenches;
|
||||
|
||||
[XmlIgnore]
|
||||
public DatabaseSettings[] TestBenches { get { return testBenches; } }
|
||||
public Config.DatabaseSettings[] TestBenches { get { return testBenches; } }
|
||||
|
||||
[XmlIgnore]
|
||||
public int BenchesCount { get { return (testBenches != null) ? testBenches.GetLength(0) : 0; } }
|
||||
@ -130,8 +130,8 @@ namespace ResultsBrowser
|
||||
public int OneProcedureDlgHeight;
|
||||
|
||||
/// Configuration of results
|
||||
public Forms.ResultsConfig.Meters ResultsConfigMeters;
|
||||
public Forms.ResultsConfig.TestsAre ResultsConfigTests;
|
||||
public Config.Entities.MetersArrangement ResultsConfigMeters;
|
||||
public Config.Entities.TestsArrangement ResultsConfigTests;
|
||||
public string[] RsltItems_Screen_SingleWM;
|
||||
public string[] RsltItems_Screen_CombinedWM;
|
||||
public string[] RsltItems_Printer_SingleWM;
|
||||
|
||||
@ -1,27 +0,0 @@
|
||||
using FluentNHibernate.Mapping;
|
||||
using ResultsBrowser.Entities;
|
||||
|
||||
namespace ResultsBrowser.Mappings
|
||||
{
|
||||
class BenchPathMap : ClassMap<BenchPath>
|
||||
{
|
||||
public BenchPathMap()
|
||||
{
|
||||
Id(x => x.Id);
|
||||
Map(x => x.ItemNr);
|
||||
Map(x => x.Name);
|
||||
Map(x => x.Qfrom);
|
||||
Map(x => x.Qto);
|
||||
Map(x => x.TempIn);
|
||||
Map(x => x.TempOut);
|
||||
Map(x => x.PressIn);
|
||||
Map(x => x.PressOut);
|
||||
Map(x => x.ValvesOpen)
|
||||
.CustomType("StringClob")
|
||||
.CustomSqlType("varchar(8000)");
|
||||
Map(x => x.ValvesClose)
|
||||
.CustomType("StringClob")
|
||||
.CustomSqlType("varchar(8000)");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,25 +0,0 @@
|
||||
using FluentNHibernate.Mapping;
|
||||
using ResultsBrowser.Entities;
|
||||
|
||||
namespace ResultsBrowser.Mappings
|
||||
{
|
||||
class ComponentMap : ClassMap<Component>
|
||||
{
|
||||
public ComponentMap()
|
||||
{
|
||||
Id(x => x.Id);
|
||||
Map(x => x.Name);
|
||||
Map(x => x.ClassName);
|
||||
Map(x => x.ParentName);
|
||||
Map(x => x.ItemNr);
|
||||
Map(x => x.Mode);
|
||||
Map(x => x.Logging);
|
||||
Map(x => x.Parameters)
|
||||
.CustomType("StringClob")
|
||||
.CustomSqlType("varchar(8000)");
|
||||
HasMany(x => x.Corrections)
|
||||
.OrderBy("Measurement")
|
||||
.Cascade.All();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,19 +0,0 @@
|
||||
using FluentNHibernate.Mapping;
|
||||
using ResultsBrowser.Entities;
|
||||
|
||||
namespace ResultsBrowser.Mappings
|
||||
{
|
||||
class ComponentProcedureMap : ClassMap<ComponentProcedure>
|
||||
{
|
||||
public ComponentProcedureMap()
|
||||
{
|
||||
Id(x => x.Id);
|
||||
Map(x => x.CmpntName);
|
||||
Map(x => x.Parameters)
|
||||
.CustomType("StringClob")
|
||||
.CustomSqlType("varchar(8000)");
|
||||
|
||||
References(x => x.Procedure);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,19 +0,0 @@
|
||||
using FluentNHibernate.Mapping;
|
||||
using ResultsBrowser.Entities;
|
||||
|
||||
namespace ResultsBrowser.Mappings
|
||||
{
|
||||
class ComponentTestMap : ClassMap<ComponentTest>
|
||||
{
|
||||
public ComponentTestMap()
|
||||
{
|
||||
Id(x => x.Id);
|
||||
Map(x => x.CmpntName);
|
||||
Map(x => x.Parameters)
|
||||
.CustomType("StringClob")
|
||||
.CustomSqlType("varchar(8000)");
|
||||
|
||||
References(x => x.Test);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,24 +0,0 @@
|
||||
using FluentNHibernate.Mapping;
|
||||
using ResultsBrowser.Entities;
|
||||
|
||||
namespace ResultsBrowser.Mappings
|
||||
{
|
||||
class FeedingPathMap : ClassMap<FeedingPath>
|
||||
{
|
||||
public FeedingPathMap()
|
||||
{
|
||||
Id(x => x.Id);
|
||||
Map(x => x.ItemNr);
|
||||
Map(x => x.Name);
|
||||
Map(x => x.Qfrom);
|
||||
Map(x => x.Qto);
|
||||
Map(x => x.Pump);
|
||||
Map(x => x.ValvesOpen)
|
||||
.CustomType("StringClob")
|
||||
.CustomSqlType("varchar(8000)");
|
||||
Map(x => x.ValvesClose)
|
||||
.CustomType("StringClob")
|
||||
.CustomSqlType("varchar(8000)");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,14 +0,0 @@
|
||||
using FluentNHibernate.Mapping;
|
||||
|
||||
namespace ResultsBrowser.Mappings
|
||||
{
|
||||
class GroupMap : ClassMap<Entities.Group>
|
||||
{
|
||||
public GroupMap()
|
||||
{
|
||||
Id(x => x.Id);
|
||||
Map(x => x.Gid);
|
||||
Map(x => x.Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,15 +0,0 @@
|
||||
using FluentNHibernate.Mapping;
|
||||
using ResultsBrowser.Entities;
|
||||
|
||||
namespace ResultsBrowser.Mappings
|
||||
{
|
||||
class MeasurementCorrectionMap : ClassMap<MeasurementCorrection>
|
||||
{
|
||||
public MeasurementCorrectionMap()
|
||||
{
|
||||
Id(x => x.Id);
|
||||
Map(x => x.Measurement);
|
||||
Map(x => x.Correction);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,39 +0,0 @@
|
||||
using FluentNHibernate.Mapping;
|
||||
using ResultsBrowser.Entities;
|
||||
|
||||
namespace ResultsBrowser.Mappings
|
||||
{
|
||||
class MetersPathMap : ClassMap<MetersPath>
|
||||
{
|
||||
public MetersPathMap()
|
||||
{
|
||||
Id(x => x.Id);
|
||||
Map(x => x.ItemNr);
|
||||
Map(x => x.Name);
|
||||
Map(x => x.Qfrom);
|
||||
Map(x => x.Qto);
|
||||
Map(x => x.Sensor1);
|
||||
#pragma warning disable
|
||||
if (Program.WMsCount >= 2) Map(x => x.Sensor2);
|
||||
if (Program.WMsCount >= 3) Map(x => x.Sensor3);
|
||||
if (Program.WMsCount >= 4) Map(x => x.Sensor4);
|
||||
if (Program.WMsCount >= 5) Map(x => x.Sensor5);
|
||||
if (Program.WMsCount >= 6) Map(x => x.Sensor6);
|
||||
if (Program.WMsCount >= 7) Map(x => x.Sensor7);
|
||||
if (Program.WMsCount >= 8) Map(x => x.Sensor8);
|
||||
if (Program.WMsCount >= 9) Map(x => x.Sensor9);
|
||||
if (Program.WMsCount >= 10) Map(x => x.Sensor10);
|
||||
if (Program.WMsCount >= 11) Map(x => x.Sensor11);
|
||||
if (Program.WMsCount >= 12) Map(x => x.Sensor12);
|
||||
if (Program.WMsCount >= 13) Map(x => x.Sensor13);
|
||||
if (Program.WMsCount >= 14) Map(x => x.Sensor14);
|
||||
if (Program.WMsCount >= 15) Map(x => x.Sensor15);
|
||||
if (Program.WMsCount >= 16) Map(x => x.Sensor16);
|
||||
if (Program.WMsCount >= 17) Map(x => x.Sensor17);
|
||||
if (Program.WMsCount >= 18) Map(x => x.Sensor18);
|
||||
if (Program.WMsCount >= 19) Map(x => x.Sensor19);
|
||||
if (Program.WMsCount >= 20) Map(x => x.Sensor20);
|
||||
#pragma warning restore
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,31 +0,0 @@
|
||||
using FluentNHibernate.Mapping;
|
||||
using ResultsBrowser.Entities;
|
||||
|
||||
namespace ResultsBrowser.Mappings
|
||||
{
|
||||
class OutputPathMap : ClassMap<OutputPath>
|
||||
{
|
||||
public OutputPathMap()
|
||||
{
|
||||
Id(x => x.Id);
|
||||
Map(x => x.ItemNr);
|
||||
Map(x => x.Name);
|
||||
Map(x => x.Qfrom);
|
||||
Map(x => x.Qto);
|
||||
Map(x => x.RegulValve);
|
||||
Map(x => x.FlowMeter);
|
||||
Map(x => x.PidCoef);
|
||||
Map(x => x.StartValve);
|
||||
Map(x => x.Diverter);
|
||||
Map(x => x.TempDiv);
|
||||
Map(x => x.Balance);
|
||||
Map(x => x.EmptyTankValve);
|
||||
Map(x => x.ValvesOpen)
|
||||
.CustomType("StringClob")
|
||||
.CustomSqlType("varchar(8000)");
|
||||
Map(x => x.ValvesClose)
|
||||
.CustomType("StringClob")
|
||||
.CustomSqlType("varchar(8000)");
|
||||
}
|
||||
}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user