Test.TstTime -> TestTime, Config.Ent.Enums + Events.Ent.Enums + Users.Ent.Enums -> Common.Enums, IRegulValve -> IRegValve, etc.

This commit is contained in:
Milan Hanajik 2021-09-23 11:46:40 +02:00
parent 5c55b2540a
commit 698e2dd6c4
536 changed files with 1795 additions and 1364 deletions

View File

@ -42,6 +42,7 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="BackgroundBeep.cs" /> <Compile Include="BackgroundBeep.cs" />
<Compile Include="Enums.cs" />
<Compile Include="Iperl\OptoTelegramRaw.cs" /> <Compile Include="Iperl\OptoTelegramRaw.cs" />
<Compile Include="SerializableDictionary.cs" /> <Compile Include="SerializableDictionary.cs" />
<Compile Include="UIControls\CoolButtonCtrl.cs"> <Compile Include="UIControls\CoolButtonCtrl.cs">

View File

@ -1,11 +1,11 @@
/// ///
/// Copyright (c) 2013-2018 Sensus Slovensko a.s. /// Copyright (c) 2013-2021 Sensus Slovensko a.s.
/// ///
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Reflection; using System.Reflection;
namespace Config.Entities namespace Common
{ {
/// <summary> /// <summary>
/// Helper class to assign descriptions to enum values /// Helper class to assign descriptions to enum values
@ -38,6 +38,115 @@ namespace Config.Entities
} }
} }
/// <summary>
/// Identifies the type of a database
/// </summary>
public enum DBType
{
None, /// Database disabled
MySql, /// MySQL database
SQLite, /// SQLite
Count
}
/// <summary> Identifies the database based on the content </summary>
public enum DBKind
{
Config,
Results,
RemoteConfig,
Count
}
public enum ProcedureSelection
{
#if LANG_CS
[Description("Žádné")] None,
[Description("Lokální postupy")] FromLocalDB,
[Description("Postupy ze sdílené databázy")] FromSharedDB,
[Description("Zakázky z Oracle databázy")] OrderNrFromOracleDB,
[Description("Zakázky ze sledovací databázy")] OrderNrFromTracingDB,
#else
[Description("None")] None,
[Description("Local procedures")] FromLocalDB,
[Description("Shared procedures")] FromSharedDB,
[Description("Orders from Oracle DB")] OrderNrFromOracleDB,
[Description("Orders from Tracing DB")] OrderNrFromTracingDB,
#endif
Count
}
/// <summary>
/// Obsolete - replaced by enum ProcedureSelection (above) in 3.1 and newer
/// </summary>
public enum RemoteDBUse
{
[Description("Local DB only")] LocalDBOnly,
[Description("Remote DB only")] RemoteDBOnly,
[Description("Both DB-s, local 1st")] BothDBsLocalFirst,
[Description("Both DB-s, remote 1st")] BothDBsRemoteFirst,
Count
}
/// <summary>
/// Obsolete - Contains a procedure name and a database specification (local/remote).
/// </summary>
public class ProcedureInfo
{
public readonly string Name;
public readonly bool IsRemote;
public ProcedureInfo(string name, bool isRemote)
{
Name = name;
IsRemote = isRemote;
}
}
public enum LoginMethod
{
UserName, /// = alias, abbreviation
FullName, /// = description
Number,
Count
}
public enum AuthorizedAs
{
PowerUser,
LocalUser,
RemoteUser,
Count
}
/// <summary>
/// GID-s of user groups, each user is member of one or more groups.
/// </summary>
public enum GID
{
Testers,
TestingSpecialists,
HeadOfLab,
MaintenanceSpecialists,
Metrologists,
CalibrationSpecialists,
Administrators, /// application / network / database administrator
TraceabilityManagement,
MetrologicalAuthority,
WaterMeterAuthority,
NrOfGroups, /// Number of groups (this is not a GroupID)
None,
}
public enum MySortOrder
{
None,
Ascending, /// The same like SortOrder.Ascending
Descending, /// The same like SortOrder.Descending
Ascending2, /// Sorts by a surname in ascending order in case or 'Name Surname' column
Descending2, /// Sorts by a surname in descending order in case or 'Name Surname' column
}
/// <summary> /// <summary>
/// Flags returned by each device configuration control Verify(...) function. /// Flags returned by each device configuration control Verify(...) function.
/// </summary> /// </summary>
@ -52,28 +161,48 @@ namespace Config.Entities
InvokeCfgChange = 0x20, /// Invoke CfgChange handler of the component InvokeCfgChange = 0x20, /// Invoke CfgChange handler of the component
} }
public enum RemoteDBUse /// <summary>
/// Event severity
/// </summary>
public enum Severity
{ {
[Description("Local DB only")] LocalDBOnly, Undefined,
[Description("Remote DB only")] RemoteDBOnly, Notification,
[Description("Both DB-s, local 1st")] BothDBsLocalFirst, Warning,
[Description("Both DB-s, remote 1st")] BothDBsRemoteFirst, Error,
FatalError,
Count Count
} }
/// <summary> public enum EventClass
/// Contains a procedure name and a database specification (local/remote).
/// </summary>
public class ProcedureInfo
{ {
public readonly string Name; Undefined,
public readonly bool IsRemote; EquipmentHW,
Metrology,
TestingProcess,
BadResults,
ComputerResources,
Network,
Other,
Count
}
public ProcedureInfo(string name, bool isRemote) public enum SubscriberGroup : long
{ {
Name = name; None = 0,
IsRemote = isRemote; Metrology = 1,
} Maintenance = 2,
Production = 4,
Management = 8,
Finish = 16,
}
public enum EViewerOption
{
Undefined,
AllEvents,
RecentEvents,
UnreadEvents,
} }
public enum ProcedureState public enum ProcedureState
@ -424,7 +553,7 @@ namespace Config.Entities
[Description("Fehler")] FailureDuringOperation, /// Failure during operation -> disabled [Description("Fehler")] FailureDuringOperation, /// Failure during operation -> disabled
[Description("Aus")] Off, /// The component is off [Description("Aus")] Off, /// The component is off
[Description("Aufzeichnen")] Record, [Description("Aufzeichnen")] Record,
[Description("Reply")] Reply, [Description("Abspielen")] Replay,
[Description("Simuliert")] Simulate, /// Test bench simulation, this mode does not require any hardware [Description("Simuliert")] Simulate, /// Test bench simulation, this mode does not require any hardware
[Description("Geerbt")] Inherit, [Description("Geerbt")] Inherit,
#elif LANG_FR #elif LANG_FR
@ -435,7 +564,7 @@ namespace Config.Entities
[Description("Erreur d'exécution")] FailureDuringOperation, [Description("Erreur d'exécution")] FailureDuringOperation,
[Description("Éteindre")] Off, [Description("Éteindre")] Off,
[Description("Record")] Record, [Description("Record")] Record,
[Description("Répondre")] Reply, [Description("Répondre")] Replay,
[Description("Simuler")] Simulate, [Description("Simuler")] Simulate,
[Description("Hériter")] Inherit, [Description("Hériter")] Inherit,
#else #else
@ -446,7 +575,7 @@ namespace Config.Entities
[Description("Run-time error")] FailureDuringOperation, /// Failure during operation -> disabled [Description("Run-time error")] FailureDuringOperation, /// Failure during operation -> disabled
[Description("Off")] Off, /// The component is off [Description("Off")] Off, /// The component is off
[Description("Record")] Record, [Description("Record")] Record,
[Description("Reply")] Reply, [Description("Replay")] Replay,
[Description("Simulate")] Simulate, /// Test bench simulation, this mode does not require any hardware [Description("Simulate")] Simulate, /// Test bench simulation, this mode does not require any hardware
[Description("Inherit")] Inherit, [Description("Inherit")] Inherit,
#endif #endif
@ -584,15 +713,15 @@ namespace Config.Entities
public enum ErrorFlagMask : long public enum ErrorFlagMask : long
{ {
E1 = (1L << 0), /// shift = 0, E1 = 1L E1 = (1L << 0), /// shift = 0, E1 = 1L
E2 = (1L << 1), E2 = (1L << 1),
E3 = (1L << 2), E3 = (1L << 2),
E4 = (1L << 3), E4 = (1L << 3),
E5 = (1L << 4), E5 = (1L << 4),
E6 = (1L << 5), E6 = (1L << 5),
E7 = (1L << 6), E7 = (1L << 6),
E8 = (1L << 7), E8 = (1L << 7),
E9 = (1L << 8), E9 = (1L << 8),
E10 = (1L << 9), E10 = (1L << 9),
E11 = (1L << 10), E11 = (1L << 10),
E12 = (1L << 11), E12 = (1L << 11),
@ -648,4 +777,44 @@ namespace Config.Entities
E62 = (1L << 61), E62 = (1L << 61),
E63 = (1L << 62), E63 = (1L << 62),
} }
#region iPERL enums
public enum Side
{
#if LANG_CS
[Description("Levá")] Left,
[Description("Pravá")] Right,
#else
[Description("Left")] Left,
[Description("Right")] Right,
#endif
Count
}
public enum FlowDir
{
R_L,
L_R,
Count
}
public enum Counting
{
Arbitrary,
Positive,
Negative,
Count
}
public enum OptoHeadState
{
Disabled,
OptoAndDirOK,
OptoNok,
DirNok,
Count
}
#endregion iPERL enums
} }

View File

@ -75,7 +75,6 @@
<Compile Include="Entities\Component.cs" /> <Compile Include="Entities\Component.cs" />
<Compile Include="Entities\ComponentProcedure.cs" /> <Compile Include="Entities\ComponentProcedure.cs" />
<Compile Include="Entities\ComponentTest.cs" /> <Compile Include="Entities\ComponentTest.cs" />
<Compile Include="Entities\Enums.cs" />
<Compile Include="Entities\FeedingPath.cs" /> <Compile Include="Entities\FeedingPath.cs" />
<Compile Include="Entities\Group.cs" /> <Compile Include="Entities\Group.cs" />
<Compile Include="Entities\HeatMetersPath.cs" /> <Compile Include="Entities\HeatMetersPath.cs" />
@ -83,7 +82,6 @@
<Compile Include="Entities\IHasName.cs" /> <Compile Include="Entities\IHasName.cs" />
<Compile Include="Entities\IHasValves.cs" /> <Compile Include="Entities\IHasValves.cs" />
<Compile Include="Entities\IParamsProvider.cs" /> <Compile Include="Entities\IParamsProvider.cs" />
<Compile Include="Entities\IperlEnums.cs" />
<Compile Include="Entities\MeasurementCorrection.cs" /> <Compile Include="Entities\MeasurementCorrection.cs" />
<Compile Include="Entities\MetersPath.cs" /> <Compile Include="Entities\MetersPath.cs" />
<Compile Include="Entities\OutputPath.cs" /> <Compile Include="Entities\OutputPath.cs" />

View File

@ -25,10 +25,10 @@ namespace Config
{ {
BenchName = String.Empty; /// Empty string (avoid null) BenchName = String.Empty; /// Empty string (avoid null)
IsRealBench = false; IsRealBench = false;
ProceduresDBSettings = new Users.DBSettings(Users.Entities.DBType.MySql, string.Empty); ProceduresDBSettings = new Users.DBSettings(Common.DBType.MySql, string.Empty);
WaterMetersDBSettings = new Users.DBSettings(Users.Entities.DBType.MySql, string.Empty); WaterMetersDBSettings = new Users.DBSettings(Common.DBType.MySql, string.Empty);
EventsDBSettings = new Users.DBSettings(Users.Entities.DBType.MySql, string.Empty); EventsDBSettings = new Users.DBSettings(Common.DBType.MySql, string.Empty);
UsersDBSettings = new Users.DBSettings(Users.Entities.DBType.MySql, string.Empty); UsersDBSettings = new Users.DBSettings(Common.DBType.MySql, string.Empty);
} }
public object Clone() public object Clone()

View File

