Conditions and Uncertainties added to Bench menu, initial versions of dialogs, Config.Entities.Ucertainty, etc.
This commit is contained in:
parent
fd6f305f95
commit
0468b5a1f5
@ -87,6 +87,7 @@
|
||||
<Compile Include="Entities\Test.cs" />
|
||||
<Compile Include="Entities\TransitionSequence.cs" />
|
||||
<Compile Include="Entities\TransitionStep.cs" />
|
||||
<Compile Include="Entities\Uncertainty.cs" />
|
||||
<Compile Include="Entities\User.cs" />
|
||||
<Compile Include="Entities\VirtualBenchSequence.cs" />
|
||||
<Compile Include="Entities\VirtualBenchStep.cs" />
|
||||
@ -108,6 +109,7 @@
|
||||
<Compile Include="Mappings\TestMap.cs" />
|
||||
<Compile Include="Mappings\TransitionSequenceMap.cs" />
|
||||
<Compile Include="Mappings\TransitionStepMap.cs" />
|
||||
<Compile Include="Mappings\UncertaintyMap.cs" />
|
||||
<Compile Include="Mappings\UserMap.cs" />
|
||||
<Compile Include="Mappings\VirtualBenchSequenceMap.cs" />
|
||||
<Compile Include="Mappings\VirtualBenchStepMap.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<MeasurementCorrection> Corrections { get; set; }
|
||||
public virtual IList<Uncertainty> 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<MeasurementCorrection>();
|
||||
Uncertainties = new List<Uncertainty>();
|
||||
}
|
||||
|
||||
public static Component CreateFromCfg(string name, string className, string parentName, int itemNr,
|
||||
|
||||
20
Config/Entities/Uncertainty.cs
Normal file
20
Config/Entities/Uncertainty.cs
Normal file
@ -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() { }
|
||||
}
|
||||
}
|
||||
@ -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();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
22
Config/Mappings/UncertaintyMap.cs
Normal file
22
Config/Mappings/UncertaintyMap.cs
Normal file
@ -0,0 +1,22 @@
|
||||
///
|
||||
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||
///
|
||||
using FluentNHibernate.Mapping;
|
||||
using Config.Entities;
|
||||
|
||||
namespace Config.Mappings
|
||||
{
|
||||
class UncertaintyMap : ClassMap<Uncertainty>
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -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)
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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<Components>(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);
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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<MeasurementCorrection> Corrections
|
||||
{
|
||||
get { return cfg.Corrections; }
|
||||
set { cfg.Corrections = value; }
|
||||
}
|
||||
|
||||
public IList<Uncertainty> 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
|
||||
|
||||
@ -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<MeasurementCorrection> corrections;
|
||||
|
||||
[XmlIgnore]
|
||||
public IList<Uncertainty> Uncertainties
|
||||
{
|
||||
get { return uncertainties; }
|
||||
set { uncertainties = value; }
|
||||
}
|
||||
IList<Uncertainty> 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;
|
||||
}
|
||||
|
||||
@ -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<Config.Entities.MeasurementCorrection> Corrections { get; set; }
|
||||
|
||||
IList<Config.Entities.Uncertainty> Uncertainties { get; set; }
|
||||
|
||||
void StartChangeHandler();
|
||||
|
||||
void StopChangeHandler();
|
||||
|
||||
@ -43,6 +43,11 @@ namespace TBF.BenchControl.Generic
|
||||
/// </summary>
|
||||
IList<Config.Entities.MeasurementCorrection> Corrections { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Measurement correction values
|
||||
/// </summary>
|
||||
IList<Config.Entities.Uncertainty> Uncertainties { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Creates a new database entity 'Component' from the parameters
|
||||
/// </summary>
|
||||
|
||||
@ -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]
|
||||
|
||||
@ -1987,6 +1987,12 @@
|
||||
<Compile Include="UI\Bench\Components\SelectComponentClassDlg.designer.cs">
|
||||
<DependentUpon>SelectComponentClassDlg.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="UI\Bench\Conditions\ConditionsDlg.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="UI\Bench\Conditions\ConditionsDlg.designer.cs">
|
||||
<DependentUpon>ConditionsDlg.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="UI\Bench\Metrology\IMetrologyDlgTab.cs" />
|
||||
<Compile Include="UI\Bench\Metrology\MetrologyDlg.cs">
|
||||
<SubType>Form</SubType>
|
||||
@ -2081,6 +2087,12 @@
|
||||
<Compile Include="UI\Bench\Transitions\VirtualBenchStepsCtrl.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="UI\Bench\Uncertainties\UncertaintiesDlg.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="UI\Bench\Uncertainties\UncertaintiesDlg.designer.cs">
|
||||
<DependentUpon>UncertaintiesDlg.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="UI\Camera\CameraPictureCtrl.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
@ -2164,36 +2176,52 @@
|
||||
<Compile Include="UI\Procedures\TestParamsCtrl.designer.cs">
|
||||
<DependentUpon>TestParamsCtrl.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="UI\Procedures\TestWizard\FlowSelection.cs" />
|
||||
<Compile Include="UI\Procedures\TestWizard\FlowSelection.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="UI\Procedures\TestWizard\FlowSelection.designer.cs">
|
||||
<DependentUpon>FlowSelection.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="UI\Procedures\TestWizard\HeatMetersSelection.cs" />
|
||||
<Compile Include="UI\Procedures\TestWizard\HeatMetersSelection.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="UI\Procedures\TestWizard\HeatMetersSelection.designer.cs">
|
||||
<DependentUpon>HeatMetersSelection.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="UI\Procedures\TestWizard\MethodSelection.cs" />
|
||||
<Compile Include="UI\Procedures\TestWizard\MethodSelection.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="UI\Procedures\TestWizard\MethodSelection.designer.cs">
|
||||
<DependentUpon>MethodSelection.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="UI\Procedures\TestWizard\PressureSelection.cs" />
|
||||
<Compile Include="UI\Procedures\TestWizard\PressureSelection.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="UI\Procedures\TestWizard\PressureSelection.designer.cs">
|
||||
<DependentUpon>PressureSelection.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="UI\Procedures\TestWizard\Roi1.cs" />
|
||||
<Compile Include="UI\Procedures\TestWizard\Roi1.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="UI\Procedures\TestWizard\Roi1.designer.cs">
|
||||
<DependentUpon>Roi1.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="UI\Procedures\TestWizard\Roi2.cs" />
|
||||
<Compile Include="UI\Procedures\TestWizard\Roi2.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="UI\Procedures\TestWizard\Roi2.designer.cs">
|
||||
<DependentUpon>Roi2.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="UI\Procedures\TestWizard\Roi3.cs" />
|
||||
<Compile Include="UI\Procedures\TestWizard\Roi3.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="UI\Procedures\TestWizard\Roi3.designer.cs">
|
||||
<DependentUpon>Roi3.cs</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="UI\Procedures\TestWizard\RoiData.cs" />
|
||||
<Compile Include="UI\Procedures\TestWizard\VolumeAndErrorSelection.cs" />
|
||||
<Compile Include="UI\Procedures\TestWizard\VolumeAndErrorSelection.cs">
|
||||
<SubType>Form</SubType>
|
||||
</Compile>
|
||||
<Compile Include="UI\Procedures\TestWizard\VolumeAndErrorSelection.designer.cs">
|
||||
<DependentUpon>VolumeAndErrorSelection.cs</DependentUpon>
|
||||
</Compile>
|
||||
@ -2994,6 +3022,9 @@
|
||||
<EmbeddedResource Include="UI\Bench\Components\SelectComponentClassDlg.resx">
|
||||
<DependentUpon>SelectComponentClassDlg.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="UI\Bench\Conditions\ConditionsDlg.resx">
|
||||
<DependentUpon>ConditionsDlg.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="UI\Bench\Metrology\MetrologyDlg.resx">
|
||||
<DependentUpon>MetrologyDlg.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
@ -3030,6 +3061,9 @@
|
||||
<EmbeddedResource Include="UI\Bench\Transitions\TransitionsDlg.resx">
|
||||
<DependentUpon>TransitionsDlg.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="UI\Bench\Uncertainties\UncertaintiesDlg.resx">
|
||||
<DependentUpon>UncertaintiesDlg.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="UI\Camera\CameraPictureCtrl.resx">
|
||||
<DependentUpon>CameraPictureCtrl.cs</DependentUpon>
|
||||
</EmbeddedResource>
|
||||
|
||||
91
TBF/UI/Bench/Conditions/ConditionsDlg.Designer.cs
generated
Normal file
91
TBF/UI/Bench/Conditions/ConditionsDlg.Designer.cs
generated
Normal file
@ -0,0 +1,91 @@
|
||||
///
|
||||
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||
///
|
||||
namespace TBF.UI.Bench.Conditions
|
||||
{
|
||||
partial class ConditionsDlg
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(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;
|
||||
}
|
||||
}
|
||||
707
TBF/UI/Bench/Conditions/ConditionsDlg.cs
Normal file
707
TBF/UI/Bench/Conditions/ConditionsDlg.cs
Normal file
@ -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;
|
||||
|
||||
/// <summary>
|
||||
/// Fluent-NHibernate database session
|
||||
/// </summary>
|
||||
public ISession Session;
|
||||
|
||||
IList<Procedure> procedures;
|
||||
IList<Test> tests;
|
||||
|
||||
Dictionary<string, string> renameInfo; /// Pairs original name / new name
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Transition sequences to be updated by this dialog.
|
||||
/// Set by the constructor or updated by the parent after creation and before loading.
|
||||
/// </summary>
|
||||
public IList<TransitionSequence> TransitionSequences;
|
||||
public IList<TransitionSequence> RemovedTransitionSequences;
|
||||
|
||||
/// <summary>
|
||||
/// Virtual bench sequences to be updated by this dialog.
|
||||
/// Set by the constructor or updated by the parent after creation and before loading.
|
||||
/// </summary>
|
||||
public IList<VirtualBenchSequence> VirtualBenchSequences;
|
||||
public IList<VirtualBenchSequence> RemovedVirtualBenchSequences;
|
||||
|
||||
|
||||
/// Auxiliary public lists used also by user controls in tab pages
|
||||
public IList<BenchControl.Generic.IComponent> TbfComponents;
|
||||
public IList<IValve> Valves;
|
||||
public IList<IRegulValve> RegulValves;
|
||||
|
||||
|
||||
IList<ITabWithListViewEx> 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<ITabWithListViewEx>();
|
||||
|
||||
/// 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<IRegulValve>();
|
||||
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<TransitionSequence>().OrderBy(x => x.ItemNr).Asc.List();
|
||||
VirtualBenchSequences = Session.QueryOver<VirtualBenchSequence>().OrderBy(x => x.ItemNr).Asc.List();
|
||||
procedures = Session.QueryOver<Procedure>().List();
|
||||
tests = Session.QueryOver<Test>().List();
|
||||
|
||||
RemovedTransitionSequences = new List<TransitionSequence>();
|
||||
RemovedVirtualBenchSequences = new List<VirtualBenchSequence>();
|
||||
|
||||
/// 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<string, string> renmInfo)
|
||||
{
|
||||
string warnings = string.Empty;
|
||||
renmInfo = new Dictionary<string, string>();
|
||||
|
||||
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<Config.Entities.Test>()
|
||||
.Where(x => (x.RelTransBefore == ri.Key))
|
||||
.List();
|
||||
foreach (var t in tests)
|
||||
{
|
||||
t.RelTransBefore = ri.Value;
|
||||
Session.Update(t);
|
||||
}
|
||||
|
||||
tests = Session.QueryOver<Config.Entities.Test>()
|
||||
.Where(x => (x.TransitionAfter == ri.Key))
|
||||
.List();
|
||||
foreach (var t in tests)
|
||||
{
|
||||
t.TransitionAfter = ri.Value;
|
||||
Session.Update(t);
|
||||
}
|
||||
|
||||
var procedures = Session.QueryOver<Config.Entities.Procedure>()
|
||||
.Where(x => (x.TransitionStart == ri.Key))
|
||||
.List();
|
||||
foreach (var p in procedures)
|
||||
{
|
||||
p.TransitionStart = ri.Value;
|
||||
Session.Update(p);
|
||||
}
|
||||
|
||||
procedures = Session.QueryOver<Config.Entities.Procedure>()
|
||||
.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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Common part for three xxxListViewEx_SelectedIndexChanged event handlers
|
||||
/// </summary>
|
||||
/// <param name="listViewEx"></param>
|
||||
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");
|
||||
}
|
||||
}
|
||||
}
|
||||
246
TBF/UI/Bench/Conditions/ConditionsDlg.resx
Normal file
246
TBF/UI/Bench/Conditions/ConditionsDlg.resx
Normal file
@ -0,0 +1,246 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="mainSplitContainer.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
|
||||
<value>Fill</value>
|
||||
</data>
|
||||
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
|
||||
<data name="mainSplitContainer.IsSplitterFixed" type="System.Boolean, mscorlib">
|
||||
<value>True</value>
|
||||
</data>
|
||||
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
|
||||
<data name="mainSplitContainer.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>0, 0</value>
|
||||
</data>
|
||||
<data name="tabControl.Dock" type="System.Windows.Forms.DockStyle, System.Windows.Forms">
|
||||
<value>Fill</value>
|
||||
</data>
|
||||
<data name="tabControl.ItemSize" type="System.Drawing.Size, System.Drawing">
|
||||
<value>58, 30</value>
|
||||
</data>
|
||||
<data name="tabControl.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>0, 0</value>
|
||||
</data>
|
||||
<data name="tabControl.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>760, 366</value>
|
||||
</data>
|
||||
<data name="tabControl.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name=">>tabControl.Name" xml:space="preserve">
|
||||
<value>tabControl</value>
|
||||
</data>
|
||||
<data name=">>tabControl.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.TabControl, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>tabControl.Parent" xml:space="preserve">
|
||||
<value>mainSplitContainer.Panel1</value>
|
||||
</data>
|
||||
<data name=">>tabControl.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name=">>mainSplitContainer.Panel1.Name" xml:space="preserve">
|
||||
<value>mainSplitContainer.Panel1</value>
|
||||
</data>
|
||||
<data name=">>mainSplitContainer.Panel1.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>mainSplitContainer.Panel1.Parent" xml:space="preserve">
|
||||
<value>mainSplitContainer</value>
|
||||
</data>
|
||||
<data name=">>mainSplitContainer.Panel1.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name="sharedButtons.Location" type="System.Drawing.Point, System.Drawing">
|
||||
<value>-1, 0</value>
|
||||
</data>
|
||||
<data name="sharedButtons.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>100, 636</value>
|
||||
</data>
|
||||
<data name="sharedButtons.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name=">>sharedButtons.Name" xml:space="preserve">
|
||||
<value>sharedButtons</value>
|
||||
</data>
|
||||
<data name=">>sharedButtons.Type" xml:space="preserve">
|
||||
<value>TBF.UiControls.SharedButtons, TBF, Version=2.18.1313.0, Culture=neutral, PublicKeyToken=null</value>
|
||||
</data>
|
||||
<data name=">>sharedButtons.Parent" xml:space="preserve">
|
||||
<value>mainSplitContainer.Panel2</value>
|
||||
</data>
|
||||
<data name=">>sharedButtons.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<data name=">>mainSplitContainer.Panel2.Name" xml:space="preserve">
|
||||
<value>mainSplitContainer.Panel2</value>
|
||||
</data>
|
||||
<data name=">>mainSplitContainer.Panel2.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.SplitterPanel, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>mainSplitContainer.Panel2.Parent" xml:space="preserve">
|
||||
<value>mainSplitContainer</value>
|
||||
</data>
|
||||
<data name=">>mainSplitContainer.Panel2.ZOrder" xml:space="preserve">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name="mainSplitContainer.Size" type="System.Drawing.Size, System.Drawing">
|
||||
<value>863, 366</value>
|
||||
</data>
|
||||
<data name="mainSplitContainer.SplitterDistance" type="System.Int32, mscorlib">
|
||||
<value>760</value>
|
||||
</data>
|
||||
<data name="mainSplitContainer.TabIndex" type="System.Int32, mscorlib">
|
||||
<value>1</value>
|
||||
</data>
|
||||
<data name=">>mainSplitContainer.Name" xml:space="preserve">
|
||||
<value>mainSplitContainer</value>
|
||||
</data>
|
||||
<data name=">>mainSplitContainer.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.SplitContainer, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
<data name=">>mainSplitContainer.Parent" xml:space="preserve">
|
||||
<value>$this</value>
|
||||
</data>
|
||||
<data name=">>mainSplitContainer.ZOrder" xml:space="preserve">
|
||||
<value>0</value>
|
||||
</data>
|
||||
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
|
||||
<value>True</value>
|
||||
</metadata>
|
||||
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
|
||||
<value>6, 13</value>
|
||||
</data>
|
||||
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
|
||||
<value>863, 366</value>
|
||||
</data>
|
||||
<data name="$this.StartPosition" type="System.Windows.Forms.FormStartPosition, System.Windows.Forms">
|
||||
<value>CenterParent</value>
|
||||
</data>
|
||||
<data name="$this.Text" xml:space="preserve">
|
||||
<value>Conditions</value>
|
||||
</data>
|
||||
<data name=">>$this.Name" xml:space="preserve">
|
||||
<value>ConditionsDlg</value>
|
||||
</data>
|
||||
<data name=">>$this.Type" xml:space="preserve">
|
||||
<value>System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</data>
|
||||
</root>
|
||||
320
TBF/UI/Bench/Uncertainties/UncertaintiesDlg.cs
Normal file
320
TBF/UI/Bench/Uncertainties/UncertaintiesDlg.cs
Normal file
@ -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<Component> 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<Component>()
|
||||
.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);
|
||||
}
|
||||
}
|
||||
}
|
||||
103
TBF/UI/Bench/Uncertainties/UncertaintiesDlg.designer.cs
generated
Normal file
103
TBF/UI/Bench/Uncertainties/UncertaintiesDlg.designer.cs
generated
Normal file
@ -0,0 +1,103 @@
|
||||
///
|
||||
/// Copyright (c) 2019 Sensus Slovensko a.s.
|
||||
///
|
||||
namespace TBF.UI.Bench.Uncertainties
|
||||
{
|
||||
partial class UncertaintiesDlg
|
||||
{
|
||||
/// <summary>
|
||||
/// Required designer variable.
|
||||
/// </summary>
|
||||
private System.ComponentModel.IContainer components = null;
|
||||
|
||||
/// <summary>
|
||||
/// Clean up any resources being used.
|
||||
/// </summary>
|
||||
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
if (disposing && (components != null))
|
||||
{
|
||||
components.Dispose();
|
||||
}
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
#region Windows Form Designer generated code
|
||||
|
||||
/// <summary>
|
||||
/// Required method for Designer support - do not modify
|
||||
/// the contents of this method with the code editor.
|
||||
/// </summary>
|
||||
private void InitializeComponent()
|
||||
{
|
||||
this.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;
|
||||
}
|
||||
}
|
||||
120
TBF/UI/Bench/Uncertainties/UncertaintiesDlg.resx
Normal file
120
TBF/UI/Bench/Uncertainties/UncertaintiesDlg.resx
Normal file
@ -0,0 +1,120 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
||||
|
||||
Version 2.0
|
||||
|
||||
The primary goals of this format is to allow a simple XML format
|
||||
that is mostly human readable. The generation and parsing of the
|
||||
various data types are done through the TypeConverter classes
|
||||
associated with the data types.
|
||||
|
||||
Example:
|
||||
|
||||
... ado.net/XML headers & schema ...
|
||||
<resheader name="resmimetype">text/microsoft-resx</resheader>
|
||||
<resheader name="version">2.0</resheader>
|
||||
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
|
||||
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
|
||||
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
|
||||
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
|
||||
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
|
||||
<value>[base64 mime encoded serialized .NET Framework object]</value>
|
||||
</data>
|
||||
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
|
||||
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
|
||||
<comment>This is a comment</comment>
|
||||
</data>
|
||||
|
||||
There are any number of "resheader" rows that contain simple
|
||||
name/value pairs.
|
||||
|
||||
Each data row contains a name, and value. The row also contains a
|
||||
type or mimetype. Type corresponds to a .NET class that support
|
||||
text/value conversion through the TypeConverter architecture.
|
||||
Classes that don't support this are serialized and stored with the
|
||||
mimetype set.
|
||||
|
||||
The mimetype is used for serialized objects, and tells the
|
||||
ResXResourceReader how to depersist the object. This is currently not
|
||||
extensible. For a given mimetype the value must be set accordingly:
|
||||
|
||||
Note - application/x-microsoft.net.object.binary.base64 is the format
|
||||
that the ResXResourceWriter will generate, however the reader can
|
||||
read any of the formats listed below.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.binary.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.soap.base64
|
||||
value : The object must be serialized with
|
||||
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
|
||||
: and then encoded with base64 encoding.
|
||||
|
||||
mimetype: application/x-microsoft.net.object.bytearray.base64
|
||||
value : The object must be serialized into a byte array
|
||||
: using a System.ComponentModel.TypeConverter
|
||||
: and then encoded with base64 encoding.
|
||||
-->
|
||||
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
|
||||
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
|
||||
<xsd:element name="root" msdata:IsDataSet="true">
|
||||
<xsd:complexType>
|
||||
<xsd:choice maxOccurs="unbounded">
|
||||
<xsd:element name="metadata">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" use="required" type="xsd:string" />
|
||||
<xsd:attribute name="type" type="xsd:string" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="assembly">
|
||||
<xsd:complexType>
|
||||
<xsd:attribute name="alias" type="xsd:string" />
|
||||
<xsd:attribute name="name" type="xsd:string" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="data">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
|
||||
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
|
||||
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
|
||||
<xsd:attribute ref="xml:space" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
<xsd:element name="resheader">
|
||||
<xsd:complexType>
|
||||
<xsd:sequence>
|
||||
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
|
||||
</xsd:sequence>
|
||||
<xsd:attribute name="name" type="xsd:string" use="required" />
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:choice>
|
||||
</xsd:complexType>
|
||||
</xsd:element>
|
||||
</xsd:schema>
|
||||
<resheader name="resmimetype">
|
||||
<value>text/microsoft-resx</value>
|
||||
</resheader>
|
||||
<resheader name="version">
|
||||
<value>2.0</value>
|
||||
</resheader>
|
||||
<resheader name="reader">
|
||||
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
<resheader name="writer">
|
||||
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
|
||||
</resheader>
|
||||
</root>
|
||||
25
TBF/UI/MainWnd.Designer.cs
generated
25
TBF/UI/MainWnd.Designer.cs
generated
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -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)
|
||||
|
||||
1063
TBF/UI/MainWnd.resx
1063
TBF/UI/MainWnd.resx
File diff suppressed because it is too large
Load Diff
@ -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)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user