diff --git a/Config/Config.csproj b/Config/Config.csproj
index afa47fddb..889929c18 100644
--- a/Config/Config.csproj
+++ b/Config/Config.csproj
@@ -87,6 +87,7 @@
+
@@ -108,6 +109,7 @@
+
diff --git a/Config/Entities/Component.cs b/Config/Entities/Component.cs
index 800013e3b..165bd8acb 100644
--- a/Config/Entities/Component.cs
+++ b/Config/Entities/Component.cs
@@ -1,9 +1,8 @@
///
-/// Copyright (c) 2013-2015 Sensus Metering Systems
+/// Copyright (c) 2013-2019 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
-using System.Globalization;
using System.IO;
namespace Config.Entities
@@ -19,6 +18,7 @@ namespace Config.Entities
public virtual LogLevel Logging { get; set; }
public virtual string Parameters { get; set; }
public virtual IList Corrections { get; set; }
+ public virtual IList Uncertainties { get; set; }
/// ------------- Additional stuff not mapped into the database -------------
@@ -27,6 +27,7 @@ namespace Config.Entities
Name = string.Empty;
ClassName = string.Empty;
Corrections = new List();
+ Uncertainties = new List();
}
public static Component CreateFromCfg(string name, string className, string parentName, int itemNr,
diff --git a/Config/Entities/Uncertainty.cs b/Config/Entities/Uncertainty.cs
new file mode 100644
index 000000000..9ce48c7bb
--- /dev/null
+++ b/Config/Entities/Uncertainty.cs
@@ -0,0 +1,20 @@
+///
+/// Copyright (c) 2019 Sensus Slovensko a.s.
+///
+using System;
+
+namespace Config.Entities
+{
+ public class Uncertainty
+ {
+ public virtual int Id { get; protected set; }
+ public virtual float Measurement { get; set; }
+ public virtual float MainUncertainty { get; set; }
+ public virtual float Resolution { get; set; }
+ public virtual float DriftPerYr { get; set; }
+ public virtual float Conditions { get; set; }
+ public virtual float UncertaintyOfCorrection { get; set; }
+
+ public Uncertainty() { }
+ }
+}
diff --git a/Config/Mappings/ComponentMap.cs b/Config/Mappings/ComponentMap.cs
index 5a7170dc9..263e42682 100644
--- a/Config/Mappings/ComponentMap.cs
+++ b/Config/Mappings/ComponentMap.cs
@@ -1,5 +1,5 @@
///
-/// Copyright (c) 2013-2015 Sensus Metering Systems
+/// Copyright (c) 2013-2019 Sensus Slovensko a.s.
///
using FluentNHibernate.Mapping;
using Config.Entities;
@@ -23,6 +23,9 @@ namespace Config.Mappings
HasMany(x => x.Corrections)
.OrderBy("Measurement")
.Cascade.All();
- }
+ HasMany(x => x.Uncertainties)
+ .OrderBy("Measurement")
+ .Cascade.All();
+ }
}
}
diff --git a/Config/Mappings/UncertaintyMap.cs b/Config/Mappings/UncertaintyMap.cs
new file mode 100644
index 000000000..24912ea1d
--- /dev/null
+++ b/Config/Mappings/UncertaintyMap.cs
@@ -0,0 +1,22 @@
+///
+/// Copyright (c) 2019 Sensus Slovensko a.s.
+///
+using FluentNHibernate.Mapping;
+using Config.Entities;
+
+namespace Config.Mappings
+{
+ class UncertaintyMap : ClassMap
+ {
+ public UncertaintyMap()
+ {
+ Id(x => x.Id);
+ Map(x => x.Measurement);
+ Map(x => x.MainUncertainty);
+ Map(x => x.Resolution);
+ Map(x => x.DriftPerYr);
+ Map(x => x.Conditions);
+ Map(x => x.UncertaintyOfCorrection);
+ }
+ }
+}
diff --git a/Config/Mappings/UserMap.cs b/Config/Mappings/UserMap.cs
index b7d140833..6c63d6077 100644
--- a/Config/Mappings/UserMap.cs
+++ b/Config/Mappings/UserMap.cs
@@ -16,6 +16,8 @@ namespace Config.Mappings
Map(x => x.Tag);
#endif
Map(x => x.Password);
+ Map(x => x.Password2);
+ Map(x => x.Password3);
Map(x => x.FullName).Column("Description");
Map(x => x.LastPwChange);
HasMany(x => x.Groups)
diff --git a/Results/Mappings/BatchMap.cs b/Results/Mappings/BatchMap.cs
index bba268f95..3382faf6b 100644
--- a/Results/Mappings/BatchMap.cs
+++ b/Results/Mappings/BatchMap.cs
@@ -1,5 +1,5 @@
///
-/// Copyright (c) 2015 Sensus Metering Systems
+/// Copyright (c) 2019 Sensus Slovensko a.s.
///
using FluentNHibernate.Mapping;
using Results.Entities;
@@ -26,6 +26,16 @@ namespace Results.Mappings
.Column("Custom1"); ;
Map(x => x.Custom2);
Map(x => x.Custom3);
+ Map(x => x.Counter1);
+ Map(x => x.Counter2);
+ Map(x => x.Counter3);
+ Map(x => x.Counter4);
+ Map(x => x.Counter5);
+ Map(x => x.Counter6);
+ Map(x => x.Counter7);
+ Map(x => x.Counter8);
+ Map(x => x.Counter9);
+ Map(x => x.Counter10);
Map(x => x.StartTime);
Map(x => x.EndTime);
Map(x => x.Dirty);
diff --git a/Results/Mappings/MeterTestRsltMap.cs b/Results/Mappings/MeterTestRsltMap.cs
index 8da80fe5c..0f8518ce7 100644
--- a/Results/Mappings/MeterTestRsltMap.cs
+++ b/Results/Mappings/MeterTestRsltMap.cs
@@ -1,5 +1,5 @@
///
-/// Copyright (c) 2015 Sensus Metering Systems
+/// Copyright (c) 2015-2018 Sensus Slovensko a.s.
///
using FluentNHibernate.Mapping;
using Results.Entities;
@@ -12,6 +12,7 @@ namespace Results.Mappings
{
Id(x => x.Id);
Map(x => x.CompoundMeterId);
+ Map(x => x.RegReaderType);
Map(x => x.PulsesMeter);
Map(x => x.PulsesMaster);
Map(x => x.PulsesPerLiter);
diff --git a/Results/Mappings/TestRsltMap.cs b/Results/Mappings/TestRsltMap.cs
index b3f5fd23f..ce1ac904e 100644
--- a/Results/Mappings/TestRsltMap.cs
+++ b/Results/Mappings/TestRsltMap.cs
@@ -1,5 +1,5 @@
///
-/// Copyright (c) 2015-2018 Sensus Slovensko a.s.
+/// Copyright (c) 2015-2019 Sensus Slovensko a.s.
///
using FluentNHibernate.Mapping;
using Results.Entities;
@@ -16,6 +16,7 @@ namespace Results.Mappings
References(x => x.Components);
Map(x => x.Part);
Map(x => x.RepetitionNr);
+ Map(x => x.MethodClass);
Map(x => x.TestDone);
Map(x => x.Remark)
@@ -24,9 +25,13 @@ namespace Results.Mappings
Map(x => x.StartTime);
Map(x => x.EndTime);
Map(x => x.FlowSetTime);
+ Map(x => x.TimeBtwnMassMsrmnts);
Map(x => x.TestTime);
+ Map(x => x.TestTimeCorrection);
Map(x => x.PulsesMaster);
- Map(x => x.ConstMaster);
+ Map(x => x.ConstMasterRaw);
+ Map(x => x.ConstMasterCorr);
+ Map(x => x.ConstMaster);
Map(x => x.MassStartRaw);
Map(x => x.MassStart);
Map(x => x.MassEndRaw);
diff --git a/Results/Mappings/WaterMeterDataMap.cs b/Results/Mappings/WaterMeterDataMap.cs
index 13529ee14..6537ed888 100644
--- a/Results/Mappings/WaterMeterDataMap.cs
+++ b/Results/Mappings/WaterMeterDataMap.cs
@@ -42,6 +42,8 @@ namespace Results.Mappings
Map(x => x.MetrologicalClassAux);
Map(x => x.ApprovalInfoAux);
+ Map(x => x.Medium);
+
Map(x => x.Text1);
Map(x => x.Text2);
Map(x => x.Text3);
diff --git a/TBF/BenchControl/ComponentBase.cs b/TBF/BenchControl/ComponentBase.cs
index bd4cb1ec8..1ea9af76d 100644
--- a/TBF/BenchControl/ComponentBase.cs
+++ b/TBF/BenchControl/ComponentBase.cs
@@ -1,5 +1,5 @@
///
-/// Copyright (c) 2013-2015 Sensus Metering Systems
+/// Copyright (c) 2013-2019 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
@@ -20,12 +20,19 @@ namespace TBF.BenchControl
public int ItemNr { get { return cfg.ItemNr; } }
public DebugMode DebugLevel { get { return cfg.DebugLevel; } set { cfg.DebugLevel = value; } }
public LogLevel LogLevel { get { return cfg.LogLevel; } }
+
public IList Corrections
{
get { return cfg.Corrections; }
set { cfg.Corrections = value; }
}
+ public IList Uncertainties
+ {
+ get { return cfg.Uncertainties; }
+ set { cfg.Uncertainties = value; }
+ }
+
/// Constructor, components created in this way is used by
/// IComponentFactory.DummyComponent() function. Such dummy component should be used
diff --git a/TBF/BenchControl/ComponentCfgBase.cs b/TBF/BenchControl/ComponentCfgBase.cs
index f1aedf6cd..571a7a338 100644
--- a/TBF/BenchControl/ComponentCfgBase.cs
+++ b/TBF/BenchControl/ComponentCfgBase.cs
@@ -1,5 +1,5 @@
///
-/// Copyright (c) 2013-2015 Sensus Metering Systems
+/// Copyright (c) 2013-2019 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
@@ -68,6 +68,15 @@ namespace TBF.BenchControl
}
IList corrections;
+ [XmlIgnore]
+ public IList Uncertainties
+ {
+ get { return uncertainties; }
+ set { uncertainties = value; }
+ }
+ IList uncertainties;
+
+
protected ComponentCfgBase()
{
itemNr = 0;
@@ -118,7 +127,8 @@ namespace TBF.BenchControl
config.DebugLevel = cmpntEntity.Mode;
config.LogLevel = cmpntEntity.Logging;
config.Corrections = cmpntEntity.Corrections;
- config.Factory = factory;
+ config.Uncertainties = cmpntEntity.Uncertainties;
+ config.Factory = factory;
}
return config;
}
diff --git a/TBF/BenchControl/Generic/IComponent.cs b/TBF/BenchControl/Generic/IComponent.cs
index ab7a4de98..5daf62580 100644
--- a/TBF/BenchControl/Generic/IComponent.cs
+++ b/TBF/BenchControl/Generic/IComponent.cs
@@ -1,5 +1,5 @@
///
-/// Copyright (c) 2013-2015 Sensus Metering Systems
+/// Copyright (c) 2013-2019 Sensus Slovensko a.s.
///
using System.Collections.Generic;
@@ -21,6 +21,8 @@ namespace TBF.BenchControl.Generic
IList Corrections { get; set; }
+ IList Uncertainties { get; set; }
+
void StartChangeHandler();
void StopChangeHandler();
diff --git a/TBF/BenchControl/Generic/IComponentCfg.cs b/TBF/BenchControl/Generic/IComponentCfg.cs
index f7e0aab9a..1cc4346e1 100644
--- a/TBF/BenchControl/Generic/IComponentCfg.cs
+++ b/TBF/BenchControl/Generic/IComponentCfg.cs
@@ -43,6 +43,11 @@ namespace TBF.BenchControl.Generic
///
IList Corrections { get; set; }
+ ///
+ /// Measurement correction values
+ ///
+ IList Uncertainties { get; set; }
+
///
/// Creates a new database entity 'Component' from the parameters
///
diff --git a/TBF/LocalSettings.cs b/TBF/LocalSettings.cs
index edfcd7204..634734c7b 100644
--- a/TBF/LocalSettings.cs
+++ b/TBF/LocalSettings.cs
@@ -107,11 +107,6 @@ namespace TBF
public int PathsDlgWidth;
public int PathsDlgHeight;
- /// iPerlCommunicationsForm
- public int iPerlCommunicationsFormLeft;
- public int iPerlCommunicationsFormTop;
- public long iPerlCommunicationsFormCheckboxes;
-
[XmlArrayAttribute("FeedingColumnWidths")]
public int[] FeedingColumnWidths;
[XmlIgnore]
@@ -156,6 +151,20 @@ namespace TBF
public int MetrologyDlgWidth;
public int MetrologyDlgHeight;
+ /// Conditions
+ public bool ConditionsDlgMaximized;
+ public int ConditionsDlgLeft;
+ public int ConditionsDlgTop;
+ public int ConditionsDlgWidth;
+ public int ConditionsDlgHeight;
+
+ /// Uncertainty
+ public bool UncertaintyDlgMaximized;
+ public int UncertaintyDlgLeft;
+ public int UncertaintyDlgTop;
+ public int UncertaintyDlgWidth;
+ public int UncertaintyDlgHeight;
+
/// Procedures
public bool ProceduresDlgMaximized;
@@ -190,6 +199,11 @@ namespace TBF
public int EnduranceDlgWidth;
public int EnduranceDlgHeight;
+ /// iPerlCommunicationsForm
+ public int iPerlCommunicationsFormLeft;
+ public int iPerlCommunicationsFormTop;
+ public long iPerlCommunicationsFormCheckboxes;
+
/// Serial numbers
public string[] LastSNTexts;
[XmlIgnore]
diff --git a/TBF/TBF.csproj b/TBF/TBF.csproj
index bb190ee0e..7d73cbda1 100644
--- a/TBF/TBF.csproj
+++ b/TBF/TBF.csproj
@@ -1987,6 +1987,12 @@
SelectComponentClassDlg.cs
+
+ Form
+
+
+ ConditionsDlg.cs
+
Form
@@ -2081,6 +2087,12 @@
Component
+
+ Form
+
+
+ UncertaintiesDlg.cs
+
UserControl
@@ -2164,36 +2176,52 @@
TestParamsCtrl.cs
-
+
+ Form
+
FlowSelection.cs
-
+
+ Form
+
HeatMetersSelection.cs
-
+
+ Form
+
MethodSelection.cs
-
+
+ Form
+
PressureSelection.cs
-
+
+ Form
+
Roi1.cs
-
+
+ Form
+
Roi2.cs
-
+
+ Form
+
Roi3.cs
-
+
+ Form
+
VolumeAndErrorSelection.cs
@@ -2994,6 +3022,9 @@
SelectComponentClassDlg.cs
+
+ ConditionsDlg.cs
+
MetrologyDlg.cs
@@ -3030,6 +3061,9 @@
TransitionsDlg.cs
+
+ UncertaintiesDlg.cs
+
CameraPictureCtrl.cs
diff --git a/TBF/UI/Bench/Conditions/ConditionsDlg.Designer.cs b/TBF/UI/Bench/Conditions/ConditionsDlg.Designer.cs
new file mode 100644
index 000000000..d69637bf0
--- /dev/null
+++ b/TBF/UI/Bench/Conditions/ConditionsDlg.Designer.cs
@@ -0,0 +1,91 @@
+///
+/// Copyright (c) 2019 Sensus Slovensko a.s.
+///
+namespace TBF.UI.Bench.Conditions
+{
+ partial class ConditionsDlg
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ConditionsDlg));
+ this.mainSplitContainer = new System.Windows.Forms.SplitContainer();
+ this.tabControl = new System.Windows.Forms.TabControl();
+ this.sharedButtons = new TBF.UI.Shared.SharedButtons();
+ ((System.ComponentModel.ISupportInitialize)(this.mainSplitContainer)).BeginInit();
+ this.mainSplitContainer.Panel1.SuspendLayout();
+ this.mainSplitContainer.Panel2.SuspendLayout();
+ this.mainSplitContainer.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // mainSplitContainer
+ //
+ resources.ApplyResources(this.mainSplitContainer, "mainSplitContainer");
+ this.mainSplitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
+ this.mainSplitContainer.Name = "mainSplitContainer";
+ //
+ // mainSplitContainer.Panel1
+ //
+ this.mainSplitContainer.Panel1.Controls.Add(this.tabControl);
+ //
+ // mainSplitContainer.Panel2
+ //
+ this.mainSplitContainer.Panel2.Controls.Add(this.sharedButtons);
+ //
+ // tabControl
+ //
+ resources.ApplyResources(this.tabControl, "tabControl");
+ this.tabControl.Name = "tabControl";
+ this.tabControl.SelectedIndex = 0;
+ this.tabControl.SelectedIndexChanged += new System.EventHandler(this.tabControl_SelectedIndexChanged);
+ //
+ // sharedButtons
+ //
+ resources.ApplyResources(this.sharedButtons, "sharedButtons");
+ this.sharedButtons.Name = "sharedButtons";
+ //
+ // ConditionsDlg
+ //
+ resources.ApplyResources(this, "$this");
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.Controls.Add(this.mainSplitContainer);
+ this.Name = "ConditionsDlg";
+ this.Load += new System.EventHandler(this.TransitionsDlg_Load);
+ this.mainSplitContainer.Panel1.ResumeLayout(false);
+ this.mainSplitContainer.Panel2.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.mainSplitContainer)).EndInit();
+ this.mainSplitContainer.ResumeLayout(false);
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.SplitContainer mainSplitContainer;
+ private System.Windows.Forms.TabControl tabControl;
+ private TBF.UI.Shared.SharedButtons sharedButtons;
+ }
+}
\ No newline at end of file
diff --git a/TBF/UI/Bench/Conditions/ConditionsDlg.cs b/TBF/UI/Bench/Conditions/ConditionsDlg.cs
new file mode 100644
index 000000000..9ca21033a
--- /dev/null
+++ b/TBF/UI/Bench/Conditions/ConditionsDlg.cs
@@ -0,0 +1,707 @@
+///
+/// Copyright (c) 2019 Sensus Slovensko a.s.
+///
+using System;
+using System.Collections.Generic;
+using System.IO;
+using System.Linq;
+using System.Windows.Forms;
+using log4net;
+using NHibernate;
+using Config.Entities;
+using Results.Forms;
+using TBF.BenchControl.Generic;
+using TBF.BenchControl.GenericDevices;
+using TBF.Resources;
+using TBF.UI.Shared;
+using TBF.UI.Bench.Transitions; /// TODO: Remove
+
+namespace TBF.UI.Bench.Conditions
+{
+ public partial class ConditionsDlg : Form, IParentOfListViewEx
+ {
+ static readonly ILog log = LogManager.GetLogger(typeof(ConditionsDlg));
+
+ /// Used when re-scaling the dialog: 100% = 96dpi, 125% = 120dpi, 150% = 144dpi
+ public readonly int Dpi;
+ public const int Dpi100pct = 96;
+
+ ///
+ /// Fluent-NHibernate database session
+ ///
+ public ISession Session;
+
+ IList procedures;
+ IList tests;
+
+ Dictionary renameInfo; /// Pairs original name / new name
+
+
+ ///
+ /// Transition sequences to be updated by this dialog.
+ /// Set by the constructor or updated by the parent after creation and before loading.
+ ///
+ public IList TransitionSequences;
+ public IList RemovedTransitionSequences;
+
+ ///
+ /// Virtual bench sequences to be updated by this dialog.
+ /// Set by the constructor or updated by the parent after creation and before loading.
+ ///
+ public IList VirtualBenchSequences;
+ public IList RemovedVirtualBenchSequences;
+
+
+ /// Auxiliary public lists used also by user controls in tab pages
+ public IList TbfComponents;
+ public IList Valves;
+ public IList RegulValves;
+
+
+ IList seqStepsCtrls;
+
+
+ public ConditionsDlg()
+ {
+ /// Detect display setting: 100% = 96dpi, 125% = 120dpi, 150% = 144dpi.
+ Dpi = (int)this.CreateGraphics().DpiX;
+
+ InitializeComponent();
+
+ /// SharedDlgButtons configuration
+ sharedButtons.RequiredGroupMembership = new Users.Grp.GID[] { Users.Grp.GID.Metrologists };
+ sharedButtons.OptionalButtons = SharedButtons.Buttons.Add | SharedButtons.Buttons.Remove |
+ SharedButtons.Buttons.Up | SharedButtons.Buttons.Down |
+ SharedButtons.Buttons.Export | SharedButtons.Buttons.Import |
+ SharedButtons.Buttons.Compare | SharedButtons.Buttons.NewTab |
+ SharedButtons.Buttons.RenameTab | SharedButtons.Buttons.RemoveTab;
+ sharedButtons.Unlocked += Unlocked;
+ sharedButtons.OKClicked += okButton_Click;
+ sharedButtons.CancelClicked += cancelButton_Click;
+ sharedButtons.AddClicked += addButton_Click;
+ sharedButtons.RemoveClicked += removeButton_Click;
+ sharedButtons.UpClicked += upButton_Click;
+ sharedButtons.DownClicked += downButton_Click;
+ sharedButtons.ExportClicked += exportButton_Click;
+ sharedButtons.ImportClicked += importButton_Click;
+ sharedButtons.CompareClicked += compareButton_Click;
+ sharedButtons.NewTabClicked += newTabButton_Click;
+ sharedButtons.RenameTabClicked += renameTabButton_Click;
+ sharedButtons.RemoveTabClicked += removeTabButton_Click;
+
+ seqStepsCtrls = new List();
+
+ /// Open the database
+ Session = Config.FluentCommon.CreateSession(Users.Entities.DBKind.Config);
+
+ /// Prepare a list of components and a list of all valves in the test bench
+ TbfComponents = BenchControl.TbfComponents.LoadComponentsFromDB(Session);
+ Valves = BenchControl.GenericDevices.ValveBase.MasterValves(TbfComponents);
+ RegulValves = new List();
+ foreach (var cmpnt in TbfComponents)
+ {
+ if ((cmpnt is IRegulValve) && !(cmpnt is BenchControl.Elde.RegulValveTandem.RegulValveTandem))
+ {
+ RegulValves.Add(cmpnt as IRegulValve);
+ }
+ }
+
+ /// Load the sequences
+ /// Note: Each sequence (in both sequences together) has a unique ItemNr (0 .. N-1)
+ TransitionSequences = Session.QueryOver().OrderBy(x => x.ItemNr).Asc.List();
+ VirtualBenchSequences = Session.QueryOver().OrderBy(x => x.ItemNr).Asc.List();
+ procedures = Session.QueryOver().List();
+ tests = Session.QueryOver().List();
+
+ RemovedTransitionSequences = new List();
+ RemovedVirtualBenchSequences = new List();
+
+ /// Create a tab with sequence steps for each sequence ordered by ItemNr.
+ foreach (var transSeq in TransitionSequences)
+ {
+ transSeq.OriName = transSeq.Name;
+ AddTransitionSeqTab(transSeq);
+ }
+
+ foreach (var vBenchSeq in VirtualBenchSequences)
+ {
+ vBenchSeq.OriName = vBenchSeq.Name;
+ AddVirtualBenchSeqTab(vBenchSeq);
+ }
+ }
+
+ void AddTransitionSeqTab(TransitionSequence sequence)
+ {
+ //TabPage nwTab = new TabPage(sequence.Name);
+ //nwTab.Tag = sequence;
+ //TransitionStepsCtrl newCtrl = new TransitionStepsCtrl();
+ //seqStepsCtrls.Add(newCtrl);
+ //nwTab.Controls.Add(newCtrl);
+ //tabControl.TabPages.Add(nwTab);
+ //newCtrl.Initialize(sequence, this, tabControl.TabPages[tabControl.TabPages.Count - 1]);
+ //newCtrl.SelectedIndexChanged += new System.EventHandler(SelectedIndexChanged);
+ }
+
+ void AddVirtualBenchSeqTab(VirtualBenchSequence sequence)
+ {
+ //TabPage nwTab = new TabPage(sequence.Name);
+ //nwTab.Tag = sequence;
+ //VirtualBenchStepsCtrl newCtrl = new VirtualBenchStepsCtrl();
+ //seqStepsCtrls.Add(newCtrl);
+ //nwTab.Controls.Add(newCtrl);
+ //tabControl.TabPages.Add(nwTab);
+ //newCtrl.Initialize(sequence, this, tabControl.TabPages[tabControl.TabPages.Count - 1]);
+ //newCtrl.SelectedIndexChanged += new System.EventHandler(SelectedIndexChanged);
+ }
+
+ private void TransitionsDlg_Load(object sender, EventArgs e)
+ {
+ Localize();
+ LoadUISettings();
+
+ /// Now refresh the content of the dialog
+ RefreshAllTabs();
+ }
+
+ void Localize()
+ {
+ Text = Strings.Conditions;
+ }
+
+ void RefreshAllTabs()
+ {
+ foreach (var ctrl in seqStepsCtrls) (ctrl as ListViewEx).Refresh();
+ }
+
+ private void Unlocked(object sender, EventArgs e)
+ {
+ foreach (var ctrl in seqStepsCtrls) ctrl.Unlock();
+ }
+
+
+ private void newTabButton_Click(object sender, EventArgs e)
+ {
+ TabNameDlg dlg;
+ bool nameUsed;
+ int tabId = TransitionSequences.Count + VirtualBenchSequences.Count;
+
+ do
+ {
+ /// Find an unused procedure name
+ string newName;
+ for (int nameId = 1; true; nameId++)
+ {
+ newName = "Tr" + nameId.ToString();
+ nameUsed = false;
+ foreach (var seq in TransitionSequences) if (seq.Name.Equals(newName)) nameUsed = true;
+ if (!nameUsed) break;
+ }
+
+ dlg = new TabNameDlg();
+ dlg.TabNameLabel = Strings.New_transition_name;
+ dlg.TabName = newName;
+
+ if (DialogResult.OK != dlg.ShowDialog()) return;
+
+ foreach (var seq in TransitionSequences) if (seq.Name.Equals(dlg.TabName)) nameUsed = true;
+ if (nameUsed) MessageBox.Show(Strings.Please_choose_another_transition_sequence_name,
+ Strings.Warning,
+ MessageBoxButtons.OK,
+ MessageBoxIcon.Information);
+ }
+ while (nameUsed);
+
+ if (dlg.IsVirtualBenchSeq)
+ {
+ VirtualBenchSequence sequence = new VirtualBenchSequence(dlg.TabName, tabId);
+ VirtualBenchSequences.Add(sequence);
+ AddVirtualBenchSeqTab(sequence);
+ seqStepsCtrls[tabId].Unlock();
+ }
+ else
+ {
+ TransitionSequence sequence = new TransitionSequence(dlg.TabName, tabId);
+ TransitionSequences.Add(sequence);
+ AddTransitionSeqTab(sequence);
+ seqStepsCtrls[tabId].Unlock();
+ }
+ tabControl.SelectTab(tabId);
+ }
+
+ private void renameTabButton_Click(object sender, EventArgs e)
+ {
+ TabPage tabPage = tabControl.SelectedTab;
+ TransitionSequence transitionSeq = tabPage.Tag as TransitionSequence;
+ VirtualBenchSequence virtualBenchSeq = tabPage.Tag as VirtualBenchSequence;
+
+ TabNameDlg dlg = new TabNameDlg(true);
+ dlg.TabNameLabel = Strings.New_transition_name;
+
+ if (dlg.ShowDialog() == DialogResult.OK)
+ {
+ bool nameUsed = false;
+ foreach (var seq in TransitionSequences) if (seq != transitionSeq && seq.Name == dlg.TabName) nameUsed = true;
+ foreach (var seq in VirtualBenchSequences) if (seq != virtualBenchSeq && seq.Name == dlg.TabName) nameUsed = true;
+
+ if (nameUsed)
+ {
+ MessageBox.Show(Strings.Please_choose_another_transition_sequence_name,
+ Strings.Warning,
+ MessageBoxButtons.OK,
+ MessageBoxIcon.Information);
+ }
+ else
+ {
+ if (transitionSeq != null)
+ {
+ transitionSeq.Name = dlg.TabName;
+ tabPage.Text = dlg.TabName;
+ }
+ else if (virtualBenchSeq != null)
+ {
+ virtualBenchSeq.Name = dlg.TabName;
+ tabPage.Text = dlg.TabName;
+ }
+ }
+ }
+ }
+
+ private void removeTabButton_Click(object sender, EventArgs e)
+ {
+ TabPage tabPage = tabControl.SelectedTab;
+ TransitionSequence transitionSeq = tabPage.Tag as TransitionSequence;
+ VirtualBenchSequence virtualBenchSeq = tabPage.Tag as VirtualBenchSequence;
+
+ if (DialogResult.Yes == MessageBox.Show(string.Format(Strings.Do_you_really_want_to_delete_sequence_0, tabPage.Text),
+ Strings.Warning,
+ MessageBoxButtons.YesNo,
+ MessageBoxIcon.Question))
+ {
+ if (transitionSeq != null)
+ {
+ RemovedTransitionSequences.Add(transitionSeq);
+ TransitionSequences.Remove(transitionSeq);
+ tabControl.TabPages.Remove(tabPage);
+ }
+ else if (virtualBenchSeq != null)
+ {
+ RemovedVirtualBenchSequences.Add(virtualBenchSeq);
+ VirtualBenchSequences.Remove(virtualBenchSeq);
+ tabControl.TabPages.Remove(tabPage);
+ }
+ }
+ }
+
+ void RetrieveData()
+ {
+ if (seqStepsCtrls.Count > slctdTab) seqStepsCtrls[slctdTab].OkBtnClicked();
+ }
+
+ string GetWarningsBeforeSaving(ref Dictionary renmInfo)
+ {
+ string warnings = string.Empty;
+ renmInfo = new Dictionary();
+
+ foreach (var seq in RemovedTransitionSequences)
+ {
+ if (!string.IsNullOrEmpty(seq.OriName))
+ {
+ int occurances = 0;
+ foreach (var test in tests)
+ {
+ if (!string.IsNullOrEmpty(test.RelTransBefore) && test.RelTransBefore == seq.OriName) occurances++;
+ if (!string.IsNullOrEmpty(test.TransitionAfter) && test.TransitionAfter == seq.OriName) occurances++;
+ }
+ foreach (var proc in procedures)
+ {
+ if (!string.IsNullOrEmpty(proc.TransitionStart) && proc.TransitionStart == seq.OriName) occurances++;
+ if (!string.IsNullOrEmpty(proc.TransitionEnd) && proc.TransitionEnd == seq.OriName) occurances++;
+ }
+ if (occurances > 0)
+ {
+ warnings += string.Format("Deleting transition sequence {0} used in {1} tests and procedures{2}", seq.OriName, occurances, Environment.NewLine);
+ renmInfo.Add(seq.OriName, string.Empty);
+ }
+ }
+ }
+ foreach (var seq in RemovedVirtualBenchSequences)
+ {
+ if (!string.IsNullOrEmpty(seq.OriName))
+ {
+ int occurances = 0;
+ foreach (var test in tests)
+ {
+ if (!string.IsNullOrEmpty(test.RelTransBefore) && test.RelTransBefore == seq.OriName) occurances++;
+ if (!string.IsNullOrEmpty(test.TransitionAfter) && test.TransitionAfter == seq.OriName) occurances++;
+ }
+ foreach (var proc in procedures)
+ {
+ if (!string.IsNullOrEmpty(proc.TransitionStart) && proc.TransitionStart == seq.OriName) occurances++;
+ if (!string.IsNullOrEmpty(proc.TransitionEnd) && proc.TransitionEnd == seq.OriName) occurances++;
+ }
+ if (occurances > 0)
+ {
+ warnings += string.Format("Deleting virtual bench sequence {0} used in {1} tests and procedures{2}", seq.OriName, occurances, Environment.NewLine);
+ renmInfo.Add(seq.OriName, string.Empty);
+ }
+ }
+ }
+
+ foreach (var seq in TransitionSequences)
+ {
+ if (!string.IsNullOrEmpty(seq.OriName) && seq.OriName != seq.Name)
+ {
+ int occurances = 0;
+ foreach (var test in tests)
+ {
+ if (!string.IsNullOrEmpty(test.RelTransBefore) && test.RelTransBefore == seq.OriName) occurances++;
+ if (!string.IsNullOrEmpty(test.TransitionAfter) && test.TransitionAfter == seq.OriName) occurances++;
+ }
+ foreach (var proc in procedures)
+ {
+ if (!string.IsNullOrEmpty(proc.TransitionStart) && proc.TransitionStart == seq.OriName) occurances++;
+ if (!string.IsNullOrEmpty(proc.TransitionEnd) && proc.TransitionEnd == seq.OriName) occurances++;
+ }
+ if (occurances > 0)
+ {
+ warnings += string.Format("Renaming transition sequence {0} used in {1} tests and procedures{2}", seq.OriName, occurances, Environment.NewLine);
+ renmInfo.Add(seq.OriName, seq.Name);
+ }
+ }
+ }
+ foreach (var seq in VirtualBenchSequences)
+ {
+ if (!string.IsNullOrEmpty(seq.OriName) && seq.OriName != seq.Name)
+ {
+ int occurances = 0;
+ foreach (var test in tests)
+ {
+ if (!string.IsNullOrEmpty(test.RelTransBefore) && test.RelTransBefore == seq.OriName) occurances++;
+ if (!string.IsNullOrEmpty(test.TransitionAfter) && test.TransitionAfter == seq.OriName) occurances++;
+ }
+ foreach (var proc in procedures)
+ {
+ if (!string.IsNullOrEmpty(proc.TransitionStart) && proc.TransitionStart == seq.OriName) occurances++;
+ if (!string.IsNullOrEmpty(proc.TransitionEnd) && proc.TransitionEnd == seq.OriName) occurances++;
+ }
+ if (occurances > 0)
+ {
+ warnings += string.Format("Renaming virtual bench sequence {0} used in {1} tests and procedures{2}", seq.OriName, occurances, Environment.NewLine);
+ renmInfo.Add(seq.OriName, seq.Name);
+ }
+ }
+ }
+
+ return warnings;
+ }
+
+ private void okButton_Click(object sender, EventArgs e)
+ {
+ RetrieveData();
+
+ string warnings = GetWarningsBeforeSaving(ref renameInfo);
+
+ bool updateRelatedItems = false;
+ if (!string.IsNullOrEmpty(warnings))
+ {
+ string message = string.Format("{0}{1}{2}", warnings, Environment.NewLine,
+ Strings.Do_you_want_to_update_related_tests_and_procedures);
+ DialogResult dr = MessageBox.Show(message, Strings.Warning, MessageBoxButtons.YesNoCancel, MessageBoxIcon.Exclamation);
+ if (dr == DialogResult.Cancel)
+ {
+ DialogResult = DialogResult.Cancel;
+ return;
+ }
+ else if (dr == DialogResult.Yes)
+ {
+ updateRelatedItems = true;
+ }
+ }
+
+ Cursor.Current = Cursors.WaitCursor;
+
+ using (var transaction = Session.BeginTransaction())
+ {
+ try
+ {
+ if (updateRelatedItems)
+ {
+ foreach (var ri in renameInfo)
+ {
+ var tests = Session.QueryOver()
+ .Where(x => (x.RelTransBefore == ri.Key))
+ .List();
+ foreach (var t in tests)
+ {
+ t.RelTransBefore = ri.Value;
+ Session.Update(t);
+ }
+
+ tests = Session.QueryOver()
+ .Where(x => (x.TransitionAfter == ri.Key))
+ .List();
+ foreach (var t in tests)
+ {
+ t.TransitionAfter = ri.Value;
+ Session.Update(t);
+ }
+
+ var procedures = Session.QueryOver()
+ .Where(x => (x.TransitionStart == ri.Key))
+ .List();
+ foreach (var p in procedures)
+ {
+ p.TransitionStart = ri.Value;
+ Session.Update(p);
+ }
+
+ procedures = Session.QueryOver()
+ .Where(x => (x.TransitionEnd == ri.Key))
+ .List();
+ foreach (var p in procedures)
+ {
+ p.TransitionEnd = ri.Value;
+ Session.Update(p);
+ }
+ }
+ }
+
+ foreach (var transSeq in RemovedTransitionSequences)
+ {
+ foreach (var step in transSeq.TransitionSteps) Session.Delete(step);
+ Session.Delete(transSeq);
+ }
+ foreach (var vBnchSeq in RemovedVirtualBenchSequences)
+ {
+ foreach (var step in vBnchSeq.VirtualBenchSteps) Session.Delete(step);
+ Session.Delete(vBnchSeq);
+ }
+
+ int itemNr = 0;
+ foreach (var transSeq in TransitionSequences)
+ {
+ transSeq.ItemNr = itemNr++;
+ Session.SaveOrUpdate(transSeq);
+ }
+ itemNr = 0;
+ foreach (var vBnchSeq in VirtualBenchSequences)
+ {
+ vBnchSeq.ItemNr = itemNr++;
+ Session.SaveOrUpdate(vBnchSeq);
+ }
+
+ transaction.Commit();
+ }
+ catch (Exception e2)
+ {
+ transaction.Rollback();
+ Cursor.Current = Cursors.Default;
+
+ MessageBox.Show(Strings.Cannot_save_changes, Strings.Error, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
+ log.ErrorFormat("Update of sequences in the database failed: {0}", e2.Message);
+ }
+ }
+
+ Cursor.Current = Cursors.Default;
+
+ SaveUISettings();
+ DialogResult = DialogResult.OK;
+ Close();
+ return;
+ }
+
+ private void cancelButton_Click(object sender, EventArgs e)
+ {
+ SaveUISettings();
+ DialogResult = DialogResult.Cancel;
+ Close();
+ return;
+ }
+
+ private void SaveUISettings()
+ {
+ /// Obtain ConditionsDlg dimensions, etc.
+ bool isMaximized = (WindowState == FormWindowState.Maximized);
+ int left = (WindowState == FormWindowState.Normal) ? Location.X : RestoreBounds.Left;
+ int top = (WindowState == FormWindowState.Normal) ? Location.Y : RestoreBounds.Top;
+ int width = (WindowState == FormWindowState.Normal) ? Size.Width : RestoreBounds.Width;
+ int height = (WindowState == FormWindowState.Normal) ? Size.Height : RestoreBounds.Height;
+
+ LocalSettings ls = Program.LocalSettings;
+
+ if (ls != null && (ls.ConditionsDlgMaximized != isMaximized ||
+ ls.ConditionsDlgLeft != left ||
+ ls.ConditionsDlgTop != top ||
+ ls.ConditionsDlgWidth != width ||
+ ls.ConditionsDlgHeight != height))
+ {
+ /// At least one ConditionsDlg dimension differs => Update local settings and save them
+ ls.ConditionsDlgMaximized = isMaximized;
+ ls.ConditionsDlgLeft = left;
+ ls.ConditionsDlgTop = top;
+ ls.ConditionsDlgWidth = width;
+ ls.ConditionsDlgHeight = height;
+ ls.Save();
+ }
+ }
+
+ private void LoadUISettings()
+ {
+ TBF.LocalSettings ls = Program.LocalSettings;
+ WindowState = (ls.ConditionsDlgMaximized ? FormWindowState.Maximized : FormWindowState.Normal);
+ Width = (ls.ConditionsDlgWidth > 0) ? ls.ConditionsDlgWidth : 1050;
+ Height = (ls.ConditionsDlgHeight > 0) ? ls.ConditionsDlgHeight : 650;
+ Left = (ls.ConditionsDlgLeft != 0) ? ls.ConditionsDlgLeft : 100;
+ Top = (ls.ConditionsDlgTop != 0) ? ls.ConditionsDlgTop : 100;
+ }
+
+
+ int slctdTab;
+
+ private void tabControl_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ if (seqStepsCtrls.Count > slctdTab)
+ {
+ seqStepsCtrls[slctdTab].OkBtnClicked();
+ }
+ slctdTab = tabControl.SelectedIndex;
+ sharedButtons.EnableButtons(SharedButtons.Buttons.Add);
+ sharedButtons.DisableButtons(SharedButtons.Buttons.Remove);
+ RefreshAllTabs();
+ }
+
+ private void addButton_Click(object sender, EventArgs e)
+ {
+ if (seqStepsCtrls.Count > slctdTab) seqStepsCtrls[slctdTab].AddOne();
+ }
+
+ private void removeButton_Click(object sender, EventArgs e)
+ {
+ if (seqStepsCtrls.Count > slctdTab) seqStepsCtrls[slctdTab].RemoveSelected();
+ }
+
+ private void upButton_Click(object sender, EventArgs e)
+ {
+ if (seqStepsCtrls.Count > slctdTab) seqStepsCtrls[slctdTab].MoveUpSelected();
+ }
+
+ private void downButton_Click(object sender, EventArgs e)
+ {
+ if (seqStepsCtrls.Count > slctdTab) seqStepsCtrls[slctdTab].MoveDownSelected();
+ }
+
+ public void UpdateButtonStates(SharedButtons.SelectedItemPos selectedItemPos)
+ {
+ if (selectedItemPos == SharedButtons.SelectedItemPos.None)
+ {
+ sharedButtons.DisableButtons(SharedButtons.Buttons.Remove | SharedButtons.Buttons.Up | SharedButtons.Buttons.Down);
+ }
+ else if (selectedItemPos == SharedButtons.SelectedItemPos.First)
+ {
+ sharedButtons.EnableButtons(SharedButtons.Buttons.Remove | SharedButtons.Buttons.Down);
+ sharedButtons.DisableButtons(SharedButtons.Buttons.Up);
+ }
+ else if (selectedItemPos == SharedButtons.SelectedItemPos.Last)
+ {
+ sharedButtons.EnableButtons(SharedButtons.Buttons.Remove | SharedButtons.Buttons.Up);
+ sharedButtons.DisableButtons(SharedButtons.Buttons.Down);
+ }
+ else if (selectedItemPos == SharedButtons.SelectedItemPos.FirstAndLast)
+ {
+ sharedButtons.EnableButtons(SharedButtons.Buttons.Remove);
+ sharedButtons.DisableButtons(SharedButtons.Buttons.Up | SharedButtons.Buttons.Down);
+ }
+ else
+ {
+ sharedButtons.EnableButtons(SharedButtons.Buttons.Remove | SharedButtons.Buttons.Up | SharedButtons.Buttons.Down);
+ }
+ }
+
+
+ ///
+ /// Common part for three xxxListViewEx_SelectedIndexChanged event handlers
+ ///
+ ///
+ void SelectedIndexChanged(object sender, EventArgs e)
+ {
+ ListViewEx listViewEx = sender as ListViewEx;
+ if (listViewEx.SelectedItems.Count != 1)
+ {
+ UpdateButtonStates(SharedButtons.SelectedItemPos.None);
+ }
+ else if (listViewEx.Items.Count == 1)
+ {
+ UpdateButtonStates(SharedButtons.SelectedItemPos.FirstAndLast);
+ }
+ else if (listViewEx.SelectedIndices[0] == 0)
+ {
+ UpdateButtonStates(SharedButtons.SelectedItemPos.First);
+ }
+ else if (listViewEx.SelectedIndices[0] == (listViewEx.Items.Count - 1))
+ {
+ UpdateButtonStates(SharedButtons.SelectedItemPos.Last);
+ }
+ else
+ {
+ UpdateButtonStates(SharedButtons.SelectedItemPos.Middle);
+ }
+ }
+
+
+ private void exportButton_Click(object sender, EventArgs e)
+ {
+ TabPage tabPage = tabControl.SelectedTab;
+ TransitionSequence transitionSeq = tabPage.Tag as TransitionSequence;
+ VirtualBenchSequence virtualBenchSeq = tabPage.Tag as VirtualBenchSequence;
+
+ SaveFileDialog dlg = new SaveFileDialog();
+ if (dlg.ShowDialog() == DialogResult.OK)
+ {
+ if (transitionSeq != null)
+ {
+ /// export transition sequence
+ transitionSeq.Export(new StreamWriter(dlg.FileName, false, System.Text.Encoding.UTF8));
+ }
+ else if (virtualBenchSeq != null)
+ {
+ /// export virtual sequence
+ virtualBenchSeq.Export(new StreamWriter(dlg.FileName, false, System.Text.Encoding.UTF8));
+ }
+ }
+ }
+
+ private void importButton_Click(object sender, EventArgs e)
+ {
+ OpenFileDialog dlg = new OpenFileDialog();
+
+ if (dlg.ShowDialog() != DialogResult.OK) return;
+
+ /// Import a procedure from a file
+ int tabId = TransitionSequences.Count + VirtualBenchSequences.Count;
+ TransitionSequence newSequence = TransitionSequence.Import(new StreamReader(dlg.FileName, System.Text.Encoding.UTF8));
+ newSequence.ItemNr = tabId;
+
+ /// Find an unused procedure name
+ string newName;
+ bool nameUsed;
+ for (int nameId = 1; true; nameId++)
+ {
+ newName = string.Format("{0} imported{1}", newSequence.Name, (nameId == 1) ? string.Empty : string.Format("({0})", nameId));
+ nameUsed = false;
+ foreach (var seq in TransitionSequences) if (seq.Name.Equals(newName)) nameUsed = true;
+ if (!nameUsed) break;
+ }
+ newSequence.Name = newName;
+
+ TransitionSequences.Add(newSequence);
+ AddTransitionSeqTab(newSequence);
+ seqStepsCtrls[tabId].Unlock();
+ tabControl.SelectTab(tabId);
+ }
+
+ private void compareButton_Click(object sender, EventArgs e)
+ {
+ MessageBox.Show("Comparing sequences in not implemented yet");
+ }
+ }
+}
diff --git a/TBF/UI/Bench/Conditions/ConditionsDlg.resx b/TBF/UI/Bench/Conditions/ConditionsDlg.resx
new file mode 100644
index 000000000..5d731e4b3
--- /dev/null
+++ b/TBF/UI/Bench/Conditions/ConditionsDlg.resx
@@ -0,0 +1,246 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+
+ Fill
+
+
+
+ True
+
+
+
+ 0, 0
+
+
+ Fill
+
+
+ 58, 30
+
+
+ 0, 0
+
+
+ 760, 366
+
+
+ 1
+
+
+ tabControl
+
+
+ System.Windows.Forms.TabControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ mainSplitContainer.Panel1
+
+
+ 0
+
+
+ mainSplitContainer.Panel1
+
+
+ System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ mainSplitContainer
+
+
+ 0
+
+
+ -1, 0
+
+
+ 100, 636
+
+
+ 0
+
+
+ sharedButtons
+
+
+ TBF.UiControls.SharedButtons, TBF, Version=2.18.1313.0, Culture=neutral, PublicKeyToken=null
+
+
+ mainSplitContainer.Panel2
+
+
+ 0
+
+
+ mainSplitContainer.Panel2
+
+
+ System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ mainSplitContainer
+
+
+ 1
+
+
+ 863, 366
+
+
+ 760
+
+
+ 1
+
+
+ mainSplitContainer
+
+
+ System.Windows.Forms.SplitContainer, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ $this
+
+
+ 0
+
+
+ True
+
+
+ 6, 13
+
+
+ 863, 366
+
+
+ CenterParent
+
+
+ Conditions
+
+
+ ConditionsDlg
+
+
+ System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/TBF/UI/Bench/Uncertainties/UncertaintiesDlg.cs b/TBF/UI/Bench/Uncertainties/UncertaintiesDlg.cs
new file mode 100644
index 000000000..a4753b658
--- /dev/null
+++ b/TBF/UI/Bench/Uncertainties/UncertaintiesDlg.cs
@@ -0,0 +1,320 @@
+///
+/// Copyright (c) 2019 Sensus Slovensko a.s.
+///
+using System;
+using System.Collections.Generic;
+using System.Windows.Forms;
+using NHibernate;
+using log4net;
+using Config.Entities;
+using TBF.BenchControl;
+using TBF.Resources;
+using TBF.UI.Shared;
+using TBF.UI.Bench.Metrology; /// TODO: Remove
+
+namespace TBF.UI.Bench.Uncertainties
+{
+ public partial class UncertaintiesDlg : Form, IParentOfListViewEx
+ {
+ static readonly ILog log = LogManager.GetLogger(typeof(UncertaintiesDlg));
+
+ public IList cmpntEntities;
+
+ ISession session;
+
+ public UncertaintiesDlg()
+ {
+ InitializeComponent();
+
+ /// SharedDlgButtons configuration
+#if KEMPNO_50
+ sharedButtons.RequiredGroupMembership = new Users.Grp.GID[] { Users.Grp.GID.MetrologicalAuthority };
+#else
+ sharedButtons.RequiredGroupMembership = new Users.Grp.GID[] { Users.Grp.GID.Metrologists };
+#endif
+ sharedButtons.OptionalButtons = SharedButtons.Buttons.Add | SharedButtons.Buttons.Remove;
+ sharedButtons.Unlocked += unlockButton_Click;
+ sharedButtons.OKClicked += okButton_Click;
+ sharedButtons.CancelClicked += cancelButton_Click;
+ sharedButtons.AddClicked += addButton_Click;
+ sharedButtons.RemoveClicked += removeButton_Click;
+ }
+
+ private void MetrologyDlg_Load(object sender, EventArgs e)
+ {
+ LoadUISettings();
+
+ Text = Strings.Uncertainty;
+
+ int fixedCount = 0;
+ int balancesCount = 0;
+ int levelMetersCount = 0;
+ int divertersCount = 0;
+ int flowMetersCount = 0;
+ int pressMetersCount = 0;
+ int tempMetersCount = 0;
+ int platinumTempMetersCount = 0;
+ int evaporationsCount = 0;
+
+ session = Config.FluentCommon.CreateSession(Users.Entities.DBKind.Config);
+ cmpntEntities = session.QueryOver()
+ .OrderBy(x => x. ItemNr).Asc
+ .List();
+
+ // Density tab-page
+ fixedCount++;
+ TabPage dstyTabPage = new TabPage(" " + Strings.Density + " ");
+ MetrologyDlgDensityTab uiCtl = new MetrologyDlgDensityTab();
+ uiCtl.Dock = DockStyle.Fill;
+ dstyTabPage.Tag = uiCtl;
+ dstyTabPage.Controls.Add(uiCtl);
+ metrologyTabControl.TabPages.Add(dstyTabPage);
+
+ foreach (var cmpnt in cmpntEntities)
+ {
+ BenchControl.Generic.IComponentFactory factory = TbfComponents.CmpntFactoryFromClassName(cmpnt.ClassName);
+
+ /// Tab-pages for scales
+ if (factory is BenchControl.MettlerToledo.Standard.BalanceFactory ||
+ factory is BenchControl.MettlerToledo.Standard.BalanceOldFactory ||
+ factory is BenchControl.MettlerToledo.Standard.BalanceNewFactory ||
+ factory is BenchControl.MettlerToledo.Multi.BalanceFactory)
+ {
+ balancesCount++;
+ TabPage tabPage = new TabPage(" " + cmpnt.Name + " ");
+ MetrologyDlgBalanceTab uiControl = new MetrologyDlgBalanceTab();
+ uiControl.MeterEntity = cmpnt;
+ uiControl.BalanceCfg = factory.CmpntCfgFromCmpntEntity(cmpnt) as BenchControl.GenericDevices.IScaleCfg;
+ uiControl.Dock = DockStyle.Fill;
+ tabPage.Tag = uiControl;
+ tabPage.Controls.Add(uiControl);
+ metrologyTabControl.TabPages.Add(tabPage);
+ }
+
+ /// Tab-pages for flowmeters
+ if (factory is BenchControl.Elde.FlowMeter.FlowMeterFactory)
+ {
+ BenchControl.Elde.FlowMeter.FlowMeterCfg flowMeterCfg = factory.CmpntCfgFromCmpntEntity(cmpnt) as BenchControl.Elde.FlowMeter.FlowMeterCfg;
+
+ for (int r = 0; r <= 5; r++)
+ {
+ if (flowMeterCfg.RangeEnabled(r))
+ {
+ flowMetersCount++;
+ TabPage tabPage = new TabPage(string.Format(((r == 0) ? " {0} " : " {0} r{1} "), cmpnt.Name, r));
+ MetrologyDlgFlowMeterTab uiControl = new MetrologyDlgFlowMeterTab(r);
+ uiControl.MeterEntity = cmpnt;
+ uiControl.CalibInfoCfg = factory.CmpntCfgFromCmpntEntity(cmpnt) as BenchControl.GenericDevices.ICalibRangesCfg;
+ uiControl.Dock = DockStyle.Fill;
+ tabPage.Tag = uiControl;
+ tabPage.Controls.Add(uiControl);
+ metrologyTabControl.TabPages.Add(tabPage);
+ }
+ }
+ }
+
+ /// Tab-pages for pressure meters
+ if (factory is BenchControl.Elde.PressureMeter.PressureMeterFactory ||
+ factory is BenchControl.Elde.PressureMeterInternal.PressureMeterFactory ||
+ factory is BenchControl.Modbus.PressureMeter.Meret.Factory)
+ {
+ pressMetersCount++;
+ TabPage tabPage = new TabPage(" " + cmpnt.Name + " ");
+ MetrologyDlgPressMeterTab uiControl = new MetrologyDlgPressMeterTab();
+ uiControl.MeterEntity = cmpnt;
+ uiControl.Dock = DockStyle.Fill;
+ tabPage.Tag = uiControl;
+ tabPage.Controls.Add(uiControl);
+ metrologyTabControl.TabPages.Add(tabPage);
+ }
+
+ /// Tab-pages for temperature meters
+ if (factory is BenchControl.Elde.TempMeter.TempMeterFactory ||
+ factory is BenchControl.Elde.TempMeterInternal.TempMeterFactory)
+ {
+ tempMetersCount++;
+ TabPage tabPage = new TabPage(" " + cmpnt.Name + " ");
+ MetrologyDlgTempMeterTab uiControl = new MetrologyDlgTempMeterTab();
+ uiControl.MeterEntity = cmpnt;
+ uiControl.Dock = DockStyle.Fill;
+ tabPage.Tag = uiControl;
+ tabPage.Controls.Add(uiControl);
+ metrologyTabControl.TabPages.Add(tabPage);
+ }
+
+ /// Tab-pages for platinum resistance temperature meters
+ if (factory is BenchControl.Keithley.TempMeter.Factory)
+ {
+ platinumTempMetersCount++;
+ TabPage tabPage = new TabPage(" " + cmpnt.Name + " ");
+ MetrologyDlgPlatinumResistanceTMeterTab uiControl = new MetrologyDlgPlatinumResistanceTMeterTab();
+ uiControl.MeterEntity = cmpnt;
+ uiControl.TempMeterCfg = factory.CmpntCfgFromCmpntEntity(cmpnt) as BenchControl.Keithley.TempMeter.TempMeterCfg;
+ uiControl.Dock = DockStyle.Fill;
+ tabPage.Tag = uiControl;
+ tabPage.Controls.Add(uiControl);
+ metrologyTabControl.TabPages.Add(tabPage);
+ }
+
+ /// Tab-pages for diverters
+ if (factory is BenchControl.Elde.Diverter.DiverterFactory)
+ {
+ divertersCount++;
+ TabPage tabPage = new TabPage(" " + cmpnt.Name + " ");
+ MetrologyDlgDiverterTab uiControl = new MetrologyDlgDiverterTab();
+ uiControl.MeterEntity = cmpnt;
+ uiControl.CalibInfoCfg = factory.CmpntCfgFromCmpntEntity(cmpnt) as BenchControl.GenericDevices.ICalibInfoCfg;
+ uiControl.Dock = DockStyle.Fill;
+ tabPage.Tag = uiControl;
+ tabPage.Controls.Add(uiControl);
+ metrologyTabControl.TabPages.Add(tabPage);
+ }
+
+ /// Tab-pages for level meters inside water tanks
+ if (factory is BenchControl.Hart.Nivotrack.Factory)
+ {
+ levelMetersCount++;
+ TabPage tabPage = new TabPage(" " + cmpnt.Name + " ");
+ MetrologyDlgLevelMeterTab uiControl = new MetrologyDlgLevelMeterTab();
+ uiControl.MeterEntity = cmpnt;
+ uiControl.CalibInfoCfg = factory.CmpntCfgFromCmpntEntity(cmpnt) as BenchControl.GenericDevices.ICalibInfoCfg;
+ uiControl.Dock = DockStyle.Fill;
+ tabPage.Tag = uiControl;
+ tabPage.Controls.Add(uiControl);
+ metrologyTabControl.TabPages.Add(tabPage);
+ }
+
+ /// Tab-pages for water tank evaporation rates
+ if (factory is BenchControl.Various.Evaporation.Factory)
+ {
+ evaporationsCount++;
+ TabPage tabPage = new TabPage(" " + cmpnt.Name + " ");
+ MetrologyDlgEvaporationTab uiControl = new MetrologyDlgEvaporationTab();
+ uiControl.MeterEntity = cmpnt;
+ uiControl.CalibInfoCfg = factory.CmpntCfgFromCmpntEntity(cmpnt) as BenchControl.GenericDevices.ICalibInfoCfg;
+ uiControl.Dock = DockStyle.Fill;
+ tabPage.Tag = uiControl;
+ tabPage.Controls.Add(uiControl);
+ metrologyTabControl.TabPages.Add(tabPage);
+ }
+ }
+ }
+
+ private void unlockButton_Click(object sender, EventArgs e)
+ {
+ foreach (TabPage tabPage in metrologyTabControl.TabPages)
+ {
+ (tabPage.Tag as IMetrologyDlgTab).Unlock();
+ }
+ }
+
+ private void okButton_Click(object sender, EventArgs e)
+ {
+ using (ITransaction transaction = session.BeginTransaction())
+ {
+ try
+ {
+ foreach (TabPage tabPage in metrologyTabControl.TabPages)
+ {
+ IMetrologyDlgTab tab = tabPage.Tag as IMetrologyDlgTab;
+ tab.OkBtnClicked();
+
+ if (!(tabPage.Tag is MetrologyDlgDensityTab))
+ {
+ session.SaveOrUpdate(tab.MeterEntity);
+ foreach (var entity in tab.ToBeRemoved) session.Delete(entity);
+ }
+ }
+ transaction.Commit();
+ session.Flush();
+ }
+ catch (Exception exc)
+ {
+ transaction.Rollback();
+ log.ErrorFormat("Cannot save changes to DB: {0}", exc.Message);
+ MessageBox.Show(Strings.Cannot_save_changes, Strings.Error, MessageBoxButtons.OK, MessageBoxIcon.Exclamation);
+ }
+ }
+
+ SaveUISettings();
+ DialogResult = DialogResult.OK;
+ Close();
+ }
+
+ private void cancelButton_Click(object sender, EventArgs e)
+ {
+ foreach (TabPage tabPage in metrologyTabControl.TabPages)
+ {
+ (tabPage.Tag as IMetrologyDlgTab).CancelBtnClicked();
+ }
+
+ SaveUISettings();
+ DialogResult = DialogResult.Cancel;
+ Close();
+ }
+
+ private void SaveUISettings()
+ {
+ /// Obtain UncertaintyDlg dimensions, etc.
+ bool isMaximized = (WindowState == FormWindowState.Maximized);
+ int left = (WindowState == FormWindowState.Normal) ? Location.X : RestoreBounds.Left;
+ int top = (WindowState == FormWindowState.Normal) ? Location.Y : RestoreBounds.Top;
+ int width = (WindowState == FormWindowState.Normal) ? Size.Width : RestoreBounds.Width;
+ int height = (WindowState == FormWindowState.Normal) ? Size.Height : RestoreBounds.Height;
+
+ LocalSettings ls = Program.LocalSettings;
+
+ if (ls != null && (ls.UncertaintyDlgMaximized != isMaximized ||
+ ls.UncertaintyDlgLeft != left ||
+ ls.UncertaintyDlgTop != top ||
+ ls.UncertaintyDlgWidth != width ||
+ ls.UncertaintyDlgHeight != height))
+ {
+ /// At least one UncertaintyDlg dimension differs => Update local settings and save them
+ ls.UncertaintyDlgMaximized = isMaximized;
+ ls.UncertaintyDlgLeft = left;
+ ls.UncertaintyDlgTop = top;
+ ls.UncertaintyDlgWidth = width;
+ ls.UncertaintyDlgHeight = height;
+ ls.Save();
+ }
+ }
+
+ private void LoadUISettings()
+ {
+ TBF.LocalSettings ls = Program.LocalSettings;
+ WindowState = (ls.UncertaintyDlgMaximized ? FormWindowState.Maximized : FormWindowState.Normal);
+ Width = (ls.UncertaintyDlgWidth > 0) ? ls.UncertaintyDlgWidth : 900;
+ Height = (ls.UncertaintyDlgHeight > 0) ? ls.UncertaintyDlgHeight : 500;
+ Left = (ls.UncertaintyDlgLeft != 0) ? ls.UncertaintyDlgLeft : 200;
+ Top = (ls.UncertaintyDlgTop != 0) ? ls.UncertaintyDlgTop : 100;
+ }
+
+ private void addButton_Click(object sender, EventArgs e)
+ {
+ (metrologyTabControl.SelectedTab.Tag as IMetrologyDlgTab).AddOne();
+ }
+
+ private void removeButton_Click(object sender, EventArgs e)
+ {
+ (metrologyTabControl.SelectedTab.Tag as IMetrologyDlgTab).RemoveSelected();
+ }
+
+ public void UpdateButtonStates(SharedButtons.SelectedItemPos selectedItemPos)
+ {
+ if (selectedItemPos == SharedButtons.SelectedItemPos.None)
+ {
+ sharedButtons.DisableButtons(SharedButtons.Buttons.Remove);
+ }
+ else
+ {
+ sharedButtons.EnableButtons(SharedButtons.Buttons.Remove);
+ }
+ }
+
+ private void metrologyTabControl_SelectedIndexChanged(object sender, EventArgs e)
+ {
+ sharedButtons.DisableButtons(SharedButtons.Buttons.Remove);
+ }
+ }
+}
diff --git a/TBF/UI/Bench/Uncertainties/UncertaintiesDlg.designer.cs b/TBF/UI/Bench/Uncertainties/UncertaintiesDlg.designer.cs
new file mode 100644
index 000000000..1e79fc24b
--- /dev/null
+++ b/TBF/UI/Bench/Uncertainties/UncertaintiesDlg.designer.cs
@@ -0,0 +1,103 @@
+///
+/// Copyright (c) 2019 Sensus Slovensko a.s.
+///
+namespace TBF.UI.Bench.Uncertainties
+{
+ partial class UncertaintiesDlg
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.splitContainer = new System.Windows.Forms.SplitContainer();
+ this.metrologyTabControl = new System.Windows.Forms.TabControl();
+ this.sharedButtons = new TBF.UI.Shared.SharedButtons();
+ ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).BeginInit();
+ this.splitContainer.Panel1.SuspendLayout();
+ this.splitContainer.Panel2.SuspendLayout();
+ this.splitContainer.SuspendLayout();
+ this.SuspendLayout();
+ //
+ // splitContainer
+ //
+ this.splitContainer.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.splitContainer.FixedPanel = System.Windows.Forms.FixedPanel.Panel2;
+ this.splitContainer.Location = new System.Drawing.Point(0, 0);
+ this.splitContainer.Name = "splitContainer";
+ //
+ // splitContainer.Panel1
+ //
+ this.splitContainer.Panel1.Controls.Add(this.metrologyTabControl);
+ //
+ // splitContainer.Panel2
+ //
+ this.splitContainer.Panel2.Controls.Add(this.sharedButtons);
+ this.splitContainer.Size = new System.Drawing.Size(965, 344);
+ this.splitContainer.SplitterDistance = 863;
+ this.splitContainer.TabIndex = 0;
+ //
+ // metrologyTabControl
+ //
+ this.metrologyTabControl.Dock = System.Windows.Forms.DockStyle.Fill;
+ this.metrologyTabControl.ItemSize = new System.Drawing.Size(60, 30);
+ this.metrologyTabControl.Location = new System.Drawing.Point(0, 0);
+ this.metrologyTabControl.Name = "metrologyTabControl";
+ this.metrologyTabControl.SelectedIndex = 0;
+ this.metrologyTabControl.Size = new System.Drawing.Size(863, 344);
+ this.metrologyTabControl.TabIndex = 0;
+ this.metrologyTabControl.SelectedIndexChanged += new System.EventHandler(this.metrologyTabControl_SelectedIndexChanged);
+ //
+ // sharedButtons
+ //
+ this.sharedButtons.Location = new System.Drawing.Point(-2, 0);
+ this.sharedButtons.Name = "sharedButtons";
+ this.sharedButtons.Size = new System.Drawing.Size(100, 400);
+ this.sharedButtons.TabIndex = 0;
+ //
+ // UncertaintyDlg
+ //
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.ClientSize = new System.Drawing.Size(965, 344);
+ this.Controls.Add(this.splitContainer);
+ this.Name = "UncertaintyDlg";
+ this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent;
+ this.Text = "Uncertainty";
+ this.Load += new System.EventHandler(this.MetrologyDlg_Load);
+ this.splitContainer.Panel1.ResumeLayout(false);
+ this.splitContainer.Panel2.ResumeLayout(false);
+ ((System.ComponentModel.ISupportInitialize)(this.splitContainer)).EndInit();
+ this.splitContainer.ResumeLayout(false);
+ this.ResumeLayout(false);
+
+ }
+
+ #endregion
+
+ private System.Windows.Forms.SplitContainer splitContainer;
+ private System.Windows.Forms.TabControl metrologyTabControl;
+ private TBF.UI.Shared.SharedButtons sharedButtons;
+ }
+}
\ No newline at end of file
diff --git a/TBF/UI/Bench/Uncertainties/UncertaintiesDlg.resx b/TBF/UI/Bench/Uncertainties/UncertaintiesDlg.resx
new file mode 100644
index 000000000..1af7de150
--- /dev/null
+++ b/TBF/UI/Bench/Uncertainties/UncertaintiesDlg.resx
@@ -0,0 +1,120 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
\ No newline at end of file
diff --git a/TBF/UI/MainWnd.Designer.cs b/TBF/UI/MainWnd.Designer.cs
index 399f561af..4c0861251 100644
--- a/TBF/UI/MainWnd.Designer.cs
+++ b/TBF/UI/MainWnd.Designer.cs
@@ -79,6 +79,8 @@ namespace TBF.UI
this.benchPathsTSMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.benchTransitionsToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.benchMetrologyTSMenuItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.benchConditionsTSMItem = new System.Windows.Forms.ToolStripMenuItem();
+ this.benchUncertaintyTSMItem = new System.Windows.Forms.ToolStripMenuItem();
this.toolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator();
this.exitToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.homeTSMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@@ -136,6 +138,7 @@ namespace TBF.UI
((System.ComponentModel.ISupportInitialize)(this.rightHorizSplitContainer)).BeginInit();
this.rightHorizSplitContainer.Panel1.SuspendLayout();
this.rightHorizSplitContainer.SuspendLayout();
+ this.measurementTabPage.SuspendLayout();
this.statusStrip1.SuspendLayout();
this.mainMenuStrip.SuspendLayout();
this.SuspendLayout();
@@ -382,11 +385,6 @@ namespace TBF.UI
this.progressFlowLayoutPanel.BackColor = System.Drawing.SystemColors.Control;
this.progressFlowLayoutPanel.Name = "progressFlowLayoutPanel";
//
- // measurementTabPage
- //
- resources.ApplyResources(this.measurementTabPage, "measurementTabPage");
- this.measurementTabPage.Name = "measurementTabPage";
- //
// statusStrip1
//
this.statusStrip1.Items.AddRange(new System.Windows.Forms.ToolStripItem[] {
@@ -425,6 +423,8 @@ namespace TBF.UI
this.benchPathsTSMenuItem,
this.benchTransitionsToolStripMenuItem,
this.benchMetrologyTSMenuItem,
+ this.benchConditionsTSMItem,
+ this.benchUncertaintyTSMItem,
this.toolStripSeparator1,
this.exitToolStripMenuItem});
this.benchTSMenuItem.Name = "benchTSMenuItem";
@@ -454,6 +454,18 @@ namespace TBF.UI
resources.ApplyResources(this.benchMetrologyTSMenuItem, "benchMetrologyTSMenuItem");
this.benchMetrologyTSMenuItem.Click += new System.EventHandler(this.benchMetrologyTSMItem_Click);
//
+ // benchConditionsTSMItem
+ //
+ this.benchConditionsTSMItem.Name = "benchConditionsTSMItem";
+ resources.ApplyResources(this.benchConditionsTSMItem, "benchConditionsTSMItem");
+ this.benchConditionsTSMItem.Click += new System.EventHandler(this.benchConditionsTSMItem_Click);
+ //
+ // benchUncertaintyTSMItem
+ //
+ this.benchUncertaintyTSMItem.Name = "benchUncertaintyTSMItem";
+ resources.ApplyResources(this.benchUncertaintyTSMItem, "benchUncertaintyTSMItem");
+ this.benchUncertaintyTSMItem.Click += new System.EventHandler(this.benchUncertaintyTSMItem_Click);
+ //
// toolStripSeparator1
//
this.toolStripSeparator1.Name = "toolStripSeparator1";
@@ -660,6 +672,7 @@ namespace TBF.UI
this.rightHorizSplitContainer.Panel1.ResumeLayout(false);
((System.ComponentModel.ISupportInitialize)(this.rightHorizSplitContainer)).EndInit();
this.rightHorizSplitContainer.ResumeLayout(false);
+ this.measurementTabPage.ResumeLayout(false);
this.statusStrip1.ResumeLayout(false);
this.statusStrip1.PerformLayout();
this.mainMenuStrip.ResumeLayout(false);
@@ -760,6 +773,8 @@ namespace TBF.UI
private System.Windows.Forms.ToolStripMenuItem backUpTSMItem;
private System.Windows.Forms.ToolStripMenuItem backUpConfigTSMItem;
private System.Windows.Forms.ToolStripMenuItem backUpResultsTSMItem;
+ private System.Windows.Forms.ToolStripMenuItem benchConditionsTSMItem;
+ private System.Windows.Forms.ToolStripMenuItem benchUncertaintyTSMItem;
}
}
diff --git a/TBF/UI/MainWnd.cs b/TBF/UI/MainWnd.cs
index c69ec120c..ba47b1449 100644
--- a/TBF/UI/MainWnd.cs
+++ b/TBF/UI/MainWnd.cs
@@ -474,6 +474,8 @@ namespace TBF.UI
private void benchPathsTSMItem_Click(object s, EventArgs e) { Cursor = Cursors.WaitCursor; new TBF.UI.Bench.Paths.PathsDlg().ShowDialog(); Cursor = Cursors.Default; }
private void benchTransitionsTSMItem_Click(object s, EventArgs e) { Cursor = Cursors.WaitCursor; new TBF.UI.Bench.Transitions.TransitionsDlg().ShowDialog(); Cursor = Cursors.Default; }
private void benchMetrologyTSMItem_Click(object s, EventArgs e) { Cursor = Cursors.WaitCursor; new TBF.UI.Bench.Metrology.MetrologyDlg().ShowDialog(); Cursor = Cursors.Default; }
+ private void benchConditionsTSMItem_Click(object s, EventArgs e) { Cursor = Cursors.WaitCursor; new TBF.UI.Bench.Conditions.ConditionsDlg().ShowDialog(); Cursor = Cursors.Default; }
+ private void benchUncertaintyTSMItem_Click(object s, EventArgs e) { Cursor = Cursors.WaitCursor; new TBF.UI.Bench.Uncertainties.UncertaintiesDlg().ShowDialog(); Cursor = Cursors.Default; }
private void proceduresTSMItem_Click(object s, EventArgs e) { Cursor = Cursors.WaitCursor; new TBF.UI.Procedures.ProceduresDlg().ShowDialog(); Cursor = Cursors.Default; }
private void usersTSMItem_Click(object s, EventArgs e)
diff --git a/TBF/UI/MainWnd.resx b/TBF/UI/MainWnd.resx
index 418cbda98..6ba481a2a 100644
--- a/TBF/UI/MainWnd.resx
+++ b/TBF/UI/MainWnd.resx
@@ -125,25 +125,6 @@
0, 0
-
-
- True
-
-
- Verdana, 15.75pt
-
-
- NoControl
-
-
- 6, 68
-
-
- 0, 25
-
-
- 1
-
messageLabel
@@ -156,24 +137,6 @@
0
-
- True
-
-
- Verdana, 15.75pt
-
-
- NoControl
-
-
- 6, 28
-
-
- 0, 25
-
-
- 0
-
activityLabel
@@ -198,6 +161,7 @@
335, 115
+
18
@@ -252,27 +216,6 @@
0, 0
-
- Fill
-
-
- False
-
-
- Verdana, 15.75pt
-
-
- 13, 23
-
-
- 23, 3, 3, 3
-
-
- 389, 33
-
-
- 6
-
procedureComboBox
@@ -330,18 +273,6 @@
0
-
- NoControl
-
-
- 6, 23
-
-
- 237, 33
-
-
- 0
-
mainProgressBar
@@ -429,21 +360,6 @@
0
-
- True
-
-
- NoControl
-
-
- 8, 15
-
-
- 0, 13
-
-
- 0
-
descriptionLabel
@@ -549,6 +465,150 @@
0
+
+ True
+
+
+ Verdana, 15.75pt
+
+
+ NoControl
+
+
+ 6, 68
+
+
+ 0, 25
+
+
+ 1
+
+
+ messageLabel
+
+
+ System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ activityGroupBox
+
+
+ 0
+
+
+ True
+
+
+ Verdana, 15.75pt
+
+
+ NoControl
+
+
+ 6, 28
+
+
+ 0, 25
+
+
+ 0
+
+
+ activityLabel
+
+
+ System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ activityGroupBox
+
+
+ 1
+
+
+ Fill
+
+
+ False
+
+
+ Verdana, 15.75pt
+
+
+ 13, 23
+
+
+ 23, 3, 3, 3
+
+
+ 389, 33
+
+
+ 6
+
+
+ procedureComboBox
+
+
+ System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ procedureGroupBox
+
+
+ 0
+
+
+ NoControl
+
+
+ 6, 23
+
+
+ 237, 33
+
+
+ 0
+
+
+ mainProgressBar
+
+
+ System.Windows.Forms.ProgressBar, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ progressGroupBox
+
+
+ 0
+
+
+ True
+
+
+ NoControl
+
+
+ 8, 15
+
+
+ 0, 13
+
+
+ 0
+
+
+ descriptionLabel
+
+
+ System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ descriptionGroupBox
+
+
+ 0
+
Fill
@@ -582,42 +642,6 @@
0
-
- Fill
-
-
- 0, 0
-
-
- 1012, 523
-
-
- 1
-
-
- ctrlBrdComponent
-
-
- ControlComponent3Munich.UserControl1, ControlComponent3Munich, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
-
-
- homeTabPage
-
-
- 0
-
-
- 4, 5
-
-
- 1012, 523
-
-
- 29
-
-
- Hydraulics
-
homeTabPage
@@ -630,48 +654,6 @@
0
-
- Fill
-
-
- Microsoft Sans Serif, 8.25pt
-
-
- 0, 0
-
-
- 4, 4, 4, 4
-
-
- 1012, 523
-
-
- 1
-
-
- processTabPageCtrl
-
-
- TBF.UI.Process.ProcessTabPageCtrl6, TBF, Version=2.18.1313.0, Culture=neutral, PublicKeyToken=null
-
-
- processTabPage
-
-
- 0
-
-
- 4, 5
-
-
- 1012, 523
-
-
- 30
-
-
- Process
-
processTabPage
@@ -684,18 +666,6 @@
1
-
- 4, 5
-
-
- 1012, 523
-
-
- 22
-
-
- Insert
-
insertTabPage
@@ -708,48 +678,6 @@
2
-
- Fill
-
-
- Microsoft Sans Serif, 8.25pt
-
-
- 0, 0
-
-
- 4, 4, 4, 4
-
-
- 1012, 523
-
-
- 0
-
-
- resultsTabPageCtrl
-
-
- TBF.UI.Results.ResultsTabPageCtrl, TBF, Version=2.18.1313.0, Culture=neutral, PublicKeyToken=null
-
-
- resultsTabPage
-
-
- 0
-
-
- 4, 5
-
-
- 1012, 523
-
-
- 15
-
-
- Results
-
resultsTabPage
@@ -762,45 +690,6 @@
3
-
- Fill
-
-
- Microsoft Sans Serif, 8.25pt
-
-
- 0, 0
-
-
- 1012, 523
-
-
- 0
-
-
- graphsTabPageCtrl
-
-
- TBF.UI.Graphs.GraphsTabPageCtrl, TBF, Version=2.18.1313.0, Culture=neutral, PublicKeyToken=null
-
-
- graphsTabPage
-
-
- 0
-
-
- 4, 5
-
-
- 1012, 523
-
-
- 32
-
-
- Graphs
-
graphsTabPage
@@ -813,48 +702,6 @@
4
-
- Fill
-
-
- Microsoft Sans Serif, 8.25pt
-
-
- 0, 0
-
-
- 4, 4, 4, 4
-
-
- 1012, 523
-
-
- 0
-
-
- logsTabPageCtrl
-
-
- TBF.UI.Logs.LogsTabPageCtrl, TBF, Version=2.18.1313.0, Culture=neutral, PublicKeyToken=null
-
-
- logsTabPage
-
-
- 0
-
-
- 4, 5
-
-
- 1012, 523
-
-
- 21
-
-
- Logs
-
logsTabPage
@@ -867,45 +714,6 @@
5
-
- Fill
-
-
- Microsoft Sans Serif, 8.25pt
-
-
- 0, 0
-
-
- 1012, 523
-
-
- 0
-
-
- picturesTabPageCtrl
-
-
- TBF.UI.Camera.PicturesTabPageCtrl, TBF, Version=2.18.1313.0, Culture=neutral, PublicKeyToken=null
-
-
- picturesTabPage
-
-
- 0
-
-
- 4, 5
-
-
- 1012, 523
-
-
- 31
-
-
- Pictures
-
picturesTabPage
@@ -1110,14 +918,437 @@
0
-
+
+ ctrlBrdComponent
+
+
+ ControlComponent_Torino2015.UserControl1, ControlComponent3U, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
+
+
+ homeTabPage
+
+
+ 0
+
+
+ 4, 5
+
+
+ 1012, 523
+
+
+ 29
+
+
+ Hydraulics
+
+
+ homeTabPage
+
+
+ System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ mainTabControl
+
+
+ 0
+
+
+ Fill
+
+
0, 0
+
+ 1012, 523
+
+
+ 1
+
+
+ ctrlBrdComponent
+
+
+ ControlComponent_Torino2015.UserControl1, ControlComponent3U, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null
+
+
+ homeTabPage
+
+
+ 0
+
+
+ processTabPageCtrl
+
+
+ TBF.Screens.ProcessTabPageCtrl6, TBF, Version=2.23.1314.0, Culture=neutral, PublicKeyToken=null
+
+
+ processTabPage
+
+
+ 0
+
+
+ 4, 5
+
+
+ 1012, 523
+
+
+ 30
+
+
+ Process
+
+
+ processTabPage
+
+
+ System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ mainTabControl
+
+
+ 1
+
+
+ Fill
+
+
+ Microsoft Sans Serif, 8.25pt
+
+
+ 0, 0
+
+
+ 4, 4, 4, 4
+
+
+ 1012, 523
+
+
+ 1
+
+
+ processTabPageCtrl
+
+
+ TBF.Screens.ProcessTabPageCtrl6, TBF, Version=2.23.1314.0, Culture=neutral, PublicKeyToken=null
+
+
+ processTabPage
+
+
+ 0
+
+
+ 4, 5
+
+
+ 1012, 523
+
+
+ 22
+
+
+ Insert
+
+
+ insertTabPage
+
+
+ System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ mainTabControl
+
+
+ 2
+
+
+ resultsTabPageCtrl
+
+
+ TBF.Screens.ResultsTabPageCtrl, TBF, Version=2.23.1314.0, Culture=neutral, PublicKeyToken=null
+
+
+ resultsTabPage
+
+
+ 0
+
+
+ 4, 5
+
+
+ 1012, 523
+
+
+ 15
+
+
+ Results
+
+
+ resultsTabPage
+
+
+ System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ mainTabControl
+
+
+ 3
+
+
+ Fill
+
+
+ Microsoft Sans Serif, 8.25pt
+
+
+ 0, 0
+
+
+ 4, 4, 4, 4
+
+
+ 1012, 523
+
+
+ 0
+
+
+ resultsTabPageCtrl
+
+
+ TBF.Screens.ResultsTabPageCtrl, TBF, Version=2.23.1314.0, Culture=neutral, PublicKeyToken=null
+
+
+ resultsTabPage
+
+
+ 0
+
+
+ graphsTabPageCtrl
+
+
+ TBF.Screens.GraphsTabPageCtrl, TBF, Version=2.23.1314.0, Culture=neutral, PublicKeyToken=null
+
+
+ graphsTabPage
+
+
+ 0
+
+
+ 4, 5
+
+
+ 1012, 523
+
+
+ 32
+
+
+ Graphs
+
+
+ graphsTabPage
+
+
+ System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ mainTabControl
+
+
+ 4
+
+
+ Fill
+
+
+ Microsoft Sans Serif, 8.25pt
+
+
+ 0, 0
+
+
+ 1012, 523
+
+
+ 0
+
+
+ graphsTabPageCtrl
+
+
+ TBF.Screens.GraphsTabPageCtrl, TBF, Version=2.23.1314.0, Culture=neutral, PublicKeyToken=null
+
+
+ graphsTabPage
+
+
+ 0
+
+
+ logsTabPageCtrl
+
+
+ TBF.Screens.LogsTabPageCtrl, TBF, Version=2.23.1314.0, Culture=neutral, PublicKeyToken=null
+
+
+ logsTabPage
+
+
+ 0
+
+
+ 4, 5
+
+
+ 1012, 523
+
+
+ 21
+
+
+ Logs
+
+
+ logsTabPage
+
+
+ System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ mainTabControl
+
+
+ 5
+
+
+ Fill
+
+
+ Microsoft Sans Serif, 8.25pt
+
+
+ 0, 0
+
+
+ 4, 4, 4, 4
+
+
+ 1012, 523
+
+
+ 0
+
+
+ logsTabPageCtrl
+
+
+ TBF.Screens.LogsTabPageCtrl, TBF, Version=2.23.1314.0, Culture=neutral, PublicKeyToken=null
+
+
+ logsTabPage
+
+
+ 0
+
+
+ picturesTabPageCtrl
+
+
+ TBF.Screens.PicturesTabPageCtrl, TBF, Version=2.23.1314.0, Culture=neutral, PublicKeyToken=null
+
+
+ picturesTabPage
+
+
+ 0
+
+
+ 4, 5
+
+
+ 1012, 523
+
+
+ 31
+
+
+ Pictures
+
+
+ picturesTabPage
+
+
+ System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ mainTabControl
+
+
+ 6
+
+
+ Fill
+
+
+ Microsoft Sans Serif, 8.25pt
+
+
+ 0, 0
+
+
+ 1012, 523
+
+
+ 0
+
+
+ picturesTabPageCtrl
+
+
+ TBF.Screens.PicturesTabPageCtrl, TBF, Version=2.23.1314.0, Culture=neutral, PublicKeyToken=null
+
+
+ picturesTabPage
+
+
+ 0
+
+
+ MeasurementTabPageCtrl
+
+
+ TBF.Screens.MeasurementTabPageCtrl, TBF, Version=2.23.1314.0, Culture=neutral, PublicKeyToken=null
+
+
+ measurementTabPage
+
+
+ 0
+
+
+ 4, 5
+
- 200, 100
+ 1012, 523
- 0
+ 25
+
+
+ Measurement
measurementTabPage
@@ -1125,21 +1356,39 @@
System.Windows.Forms.TabPage, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ Fill
+
+
+ Verdana, 11.25pt
+
+
+ 0, 0
+
+
+ 4, 4, 4, 4
+
+
+ 1012, 523
+
+
+ 0
+
+
+ MeasurementTabPageCtrl
+
+
+ TBF.Screens.MeasurementTabPageCtrl, TBF, Version=2.23.1314.0, Culture=neutral, PublicKeyToken=null
+
+
+ measurementTabPage
+
+
+ 0
+
152, 17
-
- 0, 17
-
-
- 0, 17
-
-
- 0, 17
-
-
- 0, 17
-
0, 680
@@ -1164,38 +1413,17 @@
1
-
- 152, 22
+
+ 0, 17
-
- Components
+
+ 0, 17
-
- 152, 22
+
+ 0, 17
-
- Paths
-
-
- 152, 22
-
-
- Transitions
-
-
- 152, 22
-
-
- Metrology
-
-
- 149, 6
-
-
- 152, 22
-
-
- Exit
+
+ 0, 17
52, 20
@@ -1203,6 +1431,51 @@
Bench
+
+ 143, 22
+
+
+ Components
+
+
+ 143, 22
+
+
+ Paths
+
+
+ 143, 22
+
+
+ Transitions
+
+
+ 143, 22
+
+
+ Metrology
+
+
+ 143, 22
+
+
+ Conditions
+
+
+ 143, 22
+
+
+ Uncertainty
+
+
+ 140, 6
+
+
+ 143, 22
+
+
+ Exit
+
52, 20
@@ -1240,13 +1513,13 @@
Profiles
- 148, 22
+ 152, 22
Configuration
- 148, 22
+ 152, 22
Test results
@@ -1287,18 +1560,18 @@
Settings
-
- 107, 22
-
-
- About
-
44, 20
Help
+
+ 107, 22
+
+
+ About
+
17, 17
@@ -1419,6 +1692,18 @@
System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+ benchConditionsTSMItem
+
+
+ System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ benchUncertaintyTSMItem
+
+
+ System.Windows.Forms.ToolStripMenuItem, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
toolStripSeparator1
diff --git a/Users/Mappings/UserMap.cs b/Users/Mappings/UserMap.cs
index 68fa1247a..5f6212406 100644
--- a/Users/Mappings/UserMap.cs
+++ b/Users/Mappings/UserMap.cs
@@ -16,6 +16,8 @@ namespace Users.Mappings
Map(x => x.Tag);
#endif
Map(x => x.Password);
+ Map(x => x.Password2);
+ Map(x => x.Password3);
Map(x => x.FullName).Column("Description");
Map(x => x.LastPwChange);
HasMany(x => x.Groups)