@ -4,6 +4,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using Common;
namespace Config.Entities namespace Config.Entities
{ {
@ -86,7 +87,7 @@ namespace Config.Entities
else if (line.Equals(DebugMode.FailureDuringOperation.ToString())) result.Mode = DebugMode.FailureDuringOperation; else if (line.Equals(DebugMode.FailureDuringOperation.ToString())) result.Mode = DebugMode.FailureDuringOperation;
else if (line.Equals(DebugMode.Off.ToString())) result.Mode = DebugMode.Off; else if (line.Equals(DebugMode.Off.ToString())) result.Mode = DebugMode.Off;
else if (line.Equals(DebugMode.Record.ToString())) result.Mode = DebugMode.Record; else if (line.Equals(DebugMode.Record.ToString())) result.Mode = DebugMode.Record;
else if (line.Equals(DebugMode.Reply.ToString())) result.Mode = DebugMode.Reply; else if (line.Equals(DebugMode.Replay.ToString())) result.Mode = DebugMode.Replay;
else if (line.Equals(DebugMode.Simulate.ToString())) result.Mode = DebugMode.Simulate; else if (line.Equals(DebugMode.Simulate.ToString())) result.Mode = DebugMode.Simulate;
else if (line.Equals(DebugMode.Inherit.ToString())) result.Mode = DebugMode.Inherit; else if (line.Equals(DebugMode.Inherit.ToString())) result.Mode = DebugMode.Inherit;

View File

@ -9,7 +9,7 @@ namespace Config.Entities
public class Group public class Group
{ {
public virtual int Id { get; protected set; } public virtual int Id { get; protected set; }
public virtual Users.Entities.GID GID { get; set; } public virtual Common.GID GID { get; set; }
public virtual long AccessFlags { get; set; } /// Bitfield of access flags: bit0 .. bit62 public virtual long AccessFlags { get; set; } /// Bitfield of access flags: bit0 .. bit62
public virtual IList<User> Users { get; set; } /// Group can be a member of a list of users public virtual IList<User> Users { get; set; } /// Group can be a member of a list of users
@ -18,7 +18,7 @@ namespace Config.Entities
Users = new List<User>(); Users = new List<User>();
} }
public Group(Users.Entities.GID gid) public Group(Common.GID gid)
: this() : this()
{ {
GID = gid; GID = gid;

View File

@ -4,6 +4,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Xml.Serialization; using System.Xml.Serialization;
using Common;
namespace Config.Entities namespace Config.Entities
{ {

View File

@ -1,44 +0,0 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System;
namespace Config.Entities
{
public enum Side
{
#if LANG_CS
[Description("Levá")] Left,
[Description("Pravá")] Right,
#else
[Description("Left")] Left,
[Description("Right")] Right,
#endif
Count
}
public enum FlowDir
{
R_L,
L_R,
Count
}
public enum Counting
{
Arbitrary,
Positive,
Negative,
Count
}
public enum OptoHeadState
{
Disabled,
OptoAndDirOK,
OptoNok,
DirNok,
Count
}
}

View File

@ -4,6 +4,7 @@
using System; using System;
using System.Globalization; using System.Globalization;
using System.IO; using System.IO;
using Common;
namespace Config.Entities namespace Config.Entities
{ {
@ -78,7 +79,7 @@ namespace Config.Entities
TempLimHi = 25.0; /// [°C] TempLimHi = 25.0; /// [°C]
PressLimLo = 0; /// [bar] PressLimLo = 0; /// [bar]
PressLimHi = 16.0; /// [bar] PressLimHi = 16.0; /// [bar]
Publish = (sbyte)Config.Entities.Publish.Always; Publish = (sbyte)Common.Publish.Always;
Evaluate = true; Evaluate = true;
E1 = (sbyte)ErrorFlagsMode.On; E1 = (sbyte)ErrorFlagsMode.On;

View File

@ -5,6 +5,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using System.IO; using System.IO;
using Common;
namespace Config.Entities namespace Config.Entities
{ {
@ -78,7 +79,7 @@ namespace Config.Entities
CreationTime = DateTime.Now; CreationTime = DateTime.Now;
LastChgUser = CreationUser; LastChgUser = CreationUser;
LastChgTime = CreationTime; LastChgTime = CreationTime;
MetersKind = Entities.MetersKind.Single; MetersKind = MetersKind.Single;
Watermeters = string.Empty; Watermeters = string.Empty;
Description = string.Empty; Description = string.Empty;
LongDescription = string.Empty; LongDescription = string.Empty;

View File

@ -5,6 +5,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using System.IO; using System.IO;
using Common;
namespace Config.Entities namespace Config.Entities
{ {

View File

@ -5,6 +5,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Globalization; using System.Globalization;
using System.IO; using System.IO;
using Common;
namespace Config.Entities namespace Config.Entities
{ {
@ -25,7 +26,7 @@ namespace Config.Entities
public virtual float Qfrom { get; set; } /// Water flow low limit in [m3/h] 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 Qto { get; set; } /// Water flow high limit in [m3/h]
public virtual float Volume { get; set; } /// Test volume (target) in [l] public virtual float Volume { get; set; } /// Test volume (target) in [l]
public virtual float TstTime { get; set; } /// Test time (estimate) in [s] public virtual float TestTime { get; set; } /// Test time (estimate) in [s]
public virtual string Method { get; set; } public virtual string Method { get; set; }
public virtual float ErrLimLo { get; set; } /// in [%] usually < 0, in case of heat meters: 1=class1, 2=class2, 3=class3 public virtual float ErrLimLo { get; set; } /// in [%] usually < 0, in case of heat meters: 1=class1, 2=class2, 3=class3
public virtual float ErrLimHi { get; set; } /// in [%] usually > 0, in case of heat meters: -Qn in m3/h public virtual float ErrLimHi { get; set; } /// in [%] usually > 0, in case of heat meters: -Qn in m3/h
@ -44,7 +45,7 @@ namespace Config.Entities
public virtual int TimeFlow2Mass { get; set; } /// Delay time from the flow stable to the 1st mass measurement in [s] public virtual int TimeFlow2Mass { get; set; } /// Delay time from the flow stable to the 1st mass measurement in [s]
public virtual int TimePump2StartV { get; set; } /// Delay time from the start of the pump to opening the start valve in [s] public virtual int TimePump2StartV { get; set; } /// Delay time from the start of the pump to opening the start valve in [s]
public virtual int TimeStop2Mass { get; set; } /// Delay time from the test end (diverted) to the 2nd mass measuremen in [s] public virtual int TimeStop2Mass { get; set; } /// Delay time from the test end (diverted) to the 2nd mass measuremen in [s]
public virtual double TolerRed { get; set; } /// = Filter public virtual double ShortPulses { get; set; } /// = Filter
public virtual string RedType { get; set; } public virtual string RedType { get; set; }
public virtual string FeedingPath { get; set; } public virtual string FeedingPath { get; set; }
public virtual string BenchPath { get; set; } public virtual string BenchPath { get; set; }
@ -53,9 +54,9 @@ namespace Config.Entities
#if HEAT_METERS #if HEAT_METERS
public virtual string HeatMetersPath { get; set; } public virtual string HeatMetersPath { get; set; }
#endif #endif
public virtual string RelTransBefore { get; set; } public virtual string TransBefore { get; set; }
public virtual string RelTransBetween { get; set; } public virtual string TransBetween { get; set; }
public virtual string TransitionAfter { get; set; } public virtual string TransAfter { get; set; }
public virtual bool IsOuterLoopStart { get; set; } /// Not mapped to database public virtual bool IsOuterLoopStart { get; set; } /// Not mapped to database
public virtual bool IsOuterLoopEnd { get; set; } /// Not mapped to database public virtual bool IsOuterLoopEnd { get; set; } /// Not mapped to database
@ -75,7 +76,7 @@ namespace Config.Entities
/// ///
Part = 0; Part = 0;
Profile = TestProfile.UserDefined; Profile = TestProfile.UserDefined;
Publish = (sbyte)Config.Entities.Publish.Always; Publish = (sbyte)Common.Publish.Always;
DoEvaluate = true; DoEvaluate = true;
Repeats = 1; Repeats = 1;
DoDraining = false; DoDraining = false;
@ -94,10 +95,10 @@ namespace Config.Entities
TimeFlow2Mass = 5; /// [s] time from the flow stable to the 1st mass measurement in [s] TimeFlow2Mass = 5; /// [s] time from the flow stable to the 1st mass measurement in [s]
TimePump2StartV = 1; /// [s] time from the 1st mass measurement to the test start in [s] TimePump2StartV = 1; /// [s] time from the 1st mass measurement to the test start in [s]
TimeStop2Mass = 5; /// [s] between the test end and the final mass measurement TimeStop2Mass = 5; /// [s] between the test end and the final mass measurement
TolerRed = 0; /// = Filter parameter ShortPulses = 0; /// = Filter parameter
RelTransBefore = string.Empty; TransBefore = string.Empty;
RelTransBetween = string.Empty; TransBetween = string.Empty;
TransitionAfter = string.Empty; TransAfter = string.Empty;
} }
public Test(string name, int itemNr, Procedure procedure) public Test(string name, int itemNr, Procedure procedure)
@ -137,7 +138,7 @@ namespace Config.Entities
result.Qfrom = Qfrom; result.Qfrom = Qfrom;
result.Qto = Qto; result.Qto = Qto;
result.Volume = Volume; result.Volume = Volume;
result.TstTime = TstTime; result.TestTime = TestTime;
result.Method = Method; result.Method = Method;
result.ErrLimLo = ErrLimLo; result.ErrLimLo = ErrLimLo;
result.ErrLimHi = ErrLimHi; result.ErrLimHi = ErrLimHi;
@ -156,7 +157,7 @@ namespace Config.Entities
result.TimeFlow2Mass = TimeFlow2Mass; result.TimeFlow2Mass = TimeFlow2Mass;
result.TimePump2StartV = TimePump2StartV; result.TimePump2StartV = TimePump2StartV;
result.TimeStop2Mass = TimeStop2Mass; result.TimeStop2Mass = TimeStop2Mass;
result.TolerRed = TolerRed; result.ShortPulses = ShortPulses;
result.RedType = RedType; result.RedType = RedType;
result.FeedingPath = FeedingPath; result.FeedingPath = FeedingPath;
result.BenchPath = BenchPath; result.BenchPath = BenchPath;
@ -165,9 +166,9 @@ namespace Config.Entities
#if HEAT_METERS #if HEAT_METERS
result.HeatMetersPath = HeatMetersPath; result.HeatMetersPath = HeatMetersPath;
#endif #endif
result.RelTransBefore = RelTransBefore; result.TransBefore = TransBefore;
result.RelTransBetween = RelTransBetween; result.TransBetween = TransBetween;
result.TransitionAfter = TransitionAfter; result.TransAfter = TransAfter;
foreach (var prms in MoreParams) { result.MoreParams.Add(prms.Clone()); } foreach (var prms in MoreParams) { result.MoreParams.Add(prms.Clone()); }
return result; return result;
@ -185,7 +186,7 @@ namespace Config.Entities
output.WriteLine(Qfrom.ToString(ci)); output.WriteLine(Qfrom.ToString(ci));
output.WriteLine(Qto.ToString(ci)); output.WriteLine(Qto.ToString(ci));
output.WriteLine(Volume.ToString(ci)); output.WriteLine(Volume.ToString(ci));
output.WriteLine(TstTime.ToString(ci)); output.WriteLine(TestTime.ToString(ci));
output.WriteLine(Method); output.WriteLine(Method);
output.WriteLine(ErrLimLo.ToString(ci)); output.WriteLine(ErrLimLo.ToString(ci));
output.WriteLine(ErrLimHi.ToString(ci)); output.WriteLine(ErrLimHi.ToString(ci));
@ -208,10 +209,10 @@ namespace Config.Entities
output.WriteLine(BenchPath); output.WriteLine(BenchPath);
output.WriteLine(OutputPath); output.WriteLine(OutputPath);
output.WriteLine(MetersPath); output.WriteLine(MetersPath);
output.WriteLine(RelTransBefore); output.WriteLine(TransBefore);
output.WriteLine(RelTransBetween); output.WriteLine(TransBetween);
output.WriteLine(Profile); output.WriteLine(Profile);
output.WriteLine(TransitionAfter); output.WriteLine(TransAfter);
foreach (var prms in MoreParams) { prms.Export(output); } foreach (var prms in MoreParams) { prms.Export(output); }
output.WriteLine(); output.WriteLine();
@ -236,7 +237,7 @@ namespace Config.Entities
tst.Qfrom = float.Parse(input.ReadLine(), ci); tst.Qfrom = float.Parse(input.ReadLine(), ci);
tst.Qto = float.Parse(input.ReadLine(), ci); tst.Qto = float.Parse(input.ReadLine(), ci);
tst.Volume = float.Parse(input.ReadLine(), ci); tst.Volume = float.Parse(input.ReadLine(), ci);
tst.TstTime = float.Parse(input.ReadLine(), ci); tst.TestTime = float.Parse(input.ReadLine(), ci);
tst.Method = input.ReadLine(); tst.Method = input.ReadLine();
tst.ErrLimLo = float.Parse(input.ReadLine(), ci); tst.ErrLimLo = float.Parse(input.ReadLine(), ci);
tst.ErrLimHi = float.Parse(input.ReadLine(), ci); tst.ErrLimHi = float.Parse(input.ReadLine(), ci);
@ -259,13 +260,13 @@ namespace Config.Entities
tst.BenchPath = input.ReadLine(); tst.BenchPath = input.ReadLine();
tst.OutputPath = input.ReadLine(); tst.OutputPath = input.ReadLine();
tst.MetersPath = input.ReadLine(); tst.MetersPath = input.ReadLine();
tst.RelTransBefore = input.ReadLine(); tst.TransBefore = input.ReadLine();
tst.RelTransBetween = input.ReadLine(); tst.TransBetween = input.ReadLine();
string line = input.ReadLine(); string line = input.ReadLine();
tst.Profile = line.Equals(TestProfile.ProtectedHeatMeter.ToString()) ? TestProfile.ProtectedHeatMeter tst.Profile = line.Equals(TestProfile.ProtectedHeatMeter.ToString()) ? TestProfile.ProtectedHeatMeter
: line.Equals(TestProfile.UserDefinedHeatMeter.ToString()) ? TestProfile.UserDefinedHeatMeter : line.Equals(TestProfile.UserDefinedHeatMeter.ToString()) ? TestProfile.UserDefinedHeatMeter
: line.Equals(TestProfile.Protected.ToString()) ? TestProfile.Protected : TestProfile.UserDefined; /// UserDefined is the default : line.Equals(TestProfile.Protected.ToString()) ? TestProfile.Protected : TestProfile.UserDefined; /// UserDefined is the default
tst.TransitionAfter = input.ReadLine(); tst.TransAfter = input.ReadLine();
while (true) while (true)
{ {
@ -298,7 +299,7 @@ namespace Config.Entities
ln = inp.ReadLine(); if (ln != Qfrom.ToString(ci)) { diff.AppendFormat(fmt, "Qfrom", Qfrom.ToString(ci), ln); }; ln = inp.ReadLine(); if (ln != Qfrom.ToString(ci)) { diff.AppendFormat(fmt, "Qfrom", Qfrom.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != Qto.ToString(ci)) { diff.AppendFormat(fmt, "Qto", Qto.ToString(ci), ln); }; ln = inp.ReadLine(); if (ln != Qto.ToString(ci)) { diff.AppendFormat(fmt, "Qto", Qto.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != Volume.ToString(ci)) { diff.AppendFormat(fmt, "Volume", Volume.ToString(ci), ln); }; ln = inp.ReadLine(); if (ln != Volume.ToString(ci)) { diff.AppendFormat(fmt, "Volume", Volume.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != TstTime.ToString(ci)) { diff.AppendFormat(fmt, "TstTime", TstTime.ToString(ci), ln); }; ln = inp.ReadLine(); if (ln != TestTime.ToString(ci)) { diff.AppendFormat(fmt, "TstTime", TestTime.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != Method) { diff.AppendFormat(fmt, "Method", Method, ln); }; ln = inp.ReadLine(); if (ln != Method) { diff.AppendFormat(fmt, "Method", Method, ln); };
ln = inp.ReadLine(); if (ln != ErrLimLo.ToString(ci)) { diff.AppendFormat(fmt, "ErrLimLo", ErrLimLo.ToString(ci), ln); }; ln = inp.ReadLine(); if (ln != ErrLimLo.ToString(ci)) { diff.AppendFormat(fmt, "ErrLimLo", ErrLimLo.ToString(ci), ln); };
ln = inp.ReadLine(); if (ln != ErrLimHi.ToString(ci)) { diff.AppendFormat(fmt, "ErrLimHi", ErrLimHi.ToString(ci), ln); }; ln = inp.ReadLine(); if (ln != ErrLimHi.ToString(ci)) { diff.AppendFormat(fmt, "ErrLimHi", ErrLimHi.ToString(ci), ln); };
@ -321,10 +322,10 @@ namespace Config.Entities
ln = inp.ReadLine(); if (ln != BenchPath) { diff.AppendFormat(fmt, "BenchPath", BenchPath, ln); }; ln = inp.ReadLine(); if (ln != BenchPath) { diff.AppendFormat(fmt, "BenchPath", BenchPath, ln); };
ln = inp.ReadLine(); if (ln != OutputPath) { diff.AppendFormat(fmt, "OutputPath", OutputPath, ln); }; ln = inp.ReadLine(); if (ln != OutputPath) { diff.AppendFormat(fmt, "OutputPath", OutputPath, ln); };
ln = inp.ReadLine(); if (ln != MetersPath) { diff.AppendFormat(fmt, "MetersPath", MetersPath, ln); }; ln = inp.ReadLine(); if (ln != MetersPath) { diff.AppendFormat(fmt, "MetersPath", MetersPath, ln); };
ln = inp.ReadLine(); if (ln != RelTransBefore) { diff.AppendFormat(fmt, "RelTransBefore", RelTransBefore, ln); }; ln = inp.ReadLine(); if (ln != TransBefore) { diff.AppendFormat(fmt, "RelTransBefore", TransBefore, ln); };
ln = inp.ReadLine(); if (ln != RelTransBetween) { diff.AppendFormat(fmt, "RelTransBetween", RelTransBetween, ln); }; ln = inp.ReadLine(); if (ln != TransBetween) { diff.AppendFormat(fmt, "RelTransBetween", TransBetween, ln); };
ln = inp.ReadLine(); if (ln != Profile.ToString()) { diff.AppendFormat(fmt, "RelTransAfter", Profile, ln); }; ln = inp.ReadLine(); if (ln != Profile.ToString()) { diff.AppendFormat(fmt, "RelTransAfter", Profile, ln); };
ln = inp.ReadLine(); if (ln != TransitionAfter) { diff.AppendFormat(fmt, "TransitionAfter", TransitionAfter, ln); }; ln = inp.ReadLine(); if (ln != TransAfter) { diff.AppendFormat(fmt, "TransitionAfter", TransAfter, ln); };
return diff.ToString(); return diff.ToString();
} }

View File

@ -18,7 +18,7 @@ namespace Config
/// NHibernate session factory (to create the database session 'SessionFactory') /// NHibernate session factory (to create the database session 'SessionFactory')
/// </summary> /// </summary>
/// <returns>A database session</returns> /// <returns>A database session</returns>
public static ISessionFactory CreateSessionFactory(Users.Entities.DBKind database, Users.Entities.DBType dbType, string connectionString, bool createDB) public static ISessionFactory CreateSessionFactory(Common.DBKind database, Common.DBType dbType, string connectionString, bool createDB)
{ {
try try
{ {
@ -27,10 +27,10 @@ namespace Config
switch (dbType) switch (dbType)
{ {
default: default:
case Users.Entities.DBType.SQLite: case Common.DBType.SQLite:
cfg = cfg.Database(SQLiteConfiguration.Standard.UsingFile(connectionString)); cfg = cfg.Database(SQLiteConfiguration.Standard.UsingFile(connectionString));
break; break;
case Users.Entities.DBType.MySql: case Common.DBType.MySql:
cfg = cfg.Database(MySQLConfiguration.Standard.ConnectionString(connectionString)); cfg = cfg.Database(MySQLConfiguration.Standard.ConnectionString(connectionString));
break; break;
} }
@ -38,11 +38,11 @@ namespace Config
switch (database) switch (database)
{ {
default: default:
case Users.Entities.DBKind.Config: case Common.DBKind.Config:
case Users.Entities.DBKind.RemoteConfig: case Common.DBKind.RemoteConfig:
cfg = cfg.Mappings(m => m.FluentMappings.AddFromAssemblyOf<Data>()); cfg = cfg.Mappings(m => m.FluentMappings.AddFromAssemblyOf<Data>());
break; break;
case Users.Entities.DBKind.Results: case Common.DBKind.Results:
cfg = cfg.Mappings(m => m.FluentMappings.AddFromAssemblyOf<Data>()); cfg = cfg.Mappings(m => m.FluentMappings.AddFromAssemblyOf<Data>());
break; break;
} }
@ -89,9 +89,9 @@ namespace Config
/// <param name="dbType">DBType.SQLite or DBType.MySql</param> /// <param name="dbType">DBType.SQLite or DBType.MySql</param>
/// <param name="connectionString">Connection string</param> /// <param name="connectionString">Connection string</param>
/// <returns>true=success, false=error</returns> /// <returns>true=success, false=error</returns>
public static bool CreateEmptyConfigDB(Users.Entities.DBType dbType, string connectionString) public static bool CreateEmptyConfigDB(Common.DBType dbType, string connectionString)
{ {
ISessionFactory sessionFactory = CreateSessionFactory(Users.Entities.DBKind.Config, dbType, connectionString, true); ISessionFactory sessionFactory = CreateSessionFactory(Common.DBKind.Config, dbType, connectionString, true);
if (sessionFactory == null) return false; if (sessionFactory == null) return false;
/// Populate the database /// Populate the database
@ -113,23 +113,23 @@ namespace Config
/// ///
/// Prepare all groups, add some of them to admin /// Prepare all groups, add some of them to admin
/// ///
for (Users.Entities.GID gid = 0; gid < Users.Entities.GID.NrOfGroups; gid++) for (Common.GID gid = 0; gid < Common.GID.NrOfGroups; gid++)
{ {
Config.Entities.Group group = new Config.Entities.Group(gid); Config.Entities.Group group = new Config.Entities.Group(gid);
switch (gid) switch (gid)
{ {
case Users.Entities.GID.Testers: case Common.GID.Testers:
case Users.Entities.GID.TestingSpecialists: case Common.GID.TestingSpecialists:
case Users.Entities.GID.HeadOfLab: case Common.GID.HeadOfLab:
case Users.Entities.GID.MaintenanceSpecialists: case Common.GID.MaintenanceSpecialists:
case Users.Entities.GID.Metrologists: case Common.GID.Metrologists:
case Users.Entities.GID.CalibrationSpecialists: case Common.GID.CalibrationSpecialists:
case Users.Entities.GID.Administrators: case Common.GID.Administrators:
#if TURA_IPERL || TURA_IPERL_NEW || TURA_SPECIAL #if TURA_IPERL || TURA_IPERL_NEW || TURA_SPECIAL
case Users.Entities.GID.TraceabilityManagement: case Common.GID.TraceabilityManagement:
#elif KEMPNO_50 || KRAKOW_50 || TORUN_50 || WARSAW_END #elif KEMPNO_50 || KRAKOW_50 || TORUN_50 || WARSAW_END
case Users.Entities.GID.MetrologicalAuthority: case Common.GID.MetrologicalAuthority:
case Users.Entities.GID.WaterMeterAuthority: case Common.GID.WaterMeterAuthority:
#endif #endif
admin.AddGroup(group); admin.AddGroup(group);
session.SaveOrUpdate(group); /// Save this group session.SaveOrUpdate(group); /// Save this group

View File

@ -22,7 +22,8 @@ namespace Config.Mappings
Map(x => x.Qfrom); Map(x => x.Qfrom);
Map(x => x.Qto); Map(x => x.Qto);
Map(x => x.Volume); Map(x => x.Volume);
Map(x => x.TstTime); Map(x => x.TestTime)
.Column("TstTime");
Map(x => x.Repeats); Map(x => x.Repeats);
Map(x => x.DoDraining) Map(x => x.DoDraining)
.Column("Emptying"); .Column("Emptying");
@ -45,7 +46,7 @@ namespace Config.Mappings
Map(x => x.ErrLimLo); Map(x => x.ErrLimLo);
Map(x => x.ErrLimHi); Map(x => x.ErrLimHi);
Map(x => x.Uncertainty); Map(x => x.Uncertainty);
Map(x => x.TolerRed) Map(x => x.ShortPulses)
.Column("TolerRed"); /// ??? .Column("TolerRed"); /// ???
Map(x => x.RedType); Map(x => x.RedType);
Map(x => x.FeedingPath); Map(x => x.FeedingPath);
@ -55,11 +56,11 @@ namespace Config.Mappings
#if HEAT_METERS #if HEAT_METERS
Map(x => x.HeatMetersPath); Map(x => x.HeatMetersPath);
#endif #endif
Map(x => x.RelTransBefore) Map(x => x.TransBefore)
.Column("RelTransBefore"); .Column("RelTransBefore");
Map(x => x.RelTransBetween) Map(x => x.TransBetween)
.Column("RelTransBetween"); .Column("RelTransBetween");
Map(x => x.TransitionAfter) Map(x => x.TransAfter)
.Column("TransitionAfter"); .Column("TransitionAfter");
HasMany(x => x.MoreParams) HasMany(x => x.MoreParams)

View File

@ -3,6 +3,7 @@
/// ///
using System; using System;
using System.Reflection; using System.Reflection;
using Common;
using Config.Entities; using Config.Entities;
namespace Config namespace Config

View File

@ -5,6 +5,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using Common;
namespace Config namespace Config
{ {
@ -147,7 +148,7 @@ namespace Config
/// <param name="medium">NotSpecified, ColdWater or HotWater</param> /// <param name="medium">NotSpecified, ColdWater or HotWater</param>
/// <param name="Qdflt">Default flow when metrologic does not match pattern</param> /// <param name="Qdflt">Default flow when metrologic does not match pattern</param>
/// <returns>Q1 or Qmin flow in m3/h</returns> /// <returns>Q1 or Qmin flow in m3/h</returns>
public static double GetQ1Qmin(double Qn, string metroClass, Entities.Medium medium = Entities.Medium.ColdWater, double Qdflt = 0) public static double GetQ1Qmin(double Qn, string metroClass, Medium medium = Medium.ColdWater, double Qdflt = 0)
{ {
if (string.IsNullOrEmpty(metroClass)) return Qdflt; if (string.IsNullOrEmpty(metroClass)) return Qdflt;
@ -158,7 +159,7 @@ namespace Config
} }
else else
{ {
if (medium == Entities.Medium.HotWater) if (medium == Medium.HotWater)
{ {
switch (metroClass) switch (metroClass)
{ {
@ -192,7 +193,7 @@ namespace Config
/// <param name="medium">NotSpecified, ColdWater or HotWater</param> /// <param name="medium">NotSpecified, ColdWater or HotWater</param>
/// <param name="Qdflt">Default flow when metrologic does not match pattern</param> /// <param name="Qdflt">Default flow when metrologic does not match pattern</param>
/// <returns>Q2 or Qt flow in m3/h</returns> /// <returns>Q2 or Qt flow in m3/h</returns>
public static double GetQ2Qt(double Qn, string metroClass, Entities.Medium medium = Entities.Medium.ColdWater, double Qdflt = 0) public static double GetQ2Qt(double Qn, string metroClass, Medium medium = Medium.ColdWater, double Qdflt = 0)
{ {
if (string.IsNullOrEmpty(metroClass)) return Qdflt; if (string.IsNullOrEmpty(metroClass)) return Qdflt;
@ -202,7 +203,7 @@ namespace Config
return 1.6 * Qn / (double)metroClassRatio; return 1.6 * Qn / (double)metroClassRatio;
} }
if (medium == Entities.Medium.HotWater) if (medium == Medium.HotWater)
{ {
switch (metroClass) switch (metroClass)
{ {
@ -235,7 +236,7 @@ namespace Config
/// <param name="medium">NotSpecified, ColdWater or HotWater</param> /// <param name="medium">NotSpecified, ColdWater or HotWater</param>
/// <param name="Qdflt">Default flow when metrologic does not match pattern</param> /// <param name="Qdflt">Default flow when metrologic does not match pattern</param>
/// <returns>Q4 or Qmax flow in m3/h</returns> /// <returns>Q4 or Qmax flow in m3/h</returns>
public static double GetQ4Qmax(double Qn, string metroClass, Entities.Medium medium = Entities.Medium.ColdWater, double Qdflt = 0) public static double GetQ4Qmax(double Qn, string metroClass, Medium medium = Medium.ColdWater, double Qdflt = 0)
{ {
if (string.IsNullOrEmpty(metroClass)) return Qdflt; if (string.IsNullOrEmpty(metroClass)) return Qdflt;

View File

@ -90,6 +90,10 @@
</Compile> </Compile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Common\Common.csproj">
<Project>{c8939821-ba5c-4988-a3d0-bf53b74865c7}</Project>
<Name>Common</Name>
</ProjectReference>
<ProjectReference Include="..\Config\Config.csproj"> <ProjectReference Include="..\Config\Config.csproj">
<Project>{743DF7DB-C7B6-42EB-986D-0F485E5588E4}</Project> <Project>{743DF7DB-C7B6-42EB-986D-0F485E5588E4}</Project>
<Name>Config</Name> <Name>Config</Name>

View File

@ -2,13 +2,13 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Diagnostics; using System.Diagnostics;
using System.IO; using System.IO;
using System.Text;
using System.Threading; using System.Threading;
using System.Xml.Serialization;
using System.Windows.Forms; using System.Windows.Forms;
using Common;
using TBF.BenchControl; using TBF.BenchControl;
using TBF.BenchControl.Generic; using TBF.BenchControl.Generic;
using TBF.UI.Bench.Components; using TBF.UI.Bench.Components;
using System.Xml.Serialization;
namespace DeviceTest namespace DeviceTest
@ -109,8 +109,8 @@ namespace DeviceTest
config.Name = Program.LocalSettings.ParentName; config.Name = Program.LocalSettings.ParentName;
config.ParentName = string.Empty; config.ParentName = string.Empty;
config.ItemNr = 0; config.ItemNr = 0;
config.DebugLevel = Config.Entities.DebugMode.Normal; config.DebugLevel = DebugMode.Normal;
config.LogLevel = Config.Entities.LogLevel.Debug; config.LogLevel = LogLevel.Debug;
config.Corrections = null; config.Corrections = null;
config.Factory = parentFactory; config.Factory = parentFactory;
parentCfg = config; parentCfg = config;
@ -142,8 +142,8 @@ namespace DeviceTest
config.Name = Program.LocalSettings.ComponentName; config.Name = Program.LocalSettings.ComponentName;
config.ParentName = string.IsNullOrEmpty(Program.LocalSettings.ComponentParentName) ? string.Empty : Program.LocalSettings.ComponentParentName; config.ParentName = string.IsNullOrEmpty(Program.LocalSettings.ComponentParentName) ? string.Empty : Program.LocalSettings.ComponentParentName;
config.ItemNr = 1; config.ItemNr = 1;
config.DebugLevel = Config.Entities.DebugMode.Normal; config.DebugLevel = DebugMode.Normal;
config.LogLevel = Config.Entities.LogLevel.Debug; config.LogLevel = LogLevel.Debug;
config.Corrections = null; config.Corrections = null;
config.Factory = component1Factory; config.Factory = component1Factory;
component1Cfg = config; component1Cfg = config;
@ -177,8 +177,8 @@ namespace DeviceTest
config.Name = Program.LocalSettings.Component2Name; config.Name = Program.LocalSettings.Component2Name;
config.ParentName = string.IsNullOrEmpty(Program.LocalSettings.Component2ParentName) ? string.Empty : Program.LocalSettings.Component2ParentName; config.ParentName = string.IsNullOrEmpty(Program.LocalSettings.Component2ParentName) ? string.Empty : Program.LocalSettings.Component2ParentName;
config.ItemNr = 2; config.ItemNr = 2;
config.DebugLevel = Config.Entities.DebugMode.Normal; config.DebugLevel = DebugMode.Normal;
config.LogLevel = Config.Entities.LogLevel.Debug; config.LogLevel = LogLevel.Debug;
config.Corrections = null; config.Corrections = null;
config.Factory = component2Factory; config.Factory = component2Factory;
component2Cfg = config; component2Cfg = config;
@ -212,8 +212,8 @@ namespace DeviceTest
config.Name = Program.LocalSettings.Component3Name; config.Name = Program.LocalSettings.Component3Name;
config.ParentName = string.IsNullOrEmpty(Program.LocalSettings.Component3ParentName) ? string.Empty : Program.LocalSettings.Component3ParentName; config.ParentName = string.IsNullOrEmpty(Program.LocalSettings.Component3ParentName) ? string.Empty : Program.LocalSettings.Component3ParentName;
config.ItemNr = 3; config.ItemNr = 3;
config.DebugLevel = Config.Entities.DebugMode.Normal; config.DebugLevel = DebugMode.Normal;
config.LogLevel = Config.Entities.LogLevel.Debug; config.LogLevel = LogLevel.Debug;
config.Corrections = null; config.Corrections = null;
config.Factory = component3Factory; config.Factory = component3Factory;
component3Cfg = config; component3Cfg = config;

View File

@ -5,6 +5,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Windows.Forms; using System.Windows.Forms;
using NHibernate; using NHibernate;
using Common;
using Common.UIControls; using Common.UIControls;
using Events; using Events;
using Events.Entities; using Events.Entities;
@ -210,8 +211,8 @@ namespace EventViewer
{ {
lvi.UseItemStyleForSubItems = false; lvi.UseItemStyleForSubItems = false;
lvi.SubItems.Add(evnt.Severity.ToString()); lvi.SubItems.Add(evnt.Severity.ToString());
lvi.SubItems[lvi.SubItems.Count - 1].BackColor = Utils.GetSeverityColor(evnt.Severity); lvi.SubItems[lvi.SubItems.Count - 1].BackColor = global::Events.Utils.GetSeverityColor(evnt.Severity);
lvi.SubItems[lvi.SubItems.Count - 1].ForeColor = Utils.GetSeverityColor(evnt.Severity, true); lvi.SubItems[lvi.SubItems.Count - 1].ForeColor = global::Events.Utils.GetSeverityColor(evnt.Severity, true);
} }
lvi.SubItems.Add(evnt.Message); lvi.SubItems.Add(evnt.Message);
eventsListView.Items.Add(lvi); eventsListView.Items.Add(lvi);
@ -275,7 +276,7 @@ namespace EventViewer
private void settingsButton_Click(object sender, EventArgs e) private void settingsButton_Click(object sender, EventArgs e)
{ {
//Users.Entities.GID[] groupsWithAccess = new Users.Entities.GID[] { Users.Entities.GID.Administrators }; //Common.GID[] groupsWithAccess = new Common.GID[] { Common.GID.Administrators };
Users.Forms.LoginDlg dlg = new Users.Forms.LoginDlg(true); Users.Forms.LoginDlg dlg = new Users.Forms.LoginDlg(true);
if (dlg.ShowDialog() == DialogResult.OK) if (dlg.ShowDialog() == DialogResult.OK)
{ {
@ -290,7 +291,7 @@ namespace EventViewer
{ {
try try
{ {
Users.GlobalData.RemoteUsersDB = new Users.DBSettings(Users.Entities.DBType.MySql, Program.LocalSettings.UsersDBConnString); Users.GlobalData.RemoteUsersDB = new Users.DBSettings(Common.DBType.MySql, Program.LocalSettings.UsersDBConnString);
Users.Forms.LoginDlg dlg = new Users.Forms.LoginDlg(); Users.Forms.LoginDlg dlg = new Users.Forms.LoginDlg();
if (dlg.ShowDialog() == DialogResult.OK) if (dlg.ShowDialog() == DialogResult.OK)
{ {

View File

@ -8,6 +8,7 @@ using FluentNHibernate.Cfg.Db;
using NHibernate; using NHibernate;
using NHibernate.Cfg; using NHibernate.Cfg;
using NHibernate.Tool.hbm2ddl; using NHibernate.Tool.hbm2ddl;
using Common;
using Events.Entities; using Events.Entities;
namespace Events namespace Events
@ -34,9 +35,9 @@ namespace Events
} }
/// <summary> Database type (MySQL or SQLite) for all sessions </summary> /// <summary> Database type (MySQL or SQLite) for all sessions </summary>
private static Entities.DBType dbType; private static DBType dbType;
/// ///
public static Entities.DBType DbType public static DBType DbType
{ {
get { return dbType; } get { return dbType; }
set { dbType = value; SessionFactory = null; } set { dbType = value; SessionFactory = null; }
@ -63,10 +64,10 @@ namespace Events
switch (dbType) switch (dbType)
{ {
default: default:
case Entities.DBType.SQLite: case DBType.SQLite:
cfg = cfg.Database(SQLiteConfiguration.Standard.UsingFile(connectionString)); cfg = cfg.Database(SQLiteConfiguration.Standard.UsingFile(connectionString));
break; break;
case Entities.DBType.MySql: case DBType.MySql:
cfg = cfg.Database(MySQLConfiguration.Standard.ConnectionString(connectionString)); cfg = cfg.Database(MySQLConfiguration.Standard.ConnectionString(connectionString));
break; break;
} }

View File

@ -1,58 +0,0 @@
///
/// Copyright (c) 2020 Sensus Slovensko a.s.
///
namespace Events.Entities
{
/// <summary>
/// Identifies the type of a database
/// </summary>
public enum DBType
{
None, /// Database disabled
MySql, /// MySQL database
SQLite, /// SQLite
Count
}
public enum Severity
{
Undefined,
Notification,
Warning,
Error,
FatalError,
Count
}
public enum EventClass
{
Undefined,
EquipmentHW,
Metrology,
TestingProcess,
BadResults,
ComputerResources,
Network,
Other,
Count
}
public enum SubscriberGroup : long
{
None = 0,
Metrology = 1,
Maintenance = 2,
Production = 4,
Management = 8,
Finish = 16,
}
public enum EViewerOption
{
Undefined,
AllEvents,
RecentEvents,
UnreadEvents,
}
}

View File

@ -3,6 +3,7 @@
/// ///
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using Common;
namespace Events.Entities namespace Events.Entities
{ {

View File

@ -56,7 +56,6 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="DB.cs" /> <Compile Include="DB.cs" />
<Compile Include="Entities\Enums.cs" />
<Compile Include="Entities\Event.cs" /> <Compile Include="Entities\Event.cs" />
<Compile Include="Entities\Subscriber.cs" /> <Compile Include="Entities\Subscriber.cs" />
<Compile Include="Utils.cs" /> <Compile Include="Utils.cs" />
@ -67,6 +66,12 @@
<ItemGroup> <ItemGroup>
<Folder Include="DeliveryServices\" /> <Folder Include="DeliveryServices\" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Common\Common.csproj">
<Project>{c8939821-ba5c-4988-a3d0-bf53b74865c7}</Project>
<Name>Common</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. <!-- 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. Other similar extension points exist, see Microsoft.Common.targets.

View File

@ -3,6 +3,7 @@
/// ///
using System; using System;
using System.Drawing; using System.Drawing;
using Common;
using Events.Entities; using Events.Entities;
namespace Events namespace Events

View File

@ -6,6 +6,7 @@ using System.Collections.Generic;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using Common;
using Results.Entities; using Results.Entities;
namespace Results namespace Results
@ -71,9 +72,9 @@ namespace Results
RealDensity = realDensity, RealDensity = realDensity,
AtTemperature = atTemperature, AtTemperature = atTemperature,
Buoyancy = buoyancy, Buoyancy = buoyancy,
Compound = (procedure.MetersKind == Config.Entities.MetersKind.Combined), Compound = (procedure.MetersKind == MetersKind.Combined),
#if HEAT_METERS #if HEAT_METERS
HeatMeter = (procedure.MetersKind == Config.Entities.MetersKind.HeatMeter), HeatMeter = (procedure.MetersKind == MetersKind.HeatMeter),
#endif #endif
}; };
@ -120,20 +121,20 @@ namespace Results
if (d.Batch.Compound) if (d.Batch.Compound)
{ {
/// Compound water meter /// Compound water meter
wmtrs.Add(new MeterTestRslt(d.Batch.WaterMeters[i], tr, Config.Entities.CompoundMeterId.CompoundMain)); wmtrs.Add(new MeterTestRslt(d.Batch.WaterMeters[i], tr, CompoundMeterId.CompoundMain));
wmtrs.Add(new MeterTestRslt(d.Batch.WaterMeters[i], tr, Config.Entities.CompoundMeterId.CompoundAux)); wmtrs.Add(new MeterTestRslt(d.Batch.WaterMeters[i], tr, CompoundMeterId.CompoundAux));
wmtrs.Add(new MeterTestRslt(d.Batch.WaterMeters[i], tr, Config.Entities.CompoundMeterId.Compound)); wmtrs.Add(new MeterTestRslt(d.Batch.WaterMeters[i], tr, CompoundMeterId.Compound));
} }
else if (d.Batch.HeatMeter) else if (d.Batch.HeatMeter)
{ {
/// Heat meter /// Heat meter
wmtrs.Add(new MeterTestRslt(d.Batch.WaterMeters[i], tr, Config.Entities.CompoundMeterId.HeatMeterVolume)); wmtrs.Add(new MeterTestRslt(d.Batch.WaterMeters[i], tr, CompoundMeterId.HeatMeterVolume));
wmtrs.Add(new MeterTestRslt(d.Batch.WaterMeters[i], tr, Config.Entities.CompoundMeterId.HeatMeterEnergy)); wmtrs.Add(new MeterTestRslt(d.Batch.WaterMeters[i], tr, CompoundMeterId.HeatMeterEnergy));
} }
else else
{ {
/// Water meter /// Water meter
wmtrs.Add(new MeterTestRslt(d.Batch.WaterMeters[i], tr, Config.Entities.CompoundMeterId.Single)); wmtrs.Add(new MeterTestRslt(d.Batch.WaterMeters[i], tr, CompoundMeterId.Single));
} }
} }
} }
@ -172,7 +173,7 @@ namespace Results
return Batch.GetTestRslt(name, part); return Batch.GetTestRslt(name, part);
} }
public MeterTestRslt GetMeterTestRslt(string name, int wmNr0, Config.Entities.CompoundMeterId meterId) public MeterTestRslt GetMeterTestRslt(string name, int wmNr0, CompoundMeterId meterId)
{ {
if (Batch.WaterMeters != null && Batch.WaterMeters.Count > wmNr0 && !Batch.WaterMeters[wmNr0].Disabled) if (Batch.WaterMeters != null && Batch.WaterMeters.Count > wmNr0 && !Batch.WaterMeters[wmNr0].Disabled)
{ {

View File

@ -37,9 +37,9 @@ namespace Results
} }
/// <summary> Database type (MySQL or SQLite) for all sessions </summary> /// <summary> Database type (MySQL or SQLite) for all sessions </summary>
private static Users.Entities.DBType dbType; private static Common.DBType dbType;
/// ///
public static Users.Entities.DBType DbType public static Common.DBType DbType
{ {
get { return dbType; } get { return dbType; }
set { dbType = value; SessionFactory = null; } set { dbType = value; SessionFactory = null; }
@ -66,10 +66,10 @@ namespace Results
switch (dbType) switch (dbType)
{ {
default: default:
case Users.Entities.DBType.MySql: case Common.DBType.MySql:
cfg = cfg.Database(MySQLConfiguration.Standard.ConnectionString(connectionString)); cfg = cfg.Database(MySQLConfiguration.Standard.ConnectionString(connectionString));
break; break;
case Users.Entities.DBType.SQLite: case Common.DBType.SQLite:
cfg = cfg.Database(SQLiteConfiguration.Standard.UsingFile(connectionString)); cfg = cfg.Database(SQLiteConfiguration.Standard.UsingFile(connectionString));
break; break;
} }

View File

@ -4,6 +4,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using Common;
namespace Results.Entities namespace Results.Entities
{ {
@ -257,7 +258,7 @@ namespace Results.Entities
{ {
for (int i = 0; i < TestRslts.Count; i++) for (int i = 0; i < TestRslts.Count; i++)
{ {
if (TestRslts[i].Publish() == Config.Entities.Publish.Always) if (TestRslts[i].Publish() == Publish.Always)
return TestRslts[i].AmbTempStart; return TestRslts[i].AmbTempStart;
} }
return 0; return 0;
@ -266,7 +267,7 @@ namespace Results.Entities
{ {
for (int i = 0; i < TestRslts.Count; i++) for (int i = 0; i < TestRslts.Count; i++)
{ {
if (TestRslts[i].Publish() == Config.Entities.Publish.Always) if (TestRslts[i].Publish() == Publish.Always)
return TestRslts[i].AmbPressStart; return TestRslts[i].AmbPressStart;
} }
return 0; return 0;
@ -275,7 +276,7 @@ namespace Results.Entities
{ {
for (int i = 0; i < TestRslts.Count; i++) for (int i = 0; i < TestRslts.Count; i++)
{ {
if (TestRslts[i].Publish() == Config.Entities.Publish.Always) if (TestRslts[i].Publish() == Publish.Always)
return TestRslts[i].AmbHumiStart; return TestRslts[i].AmbHumiStart;
} }
return 0; return 0;
@ -285,7 +286,7 @@ namespace Results.Entities
{ {
for (int i = TestRslts.Count - 1; i >= 0; i++) for (int i = TestRslts.Count - 1; i >= 0; i++)
{ {
if (TestRslts[i].Publish() == Config.Entities.Publish.Always) if (TestRslts[i].Publish() == Publish.Always)
return TestRslts[i].AmbTempEnd; return TestRslts[i].AmbTempEnd;
} }
return 0; return 0;
@ -294,7 +295,7 @@ namespace Results.Entities
{ {
for (int i = TestRslts.Count - 1; i >= 0; i++) for (int i = TestRslts.Count - 1; i >= 0; i++)
{ {
if (TestRslts[i].Publish() == Config.Entities.Publish.Always) if (TestRslts[i].Publish() == Publish.Always)
return TestRslts[i].AmbPressEnd; return TestRslts[i].AmbPressEnd;
} }
return 0; return 0;
@ -303,7 +304,7 @@ namespace Results.Entities
{ {
for (int i = TestRslts.Count - 1; i >= 0; i++) for (int i = TestRslts.Count - 1; i >= 0; i++)
{ {
if (TestRslts[i].Publish() == Config.Entities.Publish.Always) if (TestRslts[i].Publish() == Publish.Always)
return TestRslts[i].AmbHumiEnd; return TestRslts[i].AmbHumiEnd;
} }
return 0; return 0;

View File

@ -4,6 +4,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using Common;
namespace Results.Entities namespace Results.Entities
{ {
@ -87,23 +88,23 @@ namespace Results.Entities
public virtual double QRise() { return WaterMeter.QRise; } /// [m3/h] public virtual double QRise() { return WaterMeter.QRise; } /// [m3/h]
public virtual double QFall() { return WaterMeter.QFall; } /// [m3/h] public virtual double QFall() { return WaterMeter.QFall; } /// [m3/h]
public virtual bool Evaluate() { return TestData().Evaluate; } public virtual bool Evaluate() { return TestData().Evaluate; }
public virtual Config.Entities.Publish Publish() { return (Config.Entities.Publish)TestData().Publish; } public virtual Common.Publish Publish() { return (Publish)TestData().Publish; }
public virtual WaterMeterData WaterMeterData() { return WaterMeter.WaterMeterData; } public virtual WaterMeterData WaterMeterData() { return WaterMeter.WaterMeterData; }
public virtual Batch Batch() { return WaterMeter.Batch; } public virtual Batch Batch() { return WaterMeter.Batch; }
public virtual bool IsPilotRslt() public virtual bool IsPilotRslt()
{ {
return (CompoundMeterId == (byte)Config.Entities.CompoundMeterId.Single) || return (CompoundMeterId == (byte)Common.CompoundMeterId.Single) ||
(CompoundMeterId == (byte)Config.Entities.CompoundMeterId.Compound) || (CompoundMeterId == (byte)Common.CompoundMeterId.Compound) ||
(CompoundMeterId == (byte)Config.Entities.CompoundMeterId.HeatMeterEnergy); (CompoundMeterId == (byte)Common.CompoundMeterId.HeatMeterEnergy);
} }
public virtual bool IsPulses() { return (RegReaderType == (int)Config.Entities.RegisterReaderType.Pulses || RegReaderType == (int)Config.Entities.RegisterReaderType.Unknown); } public virtual bool IsPulses() { return (RegReaderType == (int)RegisterReaderType.Pulses || RegReaderType == (int)RegisterReaderType.Unknown); }
public virtual bool IsCamera() { return (RegReaderType == (int)Config.Entities.RegisterReaderType.Camera); } public virtual bool IsCamera() { return (RegReaderType == (int)RegisterReaderType.Camera); }
public virtual bool IsDataStream() { return (RegReaderType == (int)Config.Entities.RegisterReaderType.DataStream); } public virtual bool IsDataStream() { return (RegReaderType == (int)RegisterReaderType.DataStream); }
public virtual bool IsManual() { return (RegReaderType == (int)Config.Entities.RegisterReaderType.Manual); } public virtual bool IsManual() { return (RegReaderType == (int)RegisterReaderType.Manual); }
public virtual string PassedColorStr(string yesNoFormatOrEmpty) public virtual string PassedColorStr(string yesNoFormatOrEmpty)
{ {
@ -124,7 +125,7 @@ namespace Results.Entities
Passed = false; Passed = false;
} }
public MeterTestRslt(WaterMeter waterMeterRslt, TestRslt testRslt, Config.Entities.CompoundMeterId compoundMeterId) public MeterTestRslt(WaterMeter waterMeterRslt, TestRslt testRslt, CompoundMeterId compoundMeterId)
: this() : this()
{ {
WaterMeter = waterMeterRslt; WaterMeter = waterMeterRslt;

View File

@ -51,7 +51,7 @@ namespace Results.Entities
Qfrom = (double)test.Qfrom; Qfrom = (double)test.Qfrom;
Qto = (double)test.Qto; Qto = (double)test.Qto;
TargetVolume = (double)test.Volume; TargetVolume = (double)test.Volume;
TargetTime = (double)test.TstTime; TargetTime = (double)test.TestTime;
Method = test.Method; Method = test.Method;
ErrLimLo = (double)test.ErrLimLo; ErrLimLo = (double)test.ErrLimLo;
ErrLimHi = (double)test.ErrLimHi; ErrLimHi = (double)test.ErrLimHi;

View File

@ -5,6 +5,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
using System.IO; using System.IO;
using Common;
namespace Results.Entities namespace Results.Entities
{ {
@ -228,7 +229,7 @@ namespace Results.Entities
public virtual float TempLimLo() { return TestData.TempLimLo; } public virtual float TempLimLo() { return TestData.TempLimLo; }
public virtual float TempLimHi() { return TestData.TempLimHi; } public virtual float TempLimHi() { return TestData.TempLimHi; }
public virtual bool Evaluate() { return TestData.Evaluate; } public virtual bool Evaluate() { return TestData.Evaluate; }
public virtual Config.Entities.Publish Publish() { return (Config.Entities.Publish)TestData.Publish; } public virtual Publish Publish() { return (Publish)TestData.Publish; }
public TestRslt() public TestRslt()

View File

@ -5,7 +5,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Text; using System.Text;
using System.IO; using System.IO;
using Config.Entities; using Common;
using Results.Resources; using Results.Resources;
namespace Results.Entities namespace Results.Entities
@ -329,7 +329,7 @@ namespace Results.Entities
return GetMeterTestRslt(testName, CompoundMeterId.SingleOrCompound); return GetMeterTestRslt(testName, CompoundMeterId.SingleOrCompound);
} }
public virtual MeterTestRslt GetMeterTestRslt(string testName, Config.Entities.CompoundMeterId meterId) public virtual MeterTestRslt GetMeterTestRslt(string testName, CompoundMeterId meterId)
{ {
if (string.IsNullOrEmpty(testName)) return null; if (string.IsNullOrEmpty(testName)) return null;
if (Disabled) return null; if (Disabled) return null;
@ -343,18 +343,15 @@ namespace Results.Entities
{ {
return mtr; return mtr;
} }
else if (meterId == Config.Entities.CompoundMeterId.SingleOrCompound && else if (meterId == CompoundMeterId.SingleOrCompound && mtr.CompoundMeterId == (byte)CompoundMeterId.Single)
mtr.CompoundMeterId == (byte)Config.Entities.CompoundMeterId.Single)
{ {
return mtr; return mtr;
} }
else if (meterId == Config.Entities.CompoundMeterId.SingleOrCompound && else if (meterId == CompoundMeterId.SingleOrCompound && mtr.CompoundMeterId == (byte)CompoundMeterId.Compound)
mtr.CompoundMeterId == (byte)Config.Entities.CompoundMeterId.Compound)
{ {
return mtr; return mtr;
} }
else if (meterId == Config.Entities.CompoundMeterId.SingleOrCompound && else if (meterId == CompoundMeterId.SingleOrCompound && mtr.CompoundMeterId == (byte)CompoundMeterId.HeatMeterEnergy)
mtr.CompoundMeterId == (byte)Config.Entities.CompoundMeterId.HeatMeterEnergy)
{ {
return mtr; return mtr;
} }
@ -518,7 +515,7 @@ namespace Results.Entities
foreach (var mtr in MeterTestRslts) foreach (var mtr in MeterTestRslts)
{ {
MeterTestRslt srcMtr = src.GetMeterTestRslt(mtr.Name(), (Config.Entities.CompoundMeterId)mtr.CompoundMeterId); MeterTestRslt srcMtr = src.GetMeterTestRslt(mtr.Name(), (CompoundMeterId)mtr.CompoundMeterId);
if (srcMtr != null) if (srcMtr != null)
{ {
mtr.CopyContentFrom(srcMtr); mtr.CopyContentFrom(srcMtr);
@ -557,8 +554,8 @@ namespace Results.Entities
{ {
if ((mtr.CompoundMeterId == (byte)CompoundMeterId.Single || mtr.CompoundMeterId == (byte)CompoundMeterId.Compound || mtr.CompoundMeterId == (byte)CompoundMeterId.HeatMeterEnergy) if ((mtr.CompoundMeterId == (byte)CompoundMeterId.Single || mtr.CompoundMeterId == (byte)CompoundMeterId.Compound || mtr.CompoundMeterId == (byte)CompoundMeterId.HeatMeterEnergy)
&& mtr.TestDone && mtr.TestDone
&& (mtr.Publish() != Config.Entities.Publish.Never) && (mtr.Publish() != Publish.Never)
&& (mtr.Publish() != Config.Entities.Publish.Internal)) && (mtr.Publish() != Publish.Internal))
{ {
testNames.Add(mtr.Name()); testNames.Add(mtr.Name());
} }

View File

@ -5,7 +5,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.IO; using System.IO;
using Config.Entities; using Common;
namespace Results.Entities namespace Results.Entities
{ {
@ -204,17 +204,17 @@ namespace Results.Entities
Producer = reader.ReadString(); Producer = reader.ReadString();
DN = reader.ReadDouble(); DN = reader.ReadDouble();
L = reader.ReadDouble(); L = reader.ReadDouble();
Mounting = (Config.Entities.Mounting)reader.ReadInt32(); Mounting = (Mounting)reader.ReadInt32();
NewQnames = reader.ReadBoolean(); NewQnames = reader.ReadBoolean();
Q4_Qmax = reader.ReadDouble(); Q4_Qmax = reader.ReadDouble();
Q3_Qn = reader.ReadDouble(); Q3_Qn = reader.ReadDouble();
Q2_Qt = reader.ReadDouble(); Q2_Qt = reader.ReadDouble();
Q1_Qmin = reader.ReadDouble(); Q1_Qmin = reader.ReadDouble();
MetrologicalClass = reader.ReadString(); MetrologicalClass = reader.ReadString();
TemperatureClass = (Config.Entities.TemperatureClass)reader.ReadInt32(); TemperatureClass = (TemperatureClass)reader.ReadInt32();
PressureLossClass = (Config.Entities.PressureLossClass)reader.ReadInt32(); PressureLossClass = (PressureLossClass)reader.ReadInt32();
MaxAdmissiblePressure = (Config.Entities.MaxAdmissiblePressure)reader.ReadInt32(); MaxAdmissiblePressure = (MaxAdmissiblePressure)reader.ReadInt32();
FlowProfileSensitivityClass = (Config.Entities.FlowProfileSensitivityClass)reader.ReadInt32(); FlowProfileSensitivityClass = (FlowProfileSensitivityClass)reader.ReadInt32();
ApprovalInfo = reader.ReadString(); ApprovalInfo = reader.ReadString();
Certificate = reader.ReadString(); Certificate = reader.ReadString();
PulsesPerLtr = reader.ReadDouble(); PulsesPerLtr = reader.ReadDouble();
@ -222,7 +222,7 @@ namespace Results.Entities
Q3_Qn_Aux = reader.ReadDouble(); Q3_Qn_Aux = reader.ReadDouble();
MetrologicalClassAux = reader.ReadString(); MetrologicalClassAux = reader.ReadString();
ApprovalInfoAux = reader.ReadString(); ApprovalInfoAux = reader.ReadString();
Medium = (Config.Entities.Medium)reader.ReadInt32(); Medium = (Medium)reader.ReadInt32();
Text1 = reader.ReadString(); Text1 = reader.ReadString();
Text2 = reader.ReadString(); Text2 = reader.ReadString();
Text3 = reader.ReadString(); Text3 = reader.ReadString();

View File

@ -2,7 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Windows.Forms; using System.Windows.Forms;
using log4net; using log4net;
using Config.Entities; using Common;
using Results.Resources; using Results.Resources;
using NHibernate; using NHibernate;
using TracingDB.Entities; using TracingDB.Entities;

View File

@ -2,6 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Windows.Forms; using System.Windows.Forms;
using Common;
using Config.Entities; using Config.Entities;
using Results.Resources; using Results.Resources;
@ -78,7 +79,7 @@ namespace Results.Forms
unitsCB = new ComboBox(); unitsCB = new ComboBox();
ComboBox alignmentCB = new ComboBox(); ComboBox alignmentCB = new ComboBox();
for (Config.Entities.Alignment a = 0; a < Config.Entities.Alignment.Count; a++) for (Alignment a = 0; a < Alignment.Count; a++)
{ {
alignmentCB.Items.Add(a.ToDescription()); alignmentCB.Items.Add(a.ToDescription());
} }

View File

@ -76,8 +76,8 @@ namespace Results.Forms
// foreach (var mtr in wMtr.MeterTestRslts) // foreach (var mtr in wMtr.MeterTestRslts)
// { // {
// if (mtr != null && mtr.IsPilotRslt() && mtr.TestDone && mtr.Publish() != Config.Entities.Publish.Never && // if (mtr != null && mtr.IsPilotRslt() && mtr.TestDone && mtr.Publish() != Publish.Never &&
// mtr.Publish() != Config.Entities.Publish.Internal) // mtr.Publish() != Publish.Internal)
// { // {
// string str = item.Print(wMtr, mtr.Name()); // string str = item.Print(wMtr, mtr.Name());

View File

@ -5,6 +5,7 @@ using System;
using System.Drawing; using System.Drawing;
using System.Windows.Forms; using System.Windows.Forms;
using System.Collections.Generic; using System.Collections.Generic;
using Common;
namespace Results.Forms namespace Results.Forms
{ {
@ -107,8 +108,8 @@ namespace Results.Forms
foreach (var mtr in wMtr.MeterTestRslts) foreach (var mtr in wMtr.MeterTestRslts)
{ {
if (mtr != null && mtr.IsPilotRslt() && mtr.TestDone && mtr.Publish() != Config.Entities.Publish.Never && if (mtr != null && mtr.IsPilotRslt() && mtr.TestDone && mtr.Publish() != Publish.Never &&
mtr.Publish() != Config.Entities.Publish.Internal) mtr.Publish() != Publish.Internal)
{ {
string str = item.Print(wMtr, mtr.Name()); string str = item.Print(wMtr, mtr.Name());

View File

@ -5,6 +5,7 @@ using System;
using System.Drawing; using System.Drawing;
using System.Windows.Forms; using System.Windows.Forms;
using System.Collections.Generic; using System.Collections.Generic;
using Common;
namespace Results.Forms namespace Results.Forms
{ {
@ -109,8 +110,8 @@ namespace Results.Forms
lView.Items.Clear(); lView.Items.Clear();
foreach (var mtr in wMtr.MeterTestRslts) foreach (var mtr in wMtr.MeterTestRslts)
{ {
if (mtr != null && mtr.IsPilotRslt() && mtr.TestDone && mtr.Publish() != Config.Entities.Publish.Never if (mtr != null && mtr.IsPilotRslt() && mtr.TestDone && mtr.Publish() != Publish.Never
&& mtr.Publish() != Config.Entities.Publish.Internal) && mtr.Publish() != Publish.Internal)
{ {
ListViewItem lvi = new ListViewItem(testNames[ix++]); ListViewItem lvi = new ListViewItem(testNames[ix++]);

View File

@ -2,7 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Windows.Forms; using System.Windows.Forms;
using Config.Entities; using Common;
using Results.Resources; using Results.Resources;
namespace Results.Forms namespace Results.Forms
@ -99,7 +99,7 @@ namespace Results.Forms
unitsCB = new ComboBox(); unitsCB = new ComboBox();
ComboBox alignmentCB = new ComboBox(); ComboBox alignmentCB = new ComboBox();
for (Config.Entities.Alignment a = 0; a < Config.Entities.Alignment.Count; a++) for (Alignment a = 0; a < Alignment.Count; a++)
{ {
alignmentCB.Items.Add(a.ToDescription()); alignmentCB.Items.Add(a.ToDescription());
} }
@ -187,7 +187,7 @@ namespace Results.Forms
} }
case Column.Alignment: case Column.Alignment:
for (Config.Entities.Alignment a = 0; a < Config.Entities.Alignment.Count; a++) for (Alignment a = 0; a < Alignment.Count; a++)
{ {
if (a.ToDescription().Equals(editors[e.SubItem].Text)) if (a.ToDescription().Equals(editors[e.SubItem].Text))
{ {

View File

@ -6,7 +6,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Windows.Forms; using System.Windows.Forms;
using log4net; using log4net;
using Config.Entities; using Common;
using Results; using Results;
using Results.Resources; using Results.Resources;

View File

@ -3,8 +3,8 @@
/// ///
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using Common;
using Config; using Config;
using Config.Entities;
using Results.Entities; using Results.Entities;
using Results.Resources; using Results.Resources;
using System.Globalization; using System.Globalization;

View File

@ -7,7 +7,7 @@ using System.Drawing;
using System.Drawing.Drawing2D; using System.Drawing.Drawing2D;
using System.Drawing.Printing; using System.Drawing.Printing;
using System.IO; using System.IO;
using Config.Entities; using Common;
using GenCode128; using GenCode128;
using Gma.QrCodeNet.Encoding; using Gma.QrCodeNet.Encoding;
using Results.Resources; using Results.Resources;

View File

@ -1,12 +1,13 @@
/// ///
/// Copyright (c) 2017-2020 Sensus Slovensko a.s. /// Copyright (c) 2017-2020 Sensus Slovensko a.s.
/// ///
using Common;
namespace Results.Output.Printers.Enhanced namespace Results.Output.Printers.Enhanced
{ {
public class EnhancedPrinterCfg public class EnhancedPrinterCfg
{ {
public Config.Entities.PageOrientation PageOrientation; public PageOrientation PageOrientation;
public string Template; public string Template;
public int TopMargin; public int TopMargin;
public int BottomMargin; public int BottomMargin;

View File

@ -8,7 +8,7 @@ using System.Drawing.Drawing2D;
using System.Drawing.Printing; using System.Drawing.Printing;
using System.IO; using System.IO;
using Gma.QrCodeNet.Encoding; using Gma.QrCodeNet.Encoding;
using Config.Entities; using Common;
using Results.Resources; using Results.Resources;
using GenCode128; using GenCode128;

View File

@ -1,13 +1,14 @@
/// ///
/// Copyright (c) 2018-2020 Sensus Slovensko a.s. /// Copyright (c) 2018-2020 Sensus Slovensko a.s.
/// ///
using Common;
namespace Results.Output.Printers.Label namespace Results.Output.Printers.Label
{ {
public class LabelPrinterCfg public class LabelPrinterCfg
{ {
public string Template; /// Full path to a 'png' file public string Template; /// Full path to a 'png' file
public Config.Entities.PageOrientation PageOrientation; public PageOrientation PageOrientation;
public int PaperWidth; /// In 0,254 mm = 1/100 in = 100dpi pixels count public int PaperWidth; /// In 0,254 mm = 1/100 in = 100dpi pixels count
public int PaperHeight; /// In 0,254 mm = 1/100 in = 100dpi pixels count public int PaperHeight; /// In 0,254 mm = 1/100 in = 100dpi pixels count
public string[] ItemsToPrint; public string[] ItemsToPrint;

View File

@ -8,7 +8,7 @@ using System.Drawing.Drawing2D;
using System.Drawing.Printing; using System.Drawing.Printing;
using System.IO; using System.IO;
using Gma.QrCodeNet.Encoding; using Gma.QrCodeNet.Encoding;
using Config.Entities; using Common;
using Results.Resources; using Results.Resources;
using GenCode128; using GenCode128;

View File

@ -1,12 +1,13 @@
/// ///
/// Copyright (c) 2020 Sensus Slovensko a.s. /// Copyright (c) 2020 Sensus Slovensko a.s.
/// ///
using Common;
namespace Results.Output.Printers.MultiLabel namespace Results.Output.Printers.MultiLabel
{ {
public class MultiLabelPrinterCfg public class MultiLabelPrinterCfg
{ {
public Config.Entities.PageOrientation PageOrientation; public PageOrientation PageOrientation;
public int LabelColumnsCount; public int LabelColumnsCount;
public int LeftTopLabelLeft; public int LeftTopLabelLeft;
public int LeftTopLabelTop; public int LeftTopLabelTop;

View File

@ -5,7 +5,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.Drawing.Printing; using System.Drawing.Printing;
using Config.Entities; using Common;
using System.IO; using System.IO;
using Results.Resources; using Results.Resources;
@ -120,7 +120,7 @@ namespace Results.Output.Printers.Munich
resultsCount = 0; resultsCount = 0;
foreach (var mtr in wm.RegularMeterTestRslts()) foreach (var mtr in wm.RegularMeterTestRslts())
{ {
if (mtr != null && mtr.IsPilotRslt() && mtr.Publish() == Config.Entities.Publish.Always) resultsCount++; if (mtr != null && mtr.IsPilotRslt() && mtr.Publish() == Publish.Always) resultsCount++;
} }
pageNr = 1; pageNr = 1;
@ -381,7 +381,7 @@ namespace Results.Output.Printers.Munich
int rowCount = 0; int rowCount = 0;
foreach (var mtr in wm.RegularMeterTestRslts()) foreach (var mtr in wm.RegularMeterTestRslts())
{ {
if (mtr != null && mtr.IsPilotRslt() && mtr.Publish() == Config.Entities.Publish.Always) if (mtr != null && mtr.IsPilotRslt() && mtr.Publish() == Publish.Always)
{ {
if (from <= rowCount && rowCount <= to) if (from <= rowCount && rowCount <= to)
{ {
@ -449,7 +449,7 @@ namespace Results.Output.Printers.Munich
int rowCount = 0; int rowCount = 0;
foreach (var mtr in wm.RegularMeterTestRslts()) foreach (var mtr in wm.RegularMeterTestRslts())
{ {
if (mtr != null && mtr.IsPilotRslt() && mtr.Publish() == Config.Entities.Publish.Always) if (mtr != null && mtr.IsPilotRslt() && mtr.Publish() == Publish.Always)
{ {
if (from <= rowCount && rowCount <= to) if (from <= rowCount && rowCount <= to)
{ {

View File

@ -6,7 +6,7 @@ using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.Drawing.Printing; using System.Drawing.Printing;
using System.IO; using System.IO;
using Config.Entities; using Common;
using Results.Resources; using Results.Resources;
namespace Results.Output.Printers.OnePerBatch namespace Results.Output.Printers.OnePerBatch

View File

@ -1,13 +1,14 @@
/// ///
/// Copyright (c) 2020 Sensus Slovensko a.s. /// Copyright (c) 2020 Sensus Slovensko a.s.
/// ///
using Common;
namespace Results.Output.Printers.OnePerBatch namespace Results.Output.Printers.OnePerBatch
{ {
public class OnePerBatchPrinterCfg public class OnePerBatchPrinterCfg
{ {
public string AutoTestParam; public string AutoTestParam;
public Config.Entities.PageOrientation PageOrientation; public PageOrientation PageOrientation;
public string Template; public string Template;
public int TopMargin; public int TopMargin;
public int BottomMargin; public int BottomMargin;
@ -34,9 +35,9 @@ namespace Results.Output.Printers.OnePerBatch
public string[] CommonItems1; public string[] CommonItems1;
public string[] CommonItems2; public string[] CommonItems2;
public string[] CommonItems3; public string[] CommonItems3;
public Config.Entities.TableForm Form; public TableForm Form;
public string[] TestItems; public string[] TestItems;
public Config.Entities.TableForm Form2; public TableForm Form2;
public string[] TestItems2; public string[] TestItems2;
public int BelowW0Pct; public int BelowW0Pct;
public int BelowW1Pct; public int BelowW1Pct;

View File

@ -7,7 +7,7 @@ using System.Drawing;
using System.Drawing.Drawing2D; using System.Drawing.Drawing2D;
using System.Drawing.Printing; using System.Drawing.Printing;
using System.IO; using System.IO;
using Config.Entities; using Common;
using GenCode128; using GenCode128;
using Gma.QrCodeNet.Encoding; using Gma.QrCodeNet.Encoding;
using Results.Resources; using Results.Resources;

View File

@ -1,12 +1,13 @@
/// ///
/// Copyright (c) 2017-2020 Sensus Slovensko a.s. /// Copyright (c) 2017-2020 Sensus Slovensko a.s.
/// ///
using Common;
namespace Results.Output.Printers.OnePerMeter namespace Results.Output.Printers.OnePerMeter
{ {
public class OnePerMeterPrinterCfg public class OnePerMeterPrinterCfg
{ {
public Config.Entities.PageOrientation PageOrientation; public PageOrientation PageOrientation;
public string Template; public string Template;
public int TopMargin; public int TopMargin;
public int BottomMargin; public int BottomMargin;
@ -33,9 +34,9 @@ namespace Results.Output.Printers.OnePerMeter
public string[] CommonItems1; public string[] CommonItems1;
public string[] CommonItems2; public string[] CommonItems2;
public string[] CommonItems3; public string[] CommonItems3;
public Config.Entities.TableForm Form; public TableForm Form;
public string[] TestItems; public string[] TestItems;
public Config.Entities.TableForm Form2; public TableForm Form2;
public string[] TestItems2; public string[] TestItems2;
public int BelowW0Pct; public int BelowW0Pct;
public int BelowW1Pct; public int BelowW1Pct;

View File

@ -2,7 +2,7 @@
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.Drawing.Printing; using System.Drawing.Printing;
using Config.Entities; using Common;
namespace Results.Output.Printers namespace Results.Output.Printers
{ {

View File

@ -6,7 +6,7 @@ using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.Drawing.Printing; using System.Drawing.Printing;
using System.IO; using System.IO;
using Config.Entities; using Common;
using Results; using Results;
using Results.Resources; using Results.Resources;

View File

@ -1,12 +1,13 @@
/// ///
/// Copyright (c) 2017 Sensus Slovensko a.s. /// Copyright (c) 2017 Sensus Slovensko a.s.
/// ///
using Common;
namespace Results.Output.Printers.Zapiska namespace Results.Output.Printers.Zapiska
{ {
public class ZapiskaPrinterCfg public class ZapiskaPrinterCfg
{ {
public Config.Entities.PageOrientation PageOrientation; public PageOrientation PageOrientation;
public string Template; public string Template;
public int TopMargin; public int TopMargin;
public int BottomMargin; public int BottomMargin;

View File

@ -556,7 +556,7 @@ namespace Results.Output
QBezeichnungLog = fullTestNameWoPart, /// Flow name in Oracle database QBezeichnungLog = fullTestNameWoPart, /// Flow name in Oracle database
Range = range, Range = range,
Flow = (range == Range.R100_110) ? test.Qfrom : (range == Range.R90_100) ? test.Qto : (test.Qfrom + test.Qto) / 2, Flow = (range == Range.R100_110) ? test.Qfrom : (range == Range.R90_100) ? test.Qto : (test.Qfrom + test.Qto) / 2,
TestTime = (int)Math.Round(test.TstTime), TestTime = (int)Math.Round(test.TestTime),
ErrLimLoFromDB = test.ErrLimLo, ErrLimLoFromDB = test.ErrLimLo,
ErrLimHiFromDB = test.ErrLimHi, ErrLimHiFromDB = test.ErrLimHi,
Uncertainty = test.Uncertainty, Uncertainty = test.Uncertainty,

View File

@ -5,7 +5,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.Drawing.Printing; using System.Drawing.Printing;
using Config.Entities; using Common;
namespace Results.Output namespace Results.Output
{ {
@ -283,7 +283,7 @@ namespace Results.Output
WMeterRsltItemSpec.TableRowNr = 1; WMeterRsltItemSpec.TableRowNr = 1;
foreach (var mtr in string.IsNullOrEmpty(autoTestParam) ? wm.RegularMeterTestRslts() : wm.AutoMeterTestRslts(autoTestParam)) foreach (var mtr in string.IsNullOrEmpty(autoTestParam) ? wm.RegularMeterTestRslts() : wm.AutoMeterTestRslts(autoTestParam))
{ {
if (mtr != null && mtr.IsPilotRslt() && mtr.Publish() == Config.Entities.Publish.Always) if (mtr != null && mtr.IsPilotRslt() && mtr.Publish() == Publish.Always)
{ {
string[] oneTableRow = new string[table.ColumnsCount]; string[] oneTableRow = new string[table.ColumnsCount];
horizAlignment = new Alignment[table.ColumnsCount]; horizAlignment = new Alignment[table.ColumnsCount];
@ -317,7 +317,7 @@ namespace Results.Output
int columnsCount = 1; /// Left column contains item caption int columnsCount = 1; /// Left column contains item caption
foreach (var mtr in string.IsNullOrEmpty(autoTestParam) ? wm.RegularMeterTestRslts() : wm.AutoMeterTestRslts(autoTestParam)) foreach (var mtr in string.IsNullOrEmpty(autoTestParam) ? wm.RegularMeterTestRslts() : wm.AutoMeterTestRslts(autoTestParam))
{ {
if (mtr != null && mtr.IsPilotRslt() && mtr.Publish() == Config.Entities.Publish.Always) if (mtr != null && mtr.IsPilotRslt() && mtr.Publish() == Publish.Always)
{ {
columnsCount++; /// One additional column for each test to be published columnsCount++; /// One additional column for each test to be published
} }
@ -343,7 +343,7 @@ namespace Results.Output
WMeterRsltItemSpec.TableColumnNr = 1; WMeterRsltItemSpec.TableColumnNr = 1;
foreach (var mtr in string.IsNullOrEmpty(autoTestParam) ? wm.RegularMeterTestRslts() : wm.AutoMeterTestRslts(autoTestParam)) foreach (var mtr in string.IsNullOrEmpty(autoTestParam) ? wm.RegularMeterTestRslts() : wm.AutoMeterTestRslts(autoTestParam))
{ {
if (mtr != null && mtr.IsPilotRslt() && mtr.Publish() == Config.Entities.Publish.Always) if (mtr != null && mtr.IsPilotRslt() && mtr.Publish() == Publish.Always)
{ {
/// Strip color information /// Strip color information
oneTableRow[WMeterRsltItemSpec.TableColumnNr] = oneTableRow[WMeterRsltItemSpec.TableColumnNr] =
@ -374,7 +374,7 @@ namespace Results.Output
int columnsCount = 2; /// Left two columns contain item caption and units int columnsCount = 2; /// Left two columns contain item caption and units
foreach (var mtr in string.IsNullOrEmpty(autoTestParam) ? wm.RegularMeterTestRslts() : wm.AutoMeterTestRslts(autoTestParam)) foreach (var mtr in string.IsNullOrEmpty(autoTestParam) ? wm.RegularMeterTestRslts() : wm.AutoMeterTestRslts(autoTestParam))
{ {
if (mtr != null && mtr.IsPilotRslt() && mtr.Publish() == Config.Entities.Publish.Always) if (mtr != null && mtr.IsPilotRslt() && mtr.Publish() == Publish.Always)
{ {
columnsCount++; /// One additional column for each test to be published columnsCount++; /// One additional column for each test to be published
} }
@ -410,7 +410,7 @@ namespace Results.Output
WMeterRsltItemSpec.TableColumnNr = 1; WMeterRsltItemSpec.TableColumnNr = 1;
foreach (var mtr in string.IsNullOrEmpty(autoTestParam) ? wm.RegularMeterTestRslts() : wm.AutoMeterTestRslts(autoTestParam)) foreach (var mtr in string.IsNullOrEmpty(autoTestParam) ? wm.RegularMeterTestRslts() : wm.AutoMeterTestRslts(autoTestParam))
{ {
if (mtr != null && mtr.IsPilotRslt() && mtr.Publish() == Config.Entities.Publish.Always) if (mtr != null && mtr.IsPilotRslt() && mtr.Publish() == Publish.Always)
{ {
int colIx = WMeterRsltItemSpec.TableColumnNr + 1; int colIx = WMeterRsltItemSpec.TableColumnNr + 1;

View File

@ -3,7 +3,7 @@ using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.Linq; using System.Linq;
using System.Windows.Forms.DataVisualization.Charting; using System.Windows.Forms.DataVisualization.Charting;
using Config.Entities; using Common;
using Results.Entities; using Results.Entities;
using Results.Resources; using Results.Resources;

View File

@ -4,7 +4,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using Config; using Config;
using Config.Entities; using Common;
using Results.Entities; using Results.Entities;
using Results.Resources; using Results.Resources;
using System.Globalization; using System.Globalization;
@ -28,7 +28,7 @@ namespace Results
public string Format; /// Specifies format for the output public string Format; /// Specifies format for the output
public string Precision; /// Specifies precision for the output public string Precision; /// Specifies precision for the output
public int Width; /// Specifies the number of characters of the output, 0 = automatic public int Width; /// Specifies the number of characters of the output, 0 = automatic
public Config.Entities.Alignment Alignment; /// Specifies alignment for the output public Alignment Alignment; /// Specifies alignment for the output
public WMeterRsltItemSpec Clone() public WMeterRsltItemSpec Clone()
{ {
@ -67,11 +67,11 @@ namespace Results
{ {
return str; return str;
} }
else if (Alignment == Config.Entities.Alignment.Left) else if (Alignment == Alignment.Left)
{ {
return str + new string(' ', Width - len); return str + new string(' ', Width - len);
} }
else if (Alignment == Config.Entities.Alignment.Right) else if (Alignment == Alignment.Right)
{ {
return new string(' ', Width - len) + str; return new string(' ', Width - len) + str;
} }
@ -423,10 +423,10 @@ namespace Results
AllItems.Add(new WMeterRsltItemSpec(ItemID.Meter_type, Strings.Meter_type, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, w.WaterMeterData.Compound ? Strings.Compound : (w.WaterMeterData.HeatMeter ? Strings.Heat_meter : Strings.Single)))); AllItems.Add(new WMeterRsltItemSpec(ItemID.Meter_type, Strings.Meter_type, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, w.WaterMeterData.Compound ? Strings.Compound : (w.WaterMeterData.HeatMeter ? Strings.Heat_meter : Strings.Single))));
#if HEAT_METERS #if HEAT_METERS
AllItems.Add(new WMeterRsltItemSpec(ItemID.Energy, Strings.Energy + " ()", Quantity.Energy, ItemCategory.Other, (w, t, u, f, p) => (w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy) != null) ? FormatDbl(u, f, p, "F1", w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy).VolumeMeter) : string.Empty)); AllItems.Add(new WMeterRsltItemSpec(ItemID.Energy, Strings.Energy + " ()", Quantity.Energy, ItemCategory.Other, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterEnergy) != null) ? FormatDbl(u, f, p, "F1", w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterEnergy).VolumeMeter) : string.Empty));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Energy_start, Strings.Energy + " start ()", Quantity.Energy, ItemCategory.Other, (w, t, u, f, p) => (w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy) != null) ? FormatDbl(u, f, p, "F1", w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy).VolumeStart) : string.Empty)); AllItems.Add(new WMeterRsltItemSpec(ItemID.Energy_start, Strings.Energy + " start ()", Quantity.Energy, ItemCategory.Other, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterEnergy) != null) ? FormatDbl(u, f, p, "F1", w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterEnergy).VolumeStart) : string.Empty));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Energy_end, Strings.Energy + " end ()", Quantity.Energy, ItemCategory.Other, (w, t, u, f, p) => (w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy) != null) ? FormatDbl(u, f, p, "F1", w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy).VolumeEnd) : string.Empty)); AllItems.Add(new WMeterRsltItemSpec(ItemID.Energy_end, Strings.Energy + " end ()", Quantity.Energy, ItemCategory.Other, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterEnergy) != null) ? FormatDbl(u, f, p, "F1", w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterEnergy).VolumeEnd) : string.Empty));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_energy, Strings.Energy_ref + " ()", Quantity.Energy, ItemCategory.Other, (w, t, u, f, p) => (w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy) != null) ? FormatDbl(u, f, p, "F1", w.GetMeterTestRslt(t, Config.Entities.CompoundMeterId.HeatMeterEnergy).VolumeRef) : string.Empty)); AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_energy, Strings.Energy_ref + " ()", Quantity.Energy, ItemCategory.Other, (w, t, u, f, p) => (w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterEnergy) != null) ? FormatDbl(u, f, p, "F1", w.GetMeterTestRslt(t, CompoundMeterId.HeatMeterEnergy).VolumeRef) : string.Empty));
#endif #endif
#if IPERL #if IPERL
@ -826,7 +826,7 @@ namespace Results
item.Precision = field[5]; item.Precision = field[5];
item.Width = int.Parse(field[6]); item.Width = int.Parse(field[6]);
item.Alignment = 0; item.Alignment = 0;
for (Config.Entities.Alignment a = 0; a < Config.Entities.Alignment.Count; a++) for (Alignment a = 0; a < Alignment.Count; a++)
{ {
if (a.ToString().Equals(field[7])) { item.Alignment = a; break; } if (a.ToString().Equals(field[7])) { item.Alignment = a; break; }
} }

View File

@ -3,11 +3,12 @@
/// ///
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO;
using System.Windows.Forms; using System.Windows.Forms;
using Common;
using Results.Entities; using Results.Entities;
using ResultsBrowser.Resources; using ResultsBrowser.Resources;
using ResultsBrowser.Output.Printers.Statistics; using ResultsBrowser.Output.Printers.Statistics;
using System.IO;
namespace ResultsBrowser.Forms namespace ResultsBrowser.Forms
{ {
@ -168,10 +169,10 @@ namespace ResultsBrowser.Forms
switch (MessageBox.Show(Strings.Yes_Portrait_No_Landscape, Strings.Page_orientation, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question)) switch (MessageBox.Show(Strings.Yes_Portrait_No_Landscape, Strings.Page_orientation, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question))
{ {
case DialogResult.Yes: case DialogResult.Yes:
new StatisticsPrintDocument(title, table, Config.Entities.PageOrientation.Portrait).Print(); new StatisticsPrintDocument(title, table, PageOrientation.Portrait).Print();
break; break;
case DialogResult.No: case DialogResult.No:
new StatisticsPrintDocument(title, table, Config.Entities.PageOrientation.Landscape).Print(); new StatisticsPrintDocument(title, table, PageOrientation.Landscape).Print();
break; break;
default: default:
break; break;

View File

@ -1,11 +1,11 @@
/// ///
/// Copyright (c) 2016 Sensus Metering Systems /// Copyright (c) 2016 Sensus Slovensko a.s.
/// ///
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Drawing; using System.Drawing;
using System.Drawing.Printing; using System.Drawing.Printing;
using Config.Entities; using Common;
namespace ResultsBrowser.Output.Printers.Statistics namespace ResultsBrowser.Output.Printers.Statistics
{ {

View File

@ -304,6 +304,10 @@
</Compile> </Compile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Common\Common.csproj">
<Project>{c8939821-ba5c-4988-a3d0-bf53b74865c7}</Project>
<Name>Common</Name>
</ProjectReference>
<ProjectReference Include="..\Config\Config.csproj"> <ProjectReference Include="..\Config\Config.csproj">
<Project>{743DF7DB-C7B6-42EB-986D-0F485E5588E4}</Project> <Project>{743DF7DB-C7B6-42EB-986D-0F485E5588E4}</Project>
<Name>Config</Name> <Name>Config</Name>

View File

@ -6,14 +6,15 @@ using System.Collections.Generic;
using System.IO; using System.IO;
using System.Windows.Forms; using System.Windows.Forms;
using NHibernate; using NHibernate;
using Oracle;
using Oracle.DataAccess.Client;
using Common;
using Results.Entities; using Results.Entities;
using TBF.BenchControl; using TBF.BenchControl;
using TBF.BenchControl.Generic; using TBF.BenchControl.Generic;
using TBF.BenchControl.GenericDevices; using TBF.BenchControl.GenericDevices;
using ResultsBrowser.Filters; using ResultsBrowser.Filters;
using ResultsBrowser.Resources; using ResultsBrowser.Resources;
using Oracle;
using Oracle.DataAccess.Client;
namespace ResultsBrowser namespace ResultsBrowser
{ {
@ -197,7 +198,7 @@ namespace ResultsBrowser
private void formatOfResultsBtn_Click(object sender, EventArgs e) private void formatOfResultsBtn_Click(object sender, EventArgs e)
{ {
Results.Forms.ResultsConfigDlg dlg = new Results.Forms.ResultsConfigDlg(); Results.Forms.ResultsConfigDlg dlg = new Results.Forms.ResultsConfigDlg();
dlg.MetersKind = Config.Entities.MetersKind.Single; dlg.MetersKind = MetersKind.Single;
dlg.SelectedItems = Results.WMeterRsltItemSpec.FromStrArray(filtersConfig.ResultItems); dlg.SelectedItems = Results.WMeterRsltItemSpec.FromStrArray(filtersConfig.ResultItems);
if (dlg.ShowDialog() == DialogResult.OK) if (dlg.ShowDialog() == DialogResult.OK)
@ -432,7 +433,7 @@ namespace ResultsBrowser
#if MUNICH #if MUNICH
foreach (var wm in waterMeters) foreach (var wm in waterMeters)
{ {
new Results.Output.Printers.Munich.MunichPrintDocument(string.Format("4/13 - {0}", BenchName()), wm, Config.Entities.PageOrientation.Portrait).Print(); new Results.Output.Printers.Munich.MunichPrintDocument(string.Format("4/13 - {0}", BenchName()), wm, PageOrientation.Portrait).Print();
} }
#elif CEVAK_40 #elif CEVAK_40
IList<Results.Entities.Batch> batches = new List<Results.Entities.Batch>(); IList<Results.Entities.Batch> batches = new List<Results.Entities.Batch>();
@ -444,7 +445,7 @@ namespace ResultsBrowser
//foreach (var batch in batches) //foreach (var batch in batches)
//{ //{
// new Results.Output.Printers.Cevak.PrintDocumentCevak(batch, // new Results.Output.Printers.Cevak.PrintDocumentCevak(batch,
// Config.Entities.PageOrientation.Portrait, // PageOrientation.Portrait,
// 60, 60, 60, // 60, 60, 60,
// "PT40 Z/E-35-A", // "PT40 Z/E-35-A",
// "0111-OOP-C035-13").Print(); // "0111-OOP-C035-13").Print();
@ -822,7 +823,7 @@ namespace ResultsBrowser
#endif #endif
default: Results.DB.ConnectionString = string.Empty; break; default: Results.DB.ConnectionString = string.Empty; break;
} }
Results.DB.DbType = Users.Entities.DBType.MySql; Results.DB.DbType = Common.DBType.MySql;
string[] fields = dlg.InputList.Split(new char[] { ',' }); string[] fields = dlg.InputList.Split(new char[] { ',' });
int[] batchNrs = new int[fields.Length]; int[] batchNrs = new int[fields.Length];
@ -936,7 +937,7 @@ namespace ResultsBrowser
default: Results.DB.ConnectionString = string.Empty; break; default: Results.DB.ConnectionString = string.Empty; break;
} }
#endif #endif
Results.DB.DbType = Users.Entities.DBType.MySql; Results.DB.DbType = Common.DBType.MySql;
if (!string.IsNullOrEmpty(Results.DB.ConnectionString)) if (!string.IsNullOrEmpty(Results.DB.ConnectionString))
{ {

View File

@ -5,6 +5,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO.Ports; using System.IO.Ports;
using log4net; using log4net;
using Common;
using Config.Entities; using Config.Entities;
using TBF.BenchControl.Generic; using TBF.BenchControl.Generic;
using TBF.Boxes; using TBF.Boxes;

View File

@ -4,6 +4,7 @@
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;
using System.IO.Ports; using System.IO.Ports;
using Common;
using Config.Entities; using Config.Entities;
using TBF.BenchControl.Generic; using TBF.BenchControl.Generic;

View File

@ -7,7 +7,7 @@ using System.Globalization;
using System.IO.Ports; using System.IO.Ports;
using System.Text; using System.Text;
using log4net; using log4net;
using Config.Entities; using Common;
using TBF.BenchControl.Generic; using TBF.BenchControl.Generic;
using TBF.Boxes; using TBF.Boxes;

View File

@ -4,6 +4,7 @@
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;
using System.IO.Ports; using System.IO.Ports;
using Common;
using Config.Entities; using Config.Entities;
using TBF.BenchControl.Generic; using TBF.BenchControl.Generic;

View File

@ -3,6 +3,7 @@
/// ///
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using Common;
using Config.Entities; using Config.Entities;
using TBF.BenchControl.Generic; using TBF.BenchControl.Generic;

View File

@ -5,6 +5,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using System.Xml.Serialization; using System.Xml.Serialization;
using Common;
using Config.Entities; using Config.Entities;
using TBF.BenchControl.Generic; using TBF.BenchControl.Generic;

View File

@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Windows.Forms; using System.Windows.Forms;
using Common;
using Config.Entities; using Config.Entities;
using TBF.BenchControl; using TBF.BenchControl;

View File

@ -3,6 +3,7 @@
/// ///
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;
using Common;
using Config.Entities; using Config.Entities;
using TBF.BenchControl.Generic; using TBF.BenchControl.Generic;

View File

@ -5,6 +5,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Windows.Forms; using System.Windows.Forms;
using log4net; using log4net;
using Common;
using Config.Entities; using Config.Entities;
using TBF.BenchControl.Generic; using TBF.BenchControl.Generic;
using TBF.Resources; using TBF.Resources;

View File

@ -7,7 +7,7 @@ using System.Globalization;
using System.IO.Ports; using System.IO.Ports;
using System.Text; using System.Text;
using log4net; using log4net;
using Config.Entities; using Common;
using TBF.BenchControl.Generic; using TBF.BenchControl.Generic;
using TBF.Boxes; using TBF.Boxes;
using Dirichlet.Numerics; using Dirichlet.Numerics;

View File

@ -4,6 +4,7 @@
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;
using System.IO.Ports; using System.IO.Ports;
using Common;
using Config.Entities; using Config.Entities;
using TBF.BenchControl.Generic; using TBF.BenchControl.Generic;

View File

@ -4,6 +4,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Xml.Serialization; using System.Xml.Serialization;
using Common;
using Config.Entities; using Config.Entities;
using TBF.BenchControl.Generic; using TBF.BenchControl.Generic;

View File

@ -5,8 +5,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Xml.Serialization; using System.Xml.Serialization;
using log4net; using log4net;
using Config.Entities; using Common;
using TBF.BenchControl;
using TBF.BenchControl.Generic; using TBF.BenchControl.Generic;
namespace TBF.BenchControl.DataContainers.BenchInfo.Extended namespace TBF.BenchControl.DataContainers.BenchInfo.Extended

View File

@ -4,6 +4,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Xml.Serialization; using System.Xml.Serialization;
using Common;
using Config.Entities; using Config.Entities;
using TBF.BenchControl.Generic; using TBF.BenchControl.Generic;

View File

@ -5,7 +5,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Xml.Serialization; using System.Xml.Serialization;
using log4net; using log4net;
using Config.Entities; using Common;
using TBF.BenchControl; using TBF.BenchControl;
using TBF.BenchControl.Generic; using TBF.BenchControl.Generic;
using TBF.Resources; using TBF.Resources;

View File

@ -4,6 +4,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Xml.Serialization; using System.Xml.Serialization;
using Common;
using Config.Entities; using Config.Entities;
using TBF.BenchControl.Generic; using TBF.BenchControl.Generic;
using TBF.Resources; using TBF.Resources;

View File

@ -4,6 +4,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Xml.Serialization; using System.Xml.Serialization;
using Common;
using Config.Entities; using Config.Entities;
using TBF.BenchControl.Generic; using TBF.BenchControl.Generic;

View File

@ -4,6 +4,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Xml.Serialization; using System.Xml.Serialization;
using Common;
using Config.Entities; using Config.Entities;
using TBF.BenchControl.Generic; using TBF.BenchControl.Generic;

View File

@ -3,6 +3,7 @@
/// ///
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;
using Common;
using Config.Entities; using Config.Entities;
using TBF.BenchControl.Generic; using TBF.BenchControl.Generic;

View File

@ -3,6 +3,7 @@
/// ///
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;
using Common;
using Config.Entities; using Config.Entities;
using TBF.BenchControl.Generic; using TBF.BenchControl.Generic;
using TBF.Resources; using TBF.Resources;

View File

@ -4,6 +4,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Xml.Serialization; using System.Xml.Serialization;
using Common;
using Config.Entities; using Config.Entities;
using TBF.BenchControl.Generic; using TBF.BenchControl.Generic;
using TBF.Resources; using TBF.Resources;

View File

@ -3,6 +3,7 @@
/// ///
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;
using Common;
using Config.Entities; using Config.Entities;
using TBF.BenchControl.Generic; using TBF.BenchControl.Generic;
using TBF.Resources; using TBF.Resources;

View File

@ -3,6 +3,7 @@
/// ///
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;
using Common;
using Config.Entities; using Config.Entities;
using TBF.BenchControl.Generic; using TBF.BenchControl.Generic;
using TBF.Resources; using TBF.Resources;

View File

@ -3,6 +3,7 @@
/// ///
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;
using Common;
using Config.Entities; using Config.Entities;
using TBF.BenchControl.Generic; using TBF.BenchControl.Generic;
using TBF.Resources; using TBF.Resources;

View File

@ -3,6 +3,7 @@
/// ///
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;
using Common;
using Config.Entities; using Config.Entities;
using TBF.BenchControl.Generic; using TBF.BenchControl.Generic;

View File

@ -3,6 +3,7 @@
/// ///
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;
using Common;
using Config.Entities; using Config.Entities;
using TBF.BenchControl.Generic; using TBF.BenchControl.Generic;

View File

@ -3,6 +3,7 @@
/// ///
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;
using Common;
using Config.Entities; using Config.Entities;
using TBF.BenchControl.Generic; using TBF.BenchControl.Generic;
using TBF.Resources; using TBF.Resources;

View File

@ -3,6 +3,7 @@
/// ///
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;
using Common;
using Config.Entities; using Config.Entities;
using TBF.BenchControl.Generic; using TBF.BenchControl.Generic;
using TBF.Resources; using TBF.Resources;

View File

@ -3,6 +3,7 @@
/// ///
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;
using Common;
using Config.Entities; using Config.Entities;
using TBF.BenchControl.Generic; using TBF.BenchControl.Generic;
using TBF.Resources; using TBF.Resources;

View File

@ -3,6 +3,7 @@
/// ///
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;
using Common;
using Config.Entities; using Config.Entities;
using TBF.BenchControl.Generic; using TBF.BenchControl.Generic;
using TBF.Resources; using TBF.Resources;

View File

@ -3,6 +3,7 @@
/// ///
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;
using Common;
using Config.Entities; using Config.Entities;
using TBF.BenchControl.Generic; using TBF.BenchControl.Generic;
using TBF.Resources; using TBF.Resources;

View File

@ -3,6 +3,7 @@
/// ///
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;
using Common;
using Config.Entities; using Config.Entities;
using TBF.BenchControl.Generic; using TBF.BenchControl.Generic;
using TBF.Resources; using TBF.Resources;

View File

@ -4,6 +4,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using log4net; using log4net;
using Common;
using Config.Entities; using Config.Entities;
using TBF.BenchControl; using TBF.BenchControl;
using TBF.BenchControl.GenericDevices; using TBF.BenchControl.GenericDevices;

View File

@ -3,6 +3,7 @@
/// ///
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;
using Common;
using Config.Entities; using Config.Entities;
using TBF.BenchControl.Generic; using TBF.BenchControl.Generic;
using TBF.Resources; using TBF.Resources;

View File

@ -3,6 +3,7 @@
/// ///
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;
using Common;
using Config.Entities; using Config.Entities;
using TBF.BenchControl.Generic; using TBF.BenchControl.Generic;

View File

@ -5,6 +5,7 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Windows.Forms; using System.Windows.Forms;
using log4net; using log4net;
using Common;
using TBF.Resources; using TBF.Resources;
using System.Drawing; using System.Drawing;
@ -63,20 +64,20 @@ namespace TBF.BenchControl.DataEntry.iPerl
/// ///
/// Draw an appropriate test bench picture /// Draw an appropriate test bench picture
/// ///
Config.Entities.Side side = (TBF.BenchControl.Sequences.ProcessData.BenchInfo is DataContainers.BenchInfo.iPerl.Component) Side side = (TBF.BenchControl.Sequences.ProcessData.BenchInfo is DataContainers.BenchInfo.iPerl.Component)
? (TBF.BenchControl.Sequences.ProcessData.BenchInfo as DataContainers.BenchInfo.iPerl.Component).Side ? (TBF.BenchControl.Sequences.ProcessData.BenchInfo as DataContainers.BenchInfo.iPerl.Component).Side
: Config.Entities.Side.Left; : Side.Left;
if (reversedDirection && (side == Config.Entities.Side.Left)) if (reversedDirection && (side == Side.Left))
{ {
/// direction L->R (reversed), left side /// direction L->R (reversed), left side
pictureBox.Image = Image.FromFile(string.Format("{0}\\Pictures\\reversed_dir_left.jpg", Program.ExecutableDir, true)); pictureBox.Image = Image.FromFile(string.Format("{0}\\Pictures\\reversed_dir_left.jpg", Program.ExecutableDir, true));
} }
else if (reversedDirection && (side == Config.Entities.Side.Right)) else if (reversedDirection && (side == Side.Right))
{ {
/// direction L->R (reversed), right side /// direction L->R (reversed), right side
pictureBox.Image = Image.FromFile(string.Format("{0}\\Pictures\\reversed_dir_right.jpg", Program.ExecutableDir, true)); pictureBox.Image = Image.FromFile(string.Format("{0}\\Pictures\\reversed_dir_right.jpg", Program.ExecutableDir, true));
} }
else if (side == Config.Entities.Side.Right) else if (side == Side.Right)
{ {
/// direction R->L (forward), right side /// direction R->L (forward), right side
pictureBox.Image = Image.FromFile(string.Format("{0}\\Pictures\\forward_dir_right.jpg", Program.ExecutableDir, true)); pictureBox.Image = Image.FromFile(string.Format("{0}\\Pictures\\forward_dir_right.jpg", Program.ExecutableDir, true));

View File

@ -3,6 +3,7 @@
/// ///
using System; using System;
using System.Windows.Forms; using System.Windows.Forms;
using Common;
using Config.Entities; using Config.Entities;
using TBF.BenchControl.Generic; using TBF.BenchControl.Generic;
using TBF.Resources; using TBF.Resources;

View File

@ -4,7 +4,7 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using log4net; using log4net;
using Config.Entities; using Common;
using TBF.BenchControl.GenericDevices; using TBF.BenchControl.GenericDevices;
namespace TBF.BenchControl.Dummy.Balance namespace TBF.BenchControl.Dummy.Balance
@ -51,7 +51,7 @@ namespace TBF.BenchControl.Dummy.Balance
return this; return this;
} }
public IOperation ReadStableMassOp(ref Boxes.DoubleBox mass, int readingsCount, double maxSpread, Config.Entities.MassMethod method) public IOperation ReadStableMassOp(ref Boxes.DoubleBox mass, int readingsCount, double maxSpread, MassMethod method)
{ {
mass.Val = 0; mass.Val = 0;
return this; return this;

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