Compare commits

..
Author SHA1 Message Date
Milan Hanajik 3447a3b306 Reconfigured for MURES PT40 2015-10-04 22:42:44 +02:00
514 changed files with 19653 additions and 34132 deletions
+4 -10
View File
@@ -1,13 +1,7 @@
Config/bin/
Config/obj/
Results/bin/
Results/obj/
ResultsBrowser/bin/
ResultsBrowser/obj/
TestBenchFramework/bin/
TestBenchFramework/obj/
TBFSetup/Debug/
TBFSetup/Release/
ResultsBrowser/bin/
ResultsBrowser/obj/
TBFSetup/
Doc/
*.suo
*.bak
*.suo
-133
View File
@@ -1,133 +0,0 @@
<?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;IPERLST</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;IPERLST</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="log4net">
<HintPath>..\packages\log4net.2.0.2\lib\net40-full\log4net.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.Data.SQLite">
<HintPath>..\packages\System.Data.SQLite.1.0.90.0\lib\net40\System.Data.SQLite.dll</HintPath>
</Reference>
<Reference Include="System.Data.SQLite.Linq">
<HintPath>..\packages\System.Data.SQLite.1.0.90.0\lib\net40\System.Data.SQLite.Linq.dll</HintPath>
</Reference>
<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="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" />
<Compile Include="ResultItemSpec.cs" />
</ItemGroup>
<ItemGroup>
<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>
-42
View File
@@ -1,42 +0,0 @@
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;
}
}
-47
View File
@@ -1,47 +0,0 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using System;
using System.Text;
using System.Xml.Serialization;
namespace Config
{
/// <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 ProceduresDBSettings; /// Config database settings
public DBSettings WaterMetersDBSettings; /// Results database settings
// Constructor
public DatabaseSettings()
{
BenchName = String.Empty; /// Empty string to avoid null
IsRealBench = false;
ProceduresDBSettings = new DBSettings(Entities.DBType.MySql, "SERVER=localhost; DATABASE=tbf_procedures; UID=root; PASSWORD=;");
WaterMetersDBSettings = new DBSettings(Entities.DBType.MySql, "SERVER=localhost; DATABASE=tbf_watermeters; UID=root; PASSWORD=;");
}
public object Clone()
{
DatabaseSettings result = new DatabaseSettings();
result.BenchName = BenchName;
result.IsRealBench = IsRealBench;
result.ProceduresDBSettings = (DBSettings)ProceduresDBSettings.Clone();
result.WaterMetersDBSettings = (DBSettings)WaterMetersDBSettings.Clone();
return result;
}
public override string ToString()
{
return string.Format("{0} conn.str.={1}", BenchName, ProceduresDBSettings.ConnectionString);
}
}
}
-290
View File
@@ -1,290 +0,0 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.Reflection;
namespace Config.Entities
{
/// <summary>
/// Helper class to assign descriptions to enum values
/// </summary>
public class Description : Attribute
{
public string Text;
public Description(string t)
{
Text = t;
}
}
public static class GetDescription
{
/// Extension method for enum-s
public static string ToDescription(this Enum en)
{
Type type = en.GetType();
MemberInfo[] memInfo = type.GetMember(en.ToString());
if (memInfo != null && memInfo.Length > 0)
{
object[] attrs = memInfo[0].GetCustomAttributes(typeof(Description), false);
if (attrs != null && attrs.Length > 0)
return ((Description)attrs[0]).Text;
}
return en.ToString(); /// Return ToString() value in case there is no description
}
}
/// <summary> Identifies the type of a database </summary>
public enum DBType
{
MySql, /// MySQL database
SQLite, /// SQLite
DbTypesCount,
}
/// <summary> Identifies the database based on the content </summary>
public enum DBKind
{
Config,
Results,
Count,
}
public enum ProcedureState
{
Active,
History,
Template,
Count,
}
/// <summary> Kind of meters for the procedure / test </summary>
public enum MetersKind
{
Single,
Combined,
HeatMeter,
}
public enum CompoundMeterId : byte
{
Single,
CompoundMain,
CompoundAux,
Compound,
}
public enum Medium
{
[Description("")] NotSpecified,
ColdWater,
HotWater,
Count
}
public enum Mounting
{
[Description("")] NotSpecified,
[Description("H")] H, /// horizontal
[Description("V")] V, /// vertical
[Description("S")] S, /// steig
[Description("F")] F, /// fall
Count
}
public enum TemperatureClass
{
[Description("")] NotSpecified,
[Description("T30")] T30,
[Description("T50")] T50,
[Description("T70")] T70,
[Description("T90")] T90,
[Description("T130")] T130,
[Description("T180")] T180,
[Description("T30/70")] T30_70,
[Description("T30/90")] T30_90,
[Description("T30/130")] T30_130,
[Description("T30/180")] T30_180,
[Description("30")] t30,
[Description("50")] t50,
[Description("70")] t70,
[Description("90")] t90,
[Description("130")] t130,
[Description("180")] t180,
Count
}
public enum FlowProfileSensitivityClass
{
[Description("")] NotSpecified,
[Description("U0")] U0, /// ?
[Description("D0")] D0, /// ?
Count
}
public enum PressureLossClass
{
[Description("")] NotSpecified,
[Description("dp63")] dp63, /// 0.063 MPa = 0.63 bar, TODO: Change to "Δp63"
[Description("dp40")] dp40, /// 0.040 MPa = 0.40 bar
[Description("dp25")] dp25, /// 0.025 MPa = 0.25 bar
[Description("dp16")] dp16, /// 0.016 MPa = 0.16 bar
[Description("dp10")] dp10, /// 0.010 MPa = 0.10 bar
Count
}
/// <summary> Maximum Admissible Pressure </summary>
public enum MaxAdmissiblePressure
{
[Description("")] NotSpecified,
[Description("MAP6")] MAP6,
[Description("MAP10")] MAP10,
[Description("MAP16")] MAP16,
[Description("MAP25")] MAP25,
[Description("MAP40")] MAP40,
Count
}
/// <summary> Transition step is finished when this condition is fulfilled </summary>
public enum StepCondition
{
None,
Scale1Empty,
Scale2Empty,
Scale3Empty,
AllScalesEmpty,
Count
}
public enum Publish : sbyte
{
#if MUNICH
/// nemecky
[Description("nie")] Never = 0,
[Description("immer")] Always = 1,
[Description("Bildschirm")] OnScreen = 2,
[Description("intern")] Internal = 3,
#elif CEVAK || BADGER_MALA_TRAT || BADGER_VELKA_TRAT
/// cesky
[Description("nikdy")] Never = 0,
[Description("vždy")] Always = 1,
[Description("na obrazovku")] OnScreen = 2,
[Description("interně")] Internal = 3,
#elif IPERLST || IPERLST_SPECIAL || SLM_50
/// slovensky
[Description("nikdy")] Never = 0,
[Description("vždy")] Always = 1,
[Description("na obrazovku")] OnScreen = 2,
[Description("interne")] Internal = 3,
#else
[Description("Never")] Never = 0,
[Description("Always")] Always = 1,
[Description("On screen")] OnScreen = 2,
[Description("Internal")] Internal = 3,
#endif
Count
}
public enum TestRedType
{
Fix,
/// etc.
Count,
}
public enum FQC1
{
FQC1,
FQP1,
Count,
}
public enum Progress
{
JustStarted,
TransitionBefore,
SwitchingFlowDetection,
FlowSetting,
Test,
TransitionAfter,
Completed,
Count,
}
public enum Device
{
Screen,
Printer,
Disk,
}
public enum PageOrientation
{
Portrait,
Landscape,
Count,
}
public enum UnitsVolume
{
Liter,
CubicMtr,
}
/// <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
FailureDuringOperation, /// Failure during operation -> disabled
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,
}
/// <summary> Arrangement of tests </summary>
public enum TestsArrangement
{
Rows,
Columns,
}
/// <summary> Arrangement of meters </summary>
public enum MetersArrangement
{
Vertically,
Horizontally,
}
public enum Alignment
{
Left,
Center,
Right,
Justified,
Count
}
}
-234
View File
@@ -1,234 +0,0 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using System;
using System.Windows.Forms;
using FluentNHibernate.Cfg;
using FluentNHibernate.Cfg.Db;
using NHibernate;
using NHibernate.Cfg;
using NHibernate.Tool.hbm2ddl;
using Config.Resources;
namespace Config
{
public static class FluentCommon
{
/// <summary>
/// Session factories for regular sessions.
/// </summary>
public static ISessionFactory[] SessionFactories = new ISessionFactory[(int)Entities.DBKind.Count];
/// <summary>
/// NHibernate session factory (to create the database session 'SessionFactory')
/// </summary>
/// <returns>A database session</returns>
static ISessionFactory CreateSessionFactory(Entities.DBKind database)
{
Entities.DBType dbType;
string connectionString;
switch (database)
{
default:
case Entities.DBKind.Config:
dbType = Data.CurrentBench.ProceduresDBSettings.DbType;
connectionString = Data.CurrentBench.ProceduresDBSettings.ConnectionString;
break;
case Entities.DBKind.Results:
dbType = Data.CurrentBench.WaterMetersDBSettings.DbType;
connectionString = Data.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(Entities.DBKind database, DBSettings dbSettings, bool createDB)
{
try
{
FluentConfiguration cfg = Fluently.Configure();
switch (dbSettings.DbType)
{
default:
case Entities.DBType.SQLite:
cfg = cfg.Database(SQLiteConfiguration.Standard.UsingFile(dbSettings.ConnectionString));
break;
case Entities.DBType.MySql:
cfg = cfg.Database(MySQLConfiguration.Standard.ConnectionString(dbSettings.ConnectionString));
break;
}
switch (database)
{
default:
case Entities.DBKind.Config:
cfg = cfg.Mappings(m => m.FluentMappings.AddFromAssemblyOf<Data>());
break;
case Entities.DBKind.Results:
cfg = cfg.Mappings(m => m.FluentMappings.AddFromAssemblyOf<Data>());
break;
}
if (createDB)
{
return cfg.ExposeConfiguration(BuildSchemaCreate).BuildSessionFactory();
}
else
{
return cfg.ExposeConfiguration(BuildSchema).BuildSessionFactory();
}
}
catch (Exception exc)
{
MessageBox.Show(string.Format("Cannot open database.\r\nReason:\r\n{0}", exc.Message),
"Error", MessageBoxButtons.OK, MessageBoxIcon.Error);
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(Entities.DBKind database)
{
int ix = (int)database;
if (ix < 0 || ix >= (int)Entities.DBKind.Count) return null;
if (SessionFactories[ix] == null) SessionFactories[ix] = CreateSessionFactory(database);
return SessionFactories[ix].OpenSession();
}
public static void SaveToDb(Entities.DBKind database, object obj)
{
SaveToDb(CreateSession(database), 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(Entities.DBKind database, object obj)
{
DeleteFromDb(CreateSession(database), 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 CreateEmptyConfigDB(DBSettings dbSettings)
{
ISessionFactory sessionFactory = CreateSessionFactory(Entities.DBKind.Config, 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)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 = Data.AdminUsername,
Description = "Administrator",
LastPwChange = DateTime.Now
};
admin.SetPassword(Data.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 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 CreateEmptyResultsDB(DBSettings dbSettings)
{
ISessionFactory sessionFactory = CreateSessionFactory(Entities.DBKind.Results, 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;
}
}
}
-64
View File
@@ -1,64 +0,0 @@
///
/// 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
}
}
}
-36
View File
@@ -1,36 +0,0 @@
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("Sensus")]
[assembly: AssemblyProduct("Config")]
[assembly: AssemblyCopyright("Copyright © 2013 - 2016 Sensus Slovensko a.s.")]
[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("2.9.329.0")]
[assembly: AssemblyFileVersion("2.9.329.0")]
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-1
View File
@@ -1 +0,0 @@
Test StartTime: when? Start of flow set or start of real test?
-186
View File
@@ -1,186 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Results.Entities;
namespace Results
{
public class BatchResults
{
public readonly int WMPositionsCount;
public IList<Entities.TestData> TestDataList;
public IList<Entities.Components> ComponentsList;
public IList<Entities.WaterMeterData> WaterMeterDataList;
private BatchResults(int wmPositionsCount)
{
WMPositionsCount = wmPositionsCount;
TestDataList = new List<Entities.TestData>();
ComponentsList = new List<Entities.Components>();
WaterMeterDataList = new List<Entities.WaterMeterData>();
}
public Batch Batch;
public WaterMeter[] WaterMeters;
public static BatchResults NewFromProcedure(int batchNr, int benchId, string user, string programVer,
Config.Entities.Procedure procedure,
WaterMeterData[] waterMeterDatas, int[] waterMeterParts)
{
BatchResults d = new BatchResults(waterMeterDatas.Length);
int year = DateTime.Now.Year;
/// Create new batch
d.Batch = new Batch()
{
TestBenchId = benchId,
BatchNr = batchNr,
ProgramVersion = programVer,
UserName = user,
ProcedureName = procedure.Name,
ProcedureDescription = procedure.Description,
WatermetersStr = procedure.Watermeters,
ProcedureRevision = procedure.Revision,
ProtocolTitle = procedure.ProtocolTitle,
StartTime = DateTime.Now,
Compound = (procedure.MetersKind == Config.Entities.MetersKind.Combined),
#if HEAT_METERS_SUPPORT
HeatMeter = (procedure.MetersKind == Config.Entities.MetersKind.HeatMeter),
#endif
};
///
/// Add watermeter to an array, array index is WM position.
/// AddWaterMetersToBatch() has to be used before saving results.
///
d.WaterMeters = new WaterMeter[d.WMPositionsCount];
for (int i = 0; i < d.WMPositionsCount; i++)
{
if (waterMeterDatas[i] == null) continue;
WaterMeterData wmd = WaterMeterData.UpdateList(d.WaterMeterDataList, waterMeterDatas[i]);
d.WaterMeters[i] = new WaterMeter()
{
Batch = d.Batch,
WaterMeterData = wmd,
WMPosition = i + 1,
YearOfProduction = year,
};
}
foreach (var t in procedure.Tests)
{
if (t.Publish != (byte)Config.Entities.Publish.Never)
{
TestData td = TestData.UpdateList(d.TestDataList, new TestData(t));
for (int rnr = 1; rnr <= t.Repeats; rnr++)
{
/// Create an empty test result and add it to the list
TestRslt tr = new TestRslt(d.Batch, td, t.Part, rnr);
d.Batch.TestRslts.Add(tr);
for (int i = 0; i < d.WMPositionsCount; i++)
{
if (d.WaterMeters[i] == null) continue;
if (t.Part != 0 && waterMeterParts[i] != 0 && t.Part != waterMeterParts[i]) continue;
/// Create empty watermeter test results and add them to the list and to dictionaries
if (!d.Batch.Compound)
{
MeterTestRslt mtr = new MeterTestRslt(d.WaterMeters[i], tr, Config.Entities.CompoundMeterId.Single);
d.WaterMeters[i].MeterTestRslts.Add(mtr);
}
else
{
MeterTestRslt mainMTR = new MeterTestRslt(d.WaterMeters[i], tr, Config.Entities.CompoundMeterId.CompoundMain);
d.WaterMeters[i].MeterTestRslts.Add(mainMTR);
MeterTestRslt auxMTR = new MeterTestRslt(d.WaterMeters[i], tr, Config.Entities.CompoundMeterId.CompoundAux);
d.WaterMeters[i].MeterTestRslts.Add(auxMTR);
MeterTestRslt cmpdMTR = new MeterTestRslt(d.WaterMeters[i], tr, Config.Entities.CompoundMeterId.Compound);
d.WaterMeters[i].MeterTestRslts.Add(cmpdMTR);
}
}
}
}
}
return d;
}
public static BatchResults FromBatch(Batch batch)
{
int wmCount = batch.WaterMeters.Count;
if (wmCount == 0) return null;
BatchResults batchResults = new BatchResults(wmCount);
batchResults.Batch = batch;
batchResults.WaterMeters = new WaterMeter[wmCount];
for (int i = 0; i < wmCount; i++) batchResults.WaterMeters[i] = batch.WaterMeters[i];
return batchResults;
}
public TestRslt GetTestRslt(string name, int part)
{
return Batch.GetTestRslt(name, part);
}
public MeterTestRslt GetMeterTestRslt(string name, int wmnr0, Config.Entities.CompoundMeterId meterId)
{
if (WaterMeters[wmnr0] != null)
{
return WaterMeters[wmnr0].GetMeterTestRslt(name, meterId);
}
return null;
}
/// <summary>
/// Returns true when all tests were done
/// </summary>
/// <returns>true = all tests done</returns>
public bool AllTestsDone()
{
for (int i = 0; i < WMPositionsCount; i++)
{
if (WaterMeters[i] != null)
{
foreach (var mtr in WaterMeters[i].MeterTestRslts)
{
if (!mtr.TestDone) return false;
}
}
}
return true;
}
/// <summary>
/// Adds non-null water meters from an array to a Batch water meters list.
/// This method should be used when results are prepared and
/// all disabled water meters are deleted.
/// </summary>
public void AddWaterMetersToBatch()
{
for (int i = 0; i < WMPositionsCount; i++)
{
if (WaterMeters[i] != null)
{
WaterMeters[i].Passed = WaterMeters[i].PassedFromTests();
if (!WaterMeters[i].Disabled)
{
Batch.WaterMeters.Add(WaterMeters[i]);
}
}
}
}
}
}
-257
View File
@@ -1,257 +0,0 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using FluentNHibernate.Cfg;
using FluentNHibernate.Cfg.Db;
using log4net;
using NHibernate;
using NHibernate.Cfg;
using NHibernate.Tool.hbm2ddl;
using Results.Entities;
namespace Results
{
public static class DB
{
static readonly ILog log = LogManager.GetLogger(typeof(DB));
/// <summary> Session factory for all regular sessions, not for CreateEmptyResultsDB(). </summary>
public static ISessionFactory SessionFactory;
/// <summary> Connection string for all sessions </summary>
private static string connectionString;
///
public static string ConnectionString
{
get { return connectionString; }
set { connectionString = value; SessionFactory = null; }
}
/// <summary> Database type (MySQL or SQLite) for all sessions </summary>
private static Config.Entities.DBType dbType;
///
public static Config.Entities.DBType DbType
{
get { return dbType; }
set { dbType = value; SessionFactory = null; }
}
/// <summary>
/// NHibernate session factory (to create the database session 'SessionFactory')
/// </summary>
/// <returns>A database session</returns>
static ISessionFactory CreateSessionFactory()
{
return CreateSessionFactory(false);
}
/// <summary>
/// NHibernate session factory (to create the database session 'SessionFactory')
/// </summary>
/// <param name="createDB">true = Create a new DB, false = Regular DB</param>
/// <returns>A database session</returns>
public static ISessionFactory CreateSessionFactory(bool createDB)
{
FluentConfiguration cfg = Fluently.Configure();
switch (dbType)
{
default:
case Config.Entities.DBType.SQLite:
cfg = cfg.Database(SQLiteConfiguration.Standard.UsingFile(connectionString));
break;
case Config.Entities.DBType.MySql:
cfg = cfg.Database(MySQLConfiguration.Standard.ConnectionString(connectionString));
break;
}
cfg = cfg.Mappings(m => m.FluentMappings.AddFromAssemblyOf<Entities.WaterMeterData>());
if (createDB)
{
return cfg.ExposeConfiguration(BuildSchemaCreate).BuildSessionFactory();
}
else
{
return cfg.ExposeConfiguration(BuildSchema).BuildSessionFactory();
}
}
static void BuildSchema(Configuration config)
{
/// This NHibernate tool takes a configuration with mapping info and exports a database schema
new SchemaExport(config).SetOutputFile("db_schema");
}
static void BuildSchemaCreate(Configuration config)
{
/// This NHibernate tool takes a configuration with mapping info and exports a database schema
new SchemaExport(config).Create(true, true);
}
/// Create a NHibernate session for the given database
public static ISession CreateSession()
{
if (string.IsNullOrEmpty(connectionString))
{
throw new Exception("Connection string was not specified");
}
if (SessionFactory == null) SessionFactory = CreateSessionFactory();
return SessionFactory.OpenSession();
}
public static void SaveObject(object obj)
{
SaveObject(CreateSession(), obj);
}
///
public static void SaveObject(ISession session, object obj)
{
using (var transaction = session.BeginTransaction())
{
session.SaveOrUpdate(obj);
try { transaction.Commit(); }
catch { }
}
}
public static void DeleteObject(object obj)
{
DeleteObject(CreateSession(), obj);
}
///
public static void DeleteObject(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 CreateEmptyDB()
{
ISessionFactory sessionFactory = CreateSessionFactory(true);
if (sessionFactory == null) return false;
/// Populate the database
using (var session = sessionFactory.OpenSession())
{
using (var transaction = session.BeginTransaction())
{
transaction.Commit();
}
}
return true;
}
/// <summary>
/// Shared data
/// </summary>
public static IList<Entities.TestData> TestDataList;
public static IList<Entities.Components> ComponentsList;
public static IList<Entities.WaterMeterData> WaterMeterDataList;
/// <summary>
/// Loads shared data from the database
/// </summary>
/// <exception>Throws NHibernate exceptions</exception>
public static void LoadSharedData()
{
ISession session = DB.CreateSession();
TestDataList = session.CreateQuery("FROM TestData").List<Entities.TestData>();
ComponentsList = session.CreateQuery("FROM Components").List<Entities.Components>();
WaterMeterDataList = session.CreateQuery("FROM WaterMeterData").List<Entities.WaterMeterData>();
}
/// <summary>
/// Update TestData, Components and WaterMeterData fo tests and water meters in batch results
/// with existing data in static lists TestDataList, ComponentsList and WaterMeterDataList.
/// </summary>
/// <param name="batch">Batch results</param>
/// <returns>true when any data modiifed</returns>
public static bool UpdateBatchData(Entities.Batch batch)
{
ISession session = DB.CreateSession();
if (session == null) return false;
foreach (var tr in batch.TestRslts)
{
/// Search in TestDataList and update test data in the new batch
TestData td = TestData.UpdateList(TestDataList, tr.TestData);
tr.TestData = td;
/// Search in ComponentsList and update components in the new batch
Components cd = Components.UpdateList(ComponentsList, tr.Components);
tr.Components = cd;
}
foreach (var wm in batch.WaterMeters)
{
/// Search in WaterMeterDataList and update water meter data in the new batch
WaterMeterData wmd = WaterMeterData.UpdateList(WaterMeterDataList, wm.WaterMeterData);
wm.WaterMeterData = wmd;
}
return true; /// TODO: Really check for modifications
}
public static bool SaveNewBatch(Entities.Batch batch)
{
ISession session = DB.CreateSession();
if (session == null) return false;
TestDataList = session.CreateQuery("FROM TestData").List<Entities.TestData>();
ComponentsList = session.CreateQuery("FROM Components").List<Entities.Components>();
WaterMeterDataList = session.CreateQuery("FROM WaterMeterData").List<Entities.WaterMeterData>();
UpdateBatchData(batch);
ITransaction transaction = session.BeginTransaction();
if (transaction == null) return false;
try
{
foreach (var td in TestDataList) if (td.Id == 0) session.SaveOrUpdate(td);
foreach (var cd in ComponentsList) if (cd.Id == 0) session.SaveOrUpdate(cd);
foreach (var wd in WaterMeterDataList) if (wd.Id == 0) session.SaveOrUpdate(wd);
session.SaveOrUpdate(batch);
transaction.Commit();
}
catch (Exception exc)
{
transaction.Rollback();
log.FatalFormat("Saving results of batch #{0} into the results DB failed: {1}", batch.BatchNr, exc.Message);
return false;
}
session.Flush();
return true;
}
}
}
-83
View File
@@ -1,83 +0,0 @@
///
/// Copyright (c) 2015-2016 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
namespace Results.Entities
{
public class Batch
{
public virtual int Id { get; protected set; }
public virtual int BatchNr { get; set; }
public virtual int TestBenchId { get; set; }
public virtual string ProgramVersion { get; set; }
public virtual string UserName { get; set; }
public virtual int UserNumber { get; set; }
public virtual string ProcedureName { get; set; }
public virtual string ProcedureDescription { get; set; } /// CEVAK, not mapped to DB
public virtual int ProcedureRevision { get; set; }
public virtual string WatermetersStr { get; set; } /// CEVAK, not mapped to DB
public virtual string ProtocolTitle { get; set; }
public virtual string Remark { get; set; }
public virtual float Custom1 { get; set; }
public virtual float Custom2 { get; set; }
public virtual float Custom3 { get; set; }
public virtual DateTime StartTime { get; set; }
public virtual DateTime EndTime { get; set; }
public virtual bool RsltsSent { get; set; }
public virtual bool RsltsPrinted { get; set; }
public virtual IList<TestData> Tests { get; set; }
public virtual IList<WaterMeter> WaterMeters { get; set; }
public virtual IList<TestRslt> TestRslts { get; set; }
public virtual bool Compound { get; set; } /// Not mapped to DB now
#if HEAT_METERS_SUPPORT
public virtual bool HeatMeter { get; set; } /// Not mapped to DB now
#endif
public Batch()
{
Tests = new List<TestData>();
WaterMeters = new List<WaterMeter>();
TestRslts = new List<TestRslt>();
}
public virtual float AmbientTempAve()
{
if (TestRslts.Count == 0) return 0;
float sum = 0;
foreach (var tr in TestRslts) sum += tr.AmbientTempAve;
return sum / TestRslts.Count;
}
public virtual float AmbientPressAve()
{
if (TestRslts.Count == 0) return 0;
float sum = 0;
foreach (var tr in TestRslts) sum += tr.AmbientPressAve;
return sum / TestRslts.Count;
}
public virtual float AmbientHumiAve()
{
if (TestRslts.Count == 0) return 0;
float sum = 0;
foreach (var tr in TestRslts) sum += tr.AmbientHumiAve;
return sum / TestRslts.Count;
}
public virtual TestRslt GetTestRslt(string name, int part)
{
foreach (var tr in TestRslts)
{
if (part == tr.Part && name.Equals(tr.Name())) return tr;
}
return null;
}
public override string ToString()
{
return string.Format("Batch #{0}, Start:{1}, End:{2}, Procedure:{3}", BatchNr, StartTime, EndTime, ProcedureName);
}
}
}
-94
View File
@@ -1,94 +0,0 @@
///
/// Copyright (c) 2016 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.Linq;
namespace Results.Entities
{
public class Components
{
public virtual int Id { get; protected set; }
public virtual int TestBenchId { get; set; }
public virtual string TestBenchName { get; set; }
public virtual string Pump { get; set; }
public virtual string RegValve { get; set; }
public virtual string Flowmeter { get; set; }
public virtual string Diverter { get; set; }
public virtual string Scale { get; set; }
public virtual string Custom1 { get; set; }
public virtual string Custom2 { get; set; }
public virtual string Custom3 { get; set; }
protected Components()
{
TestBenchId = 0;
TestBenchName = string.Empty;
Pump = string.Empty;
RegValve = string.Empty;
Flowmeter = string.Empty;
Diverter = string.Empty;
Scale = string.Empty;
Custom1 = string.Empty;
Custom2 = string.Empty;
Custom3 = string.Empty;
}
public Components(int benchId, string benchName, string pump, string flowmeter,
string scale, string regValve, string diverter)
{
TestBenchId = benchId;
TestBenchName = benchName;
Pump = pump;
RegValve = regValve;
Flowmeter = flowmeter;
Diverter = diverter;
Scale = scale;
Custom1 = string.Empty;
Custom2 = string.Empty;
Custom3 = string.Empty;
}
/// <summary>
/// Method to compare the content of two entities
/// </summary>
/// <param name="wmd">Second entity to compare with</param>
/// <returns>first = two entities are equal (except of Id)</returns>
public virtual bool Equals(Components bc)
{
if (TestBenchId != bc.TestBenchId) return false;
if (!TestBenchName.Equals(bc.TestBenchName)) return false;
if (!Pump.Equals(bc.Pump)) return false;
if (!RegValve.Equals(bc.RegValve)) return false;
if (!Flowmeter.Equals(bc.Flowmeter)) return false;
if (!Diverter.Equals(bc.Diverter)) return false;
if (!Scale.Equals(bc.Scale)) return false;
if (!Custom1.Equals(bc.Custom1)) return false;
if (!Custom2.Equals(bc.Custom2)) return false;
if (!Custom3.Equals(bc.Custom3)) return false;
return true;
}
/// <summary>
/// Adds an item to the list if it does not occur there
/// </summary>
/// <param name="list">List of items</param>
/// <param name="item">Item to add to the list or find there</param>
/// <returns>Item from the list (existing or added)</returns>
public static Components UpdateList(IList<Components> list, Components item)
{
if (item == null) return null; /// Null item is not stored in the list
Components found = list.FirstOrDefault<Components>(x => x.Equals(item));
if (found != null) return found; /// The same item found in the list, The found item returned
list.Add(item); /// Item not fund in the list, it is added to the list
return item;
}
}
}
-91
View File
@@ -1,91 +0,0 @@
///
/// Copyright (c) 2013-2016 Sensus Metering Systems
///
using System;
namespace Results.Entities
{
public class MeterTestRslt
{
public virtual int Id { get; protected set; }
public virtual byte CompoundMeterId { get; set; } /// 0=single, 1=compound/main, 2=compound/aux., 3=compound/overal
public virtual double PulsesMeter { get; set; } /// # of water meter pulses
public virtual double PulsesMaster { get; set; } /// # of reference flowmeter pulses (gated by this water meter pulses)
public virtual double PulsesPerLiter { get; set; } /// # of water meter pulses per one liter
public virtual double VolumeStart { get; set; } /// [l]
public virtual double VolumeEnd { get; set; } /// [l]
public virtual double VolumeMeter { get; set; } /// [l]
public virtual double VolumeRef { get; set; } /// [l]
public virtual double TimestampStart { get; set; } /// [s]
public virtual double TimestampEnd { get; set; } /// [s]
public virtual double TestTime { get; set; } /// [s]
public virtual double Error { get; set; } /// [%]
public virtual bool TestDone { get; set; } /// true = test was completed
public virtual bool Passed { get; set; } /// true = test passed, water meter is OK
public virtual WaterMeter WaterMeter { get; set; } /// reference to the WaterMeter entity
public virtual TestRslt TestRslt { get; set; } /// reference to the TestRslt entity
/// Wrappers
public virtual string Name() { return TestRslt.Name(); }
public virtual DateTime StartTime() { return TestRslt.StartTime; }
public virtual DateTime EndTime() { return TestRslt.EndTime; }
public virtual double FlowSetTime() { return TestRslt.FlowSetTime; } /// [s]
public virtual double FlowMass() { return TestRslt.FlowMass; } /// [kg/h]
public virtual double FlowVolume() { return TestRslt.FlowVolume; } /// [m3/h]
public virtual double ErrorMaster() { return TestRslt.ErrorMaster; } /// [%]
public virtual double DensityOut() { return TestRslt.DensityOut; }
public virtual Components Components(){ return TestRslt.Components; }
///
protected virtual TestData TestData() { return TestRslt.TestData; }
///
public virtual int Repeats() { return TestData().Repeats; }
public virtual double Qfrom() { return TestData().Qfrom; } /// [m3/h]
public virtual double Qto() { return TestData().Qto; } /// [m3/h]
public virtual double TargetVolume() { return TestData().TargetVolume; } /// [l]
public virtual double TargetTime() { return TestData().TargetTime; } /// [s]
public virtual string Method() { return TestData().Method; }
public virtual double ErrLimLo() { return TestData().ErrLimLo; } /// [%]
public virtual double ErrLimHi() { return TestData().ErrLimHi; } /// [%]
public virtual double Uncertainty() { return TestData().Uncertainty; } /// [%]
public virtual string ProcedureName() { return WaterMeter.Batch.ProcedureName; }
public virtual int BatchNr() { return WaterMeter.Batch.BatchNr; }
public virtual string SerialNr() { return WaterMeter.SerialNr; }
public virtual string EndState() { return WaterMeter.EndState; }
public virtual double QRise() { return WaterMeter.QRise; } /// [m3/h]
public virtual double QFall() { return WaterMeter.QFall; } /// [m3/h]
public virtual bool Evaluate() { return TestData().Evaluate; }
public virtual Config.Entities.Publish Publish() { return (Config.Entities.Publish)TestData().Publish; }
public virtual WaterMeterData WaterMeterData() { return WaterMeter.WaterMeterData; }
public virtual Batch Batch() { return WaterMeter.Batch; }
public virtual string PassedColorStr()
{
#if PUCHONG_PT200
if (!Evaluate()) return Passed ? "OK|White" : "NG|White";
else return Passed ? "OK|Green" : "NG|Red";
#else
if (!Evaluate()) return Passed ? "OK|White" : "NOK|White";
else return Passed ? "OK|Green" : "NOK|Red";
#endif
}
public MeterTestRslt()
{
TestDone = false;
Passed = false;
}
public MeterTestRslt(WaterMeter waterMeterRslt, TestRslt testRslt, Config.Entities.CompoundMeterId compoundMeterId)
: this()
{
WaterMeter = waterMeterRslt;
TestRslt = testRslt;
CompoundMeterId = (byte)compoundMeterId;
}
}
}
-96
View File
@@ -1,96 +0,0 @@
///
/// Copyright (c) 2016 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.Linq;
namespace Results.Entities
{
/// <summary>
/// Test, consisting of one or more repetitions of the test 'SingleTest'.
/// </summary>
public class TestData
{
public virtual int Id { get; protected set; }
public virtual string Name { get; set; }
public virtual int Repeats { get; set; }
public virtual double Qfrom { get; set; } /// [m3/h] flow range low limit
public virtual double Qto { get; set; } /// [m3/h] flow range high limit
public virtual double TargetVolume { get; set; } /// [l] target test volume
public virtual double TargetTime { get; set; } /// [s] target test time
public virtual string Method { get; set; }
public virtual double ErrLimLo { get; set; } /// [%] (usually < 0)
public virtual double ErrLimHi { get; set; } /// [%] (usually > 0)
public virtual double Uncertainty { get; set; } /// [%] makes error limits tighter: 0 <= Uncertainty <= abs(ErrLimXx)
public virtual sbyte Publish { get; set; } /// 0=no, 1=in all protocols, 2=on screen, 3=internal
public virtual bool Evaluate { get; set; }
protected TestData()
{
Name = string.Empty;
Method = string.Empty;
}
public TestData(Config.Entities.Test test)
: this()
{
Name = test.Name;
Repeats = test.Repeats;
Qfrom = (double)test.Qfrom;
Qto = (double)test.Qto;
TargetVolume = (double)test.Volume;
TargetTime = (double)test.TstTime;
Method = test.Method;
ErrLimLo = (double)test.ErrLimLo;
ErrLimHi = (double)test.ErrLimHi;
Uncertainty = (double)test.Uncertainty;
Publish = test.Publish;
Evaluate = test.Evaluate;
}
/// <summary>
/// Method to compare the content of two entities
/// </summary>
/// <param name="wmd">Second entity to compare with</param>
/// <returns>first = two entities are equal (except of Id)</returns>
public virtual bool Equals(TestData td)
{
if (!Name.Equals(td.Name)) return false;
if (Repeats != td.Repeats) return false;
if (Qfrom != td.Qfrom) return false;
if (Qto != td.Qto) return false;
if (TargetVolume != td.TargetVolume) return false;
if (TargetTime != td.TargetTime) return false;
if (!Method.Equals(td.Method)) return false;
if (ErrLimLo != td.ErrLimLo) return false;
if (ErrLimHi != td.ErrLimHi) return false;
if (Uncertainty != td.Uncertainty) return false;
if (Publish != td.Publish) return false;
if (Evaluate != td.Evaluate) return false;
return true;
}
/// <summary>
/// Adds an item to the list if it does not occur there
/// </summary>
/// <param name="list">List of items</param>
/// <param name="item">Item to add to the list or find there</param>
/// <returns>Item from the list (existing or added)</returns>
public static TestData UpdateList(IList<TestData> list, TestData item)
{
if (item == null) return null; /// Null item is not stored in the list
TestData found = list.FirstOrDefault<TestData>(x => x.Equals(item));
if (found != null) return found; /// The same item found in the list, The found item returned
list.Add(item); /// Item not fund in the list, it is added to the list
return item;
}
}
}
-114
View File
@@ -1,114 +0,0 @@
///
/// Copyright (c) 2015-2016 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
namespace Results.Entities
{
public class TestRslt
{
/// Identity
public virtual int Id { get; protected set; }
public virtual Batch Batch { get; set; }
public virtual TestData TestData { get; set; }
public virtual Components Components { get; set; }
public virtual int Part { get; set; }
public virtual int RepetitionNr { get; set; } /// Repetition number from the set of repeated tests (1...)
/// Main results
public virtual DateTime StartTime { get; set; } /// Date and time of the test start
public virtual DateTime EndTime { get; set; } /// Date and time of the test end
public virtual int FlowSetTime { get; set; } /// [s] Measurement time in seconds
public virtual double TestTime { get; set; } /// [s] Measurement time in seconds
public virtual double PulsesMaster { get; set; }
public virtual double ConstMaster { get; set; } /// [pls/l] Pulses per liter master flow meter
public virtual double MassStartRaw { get; set; } /// [kg]
public virtual double MassStart { get; set; } /// [kg]
public virtual double MassEndRaw { get; set; } /// [kg]
public virtual double MassEnd { get; set; } /// [kg]
public virtual double DensityIn { get; set; } /// [kg/m3]
public virtual double DensityOut { get; set; } /// [kg/m3]
public virtual double DensityDiv { get; set; } /// [kg/m3]
public virtual double Buoyancy { get; set; }
public virtual double FlowMass { get; set; } /// [kg/h] calculated from conventional true value
public virtual double FlowVolume { get; set; } ///![m3/h]
public virtual double VolumeCTV { get; set; } /// [l] Volume conventional true value
public virtual double VolumeMaster { get; set; } /// [l] Volume from the master flow meter
public virtual double ErrorMaster { get; set; } /// [%]
/// Auxiliary results
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 PressUpAvrg { get; set; } /// [Bar] Input water pressure (average)
public virtual float PressUpStart { get; set; } /// [Bar]
public virtual float PressUpEnd { get; set; } /// [Bar]
public virtual float PressUpMin { get; set; } /// [Bar]
public virtual float PressUpMax { get; set; } /// [Bar]
public virtual float PressDownAvrg { get; set; } /// [Bar]
public virtual float PressDownStart { get; set; } /// [Bar]
public virtual float PressDownEnd { get; set; } /// [Bar]
public virtual float PressDownMin { get; set; } /// [Bar]
public virtual float PressDownMax { 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 TempInMin { get; set; } /// [deg.C]
public virtual float TempInMax { 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 TempOutMin { get; set; } /// [deg.C]
public virtual float TempOutMax { 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 TempDivMin { get; set; } /// [deg.C]
public virtual float TempDivMax { get; set; } /// [deg.C]
public virtual float FlowMin { get; set; } /// [kg/m3] minimum flow
public virtual float FlowMax { get; set; } /// [kg/m3] maximum flow
public virtual float Custom1 { get; set; }
public virtual float Custom2 { get; set; }
public virtual float Custom3 { get; set; }
public virtual float Custom4 { get; set; }
public virtual float Custom5 { get; set; }
public virtual float Custom6 { get; set; }
public virtual float Custom7 { get; set; }
public virtual float Custom8 { get; set; }
/// Wrappers
public virtual string Name() { return Utils.GetTestName(TestData.Name, TestData.Repeats, RepetitionNr); }
public virtual int Repeats() { return TestData.Repeats; }
public virtual double Qfrom() { return TestData.Qfrom; }
public virtual double Qto() { return TestData.Qto; }
public virtual double TargetVolume() { return TestData.TargetVolume; }
public virtual double TargetTime() { return TestData.TargetTime; }
public virtual string Method() { return TestData.Method; }
public virtual double ErrLimLo() { return TestData.ErrLimLo; }
public virtual double ErrLimHi() { return TestData.ErrLimHi; }
public virtual double Uncertainty() { return TestData.Uncertainty; }
public virtual bool Evaluate() { return TestData.Evaluate; }
public virtual Config.Entities.Publish Publish() { return (Config.Entities.Publish)TestData.Publish; }
protected TestRslt()
{
}
public TestRslt(Batch batch, TestData testData, int part, int repetitionNr)
: this()
{
Batch = batch;
TestData = testData;
Part = part;
RepetitionNr = repetitionNr;
}
public override string ToString()
{
return string.Format("batch={0}, procedure={1}, test={2}, {3} {4}", Batch.BatchNr, Batch.ProcedureName, Name(), StartTime.ToShortDateString(), StartTime.ToShortTimeString());
}
}
}
-146
View File
@@ -1,146 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Config.Entities;
namespace Results.Entities
{
public class WaterMeter
{
public virtual int Id { get; protected set; }
public virtual string SerialNr { get; set; } /// Main s/n for compound meters, PCB Number for iPerl water meter
public virtual string SerialNrAux { get; set; } /// Aux s/n for compound meters, Serial number for iPerl water meter
public virtual string PurchaseOrder { get; set; }
public virtual int YearOfProduction { get; set; }
public virtual int WMPosition { get; set; }
public virtual string EndState { get; set; } /// End state (of the main water meter)
public virtual string EndStateAux { get; set; } /// End state of the auxiliary water meter
public virtual double QRise { get; set; } ///![m3/h] detected Q_rise of a composed meter
public virtual double QFall { get; set; } ///![m3/h] detected Q_fall of a composed meter
public virtual bool Passed { get; set; }
public virtual int ResultCode { get; set; }
#if IPERLST || IPERLST_SPECIAL
public virtual int SerialNrEx { get; set; } /// Aux s/n for compound meters, Serial number for iPerl water meter
public virtual double OrigCalibFactor { get; set; } /// iPerl calibration factor used during the test
public virtual double CalibFactor { get; set; } /// iPerl calibration factor used during the test
public virtual double Q2ErrWOCorrection { get; set; }
public virtual bool Q2CorrectionDone { get; set; } /// true = iPerl Q2 correction was done
public virtual double Q2Correction { get; set; } /// iPerl Q2 correction used during the test
public virtual int Q2CorrFlowRight { get; set; } /// 1 = right to left
public virtual double Diff2Hz8Hz { get; set; }
public virtual bool Hz2CorrectionDone { get; set; } /// true = iPerl Q2 correction was done
public virtual int Hz2Correction { get; set; } /// iPerl Q2 correction used during the test
public virtual int Pruefindex { get; set; } /// Not mapped to DB !!! 0=unknown (saving to Oracle failed), >=1 ... pruefindex
public virtual int HydrPruefung { get; set; } /// Not mapped to DB !!!
#endif
public virtual WaterMeterData WaterMeterData { get; set; }
public virtual Batch Batch { get; set; }
public virtual IList<MeterTestRslt> MeterTestRslts { get; set; }
///
/// Wrappers
///
public virtual string ProductName() { return ((WaterMeterData == null) || string.IsNullOrEmpty(WaterMeterData.ProductName)) ? string.Empty : WaterMeterData.ProductName; }
public virtual string Producer() { return WaterMeterData.Producer; }
public virtual string MetrologicalClass() { return WaterMeterData.MetrologicalClass; }
public virtual string ApprovalInfo() { return WaterMeterData.ApprovalInfo; }
public virtual double Q4_Qmax() { return WaterMeterData.Q4_Qmax; }
public virtual double Q3_Qn() { return WaterMeterData.Q3_Qn; }
public virtual double Q2_Qt() { return WaterMeterData.Q2_Qt; }
public virtual double Q1_Qmin() { return WaterMeterData.Q1_Qmin; }
public virtual bool Compound() { return WaterMeterData.Compound; }
#if HEAT_METER_SUPPORT
public virtual bool HeatMeter() { return WaterMeterData.HeatMeter; }
#endif
public virtual string ProducerAux() { return WaterMeterData.ProducerAux; }
public virtual double Q3_Qn_Aux() { return WaterMeterData.Q3_Qn_Aux; }
public virtual string MetrologicalClassAux() { return WaterMeterData.MetrologicalClassAux; }
public virtual string ApprovalInfoAux() { return WaterMeterData.ApprovalInfoAux; }
public virtual int BatchNr() { return Batch.BatchNr; }
public virtual int BenchId() { return Batch.TestBenchId; }
public virtual string ProcedureName() { return Batch.ProcedureName; }
public virtual int ProcedureRevision() { return Batch.ProcedureRevision; }
public virtual DateTime StartTime() { return Batch.StartTime; }
public virtual DateTime EndTime() { return Batch.EndTime; }
protected MeterTestRslt lastMeterTestRslts;
public virtual MeterTestRslt LastMeterTestRslts() { return lastMeterTestRslts; }
public virtual bool PassedFromTests()
{
bool passed = true;
foreach (var mtr in MeterTestRslts)
{
if (mtr.Evaluate() && (!mtr.Passed || !mtr.TestDone))
{
passed = false;
break;
}
}
return passed;
}
///
/// Not mapped to the database
///
public virtual bool Disabled { get; set; } /// true = Disabled water meters (not saved into DB)
public virtual MeterTestRslt GetMeterTestRslt(string testName)
{
return GetMeterTestRslt(testName, CompoundMeterId.Single);
}
public virtual MeterTestRslt GetMeterTestRslt(string testName, Config.Entities.CompoundMeterId meterId)
{
if (Disabled) return null;
string testNameL = testName.ToLower();
foreach (var mtr in MeterTestRslts)
{
if ((mtr.CompoundMeterId == (byte)meterId) && mtr.Name().ToLower().Equals(testNameL))
{
return mtr;
}
}
return null;
}
public virtual TestRslt GetTestRslt(string testName)
{
MeterTestRslt mtr = GetMeterTestRslt(testName);
if (mtr != null) return mtr.TestRslt;
return null;
}
/// <summary>
/// Constructor, initializes a list, used as a base for other constructors
/// </summary>
public WaterMeter()
{
MeterTestRslts = new List<MeterTestRslt>();
}
public override string ToString()
{
StringBuilder sb = new StringBuilder(80);
#if IPERLST || IPERLST_SPECIAL
sb.AppendFormat("PCB:{0} S/N:{1} ", SerialNr, SerialNrEx);
#else
sb.AppendFormat("S/N:{0} ", SerialNr);
#endif
foreach (var tr in MeterTestRslts) sb.AppendFormat(" {0}:{1}%", tr.Name(), tr.Error.ToString("F2"));
sb.AppendFormat(" test start: {0} {1} batch={2}", StartTime().ToShortDateString(), StartTime().ToShortTimeString(), BatchNr());
return sb.ToString();
}
}
}
-132
View File
@@ -1,132 +0,0 @@
///
/// Copyright (c) 2016 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.Linq;
namespace Results.Entities
{
public class WaterMeterData
{
public virtual int Id { get; protected set; }
public virtual string ProductName { get; set; }
public virtual string Producer { get; set; }
public virtual double DN { get; set; } /// [mm]
public virtual double L { get; set; } /// [mm]
public virtual Config.Entities.Mounting Mounting { get; set; } /// H / V / S / F
public virtual double Q4_Qmax { get; set; } /// [m3/h]
public virtual double Q3_Qn { get; set; } /// [m3/h]
public virtual double Q2_Qt { get; set; } /// [m3/h]
public virtual double Q1_Qmin { get; set; } /// [m3/h]
public virtual string MetrologicalClass { get; set; }
public virtual Config.Entities.TemperatureClass TemperatureClass { get; set; }
public virtual Config.Entities.PressureLossClass PressureLossClass { get; set; }
public virtual Config.Entities.MaxAdmissiblePressure MaxAdmissiblePressure { get; set; }
public virtual Config.Entities.FlowProfileSensitivityClass FlowProfileSensitivityClass { get; set; }
public virtual string ApprovalInfo { get; set; }
public virtual string Certificate { get; set; }
public virtual double PulsesPerLtr { get; set; }
/// Concerns compound water meters
public virtual string ProducerAux { get; set; }
public virtual double Q3_Qn_Aux { get; set; } /// [m3/h]
public virtual string MetrologicalClassAux { get; set; }
public virtual string ApprovalInfoAux { get; set; }
public virtual string Text1 { get; set; }
public virtual string Text2 { get; set; }
public virtual string Text3 { get; set; }
public virtual string Text4 { get; set; }
public virtual string Text5 { get; set; }
public virtual bool Compound { get; set; }
#if HEAT_METER_SUPPORT
public virtual bool HeatMeter { get; set; }
#endif
#if IPERLST || IPERLST_SPECIAL
public virtual int WMTypeId { get; set; }
public virtual int WMTypeRev { get; set; }
#endif
public WaterMeterData()
{
}
/// <summary>
/// Method to compare the content of two entities
/// </summary>
/// <param name="wmd">Second entity to compare with</param>
/// <returns>first = two entities are equal (except of Id)</returns>
public virtual bool Equals(WaterMeterData wmd)
{
if (!ProductName.Equals(wmd.ProductName)) return false;
if (!Producer.Equals(wmd.Producer)) return false;
if (DN != wmd.DN) return false;
if (L != wmd.L) return false;
if (Mounting != wmd.Mounting) return false;
if (Q4_Qmax != wmd.Q4_Qmax) return false;
if (Q3_Qn != wmd.Q3_Qn) return false;
if (Q2_Qt != wmd.Q2_Qt) return false;
if (Q1_Qmin != wmd.Q1_Qmin) return false;
if (!MetrologicalClass.Equals(wmd.MetrologicalClass)) return false;
if (!TemperatureClass.Equals(wmd.TemperatureClass)) return false;
if (!PressureLossClass.Equals(wmd.PressureLossClass)) return false;
if (!MaxAdmissiblePressure.Equals(wmd.MaxAdmissiblePressure)) return false;
if (!FlowProfileSensitivityClass.Equals(wmd.FlowProfileSensitivityClass)) return false;
if (!ApprovalInfo.Equals(wmd.ApprovalInfo)) return false;
if (Certificate != wmd.Certificate) return false;
if (PulsesPerLtr != wmd.PulsesPerLtr) return false;
if (ProducerAux != wmd.ProducerAux) return false;
if (Q3_Qn_Aux != wmd.Q3_Qn_Aux) return false;
if (MetrologicalClassAux != wmd.MetrologicalClassAux) return false;
if (ApprovalInfoAux != wmd.ApprovalInfoAux) return false;
if (Text1 != wmd.Text1) return false;
if (Text2 != wmd.Text2) return false;
if (Text3 != wmd.Text3) return false;
if (Text4 != wmd.Text4) return false;
if (Text5 != wmd.Text5) return false;
if (Compound != wmd.Compound) return false;
#if IPERLST || IPERLST_SPECIAL
if (WMTypeId != wmd.WMTypeId) return false;
if (WMTypeRev != wmd.WMTypeRev) return false;
#endif
return true;
}
/// <summary>
/// Adds an item to the list if it does not occur there
/// </summary>
/// <param name="list">List of items</param>
/// <param name="item">Item to add to the list or find there</param>
/// <returns>Item from the list (existing or added)</returns>
public static WaterMeterData UpdateList(IList<WaterMeterData> list, WaterMeterData item)
{
if (item == null) return null; /// Null item is not stored in the list
WaterMeterData found = list.FirstOrDefault<WaterMeterData>(x => x.Equals(item));
if (found != null) return found; /// The same item found in the list, The found item returned
list.Add(item); /// Item not fund in the list, it is added to the list
return item;
}
}
}
-210
View File
@@ -1,210 +0,0 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using Results.Entities;
namespace Results
{
public class ItemSpec
{
///
/// Public fields
///
public readonly string Name; /// Name-s of all items must be unique
public readonly string ClmnHeaderText; /// Text printed in the column header
///
/// Function to pick a MeterTestResult field and convert it into a string
///
public delegate string PrintDlgt(MeterTestRslt meterTestRslt);
private readonly PrintDlgt printDlgt;
public bool CanPrintSingle { get { return (printDlgt != null); } }
/// <summary> Safe wrapper which replaces null-s by empty strings </summary>
public string Print(MeterTestRslt meterTestRslt)
{
string str = printDlgt(meterTestRslt);
return (str == null) ? string.Empty : str;
}
///
/// Function to pick a MeterTestResult field and convert it into a string
///
public delegate string PrintCombinedDlgt(MeterTestRslt mainMtrTestResult,
MeterTestRslt auxMtrTestResult,
MeterTestRslt compoundMtrTestResult);
private readonly PrintCombinedDlgt printCombinedDlgt;
public bool CanPrintCombined { get { return (printCombinedDlgt != null); } }
/// <summary> Safe wrapper which replaces null-s by empty strings </summary>
public string PrintCombined(MeterTestRslt mainMtrTestResult,
MeterTestRslt auxMtrTestResult,
MeterTestRslt compoundMtrTestResult)
{
string str = printCombinedDlgt(mainMtrTestResult, auxMtrTestResult, compoundMtrTestResult);
return (str == null) ? string.Empty : str;
}
///
/// Public constructor
///
public ItemSpec(string name, string clmnHeaderText, PrintDlgt printDlgt, PrintCombinedDlgt printCombinedDlgt)
{
Name = name;
ClmnHeaderText = clmnHeaderText;
this.printDlgt = printDlgt;
this.printCombinedDlgt = printCombinedDlgt;
}
/// Static list of all available items
public static readonly IList<ItemSpec> AllItems;
/// Static constructor that initializes the list of all items
static ItemSpec()
{
AllItems = new List<ItemSpec>();
/// Common
//AllItems.Add(new ResultItemSpec("Bench ID", "Bench ID", x => x.BenchID,
// (x, y, z) => x.BenchID));
AllItems.Add(new ItemSpec("Test name", "Test", x => x.Name(), (x, y, z) => z.Name()));
AllItems.Add(new ItemSpec("Procedure name", "Procedure", x => x.ProcedureName(), (x, y, z) => z.ProcedureName()));
AllItems.Add(new ItemSpec("Batch number", "Batch nr.", x => x.BatchNr().ToString(), (x, y, z) => z.BatchNr().ToString()));
AllItems.Add(new ItemSpec("Test method", "Test method", x => x.Method(), (x, y, z) => z.Method()));
AllItems.Add(new ItemSpec("Density", "Density", x => x.DensityOut().ToString("F1"), (x, y, z) => z.DensityOut().ToString("F1"))); /// [kg/m3]
/// Target values
AllItems.Add(new ItemSpec("Q from", "Q from [m3/h]", x => x.Qfrom().ToString("F3"), (x, y, z) => z.Qfrom().ToString("F3")));
AllItems.Add(new ItemSpec("Q to", "Q to [m3/h]", x => x.Qto().ToString("F3"), (x, y, z) => z.Qto().ToString("F3")));
AllItems.Add(new ItemSpec("Test volume", "Test vol. [l]", x => x.TargetVolume().ToString("F1"),(x, y, z) => z.TargetVolume().ToString("F1")));
AllItems.Add(new ItemSpec("Error limit Lo", "Err.Lim.Lo [%]", x => x.ErrLimLo().ToString("F1"), (x, y, z) => z.ErrLimLo().ToString("F1")));
AllItems.Add(new ItemSpec("Error limit Hi", "Err.Lim.Hi [%]", x => x.ErrLimHi().ToString("F1"), (x, y, z) => z.ErrLimHi().ToString("F1")));
AllItems.Add(new ItemSpec("Uncertainty", "Uncertainty [%]",x => x.Uncertainty().ToString("F2"), (x, y, z) => z.Uncertainty().ToString("F2")));
/// Test results
AllItems.Add(new ItemSpec("Start time", "T start", x => x.StartTime().ToShortTimeString(), (x, y, z) => z.StartTime().ToShortTimeString()));
AllItems.Add(new ItemSpec("End time", "T end", x => x.EndTime().ToShortTimeString(), (x, y, z) => z.EndTime().ToShortTimeString()));
AllItems.Add(new ItemSpec("Test time", "T [s]", x => x.TestTime.ToString("F2"), (x, y, z) => z.TestTime.ToString("F2")));
AllItems.Add(new ItemSpec("Flow", "Flow [m3/h]", x => DoubleToStr(x.FlowVolume(), 4), (x, y, z) => DoubleToStr(z.FlowVolume(), 4)));
AllItems.Add(new ItemSpec("T in", "T in", x => x.TestRslt.TempInAvrg.ToString("F2"), (x, y, z) => z.TestRslt.TempInAvrg.ToString("F2")));
AllItems.Add(new ItemSpec("T out", "T out", x => x.TestRslt.TempOutAvrg.ToString("F2"), (x, y, z) => z.TestRslt.TempOutAvrg.ToString("F2")));
AllItems.Add(new ItemSpec("T div", "T div", x => x.TestRslt.TempDivAvrg.ToString("F2"), (x, y, z) => z.TestRslt.TempDivAvrg.ToString("F2")));
AllItems.Add(new ItemSpec("P up", "P up", x => x.TestRslt.PressUpAvrg.ToString("F3"), (x, y, z) => z.TestRslt.PressUpAvrg.ToString("F3")));
AllItems.Add(new ItemSpec("P up start", "P up start", x => x.TestRslt.PressUpStart.ToString("F3"), (x, y, z) => z.TestRslt.PressUpStart.ToString("F3")));
AllItems.Add(new ItemSpec("P up end", "P up end", x => x.TestRslt.PressUpEnd.ToString("F3"), (x, y, z) => z.TestRslt.PressUpEnd.ToString("F3")));
AllItems.Add(new ItemSpec("P down", "P down", x => x.TestRslt.PressDownAvrg.ToString("F3"), (x, y, z) => z.TestRslt.PressDownAvrg.ToString("F3")));
AllItems.Add(new ItemSpec("P down start", "P down start", x => x.TestRslt.PressDownStart.ToString("F3"), (x, y, z) => z.TestRslt.PressDownStart.ToString("F3")));
AllItems.Add(new ItemSpec("P down end", "P down end", x => x.TestRslt.PressDownEnd.ToString("F3"), (x, y, z) => z.TestRslt.PressDownEnd.ToString("F3")));
AllItems.Add(new ItemSpec("Reference error","Err.ref. [%]", x => x.TestRslt.ErrorMaster.ToString("F3"), (x, y, z) => z.TestRslt.ErrorMaster.ToString("F3")));
AllItems.Add(new ItemSpec("Ambient temperature","T amb", x => x.TestRslt.AmbientTempAve.ToString("F1"), (x, y, z) => z.TestRslt.AmbientTempAve.ToString("F1")));
AllItems.Add(new ItemSpec("Ambient pressure", "P amb", x => x.TestRslt.AmbientPressAve.ToString("F0"), (x, y, z) => z.TestRslt.AmbientPressAve.ToString("F0")));
AllItems.Add(new ItemSpec("Ambient humidity", "H amb [%]",x => x.TestRslt.AmbientHumiAve.ToString("F1"), (x, y, z) => z.TestRslt.AmbientHumiAve.ToString("F1")));
/// Single and combined meter results
AllItems.Add(new ItemSpec("Volume", "Volume [l]", x => x.VolumeMeter.ToString("F3"), (x, y, z) => z.VolumeMeter.ToString("F3")));
AllItems.Add(new ItemSpec("Reference volume", "Vol.ref. [l]", x => x.VolumeRef.ToString("F3"), (x, y, z) => z.VolumeRef.ToString("F3")));
AllItems.Add(new ItemSpec("Error", "Error [%]", x => x.Error.ToString("F2"), (x, y, z) => z.Error.ToString("F2")));
AllItems.Add(new ItemSpec("Passed", "Result", x => x.PassedColorStr(), (x, y, z) => z.PassedColorStr()));
/// Single water meters only results
AllItems.Add(new ItemSpec("Serial Nr", "s/n", x => x.SerialNr(), null));
AllItems.Add(new ItemSpec("End state", "End state", x => x.EndState(), null));
AllItems.Add(new ItemSpec("Pulses", "Pulses", x => x.PulsesMeter.ToString(), null));
AllItems.Add(new ItemSpec("Pulses/liter", "Pulses/liter", x => x.PulsesPerLiter.ToString(), null));
AllItems.Add(new ItemSpec("Reference pulses", "Ref.pulses", x => x.PulsesMaster.ToString(), null));
/// Combined water meters only results
AllItems.Add(new ItemSpec("Q rise", "Q rise [m3/h]", null, (x, y, z) => (z.QRise() == 0) ? "-" : DoubleToStr(z.QRise(), 4)));
AllItems.Add(new ItemSpec("Q fall", "Q fall [m3/h]", null, (x, y, z) => (z.QFall() == 0) ? "-" : DoubleToStr(z.QFall(), 4)));
AllItems.Add(new ItemSpec("Error large WM", "Error-L [%]", null, (x, y, z) => x.Error.ToString("F2")));
AllItems.Add(new ItemSpec("Error small WM", "Error-S [%]", null, (x, y, z) => y.Error.ToString("F2")));
AllItems.Add(new ItemSpec("Serial Nr large WM", "s/n", null, (x, y, z) => x.SerialNr()));
AllItems.Add(new ItemSpec("Serial Nr small WM", "s/n", null, (x, y, z) => y.SerialNr()));
AllItems.Add(new ItemSpec("End state large WM", "End state", null, (x, y, z) => x.EndState()));
AllItems.Add(new ItemSpec("End state small WM", "End state", null, (x, y, z) => y.EndState()));
}
public static ItemSpec GetItem(string name)
{
foreach (var item in AllItems) if (item.Name.Equals(name)) return item;
return null;
}
public static string[] ToStrArray(IList<ItemSpec> items)
{
int count = (items != null) ? items.Count : 0;
string[] result = new string[count];
for (int i = 0; i < count; i++) result[i] = items[i].Name;
return result;
}
public static IList<ItemSpec> FromStrArray(string[] strArray)
{
IList<ItemSpec> result = new List<ItemSpec>();
if (strArray != null)
{
for (int i = 0; i < strArray.Length; i++)
{
ItemSpec item = GetItem(strArray[i]);
if (item != null) result.Add(item);
}
}
return result;
}
/// <summary>
/// Converts float number to a string with the specified number of valid digits
/// </summary>
/// <param name="value">Float value to be converted to a string</param>
/// <param name="validDigits">Number of valid digits: 4, 3, or 2 (otherwise a full precision number is printed)</param>
/// <returns>String representation of the float number</returns>
public static string DoubleToStr(double value, int validDigits)
{
if (-float.Epsilon <= value && value <= float.Epsilon)
{
return "0";
}
else if (validDigits == 4)
{
if (value >= 999.5 || value < -999.5) return value.ToString("F0");
else if (value >= 99.95 || value < -99.95) return value.ToString("F1");
else if (value >= 9.995 || value < -9.995) return value.ToString("F2");
else if (value >= 0.9995 || value < -0.9995) return value.ToString("F3");
else if (value >= 0.09995 || value < -0.09995) return value.ToString("F4");
else if (value >= 0.009995 || value < -0.009995) return value.ToString("F5");
else return value.ToString("F6");
}
else if (validDigits == 3)
{
if (value >= 99.5 || value < -99.5) return value.ToString("F0");
else if (value >= 9.95 || value < -9.95) return value.ToString("F1");
else if (value >= 0.995 || value < -0.995) return value.ToString("F2");
else if (value >= 0.0995 || value < -0.0995) return value.ToString("F3");
else if (value >= 0.00995 || value < -0.00995) return value.ToString("F4");
else if (value >= 0.000995 || value < -0.000995) return value.ToString("F5");
else return value.ToString("F6");
}
else if (validDigits == 2)
{
if (value >= 9.5 || value < -9.5) return value.ToString("F0");
else if (value >= 0.95 || value < -0.95) return value.ToString("F1");
else if (value >= 0.095 || value < -0.095) return value.ToString("F2");
else if (value >= 0.0095 || value < -0.0095) return value.ToString("F3");
else if (value >= 0.00095 || value < -0.00095) return value.ToString("F4");
else return value.ToString("F5");
}
else return value.ToString();
}
}
}
-40
View File
@@ -1,40 +0,0 @@
///
/// Copyright (c) 2015 Sensus Metering Systems
///
using FluentNHibernate.Mapping;
using Results.Entities;
namespace Results.Mappings
{
class BatchMap : ClassMap<Batch>
{
public BatchMap()
{
Id(x => x.Id);
Map(x => x.BatchNr);
Map(x => x.TestBenchId);
Map(x => x.ProgramVersion);
Map(x => x.UserName);
Map(x => x.UserNumber);
Map(x => x.ProcedureName);
Map(x => x.ProcedureRevision);
Map(x => x.ProtocolTitle);
Map(x => x.Remark)
.CustomType("StringClob")
.CustomSqlType("varchar(2000)");
Map(x => x.Custom1);
Map(x => x.Custom2);
Map(x => x.Custom3);
Map(x => x.StartTime);
Map(x => x.EndTime);
Map(x => x.RsltsSent);
Map(x => x.RsltsPrinted);
HasMany(x => x.Tests)
.Cascade.All();
HasMany(x => x.WaterMeters)
.Cascade.All();
HasMany(x => x.TestRslts)
.Cascade.All();
}
}
}
-26
View File
@@ -1,26 +0,0 @@
///
/// Copyright (c) 2016 Sensus Metering Systems
///
using FluentNHibernate.Mapping;
using Results.Entities;
namespace Results.Mappings
{
class ComponentsMap : ClassMap<Components>
{
public ComponentsMap()
{
Id(x => x.Id);
Map(x => x.TestBenchId);
Map(x => x.TestBenchName);
Map(x => x.Pump);
Map(x => x.RegValve);
Map(x => x.Flowmeter);
Map(x => x.Diverter);
Map(x => x.Scale);
Map(x => x.Custom1);
Map(x => x.Custom2);
Map(x => x.Custom3);
}
}
}
-33
View File
@@ -1,33 +0,0 @@
///
/// Copyright (c) 2015 Sensus Metering Systems
///
using FluentNHibernate.Mapping;
using Results.Entities;
namespace Results.Mappings
{
class MeterTestRsltMap : ClassMap<MeterTestRslt>
{
public MeterTestRsltMap()
{
Id(x => x.Id);
Map(x => x.CompoundMeterId);
Map(x => x.PulsesMeter);
Map(x => x.PulsesMaster);
Map(x => x.PulsesPerLiter);
Map(x => x.VolumeStart);
Map(x => x.VolumeEnd);
Map(x => x.VolumeMeter);
Map(x => x.VolumeRef);
Map(x => x.TimestampStart);
Map(x => x.TimestampEnd);
Map(x => x.TestTime);
Map(x => x.Error);
Map(x => x.TestDone);
Map(x => x.Passed);
References(x => x.WaterMeter);
References(x => x.TestRslt);
}
}
}
-28
View File
@@ -1,28 +0,0 @@
///
/// Copyright (c) 2015 Sensus Metering Systems
///
using FluentNHibernate.Mapping;
using Results.Entities;
namespace Results.Mappings
{
class TestDataMap : ClassMap<TestData>
{
public TestDataMap()
{
Id(x => x.Id);
Map(x => x.Name);
Map(x => x.Qfrom);
Map(x => x.Qto);
Map(x => x.TargetVolume);
Map(x => x.TargetTime);
Map(x => x.Repeats);
Map(x => x.Method);
Map(x => x.ErrLimLo);
Map(x => x.ErrLimHi);
Map(x => x.Uncertainty);
Map(x => x.Publish);
Map(x => x.Evaluate);
}
}
}
-81
View File
@@ -1,81 +0,0 @@
///
/// Copyright (c) 2015 Sensus Metering Systems
///
using FluentNHibernate.Mapping;
using Results.Entities;
namespace Results.Mappings
{
class TestRsltMap : ClassMap<TestRslt>
{
public TestRsltMap()
{
Id(x => x.Id);
References<Batch>(x => x.Batch);
References<TestData>(x => x.TestData);
References<Components>(x => x.Components);
Map(x => x.Part);
Map(x => x.RepetitionNr);
Map(x => x.StartTime);
Map(x => x.EndTime);
Map(x => x.FlowSetTime);
Map(x => x.TestTime);
Map(x => x.PulsesMaster);
Map(x => x.ConstMaster);
Map(x => x.MassStartRaw);
Map(x => x.MassStart);
Map(x => x.MassEndRaw);
Map(x => x.MassEnd);
Map(x => x.DensityIn);
Map(x => x.DensityOut);
Map(x => x.DensityDiv);
Map(x => x.Buoyancy);
Map(x => x.FlowMass);
Map(x => x.FlowVolume);
Map(x => x.VolumeCTV);
Map(x => x.VolumeMaster);
Map(x => x.ErrorMaster);
Map(x => x.AmbientTempAve);
Map(x => x.AmbientPressAve);
Map(x => x.AmbientHumiAve);
Map(x => x.PressUpAvrg);
Map(x => x.PressUpStart);
Map(x => x.PressUpEnd);
Map(x => x.PressUpMin);
Map(x => x.PressUpMax);
Map(x => x.PressDownAvrg);
Map(x => x.PressDownStart);
Map(x => x.PressDownEnd);
Map(x => x.PressDownMin);
Map(x => x.PressDownMax);
Map(x => x.TempInAvrg);
Map(x => x.TempInStart);
Map(x => x.TempInEnd);
Map(x => x.TempInMin);
Map(x => x.TempInMax);
Map(x => x.TempOutAvrg);
Map(x => x.TempOutStart);
Map(x => x.TempOutEnd);
Map(x => x.TempOutMin);
Map(x => x.TempOutMax);
Map(x => x.TempDivAvrg);
Map(x => x.TempDivStart);
Map(x => x.TempDivEnd);
Map(x => x.TempDivMin);
Map(x => x.TempDivMax);
Map(x => x.FlowMin);
Map(x => x.FlowMax);
Map(x => x.Custom1);
Map(x => x.Custom2);
Map(x => x.Custom3);
Map(x => x.Custom4);
Map(x => x.Custom5);
Map(x => x.Custom6);
Map(x => x.Custom7);
Map(x => x.Custom8);
}
}
}
-58
View File
@@ -1,58 +0,0 @@
///
/// Copyright (c) 2015 Sensus Metering Systems
///
using FluentNHibernate.Mapping;
using Results.Entities;
namespace Results.Mappings
{
class WaterMeterDataMap : ClassMap<WaterMeterData>
{
public WaterMeterDataMap()
{
Id(x => x.Id);
Map(x => x.ProductName);
Map(x => x.Producer);
Map(x => x.DN);
Map(x => x.L);
Map(x => x.Mounting);
Map(x => x.Q4_Qmax);
Map(x => x.Q3_Qn);
Map(x => x.Q2_Qt);
Map(x => x.Q1_Qmin);
Map(x => x.MetrologicalClass);
Map(x => x.TemperatureClass);
Map(x => x.PressureLossClass);
Map(x => x.MaxAdmissiblePressure);
Map(x => x.FlowProfileSensitivityClass);
Map(x => x.ApprovalInfo);
Map(x => x.Certificate);
Map(x => x.PulsesPerLtr);
Map(x => x.ProducerAux);
Map(x => x.Q3_Qn_Aux);
Map(x => x.MetrologicalClassAux);
Map(x => x.ApprovalInfoAux);
Map(x => x.Text1);
Map(x => x.Text2);
Map(x => x.Text3);
Map(x => x.Text4);
Map(x => x.Text5);
Map(x => x.Compound);
#if HEAT_METER_SUPPORT
Map(x => x.HeatMeter);
#endif
#if IPERLST || IPERLST_SPECIAL
Map(x => x.WMTypeId);
Map(x => x.WMTypeRev);
#endif
}
}
}
-41
View File
@@ -1,41 +0,0 @@
///
/// Copyright (c) 2015-2020 Sensus Slovansko a.s.
///
using FluentNHibernate.Mapping;
using Results.Entities;
namespace Results.Mappings
{
class WaterMeterMap : ClassMap<WaterMeter>
{
public WaterMeterMap()
{
Id(x => x.Id);
Map(x => x.SerialNr);
Map(x => x.SerialNrAux);
Map(x => x.PurchaseOrder);
Map(x => x.YearOfProduction);
Map(x => x.WMPosition);
Map(x => x.EndState);
Map(x => x.EndStateAux);
Map(x => x.QRise);
Map(x => x.QFall);
Map(x => x.Passed);
Map(x => x.ResultCode);
#if IPERLST || IPERLST_SPECIAL
Map(x => x.OrigCalibFactor);
Map(x => x.CalibFactor);
Map(x => x.Q2ErrWOCorrection);
Map(x => x.Q2CorrFlowRight);
Map(x => x.Diff2Hz8Hz);
Map(x => x.Hz2CorrectionDone);
Map(x => x.Hz2Correction);
#endif
References(x => x.WaterMeterData);
References(x => x.Batch);
HasMany(x => x.MeterTestRslts)
.Cascade.All();
}
}
}
-36
View File
@@ -1,36 +0,0 @@
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("Sensus")]
[assembly: AssemblyProduct("Results")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[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("2.9.329.0")]
[assembly: AssemblyFileVersion("2.9.329.0")]
-97
View File
@@ -1,97 +0,0 @@
<?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>TRACE;DEBUG;IPERLST</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<PlatformTarget>x86</PlatformTarget>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;IPERLST</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="log4net">
<HintPath>..\packages\log4net.2.0.2\lib\net40-full\log4net.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="BatchResults.cs" />
<Compile Include="Entities\Batch.cs" />
<Compile Include="Entities\Components.cs" />
<Compile Include="Entities\MeterTestRslt.cs" />
<Compile Include="Entities\TestData.cs" />
<Compile Include="Entities\TestRslt.cs" />
<Compile Include="Entities\WaterMeterData.cs" />
<Compile Include="Entities\WaterMeter.cs" />
<Compile Include="DB.cs" />
<Compile Include="Mappings\BatchMap.cs" />
<Compile Include="Mappings\ComponentsMap.cs" />
<Compile Include="Mappings\MeterTestRsltMap.cs" />
<Compile Include="Mappings\TestDataMap.cs" />
<Compile Include="Mappings\TestRsltMap.cs" />
<Compile Include="Mappings\WaterMeterDataMap.cs" />
<Compile Include="Mappings\WaterMeterMap.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ItemSpec.cs" />
<Compile Include="Utils.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Config\Config.csproj">
<Project>{743DF7DB-C7B6-42EB-986D-0F485E5588E4}</Project>
<Name>Config</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<Folder Include="FileWriters\" />
<Folder Include="Printers\" />
</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>
-29
View File
@@ -1,29 +0,0 @@
using System;
using System.Text;
namespace Results
{
public static class Utils
{
public static string GetTestName(string name, int repeats, int repetitionNr)
{
if (repeats == 1) return name;
return string.Format("{0} ({1}/{2})", name, repetitionNr, repeats);
}
public static int BenchIdOracle2Asc(int benchIdOracle)
{
switch (benchIdOracle)
{
case 4: return 35; /// WR9
case 5: return 33; /// WR10
case 6: return 34; /// WR11
case 7: return 29; /// PT7, special
case 8: return 36; /// WR13
case 9: return 37; /// WR15
case 10: return 38; /// WR16
default: return 0;
}
}
}
}
+137
View File
@@ -0,0 +1,137 @@
namespace ResultsBrowser
{
partial class BenchesDlg
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(BenchesDlg));
this.okButton = new System.Windows.Forms.Button();
this.cancelButton = new System.Windows.Forms.Button();
this.testBenchesListBox = new System.Windows.Forms.ListBox();
this.label1 = new System.Windows.Forms.Label();
this.editButton = new System.Windows.Forms.Button();
this.addButton = new System.Windows.Forms.Button();
this.removeButton = new System.Windows.Forms.Button();
this.copyButton = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// okButton
//
resources.ApplyResources(this.okButton, "okButton");
this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK;
this.okButton.ImageKey = global::TBF.Resources.Strings.String1;
this.okButton.Name = "okButton";
this.okButton.UseVisualStyleBackColor = true;
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// cancelButton
//
resources.ApplyResources(this.cancelButton, "cancelButton");
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelButton.ImageKey = global::TBF.Resources.Strings.String1;
this.cancelButton.Name = "cancelButton";
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
//
// testBenchesListBox
//
resources.ApplyResources(this.testBenchesListBox, "testBenchesListBox");
this.testBenchesListBox.FormattingEnabled = true;
this.testBenchesListBox.Name = "testBenchesListBox";
this.testBenchesListBox.DoubleClick += new System.EventHandler(this.testBenchesListBox_DoubleClick);
//
// label1
//
resources.ApplyResources(this.label1, "label1");
this.label1.ImageKey = global::TBF.Resources.Strings.String1;
this.label1.Name = "label1";
//
// editButton
//
resources.ApplyResources(this.editButton, "editButton");
this.editButton.ImageKey = global::TBF.Resources.Strings.String1;
this.editButton.Name = "editButton";
this.editButton.UseVisualStyleBackColor = true;
this.editButton.Click += new System.EventHandler(this.editButton_Click);
//
// addButton
//
resources.ApplyResources(this.addButton, "addButton");
this.addButton.ImageKey = global::TBF.Resources.Strings.String1;
this.addButton.Name = "addButton";
this.addButton.UseVisualStyleBackColor = true;
this.addButton.Click += new System.EventHandler(this.addButton_Click);
//
// removeButton
//
resources.ApplyResources(this.removeButton, "removeButton");
this.removeButton.ImageKey = global::TBF.Resources.Strings.String1;
this.removeButton.Name = "removeButton";
this.removeButton.UseVisualStyleBackColor = true;
this.removeButton.Click += new System.EventHandler(this.removeButton_Click);
//
// copyButton
//
resources.ApplyResources(this.copyButton, "copyButton");
this.copyButton.ImageKey = global::TBF.Resources.Strings.String1;
this.copyButton.Name = "copyButton";
this.copyButton.UseVisualStyleBackColor = true;
this.copyButton.Click += new System.EventHandler(this.copyButton_Click);
//
// BenchesDlg
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.copyButton);
this.Controls.Add(this.removeButton);
this.Controls.Add(this.addButton);
this.Controls.Add(this.editButton);
this.Controls.Add(this.label1);
this.Controls.Add(this.testBenchesListBox);
this.Controls.Add(this.okButton);
this.Controls.Add(this.cancelButton);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.Name = "BenchesDlg";
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button okButton;
private System.Windows.Forms.Button cancelButton;
private System.Windows.Forms.ListBox testBenchesListBox;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button editButton;
private System.Windows.Forms.Button addButton;
private System.Windows.Forms.Button removeButton;
private System.Windows.Forms.Button copyButton;
}
}
+199
View File
@@ -0,0 +1,199 @@
using System;
using System.Windows.Forms;
namespace ResultsBrowser
{
/// <summary>
/// Dialog to edit local settings that specify database parameters (S1.2)
/// </summary>
public partial class BenchesDlg : Form
{
// Local copy of 'local settings' initialized to Program.localSettings.
// Dialog modifies this copy and updates Program.localSettings just
// when 'OK' is pressed.
LocalSettings localSettings;
/// <summary>
/// Constructor, initializes the dialog
/// </summary>
public BenchesDlg()
{
localSettings = new LocalSettings();
localSettings.Assign(Program.LocalSettings);
InitializeComponent();
RedrawTestBenchesListBox();
}
void RedrawTestBenchesListBox()
{
testBenchesListBox.Items.Clear();
if (localSettings.testBenches != null)
{
int nrBenches = localSettings.testBenches.GetLength(0);
for (int i = 0; i < nrBenches; i++)
{
testBenchesListBox.Items.Add(localSettings.testBenches[i].BenchName);
}
}
}
/// <summary>
/// Create a new test bench DB specification and append it to the list
/// </summary>
/// <param name="sender">Not used</param>
/// <param name="e">Not used</param>
private void addButton_Click(object sender, EventArgs e)
{
DatabaseSettings bench = new DatabaseSettings();
DatabaseSettingsDlg dlg = new DatabaseSettingsDlg(bench);
DialogResult dr = dlg.ShowDialog();
if (dr == DialogResult.OK)
{
int nrBenches =
(localSettings.testBenches == null) ? 0 : localSettings.testBenches.GetLength(0);
if (nrBenches == 0)
{
localSettings.testBenches = new DatabaseSettings[1];
localSettings.testBenches[0] = bench;
}
else
{
DatabaseSettings[] newTestBenches = new DatabaseSettings[nrBenches + 1];
for (int i = 0; i < nrBenches; i++)
{
newTestBenches[i] = localSettings.testBenches[i];
}
newTestBenches[nrBenches] = bench;
localSettings.testBenches = newTestBenches;
}
testBenchesListBox.Items.Add(bench.BenchName);
}
}
/// <summary>
/// Create a new test bench DB specification,which is a copy of the
/// selected bench, and append it to the list
/// </summary>
/// <param name="sender">Not used</param>
/// <param name="e">Not used</param>
private void copyButton_Click(object sender, EventArgs e)
{
if (testBenchesListBox.SelectedIndex >= 0)
{
DatabaseSettings ori = localSettings.testBenches[testBenchesListBox.SelectedIndex];
DatabaseSettings bench = (DatabaseSettings)ori.Clone();
DatabaseSettingsDlg dlg = new DatabaseSettingsDlg(bench);
DialogResult dr = dlg.ShowDialog();
if (dr == DialogResult.OK)
{
int nrBenches =
(localSettings.testBenches == null) ? 0 : localSettings.testBenches.GetLength(0);
DatabaseSettings[] newTestBenches = new DatabaseSettings[nrBenches + 1];
for (int i = 0; i < nrBenches; i++)
{
newTestBenches[i] = localSettings.testBenches[i];
}
newTestBenches[nrBenches] = bench;
localSettings.testBenches = newTestBenches;
testBenchesListBox.Items.Add(bench.BenchName);
}
}
}
/// <summary>
/// Edit selected test bench DB specification
/// </summary>
/// <param name="sender">Not used</param>
/// <param name="e">Not used</param>
private void editButton_Click(object sender, EventArgs e)
{
if (testBenchesListBox.SelectedIndex >= 0)
{
DatabaseSettingsDlg dlg = new DatabaseSettingsDlg(localSettings.testBenches[testBenchesListBox.SelectedIndex]);
DialogResult dr = dlg.ShowDialog();
if (dr == DialogResult.OK)
{
// Update the item name
testBenchesListBox.Items[testBenchesListBox.SelectedIndex] =
localSettings.testBenches[testBenchesListBox.SelectedIndex].BenchName;
}
}
}
/// <summary>
/// Remove selected test bench DB specification from the list
/// </summary>
/// <param name="sender">Not used</param>
/// <param name="e">Not used</param>
private void removeButton_Click(object sender, EventArgs e)
{
int selectedIx = testBenchesListBox.SelectedIndex;
if (selectedIx >= 0)
{
int nrBenches =
(localSettings.testBenches == null) ? 0 : localSettings.testBenches.GetLength(0);
if (nrBenches == 1)
{
localSettings.testBenches = null;
}
else
{
DatabaseSettings[] newTestBenches = new DatabaseSettings[nrBenches - 1];
for (int i = 0; i < selectedIx; i++)
{
newTestBenches[i] = localSettings.testBenches[i];
}
for (int i = selectedIx + 1; i < nrBenches; i++)
{
newTestBenches[i - 1] = localSettings.testBenches[i];
}
localSettings.testBenches = newTestBenches;
}
RedrawTestBenchesListBox();
}
}
/// <summary>
/// Update setting, return 'OK'
/// </summary>
/// <param name="sender">Not used</param>
/// <param name="e">Not used</param>
private void okButton_Click(object sender, EventArgs e)
{
Program.LocalSettings.Assign(localSettings); // Update Program.localSettings
DialogResult = DialogResult.OK;
Close();
return;
}
/// <summary>
/// Throw away changes, return 'Cancel'
/// </summary>
/// <param name="sender">Not used</param>
/// <param name="e">Not used</param>
private void cancelButton_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
Close();
return;
}
/// <summary>
/// Double click on an item = edit item
/// </summary>
/// <param name="sender">Not used</param>
/// <param name="e">Not used</param>
private void testBenchesListBox_DoubleClick(object sender, EventArgs e)
{
editButton_Click(sender, e);
}
}
}
+148
View File
@@ -0,0 +1,148 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="okButton.Text" xml:space="preserve">
<value>&amp;OK</value>
</data>
<data name="cancelButton.Text" xml:space="preserve">
<value>&amp;Abbrechen</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>58, 13</value>
</data>
<data name="label1.Text" xml:space="preserve">
<value>Prüfstände</value>
</data>
<data name="editButton.Text" xml:space="preserve">
<value>&amp;Bearbeiten...</value>
</data>
<data name="addButton.Text" xml:space="preserve">
<value>&amp;Neu...</value>
</data>
<data name="removeButton.Text" xml:space="preserve">
<value>&amp;Löschen</value>
</data>
<data name="copyButton.Text" xml:space="preserve">
<value>&amp;Kopieren</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>Datenbank Einstellungen</value>
</data>
</root>
+339
View File
@@ -0,0 +1,339 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="testBenchesListBox.TabIndex" type="System.Int32, mscorlib">
<value>13</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="editButton.Location" type="System.Drawing.Point, System.Drawing">
<value>192, 105</value>
</data>
<data name="&gt;&gt;copyButton.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="cancelButton.Size" type="System.Drawing.Size, System.Drawing">
<value>105, 28</value>
</data>
<data name="addButton.Location" type="System.Drawing.Point, System.Drawing">
<value>192, 37</value>
</data>
<data name="testBenchesListBox.Size" type="System.Drawing.Size, System.Drawing">
<value>164, 134</value>
</data>
<data name="addButton.Text" xml:space="preserve">
<value>&amp;Add</value>
</data>
<data name="&gt;&gt;removeButton.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="editButton.TabIndex" type="System.Int32, mscorlib">
<value>15</value>
</data>
<data name="&gt;&gt;editButton.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;cancelButton.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>BenchesDlg</value>
</data>
<data name="&gt;&gt;testBenchesListBox.ZOrder" xml:space="preserve">
<value>5</value>
</data>
<data name="&gt;&gt;label1.Name" xml:space="preserve">
<value>label1</value>
</data>
<data name="removeButton.Text" xml:space="preserve">
<value>&amp;Remove</value>
</data>
<data name="cancelButton.Location" type="System.Drawing.Point, System.Drawing">
<value>344, 71</value>
</data>
<data name="&gt;&gt;cancelButton.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="cancelButton.Text" xml:space="preserve">
<value>Cancel</value>
</data>
<data name="&gt;&gt;testBenchesListBox.Name" xml:space="preserve">
<value>testBenchesListBox</value>
</data>
<data name="copyButton.Location" type="System.Drawing.Point, System.Drawing">
<value>192, 71</value>
</data>
<data name="&gt;&gt;okButton.Name" xml:space="preserve">
<value>okButton</value>
</data>
<data name="&gt;&gt;label1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;testBenchesListBox.Type" xml:space="preserve">
<value>System.Windows.Forms.ListBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="editButton.Size" type="System.Drawing.Size, System.Drawing">
<value>105, 28</value>
</data>
<data name="copyButton.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="label1.TabIndex" type="System.Int32, mscorlib">
<value>14</value>
</data>
<data name="&gt;&gt;editButton.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>79, 13</value>
</data>
<data name="addButton.Size" type="System.Drawing.Size, System.Drawing">
<value>105, 28</value>
</data>
<data name="&gt;&gt;removeButton.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>459, 185</value>
</data>
<data name="cancelButton.TabIndex" type="System.Int32, mscorlib">
<value>11</value>
</data>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 13</value>
</data>
<data name="okButton.Size" type="System.Drawing.Size, System.Drawing">
<value>105, 28</value>
</data>
<data name="editButton.Text" xml:space="preserve">
<value>&amp;Edit</value>
</data>
<data name="&gt;&gt;addButton.Name" xml:space="preserve">
<value>addButton</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="$this.StartPosition" type="System.Windows.Forms.FormStartPosition, System.Windows.Forms">
<value>CenterParent</value>
</data>
<data name="&gt;&gt;okButton.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="removeButton.Location" type="System.Drawing.Point, System.Drawing">
<value>192, 139</value>
</data>
<data name="&gt;&gt;cancelButton.ZOrder" xml:space="preserve">
<value>7</value>
</data>
<data name="okButton.Location" type="System.Drawing.Point, System.Drawing">
<value>344, 37</value>
</data>
<data name="copyButton.Size" type="System.Drawing.Size, System.Drawing">
<value>105, 28</value>
</data>
<data name="removeButton.TabIndex" type="System.Int32, mscorlib">
<value>17</value>
</data>
<data name="&gt;&gt;removeButton.Name" xml:space="preserve">
<value>removeButton</value>
</data>
<data name="copyButton.Text" xml:space="preserve">
<value>&amp;Copy</value>
</data>
<data name="testBenchesListBox.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 37</value>
</data>
<data name="&gt;&gt;label1.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="&gt;&gt;addButton.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;okButton.ZOrder" xml:space="preserve">
<value>6</value>
</data>
<data name="&gt;&gt;addButton.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;copyButton.Name" xml:space="preserve">
<value>copyButton</value>
</data>
<data name="removeButton.Size" type="System.Drawing.Size, System.Drawing">
<value>105, 28</value>
</data>
<data name="label1.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="&gt;&gt;editButton.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="&gt;&gt;editButton.Name" xml:space="preserve">
<value>editButton</value>
</data>
<data name="&gt;&gt;cancelButton.Name" xml:space="preserve">
<value>cancelButton</value>
</data>
<data name="label1.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 15</value>
</data>
<data name="&gt;&gt;removeButton.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;copyButton.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;testBenchesListBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;addButton.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="okButton.Text" xml:space="preserve">
<value>OK</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>Database Settings</value>
</data>
<data name="&gt;&gt;okButton.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label1.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;copyButton.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="okButton.TabIndex" type="System.Int32, mscorlib">
<value>12</value>
</data>
<data name="addButton.TabIndex" type="System.Int32, mscorlib">
<value>16</value>
</data>
<data name="label1.Text" xml:space="preserve">
<value>Test Benches :</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>de</value>
</metadata>
</root>
+28
View File
@@ -0,0 +1,28 @@
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);
}
}
}
+48
View File
@@ -0,0 +1,48 @@
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;
}
}
}
+370
View File
@@ -0,0 +1,370 @@
namespace ResultsBrowser
{
partial class DatabaseSettingsDlg
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DatabaseSettingsDlg));
this.okButton = new System.Windows.Forms.Button();
this.cancelButton = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.benchNameTextBox = new System.Windows.Forms.TextBox();
this.usersConnectionStringTextBox = new System.Windows.Forms.TextBox();
this.connectionStringLabel = new System.Windows.Forms.Label();
this.benchConnectionStringTextBox = new System.Windows.Forms.TextBox();
this.proceduresConnectionStringTextBox = new System.Windows.Forms.TextBox();
this.wmTypesConnectionStringTextBox = new System.Windows.Forms.TextBox();
this.watermetersConnectionStringTextBox = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.testConnUsersBtn = new System.Windows.Forms.Button();
this.createUsersDbBtn = new System.Windows.Forms.Button();
this.realBenchCheckBox = new System.Windows.Forms.CheckBox();
this.dbTypeLabel = new System.Windows.Forms.Label();
this.usersDbTypeComboBox = new System.Windows.Forms.ComboBox();
this.benchDbTypeComboBox = new System.Windows.Forms.ComboBox();
this.proceduresDbTypeComboBox = new System.Windows.Forms.ComboBox();
this.wmTypesDbTypeComboBox = new System.Windows.Forms.ComboBox();
this.watermetersDbTypeComboBox = new System.Windows.Forms.ComboBox();
this.testConnBenchBtn = new System.Windows.Forms.Button();
this.testConnProceduresBtn = new System.Windows.Forms.Button();
this.testConnWMTypesBtn = new System.Windows.Forms.Button();
this.testConnWaterMetersBtn = new System.Windows.Forms.Button();
this.createBenchDbBtn = new System.Windows.Forms.Button();
this.createProceduresDbBtn = new System.Windows.Forms.Button();
this.createWMTypesDbBtn = new System.Windows.Forms.Button();
this.createWaterMetersDbBtn = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// 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;
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// 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;
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
//
// label1
//
resources.ApplyResources(this.label1, "label1");
this.label1.ImageKey = global::TBF.Resources.Strings.String1;
this.label1.Name = "label1";
//
// benchNameTextBox
//
resources.ApplyResources(this.benchNameTextBox, "benchNameTextBox");
this.benchNameTextBox.Name = "benchNameTextBox";
//
// usersConnectionStringTextBox
//
resources.ApplyResources(this.usersConnectionStringTextBox, "usersConnectionStringTextBox");
this.usersConnectionStringTextBox.Name = "usersConnectionStringTextBox";
//
// connectionStringLabel
//
resources.ApplyResources(this.connectionStringLabel, "connectionStringLabel");
this.connectionStringLabel.ImageKey = global::TBF.Resources.Strings.String1;
this.connectionStringLabel.Name = "connectionStringLabel";
//
// benchConnectionStringTextBox
//
resources.ApplyResources(this.benchConnectionStringTextBox, "benchConnectionStringTextBox");
this.benchConnectionStringTextBox.Name = "benchConnectionStringTextBox";
//
// proceduresConnectionStringTextBox
//
resources.ApplyResources(this.proceduresConnectionStringTextBox, "proceduresConnectionStringTextBox");
this.proceduresConnectionStringTextBox.Name = "proceduresConnectionStringTextBox";
//
// wmTypesConnectionStringTextBox
//
resources.ApplyResources(this.wmTypesConnectionStringTextBox, "wmTypesConnectionStringTextBox");
this.wmTypesConnectionStringTextBox.Name = "wmTypesConnectionStringTextBox";
//
// watermetersConnectionStringTextBox
//
resources.ApplyResources(this.watermetersConnectionStringTextBox, "watermetersConnectionStringTextBox");
this.watermetersConnectionStringTextBox.Name = "watermetersConnectionStringTextBox";
//
// 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;
this.testConnUsersBtn.Click += new System.EventHandler(this.testConnUsersBtn_Click);
//
// 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;
this.createUsersDbBtn.Click += new System.EventHandler(this.createDatabasesButton_Click);
//
// 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
//
this.usersDbTypeComboBox.FormattingEnabled = true;
resources.ApplyResources(this.usersDbTypeComboBox, "usersDbTypeComboBox");
this.usersDbTypeComboBox.Name = "usersDbTypeComboBox";
//
// benchDbTypeComboBox
//
this.benchDbTypeComboBox.FormattingEnabled = true;
resources.ApplyResources(this.benchDbTypeComboBox, "benchDbTypeComboBox");
this.benchDbTypeComboBox.Name = "benchDbTypeComboBox";
//
// proceduresDbTypeComboBox
//
this.proceduresDbTypeComboBox.FormattingEnabled = true;
resources.ApplyResources(this.proceduresDbTypeComboBox, "proceduresDbTypeComboBox");
this.proceduresDbTypeComboBox.Name = "proceduresDbTypeComboBox";
//
// wmTypesDbTypeComboBox
//
this.wmTypesDbTypeComboBox.FormattingEnabled = true;
resources.ApplyResources(this.wmTypesDbTypeComboBox, "wmTypesDbTypeComboBox");
this.wmTypesDbTypeComboBox.Name = "wmTypesDbTypeComboBox";
//
// watermetersDbTypeComboBox
//
this.watermetersDbTypeComboBox.FormattingEnabled = true;
resources.ApplyResources(this.watermetersDbTypeComboBox, "watermetersDbTypeComboBox");
this.watermetersDbTypeComboBox.Name = "watermetersDbTypeComboBox";
//
// 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;
this.testConnBenchBtn.Click += new System.EventHandler(this.testConnBenchBtn_Click);
//
// 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;
this.testConnProceduresBtn.Click += new System.EventHandler(this.testConnProceduresBtn_Click);
//
// 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;
this.testConnWMTypesBtn.Click += new System.EventHandler(this.testConnWMTypesBtn_Click);
//
// 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;
this.testConnWaterMetersBtn.Click += new System.EventHandler(this.testConnWaterMetersBtn_Click);
//
// 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;
this.createBenchDbBtn.Click += new System.EventHandler(this.createbenchDbBtn_Click);
//
// 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;
this.createProceduresDbBtn.Click += new System.EventHandler(this.createProecduresDbBtn_Click);
//
// 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;
this.createWMTypesDbBtn.Click += new System.EventHandler(this.createWMTypesDbBtn_Click);
//
// 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;
this.createWaterMetersDbBtn.Click += new System.EventHandler(this.createWaterMetersDbBtn_Click);
//
// DatabaseSettingsDlg
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.createWaterMetersDbBtn);
this.Controls.Add(this.createWMTypesDbBtn);
this.Controls.Add(this.createProceduresDbBtn);
this.Controls.Add(this.createBenchDbBtn);
this.Controls.Add(this.testConnWaterMetersBtn);
this.Controls.Add(this.testConnWMTypesBtn);
this.Controls.Add(this.testConnProceduresBtn);
this.Controls.Add(this.testConnBenchBtn);
this.Controls.Add(this.watermetersDbTypeComboBox);
this.Controls.Add(this.wmTypesDbTypeComboBox);
this.Controls.Add(this.proceduresDbTypeComboBox);
this.Controls.Add(this.benchDbTypeComboBox);
this.Controls.Add(this.usersDbTypeComboBox);
this.Controls.Add(this.dbTypeLabel);
this.Controls.Add(this.realBenchCheckBox);
this.Controls.Add(this.createUsersDbBtn);
this.Controls.Add(this.testConnUsersBtn);
this.Controls.Add(this.label6);
this.Controls.Add(this.label5);
this.Controls.Add(this.label4);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.watermetersConnectionStringTextBox);
this.Controls.Add(this.wmTypesConnectionStringTextBox);
this.Controls.Add(this.proceduresConnectionStringTextBox);
this.Controls.Add(this.benchConnectionStringTextBox);
this.Controls.Add(this.connectionStringLabel);
this.Controls.Add(this.usersConnectionStringTextBox);
this.Controls.Add(this.benchNameTextBox);
this.Controls.Add(this.label1);
this.Controls.Add(this.okButton);
this.Controls.Add(this.cancelButton);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MinimizeBox = false;
this.Name = "DatabaseSettingsDlg";
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.Load += new System.EventHandler(this.BenchSettingsDlg_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button okButton;
private System.Windows.Forms.Button cancelButton;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox benchNameTextBox;
private System.Windows.Forms.TextBox usersConnectionStringTextBox;
private System.Windows.Forms.Label connectionStringLabel;
private System.Windows.Forms.TextBox benchConnectionStringTextBox;
private System.Windows.Forms.TextBox proceduresConnectionStringTextBox;
private System.Windows.Forms.TextBox wmTypesConnectionStringTextBox;
private System.Windows.Forms.TextBox watermetersConnectionStringTextBox;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Button testConnUsersBtn;
private System.Windows.Forms.Button createUsersDbBtn;
private System.Windows.Forms.CheckBox realBenchCheckBox;
private System.Windows.Forms.Label dbTypeLabel;
private System.Windows.Forms.ComboBox usersDbTypeComboBox;
private System.Windows.Forms.ComboBox benchDbTypeComboBox;
private System.Windows.Forms.ComboBox proceduresDbTypeComboBox;
private System.Windows.Forms.ComboBox wmTypesDbTypeComboBox;
private System.Windows.Forms.ComboBox watermetersDbTypeComboBox;
private System.Windows.Forms.Button testConnBenchBtn;
private System.Windows.Forms.Button testConnProceduresBtn;
private System.Windows.Forms.Button testConnWMTypesBtn;
private System.Windows.Forms.Button testConnWaterMetersBtn;
private System.Windows.Forms.Button createBenchDbBtn;
private System.Windows.Forms.Button createProceduresDbBtn;
private System.Windows.Forms.Button createWMTypesDbBtn;
private System.Windows.Forms.Button createWaterMetersDbBtn;
}
}
+261
View File
@@ -0,0 +1,261 @@
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;
namespace TBF
{
/// <summary>
/// Dialog to process test bench name and database settings (BenchSettings)
/// </summary>
public partial class DatabaseSettingsDlg : Form
{
// Reference to bench DB settins (not a local copy)
DatabaseSettings bench;
/// <summary>
/// Constructor
/// </summary>
/// <param name="bench">Test bench database settings</param>
public DatabaseSettingsDlg(DatabaseSettings bench)
{
this.bench = bench;
InitializeComponent();
}
void Localize()
{
Text = Strings.Test_Bench_Databases_Specification;
label1.Text = Strings.Test_bench_name;
realBenchCheckBox.Text = Strings.Test_bench_is_controlled_by_this_computer;
dbTypeLabel.Text = Strings.Database_type;
connectionStringLabel.Text = Strings.Connection_string;
label2.Text = Strings.Users_and_groups;
label3.Text = Strings.Bench_parameters;
label4.Text = Strings.Procedures;
label5.Text = Strings.Water_meter_types;
label6.Text = Strings.Water_meter_data;
okButton.Text = Strings.OkBtnText;
cancelButton.Text = Strings.CancelBtnText;
testConnBenchBtn.Text = Strings.Test_connection;
testConnProceduresBtn.Text = Strings.Test_connection;
testConnUsersBtn.Text = Strings.Test_connection;
testConnWaterMetersBtn.Text = Strings.Test_connection;
testConnWMTypesBtn.Text = Strings.Test_connection;
createBenchDbBtn.Text = Strings.Create_DB;
createProceduresDbBtn.Text = Strings.Create_DB;
createUsersDbBtn.Text = Strings.Create_DB;
createWaterMetersDbBtn.Text = Strings.Create_DB;
createWMTypesDbBtn.Text = Strings.Create_DB;
}
private void BenchSettingsDlg_Load(object sender, EventArgs e)
{
Localize();
benchNameTextBox.Text = bench.BenchName;
realBenchCheckBox.Checked = bench.IsRealBench;
/// Initialize 'Database type' combo-boxes
for (int i = 0; i < (int)DBType.DbTypesCount; i++)
{
DBType dbType = (DBType)i;
usersDbTypeComboBox.Items.Add(dbType);
benchDbTypeComboBox.Items.Add(dbType);
proceduresDbTypeComboBox.Items.Add(dbType);
wmTypesDbTypeComboBox.Items.Add(dbType);
watermetersDbTypeComboBox.Items.Add(dbType);
}
usersDbTypeComboBox.SelectedIndex = (int)bench.UsersDBSettings.DbType;
benchDbTypeComboBox.SelectedIndex = (int)bench.BenchDBSettings.DbType;
proceduresDbTypeComboBox.SelectedIndex = (int)bench.ProceduresDBSettings.DbType;
wmTypesDbTypeComboBox.SelectedIndex = (int)bench.WMTypesDBSettings.DbType;
watermetersDbTypeComboBox.SelectedIndex = (int)bench.WaterMetersDBSettings.DbType;
/// Initialize connection strings
usersConnectionStringTextBox.Text = bench.UsersDBSettings.ConnectionString;
benchConnectionStringTextBox.Text = bench.BenchDBSettings.ConnectionString;
proceduresConnectionStringTextBox.Text = bench.ProceduresDBSettings.ConnectionString;
wmTypesConnectionStringTextBox.Text = bench.WMTypesDBSettings.ConnectionString;
watermetersConnectionStringTextBox.Text = bench.WaterMetersDBSettings.ConnectionString;
}
bool UpdateBenchFromUIControls()
{
for (int i = 0; i < Program.LocalSettings.BenchesCount; i++)
{
if (bench != Program.LocalSettings.TestBenches[i] &&
benchNameTextBox.Text == Program.LocalSettings.TestBenches[i].BenchName)
{
MessageBox.Show(Strings.Bench_name_conflict_Use_another_name_pls, Strings.Error, MessageBoxButtons.OK);
return false;
}
}
bench.BenchName = benchNameTextBox.Text;
bench.IsRealBench = realBenchCheckBox.Checked;
bench.UsersDBSettings.ConnectionString = usersConnectionStringTextBox.Text;
bench.BenchDBSettings.ConnectionString = benchConnectionStringTextBox.Text;
bench.ProceduresDBSettings.ConnectionString = proceduresConnectionStringTextBox.Text;
bench.WMTypesDBSettings.ConnectionString = wmTypesConnectionStringTextBox.Text;
bench.WaterMetersDBSettings.ConnectionString = watermetersConnectionStringTextBox.Text;
bench.UsersDBSettings.DbType = (DBType)usersDbTypeComboBox.SelectedIndex;
bench.BenchDBSettings.DbType = (DBType)benchDbTypeComboBox.SelectedIndex;
bench.ProceduresDBSettings.DbType = (DBType)proceduresDbTypeComboBox.SelectedIndex;
bench.WMTypesDBSettings.DbType = (DBType)wmTypesDbTypeComboBox.SelectedIndex;
bench.WaterMetersDBSettings.DbType = (DBType)watermetersDbTypeComboBox.SelectedIndex;
return true;
}
/// <summary>
/// Update bench DB setting, return 'OK'
/// </summary>
/// <param name="sender">Not used</param>
/// <param name="e">Not used</param>
private void okButton_Click(object sender, EventArgs e)
{
if (UpdateBenchFromUIControls())
{
DialogResult = DialogResult.OK;
Close();
return;
}
DialogResult = DialogResult.None;
}
/// <summary>
/// Throw away changes, return 'Cancel'
/// </summary>
/// <param name="sender">Not used</param>
/// <param name="e">Not used</param>
private void cancelButton_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
Close();
}
private void createDatabasesButton_Click(object sender, EventArgs e)
{
if (!UpdateBenchFromUIControls()) return;
if (DialogResult.OK == MessageBox.Show(Strings.DB_will_be_overwritten + Environment.NewLine +
Strings.Do_you_want_to_proceed, Strings.Warning,
MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation))
try
{
Cursor.Current = Cursors.WaitCursor;
FluentCommon.CreateEmptyUsersDB(bench.UsersDBSettings);
MessageBox.Show(Strings.DB_was_successfully_created, Strings.Notification);
Cursor.Current = Cursors.Default;
DialogResult = DialogResult.None;
}
catch (Exception exception)
{
Cursor.Current = Cursors.Default;
MessageBox.Show(Strings.Error_while_creating_DB_Reason + exception.Message, Strings.Error);
}
}
private void createbenchDbBtn_Click(object sender, EventArgs e)
{
if (!UpdateBenchFromUIControls()) return;
if (DialogResult.OK == MessageBox.Show(Strings.DB_will_be_overwritten + Environment.NewLine +
Strings.Do_you_want_to_proceed, Strings.Warning,
MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation))
try
{
Cursor.Current = Cursors.WaitCursor;
FluentCommon.CreateEmptyBenchDB(bench.BenchDBSettings);
MessageBox.Show(Strings.DB_was_successfully_created, Strings.Notification);
Cursor.Current = Cursors.Default;
DialogResult = DialogResult.None;
}
catch (Exception exception)
{
Cursor.Current = Cursors.Default;
MessageBox.Show(Strings.Error_while_creating_DB_Reason + exception.Message, Strings.Error);
}
}
private void createProecduresDbBtn_Click(object sender, EventArgs e)
{
if (!UpdateBenchFromUIControls()) return;
if (DialogResult.OK == MessageBox.Show(Strings.DB_will_be_overwritten + Environment.NewLine +
Strings.Do_you_want_to_proceed, Strings.Warning,
MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation))
try
{
Cursor.Current = Cursors.WaitCursor;
FluentCommon.CreateEmptyProceduresDB(bench.ProceduresDBSettings);
MessageBox.Show(Strings.DB_was_successfully_created, Strings.Notification);
Cursor.Current = Cursors.Default;
DialogResult = DialogResult.None;
}
catch (Exception exception)
{
Cursor.Current = Cursors.Default;
MessageBox.Show(Strings.Error_while_creating_DB_Reason + exception.Message, Strings.Error);
}
}
private void createWMTypesDbBtn_Click(object sender, EventArgs e)
{
}
private void createWaterMetersDbBtn_Click(object sender, EventArgs e)
{
if (!UpdateBenchFromUIControls()) return;
if (DialogResult.OK == MessageBox.Show(Strings.DB_will_be_overwritten + Environment.NewLine +
Strings.Do_you_want_to_proceed, Strings.Warning,
MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation))
try
{
Cursor.Current = Cursors.WaitCursor;
FluentCommon.CreateEmptyWaterMetersDB(bench.WaterMetersDBSettings);
MessageBox.Show(Strings.DB_was_successfully_created, Strings.Notification);
Cursor.Current = Cursors.Default;
DialogResult = DialogResult.None;
}
catch (Exception exception)
{
Cursor.Current = Cursors.Default;
MessageBox.Show(Strings.Error_while_creating_DB_Reason + exception.Message, Strings.Error);
}
}
private void testConnUsersBtn_Click(object sender, EventArgs e)
{
}
private void testConnBenchBtn_Click(object sender, EventArgs e)
{
}
private void testConnProceduresBtn_Click(object sender, EventArgs e)
{
}
private void testConnWMTypesBtn_Click(object sender, EventArgs e)
{
}
private void testConnWaterMetersBtn_Click(object sender, EventArgs e)
{
}
}
}
+930
View File
@@ -0,0 +1,930 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="okButton.Location" type="System.Drawing.Point, System.Drawing">
<value>614, 15</value>
</data>
<data name="okButton.Size" type="System.Drawing.Size, System.Drawing">
<value>217, 28</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="okButton.TabIndex" type="System.Int32, mscorlib">
<value>14</value>
</data>
<data name="okButton.Text" xml:space="preserve">
<value>OK</value>
</data>
<data name="&gt;&gt;okButton.Name" xml:space="preserve">
<value>okButton</value>
</data>
<data name="&gt;&gt;okButton.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;okButton.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;okButton.ZOrder" xml:space="preserve">
<value>30</value>
</data>
<data name="cancelButton.Location" type="System.Drawing.Point, System.Drawing">
<value>614, 49</value>
</data>
<data name="cancelButton.Size" type="System.Drawing.Size, System.Drawing">
<value>217, 28</value>
</data>
<data name="cancelButton.TabIndex" type="System.Int32, mscorlib">
<value>13</value>
</data>
<data name="cancelButton.Text" xml:space="preserve">
<value>Cancel</value>
</data>
<data name="&gt;&gt;cancelButton.Name" xml:space="preserve">
<value>cancelButton</value>
</data>
<data name="&gt;&gt;cancelButton.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;cancelButton.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;cancelButton.ZOrder" xml:space="preserve">
<value>31</value>
</data>
<data name="label1.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label1.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 18</value>
</data>
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>93, 13</value>
</data>
<data name="label1.TabIndex" type="System.Int32, mscorlib">
<value>15</value>
</data>
<data name="label1.Text" xml:space="preserve">
<value>Test Bench Name</value>
</data>
<data name="&gt;&gt;label1.Name" xml:space="preserve">
<value>label1</value>
</data>
<data name="&gt;&gt;label1.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;label1.ZOrder" xml:space="preserve">
<value>29</value>
</data>
<data name="benchNameTextBox.Location" type="System.Drawing.Point, System.Drawing">
<value>116, 15</value>
</data>
<data name="benchNameTextBox.Size" type="System.Drawing.Size, System.Drawing">
<value>315, 20</value>
</data>
<data name="benchNameTextBox.TabIndex" type="System.Int32, mscorlib">
<value>16</value>
</data>
<data name="&gt;&gt;benchNameTextBox.Name" xml:space="preserve">
<value>benchNameTextBox</value>
</data>
<data name="&gt;&gt;benchNameTextBox.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;benchNameTextBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;benchNameTextBox.ZOrder" xml:space="preserve">
<value>28</value>
</data>
<data name="usersConnectionStringTextBox.Location" type="System.Drawing.Point, System.Drawing">
<value>202, 101</value>
</data>
<data name="usersConnectionStringTextBox.Size" type="System.Drawing.Size, System.Drawing">
<value>406, 20</value>
</data>
<data name="usersConnectionStringTextBox.TabIndex" type="System.Int32, mscorlib">
<value>17</value>
</data>
<data name="&gt;&gt;usersConnectionStringTextBox.Name" xml:space="preserve">
<value>usersConnectionStringTextBox</value>
</data>
<data name="&gt;&gt;usersConnectionStringTextBox.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;usersConnectionStringTextBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;usersConnectionStringTextBox.ZOrder" xml:space="preserve">
<value>27</value>
</data>
<data name="connectionStringLabel.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="connectionStringLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>199, 82</value>
</data>
<data name="connectionStringLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>89, 13</value>
</data>
<data name="connectionStringLabel.TabIndex" type="System.Int32, mscorlib">
<value>18</value>
</data>
<data name="connectionStringLabel.Text" xml:space="preserve">
<value>Connection string</value>
</data>
<data name="&gt;&gt;connectionStringLabel.Name" xml:space="preserve">
<value>connectionStringLabel</value>
</data>
<data name="&gt;&gt;connectionStringLabel.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;connectionStringLabel.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;connectionStringLabel.ZOrder" xml:space="preserve">
<value>26</value>
</data>
<data name="benchConnectionStringTextBox.Location" type="System.Drawing.Point, System.Drawing">
<value>202, 127</value>
</data>
<data name="benchConnectionStringTextBox.Size" type="System.Drawing.Size, System.Drawing">
<value>406, 20</value>
</data>
<data name="benchConnectionStringTextBox.TabIndex" type="System.Int32, mscorlib">
<value>19</value>
</data>
<data name="&gt;&gt;benchConnectionStringTextBox.Name" xml:space="preserve">
<value>benchConnectionStringTextBox</value>
</data>
<data name="&gt;&gt;benchConnectionStringTextBox.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;benchConnectionStringTextBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;benchConnectionStringTextBox.ZOrder" xml:space="preserve">
<value>25</value>
</data>
<data name="proceduresConnectionStringTextBox.Location" type="System.Drawing.Point, System.Drawing">
<value>202, 153</value>
</data>
<data name="proceduresConnectionStringTextBox.Size" type="System.Drawing.Size, System.Drawing">
<value>406, 20</value>
</data>
<data name="proceduresConnectionStringTextBox.TabIndex" type="System.Int32, mscorlib">
<value>20</value>
</data>
<data name="&gt;&gt;proceduresConnectionStringTextBox.Name" xml:space="preserve">
<value>proceduresConnectionStringTextBox</value>
</data>
<data name="&gt;&gt;proceduresConnectionStringTextBox.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;proceduresConnectionStringTextBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;proceduresConnectionStringTextBox.ZOrder" xml:space="preserve">
<value>24</value>
</data>
<data name="wmTypesConnectionStringTextBox.Location" type="System.Drawing.Point, System.Drawing">
<value>202, 179</value>
</data>
<data name="wmTypesConnectionStringTextBox.Size" type="System.Drawing.Size, System.Drawing">
<value>406, 20</value>
</data>
<data name="wmTypesConnectionStringTextBox.TabIndex" type="System.Int32, mscorlib">
<value>21</value>
</data>
<data name="&gt;&gt;wmTypesConnectionStringTextBox.Name" xml:space="preserve">
<value>wmTypesConnectionStringTextBox</value>
</data>
<data name="&gt;&gt;wmTypesConnectionStringTextBox.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;wmTypesConnectionStringTextBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;wmTypesConnectionStringTextBox.ZOrder" xml:space="preserve">
<value>23</value>
</data>
<data name="watermetersConnectionStringTextBox.Location" type="System.Drawing.Point, System.Drawing">
<value>202, 205</value>
</data>
<data name="watermetersConnectionStringTextBox.Size" type="System.Drawing.Size, System.Drawing">
<value>406, 20</value>
</data>
<data name="watermetersConnectionStringTextBox.TabIndex" type="System.Int32, mscorlib">
<value>22</value>
</data>
<data name="&gt;&gt;watermetersConnectionStringTextBox.Name" xml:space="preserve">
<value>watermetersConnectionStringTextBox</value>
</data>
<data name="&gt;&gt;watermetersConnectionStringTextBox.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;watermetersConnectionStringTextBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;watermetersConnectionStringTextBox.ZOrder" xml:space="preserve">
<value>22</value>
</data>
<data name="label2.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label2.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 104</value>
</data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>90, 13</value>
</data>
<data name="label2.TabIndex" type="System.Int32, mscorlib">
<value>47</value>
</data>
<data name="label2.Text" xml:space="preserve">
<value>Users and groups</value>
</data>
<data name="&gt;&gt;label2.Name" xml:space="preserve">
<value>label2</value>
</data>
<data name="&gt;&gt;label2.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label2.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;label2.ZOrder" xml:space="preserve">
<value>21</value>
</data>
<data name="label3.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label3.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 130</value>
</data>
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>93, 13</value>
</data>
<data name="label3.TabIndex" type="System.Int32, mscorlib">
<value>48</value>
</data>
<data name="label3.Text" xml:space="preserve">
<value>Bench parameters</value>
</data>
<data name="&gt;&gt;label3.Name" xml:space="preserve">
<value>label3</value>
</data>
<data name="&gt;&gt;label3.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label3.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;label3.ZOrder" xml:space="preserve">
<value>20</value>
</data>
<data name="label4.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label4.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 156</value>
</data>
<data name="label4.Size" type="System.Drawing.Size, System.Drawing">
<value>61, 13</value>
</data>
<data name="label4.TabIndex" type="System.Int32, mscorlib">
<value>49</value>
</data>
<data name="label4.Text" xml:space="preserve">
<value>Procedures</value>
</data>
<data name="&gt;&gt;label4.Name" xml:space="preserve">
<value>label4</value>
</data>
<data name="&gt;&gt;label4.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label4.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;label4.ZOrder" xml:space="preserve">
<value>19</value>
</data>
<data name="label5.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label5.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 182</value>
</data>
<data name="label5.Size" type="System.Drawing.Size, System.Drawing">
<value>90, 13</value>
</data>
<data name="label5.TabIndex" type="System.Int32, mscorlib">
<value>50</value>
</data>
<data name="label5.Text" xml:space="preserve">
<value>Watermeter types</value>
</data>
<data name="&gt;&gt;label5.Name" xml:space="preserve">
<value>label5</value>
</data>
<data name="&gt;&gt;label5.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label5.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;label5.ZOrder" xml:space="preserve">
<value>18</value>
</data>
<data name="label6.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label6.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 208</value>
</data>
<data name="label6.Size" type="System.Drawing.Size, System.Drawing">
<value>67, 13</value>
</data>
<data name="label6.TabIndex" type="System.Int32, mscorlib">
<value>51</value>
</data>
<data name="label6.Text" xml:space="preserve">
<value>Watermeters</value>
</data>
<data name="&gt;&gt;label6.Name" xml:space="preserve">
<value>label6</value>
</data>
<data name="&gt;&gt;label6.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label6.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;label6.ZOrder" xml:space="preserve">
<value>17</value>
</data>
<data name="testConnUsersBtn.Location" type="System.Drawing.Point, System.Drawing">
<value>614, 99</value>
</data>
<data name="testConnUsersBtn.Size" type="System.Drawing.Size, System.Drawing">
<value>95, 23</value>
</data>
<data name="testConnUsersBtn.TabIndex" type="System.Int32, mscorlib">
<value>52</value>
</data>
<data name="testConnUsersBtn.Text" xml:space="preserve">
<value>Test Connection</value>
</data>
<data name="&gt;&gt;testConnUsersBtn.Name" xml:space="preserve">
<value>testConnUsersBtn</value>
</data>
<data name="&gt;&gt;testConnUsersBtn.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;testConnUsersBtn.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;testConnUsersBtn.ZOrder" xml:space="preserve">
<value>16</value>
</data>
<data name="createUsersDbBtn.Location" type="System.Drawing.Point, System.Drawing">
<value>711, 99</value>
</data>
<data name="createUsersDbBtn.Size" type="System.Drawing.Size, System.Drawing">
<value>120, 23</value>
</data>
<data name="createUsersDbBtn.TabIndex" type="System.Int32, mscorlib">
<value>53</value>
</data>
<data name="createUsersDbBtn.Text" xml:space="preserve">
<value>Create DB</value>
</data>
<data name="&gt;&gt;createUsersDbBtn.Name" xml:space="preserve">
<value>createUsersDbBtn</value>
</data>
<data name="&gt;&gt;createUsersDbBtn.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;createUsersDbBtn.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;createUsersDbBtn.ZOrder" xml:space="preserve">
<value>15</value>
</data>
<data name="realBenchCheckBox.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="realBenchCheckBox.Location" type="System.Drawing.Point, System.Drawing">
<value>116, 47</value>
</data>
<data name="realBenchCheckBox.Size" type="System.Drawing.Size, System.Drawing">
<value>219, 17</value>
</data>
<data name="realBenchCheckBox.TabIndex" type="System.Int32, mscorlib">
<value>54</value>
</data>
<data name="realBenchCheckBox.Text" xml:space="preserve">
<value>Test bench is controlled by this computer</value>
</data>
<data name="&gt;&gt;realBenchCheckBox.Name" xml:space="preserve">
<value>realBenchCheckBox</value>
</data>
<data name="&gt;&gt;realBenchCheckBox.Type" xml:space="preserve">
<value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;realBenchCheckBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;realBenchCheckBox.ZOrder" xml:space="preserve">
<value>14</value>
</data>
<data name="dbTypeLabel.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="dbTypeLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>113, 82</value>
</data>
<data name="dbTypeLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>76, 13</value>
</data>
<data name="dbTypeLabel.TabIndex" type="System.Int32, mscorlib">
<value>55</value>
</data>
<data name="dbTypeLabel.Text" xml:space="preserve">
<value>Database type</value>
</data>
<data name="&gt;&gt;dbTypeLabel.Name" xml:space="preserve">
<value>dbTypeLabel</value>
</data>
<data name="&gt;&gt;dbTypeLabel.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;dbTypeLabel.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;dbTypeLabel.ZOrder" xml:space="preserve">
<value>13</value>
</data>
<data name="usersDbTypeComboBox.Location" type="System.Drawing.Point, System.Drawing">
<value>116, 101</value>
</data>
<data name="usersDbTypeComboBox.Size" type="System.Drawing.Size, System.Drawing">
<value>80, 21</value>
</data>
<data name="usersDbTypeComboBox.TabIndex" type="System.Int32, mscorlib">
<value>56</value>
</data>
<data name="&gt;&gt;usersDbTypeComboBox.Name" xml:space="preserve">
<value>usersDbTypeComboBox</value>
</data>
<data name="&gt;&gt;usersDbTypeComboBox.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;usersDbTypeComboBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;usersDbTypeComboBox.ZOrder" xml:space="preserve">
<value>12</value>
</data>
<data name="benchDbTypeComboBox.Location" type="System.Drawing.Point, System.Drawing">
<value>116, 127</value>
</data>
<data name="benchDbTypeComboBox.Size" type="System.Drawing.Size, System.Drawing">
<value>80, 21</value>
</data>
<data name="benchDbTypeComboBox.TabIndex" type="System.Int32, mscorlib">
<value>57</value>
</data>
<data name="&gt;&gt;benchDbTypeComboBox.Name" xml:space="preserve">
<value>benchDbTypeComboBox</value>
</data>
<data name="&gt;&gt;benchDbTypeComboBox.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;benchDbTypeComboBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;benchDbTypeComboBox.ZOrder" xml:space="preserve">
<value>11</value>
</data>
<data name="proceduresDbTypeComboBox.Location" type="System.Drawing.Point, System.Drawing">
<value>116, 153</value>
</data>
<data name="proceduresDbTypeComboBox.Size" type="System.Drawing.Size, System.Drawing">
<value>80, 21</value>
</data>
<data name="proceduresDbTypeComboBox.TabIndex" type="System.Int32, mscorlib">
<value>58</value>
</data>
<data name="&gt;&gt;proceduresDbTypeComboBox.Name" xml:space="preserve">
<value>proceduresDbTypeComboBox</value>
</data>
<data name="&gt;&gt;proceduresDbTypeComboBox.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;proceduresDbTypeComboBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;proceduresDbTypeComboBox.ZOrder" xml:space="preserve">
<value>10</value>
</data>
<data name="wmTypesDbTypeComboBox.Location" type="System.Drawing.Point, System.Drawing">
<value>116, 179</value>
</data>
<data name="wmTypesDbTypeComboBox.Size" type="System.Drawing.Size, System.Drawing">
<value>80, 21</value>
</data>
<data name="wmTypesDbTypeComboBox.TabIndex" type="System.Int32, mscorlib">
<value>59</value>
</data>
<data name="&gt;&gt;wmTypesDbTypeComboBox.Name" xml:space="preserve">
<value>wmTypesDbTypeComboBox</value>
</data>
<data name="&gt;&gt;wmTypesDbTypeComboBox.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;wmTypesDbTypeComboBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;wmTypesDbTypeComboBox.ZOrder" xml:space="preserve">
<value>9</value>
</data>
<data name="watermetersDbTypeComboBox.Location" type="System.Drawing.Point, System.Drawing">
<value>116, 205</value>
</data>
<data name="watermetersDbTypeComboBox.Size" type="System.Drawing.Size, System.Drawing">
<value>80, 21</value>
</data>
<data name="watermetersDbTypeComboBox.TabIndex" type="System.Int32, mscorlib">
<value>60</value>
</data>
<data name="&gt;&gt;watermetersDbTypeComboBox.Name" xml:space="preserve">
<value>watermetersDbTypeComboBox</value>
</data>
<data name="&gt;&gt;watermetersDbTypeComboBox.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;watermetersDbTypeComboBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;watermetersDbTypeComboBox.ZOrder" xml:space="preserve">
<value>8</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="testConnBenchBtn.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="testConnBenchBtn.Location" type="System.Drawing.Point, System.Drawing">
<value>614, 125</value>
</data>
<data name="testConnBenchBtn.Size" type="System.Drawing.Size, System.Drawing">
<value>95, 23</value>
</data>
<data name="testConnBenchBtn.TabIndex" type="System.Int32, mscorlib">
<value>61</value>
</data>
<data name="testConnBenchBtn.Text" xml:space="preserve">
<value>Test Connection</value>
</data>
<data name="&gt;&gt;testConnBenchBtn.Name" xml:space="preserve">
<value>testConnBenchBtn</value>
</data>
<data name="&gt;&gt;testConnBenchBtn.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;testConnBenchBtn.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;testConnBenchBtn.ZOrder" xml:space="preserve">
<value>7</value>
</data>
<data name="testConnProceduresBtn.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="testConnProceduresBtn.Location" type="System.Drawing.Point, System.Drawing">
<value>614, 151</value>
</data>
<data name="testConnProceduresBtn.Size" type="System.Drawing.Size, System.Drawing">
<value>95, 23</value>
</data>
<data name="testConnProceduresBtn.TabIndex" type="System.Int32, mscorlib">
<value>62</value>
</data>
<data name="testConnProceduresBtn.Text" xml:space="preserve">
<value>Test Connection</value>
</data>
<data name="&gt;&gt;testConnProceduresBtn.Name" xml:space="preserve">
<value>testConnProceduresBtn</value>
</data>
<data name="&gt;&gt;testConnProceduresBtn.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;testConnProceduresBtn.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;testConnProceduresBtn.ZOrder" xml:space="preserve">
<value>6</value>
</data>
<data name="testConnWMTypesBtn.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="testConnWMTypesBtn.Location" type="System.Drawing.Point, System.Drawing">
<value>614, 177</value>
</data>
<data name="testConnWMTypesBtn.Size" type="System.Drawing.Size, System.Drawing">
<value>95, 23</value>
</data>
<data name="testConnWMTypesBtn.TabIndex" type="System.Int32, mscorlib">
<value>63</value>
</data>
<data name="testConnWMTypesBtn.Text" xml:space="preserve">
<value>Test Connection</value>
</data>
<data name="&gt;&gt;testConnWMTypesBtn.Name" xml:space="preserve">
<value>testConnWMTypesBtn</value>
</data>
<data name="&gt;&gt;testConnWMTypesBtn.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;testConnWMTypesBtn.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;testConnWMTypesBtn.ZOrder" xml:space="preserve">
<value>5</value>
</data>
<data name="testConnWaterMetersBtn.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="testConnWaterMetersBtn.Location" type="System.Drawing.Point, System.Drawing">
<value>614, 203</value>
</data>
<data name="testConnWaterMetersBtn.Size" type="System.Drawing.Size, System.Drawing">
<value>95, 23</value>
</data>
<data name="testConnWaterMetersBtn.TabIndex" type="System.Int32, mscorlib">
<value>64</value>
</data>
<data name="testConnWaterMetersBtn.Text" xml:space="preserve">
<value>Test Connection</value>
</data>
<data name="&gt;&gt;testConnWaterMetersBtn.Name" xml:space="preserve">
<value>testConnWaterMetersBtn</value>
</data>
<data name="&gt;&gt;testConnWaterMetersBtn.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;testConnWaterMetersBtn.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;testConnWaterMetersBtn.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="createBenchDbBtn.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="createBenchDbBtn.Location" type="System.Drawing.Point, System.Drawing">
<value>711, 124</value>
</data>
<data name="createBenchDbBtn.Size" type="System.Drawing.Size, System.Drawing">
<value>120, 23</value>
</data>
<data name="createBenchDbBtn.TabIndex" type="System.Int32, mscorlib">
<value>65</value>
</data>
<data name="createBenchDbBtn.Text" xml:space="preserve">
<value>Create DB</value>
</data>
<data name="&gt;&gt;createBenchDbBtn.Name" xml:space="preserve">
<value>createBenchDbBtn</value>
</data>
<data name="&gt;&gt;createBenchDbBtn.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;createBenchDbBtn.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;createBenchDbBtn.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="createProceduresDbBtn.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="createProceduresDbBtn.Location" type="System.Drawing.Point, System.Drawing">
<value>711, 150</value>
</data>
<data name="createProceduresDbBtn.Size" type="System.Drawing.Size, System.Drawing">
<value>120, 23</value>
</data>
<data name="createProceduresDbBtn.TabIndex" type="System.Int32, mscorlib">
<value>66</value>
</data>
<data name="createProceduresDbBtn.Text" xml:space="preserve">
<value>Create DB</value>
</data>
<data name="&gt;&gt;createProceduresDbBtn.Name" xml:space="preserve">
<value>createProceduresDbBtn</value>
</data>
<data name="&gt;&gt;createProceduresDbBtn.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;createProceduresDbBtn.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;createProceduresDbBtn.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="createWMTypesDbBtn.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="createWMTypesDbBtn.Location" type="System.Drawing.Point, System.Drawing">
<value>711, 176</value>
</data>
<data name="createWMTypesDbBtn.Size" type="System.Drawing.Size, System.Drawing">
<value>120, 23</value>
</data>
<data name="createWMTypesDbBtn.TabIndex" type="System.Int32, mscorlib">
<value>67</value>
</data>
<data name="createWMTypesDbBtn.Text" xml:space="preserve">
<value>Create DB</value>
</data>
<data name="&gt;&gt;createWMTypesDbBtn.Name" xml:space="preserve">
<value>createWMTypesDbBtn</value>
</data>
<data name="&gt;&gt;createWMTypesDbBtn.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;createWMTypesDbBtn.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;createWMTypesDbBtn.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="createWaterMetersDbBtn.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="createWaterMetersDbBtn.Location" type="System.Drawing.Point, System.Drawing">
<value>711, 202</value>
</data>
<data name="createWaterMetersDbBtn.Size" type="System.Drawing.Size, System.Drawing">
<value>120, 23</value>
</data>
<data name="createWaterMetersDbBtn.TabIndex" type="System.Int32, mscorlib">
<value>68</value>
</data>
<data name="createWaterMetersDbBtn.Text" xml:space="preserve">
<value>Create DB</value>
</data>
<data name="&gt;&gt;createWaterMetersDbBtn.Name" xml:space="preserve">
<value>createWaterMetersDbBtn</value>
</data>
<data name="&gt;&gt;createWaterMetersDbBtn.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;createWaterMetersDbBtn.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;createWaterMetersDbBtn.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 13</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>836, 241</value>
</data>
<data name="$this.StartPosition" type="System.Windows.Forms.FormStartPosition, System.Windows.Forms">
<value>CenterParent</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>Test Bench Databases Specification</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>DatabaseSettingsDlg</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root>
+78
View File
@@ -0,0 +1,78 @@
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;
}
}
}
+71
View File
@@ -0,0 +1,71 @@
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;
}
}
}
@@ -0,0 +1,20 @@
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;
}
}
}
+20
View File
@@ -0,0 +1,20 @@
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;
}
}
}
+85
View File
@@ -0,0 +1,85 @@
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,
}
}
+69
View File
@@ -0,0 +1,69 @@
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;
}
}
}
+12
View File
@@ -0,0 +1,12 @@
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; }
}
}
+9
View File
@@ -0,0 +1,9 @@
namespace ResultsBrowser.Entities
{
interface IHasItemNr
{
int Id { get; }
int ItemNr { get; set; }
}
}
+9
View File
@@ -0,0 +1,9 @@
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
}
}
@@ -0,0 +1,11 @@
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; }
}
}
@@ -0,0 +1,51 @@
using System;
namespace ResultsBrowser.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 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 PulsesMaster { get; set; }
public virtual float Time { get; set; } /// sec.
public virtual bool Passed { get; set; } /// true = test passed
public MeterTestResult()
{
}
public MeterTestResult(TestResult testResult)
: this()
{
TestResult = testResult;
}
public virtual MeterTestResult Clone(TestResult testResult)
{
MeterTestResult result = new MeterTestResult(testResult);
result.SerialNr = SerialNr;
result.EndState = EndState;
result.VolumeStart = VolumeStart;
result.VolumeEnd = VolumeEnd;
result.VolumeMeter = VolumeMeter;
result.VolumeRef = VolumeRef;
result.VolumeErrorPct = VolumeErrorPct;
result.PulsesMeter = PulsesMeter;
result.PulsesMaster = PulsesMaster;
result.Time = Time;
result.Passed = Passed;
return result;
}
}
}
+157
View File
@@ -0,0 +1,157 @@
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;
}
}
}
+91
View File
@@ -0,0 +1,91 @@
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;
}
}
}
+90
View File
@@ -0,0 +1,90 @@
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;
}
}
}
@@ -0,0 +1,28 @@
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;
}
}
}
+97
View File
@@ -0,0 +1,97 @@
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;
}
}
}
+161
View File
@@ -0,0 +1,161 @@
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;
}
}
}
@@ -0,0 +1,37 @@
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;
}
}
}
+58
View File
@@ -0,0 +1,58 @@
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;
}
}
}
+257
View File
@@ -0,0 +1,257 @@
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;
}
}
}
@@ -0,0 +1,35 @@
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;
}
}
}
@@ -0,0 +1,36 @@
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;
}
}
}
+75
View File
@@ -0,0 +1,75 @@
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;
}
}
}
+38
View File
@@ -0,0 +1,38 @@
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;
}
}
}
+316
View File
@@ -0,0 +1,316 @@
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;
}
}
}
-144
View File
@@ -1,144 +0,0 @@
namespace ResultsBrowser.Forms
{
partial class DatabaseSettings
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.textBox10 = new System.Windows.Forms.TextBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.textBox11 = new System.Windows.Forms.TextBox();
this.label3 = new System.Windows.Forms.Label();
this.textBox12 = new System.Windows.Forms.TextBox();
this.okButton = new System.Windows.Forms.Button();
this.cancelButton = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// textBox10
//
this.textBox10.Location = new System.Drawing.Point(85, 23);
this.textBox10.Name = "textBox10";
this.textBox10.Size = new System.Drawing.Size(555, 20);
this.textBox10.TabIndex = 0;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(26, 26);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(38, 13);
this.label1.TabIndex = 1;
this.label1.Text = "WR10";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(26, 52);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(38, 13);
this.label2.TabIndex = 3;
this.label2.Text = "WR11";
//
// textBox11
//
this.textBox11.Location = new System.Drawing.Point(85, 49);
this.textBox11.Name = "textBox11";
this.textBox11.Size = new System.Drawing.Size(555, 20);
this.textBox11.TabIndex = 2;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(26, 78);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(38, 13);
this.label3.TabIndex = 5;
this.label3.Text = "WR12";
//
// textBox12
//
this.textBox12.Location = new System.Drawing.Point(85, 75);
this.textBox12.Name = "textBox12";
this.textBox12.Size = new System.Drawing.Size(555, 20);
this.textBox12.TabIndex = 4;
//
// okButton
//
this.okButton.Location = new System.Drawing.Point(434, 109);
this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(95, 38);
this.okButton.TabIndex = 6;
this.okButton.Text = "OK";
this.okButton.UseVisualStyleBackColor = true;
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// cancelButton
//
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelButton.Location = new System.Drawing.Point(545, 109);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(95, 38);
this.cancelButton.TabIndex = 7;
this.cancelButton.Text = "Cancel";
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
//
// DatabaseSettings
//
this.AcceptButton = this.okButton;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.cancelButton;
this.ClientSize = new System.Drawing.Size(668, 159);
this.Controls.Add(this.cancelButton);
this.Controls.Add(this.okButton);
this.Controls.Add(this.label3);
this.Controls.Add(this.textBox12);
this.Controls.Add(this.label2);
this.Controls.Add(this.textBox11);
this.Controls.Add(this.label1);
this.Controls.Add(this.textBox10);
this.Name = "DatabaseSettings";
this.Text = "Database Settings";
this.Load += new System.EventHandler(this.DatabaseSettings_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.TextBox textBox10;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox textBox11;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox textBox12;
private System.Windows.Forms.Button okButton;
private System.Windows.Forms.Button cancelButton;
}
}
-44
View File
@@ -1,44 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace ResultsBrowser.Forms
{
public partial class DatabaseSettings : Form
{
public DatabaseSettings()
{
InitializeComponent();
}
private void DatabaseSettings_Load(object sender, EventArgs e)
{
textBox10.Text = Program.LocalSettings.ConnectionString_WR10;
textBox11.Text = Program.LocalSettings.ConnectionString_WR11;
textBox12.Text = Program.LocalSettings.ConnectionString_WR12;
}
private void okButton_Click(object sender, EventArgs e)
{
Program.LocalSettings.ConnectionString_WR10 = textBox10.Text;
Program.LocalSettings.ConnectionString_WR11 = textBox11.Text;
Program.LocalSettings.ConnectionString_WR12 = textBox12.Text;
Program.LocalSettings.Save();
DialogResult = DialogResult.OK;
Close();
}
private void cancelButton_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
Close();
}
}
}
+107
View File
@@ -0,0 +1,107 @@
namespace ResultsBrowser.Forms
{
partial class LoginDlg
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LoginDlg));
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.passwordTextBox = new System.Windows.Forms.TextBox();
this.cancelButton = new System.Windows.Forms.Button();
this.okButton = new System.Windows.Forms.Button();
this.userNameTextBox = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// label1
//
resources.ApplyResources(this.label1, "label1");
this.label1.Name = "label1";
//
// label2
//
resources.ApplyResources(this.label2, "label2");
this.label2.Name = "label2";
//
// passwordTextBox
//
resources.ApplyResources(this.passwordTextBox, "passwordTextBox");
this.passwordTextBox.Name = "passwordTextBox";
this.passwordTextBox.UseSystemPasswordChar = true;
//
// cancelButton
//
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
resources.ApplyResources(this.cancelButton, "cancelButton");
this.cancelButton.Name = "cancelButton";
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
//
// okButton
//
this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK;
resources.ApplyResources(this.okButton, "okButton");
this.okButton.Name = "okButton";
this.okButton.UseVisualStyleBackColor = true;
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// userNameTextBox
//
resources.ApplyResources(this.userNameTextBox, "userNameTextBox");
this.userNameTextBox.Name = "userNameTextBox";
//
// LoginDlg
//
this.AcceptButton = this.okButton;
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.cancelButton;
this.Controls.Add(this.userNameTextBox);
this.Controls.Add(this.okButton);
this.Controls.Add(this.cancelButton);
this.Controls.Add(this.passwordTextBox);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Name = "LoginDlg";
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.Load += new System.EventHandler(this.LoginDlg_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox userNameTextBox;
private System.Windows.Forms.TextBox passwordTextBox;
private System.Windows.Forms.Button cancelButton;
private System.Windows.Forms.Button okButton;
}
}
+137
View File
@@ -0,0 +1,137 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using ResultsBrowser.Resources;
namespace ResultsBrowser.Forms
{
/// <summary>
/// Provides login dialog as well as user authorization using TBF.User.Authorize(...)
/// (i.e. when DialogResult is OK, user was authorized).
/// </summary>
public partial class LoginDlg : Form
{
// Private fields
string user;
string password;
Grp.GID requiredGroupMembership = Grp.GID.Invalid;
bool noDatabase;
/// <summary>
/// Constructor.
/// </summary>
public LoginDlg()
{
InitializeComponent();
}
/// <summary>
/// Constructor with a predefined user.
/// </summary>
public LoginDlg(string predefinedUser)
: this()
{
user = predefinedUser;
userNameTextBox.Text = predefinedUser;
}
/// <summary>
/// Constructor with 'no Database' flag.
/// </summary>
public LoginDlg(bool noDatabase)
: this()
{
this.noDatabase = noDatabase;
}
/// <summary>
/// Constructor when a specific group membership is required.
/// </summary>
public LoginDlg(Grp.GID requiredGroupMembership)
: this()
{
this.requiredGroupMembership = requiredGroupMembership;
}
/// <summary>
/// Constructor with a predefined user when a specific group membership is required.
/// </summary>
public LoginDlg(string predefinedUser, Grp.GID requiredGroupMembership)
: this()
{
user = predefinedUser;
userNameTextBox.Text = predefinedUser;
this.requiredGroupMembership = requiredGroupMembership;
}
private void LoginDlg_Load(object sender, EventArgs e)
{
Text = Strings.User_Login;
label1.Text = Strings.Username;
label2.Text = Strings.Password;
okButton.Text = Strings.OkBtnText;
cancelButton.Text = Strings.CancelBtnText;
if (user == null) userNameTextBox.Select();
else passwordTextBox.Select();
}
/// <summary>
/// Try to authorize the user when OK clicked.
/// </summary>
private void okButton_Click(object sender, EventArgs e)
{
user = userNameTextBox.Text;
password = passwordTextBox.Text;
bool authorized = Entities.User.IsPowerUser(user, password);
if (!authorized && !noDatabase)
{
Entities.User loadedUser = Entities.User.LoadUserByName(user);
if (loadedUser != null)
{
if (requiredGroupMembership == Grp.GID.Invalid)
{
authorized = loadedUser.Authorize(user, password);
}
else
{
authorized = loadedUser.Authorize(user, password, requiredGroupMembership);
}
}
}
if (authorized)
{
DialogResult = DialogResult.OK;
Close();
if (Program.MainWnd != null) Program.MainWnd.UpdateUser();
return;
}
MessageBox.Show(Strings.Invalid_username_or_password, Strings.Error, MessageBoxButtons.OK);
DialogResult = DialogResult.None;
return;
}
/// <summary>
/// Cancel clicked, do not try to authorize.
/// </summary>
private void cancelButton_Click(object sender, EventArgs e)
{
if (requiredGroupMembership == Grp.GID.Invalid)
{
Entities.User.Unauthorize();
}
DialogResult = DialogResult.Cancel;
Close();
return;
}
}
}
+142
View File
@@ -0,0 +1,142 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 13</value>
</data>
<data name="label1.Text" xml:space="preserve">
<value>Benutzername</value>
</data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>50, 13</value>
</data>
<data name="label2.Text" xml:space="preserve">
<value>Passwort</value>
</data>
<data name="cancelButton.Text" xml:space="preserve">
<value>&amp;Abbrechen</value>
</data>
<data name="okButton.Text" xml:space="preserve">
<value>&amp;OK</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>Anmelden</value>
</data>
</root>
+288
View File
@@ -0,0 +1,288 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="label1.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="passwordTextBox.Size" type="System.Drawing.Size, System.Drawing">
<value>168, 20</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="$this.StartPosition" type="System.Windows.Forms.FormStartPosition, System.Windows.Forms">
<value>CenterScreen</value>
</data>
<data name="&gt;&gt;cancelButton.Name" xml:space="preserve">
<value>cancelButton</value>
</data>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 13</value>
</data>
<data name="&gt;&gt;okButton.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="okButton.Size" type="System.Drawing.Size, System.Drawing">
<value>105, 28</value>
</data>
<data name="&gt;&gt;passwordTextBox.Name" xml:space="preserve">
<value>passwordTextBox</value>
</data>
<data name="cancelButton.Size" type="System.Drawing.Size, System.Drawing">
<value>105, 28</value>
</data>
<data name="label2.Location" type="System.Drawing.Point, System.Drawing">
<value>8, 51</value>
</data>
<data name="passwordTextBox.Location" type="System.Drawing.Point, System.Drawing">
<value>96, 48</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="label1.Text" xml:space="preserve">
<value>User name</value>
</data>
<data name="&gt;&gt;cancelButton.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="&gt;&gt;label2.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="cancelButton.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="passwordTextBox.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="label1.Location" type="System.Drawing.Point, System.Drawing">
<value>8, 24</value>
</data>
<data name="&gt;&gt;label2.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>LoginDlg</value>
</data>
<data name="userNameTextBox.Size" type="System.Drawing.Size, System.Drawing">
<value>168, 20</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>402, 88</value>
</data>
<data name="&gt;&gt;label1.ZOrder" xml:space="preserve">
<value>5</value>
</data>
<data name="okButton.Location" type="System.Drawing.Point, System.Drawing">
<value>285, 14</value>
</data>
<data name="&gt;&gt;okButton.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;label1.Name" xml:space="preserve">
<value>label1</value>
</data>
<data name="&gt;&gt;label2.Name" xml:space="preserve">
<value>label2</value>
</data>
<data name="cancelButton.Text" xml:space="preserve">
<value>Cancel</value>
</data>
<data name="&gt;&gt;cancelButton.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;okButton.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;okButton.Name" xml:space="preserve">
<value>okButton</value>
</data>
<data name="label2.Text" xml:space="preserve">
<value>Password</value>
</data>
<data name="&gt;&gt;passwordTextBox.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label1.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="label1.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>53, 13</value>
</data>
<data name="userNameTextBox.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="cancelButton.Location" type="System.Drawing.Point, System.Drawing">
<value>285, 48</value>
</data>
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>58, 13</value>
</data>
<data name="okButton.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="label2.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="&gt;&gt;passwordTextBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;userNameTextBox.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="okButton.Text" xml:space="preserve">
<value>OK</value>
</data>
<data name="&gt;&gt;userNameTextBox.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;userNameTextBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="userNameTextBox.Location" type="System.Drawing.Point, System.Drawing">
<value>96, 22</value>
</data>
<data name="label2.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="&gt;&gt;cancelButton.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;passwordTextBox.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>User login</value>
</data>
<data name="&gt;&gt;label2.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="&gt;&gt;label1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;userNameTextBox.Name" xml:space="preserve">
<value>userNameTextBox</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>
@@ -0,0 +1,111 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using ResultsBrowser.Resources;
namespace ResultsBrowser.Forms
{
/// <summary>
/// Provides login dialog that includes test bench selection.
/// It is used only once on program startup. Does not do authorisation
/// as User.users have not been loadded from the DB yet.
/// </summary>
public partial class LoginDlgWithBenchSelection : Form
{
// Private fields
string user;
string password;
string benchName = null;
// Readonly public properties to do the authorization.
public string User { get { return user; } }
public string Password { get { return password; } }
public string BenchName { get { return benchName; } }
/// <summary>
/// Constructor.
/// </summary>
public LoginDlgWithBenchSelection()
{
InitializeComponent();
}
/// <summary>
/// Constructor with a predefined bench.
/// </summary>
public LoginDlgWithBenchSelection(string predefinedBench)
: this()
{
benchName = predefinedBench;
}
private void LoginDlgWithBenchSelection_Load(object sender, EventArgs e)
{
#if DEBUG
userNameTextBox.Text = Program.AdminUsername;
passwordTextBox.Text = Program.AdminPassword;
#endif
int nrOfBenches = Program.LocalSettings.testBenches == null ? 0 : Program.LocalSettings.testBenches.GetLength(0);
for (int i = 0; i < nrOfBenches; i++)
{
testBenchComboBox.Items.Add(Program.LocalSettings.testBenches[i].BenchName);
if (benchName != null && benchName == Program.LocalSettings.testBenches[i].BenchName)
{
testBenchComboBox.Text = benchName;
}
}
}
/// <summary>
/// OK clicked (authorization is done outside this dialog).
/// </summary>
private void okButton_Click(object sender, EventArgs e)
{
if (testBenchComboBox.SelectedItem != null)
{
user = userNameTextBox.Text;
password = passwordTextBox.Text;
benchName = testBenchComboBox.SelectedItem.ToString();
DialogResult = DialogResult.OK;
Close();
return;
}
else
{
MessageBox.Show(Strings.PLs_select_testbench, Strings.Warning, MessageBoxButtons.OK);
}
}
/// <summary>
/// Cancel clicked.
/// </summary>
private void cancelButton_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
Close();
return;
}
private void passwordTextBox_TextChanged(object sender, EventArgs e)
{
if (passwordTextBox.Text != "")
{
this.AcceptButton = okButton;
}
}
private void userNameTextBox_KeyPress(object sender, KeyPressEventArgs e)
{
if (Convert.ToInt32(e.KeyChar) == 13)
{
passwordTextBox.Focus();
}
}
}
}
@@ -0,0 +1,145 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 13</value>
</data>
<data name="label1.Text" xml:space="preserve">
<value>Benutzername</value>
</data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>50, 13</value>
</data>
<data name="label2.Text" xml:space="preserve">
<value>Passwort</value>
</data>
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>52, 13</value>
</data>
<data name="label3.Text" xml:space="preserve">
<value>Prüfstand</value>
</data>
<data name="cancelButton.Text" xml:space="preserve">
<value>Abbrechen</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>Anmelden am Prüfstand</value>
</data>
</root>
@@ -0,0 +1,130 @@
namespace ResultsBrowser.Forms
{
partial class LoginDlgWithBenchSelection
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LoginDlgWithBenchSelection));
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.testBenchComboBox = new System.Windows.Forms.ComboBox();
this.passwordTextBox = new System.Windows.Forms.TextBox();
this.cancelButton = new System.Windows.Forms.Button();
this.okButton = new System.Windows.Forms.Button();
this.userNameTextBox = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// label1
//
resources.ApplyResources(this.label1, "label1");
this.label1.ImageKey = global::TBF.Resources.Strings.String1;
this.label1.Name = "label1";
//
// 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";
//
// testBenchComboBox
//
resources.ApplyResources(this.testBenchComboBox, "testBenchComboBox");
this.testBenchComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.testBenchComboBox.FormattingEnabled = true;
this.testBenchComboBox.Name = "testBenchComboBox";
//
// passwordTextBox
//
resources.ApplyResources(this.passwordTextBox, "passwordTextBox");
this.passwordTextBox.Name = "passwordTextBox";
this.passwordTextBox.UseSystemPasswordChar = true;
this.passwordTextBox.TextChanged += new System.EventHandler(this.passwordTextBox_TextChanged);
//
// cancelButton
//
resources.ApplyResources(this.cancelButton, "cancelButton");
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelButton.ImageKey = global::TBF.Resources.Strings.String1;
this.cancelButton.Name = "cancelButton";
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
//
// okButton
//
resources.ApplyResources(this.okButton, "okButton");
this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK;
this.okButton.ImageKey = global::TBF.Resources.Strings.String1;
this.okButton.Name = "okButton";
this.okButton.UseVisualStyleBackColor = true;
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// userNameTextBox
//
resources.ApplyResources(this.userNameTextBox, "userNameTextBox");
this.userNameTextBox.Name = "userNameTextBox";
this.userNameTextBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.userNameTextBox_KeyPress);
//
// LoginDlgWithBenchSelection
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.userNameTextBox);
this.Controls.Add(this.okButton);
this.Controls.Add(this.cancelButton);
this.Controls.Add(this.passwordTextBox);
this.Controls.Add(this.testBenchComboBox);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Name = "LoginDlgWithBenchSelection";
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.Load += new System.EventHandler(this.LoginDlgWithBenchSelection_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox userNameTextBox;
private System.Windows.Forms.TextBox passwordTextBox;
private System.Windows.Forms.ComboBox testBenchComboBox;
private System.Windows.Forms.Button cancelButton;
private System.Windows.Forms.Button okButton;
}
}
@@ -0,0 +1,339 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="label1.Text" xml:space="preserve">
<value>User name</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>402, 102</value>
</data>
<data name="cancelButton.Size" type="System.Drawing.Size, System.Drawing">
<value>105, 28</value>
</data>
<data name="cancelButton.Location" type="System.Drawing.Point, System.Drawing">
<value>285, 48</value>
</data>
<data name="cancelButton.Text" xml:space="preserve">
<value>Cancel</value>
</data>
<data name="&gt;&gt;cancelButton.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;testBenchComboBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>LoginDlgWithBenchSelection</value>
</data>
<data name="&gt;&gt;label1.Name" xml:space="preserve">
<value>label1</value>
</data>
<data name="&gt;&gt;passwordTextBox.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="testBenchComboBox.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="&gt;&gt;label3.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="userNameTextBox.Location" type="System.Drawing.Point, System.Drawing">
<value>96, 15</value>
</data>
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>61, 13</value>
</data>
<data name="&gt;&gt;cancelButton.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="testBenchComboBox.Location" type="System.Drawing.Point, System.Drawing">
<value>96, 67</value>
</data>
<data name="&gt;&gt;label3.Name" xml:space="preserve">
<value>label3</value>
</data>
<data name="label3.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="$this.StartPosition" type="System.Windows.Forms.FormStartPosition, System.Windows.Forms">
<value>CenterScreen</value>
</data>
<data name="&gt;&gt;label1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="label3.Location" type="System.Drawing.Point, System.Drawing">
<value>8, 70</value>
</data>
<data name="&gt;&gt;label1.ZOrder" xml:space="preserve">
<value>7</value>
</data>
<data name="passwordTextBox.Location" type="System.Drawing.Point, System.Drawing">
<value>96, 41</value>
</data>
<data name="&gt;&gt;userNameTextBox.Name" xml:space="preserve">
<value>userNameTextBox</value>
</data>
<data name="label2.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>58, 13</value>
</data>
<data name="&gt;&gt;testBenchComboBox.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="&gt;&gt;label2.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;passwordTextBox.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 13</value>
</data>
<data name="&gt;&gt;label2.ZOrder" xml:space="preserve">
<value>6</value>
</data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>53, 13</value>
</data>
<data name="&gt;&gt;testBenchComboBox.Name" xml:space="preserve">
<value>testBenchComboBox</value>
</data>
<data name="userNameTextBox.Size" type="System.Drawing.Size, System.Drawing">
<value>168, 20</value>
</data>
<data name="okButton.Size" type="System.Drawing.Size, System.Drawing">
<value>105, 28</value>
</data>
<data name="&gt;&gt;userNameTextBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="testBenchComboBox.Size" type="System.Drawing.Size, System.Drawing">
<value>168, 21</value>
</data>
<data name="label1.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="passwordTextBox.Size" type="System.Drawing.Size, System.Drawing">
<value>168, 20</value>
</data>
<data name="&gt;&gt;cancelButton.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="okButton.Location" type="System.Drawing.Point, System.Drawing">
<value>285, 14</value>
</data>
<data name="&gt;&gt;userNameTextBox.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="label3.Text" xml:space="preserve">
<value>Test bench</value>
</data>
<data name="&gt;&gt;okButton.Name" xml:space="preserve">
<value>okButton</value>
</data>
<data name="&gt;&gt;label2.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;okButton.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="&gt;&gt;testBenchComboBox.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="label2.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="userNameTextBox.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="label1.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="&gt;&gt;label2.Name" xml:space="preserve">
<value>label2</value>
</data>
<data name="&gt;&gt;passwordTextBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="passwordTextBox.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="&gt;&gt;cancelButton.Name" xml:space="preserve">
<value>cancelButton</value>
</data>
<data name="label1.Location" type="System.Drawing.Point, System.Drawing">
<value>8, 17</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>User login</value>
</data>
<data name="&gt;&gt;passwordTextBox.Name" xml:space="preserve">
<value>passwordTextBox</value>
</data>
<data name="label2.Text" xml:space="preserve">
<value>Password</value>
</data>
<data name="label3.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="label2.Location" type="System.Drawing.Point, System.Drawing">
<value>8, 44</value>
</data>
<data name="cancelButton.TabIndex" type="System.Int32, mscorlib">
<value>7</value>
</data>
<data name="okButton.Text" xml:space="preserve">
<value>OK</value>
</data>
<data name="&gt;&gt;okButton.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;okButton.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label3.ZOrder" xml:space="preserve">
<value>5</value>
</data>
<data name="&gt;&gt;label1.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="okButton.TabIndex" type="System.Int32, mscorlib">
<value>6</value>
</data>
<data name="&gt;&gt;label3.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;userNameTextBox.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>de</value>
</metadata>
</root>
-237
View File
@@ -1,237 +0,0 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
namespace ResultsBrowser.Forms
{
partial class ResultsConfig
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.okButton = new System.Windows.Forms.Button();
this.cancelButton = new System.Windows.Forms.Button();
this.availableResultsListBox = new System.Windows.Forms.ListBox();
this.selectedResultsListBox = new System.Windows.Forms.ListBox();
this.availableResultsLabel = new System.Windows.Forms.Label();
this.selectedResultsLabel = new System.Windows.Forms.Label();
this.removeAllButton = new System.Windows.Forms.Button();
this.removeButton = new System.Windows.Forms.Button();
this.addButton = new System.Windows.Forms.Button();
this.unlockButton = new System.Windows.Forms.Button();
this.singleRadioButton = new System.Windows.Forms.RadioButton();
this.combinedRadioButton = new System.Windows.Forms.RadioButton();
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// okButton
//
this.okButton.Location = new System.Drawing.Point(283, 57);
this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(104, 30);
this.okButton.TabIndex = 4;
this.okButton.Text = "Close";
this.okButton.UseVisualStyleBackColor = true;
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// cancelButton
//
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelButton.Location = new System.Drawing.Point(283, 94);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(104, 30);
this.cancelButton.TabIndex = 5;
this.cancelButton.Text = "Cancel";
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Visible = false;
//
// availableResultsListBox
//
this.availableResultsListBox.Enabled = false;
this.availableResultsListBox.FormattingEnabled = true;
this.availableResultsListBox.Location = new System.Drawing.Point(12, 162);
this.availableResultsListBox.Name = "availableResultsListBox";
this.availableResultsListBox.Size = new System.Drawing.Size(135, 186);
this.availableResultsListBox.TabIndex = 6;
this.availableResultsListBox.DoubleClick += new System.EventHandler(this.availableResultsListBox_DoubleClick);
//
// selectedResultsListBox
//
this.selectedResultsListBox.Enabled = false;
this.selectedResultsListBox.FormattingEnabled = true;
this.selectedResultsListBox.Location = new System.Drawing.Point(252, 162);
this.selectedResultsListBox.Name = "selectedResultsListBox";
this.selectedResultsListBox.Size = new System.Drawing.Size(135, 186);
this.selectedResultsListBox.TabIndex = 7;
this.selectedResultsListBox.DoubleClick += new System.EventHandler(this.selectedResultsListBox_DoubleClick);
//
// availableResultsLabel
//
this.availableResultsLabel.AutoSize = true;
this.availableResultsLabel.Location = new System.Drawing.Point(12, 140);
this.availableResultsLabel.Name = "availableResultsLabel";
this.availableResultsLabel.Size = new System.Drawing.Size(86, 13);
this.availableResultsLabel.TabIndex = 8;
this.availableResultsLabel.Text = "Available results:";
//
// selectedResultsLabel
//
this.selectedResultsLabel.AutoSize = true;
this.selectedResultsLabel.Location = new System.Drawing.Point(249, 140);
this.selectedResultsLabel.Name = "selectedResultsLabel";
this.selectedResultsLabel.Size = new System.Drawing.Size(85, 13);
this.selectedResultsLabel.TabIndex = 9;
this.selectedResultsLabel.Text = "Selected results:";
//
// removeAllButton
//
this.removeAllButton.Anchor = System.Windows.Forms.AnchorStyles.None;
this.removeAllButton.Enabled = false;
this.removeAllButton.Location = new System.Drawing.Point(153, 273);
this.removeAllButton.Name = "removeAllButton";
this.removeAllButton.Size = new System.Drawing.Size(94, 30);
this.removeAllButton.TabIndex = 46;
this.removeAllButton.Text = "<< R&emove all";
this.removeAllButton.UseVisualStyleBackColor = true;
this.removeAllButton.Click += new System.EventHandler(this.removeAllButton_Click);
//
// removeButton
//
this.removeButton.Anchor = System.Windows.Forms.AnchorStyles.None;
this.removeButton.Enabled = false;
this.removeButton.Location = new System.Drawing.Point(153, 238);
this.removeButton.Name = "removeButton";
this.removeButton.Size = new System.Drawing.Size(93, 30);
this.removeButton.TabIndex = 45;
this.removeButton.Text = "< &Remove";
this.removeButton.UseVisualStyleBackColor = true;
this.removeButton.Click += new System.EventHandler(this.removeButton_Click);
//
// addButton
//
this.addButton.Anchor = System.Windows.Forms.AnchorStyles.None;
this.addButton.Enabled = false;
this.addButton.Location = new System.Drawing.Point(153, 203);
this.addButton.Name = "addButton";
this.addButton.Size = new System.Drawing.Size(93, 30);
this.addButton.TabIndex = 44;
this.addButton.Text = "&Add >";
this.addButton.UseVisualStyleBackColor = true;
this.addButton.Click += new System.EventHandler(this.addButton_Click);
//
// unlockButton
//
this.unlockButton.Location = new System.Drawing.Point(283, 21);
this.unlockButton.Name = "unlockButton";
this.unlockButton.Size = new System.Drawing.Size(104, 30);
this.unlockButton.TabIndex = 47;
this.unlockButton.Text = "Unlock";
this.unlockButton.UseVisualStyleBackColor = true;
this.unlockButton.Click += new System.EventHandler(this.unlockButton_Click);
//
// singleRadioButton
//
this.singleRadioButton.Appearance = System.Windows.Forms.Appearance.Button;
this.singleRadioButton.AutoSize = true;
this.singleRadioButton.Checked = true;
this.singleRadioButton.Location = new System.Drawing.Point(19, 24);
this.singleRadioButton.Name = "singleRadioButton";
this.singleRadioButton.Size = new System.Drawing.Size(46, 23);
this.singleRadioButton.TabIndex = 48;
this.singleRadioButton.TabStop = true;
this.singleRadioButton.Text = "Single";
this.singleRadioButton.UseVisualStyleBackColor = true;
this.singleRadioButton.CheckedChanged += new System.EventHandler(this.singleRadioButton_CheckedChanged);
//
// combinedRadioButton
//
this.combinedRadioButton.Appearance = System.Windows.Forms.Appearance.Button;
this.combinedRadioButton.AutoSize = true;
this.combinedRadioButton.Location = new System.Drawing.Point(71, 24);
this.combinedRadioButton.Name = "combinedRadioButton";
this.combinedRadioButton.Size = new System.Drawing.Size(64, 23);
this.combinedRadioButton.TabIndex = 49;
this.combinedRadioButton.Text = "Combined";
this.combinedRadioButton.UseVisualStyleBackColor = true;
this.combinedRadioButton.CheckedChanged += new System.EventHandler(this.combinedRadioButton_CheckedChanged);
//
// groupBox1
//
this.groupBox1.Controls.Add(this.combinedRadioButton);
this.groupBox1.Controls.Add(this.singleRadioButton);
this.groupBox1.Location = new System.Drawing.Point(12, 21);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(153, 60);
this.groupBox1.TabIndex = 52;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Water Meter";
//
// ResultsConfig
//
this.AcceptButton = this.okButton;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.cancelButton;
this.ClientSize = new System.Drawing.Size(399, 358);
this.Controls.Add(this.groupBox1);
this.Controls.Add(this.unlockButton);
this.Controls.Add(this.removeAllButton);
this.Controls.Add(this.removeButton);
this.Controls.Add(this.addButton);
this.Controls.Add(this.selectedResultsLabel);
this.Controls.Add(this.availableResultsLabel);
this.Controls.Add(this.selectedResultsListBox);
this.Controls.Add(this.availableResultsListBox);
this.Controls.Add(this.cancelButton);
this.Controls.Add(this.okButton);
this.Name = "ResultsConfig";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
this.Text = "ResultsConfig";
this.Load += new System.EventHandler(this.ResultsConfig_Load);
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button okButton;
private System.Windows.Forms.Button cancelButton;
private System.Windows.Forms.ListBox availableResultsListBox;
private System.Windows.Forms.ListBox selectedResultsListBox;
private System.Windows.Forms.Label availableResultsLabel;
private System.Windows.Forms.Label selectedResultsLabel;
private System.Windows.Forms.Button removeAllButton;
private System.Windows.Forms.Button removeButton;
private System.Windows.Forms.Button addButton;
private System.Windows.Forms.Button unlockButton;
private System.Windows.Forms.RadioButton singleRadioButton;
private System.Windows.Forms.RadioButton combinedRadioButton;
private System.Windows.Forms.GroupBox groupBox1;
}
}
-219
View File
@@ -1,219 +0,0 @@
///
/// Copyright (c) 2015 Sensus Metering Systems
///
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Results.Entities;
using ResultsBrowser.Resources;
namespace ResultsBrowser.Forms
{
public partial class ResultsConfig : Form
{
/// <summary>
/// Required access rights to make changes with this form
/// </summary>
const Config.Grp.GID RequiredGroupMembership = Config.Grp.GID.Metrologists;
public Config.Entities.TestsArrangement TestsArrangement;
public Config.Entities.MetersArrangement MetersArrangement;
public int NrMetersInOneGroup;
public IList<Results.ItemSpec> currentlyAvailableItems;
public IList<Results.ItemSpec> ReportItems_Single;
public IList<Results.ItemSpec> ReportItems_Compound;
bool combined; /// false = single meter items, true = combined meter items
Config.Entities.Device device; /// Screen, Printer or Disk
bool unlocked; /// true = changes enabled
public ResultsConfig(bool combined)
{
InitializeComponent();
this.combined = combined;
device = Config.Entities.Device.Screen;
unlocked = false;
cancelButton.Visible = false;
}
void Localize()
{
Text = Strings.Configuration;
groupBox1.Text = Strings.Water_Meter;
singleRadioButton.Text = Strings.SingleBtnText;
combinedRadioButton.Text = Strings.CombinedBtnText;
availableResultsLabel.Text = Strings.Available_results;
selectedResultsLabel.Text = Strings.Selected_results;
addButton.Text = Strings.Add;
removeButton.Text = Strings.Remove;
removeAllButton.Text = Strings.Remove_all;
unlockButton.Text = Strings.UnlockBtnText;
okButton.Text = Strings.CloseBtnText;
cancelButton.Text = Strings.CancelBtnText;
}
void ResultsConfig_Load(object sender, EventArgs e)
{
Localize();
singleRadioButton.Checked = !combined;
combinedRadioButton.Checked = combined;
RedrawAvailable();
RedrawSelected();
}
/// <summary>
/// Gets the list of selected items based on watermeter type and device selections
/// </summary>
/// <returns>List of selected result items</returns>
IList<Results.ItemSpec> GetSelectedItems()
{
if (combined)
{
return ReportItems_Compound;
}
else
{
return ReportItems_Single;
}
}
/// <summary>
/// Redraw selected items (right hand side)
/// </summary>
void RedrawAvailable()
{
availableResultsListBox.Items.Clear();
currentlyAvailableItems = new List<Results.ItemSpec>();
foreach (var item in Results.ItemSpec.AllItems)
{
if (!GetSelectedItems().Contains(item) && (combined ? item.CanPrintCombined : item.CanPrintSingle))
{
currentlyAvailableItems.Add(item);
availableResultsListBox.Items.Add(item.Name);
}
}
}
/// <summary>
/// Redraw selected items (right hand side)
/// </summary>
void RedrawSelected()
{
selectedResultsListBox.Items.Clear();
foreach (var item in GetSelectedItems())
{
selectedResultsListBox.Items.Add(item.Name);
}
}
void unlockButton_Click(object sender, EventArgs e)
{
if (!unlocked)
{
//if (!User.CurrentUser.IsMemberOf(RequiredGroupMembership))
//{
// if ((new LoginDlg(RequiredGroupMembership)).ShowDialog() != DialogResult.OK) return;
//}
unlocked = true;
///
/// Unlock user interface controls
///
unlockButton.Enabled = false;
okButton.Text = Strings.OkBtnText;
cancelButton.Visible = true;
availableResultsListBox.Enabled = true;
selectedResultsListBox.Enabled = true;
addButton.Enabled = true;
removeButton.Enabled = true;
removeAllButton.Enabled = true;
}
}
void okButton_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.OK;
Close();
}
void availableResultsListBox_DoubleClick(object sender, EventArgs e)
{
/// Double click works when just one item is selected
IList<Results.ItemSpec> itemsToRemove = new List<Results.ItemSpec>();
if (availableResultsListBox.SelectedIndices.Count == 1)
{
var item = currentlyAvailableItems[availableResultsListBox.SelectedIndices[0]];
GetSelectedItems().Add(item);
RedrawAvailable();
RedrawSelected();
}
}
void addButton_Click(object sender, EventArgs e)
{
/// Append at the end, this code supports multiple selected items,
/// although ListBox control settings may limit the max.number of selected items to one.
for (int i = availableResultsListBox.SelectedIndices.Count - 1; i >= 0; i--)
{
var item = currentlyAvailableItems[availableResultsListBox.SelectedIndices[i]];
GetSelectedItems().Add(item);
}
RedrawAvailable();
RedrawSelected();
}
private void selectedResultsListBox_DoubleClick(object sender, EventArgs e)
{
/// Double click works when just one item is selected
if (selectedResultsListBox.SelectedIndices.Count == 1)
{
GetSelectedItems().RemoveAt(selectedResultsListBox.SelectedIndices[0]);
RedrawAvailable();
RedrawSelected();
}
}
void removeButton_Click(object sender, EventArgs e)
{
/// Remove from the list (the last selected item first so that the indexes are not affected)
for (int i = selectedResultsListBox.SelectedIndices.Count - 1; i >= 0; i--)
{
GetSelectedItems().RemoveAt(selectedResultsListBox.SelectedIndices[i]);
}
RedrawAvailable();
RedrawSelected();
}
void removeAllButton_Click(object sender, EventArgs e)
{
/// Remove all items from 'Selected' list
GetSelectedItems().Clear();
RedrawAvailable();
RedrawSelected();
}
private void singleRadioButton_CheckedChanged(object sender, EventArgs e)
{
}
private void combinedRadioButton_CheckedChanged(object sender, EventArgs e)
{
combined = combinedRadioButton.Checked;
RedrawAvailable();
RedrawSelected();
}
}
}
+237 -87
View File
@@ -1,6 +1,3 @@
///
/// Copyright (c) 2015 Sensus Metering Systems
///
using System;
using System.IO;
using System.Text;
@@ -15,26 +12,54 @@ namespace ResultsBrowser
/// Edit->Preferences ... PreferencesDlg ... S1.1(language, etc. local settings), and
/// Edit->Advanced settings ... AdvancedSettingsDlg ... S1.2(spec. where bench settings are stored)
/// </summary>
[XmlRootAttribute("ResultsBrowser")]
[XmlRootAttribute("TestBenchFramework")]
public class LocalSettings
{
/// <summary>
/// User interface language (used as CultureInfo(..) constructor argument).
/// </summary>
/// Available languages.
/// Method ToString should give a supported culture info string:
/// ("en","de","fr","es","it","cn", etc.).
/// </summary>
public enum Languages
{
en,
de,
sk,
Count,
}
/// <summary>
/// User interface language ("en","de","fr","es","it","cn", etc.).
/// </summary>
public string Language = "en";
/// <summary>C:\VSProjects\TBF\TestBenchFramework\LocalSettings.cs
/// <summary>
/// Names and database settings of test benches.
/// </summary>
public string ConnectionString_WR10;
public string ConnectionString_WR11;
public string ConnectionString_WR12;
[XmlArrayAttribute("TestBenches")]
public DatabaseSettings[] testBenches;
public bool FilterPurchaseOrder;
public bool FilterProcedure;
public bool FilterBatchNr;
public bool FilterDate;
public bool ResolveManually;
[XmlIgnore]
public DatabaseSettings[] TestBenches { get { return testBenches; } }
[XmlIgnore]
public int BenchesCount { get { return (testBenches != null) ? testBenches.GetLength(0) : 0; } }
/// <summary>
/// Currently selected bench name (local or remote) or null (= no selection done).
/// </summary>
[XmlElementAttribute("LastBench")]
public string LastBenchName;
/// <summary>
/// Currently selected procedure name or null (= no selection done yet).
/// </summary>
[XmlElementAttribute("LastProcedure")]
public string LastProcedureName;
public int BatchNr;
public int RightPaneHorizSplitterDistance;
/// MainWnd
public int MainWndLeft;
@@ -43,54 +68,226 @@ namespace ResultsBrowser
public int MainWndHeight;
public bool ManiWndMaximized;
/// Purchase order history
public string LastPurchaseOrder;
public string[] PurchaseOrderHistory;
/// Components
public int ComponentsDlgLeft;
public int ComponentsDlgTop;
public int ComponentsDlgWidth;
public int ComponentsDlgHeight;
/// Paths
public int PathsDlgLeft;
public int PathsDlgTop;
public int PathsDlgWidth;
public int PathsDlgHeight;
[XmlArrayAttribute("FeedingColumnWidths")]
public int[] FeedingColumnWidths;
[XmlIgnore]
public int PurchaseOrderHistoryCount { get { return (PurchaseOrderHistory != null) ? PurchaseOrderHistory.Length : 0; } }
public int FeedingColumnCount { get { return (FeedingColumnWidths != null) ? FeedingColumnWidths.Length : 0; } }
/// Procedure history
public string LastProcedure;
public string[] ProcedureHistory;
[XmlArrayAttribute("BenchColumnWidths")]
public int[] BenchColumnWidths;
[XmlIgnore]
public int BenchColumnCount { get { return (BenchColumnWidths != null) ? BenchColumnWidths.Length : 0; } }
[XmlArrayAttribute("OutputColumnWidths")]
public int[] OutputColumnWidths;
[XmlIgnore]
public int OutputColumnCount { get { return (OutputColumnWidths != null) ? OutputColumnWidths.Length : 0; } }
[XmlArrayAttribute("MetersColumnWidths")]
public int[] MetersColumnWidths;
[XmlIgnore]
public int MetersColumnCount { get { return (MetersColumnWidths != null) ? MetersColumnWidths.Length : 0; } }
/// Transitions
public int TransitionsDlgLeft;
public int TransitionsDlgTop;
public int TransitionsDlgWidth;
public int TransitionsDlgHeight;
[XmlArrayAttribute("TransitionsColumnWidths")]
public int[] TransitionsColumnWidths;
[XmlIgnore]
public int TransitionsColumnCount { get { return (TransitionsColumnWidths != null) ? TransitionsColumnWidths.Length : 0; } }
/// Metrology
public int MetrologyDlgLeft;
public int MetrologyDlgTop;
public int MetrologyDlgWidth;
public int MetrologyDlgHeight;
/// Procedures
public int ProceduresDlgLeft;
public int ProceduresDlgTop;
public int ProceduresDlgWidth;
public int ProceduresDlgHeight;
/// OneProcedure
public int OneProcedureDlgLeft;
public int OneProcedureDlgTop;
public int OneProcedureDlgWidth;
public int OneProcedureDlgHeight;
/// Configuration of results
public Forms.ResultsConfig.Meters ResultsConfigMeters;
public Forms.ResultsConfig.TestsAre ResultsConfigTests;
public string[] RsltItems_Screen_SingleWM;
public string[] RsltItems_Screen_CombinedWM;
public string[] RsltItems_Printer_SingleWM;
public string[] RsltItems_Printer_CombinedWM;
public string[] RsltItems_Disk_SingleWM;
public string[] RsltItems_Disk_CombinedWM;
[XmlArrayAttribute("RsltsSingleClmnWdths")]
public int[] RsltsSingleClmnWdths;
[XmlIgnore]
public int ProcedureHistoryCount { get { return (ProcedureHistory != null) ? ProcedureHistory.Length : 0; } }
public int RsltsSingleClmnCount { get { return (RsltsSingleClmnWdths != null) ? RsltsSingleClmnWdths.Length : 0; } }
/// BatchNr range
public string BatchFrom;
public string BatchTo;
/// Report file name history
public string LastReportFileName;
public string[] ReportFileNameHistory;
[XmlArrayAttribute("RsltsCombinedClmnWdths")]
public int[] RsltsCombinedClmnWdths;
[XmlIgnore]
public int ReportFileNameHistoryCount { get { return (ReportFileNameHistory != null) ? ReportFileNameHistory.Length : 0; } }
public int RsltsCombinedClmnCount { get { return (RsltsCombinedClmnWdths != null) ? RsltsCombinedClmnWdths.Length : 0; } }
/// Report configuration
public string[] ReportItems_Single;
public string[] ReportItems_Compound;
/// <summary>
/// Copy public fields from a LocalSettings object to this object.
/// </summary>
/// <param name="ls">Origin</param>
public void Assign(LocalSettings ls)
{
if (ls != null)
{
Language = ls.Language;
testBenches = new DatabaseSettings[ls.BenchesCount];
for (int i = 0; i < BenchesCount; i++)
testBenches[i] = ls.testBenches[i];
LastBenchName = ls.LastBenchName;
LastProcedureName = ls.LastProcedureName;
BatchNr = ls.BatchNr;
MainWndLeft = ls.MainWndLeft;
MainWndTop = ls.MainWndTop;
MainWndWidth = ls.MainWndWidth;
MainWndHeight = ls.MainWndHeight;
ManiWndMaximized = ls.ManiWndMaximized;
RightPaneHorizSplitterDistance = ls.RightPaneHorizSplitterDistance;
ComponentsDlgLeft = ls.ComponentsDlgLeft;
ComponentsDlgTop = ls.ComponentsDlgTop;
ComponentsDlgWidth = ls.ComponentsDlgWidth;
ComponentsDlgHeight = ls.ComponentsDlgHeight;
PathsDlgLeft = ls.PathsDlgLeft;
PathsDlgTop = ls.PathsDlgTop;
PathsDlgWidth = ls.PathsDlgWidth;
PathsDlgHeight = ls.PathsDlgHeight;
FeedingColumnWidths = new int[ls.FeedingColumnCount];
for (int i = 0; i < FeedingColumnCount; i++)
FeedingColumnWidths[i] = ls.FeedingColumnWidths[i];
BenchColumnWidths = new int[ls.BenchColumnCount];
for (int i = 0; i < BenchColumnCount; i++)
BenchColumnWidths[i] = ls.BenchColumnWidths[i];
OutputColumnWidths = new int[ls.OutputColumnCount];
for (int i = 0; i < OutputColumnCount; i++)
OutputColumnWidths[i] = ls.OutputColumnWidths[i];
MetersColumnWidths = new int[ls.MetersColumnCount];
for (int i = 0; i < MetersColumnCount; i++)
MetersColumnWidths[i] = ls.MetersColumnWidths[i];
TransitionsDlgLeft = ls.TransitionsDlgLeft;
TransitionsDlgTop = ls.TransitionsDlgTop;
TransitionsDlgWidth = ls.TransitionsDlgWidth;
TransitionsDlgHeight = ls.TransitionsDlgHeight;
TransitionsColumnWidths = new int[ls.TransitionsColumnCount];
for (int i = 0; i < TransitionsColumnCount; i++)
TransitionsColumnWidths[i] = ls.TransitionsColumnWidths[i];
MetrologyDlgLeft = ls.MetrologyDlgLeft;
MetrologyDlgTop = ls.MetrologyDlgTop;
MetrologyDlgWidth = ls.MetrologyDlgWidth;
MetrologyDlgHeight = ls.MetrologyDlgHeight;
ProceduresDlgLeft = ls.ProceduresDlgLeft;
ProceduresDlgTop = ls.ProceduresDlgTop;
ProceduresDlgWidth = ls.ProceduresDlgWidth;
ProceduresDlgHeight = ls.ProceduresDlgHeight;
OneProcedureDlgLeft = ls.OneProcedureDlgLeft;
OneProcedureDlgTop = ls.OneProcedureDlgTop;
OneProcedureDlgWidth = ls.OneProcedureDlgWidth;
OneProcedureDlgHeight = ls.OneProcedureDlgHeight;
ResultsConfigMeters = ls.ResultsConfigMeters;
ResultsConfigTests = ls.ResultsConfigTests;
int count = (ls.RsltItems_Screen_SingleWM != null) ? ls.RsltItems_Screen_SingleWM.Length : 0;
RsltItems_Screen_SingleWM = new string[count];
for (int i = 0; i < count; i++) RsltItems_Screen_SingleWM[i] = ls.RsltItems_Screen_SingleWM[i];
count = (ls.RsltItems_Screen_CombinedWM != null) ? ls.RsltItems_Screen_CombinedWM.Length : 0;
RsltItems_Screen_CombinedWM = new string[count];
for (int i = 0; i < count; i++) RsltItems_Screen_CombinedWM[i] = ls.RsltItems_Screen_CombinedWM[i];
count = (ls.RsltItems_Printer_SingleWM != null) ? ls.RsltItems_Printer_SingleWM.Length : 0;
RsltItems_Printer_SingleWM = new string[count];
for (int i = 0; i < count; i++) RsltItems_Printer_SingleWM[i] = ls.RsltItems_Printer_SingleWM[i];
count = (ls.RsltItems_Printer_CombinedWM != null) ? ls.RsltItems_Printer_CombinedWM.Length : 0;
RsltItems_Printer_CombinedWM = new string[count];
for (int i = 0; i < count; i++) RsltItems_Printer_CombinedWM[i] = ls.RsltItems_Printer_CombinedWM[i];
count = (ls.RsltItems_Disk_SingleWM != null) ? ls.RsltItems_Disk_SingleWM.Length : 0;
RsltItems_Disk_SingleWM = new string[count];
for (int i = 0; i < count; i++) RsltItems_Disk_SingleWM[i] = ls.RsltItems_Disk_SingleWM[i];
count = (ls.RsltItems_Disk_CombinedWM != null) ? ls.RsltItems_Disk_CombinedWM.Length : 0;
RsltItems_Disk_CombinedWM = new string[count];
for (int i = 0; i < count; i++) RsltItems_Disk_CombinedWM[i] = ls.RsltItems_Disk_CombinedWM[i];
RsltsSingleClmnWdths = new int[ls.RsltsSingleClmnCount];
for (int i = 0; i < RsltsSingleClmnCount; i++)
RsltsSingleClmnWdths[i] = ls.RsltsSingleClmnWdths[i];
RsltsCombinedClmnWdths = new int[ls.RsltsCombinedClmnCount];
for (int i = 0; i < RsltsCombinedClmnCount; i++)
RsltsCombinedClmnWdths[i] = ls.RsltsCombinedClmnWdths[i];
}
}
[XmlIgnore]
public readonly bool AlwaysAskPasswdWhenUnlocking;
[XmlIgnore]
public readonly bool RestoreUserWhenLeavingDialog;
public LocalSettings()
{
AlwaysAskPasswdWhenUnlocking = false;
RestoreUserWhenLeavingDialog = true;
}
/// <summary>
/// Load public fields of this class from the XML file.
/// </summary>
public static LocalSettings Load(string fileName)
public void Load()
{
try
{
using (TextReader reader = new StreamReader(fileName))
{
using (TextReader reader = new StreamReader(Program.LocalSettingsFileName))
{
LocalSettings ls = (new XmlSerializer(typeof(LocalSettings))).Deserialize(reader) as LocalSettings;
// Copy the settings just in case De-serialize() completes OK
return ls;
this.Assign(ls);
}
}
catch (Exception e)
{
string msg = e.Message;
return null;
}
}
@@ -111,52 +308,5 @@ namespace ResultsBrowser
string msg = e.Message;
}
}
/// <summary>
/// Updates history stored in a string array by a new latest string.
/// </summary>
/// <param name="lastStrValue">Lste entered string</param>
/// <returns>true = updated and saved</returns>
public bool UpdateHistory(string lastStrValue, ref string[] history, int maxHistoryLen = 10)
{
if (string.IsNullOrEmpty(lastStrValue)) return false;
int currentHistoryCount = (history != null) ? history.Length : 0;
int match = -1;
for (int i = 0; i < currentHistoryCount; i++)
{
if (history[i] == lastStrValue)
{
match = i;
break;
}
}
if (match >= 0 || currentHistoryCount >= maxHistoryLen)
{
/// History does not have to be (because of a match) or should not be extended (because of the lenght)
if (match < 0) match = currentHistoryCount - 1;
for (int j = match; j > 0; j--)
{
history[j] = history[j - 1];
}
history[0] = lastStrValue;
}
else
{
/// History wiil be extended, new item inserted at the beginning
string[] newHistory = new string[currentHistoryCount + 1];
newHistory[0] = lastStrValue;
for (int j = 1; j <= currentHistoryCount; j++)
{
newHistory[j] = history[j - 1];
}
history = newHistory;
}
Save();
return true;
}
}
}
}
+102 -551
View File
@@ -28,563 +28,114 @@
/// </summary>
private void InitializeComponent()
{
this.queryBatchesButton = new System.Windows.Forms.Button();
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
this.queryWatermetersButton = new System.Windows.Forms.Button();
this.batchNrGroupBox = new System.Windows.Forms.GroupBox();
this.batchNrToTextBox = new System.Windows.Forms.TextBox();
this.batchNrFromTextBox = new System.Windows.Forms.TextBox();
this.label4 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.batchNrCheckBox = new System.Windows.Forms.CheckBox();
this.removeFromQueryButton = new System.Windows.Forms.Button();
this.addToReportButton = new System.Windows.Forms.Button();
this.resolveManuallyCheckBox = new System.Windows.Forms.CheckBox();
this.procedureGroupBox = new System.Windows.Forms.GroupBox();
this.procedureCheckBox = new System.Windows.Forms.CheckBox();
this.procedureComboBox = new System.Windows.Forms.ComboBox();
this.fromGroupBox = new System.Windows.Forms.GroupBox();
this.label2 = new System.Windows.Forms.Label();
this.label1 = new System.Windows.Forms.Label();
this.filterDateCheckBox = new System.Windows.Forms.CheckBox();
this.toDateTimePicker = new System.Windows.Forms.DateTimePicker();
this.fromDateTimePicker = new System.Windows.Forms.DateTimePicker();
this.purchaseOrderGroupBox = new System.Windows.Forms.GroupBox();
this.purchaseOrderCheckBox = new System.Windows.Forms.CheckBox();
this.purchaseOrderComboBox = new System.Windows.Forms.ComboBox();
this.queryResultsListBox = new System.Windows.Forms.ListBox();
this.configReportButton = new System.Windows.Forms.Button();
this.splitContainer2 = new System.Windows.Forms.SplitContainer();
this.splitContainer3 = new System.Windows.Forms.SplitContainer();
this.configButton = new System.Windows.Forms.Button();
this.makeReportButton = new System.Windows.Forms.Button();
this.removeFromReportButton = new System.Windows.Forms.Button();
this.reportFileGroupBox = new System.Windows.Forms.GroupBox();
this.browseFileButton = new System.Windows.Forms.Button();
this.reportFileComboBox = new System.Windows.Forms.ComboBox();
this.makeAscFileButton = new System.Windows.Forms.Button();
this.addOracleDataButton = new System.Windows.Forms.Button();
this.reportListBox = new System.Windows.Forms.ListBox();
this.queryResultsItemsLabel = new System.Windows.Forms.Label();
this.reportItemsLabel = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
this.splitContainer1.Panel1.SuspendLayout();
this.splitContainer1.Panel2.SuspendLayout();
this.splitContainer1.SuspendLayout();
this.batchNrGroupBox.SuspendLayout();
this.procedureGroupBox.SuspendLayout();
this.fromGroupBox.SuspendLayout();
this.purchaseOrderGroupBox.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).BeginInit();
this.splitContainer2.Panel1.SuspendLayout();
this.splitContainer2.Panel2.SuspendLayout();
this.splitContainer2.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).BeginInit();
this.splitContainer3.Panel1.SuspendLayout();
this.splitContainer3.Panel2.SuspendLayout();
this.splitContainer3.SuspendLayout();
this.reportFileGroupBox.SuspendLayout();
this.SuspendLayout();
//
// queryBatchesButton
//
this.queryBatchesButton.Location = new System.Drawing.Point(15, 178);
this.queryBatchesButton.Name = "queryBatchesButton";
this.queryBatchesButton.Size = new System.Drawing.Size(108, 29);
this.queryBatchesButton.TabIndex = 3;
this.queryBatchesButton.Text = "Query batches";
this.queryBatchesButton.UseVisualStyleBackColor = true;
this.queryBatchesButton.Click += new System.EventHandler(this.queryBatchesButton_Click);
//
// splitContainer1
//
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.splitContainer1.IsSplitterFixed = true;
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
this.splitContainer1.Name = "splitContainer1";
this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer1.Panel1
//
this.splitContainer1.Panel1.Controls.Add(this.queryResultsItemsLabel);
this.splitContainer1.Panel1.Controls.Add(this.queryWatermetersButton);
this.splitContainer1.Panel1.Controls.Add(this.batchNrGroupBox);
this.splitContainer1.Panel1.Controls.Add(this.removeFromQueryButton);
this.splitContainer1.Panel1.Controls.Add(this.addToReportButton);
this.splitContainer1.Panel1.Controls.Add(this.resolveManuallyCheckBox);
this.splitContainer1.Panel1.Controls.Add(this.procedureGroupBox);
this.splitContainer1.Panel1.Controls.Add(this.fromGroupBox);
this.splitContainer1.Panel1.Controls.Add(this.queryBatchesButton);
this.splitContainer1.Panel1.Controls.Add(this.purchaseOrderGroupBox);
//
// splitContainer1.Panel2
//
this.splitContainer1.Panel2.Controls.Add(this.queryResultsListBox);
this.splitContainer1.Size = new System.Drawing.Size(604, 624);
this.splitContainer1.SplitterDistance = 220;
this.splitContainer1.TabIndex = 5;
//
// queryWatermetersButton
//
this.queryWatermetersButton.Location = new System.Drawing.Point(129, 178);
this.queryWatermetersButton.Name = "queryWatermetersButton";
this.queryWatermetersButton.Size = new System.Drawing.Size(108, 29);
this.queryWatermetersButton.TabIndex = 12;
this.queryWatermetersButton.Text = "Query water meters";
this.queryWatermetersButton.UseVisualStyleBackColor = true;
this.queryWatermetersButton.Click += new System.EventHandler(this.queryWatermetersButton_Click);
//
// batchNrGroupBox
//
this.batchNrGroupBox.Controls.Add(this.batchNrToTextBox);
this.batchNrGroupBox.Controls.Add(this.batchNrFromTextBox);
this.batchNrGroupBox.Controls.Add(this.label4);
this.batchNrGroupBox.Controls.Add(this.label3);
this.batchNrGroupBox.Controls.Add(this.batchNrCheckBox);
this.batchNrGroupBox.Location = new System.Drawing.Point(15, 122);
this.batchNrGroupBox.Name = "batchNrGroupBox";
this.batchNrGroupBox.Size = new System.Drawing.Size(242, 50);
this.batchNrGroupBox.TabIndex = 11;
this.batchNrGroupBox.TabStop = false;
this.batchNrGroupBox.Visible = false;
//
// batchNrToTextBox
//
this.batchNrToTextBox.Location = new System.Drawing.Point(157, 21);
this.batchNrToTextBox.Name = "batchNrToTextBox";
this.batchNrToTextBox.Size = new System.Drawing.Size(62, 20);
this.batchNrToTextBox.TabIndex = 5;
//
// batchNrFromTextBox
//
this.batchNrFromTextBox.Location = new System.Drawing.Point(56, 21);
this.batchNrFromTextBox.Name = "batchNrFromTextBox";
this.batchNrFromTextBox.Size = new System.Drawing.Size(62, 20);
this.batchNrFromTextBox.TabIndex = 4;
//
// label4
//
this.label4.AutoSize = true;
this.label4.Location = new System.Drawing.Point(131, 24);
this.label4.Name = "label4";
this.label4.Size = new System.Drawing.Size(20, 13);
this.label4.TabIndex = 3;
this.label4.Text = "To";
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(19, 24);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(30, 13);
this.label3.TabIndex = 2;
this.label3.Text = "From";
//
// batchNrCheckBox
//
this.batchNrCheckBox.AutoSize = true;
this.batchNrCheckBox.Location = new System.Drawing.Point(19, 0);
this.batchNrCheckBox.Name = "batchNrCheckBox";
this.batchNrCheckBox.Size = new System.Drawing.Size(116, 17);
this.batchNrCheckBox.TabIndex = 1;
this.batchNrCheckBox.Text = "Filter batch number";
this.batchNrCheckBox.UseVisualStyleBackColor = true;
this.batchNrCheckBox.Visible = false;
//
// removeFromQueryButton
//
this.removeFromQueryButton.Location = new System.Drawing.Point(380, 178);
this.removeFromQueryButton.Name = "removeFromQueryButton";
this.removeFromQueryButton.Size = new System.Drawing.Size(114, 29);
this.removeFromQueryButton.TabIndex = 9;
this.removeFromQueryButton.Text = "Remove selected";
this.removeFromQueryButton.UseVisualStyleBackColor = true;
this.removeFromQueryButton.Click += new System.EventHandler(this.removeFromQueryButton_Click);
//
// addToReportButton
//
this.addToReportButton.Location = new System.Drawing.Point(558, 162);
this.addToReportButton.Name = "addToReportButton";
this.addToReportButton.Size = new System.Drawing.Size(46, 40);
this.addToReportButton.TabIndex = 8;
this.addToReportButton.Text = ">>>";
this.addToReportButton.UseVisualStyleBackColor = true;
this.addToReportButton.Click += new System.EventHandler(this.addToReportButton_Click);
//
// resolveManuallyCheckBox
//
this.resolveManuallyCheckBox.AutoSize = true;
this.resolveManuallyCheckBox.Location = new System.Drawing.Point(282, 143);
this.resolveManuallyCheckBox.Name = "resolveManuallyCheckBox";
this.resolveManuallyCheckBox.Size = new System.Drawing.Size(158, 17);
this.resolveManuallyCheckBox.TabIndex = 7;
this.resolveManuallyCheckBox.Text = "Resolve duplicities manually";
this.resolveManuallyCheckBox.UseVisualStyleBackColor = true;
//
// procedureGroupBox
//
this.procedureGroupBox.Controls.Add(this.procedureCheckBox);
this.procedureGroupBox.Controls.Add(this.procedureComboBox);
this.procedureGroupBox.Location = new System.Drawing.Point(15, 68);
this.procedureGroupBox.Name = "procedureGroupBox";
this.procedureGroupBox.Size = new System.Drawing.Size(242, 50);
this.procedureGroupBox.TabIndex = 6;
this.procedureGroupBox.TabStop = false;
//
// procedureCheckBox
//
this.procedureCheckBox.AutoSize = true;
this.procedureCheckBox.Location = new System.Drawing.Point(19, 0);
this.procedureCheckBox.Name = "procedureCheckBox";
this.procedureCheckBox.Size = new System.Drawing.Size(99, 17);
this.procedureCheckBox.TabIndex = 1;
this.procedureCheckBox.Text = "Filter procedure";
this.procedureCheckBox.UseVisualStyleBackColor = true;
this.procedureCheckBox.CheckedChanged += new System.EventHandler(this.procedureCheckBox_CheckedChanged);
//
// procedureComboBox
//
this.procedureComboBox.FormattingEnabled = true;
this.procedureComboBox.Location = new System.Drawing.Point(18, 19);
this.procedureComboBox.Name = "procedureComboBox";
this.procedureComboBox.Size = new System.Drawing.Size(201, 21);
this.procedureComboBox.TabIndex = 0;
//
// fromGroupBox
//
this.fromGroupBox.Controls.Add(this.label2);
this.fromGroupBox.Controls.Add(this.label1);
this.fromGroupBox.Controls.Add(this.filterDateCheckBox);
this.fromGroupBox.Controls.Add(this.toDateTimePicker);
this.fromGroupBox.Controls.Add(this.fromDateTimePicker);
this.fromGroupBox.Location = new System.Drawing.Point(263, 14);
this.fromGroupBox.Name = "fromGroupBox";
this.fromGroupBox.Size = new System.Drawing.Size(242, 104);
this.fromGroupBox.TabIndex = 3;
this.fromGroupBox.TabStop = false;
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(16, 68);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(20, 13);
this.label2.TabIndex = 3;
this.label2.Text = "To";
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(16, 36);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(30, 13);
this.label1.TabIndex = 2;
this.label1.Text = "From";
//
// filterDateCheckBox
//
this.filterDateCheckBox.AutoSize = true;
this.filterDateCheckBox.Location = new System.Drawing.Point(19, -1);
this.filterDateCheckBox.Name = "filterDateCheckBox";
this.filterDateCheckBox.Size = new System.Drawing.Size(72, 17);
this.filterDateCheckBox.TabIndex = 1;
this.filterDateCheckBox.Text = "Filter date";
this.filterDateCheckBox.UseVisualStyleBackColor = true;
//
// toDateTimePicker
//
this.toDateTimePicker.Location = new System.Drawing.Point(68, 65);
this.toDateTimePicker.Name = "toDateTimePicker";
this.toDateTimePicker.Size = new System.Drawing.Size(151, 20);
this.toDateTimePicker.TabIndex = 0;
//
// fromDateTimePicker
//
this.fromDateTimePicker.Location = new System.Drawing.Point(68, 32);
this.fromDateTimePicker.Name = "fromDateTimePicker";
this.fromDateTimePicker.Size = new System.Drawing.Size(151, 20);
this.fromDateTimePicker.TabIndex = 0;
//
// purchaseOrderGroupBox
//
this.purchaseOrderGroupBox.Controls.Add(this.purchaseOrderCheckBox);
this.purchaseOrderGroupBox.Controls.Add(this.purchaseOrderComboBox);
this.purchaseOrderGroupBox.Location = new System.Drawing.Point(15, 14);
this.purchaseOrderGroupBox.Name = "purchaseOrderGroupBox";
this.purchaseOrderGroupBox.Size = new System.Drawing.Size(242, 50);
this.purchaseOrderGroupBox.TabIndex = 2;
this.purchaseOrderGroupBox.TabStop = false;
//
// purchaseOrderCheckBox
//
this.purchaseOrderCheckBox.AutoSize = true;
this.purchaseOrderCheckBox.Location = new System.Drawing.Point(19, 0);
this.purchaseOrderCheckBox.Name = "purchaseOrderCheckBox";
this.purchaseOrderCheckBox.Size = new System.Drawing.Size(122, 17);
this.purchaseOrderCheckBox.TabIndex = 1;
this.purchaseOrderCheckBox.Text = "Filter purchase order";
this.purchaseOrderCheckBox.UseVisualStyleBackColor = true;
//
// purchaseOrderComboBox
//
this.purchaseOrderComboBox.FormattingEnabled = true;
this.purchaseOrderComboBox.Location = new System.Drawing.Point(18, 19);
this.purchaseOrderComboBox.Name = "purchaseOrderComboBox";
this.purchaseOrderComboBox.Size = new System.Drawing.Size(201, 21);
this.purchaseOrderComboBox.TabIndex = 0;
//
// queryResultsListBox
//
this.queryResultsListBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.queryResultsListBox.FormattingEnabled = true;
this.queryResultsListBox.Location = new System.Drawing.Point(0, 0);
this.queryResultsListBox.Name = "queryResultsListBox";
this.queryResultsListBox.SelectionMode = System.Windows.Forms.SelectionMode.MultiSimple;
this.queryResultsListBox.Size = new System.Drawing.Size(604, 400);
this.queryResultsListBox.TabIndex = 0;
this.queryResultsListBox.DoubleClick += new System.EventHandler(this.queryResultsListBox_DoubleClick);
//
// configReportButton
//
this.configReportButton.Location = new System.Drawing.Point(226, 95);
this.configReportButton.Name = "configReportButton";
this.configReportButton.Size = new System.Drawing.Size(103, 47);
this.configReportButton.TabIndex = 5;
this.configReportButton.Text = "Configure Report";
this.configReportButton.UseVisualStyleBackColor = true;
this.configReportButton.Click += new System.EventHandler(this.configReportButton_Click);
//
// splitContainer2
//
this.splitContainer2.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer2.Location = new System.Drawing.Point(0, 0);
this.splitContainer2.Name = "splitContainer2";
//
// splitContainer2.Panel1
//
this.splitContainer2.Panel1.Controls.Add(this.splitContainer1);
//
// splitContainer2.Panel2
//
this.splitContainer2.Panel2.Controls.Add(this.splitContainer3);
this.splitContainer2.Size = new System.Drawing.Size(1284, 624);
this.splitContainer2.SplitterDistance = 604;
this.splitContainer2.TabIndex = 6;
//
// splitContainer3
//
this.splitContainer3.Dock = System.Windows.Forms.DockStyle.Fill;
this.splitContainer3.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
this.splitContainer3.IsSplitterFixed = true;
this.splitContainer3.Location = new System.Drawing.Point(0, 0);
this.splitContainer3.Name = "splitContainer3";
this.splitContainer3.Orientation = System.Windows.Forms.Orientation.Horizontal;
//
// splitContainer3.Panel1
//
this.splitContainer3.Panel1.Controls.Add(this.reportItemsLabel);
this.splitContainer3.Panel1.Controls.Add(this.configButton);
this.splitContainer3.Panel1.Controls.Add(this.makeReportButton);
this.splitContainer3.Panel1.Controls.Add(this.removeFromReportButton);
this.splitContainer3.Panel1.Controls.Add(this.reportFileGroupBox);
this.splitContainer3.Panel1.Controls.Add(this.makeAscFileButton);
this.splitContainer3.Panel1.Controls.Add(this.addOracleDataButton);
this.splitContainer3.Panel1.Controls.Add(this.configReportButton);
//
// splitContainer3.Panel2
//
this.splitContainer3.Panel2.Controls.Add(this.reportListBox);
this.splitContainer3.Size = new System.Drawing.Size(676, 624);
this.splitContainer3.SplitterDistance = 220;
this.splitContainer3.TabIndex = 6;
//
// configButton
//
this.configButton.Location = new System.Drawing.Point(589, 14);
this.configButton.Name = "configButton";
this.configButton.Size = new System.Drawing.Size(75, 71);
this.configButton.TabIndex = 12;
this.configButton.Text = "Configure";
this.configButton.UseVisualStyleBackColor = true;
this.configButton.Click += new System.EventHandler(this.configButton_Click);
//
// makeReportButton
//
this.makeReportButton.Location = new System.Drawing.Point(335, 95);
this.makeReportButton.Name = "makeReportButton";
this.makeReportButton.Size = new System.Drawing.Size(103, 47);
this.makeReportButton.TabIndex = 11;
this.makeReportButton.Text = "Make Report";
this.makeReportButton.UseVisualStyleBackColor = true;
this.makeReportButton.Click += new System.EventHandler(this.makeReportButton_Click);
//
// removeFromReportButton
//
this.removeFromReportButton.Location = new System.Drawing.Point(55, 178);
this.removeFromReportButton.Name = "removeFromReportButton";
this.removeFromReportButton.Size = new System.Drawing.Size(114, 29);
this.removeFromReportButton.TabIndex = 10;
this.removeFromReportButton.Text = "Remove selected";
this.removeFromReportButton.UseVisualStyleBackColor = true;
this.removeFromReportButton.Click += new System.EventHandler(this.removeFromReportButton_Click);
//
// reportFileGroupBox
//
this.reportFileGroupBox.Controls.Add(this.browseFileButton);
this.reportFileGroupBox.Controls.Add(this.reportFileComboBox);
this.reportFileGroupBox.Location = new System.Drawing.Point(18, 14);
this.reportFileGroupBox.Name = "reportFileGroupBox";
this.reportFileGroupBox.Size = new System.Drawing.Size(546, 63);
this.reportFileGroupBox.TabIndex = 8;
this.reportFileGroupBox.TabStop = false;
this.reportFileGroupBox.Text = "Report file name";
//
// browseFileButton
//
this.browseFileButton.Location = new System.Drawing.Point(453, 22);
this.browseFileButton.Name = "browseFileButton";
this.browseFileButton.Size = new System.Drawing.Size(75, 27);
this.browseFileButton.TabIndex = 2;
this.browseFileButton.Text = "Browse";
this.browseFileButton.UseVisualStyleBackColor = true;
this.browseFileButton.Click += new System.EventHandler(this.browseFileButton_Click);
//
// reportFileComboBox
//
this.reportFileComboBox.FormattingEnabled = true;
this.reportFileComboBox.Location = new System.Drawing.Point(20, 25);
this.reportFileComboBox.Name = "reportFileComboBox";
this.reportFileComboBox.Size = new System.Drawing.Size(414, 21);
this.reportFileComboBox.TabIndex = 1;
//
// makeAscFileButton
//
this.makeAscFileButton.Location = new System.Drawing.Point(443, 95);
this.makeAscFileButton.Name = "makeAscFileButton";
this.makeAscFileButton.Size = new System.Drawing.Size(103, 47);
this.makeAscFileButton.TabIndex = 7;
this.makeAscFileButton.Text = "Make *.asc File";
this.makeAscFileButton.UseVisualStyleBackColor = true;
this.makeAscFileButton.Click += new System.EventHandler(this.makeAscFileButton_Click);
//
// addOracleDataButton
//
this.addOracleDataButton.Location = new System.Drawing.Point(117, 95);
this.addOracleDataButton.Name = "addOracleDataButton";
this.addOracleDataButton.Size = new System.Drawing.Size(103, 47);
this.addOracleDataButton.TabIndex = 6;
this.addOracleDataButton.Text = "Add Oracle Data";
this.addOracleDataButton.UseVisualStyleBackColor = true;
this.addOracleDataButton.Click += new System.EventHandler(this.addOracleDataButton_Click);
//
// reportListBox
//
this.reportListBox.Dock = System.Windows.Forms.DockStyle.Fill;
this.reportListBox.FormattingEnabled = true;
this.reportListBox.Location = new System.Drawing.Point(0, 0);
this.reportListBox.Name = "reportListBox";
this.reportListBox.SelectionMode = System.Windows.Forms.SelectionMode.MultiSimple;
this.reportListBox.Size = new System.Drawing.Size(676, 400);
this.reportListBox.TabIndex = 0;
this.reportListBox.DoubleClick += new System.EventHandler(this.reportListBox_DoubleClick);
//
// queryResultsItemsLabel
//
this.queryResultsItemsLabel.AutoSize = true;
this.queryResultsItemsLabel.Location = new System.Drawing.Point(255, 207);
this.queryResultsItemsLabel.Name = "queryResultsItemsLabel";
this.queryResultsItemsLabel.Size = new System.Drawing.Size(40, 13);
this.queryResultsItemsLabel.TabIndex = 13;
this.queryResultsItemsLabel.Text = "0 items";
//
// reportItemsLabel
//
this.reportItemsLabel.AutoSize = true;
this.reportItemsLabel.Location = new System.Drawing.Point(261, 207);
this.reportItemsLabel.Name = "reportItemsLabel";
this.reportItemsLabel.Size = new System.Drawing.Size(40, 13);
this.reportItemsLabel.TabIndex = 14;
this.reportItemsLabel.Text = "0 items";
//
// MainWnd
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(1284, 624);
this.Controls.Add(this.splitContainer2);
this.Name = "MainWnd";
this.Text = "Results browser";
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainWnd_FormClosing);
this.Load += new System.EventHandler(this.MainWnd_Load);
this.splitContainer1.Panel1.ResumeLayout(false);
this.splitContainer1.Panel1.PerformLayout();
this.splitContainer1.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
this.splitContainer1.ResumeLayout(false);
this.batchNrGroupBox.ResumeLayout(false);
this.batchNrGroupBox.PerformLayout();
this.procedureGroupBox.ResumeLayout(false);
this.procedureGroupBox.PerformLayout();
this.fromGroupBox.ResumeLayout(false);
this.fromGroupBox.PerformLayout();
this.purchaseOrderGroupBox.ResumeLayout(false);
this.purchaseOrderGroupBox.PerformLayout();
this.splitContainer2.Panel1.ResumeLayout(false);
this.splitContainer2.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer2)).EndInit();
this.splitContainer2.ResumeLayout(false);
this.splitContainer3.Panel1.ResumeLayout(false);
this.splitContainer3.Panel1.PerformLayout();
this.splitContainer3.Panel2.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.splitContainer3)).EndInit();
this.splitContainer3.ResumeLayout(false);
this.reportFileGroupBox.ResumeLayout(false);
this.ResumeLayout(false);
this.dateFromComboBox = new System.Windows.Forms.ComboBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.dateToComboBox = new System.Windows.Forms.ComboBox();
this.label3 = new System.Windows.Forms.Label();
this.procedureComboBox = new System.Windows.Forms.ComboBox();
this.searchButton = new System.Windows.Forms.Button();
this.resultsTextBox = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// dateFromComboBox
//
this.dateFromComboBox.FormattingEnabled = true;
this.dateFromComboBox.Location = new System.Drawing.Point(45, 49);
this.dateFromComboBox.Name = "dateFromComboBox";
this.dateFromComboBox.Size = new System.Drawing.Size(133, 21);
this.dateFromComboBox.TabIndex = 0;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(42, 32);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(53, 13);
this.label1.TabIndex = 1;
this.label1.Text = "Date from";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(206, 32);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(42, 13);
this.label2.TabIndex = 3;
this.label2.Text = "Date to";
//
// dateToComboBox
//
this.dateToComboBox.FormattingEnabled = true;
this.dateToComboBox.Location = new System.Drawing.Point(209, 49);
this.dateToComboBox.Name = "dateToComboBox";
this.dateToComboBox.Size = new System.Drawing.Size(133, 21);
this.dateToComboBox.TabIndex = 2;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(367, 32);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(56, 13);
this.label3.TabIndex = 5;
this.label3.Text = "Procedure";
//
// procedureComboBox
//
this.procedureComboBox.FormattingEnabled = true;
this.procedureComboBox.Location = new System.Drawing.Point(370, 49);
this.procedureComboBox.Name = "procedureComboBox";
this.procedureComboBox.Size = new System.Drawing.Size(133, 21);
this.procedureComboBox.TabIndex = 4;
//
// searchButton
//
this.searchButton.Location = new System.Drawing.Point(395, 109);
this.searchButton.Name = "searchButton";
this.searchButton.Size = new System.Drawing.Size(107, 31);
this.searchButton.TabIndex = 6;
this.searchButton.Text = "Search";
this.searchButton.UseVisualStyleBackColor = true;
//
// resultsTextBox
//
this.resultsTextBox.Location = new System.Drawing.Point(46, 175);
this.resultsTextBox.Multiline = true;
this.resultsTextBox.Name = "resultsTextBox";
this.resultsTextBox.Size = new System.Drawing.Size(456, 234);
this.resultsTextBox.TabIndex = 7;
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(550, 448);
this.Controls.Add(this.resultsTextBox);
this.Controls.Add(this.searchButton);
this.Controls.Add(this.label3);
this.Controls.Add(this.procedureComboBox);
this.Controls.Add(this.label2);
this.Controls.Add(this.dateToComboBox);
this.Controls.Add(this.label1);
this.Controls.Add(this.dateFromComboBox);
this.Name = "Form1";
this.Text = "Results Browser";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button queryBatchesButton;
private System.Windows.Forms.SplitContainer splitContainer1;
private System.Windows.Forms.GroupBox fromGroupBox;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.CheckBox filterDateCheckBox;
private System.Windows.Forms.DateTimePicker toDateTimePicker;
private System.Windows.Forms.DateTimePicker fromDateTimePicker;
private System.Windows.Forms.GroupBox purchaseOrderGroupBox;
private System.Windows.Forms.CheckBox purchaseOrderCheckBox;
private System.Windows.Forms.ComboBox purchaseOrderComboBox;
private System.Windows.Forms.Button configReportButton;
private System.Windows.Forms.CheckBox resolveManuallyCheckBox;
private System.Windows.Forms.GroupBox procedureGroupBox;
private System.Windows.Forms.CheckBox procedureCheckBox;
private System.Windows.Forms.ComboBox dateFromComboBox;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.ComboBox dateToComboBox;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.ComboBox procedureComboBox;
private System.Windows.Forms.SplitContainer splitContainer2;
private System.Windows.Forms.SplitContainer splitContainer3;
private System.Windows.Forms.Button addOracleDataButton;
private System.Windows.Forms.Button makeAscFileButton;
private System.Windows.Forms.ListBox queryResultsListBox;
private System.Windows.Forms.ListBox reportListBox;
private System.Windows.Forms.GroupBox reportFileGroupBox;
private System.Windows.Forms.Button browseFileButton;
private System.Windows.Forms.ComboBox reportFileComboBox;
private System.Windows.Forms.Button removeFromQueryButton;
private System.Windows.Forms.Button addToReportButton;
private System.Windows.Forms.Button removeFromReportButton;
private System.Windows.Forms.GroupBox batchNrGroupBox;
private System.Windows.Forms.TextBox batchNrToTextBox;
private System.Windows.Forms.TextBox batchNrFromTextBox;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.CheckBox batchNrCheckBox;
private System.Windows.Forms.Button makeReportButton;
private System.Windows.Forms.Button configButton;
private System.Windows.Forms.Button queryWatermetersButton;
private System.Windows.Forms.Label queryResultsItemsLabel;
private System.Windows.Forms.Label reportItemsLabel;
private System.Windows.Forms.Button searchButton;
private System.Windows.Forms.TextBox resultsTextBox;
}
}
+5 -573
View File
@@ -1,587 +1,19 @@
///
/// Copyright (c) 2015 Sensus Metering Systems
///
using System;
using System;
using System.Collections.Generic;
using System.IO;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using log4net;
using NHibernate;
using Oracle.DataAccess.Client; // ODP.NET Oracle managed provider
using Oracle.DataAccess.Types;
using Results.Entities;
namespace ResultsBrowser
{
public partial class MainWnd : Form
{
static readonly ILog log = LogManager.GetLogger(typeof(MainWnd));
bool batchesQueried;
public static IList<Batch> QueryBatches;
public static IList<WaterMeter> QueryWaterMeters;
public static IList<Batch> ReportBatches;
public static IList<WaterMeter> ReportWaterMeters;
public IList<Results.ItemSpec> ReportItems_Single;
public IList<Results.ItemSpec> ReportItems_Compound;
public MainWnd()
{
InitializeComponent();
Text = string.Format("Results browser ver. {0}",
Program.Version);
QueryBatches = new List<Batch>();
QueryWaterMeters = new List<WaterMeter>();
ReportBatches = new List<Batch>();
ReportWaterMeters = new List<WaterMeter>();
}
private void MainWnd_Load(object sender, EventArgs e)
{
PrepareComboBoxHistory(Program.LocalSettings.PurchaseOrderHistory, purchaseOrderComboBox);
PrepareComboBoxHistory(Program.LocalSettings.ProcedureHistory, procedureComboBox);
PrepareComboBoxHistory(Program.LocalSettings.ReportFileNameHistory, reportFileComboBox);
purchaseOrderComboBox.Text = Program.LocalSettings.LastPurchaseOrder;
procedureComboBox.Text = Program.LocalSettings.LastProcedure;
reportFileComboBox.Text = Program.LocalSettings.LastReportFileName;
ReportItems_Single = Results.ItemSpec.FromStrArray(Program.LocalSettings.ReportItems_Single);
ReportItems_Compound = Results.ItemSpec.FromStrArray(Program.LocalSettings.ReportItems_Compound);
purchaseOrderCheckBox.Checked = Program.LocalSettings.FilterPurchaseOrder;
procedureCheckBox.Checked = Program.LocalSettings.FilterProcedure;
batchNrCheckBox.Checked = Program.LocalSettings.FilterBatchNr;
filterDateCheckBox.Checked = Program.LocalSettings.FilterDate;
resolveManuallyCheckBox.Checked = Program.LocalSettings.ResolveManually;
batchNrFromTextBox.Text = Program.LocalSettings.BatchFrom;
batchNrToTextBox.Text = Program.LocalSettings.BatchTo;
Results.DB.ConnectionString = Program.LocalSettings.ConnectionString_WR10;
}
private void MainWnd_FormClosing(object sender, FormClosingEventArgs e)
{
Program.LocalSettings.UpdateHistory(purchaseOrderComboBox.Text, ref Program.LocalSettings.PurchaseOrderHistory);
Program.LocalSettings.UpdateHistory(procedureComboBox.Text, ref Program.LocalSettings.PurchaseOrderHistory);
Program.LocalSettings.UpdateHistory(reportFileComboBox.Text, ref Program.LocalSettings.ReportFileNameHistory);
Program.LocalSettings.LastPurchaseOrder = purchaseOrderComboBox.Text;
Program.LocalSettings.LastProcedure = procedureComboBox.Text;
Program.LocalSettings.LastReportFileName = reportFileComboBox.Text;
Program.LocalSettings.ReportItems_Single = Results.ItemSpec.ToStrArray(ReportItems_Single);
Program.LocalSettings.ReportItems_Compound = Results.ItemSpec.ToStrArray(ReportItems_Compound);
Program.LocalSettings.FilterPurchaseOrder = purchaseOrderCheckBox.Checked;
Program.LocalSettings.FilterProcedure = procedureCheckBox.Checked;
Program.LocalSettings.FilterBatchNr = batchNrCheckBox.Checked;
Program.LocalSettings.FilterDate = filterDateCheckBox.Checked;
Program.LocalSettings.BatchFrom = batchNrFromTextBox.Text;
Program.LocalSettings.BatchTo = batchNrToTextBox.Text;
Program.LocalSettings.ResolveManually = resolveManuallyCheckBox.Checked;
Program.LocalSettings.Save();
}
void RedrawLists()
{
RedrawQueryList();
RedrawReportList();
}
void RedrawQueryList()
{
queryResultsListBox.Items.Clear();
if (batchesQueried)
{
foreach (var b in QueryBatches) queryResultsListBox.Items.Add(b.ToString());
}
else
{
foreach (var wmr in QueryWaterMeters) queryResultsListBox.Items.Add(wmr);
}
int nrItems = queryResultsListBox.Items.Count;
if (nrItems == 0) queryResultsListBox.Items.Add("<empty>");
queryResultsItemsLabel.Text = string.Format("{0} items", nrItems);
}
void RedrawReportList()
{
reportListBox.Items.Clear();
foreach (var wmr in ReportWaterMeters) reportListBox.Items.Add(wmr);
int nrItems = reportListBox.Items.Count;
if (nrItems == 0) reportListBox.Items.Add("<empty>");
reportItemsLabel.Text = string.Format("{0} items", nrItems);
}
/// <summary>
/// Load Purchase order combo box items from the LocalSettings PurchaseOrderHistory array
/// </summary>
/// <param name="comboBox">Puchase order ComboBox</param>
void PrepareComboBoxHistory(string[] history, ComboBox comboBox)
{
if (history == null || history.Length == 0) return;
for (int i = 0; i < history.Length; i++) comboBox.Items.Add(history[i]);
if (comboBox.Items.Count > 0) comboBox.Text = comboBox.Items[0].ToString();
}
private void filterDateCheckBox_CheckedChanged(object sender, EventArgs e)
{
fromDateTimePicker.Enabled = toDateTimePicker.Enabled = filterDateCheckBox.Checked;
}
private void purchaseOrderCheckBox_CheckedChanged(object sender, EventArgs e)
{
purchaseOrderComboBox.Enabled = purchaseOrderCheckBox.Checked;
}
private void procedureCheckBox_CheckedChanged(object sender, EventArgs e)
{
procedureComboBox.Enabled = procedureCheckBox.Checked;
}
private void clearButton_Click(object sender, EventArgs e)
{
QueryWaterMeters.Clear();
queryResultsListBox.Items.Clear();
}
private void configReportButton_Click(object sender, EventArgs e)
{
Forms.ResultsConfig dlg = new Forms.ResultsConfig(false);
dlg.ReportItems_Single = ReportItems_Single;
dlg.ReportItems_Compound = ReportItems_Compound;
if (DialogResult.OK == dlg.ShowDialog())
{
ReportItems_Single = dlg.ReportItems_Single;
ReportItems_Compound = dlg.ReportItems_Compound;
Program.LocalSettings.ReportItems_Single = Results.ItemSpec.ToStrArray(ReportItems_Single);
Program.LocalSettings.ReportItems_Compound = Results.ItemSpec.ToStrArray(ReportItems_Compound);
}
}
private void removeFromQueryButton_Click(object sender, EventArgs e)
{
try
{
/// Remove from the list (the last selected item first so that the indexes are not affected)
for (int i = queryResultsListBox.SelectedIndices.Count - 1; i >= 0; i--)
{
if (batchesQueried)
{
QueryBatches.RemoveAt(queryResultsListBox.SelectedIndices[i]);
}
else
{
QueryWaterMeters.RemoveAt(queryResultsListBox.SelectedIndices[i]);
}
}
RedrawLists();
}
catch
{
MessageBox.Show("Something strange happened", "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
}
}
private void removeFromReportButton_Click(object sender, EventArgs e)
{
/// Remove from the list (the last selected item first so that the indexes are not affected)
for (int i = reportListBox.SelectedIndices.Count - 1; i >= 0; i--)
{
ReportWaterMeters.RemoveAt(reportListBox.SelectedIndices[i]);
}
RedrawLists();
}
private void addToReportButton_Click(object sender, EventArgs e)
{
if (batchesQueried)
{
foreach (var b in QueryBatches)
{
foreach (var wm in b.WaterMeters) ReportWaterMeters.Add(wm);
}
}
else
{
foreach (var wm in QueryWaterMeters)
{
if (!ReportWaterMeters.Contains(wm)) ReportWaterMeters.Add(wm);
}
}
RedrawLists();
}
private void browseFileButton_Click(object sender, EventArgs e)
{
SaveFileDialog dlg = new SaveFileDialog();
dlg.Title = "Target file";
if (dlg.ShowDialog() == DialogResult.OK)
{
reportFileComboBox.Text = dlg.FileName;
}
}
private void addOracleDataButton_Click(object sender, EventArgs e)
{
#if IPERLST
if (ReportWaterMeters.Count == 0) return;
/// Oracle database connection
OracleConnection conn = new OracleConnection("Data Source=STARA01.WORLD;User Id=deltachef;Password=deltachef;");
try
{
conn.Open();
for (int i = 0; i < ReportWaterMeters.Count; i++)
{
Results.Entities.WaterMeter wm = ReportWaterMeters[i];
IList<int> serialNrExes = new List<int>();
{
OracleParameter parm = new OracleParameter();
parm.OracleDbType = OracleDbType.Varchar2;
parm.Value = wm.SerialNr; /// PCB Nr.
OracleCommand cmd1 = new OracleCommand("SELECT Zaehlernummer, Auftragsnummer FROM VT_ZAEHLER_PD WHERE VT_Fernum = :1 AND ANBID = 4", conn);
cmd1.Parameters.Add(parm);
OracleDataReader dr = cmd1.ExecuteReader();
if (dr.Read())
{
wm.SerialNrEx = dr.GetInt32(0);
wm.PurchaseOrder = dr.GetString(1);
}
dr.Close();
}
}
conn.Close();
}
catch (Exception exc)
{
MessageBox.Show(string.Format("Error when querying Oracle database:\r\n{0}", exc.Message),
"Error", MessageBoxButtons.OK, MessageBoxIcon.Hand);
RedrawLists();
return;
}
RedrawLists();
#endif
}
/// <summary>
/// Create ASC file in R.Uhlik format
/// </summary>
/// <param name="sender"></param>
/// <param name="e"></param>
private void makeAscFileButton_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(reportFileComboBox.Text))
{
MessageBox.Show("No report file selected.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return;
}
using (TextWriter report = new StreamWriter(reportFileComboBox.Text, true))
{
foreach (var wm in ReportWaterMeters)
{
try
{
StringBuilder sb = new StringBuilder();
#if IPERLST
sb.Append(wm.SerialNrEx);
#else
sb.Append(wm.SerialNr);
#endif
sb.Append(';'); sb.Append(wm.ProductName());
sb.Append(';'); sb.Append(wm.ApprovalInfo());
sb.Append(';'); sb.Append(wm.MetrologicalClass());
sb.Append(';'); sb.Append("0");
sb.Append(';'); sb.Append((1000 * (wm.GetTestRslt("Q1") != null ? wm.GetTestRslt("Q1").Qfrom() : 0)).ToString("F0")); /// Q1 nominal
sb.Append(';'); sb.Append((1000 * (wm.GetTestRslt("Q2") != null ? wm.GetTestRslt("Q2").Qfrom() : 0)).ToString("F0")); /// Q2 nominal
sb.Append(';'); sb.Append((1000 * (wm.GetTestRslt("Q3") != null ? wm.GetTestRslt("Q3").Qto() : 0)).ToString("F0")); /// Q3 nominal
sb.Append(';'); sb.Append("0"); /// Q4 nominal
sb.Append(';'); sb.Append(wm.Batch.UserNumber); /// Worker code
sb.Append(';'); sb.Append(ToShortStr(wm.EndTime()));
sb.Append(';'); sb.Append((wm.GetMeterTestRslt("Q1") != null ? wm.GetMeterTestRslt("Q1").Error : 99).ToString("F1")); /// Q1 Error [%]
sb.Append(';'); sb.Append((wm.GetMeterTestRslt("Q2") != null ? wm.GetMeterTestRslt("Q2").Error : 99).ToString("F1")); /// Q2 Error [%]
sb.Append(';'); sb.Append((wm.GetMeterTestRslt("Q3") != null ? wm.GetMeterTestRslt("Q3").Error : 99).ToString("F1")); /// Q3 Error [%]
sb.Append(';'); sb.Append("0"); /// Q4 Error [%]
sb.Append(';'); sb.Append(Results.Utils.BenchIdOracle2Asc(wm.BenchId()).ToString()); ///
sb.Append(';'); sb.Append(wm.PurchaseOrder);
sb.Append(';'); sb.Append("");
sb.Append(';'); sb.Append("10000");
sb.Append(';'); sb.Append(wm.ProcedureName().Substring(0, 8));
sb.Append(";\""); sb.Append(wm.SerialNr); sb.Append('"');
report.WriteLine(sb);
}
catch (Exception exc)
{
string msg = exc.Message;
}
}
}
MessageBox.Show("Report saved", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
static string ToShortStr(DateTime date)
{
return (((date.Year % 100) * 100 + date.Month) * 100 + date.Day).ToString();
}
private void makeReportButton_Click(object sender, EventArgs e)
{
if (string.IsNullOrEmpty(reportFileComboBox.Text))
{
MessageBox.Show("No report file selected.", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return;
}
if (ReportItems_Single == null || ReportItems_Single.Count == 0)
{
MessageBox.Show("Please, configure the report first", "Warning", MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
return;
}
using (TextWriter report = new StreamWriter(reportFileComboBox.Text, true))
{
foreach (var wm in ReportWaterMeters)
{
try
{
StringBuilder sb = new StringBuilder();
#if IPERLST
sb.Append(wm.SerialNrEx);
#else
sb.Append(wm.SerialNr);
#endif
sb.Append(";\""); sb.Append(wm.SerialNr); sb.Append('"'); /// PCB number
sb.Append(";\""); sb.Append(wm.ProcedureName()); sb.Append('"'); /// Procedure name
sb.Append(';'); sb.Append((1000 * (wm.GetTestRslt("q3") != null ? wm.GetTestRslt("q3").Qto() : 0)).ToString("F0")); /// Q3 nominal
sb.Append(';'); sb.Append((wm.GetMeterTestRslt("adjustment") != null ? wm.GetMeterTestRslt("adjustment").Error : 99).ToString("F2"));/// Adjustment Error [%]
sb.Append(';'); sb.Append((wm.GetMeterTestRslt("q3") != null ? wm.GetMeterTestRslt("q1").Error : 99).ToString("F2")); /// Q1 Error [%]
sb.Append(';'); sb.Append((wm.GetMeterTestRslt("q2") != null ? wm.GetMeterTestRslt("q2").Error : 99).ToString("F2")); /// Q2 Error [%]
sb.Append(';'); sb.Append((wm.GetMeterTestRslt("q1") != null ? wm.GetMeterTestRslt("q3").Error : 99).ToString("F2")); /// Q3 Error [%]
sb.Append(';'); sb.Append(wm.StartTime().ToShortTimeString());
sb.Append(';'); sb.Append(wm.EndTime().ToShortTimeString());
report.WriteLine(sb);
}
catch (Exception exc)
{
string msg = exc.Message;
}
}
}
MessageBox.Show("Report saved", "Info", MessageBoxButtons.OK, MessageBoxIcon.Information);
}
private void configButton_Click(object sender, EventArgs e)
{
if ((new Forms.DatabaseSettings()).ShowDialog() == DialogResult.OK)
{
Results.DB.ConnectionString = Program.LocalSettings.ConnectionString_WR10;
}
}
private void queryBatchesButton_Click(object sender, EventArgs e)
{
if (!purchaseOrderCheckBox.Checked && !procedureCheckBox.Checked &&
!filterDateCheckBox.Checked && !batchNrCheckBox.Checked)
{
return;
}
queryResultsListBox.Items.Clear();
try
{
ISession session = Results.DB.CreateSession();
IList<Batch> batches;
if (filterDateCheckBox.Checked)
{
batches = session.QueryOver<Batch>()
.WhereRestrictionOn(x => x.EndTime)
.IsBetween(fromDateTimePicker.Value.Date)
.And(toDateTimePicker.Value.Date.AddDays(1).AddTicks(-1))
//.OrderBy(x => x.BatchNr).Asc
.List<Batch>();
}
else
{
batches = session.QueryOver<Batch>()
.List<Batch>();
}
if (procedureCheckBox.Checked)
{
IList<Batch> batches2 = new List<Batch>();
foreach (var b in batches)
{
if (b.ProcedureName.Equals(procedureComboBox.Text)) batches2.Add(b);
}
batches = batches2;
}
if (purchaseOrderCheckBox.Checked)
{
IList<Batch> batches3 = new List<Batch>();
foreach (var b in batches)
{
if (b.WaterMeters[0].PurchaseOrder.Equals(purchaseOrderComboBox.Text)) batches3.Add(b);
}
batches = batches3;
}
QueryBatches = batches;
batchesQueried = true;
RedrawQueryList();
///
}
catch (Exception exc)
{
MessageBox.Show(exc.Message, "Exception", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void queryWatermetersButton_Click(object sender, EventArgs e)
{
if (!purchaseOrderCheckBox.Checked && !procedureCheckBox.Checked &&
!filterDateCheckBox.Checked && !batchNrCheckBox.Checked)
{
return;
}
queryResultsListBox.Items.Clear();
try
{
bool purchaseOrderFiltered = false;
bool procedureFiltered = false;
ISession session = Results.DB.CreateSession();
IList<WaterMeter> waterMeters;
if (filterDateCheckBox.Checked)
{
IList<Batch> batches = session.QueryOver<Batch>()
.WhereRestrictionOn(x => x.EndTime)
.IsBetween(fromDateTimePicker.Value.Date)
.And(toDateTimePicker.Value.Date.AddDays(1).AddTicks(-1))
//.OrderBy(x => x.BatchNr).Asc
.List<Batch>();
waterMeters = new List<WaterMeter>();
foreach (var b in batches)
{
foreach (var wm in b.WaterMeters) waterMeters.Add(wm);
}
}
else if (purchaseOrderCheckBox.Checked)
{
waterMeters = session.QueryOver<WaterMeter>()
.Where(x => (x.PurchaseOrder == purchaseOrderCheckBox.Text))
.List<WaterMeter>();
purchaseOrderFiltered = true;
}
else if (procedureCheckBox.Checked && !procedureFiltered)
{
waterMeters = session.QueryOver<WaterMeter>()
.Where(x => (x.Batch.ProcedureName == procedureComboBox.Text))
.List<WaterMeter>();
procedureFiltered = true;
}
else
{
waterMeters = session.QueryOver<WaterMeter>().List<WaterMeter>();
}
if (purchaseOrderCheckBox.Checked && !purchaseOrderFiltered)
{
IList<WaterMeter> waterMeters3 = new List<WaterMeter>();
foreach (var wm in waterMeters)
{
if (wm.PurchaseOrder.Equals(purchaseOrderComboBox.Text)) waterMeters3.Add(wm);
}
waterMeters = waterMeters3;
purchaseOrderFiltered = true;
}
if (procedureCheckBox.Checked && !procedureFiltered)
{
IList<WaterMeter> waterMeters2 = new List<WaterMeter>();
foreach (var wm in waterMeters)
{
if (wm.Batch.ProcedureName.Equals(procedureComboBox.Text)) waterMeters2.Add(wm);
}
waterMeters = waterMeters2;
procedureFiltered = true;
}
QueryWaterMeters = waterMeters;
batchesQueried = false;
RedrawQueryList();
}
catch (Exception exc)
{
MessageBox.Show(exc.Message, "Exception", MessageBoxButtons.OK, MessageBoxIcon.Error);
}
}
private void queryResultsListBox_DoubleClick(object sender, EventArgs e)
{
}
private void reportListBox_DoubleClick(object sender, EventArgs e)
{
}
}
}
+27
View File
@@ -0,0 +1,27 @@
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)");
}
}
}
+25
View File
@@ -0,0 +1,25 @@
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();
}
}
}
@@ -0,0 +1,19 @@
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);
}
}
}
@@ -0,0 +1,19 @@
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);
}
}
}
+24
View File
@@ -0,0 +1,24 @@
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)");
}
}
}
+14
View File
@@ -0,0 +1,14 @@
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);
}
}
}
@@ -0,0 +1,15 @@
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);
}
}
}
@@ -0,0 +1,24 @@
using FluentNHibernate.Mapping;
using ResultsBrowser.Entities;
namespace ResultsBrowser.Mappings
{
class MeterTestResultMap : ClassMap<MeterTestResult>
{
public MeterTestResultMap()
{
Id(x => x.Id);
References(x => x.TestResult);
Map(x => x.SerialNr);
Map(x => x.EndState);
Map(x => x.VolumeStart);
Map(x => x.VolumeEnd);
Map(x => x.VolumeMeter);
Map(x => x.VolumeRef);
Map(x => x.VolumeErrorPct);
Map(x => x.PulsesMeter);
Map(x => x.PulsesMaster);
Map(x => x.Time);
}
}
}
+39
View File
@@ -0,0 +1,39 @@
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
}
}
}
+31
View File
@@ -0,0 +1,31 @@
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)");
}
}
}
+36
View File
@@ -0,0 +1,36 @@
using FluentNHibernate.Mapping;
using ResultsBrowser.Entities;
namespace ResultsBrowser.Mappings
{
class ProcedureMap : ClassMap<Procedure>
{
public ProcedureMap()
{
Id(x => x.Id);
Map(x => x.ItemNr);
Map(x => x.Name);
Map(x => x.MetersKind);
Map(x => x.Description);
Map(x => x.CreationUser);
Map(x => x.CreationTime);
Map(x => x.LastChgUser);
Map(x => x.LastChgTime);
Map(x => x.LongDescription);
Map(x => x.Watermeters);
Map(x => x.ProtocolTitle);
Map(x => x.DataEntry);
Map(x => x.ResultsPrinter);
Map(x => x.ResultsWriter);
Map(x => x.TransitionStart);
Map(x => x.TransitionEnd);
////Map(x => x.MetrologicalClass);
////HasOne(x => x.WMType);
HasMany(x => x.MoreParams)
.Cascade.All();
HasMany(x => x.Tests)
.OrderBy("ItemNr")
.Cascade.All();
}
}
}
+39
View File
@@ -0,0 +1,39 @@
using FluentNHibernate.Mapping;
using ResultsBrowser.Entities;
namespace ResultsBrowser.Mappings
{
class TestMap : ClassMap<Test>
{
public TestMap()
{
Id(x => x.Id);
Map(x => x.ItemNr);
Map(x => x.Name);
Map(x => x.Part);
Map(x => x.Qfrom);
Map(x => x.Qto);
Map(x => x.Volume);
Map(x => x.TstTime);
Map(x => x.Repeats);
Map(x => x.Emptying);
Map(x => x.Zeroing);
Map(x => x.PumpPower);
Map(x => x.Time2MassMsrmt);
Map(x => x.Method);
Map(x => x.ErrLimLo);
Map(x => x.ErrLimHi);
Map(x => x.TolerRed); /// ???
Map(x => x.RedType); /// ???
Map(x => x.FeedingPath);
Map(x => x.BenchPath);
Map(x => x.OutputPath);
Map(x => x.MetersPath);
Map(x => x.TransitionStart);
Map(x => x.TransitionEnd);
HasMany(x => x.MoreParams)
.Cascade.All();
References(x => x.Procedure);
}
}
}
+105
View File
@@ -0,0 +1,105 @@
using FluentNHibernate.Mapping;
using ResultsBrowser.Entities;
namespace ResultsBrowser.Mappings
{
class TestResultMap : ClassMap<TestResult>
{
public TestResultMap()
{
Id(x => x.Id);
Map(x => x.Name);
Map(x => x.BatchNr)
.Column("CycleNr");
Map(x => x.MetersKind);
HasMany(x => x.Meters)
.Cascade.All();
HasMany(x => x.CombinedMeters)
.Cascade.All();
Map(x => x.ProcedureName);
Map(x => x.ProtocolTitle);
Map(x => x.TestId);
Map(x => x.TestName);
Map(x => x.Part);
Map(x => x.Qfrom);
Map(x => x.Qto);
Map(x => x.Volume);
Map(x => x.TstTime);
Map(x => x.Repeats);
Map(x => x.Emptying);
Map(x => x.Zeroing);
Map(x => x.PumpPower);
Map(x => x.Time2MassMsrmt);
Map(x => x.Method);
Map(x => x.ErrLimLo);
Map(x => x.ErrLimHi);
Map(x => x.FeedingPath)
.CustomType("StringClob")
.CustomSqlType("varchar(4000)");
Map(x => x.BenchPath)
.CustomType("StringClob")
.CustomSqlType("varchar(4000)");
Map(x => x.OutputPath)
.CustomType("StringClob")
.CustomSqlType("varchar(4000)");
Map(x => x.MetersPath)
.CustomType("StringClob")
.CustomSqlType("varchar(4000)");
Map(x => x.TimeStart);
Map(x => x.TimeEnd);
Map(x => x.RepetitionNr);
Map(x => x.AmbientTempAve);
Map(x => x.AmbientPressAve);
Map(x => x.AmbientHumiAve);
Map(x => x.PressInAvrg);
Map(x => x.PressInStart);
Map(x => x.PressInEnd);
Map(x => x.PressOutAvrg);
Map(x => x.PressOutStart);
Map(x => x.PressOutEnd);
Map(x => x.TempInAvrg);
Map(x => x.TempInStart);
Map(x => x.TempInEnd);
Map(x => x.TempOutAvrg);
Map(x => x.TempOutStart);
Map(x => x.TempOutEnd);
Map(x => x.TempDivAvrg);
Map(x => x.TempDivStart);
Map(x => x.TempDivEnd);
Map(x => x.MassStartRaw);
Map(x => x.MassStart);
Map(x => x.MassEndRaw);
Map(x => x.MassEnd);
Map(x => x.MassDiff);
Map(x => x.DensityIn);
Map(x => x.DensityOut);
Map(x => x.DensityDiv);
Map(x => x.FlowMass); /// from conventional true value
Map(x => x.FlowVolume); /// from conventional true value
Map(x => x.VolumeCTV); /// volume conventional true value
Map(x => x.VolumeMaster); /// volume from the master flow meter
Map(x => x.Time); /// measurement time in seconds
Map(x => x.ErrorMaster);
Map(x => x.PulsesMaster);
Map(x => x.ConstMaster); /// Pulses per liter master flow meter
Map(x => x.QRise);
Map(x => x.QFall);
Map(x => x.TimeDivStart0);
Map(x => x.TimeDivStart1);
Map(x => x.TimeDivStart2);
Map(x => x.TimeDivStart3);
Map(x => x.TimeDivStart4);
Map(x => x.TimeDivStart5);
Map(x => x.TimeDivEnd0);
Map(x => x.TimeDivEnd1);
Map(x => x.TimeDivEnd2);
Map(x => x.TimeDivEnd3);
Map(x => x.TimeDivEnd4);
Map(x => x.TimeDivEnd5);
}
}
}
@@ -0,0 +1,19 @@
using FluentNHibernate.Mapping;
using ResultsBrowser.Entities;
namespace ResultsBrowser.Mappings
{
class TransitionSequenceMap : ClassMap<TransitionSequence>
{
public TransitionSequenceMap()
{
Id(x => x.Id);
Map(x => x.ItemNr);
Map(x => x.Name);
Map(x => x.Description);
HasMany(x => x.TransitionSteps)
.OrderBy("ItemNr")
.Cascade.All();
}
}
}
@@ -0,0 +1,26 @@
using FluentNHibernate.Mapping;
using ResultsBrowser.Entities;
namespace ResultsBrowser.Mappings
{
class TransitionStepMap : ClassMap<TransitionStep>
{
public TransitionStepMap()
{
Id(x => x.Id);
Map(x => x.ItemNr);
Map(x => x.Duration);
Map(x => x.Message);
Map(x => x.ValvesOpen)
.CustomType("StringClob")
.CustomSqlType("varchar(8000)");
Map(x => x.ValvesClose)
.CustomType("StringClob")
.CustomSqlType("varchar(8000)");
Map(x => x.RegulValvesPct);
Map(x => x.PumpWithFMPcts);
References(x => x.TransitionSequence);
}
}
}
+18
View File
@@ -0,0 +1,18 @@
using FluentNHibernate.Mapping;
namespace ResultsBrowser.Mappings
{
class UserMap : ClassMap<Entities.User>
{
public UserMap()
{
Id(x => x.Id);
Map(x => x.Name);
Map(x => x.Password);
Map(x => x.Description);
Map(x => x.LastPwChange);
HasMany(x => x.Groups)
.Cascade.All();
}
}
}
@@ -0,0 +1,19 @@
using FluentNHibernate.Mapping;
using ResultsBrowser.Entities;
namespace ResultsBrowser.Mappings
{
class VirtualBenchSequenceMap : ClassMap<VirtualBenchSequence>
{
public VirtualBenchSequenceMap()
{
Id(x => x.Id);
Map(x => x.ItemNr);
Map(x => x.Name);
Map(x => x.Description);
HasMany(x => x.VirtualBenchSteps)
.OrderBy("ItemNr")
.Cascade.All();
}
}
}
@@ -0,0 +1,17 @@
using FluentNHibernate.Mapping;
using ResultsBrowser.Entities;
namespace ResultsBrowser.Mappings
{
class VirtualBenchStepMap : ClassMap<VirtualBenchStep>
{
public VirtualBenchStepMap()
{
Id(x => x.Id);
Map(x => x.ItemNr);
Map(x => x.Duration);
References(x => x.VirtualBenchSequence);
}
}
}
+17
View File
@@ -0,0 +1,17 @@
using FluentNHibernate.Mapping;
namespace ResultsBrowser.Mappings
{
class WMTypeMap : ClassMap<Entities.WMType>
{
public WMTypeMap()
{
Id(x => x.Id);
Map(x => x.CreateTime);
Map(x => x.CreateUserName);
Map(x => x.CreateDescription);
Map(x => x.Name);
Map(x => x.PulseRate);
}
}
}
+16
View File
@@ -0,0 +1,16 @@
using FluentNHibernate.Mapping;
namespace ResultsBrowser.Mappings
{
class WatermeterMap : ClassMap<Entities.Watermeter>
{
public WatermeterMap()
{
Id(x => x.Id);
Map(x => x.Serial);
// HasOne(x => x.WMType)
// .Cascade.All();
References(x => x.WMType);
}
}
}

Some files were not shown because too many files have changed in this diff Show More