Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0d9c03d7a2 | ||
|
|
ff9a1fd138 | ||
|
|
de269b66b5 | ||
|
|
ea894c2db5 | ||
|
|
bd9785c195 | ||
|
|
044046080d | ||
|
|
04efa02089 | ||
|
|
426a21fd0b | ||
|
|
8523324962 | ||
|
|
f06f819adb | ||
|
|
ac8e766476 | ||
|
|
a67a709782 | ||
|
|
9543de4170 | ||
|
|
79fea707f3 | ||
|
|
1034c8e752 | ||
|
|
aa95f60a81 | ||
|
|
420cf6397b | ||
|
|
fce2fcf293 | ||
|
|
41c662f053 | ||
|
|
72d2b602ab | ||
|
|
dc08f308d0 | ||
|
|
910f15dfbf | ||
|
|
d4f8c23cce | ||
|
|
324be83f9b | ||
|
|
ea8d4cb63d | ||
|
|
7b5231af80 | ||
|
|
63b7b83363 | ||
|
|
7a814c2a00 | ||
|
|
76053d466b | ||
|
|
6020d6e4eb | ||
|
|
61d06dc910 | ||
|
|
e889215cf4 | ||
|
|
cdc971f733 | ||
|
|
863856d27d | ||
|
|
cf5dd8cb71 | ||
|
|
619c06a511 | ||
|
|
9b85630405 | ||
|
|
078dc08ed0 | ||
|
|
f82658cee2 | ||
|
|
7c2135a8fe | ||
|
|
b5383a445e | ||
|
|
f3c0da79e8 | ||
|
|
c4c221f58c |
@@ -18,7 +18,7 @@
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG;SENTEC</DefineConstants>
|
||||
<DefineConstants>TRACE;DEBUG;PETERSBURG_50;LANG_RU</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
|
||||
@@ -28,7 +28,7 @@
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;SENTEC</DefineConstants>
|
||||
<DefineConstants>TRACE;PETERSBURG_50;LANG_RU</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -26,6 +26,12 @@ namespace Config
|
||||
public const int CompoundWMsCount = 3;
|
||||
public const int HeatMetersCount = 0;
|
||||
public const int MaxPartNr = 3;
|
||||
#elif FUZHOU100
|
||||
public const int WMsCount = 10;
|
||||
public const int LineSize = 10;
|
||||
public const int CompoundWMsCount = 1;
|
||||
public const int HeatMetersCount = 0;
|
||||
public const int MaxPartNr = WMsCount / LineSize;
|
||||
#elif TORINO50 || BADGER_MALA_TRAT || BERLIN
|
||||
public const int WMsCount = 6;
|
||||
public const int LineSize = 6;
|
||||
|
||||
@@ -38,7 +38,45 @@ namespace Config.Entities
|
||||
}
|
||||
}
|
||||
|
||||
public enum ProcedureState
|
||||
/// <summary>
|
||||
/// Flags returned by each device configuration control Verify(...) function.
|
||||
/// </summary>
|
||||
public enum CfgUpdateFlags
|
||||
{
|
||||
None = 0,
|
||||
Error = 0x1, /// Some settings in the user control are invalid and cannot be set
|
||||
Warning = 0x02, /// Some settings in the user control are suspicious, can be set after user confirmation
|
||||
RestartRqrd = 0x04, /// TBF program restart is required to apply all changed parameters
|
||||
AnyChange = 0x08, /// At least one parameter have changed
|
||||
VolatileChange = 0x10,
|
||||
InvokeCfgChange = 0x20, /// Invoke CfgChange handler of the component
|
||||
}
|
||||
|
||||
public enum RemoteDBUse
|
||||
{
|
||||
[Description("Local DB only")] LocalDBOnly,
|
||||
[Description("Remote DB only")] RemoteDBOnly,
|
||||
[Description("Both DB-s, local 1st")] BothDBsLocalFirst,
|
||||
[Description("Both DB-s, remote 1st")] BothDBsRemoteFirst,
|
||||
Count,
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Contains a procedure name and a database specification (local/remote).
|
||||
/// </summary>
|
||||
public class ProcedureInfo
|
||||
{
|
||||
public readonly string Name;
|
||||
public readonly Users.Entities.DBKind DBKind;
|
||||
|
||||
public ProcedureInfo(string name, Users.Entities.DBKind dbKind)
|
||||
{
|
||||
Name = name;
|
||||
DBKind = dbKind;
|
||||
}
|
||||
}
|
||||
|
||||
public enum ProcedureState
|
||||
{
|
||||
Active,
|
||||
History,
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Serialization;
|
||||
|
||||
namespace Config.Entities
|
||||
@@ -20,13 +22,19 @@ namespace Config.Entities
|
||||
int ParamsCount();
|
||||
|
||||
/// <summary>
|
||||
/// Parameter names
|
||||
/// Returns a parameter name
|
||||
/// </summary>
|
||||
/// <param name="ix">Zero based index of the parameter</param>
|
||||
string ParamName(int ix);
|
||||
|
||||
/// <summary>
|
||||
/// Returns a list of possible values of one parameter (ComboBox when editing) or null (Textbox when editing).
|
||||
/// </summary>
|
||||
/// <param name="ix">Zero based index of the parameter</param>
|
||||
IList<string> ParamValues(int ix);
|
||||
|
||||
/// <summary>
|
||||
/// Parameter values in string form
|
||||
/// Returns a parameter value in the string form
|
||||
/// </summary>
|
||||
/// <param name="ix">Zero based index of the parameter</param>
|
||||
string ToString(int ix);
|
||||
@@ -50,7 +58,7 @@ namespace Config.Entities
|
||||
/// </summary>
|
||||
/// <param name="ix">Zero based index of the parameter</param>
|
||||
/// <param name="strValue">String representation of the parameter</param>
|
||||
void UpdateParam(int ix, string strValue);
|
||||
CfgUpdateFlags UpdateParam(int ix, string strValue);
|
||||
|
||||
void UpdateEmbeddedDbEntity();
|
||||
|
||||
|
||||
@@ -39,7 +39,11 @@ namespace Config
|
||||
dbType = Data.CurrentBench.WaterMetersDBSettings.DbType;
|
||||
connectionString = Data.CurrentBench.WaterMetersDBSettings.ConnectionString;
|
||||
break;
|
||||
}
|
||||
case Users.Entities.DBKind.RemoteConfig:
|
||||
dbType = Data.CurrentBench.UsersDBSettings.DbType;
|
||||
connectionString = Data.CurrentBench.UsersDBSettings.ConnectionString;
|
||||
break;
|
||||
}
|
||||
|
||||
return CreateSessionFactory(database, dbType, connectionString, false);
|
||||
}
|
||||
@@ -69,6 +73,7 @@ namespace Config
|
||||
{
|
||||
default:
|
||||
case Users.Entities.DBKind.Config:
|
||||
case Users.Entities.DBKind.RemoteConfig:
|
||||
cfg = cfg.Mappings(m => m.FluentMappings.AddFromAssemblyOf<Data>());
|
||||
break;
|
||||
case Users.Entities.DBKind.Results:
|
||||
|
||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("2.18.893.0")]
|
||||
[assembly: AssemblyFileVersion("2.18.893.0")]
|
||||
[assembly: AssemblyVersion("2.18.928.0")]
|
||||
[assembly: AssemblyFileVersion("2.18.928.0")]
|
||||
|
||||
@@ -75,7 +75,6 @@
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>Resources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="PrecisionTimer.cs" />
|
||||
<Compile Include="Utils.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -43,11 +43,6 @@ namespace GraphLib
|
||||
PlotterGraphSelectCurvesForm GraphPropertiesForm = null;
|
||||
PrintPreviewForm printPreviewForm = null;
|
||||
|
||||
private PrecisionTimer.Timer mTimer = null;
|
||||
private float play_speed = 0.5f;
|
||||
private float play_speed_max = 10f;
|
||||
private float play_speed_min = 0.5f;
|
||||
|
||||
private bool paused = false;
|
||||
private bool isRunning = false;
|
||||
|
||||
@@ -58,11 +53,6 @@ namespace GraphLib
|
||||
public PlotterDisplayEx()
|
||||
{
|
||||
InitializeComponent();
|
||||
mTimer = new PrecisionTimer.Timer();
|
||||
mTimer.Period = 50; // 20 fps
|
||||
mTimer.Tick += new EventHandler(OnTimerTick);
|
||||
play_speed = 0.5f; // 20x10 = 200 values per second == sample frequency
|
||||
mTimer.Start();
|
||||
isRunning = false;
|
||||
}
|
||||
|
||||
@@ -192,85 +182,10 @@ namespace GraphLib
|
||||
|
||||
protected override void Dispose(bool disposing)
|
||||
{
|
||||
paused = true;
|
||||
|
||||
if (mTimer.IsRunning)
|
||||
{
|
||||
mTimer.Stop();
|
||||
mTimer.Dispose();
|
||||
}
|
||||
|
||||
paused = true;
|
||||
base.Dispose(disposing);
|
||||
}
|
||||
|
||||
public void Start()
|
||||
{
|
||||
if (isRunning == false && paused == false)
|
||||
{
|
||||
gPane.starting_idx = 0;
|
||||
paused = false;
|
||||
isRunning = true;
|
||||
// mTimer.Start();
|
||||
tb1.Buttons[0].ImageIndex = 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (paused == false)
|
||||
{
|
||||
//mTimer.Stop();
|
||||
paused = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
// mTimer.Start();
|
||||
paused = false;
|
||||
}
|
||||
|
||||
if (paused)
|
||||
{
|
||||
|
||||
tb1.Buttons[0].ImageIndex = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
tb1.Buttons[0].ImageIndex = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void Stop()
|
||||
{
|
||||
if (isRunning)
|
||||
{
|
||||
// mTimer.Stop();
|
||||
isRunning = false;
|
||||
paused = false;
|
||||
hScrollBar1.Value = 0;
|
||||
tb1.Buttons[0].ImageIndex = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void tb1_ButtonClick(object sender, ToolBarButtonClickEventArgs e)
|
||||
{
|
||||
bool pushed = e.Button.Pushed;
|
||||
switch (e.Button.Tag.ToString().ToLower())
|
||||
{
|
||||
case "play":
|
||||
|
||||
Start();
|
||||
|
||||
break;
|
||||
|
||||
case "stop":
|
||||
|
||||
Stop();
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void SetPlayPanelVisible()
|
||||
{
|
||||
panel1.Visible = true;
|
||||
@@ -317,27 +232,6 @@ namespace GraphLib
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdatePlayback()
|
||||
{
|
||||
if (!paused && isRunning == true)
|
||||
{
|
||||
try
|
||||
{
|
||||
gPane.starting_idx += play_speed;
|
||||
UpdateScrollBar();
|
||||
gPane.Invalidate();
|
||||
}
|
||||
catch { }
|
||||
}
|
||||
}
|
||||
|
||||
private void OnTimerTick(object sender, EventArgs e)
|
||||
{
|
||||
UpdateControl();
|
||||
|
||||
UpdatePlayback();
|
||||
}
|
||||
|
||||
private void UpdateScrollBar()
|
||||
{
|
||||
|
||||
Generated
-1
@@ -57,7 +57,6 @@ namespace GraphLib
|
||||
this.tb1.Size = new System.Drawing.Size(80, 26);
|
||||
this.tb1.TabIndex = 1;
|
||||
this.tb1.Visible = false;
|
||||
this.tb1.ButtonClick += new System.Windows.Forms.ToolBarButtonClickEventHandler(this.tb1_ButtonClick);
|
||||
//
|
||||
// tbbSave
|
||||
//
|
||||
|
||||
@@ -1,490 +0,0 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
#region License
|
||||
|
||||
/*
|
||||
* Based on the work of Leslie Sanford
|
||||
*/
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
namespace PrecisionTimer
|
||||
{
|
||||
public enum Mode
|
||||
{
|
||||
OneShot,
|
||||
Periodic
|
||||
};
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct TimerCaps
|
||||
{
|
||||
public int periodMin;
|
||||
public int periodMax;
|
||||
}
|
||||
|
||||
|
||||
public sealed class Timer : IComponent
|
||||
{
|
||||
private delegate void TimeProc(int id, int msg, int user, int param1, int param2);
|
||||
|
||||
private delegate void EventRaiser(EventArgs e);
|
||||
|
||||
[DllImport("winmm.dll")]
|
||||
private static extern int timeGetDevCaps(ref TimerCaps caps,
|
||||
int sizeOfTimerCaps);
|
||||
|
||||
[DllImport("winmm.dll")]
|
||||
private static extern int timeSetEvent(int delay,
|
||||
int resolution,
|
||||
TimeProc proc,
|
||||
int user,
|
||||
int mode);
|
||||
|
||||
[DllImport("winmm.dll")]
|
||||
private static extern int timeKillEvent(int id);
|
||||
|
||||
private const int TIMERR_NOERROR = 0;
|
||||
|
||||
private int timerID;
|
||||
|
||||
private volatile Mode mode;
|
||||
|
||||
private volatile int period;
|
||||
|
||||
private volatile int resolution;
|
||||
|
||||
private TimeProc timeProcPeriodic;
|
||||
|
||||
private TimeProc timeProcOneShot;
|
||||
|
||||
private EventRaiser tickRaiser;
|
||||
|
||||
private bool running = false;
|
||||
|
||||
private volatile bool disposed = false;
|
||||
|
||||
private ISynchronizeInvoke synchronizingObject = null;
|
||||
|
||||
private ISite site = null;
|
||||
|
||||
private static TimerCaps caps;
|
||||
|
||||
public event EventHandler Started;
|
||||
|
||||
public event EventHandler Stopped;
|
||||
|
||||
public event EventHandler Tick;
|
||||
|
||||
static Timer()
|
||||
{
|
||||
// Get multimedia timer capabilities.
|
||||
timeGetDevCaps(ref caps, Marshal.SizeOf(caps));
|
||||
}
|
||||
|
||||
|
||||
public Timer(IContainer container)
|
||||
{
|
||||
|
||||
container.Add(this);
|
||||
|
||||
Initialize();
|
||||
}
|
||||
|
||||
|
||||
public Timer()
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
|
||||
~Timer()
|
||||
{
|
||||
if(IsRunning)
|
||||
{
|
||||
// Stop and destroy timer.
|
||||
timeKillEvent(timerID);
|
||||
}
|
||||
}
|
||||
|
||||
private void Initialize()
|
||||
{
|
||||
this.mode = Mode.Periodic;
|
||||
this.period = Capabilities.periodMin;
|
||||
this.resolution = 1;
|
||||
|
||||
running = false;
|
||||
|
||||
timeProcPeriodic = new TimeProc(TimerPeriodicEventCallback);
|
||||
timeProcOneShot = new TimeProc(TimerOneShotEventCallback);
|
||||
tickRaiser = new EventRaiser(OnTick);
|
||||
}
|
||||
|
||||
|
||||
public void Start()
|
||||
{
|
||||
|
||||
if(disposed)
|
||||
{
|
||||
throw new ObjectDisposedException("Timer");
|
||||
}
|
||||
|
||||
if(IsRunning)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if(Mode == Mode.Periodic)
|
||||
{
|
||||
timerID = timeSetEvent(Period, Resolution, timeProcPeriodic, 0, (int)Mode);
|
||||
}
|
||||
else
|
||||
{
|
||||
timerID = timeSetEvent(Period, Resolution, timeProcOneShot, 0, (int)Mode);
|
||||
}
|
||||
|
||||
if(timerID != 0)
|
||||
{
|
||||
running = true;
|
||||
|
||||
if(SynchronizingObject != null && SynchronizingObject.InvokeRequired)
|
||||
{
|
||||
SynchronizingObject.BeginInvoke(
|
||||
new EventRaiser(OnStarted),
|
||||
new object[] { EventArgs.Empty });
|
||||
}
|
||||
else
|
||||
{
|
||||
OnStarted(EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new TimerException("Unable to start timer.");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void Stop()
|
||||
{
|
||||
|
||||
if(disposed)
|
||||
{
|
||||
throw new ObjectDisposedException("Timer");
|
||||
}
|
||||
|
||||
if(!running)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
int result = timeKillEvent(timerID);
|
||||
|
||||
Debug.Assert(result == TIMERR_NOERROR);
|
||||
|
||||
running = false;
|
||||
|
||||
if(SynchronizingObject != null && SynchronizingObject.InvokeRequired)
|
||||
{
|
||||
SynchronizingObject.BeginInvoke(
|
||||
new EventRaiser(OnStopped),
|
||||
new object[] { EventArgs.Empty });
|
||||
}
|
||||
else
|
||||
{
|
||||
OnStopped(EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private void TimerPeriodicEventCallback(int id, int msg, int user, int param1, int param2)
|
||||
{
|
||||
if(synchronizingObject != null)
|
||||
{
|
||||
synchronizingObject.BeginInvoke(tickRaiser, new object[] { EventArgs.Empty });
|
||||
}
|
||||
else
|
||||
{
|
||||
OnTick(EventArgs.Empty);
|
||||
}
|
||||
}
|
||||
|
||||
private void TimerOneShotEventCallback(int id, int msg, int user, int param1, int param2)
|
||||
{
|
||||
if(synchronizingObject != null)
|
||||
{
|
||||
synchronizingObject.BeginInvoke(tickRaiser, new object[] { EventArgs.Empty });
|
||||
Stop();
|
||||
}
|
||||
else
|
||||
{
|
||||
OnTick(EventArgs.Empty);
|
||||
Stop();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Raises the Disposed event.
|
||||
private void OnDisposed(EventArgs e)
|
||||
{
|
||||
EventHandler handler = Disposed;
|
||||
|
||||
if(handler != null)
|
||||
{
|
||||
handler(this, e);
|
||||
}
|
||||
}
|
||||
|
||||
// Raises the Started event.
|
||||
private void OnStarted(EventArgs e)
|
||||
{
|
||||
EventHandler handler = Started;
|
||||
|
||||
if(handler != null)
|
||||
{
|
||||
handler(this, e);
|
||||
}
|
||||
}
|
||||
|
||||
// Raises the Stopped event.
|
||||
private void OnStopped(EventArgs e)
|
||||
{
|
||||
EventHandler handler = Stopped;
|
||||
|
||||
if(handler != null)
|
||||
{
|
||||
handler(this, e);
|
||||
}
|
||||
}
|
||||
|
||||
// Raises the Tick event.
|
||||
private void OnTick(EventArgs e)
|
||||
{
|
||||
EventHandler handler = Tick;
|
||||
|
||||
if(handler != null)
|
||||
{
|
||||
handler(this, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the object used to marshal event-handler calls.
|
||||
/// </summary>
|
||||
public ISynchronizeInvoke SynchronizingObject
|
||||
{
|
||||
get
|
||||
{
|
||||
#region Require
|
||||
|
||||
if(disposed)
|
||||
{
|
||||
throw new ObjectDisposedException("Timer");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
return synchronizingObject;
|
||||
}
|
||||
set
|
||||
{
|
||||
#region Require
|
||||
|
||||
if(disposed)
|
||||
{
|
||||
throw new ObjectDisposedException("Timer");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
synchronizingObject = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public int Period
|
||||
{
|
||||
get
|
||||
{
|
||||
#region Require
|
||||
|
||||
if(disposed)
|
||||
{
|
||||
throw new ObjectDisposedException("Timer");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
return period;
|
||||
}
|
||||
set
|
||||
{
|
||||
#region Require
|
||||
|
||||
if(disposed)
|
||||
{
|
||||
throw new ObjectDisposedException("Timer");
|
||||
}
|
||||
else if(value < Capabilities.periodMin || value > Capabilities.periodMax)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("Period", value,
|
||||
"Multimedia Timer period out of range.");
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
period = value;
|
||||
|
||||
if(IsRunning)
|
||||
{
|
||||
Stop();
|
||||
Start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public int Resolution
|
||||
{
|
||||
get
|
||||
{
|
||||
|
||||
if(disposed)
|
||||
{
|
||||
throw new ObjectDisposedException("Timer");
|
||||
}
|
||||
|
||||
return resolution;
|
||||
}
|
||||
set
|
||||
{
|
||||
if(disposed)
|
||||
{
|
||||
throw new ObjectDisposedException("Timer");
|
||||
}
|
||||
else if(value < 0)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("Resolution", value,
|
||||
"timer resolution out of range.");
|
||||
}
|
||||
|
||||
resolution = value;
|
||||
|
||||
if(IsRunning)
|
||||
{
|
||||
Stop();
|
||||
Start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public Mode Mode
|
||||
{
|
||||
get
|
||||
{
|
||||
|
||||
if(disposed)
|
||||
{
|
||||
throw new ObjectDisposedException("Timer");
|
||||
}
|
||||
|
||||
|
||||
return mode;
|
||||
}
|
||||
set
|
||||
{
|
||||
|
||||
if(disposed)
|
||||
{
|
||||
throw new ObjectDisposedException("Timer");
|
||||
}
|
||||
|
||||
|
||||
mode = value;
|
||||
|
||||
if(IsRunning)
|
||||
{
|
||||
Stop();
|
||||
Start();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets a value indicating whether the Timer is running.
|
||||
/// </summary>
|
||||
public bool IsRunning
|
||||
{
|
||||
get
|
||||
{
|
||||
return running;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the timer capabilities.
|
||||
/// </summary>
|
||||
public static TimerCaps Capabilities
|
||||
{
|
||||
get
|
||||
{
|
||||
return caps;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public event System.EventHandler Disposed;
|
||||
|
||||
public ISite Site
|
||||
{
|
||||
get
|
||||
{
|
||||
return site;
|
||||
}
|
||||
set
|
||||
{
|
||||
site = value;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
|
||||
if(disposed)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if(IsRunning)
|
||||
{
|
||||
Stop();
|
||||
}
|
||||
|
||||
disposed = true;
|
||||
|
||||
OnDisposed(EventArgs.Empty);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public class TimerException : ApplicationException
|
||||
{
|
||||
public TimerException(string message) : base(message)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -26,8 +26,10 @@ namespace Results.Entities
|
||||
public virtual int FlowSetTime { get; set; } /// [s] Measurement time in seconds
|
||||
public virtual double TestTime { get; set; } /// [s] Measurement time in seconds
|
||||
public virtual double PulsesMaster { get; set; }
|
||||
public virtual double ConstMasterRaw { get; set; } /// [l/pls] Liters per pulse of the master flow meter uncorrected
|
||||
public virtual double ConstMaster { get; set; } /// [l/pls] Liters per pulse of the master flow meter
|
||||
public virtual double ConstMasterRaw { get; set; } /// [l/pls] Liters per pulse of the master flow meter uncorrected.
|
||||
public virtual double ConstMasterCorr { get; set; } /// [l/pls] Liters per pulse of the master flow meter corrected by a correction table.
|
||||
public virtual double ConstMaster { get; set; } /// [l/pls] Liters per pulse of the master flow meter calculated from a mass measurement.
|
||||
/// When mass measurement is not available, corrected by a correction table.
|
||||
public virtual double MassStartRaw { get; set; } /// [kg]
|
||||
public virtual double MassStart { get; set; } /// [kg]
|
||||
public virtual double MassEndRaw { get; set; } /// [kg]
|
||||
@@ -40,7 +42,7 @@ namespace Results.Entities
|
||||
public virtual double FlowVolume { get; set; } /// [m3/h]
|
||||
public virtual double VolumeCTV { get; set; } /// [l] Volume conventional true value
|
||||
public virtual double VolumeMaster { get; set; } /// [l] Volume from the master flow meter
|
||||
public virtual double ErrorMaster { get; set; } /// [%]
|
||||
public virtual double ErrorMaster { get; set; } /// [%] Error of the master flow meter
|
||||
|
||||
public virtual float DiverterStart { get; set; } /// [s] Diverter switch time when test starts
|
||||
public virtual float DivStart10 { get; set; } /// [s] Diverter switch time when test starts at level 10 (e.g. 10%) (not mapped to DB)
|
||||
@@ -107,7 +109,7 @@ namespace Results.Entities
|
||||
public virtual float FlowMean { get; set; } /// [m3/h] mean flow from the reference flowmeter
|
||||
public virtual float FlowStart { get; set; } /// [m3/h] flow at the start of test from the reference flowmeter
|
||||
public virtual float FlowEnd { get; set; } /// [m3/h] flow at the end of test from the reference flowmeter
|
||||
public virtual float FlowMin { get; set; } /// [m3/h] not mapped to DB
|
||||
public virtual float FlowMin { get; set; } /// [m3/h]
|
||||
public virtual float FlowMax { get; set; } /// [m3/h]
|
||||
|
||||
public virtual float Custom1 { get; set; } /// [°C] T ref hi mean
|
||||
@@ -129,9 +131,10 @@ namespace Results.Entities
|
||||
public virtual double TargetVolume() { return TestData.TargetVolume; }
|
||||
public virtual double TargetTime() { return TestData.TargetTime; }
|
||||
public virtual string Method() { return TestData.Method; }
|
||||
public virtual bool IsPMaxTest() { return (MethodClass != null) && (MethodClass.Contains("PMaxTest") || MethodClass.Contains("LeakTest")); }
|
||||
public virtual bool IsStartStop() { return (MethodClass != null) && MethodClass.Contains("FixedStart"); }
|
||||
public virtual bool IsDiverter() { return (MethodClass != null) && MethodClass.Contains("FlyingStart") && MethodClass.Contains("MassColl"); }
|
||||
public virtual bool IsRelErrTest() { return (MethodClass != null) ? (MethodClass.Contains("FixedStart") || MethodClass.Contains("FlyingStart") || MethodClass.Contains("CombinedWithDetection")) : true; }
|
||||
public virtual bool IsPMaxTest() { return (MethodClass != null) ? (MethodClass.Contains("PMaxTest") || MethodClass.Contains("LeakTest")) : true; }
|
||||
public virtual bool IsStartStop() { return (MethodClass != null) ? MethodClass.Contains("FixedStart") : true; }
|
||||
public virtual bool IsDiverter() { return (MethodClass != null) ? (MethodClass.Contains("FlyingStart") && MethodClass.Contains("MassColl")) : true; }
|
||||
|
||||
public virtual double ErrLimLo()
|
||||
{
|
||||
|
||||
@@ -251,6 +251,7 @@ namespace Results
|
||||
Flow_ctv_start, /// 217
|
||||
Flow_ctv_end, /// 218
|
||||
ConstMasterRaw, /// 219 ConstMaster (like 194) uncorrected
|
||||
Reference_error_corr, /// 220 Reference flow meter error after correction using correction curve
|
||||
|
||||
Count,
|
||||
}
|
||||
|
||||
@@ -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,7 +12,8 @@ namespace Results.Mappings
|
||||
{
|
||||
Id(x => x.Id);
|
||||
Map(x => x.CompoundMeterId);
|
||||
Map(x => x.PulsesMeter);
|
||||
Map(x => x.RegReaderType);
|
||||
Map(x => x.PulsesMeter);
|
||||
Map(x => x.PulsesMaster);
|
||||
Map(x => x.PulsesPerLiter);
|
||||
Map(x => x.VolumeStart);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2015-2017 Sensus Metering Systems
|
||||
/// Copyright (c) 2015-2018 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)
|
||||
@@ -26,6 +27,8 @@ namespace Results.Mappings
|
||||
Map(x => x.FlowSetTime);
|
||||
Map(x => x.TestTime);
|
||||
Map(x => x.PulsesMaster);
|
||||
Map(x => x.ConstMasterRaw);
|
||||
Map(x => x.ConstMasterCorr);
|
||||
Map(x => x.ConstMaster);
|
||||
Map(x => x.MassStartRaw);
|
||||
Map(x => x.MassStart);
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -32,5 +32,5 @@ using System.Runtime.InteropServices;
|
||||
// You can specify all the values or you can default the Build and Revision Numbers
|
||||
// by using the '*' as shown below:
|
||||
// [assembly: AssemblyVersion("1.0.*")]
|
||||
[assembly: AssemblyVersion("2.18.893.0")]
|
||||
[assembly: AssemblyFileVersion("2.18.893.0")]
|
||||
[assembly: AssemblyVersion("2.20.963.0")]
|
||||
[assembly: AssemblyFileVersion("2.20.963.0")]
|
||||
|
||||
Generated
+1
-1
@@ -1303,7 +1303,7 @@ namespace Results.Resources {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Flow calculated from conventional true volume and the time.
|
||||
/// Looks up a localized string similar to Flow measured by the reference flow meter.
|
||||
/// </summary>
|
||||
internal static string Tooltip_Q_v_r {
|
||||
get {
|
||||
|
||||
@@ -514,7 +514,7 @@
|
||||
<value>Flow obtained from the master meter - mean</value>
|
||||
</data>
|
||||
<data name="Tooltip_Q_v_r" xml:space="preserve">
|
||||
<value>Flow calculated from conventional true volume and the time</value>
|
||||
<value>Flow measured by the reference flow meter</value>
|
||||
</data>
|
||||
<data name="Tooltip_T_di_ac" xml:space="preserve">
|
||||
<value>Actual temperature at the diverter</value>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG;SENTEC</DefineConstants>
|
||||
<DefineConstants>TRACE;DEBUG;PETERSBURG_50;LANG_RU</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<PlatformTarget>x86</PlatformTarget>
|
||||
@@ -27,7 +27,7 @@
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;SENTEC</DefineConstants>
|
||||
<DefineConstants>TRACE;PETERSBURG_50;LANG_RU</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -132,7 +132,10 @@ namespace Results
|
||||
/// Static list of all available items
|
||||
public static readonly IList<WMeterRsltItemSpec> AllItems;
|
||||
|
||||
/// Static constructor that initializes the list of all items
|
||||
/// <summary>
|
||||
/// Initializes the <see cref="WMeterRsltItemSpec"/> class.
|
||||
/// </summary>
|
||||
/// Static constructor that initializes the list of all items
|
||||
static WMeterRsltItemSpec()
|
||||
{
|
||||
AllItems = new List<WMeterRsltItemSpec>();
|
||||
@@ -187,15 +190,15 @@ namespace Results
|
||||
///
|
||||
/// Time (duration)
|
||||
///
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_time, Strings.T_s + "()", Quantity.Time, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).IsPMaxTest() ? 0 : w.GetTestRslt(t).TestTime)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_time_ni, Strings.T_s + "_ni()", Quantity.Time, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null || w.GetTestRslt(t).IsPMaxTest()) ? "" : FormatDbl(u, f, p, "V3", w.GetMeterTestRslt(t).TestTime)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.PMax_test_time, "Pressure test time ()", "Pressure test time", Quantity.Time, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null || !w.GetTestRslt(t).IsPMaxTest()) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).TestTime)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Diverter_start_time, "Diverter start time ()", "Diverter start time", Quantity.Time, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "F3", w.GetTestRslt(t).IsDiverter() ? w.GetTestRslt(t).DiverterStart : 0)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Diverter_end_time, "Diverter end time ()", "Diverter end time", Quantity.Time, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "F3", w.GetTestRslt(t).IsDiverter() ? w.GetTestRslt(t).DiverterEnd : 0)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_valve_open_time, "Start valve open time ()", "Start valve open time", Quantity.Time, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "F3", w.GetTestRslt(t).IsStartStop() ? w.GetTestRslt(t).DiverterStart : 0)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_valve_close_time, "Start valve close time ()", "Start valve close time", Quantity.Time, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "F3", w.GetTestRslt(t).IsStartStop() ? w.GetTestRslt(t).DiverterEnd : 0)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Timestamp_start, "Timestamp start ()", Quantity.Time, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).TimestampStart)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Timestamp_end, "Timestamp end ()", Quantity.Time, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).TimestampEnd)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Timestamp_start, "Timestamp start ()", Quantity.Time, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null || !w.GetTestRslt(t).IsRelErrTest()) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).TimestampStart)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Timestamp_end, "Timestamp end ()", Quantity.Time, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null || !w.GetTestRslt(t).IsRelErrTest()) ? "" : FormatDbl(u, f, p, "V4", w.GetMeterTestRslt(t).TimestampEnd)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_time_ni, Strings.T_s + "_ni()", Quantity.Time, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null || !w.GetTestRslt(t).IsRelErrTest()) ? "" : FormatDbl(u, f, p, "V3", w.GetMeterTestRslt(t).TestTime)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_time, Strings.T_s + "()", Quantity.Time, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null || !w.GetTestRslt(t).IsRelErrTest()) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).TestTime)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.PMax_test_time, "Pressure test time ()", "Pressure test time", Quantity.Time, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null || !w.GetTestRslt(t).IsPMaxTest()) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).TestTime)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Diverter_start_time, "Diverter start time ()", "Diverter start time", Quantity.Time, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null || !w.GetTestRslt(t).IsDiverter()) ? "" : FormatDbl(u, f, p, "F3", w.GetTestRslt(t).DiverterStart)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Diverter_end_time, "Diverter end time ()", "Diverter end time", Quantity.Time, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null || !w.GetTestRslt(t).IsDiverter()) ? "" : FormatDbl(u, f, p, "F3", w.GetTestRslt(t).DiverterEnd)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_valve_open_time, "Start valve open time ()", "Start valve open time", Quantity.Time, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null || !w.GetTestRslt(t).IsStartStop()) ? "" : FormatDbl(u, f, p, "F3", w.GetTestRslt(t).DiverterStart)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Start_valve_close_time, "Start valve close time ()", "Start valve close time", Quantity.Time, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null || !w.GetTestRslt(t).IsStartStop()) ? "" : FormatDbl(u, f, p, "F3", w.GetTestRslt(t).DiverterEnd)));
|
||||
|
||||
///
|
||||
/// Flow
|
||||
@@ -209,7 +212,7 @@ namespace Results
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_max, string.Format("{0} ref max ()", Strings.VName_Flow), Strings.Tooltip_Q_max, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowMax)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_start, string.Format("{0} ref start ()",Strings.VName_Flow),Strings.Tooltip_Q_start, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowStart)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Q_ref_end, string.Format("{0} ref end ()", Strings.VName_Flow), Strings.Tooltip_Q_end, Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", w.GetTestRslt(t).FlowEnd)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv, string.Format("{0} ctv min ()", Strings.VName_Flow), "Mean CTV of the flow", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).TestTime == 0) ? 0 : w.GetTestRslt(t).VolumeCTV / w.GetTestRslt(t).TestTime)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv, string.Format("{0} ctv ()", Strings.VName_Flow), "CTV of the flow (mean val.)",Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).TestTime == 0) ? 0 : 3.6 * w.GetTestRslt(t).VolumeCTV / w.GetTestRslt(t).TestTime)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv_min, string.Format("{0} ctv min ()", Strings.VName_Flow), "Min. CTV of the flow", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).VolumeMaster == 0) ? 0 : w.GetTestRslt(t).VolumeCTV * w.GetTestRslt(t).FlowMin / w.GetTestRslt(t).VolumeMaster)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv_max, string.Format("{0} ctv max ()", Strings.VName_Flow), "Max. CTV of the flow", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).VolumeMaster == 0) ? 0 : w.GetTestRslt(t).VolumeCTV * w.GetTestRslt(t).FlowMax / w.GetTestRslt(t).VolumeMaster)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Flow_ctv_start, string.Format("{0} ctv start ()", Strings.VName_Flow), "Start flow CTV", Quantity.Flow, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V3", (w.GetTestRslt(t).VolumeMaster == 0) ? 0 : w.GetTestRslt(t).VolumeCTV * w.GetTestRslt(t).FlowStart / w.GetTestRslt(t).VolumeMaster)));
|
||||
@@ -304,6 +307,7 @@ namespace Results
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error_limit_Hi, Strings.ErrLimHi + "()", Quantity.Error, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V2", w.GetTestRslt(t).ErrLimHi())));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Uncertainty, Strings.Uncertainty + "()", Quantity.Error, ItemCategory.TestData, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V2", w.GetTestRslt(t).Uncertainty())));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_error, string.Format("{0} rel.ref. ()", Strings.VName_Error), Strings.Tooltip_E_rel_ref, Quantity.Error, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V2", w.GetTestRslt(t).ErrorMaster)));
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Reference_error_corr, string.Format("{0} ref.corr. ()", Strings.VName_Error), "Relative error of the reference flow meter after correction using correction curve", Quantity.Error, ItemCategory.TestResult, (w, t, u, f, p) => (w.GetTestRslt(t) == null) ? "" : FormatDbl(u, f, p, "V2", Config.Formulas.ErrorFromVolumes(w.GetTestRslt(t).ConstMasterCorr, w.GetTestRslt(t).ConstMaster))));
|
||||
#if TURA_IPERL || TURA_SPECIAL
|
||||
AllItems.Add(new WMeterRsltItemSpec(ItemID.Error, string.Format("{0} rel. ()", Strings.VName_Error), Strings.Tooltip_E_rel, Quantity.Error, ItemCategory.MeterResult, (w, t, u, f, p) => (w.GetMeterTestRslt(t) == null) ? "0" : FormatDbl(u, f, p, "V2", w.GetMeterTestRslt(t).Error)));
|
||||
#else
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG;SENTEC</DefineConstants>
|
||||
<DefineConstants>TRACE;DEBUG;PETERSBURG_50;LANG_RU</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<AllowUnsafeBlocks>false</AllowUnsafeBlocks>
|
||||
@@ -31,7 +31,7 @@
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;SENTEC</DefineConstants>
|
||||
<DefineConstants>TRACE;PETERSBURG_50;LANG_RU</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace TBF.BenchControl.Ambient.Comet
|
||||
public class AmbientCfg : ComponentCfgBase, Generic.IComponentCfg
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(AmbientCfg) })[0];
|
||||
protected override XmlSerializer GetSerializer() { return Serializer; }
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl() { return new AmbientCfgCtrl(); }
|
||||
|
||||
|
||||
@@ -4,15 +4,13 @@
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using System.IO.Ports;
|
||||
using log4net;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.Ambient.Comet
|
||||
{
|
||||
public partial class AmbientCfgCtrl : UserControl, IComponentCfgCtrl
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(AmbientCfgCtrl));
|
||||
|
||||
public bool ShowMore { get { return false; } }
|
||||
|
||||
AmbientCfg config;
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace TBF.BenchControl.Ambient.Greco
|
||||
public class AmbientCfg : ComponentCfgBase, Generic.IComponentCfg
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(AmbientCfg) })[0];
|
||||
protected override XmlSerializer GetSerializer() { return Serializer; }
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl() { return new AmbientCfgCtrl(); }
|
||||
|
||||
|
||||
@@ -4,15 +4,13 @@
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using System.IO.Ports;
|
||||
using log4net;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.Ambient.Greco
|
||||
{
|
||||
public partial class AmbientCfgCtrl : UserControl, IComponentCfgCtrl
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(AmbientCfgCtrl));
|
||||
|
||||
public bool ShowMore { get { return false; } }
|
||||
|
||||
AmbientCfg config;
|
||||
|
||||
+7
-7
@@ -1,6 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2016 Sensus Metering Systems
|
||||
/// Author: Milan Hanajík
|
||||
/// Copyright (c) 2018 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -10,7 +9,7 @@ using Config.Entities;
|
||||
using TBF.BenchControl;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.BenchInfo.Polska
|
||||
namespace TBF.BenchControl.BenchInfo.Extended
|
||||
{
|
||||
/// <summary>
|
||||
/// Holds information identifying the test bench.
|
||||
@@ -20,10 +19,11 @@ namespace TBF.BenchControl.BenchInfo.Polska
|
||||
private static readonly ILog log = LogManager.GetLogger(typeof(Component));
|
||||
public override string ToString() { return string.Format("BenchInfoEx({0})", Cfg.ToString(1)); }
|
||||
|
||||
public readonly ComponentCfg BenchInfoCfg;
|
||||
readonly ComponentCfg myCfg;
|
||||
|
||||
public string TestBenchName { get { return BenchInfoCfg.TestBenchName; } }
|
||||
public int TestBenchId { get { return BenchInfoCfg.TestBenchId; } }
|
||||
public string TestBenchName { get { return myCfg.TestBenchName; } }
|
||||
public int TestBenchId { get { return myCfg.TestBenchId; } }
|
||||
public RemoteDBUse RemoteDBUse { get { return myCfg.RemoteDBUse; } }
|
||||
|
||||
public Component()
|
||||
{
|
||||
@@ -32,7 +32,7 @@ namespace TBF.BenchControl.BenchInfo.Polska
|
||||
public Component(Generic.IComponentCfg cfg)
|
||||
: base(cfg)
|
||||
{
|
||||
BenchInfoCfg = cfg as ComponentCfg;
|
||||
myCfg = cfg as ComponentCfg;
|
||||
log.Debug(this.ToString());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,223 @@
|
||||
///
|
||||
/// Copyright (c) 2018 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Serialization;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.BenchInfo.Extended
|
||||
{
|
||||
/// <summary>
|
||||
/// Holds information identifying the test bench - serializable configuration.
|
||||
/// </summary>
|
||||
public class ComponentCfg : ComponentCfgBase, Generic.IComponentCfg, Config.Entities.IParamsProvider
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(ComponentCfg) })[0];
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl() { return new Configs.ParamsProvider.ComponentCfgCtrl(this, null); }
|
||||
|
||||
///
|
||||
/// Serialized parameters
|
||||
///
|
||||
public string TestBenchName;
|
||||
public int TestBenchId;
|
||||
public string Address1;
|
||||
public string Address2;
|
||||
public string Address3;
|
||||
public string Address4;
|
||||
public string Address5;
|
||||
public string ApprovalId;
|
||||
public string ApprovalDate;
|
||||
public string ApprovedBy;
|
||||
public RemoteDBUse RemoteDBUse;
|
||||
|
||||
/// Private parameterless constructor invoked by all other (public) constructors
|
||||
ComponentCfg() {}
|
||||
|
||||
public ComponentCfg(IComponentFactory factory)
|
||||
: this()
|
||||
{
|
||||
Factory = factory;
|
||||
Name = "BenchInfoEx";
|
||||
ParentName = string.Empty;
|
||||
InitializeAll();
|
||||
}
|
||||
|
||||
public string ToString(char a)
|
||||
{
|
||||
return string.Format("Name={0}, Parent={1}, ...", Name, ParentName);
|
||||
}
|
||||
|
||||
public string ComponentName { get { return Name; } }
|
||||
|
||||
public void InitializeAll()
|
||||
{
|
||||
TestBenchName = "1";
|
||||
TestBenchId = 1;
|
||||
|
||||
Address1 = string.Empty;
|
||||
Address2 = string.Empty;
|
||||
Address3 = string.Empty;
|
||||
Address4 = string.Empty;
|
||||
Address5 = string.Empty;
|
||||
|
||||
ApprovalId = string.Empty;
|
||||
ApprovalDate = string.Empty;
|
||||
ApprovedBy = string.Empty;
|
||||
|
||||
RemoteDBUse = RemoteDBUse.LocalDBOnly;
|
||||
}
|
||||
|
||||
string[] paramNames = new string[]
|
||||
{
|
||||
"Test bench name",
|
||||
"Test bench ID",
|
||||
"Address 1",
|
||||
"Address 2",
|
||||
"Address 3",
|
||||
"Address 4",
|
||||
"Address 5",
|
||||
"Approval",
|
||||
"Approval date",
|
||||
"Approved by",
|
||||
"Remote DB use",
|
||||
};
|
||||
public string ParamName(int i) { return paramNames[i]; }
|
||||
public int ParamsCount() { return paramNames.Length; }
|
||||
|
||||
public IList<string> ParamValues(int i)
|
||||
{
|
||||
if (i == 10)
|
||||
{
|
||||
IList<string> list = new List<string>();
|
||||
for (RemoteDBUse rdbu = 0; rdbu < RemoteDBUse.Count; rdbu++) list.Add(rdbu.ToDescription());
|
||||
return list;
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public string ToString(int i)
|
||||
{
|
||||
switch (i)
|
||||
{
|
||||
case 0: return TestBenchName;
|
||||
case 1: return TestBenchId.ToString();
|
||||
case 2: return Address1;
|
||||
case 3: return Address2;
|
||||
case 4: return Address3;
|
||||
case 5: return Address4;
|
||||
case 6: return Address5;
|
||||
case 7: return ApprovalId;
|
||||
case 8: return ApprovalDate;
|
||||
case 9: return ApprovedBy;
|
||||
case 10: return RemoteDBUse.ToDescription();
|
||||
default: return string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
public CfgUpdateFlags UpdateParam(int i, string strValue)
|
||||
{
|
||||
switch (i)
|
||||
{
|
||||
case 0: TestBenchName = strValue; return CfgUpdateFlags.RestartRqrd;
|
||||
case 1: TestBenchId = int.Parse(strValue); return CfgUpdateFlags.RestartRqrd;
|
||||
case 2: Address1 = strValue; return CfgUpdateFlags.RestartRqrd;
|
||||
case 3: Address2 = strValue; return CfgUpdateFlags.RestartRqrd;
|
||||
case 4: Address3 = strValue; return CfgUpdateFlags.RestartRqrd;
|
||||
case 5: Address4 = strValue; return CfgUpdateFlags.RestartRqrd;
|
||||
case 6: Address5 = strValue; return CfgUpdateFlags.RestartRqrd;
|
||||
case 7: ApprovalId = strValue; return CfgUpdateFlags.RestartRqrd;
|
||||
case 8: ApprovalDate = strValue; return CfgUpdateFlags.RestartRqrd;
|
||||
case 9: ApprovedBy = strValue; return CfgUpdateFlags.RestartRqrd;
|
||||
|
||||
case 10:
|
||||
for (RemoteDBUse rdbu = 0; rdbu < RemoteDBUse.Count; rdbu++)
|
||||
{
|
||||
if (strValue == rdbu.ToDescription())
|
||||
{
|
||||
if (RemoteDBUse != rdbu)
|
||||
{
|
||||
RemoteDBUse = rdbu;
|
||||
return CfgUpdateFlags.RestartRqrd;
|
||||
}
|
||||
else
|
||||
{
|
||||
return CfgUpdateFlags.None;
|
||||
}
|
||||
}
|
||||
}
|
||||
return CfgUpdateFlags.Error;
|
||||
|
||||
default: return CfgUpdateFlags.None;
|
||||
}
|
||||
}
|
||||
|
||||
public bool ValidateParam(int i, string strValue, out string message)
|
||||
{
|
||||
message = string.Empty;
|
||||
int idummy;
|
||||
|
||||
switch (i)
|
||||
{
|
||||
case 0:
|
||||
case 2:
|
||||
case 3:
|
||||
case 4:
|
||||
case 5:
|
||||
case 6:
|
||||
case 7:
|
||||
case 8:
|
||||
case 9:
|
||||
return true;
|
||||
case 1:
|
||||
if (int.TryParse(strValue, out idummy) && (idummy >= 0)) return true;
|
||||
break;
|
||||
case 10:
|
||||
for (RemoteDBUse rdbu = 0; rdbu < RemoteDBUse.Count; rdbu++)
|
||||
{
|
||||
if (strValue == rdbu.ToDescription()) return true;
|
||||
}
|
||||
return false;
|
||||
default:
|
||||
message = "Invalid index";
|
||||
return false;
|
||||
}
|
||||
|
||||
message = ParamName(i) + " is invalid";
|
||||
return false;
|
||||
}
|
||||
|
||||
void CopyContentTo(ComponentCfg prms)
|
||||
{
|
||||
prms.TestBenchName = this.TestBenchName;
|
||||
prms.TestBenchId = this.TestBenchId;
|
||||
prms.Address1 = this.Address1;
|
||||
prms.Address2 = this.Address2;
|
||||
prms.Address3 = this.Address3;
|
||||
prms.Address4 = this.Address4;
|
||||
prms.Address5 = this.Address5;
|
||||
prms.ApprovalId = this.ApprovalId;
|
||||
prms.ApprovalDate = this.ApprovalDate;
|
||||
prms.ApprovedBy = this.ApprovedBy;
|
||||
prms.RemoteDBUse = this.RemoteDBUse;
|
||||
}
|
||||
|
||||
public Config.Entities.IParamsProvider Clone()
|
||||
{
|
||||
ComponentCfg pars = new ComponentCfg();
|
||||
CopyContentTo(pars);
|
||||
return pars;
|
||||
}
|
||||
|
||||
public void UpdateEmbeddedDbEntity()
|
||||
{
|
||||
/// Do nothing
|
||||
}
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -1,10 +1,10 @@
|
||||
///
|
||||
/// Copyright (c) 2015-2016 Sensus Metering Systems
|
||||
/// Copyright (c) 2018 Sensus Slovensko a.s.
|
||||
///
|
||||
using System.Collections.Generic;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.BenchInfo.Polska
|
||||
namespace TBF.BenchControl.BenchInfo.Extended
|
||||
{
|
||||
public class ComponentFactory : IComponentFactory
|
||||
{
|
||||
@@ -1,6 +1,5 @@
|
||||
///
|
||||
/// Copyright (c) 2013-2015 Sensus Metering Systems
|
||||
/// Author: Milan Hanajík
|
||||
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -24,6 +23,7 @@ namespace TBF.BenchControl.BenchInfo.Munich
|
||||
|
||||
public string TestBenchName { get { return benchInfoCfg.TestBenchName; } }
|
||||
public int TestBenchId { get { return benchInfoCfg.TestBenchId; } }
|
||||
public RemoteDBUse RemoteDBUse { get { return RemoteDBUse.LocalDBOnly; } }
|
||||
|
||||
public Component()
|
||||
{
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace TBF.BenchControl.BenchInfo.Munich
|
||||
public class ComponentCfg : ComponentCfgBase, Generic.IComponentCfg
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(ComponentCfg) })[0];
|
||||
protected override XmlSerializer GetSerializer() { return Serializer; }
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl() { return new ComponentCfgCtrl(); }
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.Generic;
|
||||
using TBF.Resources;
|
||||
|
||||
@@ -12,8 +12,6 @@ namespace TBF.BenchControl.BenchInfo.Munich
|
||||
{
|
||||
public partial class ComponentCfgCtrl : UserControl, IComponentCfgCtrl
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(ComponentCfgCtrl));
|
||||
|
||||
public bool ShowMore { get { return false; } }
|
||||
|
||||
ComponentCfg config;
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
///
|
||||
/// Copyright (c) 2015-2016 Sensus Metering Systems
|
||||
/// Author: Milan Hanajík
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Xml.Serialization;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.BenchInfo.Polska
|
||||
{
|
||||
/// <summary>
|
||||
/// Holds information identifying the test bench - serializable configuration.
|
||||
/// </summary>
|
||||
public class ComponentCfg : ComponentCfgBase, Generic.IComponentCfg
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(ComponentCfg) })[0];
|
||||
protected override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl() { return new ComponentCfgCtrl(); }
|
||||
|
||||
///
|
||||
/// Serialized parameters
|
||||
///
|
||||
public string TestBenchName;
|
||||
public int TestBenchId;
|
||||
public string Address1;
|
||||
public string Address2;
|
||||
public string Address3;
|
||||
public string Address4;
|
||||
public string Address5;
|
||||
public string ApprovalId;
|
||||
public string ApprovalDate;
|
||||
public string ApprovedBy;
|
||||
|
||||
/// Private parameterless constructor invoked by all other (public) constructors
|
||||
ComponentCfg()
|
||||
{
|
||||
Name = "BenchInfoEx";
|
||||
ParentName = string.Empty;
|
||||
TestBenchName = "1";
|
||||
TestBenchId = 1;
|
||||
|
||||
Address1 = string.Empty;
|
||||
Address2 = string.Empty;
|
||||
Address3 = string.Empty;
|
||||
Address4 = string.Empty;
|
||||
Address5 = string.Empty;
|
||||
|
||||
ApprovalId = string.Empty;
|
||||
ApprovalDate = string.Empty;
|
||||
ApprovedBy = string.Empty;
|
||||
}
|
||||
|
||||
public ComponentCfg(IComponentFactory factory)
|
||||
: this()
|
||||
{
|
||||
this.Factory = factory;
|
||||
}
|
||||
|
||||
public string ToString(int i)
|
||||
{
|
||||
return string.Format("Name={0}, Bench name={1}, Bench Id={2}", Name, TestBenchName, TestBenchId);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,130 +0,0 @@
|
||||
///
|
||||
/// Copyright (c) 2015-2016 Sensus Metering Systems
|
||||
/// Author: Milan Hanajík
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using TBF.BenchControl.Generic;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace TBF.BenchControl.BenchInfo.Polska
|
||||
{
|
||||
public partial class ComponentCfgCtrl : UserControl, IComponentCfgCtrl
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(ComponentCfgCtrl));
|
||||
|
||||
public bool ShowMore { get { return false; } }
|
||||
|
||||
ComponentCfg config;
|
||||
public IComponentCfg Config
|
||||
{
|
||||
get { return config as IComponentCfg; }
|
||||
set
|
||||
{
|
||||
config = value as ComponentCfg;
|
||||
Redraw();
|
||||
}
|
||||
}
|
||||
|
||||
public ComponentCfgCtrl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void EntryFormCfgCtrl_Load(object sender, EventArgs e)
|
||||
{
|
||||
nameLabel.Text = Strings.Name;
|
||||
benchNameLabel.Text = Strings.Test_bench_name;
|
||||
benchIdLabel.Text = Strings.Test_bench_number;
|
||||
|
||||
address1Label.Text = Strings.Address + " 1";
|
||||
address2Label.Text = Strings.Address + " 2";
|
||||
address3Label.Text = Strings.Address + " 3";
|
||||
address4Label.Text = Strings.Address + " 4";
|
||||
address5Label.Text = Strings.Address + " 5";
|
||||
|
||||
approvalIdLabel.Text = Strings.Approval_ID;
|
||||
approvalDateLabel.Text = Strings.Approval_date;
|
||||
approvedByLabel.Text = Strings.Approved_by;
|
||||
Redraw();
|
||||
}
|
||||
|
||||
public void Closing()
|
||||
{
|
||||
}
|
||||
|
||||
void Redraw()
|
||||
{
|
||||
if (config == null) return; /// Control was not loaded, settings were not changed
|
||||
|
||||
classNameLabel.Text = config.Factory.ClassName;
|
||||
nameTextBox.Text = config.Name;
|
||||
benchNameTextBox.Text = config.TestBenchName;
|
||||
benchIdTextBox.Text = config.TestBenchId.ToString();
|
||||
|
||||
address1TextBox.Text = config.Address1;
|
||||
address2TextBox.Text = config.Address2;
|
||||
address3TextBox.Text = config.Address3;
|
||||
address4TextBox.Text = config.Address4;
|
||||
address5TextBox.Text = config.Address5;
|
||||
|
||||
approvalIdTextBox.Text = config.ApprovalId;
|
||||
approvalDateTextBox.Text = config.ApprovalDate;
|
||||
approvedByTextBox.Text = config.ApprovedBy;
|
||||
}
|
||||
|
||||
public void Unlock()
|
||||
{
|
||||
nameTextBox.Enabled = true;
|
||||
benchNameTextBox.Enabled = true;
|
||||
benchIdTextBox.Enabled = true;
|
||||
|
||||
address1TextBox.Enabled = true;
|
||||
address2TextBox.Enabled = true;
|
||||
address3TextBox.Enabled = true;
|
||||
address4TextBox.Enabled = true;
|
||||
address5TextBox.Enabled = true;
|
||||
|
||||
approvalIdTextBox.Enabled = true;
|
||||
approvalDateTextBox.Enabled = true;
|
||||
approvedByTextBox.Enabled = true;
|
||||
}
|
||||
|
||||
public CfgUpdateFlags VerifyCfg(ref string message)
|
||||
{
|
||||
CfgUpdateFlags flags = CfgUpdateFlags.None;
|
||||
|
||||
int dummy;
|
||||
if (!int.TryParse(benchIdTextBox.Text, out dummy) || dummy < 0)
|
||||
{
|
||||
flags = CfgUpdateFlags.Error;
|
||||
message = string.Format("Invalid {0} parameter", Strings.Test_bench_number);
|
||||
}
|
||||
return flags;
|
||||
}
|
||||
|
||||
public CfgUpdateFlags UpdateCfg()
|
||||
{
|
||||
CfgUpdateFlags flags = CfgUpdateFlags.RestartRqrd;
|
||||
|
||||
if (config == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed
|
||||
///
|
||||
config.Name = nameTextBox.Text;
|
||||
config.TestBenchName = benchNameTextBox.Text;
|
||||
config.TestBenchId = int.Parse(benchIdTextBox.Text);
|
||||
|
||||
config.Address1 = address1TextBox.Text;
|
||||
config.Address2 = address2TextBox.Text;
|
||||
config.Address3 = address3TextBox.Text;
|
||||
config.Address4 = address4TextBox.Text;
|
||||
config.Address5 = address5TextBox.Text;
|
||||
|
||||
config.ApprovalId = approvalIdTextBox.Text;
|
||||
config.ApprovalDate = approvalDateTextBox.Text;
|
||||
config.ApprovedBy = approvedByTextBox.Text;
|
||||
|
||||
return flags;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,316 +0,0 @@
|
||||
///
|
||||
/// Copyright (c) 2015 Sensus Metering Systems
|
||||
///
|
||||
namespace TBF.BenchControl.BenchInfo.Polska
|
||||
{
|
||||
partial class ComponentCfgCtrl
|
||||
{
|
||||
/// <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 Component 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.nameTextBox = new System.Windows.Forms.TextBox();
|
||||
this.nameLabel = new System.Windows.Forms.Label();
|
||||
this.classNameLabel = new System.Windows.Forms.Label();
|
||||
this.benchIdLabel = new System.Windows.Forms.Label();
|
||||
this.benchIdTextBox = new System.Windows.Forms.TextBox();
|
||||
this.address1TextBox = new System.Windows.Forms.TextBox();
|
||||
this.address1Label = new System.Windows.Forms.Label();
|
||||
this.address2TextBox = new System.Windows.Forms.TextBox();
|
||||
this.address2Label = new System.Windows.Forms.Label();
|
||||
this.address3TextBox = new System.Windows.Forms.TextBox();
|
||||
this.address3Label = new System.Windows.Forms.Label();
|
||||
this.address4TextBox = new System.Windows.Forms.TextBox();
|
||||
this.address4Label = new System.Windows.Forms.Label();
|
||||
this.address5TextBox = new System.Windows.Forms.TextBox();
|
||||
this.address5Label = new System.Windows.Forms.Label();
|
||||
this.approvedByTextBox = new System.Windows.Forms.TextBox();
|
||||
this.approvedByLabel = new System.Windows.Forms.Label();
|
||||
this.approvalDateTextBox = new System.Windows.Forms.TextBox();
|
||||
this.approvalDateLabel = new System.Windows.Forms.Label();
|
||||
this.approvalIdTextBox = new System.Windows.Forms.TextBox();
|
||||
this.approvalIdLabel = new System.Windows.Forms.Label();
|
||||
this.benchNameTextBox = new System.Windows.Forms.TextBox();
|
||||
this.benchNameLabel = new System.Windows.Forms.Label();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// nameTextBox
|
||||
//
|
||||
this.nameTextBox.Enabled = false;
|
||||
this.nameTextBox.Location = new System.Drawing.Point(113, 24);
|
||||
this.nameTextBox.Name = "nameTextBox";
|
||||
this.nameTextBox.Size = new System.Drawing.Size(180, 20);
|
||||
this.nameTextBox.TabIndex = 2;
|
||||
//
|
||||
// nameLabel
|
||||
//
|
||||
this.nameLabel.AutoSize = true;
|
||||
this.nameLabel.Location = new System.Drawing.Point(6, 27);
|
||||
this.nameLabel.Name = "nameLabel";
|
||||
this.nameLabel.Size = new System.Drawing.Size(35, 13);
|
||||
this.nameLabel.TabIndex = 1;
|
||||
this.nameLabel.Text = "Name";
|
||||
//
|
||||
// classNameLabel
|
||||
//
|
||||
this.classNameLabel.AutoSize = true;
|
||||
this.classNameLabel.Location = new System.Drawing.Point(110, 6);
|
||||
this.classNameLabel.Name = "classNameLabel";
|
||||
this.classNameLabel.Size = new System.Drawing.Size(60, 13);
|
||||
this.classNameLabel.TabIndex = 0;
|
||||
this.classNameLabel.Text = "ClassName";
|
||||
//
|
||||
// benchIdLabel
|
||||
//
|
||||
this.benchIdLabel.AutoSize = true;
|
||||
this.benchIdLabel.Location = new System.Drawing.Point(6, 66);
|
||||
this.benchIdLabel.Name = "benchIdLabel";
|
||||
this.benchIdLabel.Size = new System.Drawing.Size(99, 13);
|
||||
this.benchIdLabel.TabIndex = 5;
|
||||
this.benchIdLabel.Text = "Test bench number";
|
||||
//
|
||||
// benchIdTextBox
|
||||
//
|
||||
this.benchIdTextBox.Enabled = false;
|
||||
this.benchIdTextBox.Location = new System.Drawing.Point(113, 64);
|
||||
this.benchIdTextBox.Name = "benchIdTextBox";
|
||||
this.benchIdTextBox.Size = new System.Drawing.Size(57, 20);
|
||||
this.benchIdTextBox.TabIndex = 6;
|
||||
//
|
||||
// address1TextBox
|
||||
//
|
||||
this.address1TextBox.Enabled = false;
|
||||
this.address1TextBox.Location = new System.Drawing.Point(73, 86);
|
||||
this.address1TextBox.Name = "address1TextBox";
|
||||
this.address1TextBox.Size = new System.Drawing.Size(220, 20);
|
||||
this.address1TextBox.TabIndex = 8;
|
||||
//
|
||||
// address1Label
|
||||
//
|
||||
this.address1Label.AutoSize = true;
|
||||
this.address1Label.Location = new System.Drawing.Point(6, 89);
|
||||
this.address1Label.Name = "address1Label";
|
||||
this.address1Label.Size = new System.Drawing.Size(54, 13);
|
||||
this.address1Label.TabIndex = 7;
|
||||
this.address1Label.Text = "Address 1";
|
||||
//
|
||||
// address2TextBox
|
||||
//
|
||||
this.address2TextBox.Enabled = false;
|
||||
this.address2TextBox.Location = new System.Drawing.Point(73, 106);
|
||||
this.address2TextBox.Name = "address2TextBox";
|
||||
this.address2TextBox.Size = new System.Drawing.Size(220, 20);
|
||||
this.address2TextBox.TabIndex = 10;
|
||||
//
|
||||
// address2Label
|
||||
//
|
||||
this.address2Label.AutoSize = true;
|
||||
this.address2Label.Location = new System.Drawing.Point(6, 109);
|
||||
this.address2Label.Name = "address2Label";
|
||||
this.address2Label.Size = new System.Drawing.Size(54, 13);
|
||||
this.address2Label.TabIndex = 9;
|
||||
this.address2Label.Text = "Address 2";
|
||||
//
|
||||
// address3TextBox
|
||||
//
|
||||
this.address3TextBox.Enabled = false;
|
||||
this.address3TextBox.Location = new System.Drawing.Point(73, 126);
|
||||
this.address3TextBox.Name = "address3TextBox";
|
||||
this.address3TextBox.Size = new System.Drawing.Size(220, 20);
|
||||
this.address3TextBox.TabIndex = 12;
|
||||
//
|
||||
// address3Label
|
||||
//
|
||||
this.address3Label.AutoSize = true;
|
||||
this.address3Label.Location = new System.Drawing.Point(6, 129);
|
||||
this.address3Label.Name = "address3Label";
|
||||
this.address3Label.Size = new System.Drawing.Size(54, 13);
|
||||
this.address3Label.TabIndex = 11;
|
||||
this.address3Label.Text = "Address 3";
|
||||
//
|
||||
// address4TextBox
|
||||
//
|
||||
this.address4TextBox.Enabled = false;
|
||||
this.address4TextBox.Location = new System.Drawing.Point(73, 146);
|
||||
this.address4TextBox.Name = "address4TextBox";
|
||||
this.address4TextBox.Size = new System.Drawing.Size(220, 20);
|
||||
this.address4TextBox.TabIndex = 14;
|
||||
//
|
||||
// address4Label
|
||||
//
|
||||
this.address4Label.AutoSize = true;
|
||||
this.address4Label.Location = new System.Drawing.Point(6, 149);
|
||||
this.address4Label.Name = "address4Label";
|
||||
this.address4Label.Size = new System.Drawing.Size(54, 13);
|
||||
this.address4Label.TabIndex = 13;
|
||||
this.address4Label.Text = "Address 4";
|
||||
//
|
||||
// address5TextBox
|
||||
//
|
||||
this.address5TextBox.Enabled = false;
|
||||
this.address5TextBox.Location = new System.Drawing.Point(73, 166);
|
||||
this.address5TextBox.Name = "address5TextBox";
|
||||
this.address5TextBox.Size = new System.Drawing.Size(220, 20);
|
||||
this.address5TextBox.TabIndex = 16;
|
||||
//
|
||||
// address5Label
|
||||
//
|
||||
this.address5Label.AutoSize = true;
|
||||
this.address5Label.Location = new System.Drawing.Point(6, 169);
|
||||
this.address5Label.Name = "address5Label";
|
||||
this.address5Label.Size = new System.Drawing.Size(54, 13);
|
||||
this.address5Label.TabIndex = 15;
|
||||
this.address5Label.Text = "Address 5";
|
||||
//
|
||||
// approvedByTextBox
|
||||
//
|
||||
this.approvedByTextBox.Enabled = false;
|
||||
this.approvedByTextBox.Location = new System.Drawing.Point(113, 227);
|
||||
this.approvedByTextBox.Name = "approvedByTextBox";
|
||||
this.approvedByTextBox.Size = new System.Drawing.Size(180, 20);
|
||||
this.approvedByTextBox.TabIndex = 22;
|
||||
//
|
||||
// approvedByLabel
|
||||
//
|
||||
this.approvedByLabel.AutoSize = true;
|
||||
this.approvedByLabel.Location = new System.Drawing.Point(6, 230);
|
||||
this.approvedByLabel.Name = "approvedByLabel";
|
||||
this.approvedByLabel.Size = new System.Drawing.Size(67, 13);
|
||||
this.approvedByLabel.TabIndex = 21;
|
||||
this.approvedByLabel.Text = "Approved by";
|
||||
//
|
||||
// approvalDateTextBox
|
||||
//
|
||||
this.approvalDateTextBox.Enabled = false;
|
||||
this.approvalDateTextBox.Location = new System.Drawing.Point(113, 207);
|
||||
this.approvalDateTextBox.Name = "approvalDateTextBox";
|
||||
this.approvalDateTextBox.Size = new System.Drawing.Size(180, 20);
|
||||
this.approvalDateTextBox.TabIndex = 20;
|
||||
//
|
||||
// approvalDateLabel
|
||||
//
|
||||
this.approvalDateLabel.AutoSize = true;
|
||||
this.approvalDateLabel.Location = new System.Drawing.Point(6, 210);
|
||||
this.approvalDateLabel.Name = "approvalDateLabel";
|
||||
this.approvalDateLabel.Size = new System.Drawing.Size(73, 13);
|
||||
this.approvalDateLabel.TabIndex = 19;
|
||||
this.approvalDateLabel.Text = "Approval date";
|
||||
//
|
||||
// approvalIdTextBox
|
||||
//
|
||||
this.approvalIdTextBox.Enabled = false;
|
||||
this.approvalIdTextBox.Location = new System.Drawing.Point(113, 187);
|
||||
this.approvalIdTextBox.Name = "approvalIdTextBox";
|
||||
this.approvalIdTextBox.Size = new System.Drawing.Size(180, 20);
|
||||
this.approvalIdTextBox.TabIndex = 18;
|
||||
//
|
||||
// approvalIdLabel
|
||||
//
|
||||
this.approvalIdLabel.AutoSize = true;
|
||||
this.approvalIdLabel.Location = new System.Drawing.Point(6, 190);
|
||||
this.approvalIdLabel.Name = "approvalIdLabel";
|
||||
this.approvalIdLabel.Size = new System.Drawing.Size(61, 13);
|
||||
this.approvalIdLabel.TabIndex = 17;
|
||||
this.approvalIdLabel.Text = "Approval Id";
|
||||
//
|
||||
// benchNameTextBox
|
||||
//
|
||||
this.benchNameTextBox.Enabled = false;
|
||||
this.benchNameTextBox.Location = new System.Drawing.Point(113, 44);
|
||||
this.benchNameTextBox.Name = "benchNameTextBox";
|
||||
this.benchNameTextBox.Size = new System.Drawing.Size(180, 20);
|
||||
this.benchNameTextBox.TabIndex = 4;
|
||||
//
|
||||
// benchNameLabel
|
||||
//
|
||||
this.benchNameLabel.AutoSize = true;
|
||||
this.benchNameLabel.Location = new System.Drawing.Point(6, 46);
|
||||
this.benchNameLabel.Name = "benchNameLabel";
|
||||
this.benchNameLabel.Size = new System.Drawing.Size(90, 13);
|
||||
this.benchNameLabel.TabIndex = 3;
|
||||
this.benchNameLabel.Text = "Test bench name";
|
||||
//
|
||||
// ComponentCfgCtrl
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.benchNameTextBox);
|
||||
this.Controls.Add(this.benchNameLabel);
|
||||
this.Controls.Add(this.approvedByTextBox);
|
||||
this.Controls.Add(this.approvedByLabel);
|
||||
this.Controls.Add(this.approvalDateTextBox);
|
||||
this.Controls.Add(this.approvalDateLabel);
|
||||
this.Controls.Add(this.approvalIdTextBox);
|
||||
this.Controls.Add(this.approvalIdLabel);
|
||||
this.Controls.Add(this.address5TextBox);
|
||||
this.Controls.Add(this.address5Label);
|
||||
this.Controls.Add(this.address4TextBox);
|
||||
this.Controls.Add(this.address4Label);
|
||||
this.Controls.Add(this.address3TextBox);
|
||||
this.Controls.Add(this.address3Label);
|
||||
this.Controls.Add(this.address2TextBox);
|
||||
this.Controls.Add(this.address2Label);
|
||||
this.Controls.Add(this.address1TextBox);
|
||||
this.Controls.Add(this.address1Label);
|
||||
this.Controls.Add(this.benchIdTextBox);
|
||||
this.Controls.Add(this.benchIdLabel);
|
||||
this.Controls.Add(this.nameTextBox);
|
||||
this.Controls.Add(this.nameLabel);
|
||||
this.Controls.Add(this.classNameLabel);
|
||||
this.Name = "ComponentCfgCtrl";
|
||||
this.Size = new System.Drawing.Size(300, 250);
|
||||
this.Load += new System.EventHandler(this.EntryFormCfgCtrl_Load);
|
||||
this.ResumeLayout(false);
|
||||
this.PerformLayout();
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TextBox nameTextBox;
|
||||
private System.Windows.Forms.Label nameLabel;
|
||||
private System.Windows.Forms.Label classNameLabel;
|
||||
private System.Windows.Forms.Label benchIdLabel;
|
||||
private System.Windows.Forms.TextBox benchIdTextBox;
|
||||
private System.Windows.Forms.TextBox address1TextBox;
|
||||
private System.Windows.Forms.Label address1Label;
|
||||
private System.Windows.Forms.TextBox address2TextBox;
|
||||
private System.Windows.Forms.Label address2Label;
|
||||
private System.Windows.Forms.TextBox address3TextBox;
|
||||
private System.Windows.Forms.Label address3Label;
|
||||
private System.Windows.Forms.TextBox address4TextBox;
|
||||
private System.Windows.Forms.Label address4Label;
|
||||
private System.Windows.Forms.TextBox address5TextBox;
|
||||
private System.Windows.Forms.Label address5Label;
|
||||
private System.Windows.Forms.TextBox approvedByTextBox;
|
||||
private System.Windows.Forms.Label approvedByLabel;
|
||||
private System.Windows.Forms.TextBox approvalDateTextBox;
|
||||
private System.Windows.Forms.Label approvalDateLabel;
|
||||
private System.Windows.Forms.TextBox approvalIdTextBox;
|
||||
private System.Windows.Forms.Label approvalIdLabel;
|
||||
private System.Windows.Forms.TextBox benchNameTextBox;
|
||||
private System.Windows.Forms.Label benchNameLabel;
|
||||
}
|
||||
}
|
||||
@@ -94,7 +94,7 @@ namespace TBF.BenchControl
|
||||
}
|
||||
|
||||
|
||||
protected virtual XmlSerializer GetSerializer() { return new XmlSerializer(GetType()); }
|
||||
public virtual XmlSerializer GetSerializer() { return new XmlSerializer(GetType()); }
|
||||
|
||||
public Component CreateDbEntity()
|
||||
{
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace TBF.BenchControl.Configs.NameOnly
|
||||
public class TestMethodCfg : ComponentCfgBase, Generic.IComponentCfg
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(TestMethodCfg) })[0];
|
||||
protected override XmlSerializer GetSerializer() { return Serializer; }
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl() { return new TestMethodCfgCtrl(); }
|
||||
|
||||
|
||||
@@ -3,15 +3,13 @@
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.Configs.NameOnly
|
||||
{
|
||||
public partial class TestMethodCfgCtrl : UserControl, IComponentCfgCtrl
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(TestMethodCfgCtrl));
|
||||
|
||||
public bool ShowMore { get { return false; } }
|
||||
|
||||
TestMethodCfg config;
|
||||
|
||||
@@ -0,0 +1,193 @@
|
||||
///
|
||||
/// Copyright (c) 2018 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.Generic;
|
||||
using TBF.Resources;
|
||||
|
||||
namespace TBF.BenchControl.Configs.ParamsProvider
|
||||
{
|
||||
public partial class ComponentCfgCtrl : UserControl, IComponentCfgCtrl
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(ComponentCfgCtrl));
|
||||
|
||||
public bool ShowMore { get { return false; } }
|
||||
|
||||
|
||||
IParamsProvider paramsProvider;
|
||||
///
|
||||
public IComponentCfg Config
|
||||
{
|
||||
get
|
||||
{
|
||||
return paramsProvider as IComponentCfg;
|
||||
}
|
||||
set
|
||||
{
|
||||
paramsProvider = value as IParamsProvider;
|
||||
Redraw();
|
||||
}
|
||||
}
|
||||
|
||||
IList<string> parents;
|
||||
Control[] editors;
|
||||
CfgUpdateFlags flags;
|
||||
|
||||
public ComponentCfgCtrl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="paramsProvider">Parameters provider implementing IComponentCfg and IParamsProvider</param>
|
||||
/// <param name="parents">A list of parents or null, null hides parentComboBox</param>
|
||||
public ComponentCfgCtrl(IParamsProvider paramsProvider, IList<string> parents)
|
||||
: this()
|
||||
{
|
||||
this.paramsProvider = paramsProvider;
|
||||
this.parents = parents;
|
||||
|
||||
if (parents == null)
|
||||
{
|
||||
parentLabel.Visible = false;
|
||||
parentComboBox.Visible = false;
|
||||
}
|
||||
|
||||
editors = new Control[paramsProvider.ParamsCount()];
|
||||
for (int i = 0; i < paramsProvider.ParamsCount(); i++)
|
||||
{
|
||||
IList<string> values = paramsProvider.ParamValues(i);
|
||||
if (values == null)
|
||||
{
|
||||
editors[i] = new TextBox();
|
||||
}
|
||||
else
|
||||
{
|
||||
ComboBox cb = new ComboBox();
|
||||
foreach (var v in values) cb.Items.Add(v);
|
||||
editors[i] = cb;
|
||||
}
|
||||
editors[i].Visible = false;
|
||||
this.Controls.Add(editors[i]);
|
||||
}
|
||||
|
||||
flags = CfgUpdateFlags.None;
|
||||
|
||||
paramsListViewEx.SubItemClicked += new Results.Forms.SubItemEventHandler(paramsListViewEx_SubItemClicked);
|
||||
paramsListViewEx.SubItemEndEditing += new Results.Forms.SubItemEndEditingEventHandler(paramsListViewEx_SubItemEndEditing);
|
||||
}
|
||||
|
||||
void Localize()
|
||||
{
|
||||
componentClassLabel.Text = Strings.Component_class;
|
||||
nameLabel.Text = Strings.Name;
|
||||
parentLabel.Text = Strings.Parent_name;
|
||||
}
|
||||
|
||||
private void EntryFormCfgCtrl_Load(object sender, EventArgs e)
|
||||
{
|
||||
Localize();
|
||||
paramsListViewEx.Columns.Add(Strings.Parameter, 210);
|
||||
paramsListViewEx.Columns.Add(Strings.Value, 210);
|
||||
if (parents != null)
|
||||
{
|
||||
foreach (var p in parents) parentComboBox.Items.Add(p);
|
||||
}
|
||||
Redraw();
|
||||
}
|
||||
|
||||
public void Closing()
|
||||
{
|
||||
/// Close CmdResponse handlers here
|
||||
}
|
||||
|
||||
void Redraw()
|
||||
{
|
||||
if (paramsProvider == null) return; /// Control was not loaded, settings were not changed
|
||||
|
||||
componentClassTextBox.Text = Config.Factory.ClassName;
|
||||
nameTextBox.Text = Config.Name;
|
||||
|
||||
if (parents != null) parentComboBox.Text = Config.ParentName;
|
||||
|
||||
paramsListViewEx.Items.Clear();
|
||||
for (int i = 0; i < paramsProvider.ParamsCount(); i++)
|
||||
{
|
||||
ListViewItem lvi = new ListViewItem(paramsProvider.ParamName(i));
|
||||
lvi.SubItems.Add(paramsProvider.ToString(i));
|
||||
lvi.Tag = i;
|
||||
paramsListViewEx.Items.Add(lvi);
|
||||
}
|
||||
}
|
||||
|
||||
public void Unlock()
|
||||
{
|
||||
nameTextBox.Enabled = true;
|
||||
if (parents != null) parentComboBox.Enabled = true;
|
||||
paramsListViewEx.Enabled = true;
|
||||
}
|
||||
|
||||
public CfgUpdateFlags VerifyCfg(ref string message)
|
||||
{
|
||||
if (parents == null) return CfgUpdateFlags.None;
|
||||
|
||||
/// Verify the parent
|
||||
foreach (var item in parentComboBox.Items)
|
||||
{
|
||||
if (parentComboBox.Text == item.ToString()) return CfgUpdateFlags.None;
|
||||
}
|
||||
|
||||
message += Environment.NewLine + string.Format(Strings.Invalid_0, parentLabel.Text);
|
||||
return CfgUpdateFlags.Error;
|
||||
}
|
||||
|
||||
public CfgUpdateFlags UpdateCfg()
|
||||
{
|
||||
if (paramsProvider == null) return CfgUpdateFlags.Error; /// Control was not loaded, settings were not changed
|
||||
|
||||
CfgUpdateFlags f = this.flags;
|
||||
|
||||
if (Config.Name != nameTextBox.Text)
|
||||
{
|
||||
Config.Name = nameTextBox.Text;
|
||||
f |= CfgUpdateFlags.RestartRqrd;
|
||||
}
|
||||
|
||||
if (parents != null)
|
||||
{
|
||||
if (Config.ParentName != parentComboBox.Text)
|
||||
{
|
||||
Config.ParentName = parentComboBox.Text;
|
||||
f |= CfgUpdateFlags.RestartRqrd;
|
||||
}
|
||||
}
|
||||
|
||||
return f;
|
||||
}
|
||||
|
||||
private void paramsListViewEx_SubItemClicked(object sender, Results.Forms.SubItemEventArgs e)
|
||||
{
|
||||
if (e.SubItem != 1) return;
|
||||
int itemNr = (int)e.Item.Tag;
|
||||
paramsListViewEx.StartEditing(editors[itemNr], e.Item, e.SubItem);
|
||||
}
|
||||
|
||||
private void paramsListViewEx_SubItemEndEditing(object sender, Results.Forms.SubItemEndEditingEventArgs e)
|
||||
{
|
||||
if (e.SubItem != 1) return;
|
||||
int itemNr = (int)e.Item.Tag;
|
||||
|
||||
string message;
|
||||
if (paramsProvider.ValidateParam(itemNr, e.DisplayText, out message))
|
||||
{
|
||||
flags |= paramsProvider.UpdateParam(itemNr, e.DisplayText);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,171 @@
|
||||
///
|
||||
/// Copyright (c) 2018 Sensus Slovensko a.s.
|
||||
///
|
||||
namespace TBF.BenchControl.Configs.ParamsProvider
|
||||
{
|
||||
partial class ComponentCfgCtrl
|
||||
{
|
||||
/// <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 Component 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.nameTextBox = new System.Windows.Forms.TextBox();
|
||||
this.nameLabel = new System.Windows.Forms.Label();
|
||||
this.splitContainer1 = new System.Windows.Forms.SplitContainer();
|
||||
this.parentComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.parentLabel = new System.Windows.Forms.Label();
|
||||
this.componentClassLabel = new System.Windows.Forms.Label();
|
||||
this.componentClassTextBox = new System.Windows.Forms.TextBox();
|
||||
this.paramsListViewEx = new Results.Forms.ListViewEx();
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).BeginInit();
|
||||
this.splitContainer1.Panel1.SuspendLayout();
|
||||
this.splitContainer1.Panel2.SuspendLayout();
|
||||
this.splitContainer1.SuspendLayout();
|
||||
this.SuspendLayout();
|
||||
//
|
||||
// nameTextBox
|
||||
//
|
||||
this.nameTextBox.Enabled = false;
|
||||
this.nameTextBox.Location = new System.Drawing.Point(161, 30);
|
||||
this.nameTextBox.Name = "nameTextBox";
|
||||
this.nameTextBox.Size = new System.Drawing.Size(262, 20);
|
||||
this.nameTextBox.TabIndex = 5;
|
||||
//
|
||||
// nameLabel
|
||||
//
|
||||
this.nameLabel.AutoSize = true;
|
||||
this.nameLabel.Location = new System.Drawing.Point(6, 33);
|
||||
this.nameLabel.Name = "nameLabel";
|
||||
this.nameLabel.Size = new System.Drawing.Size(35, 13);
|
||||
this.nameLabel.TabIndex = 4;
|
||||
this.nameLabel.Text = "Name";
|
||||
//
|
||||
// splitContainer1
|
||||
//
|
||||
this.splitContainer1.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.splitContainer1.FixedPanel = System.Windows.Forms.FixedPanel.Panel1;
|
||||
this.splitContainer1.IsSplitterFixed = true;
|
||||
this.splitContainer1.Location = new System.Drawing.Point(0, 0);
|
||||
this.splitContainer1.Name = "splitContainer1";
|
||||
this.splitContainer1.Orientation = System.Windows.Forms.Orientation.Horizontal;
|
||||
//
|
||||
// splitContainer1.Panel1
|
||||
//
|
||||
this.splitContainer1.Panel1.Controls.Add(this.parentComboBox);
|
||||
this.splitContainer1.Panel1.Controls.Add(this.parentLabel);
|
||||
this.splitContainer1.Panel1.Controls.Add(this.componentClassLabel);
|
||||
this.splitContainer1.Panel1.Controls.Add(this.componentClassTextBox);
|
||||
this.splitContainer1.Panel1.Controls.Add(this.nameLabel);
|
||||
this.splitContainer1.Panel1.Controls.Add(this.nameTextBox);
|
||||
//
|
||||
// splitContainer1.Panel2
|
||||
//
|
||||
this.splitContainer1.Panel2.Controls.Add(this.paramsListViewEx);
|
||||
this.splitContainer1.Size = new System.Drawing.Size(444, 353);
|
||||
this.splitContainer1.SplitterDistance = 80;
|
||||
this.splitContainer1.TabIndex = 6;
|
||||
//
|
||||
// parentComboBox
|
||||
//
|
||||
this.parentComboBox.Enabled = false;
|
||||
this.parentComboBox.FormattingEnabled = true;
|
||||
this.parentComboBox.Location = new System.Drawing.Point(161, 52);
|
||||
this.parentComboBox.Name = "parentComboBox";
|
||||
this.parentComboBox.Size = new System.Drawing.Size(262, 21);
|
||||
this.parentComboBox.TabIndex = 9;
|
||||
//
|
||||
// parentLabel
|
||||
//
|
||||
this.parentLabel.AutoSize = true;
|
||||
this.parentLabel.Location = new System.Drawing.Point(6, 55);
|
||||
this.parentLabel.Name = "parentLabel";
|
||||
this.parentLabel.Size = new System.Drawing.Size(38, 13);
|
||||
this.parentLabel.TabIndex = 8;
|
||||
this.parentLabel.Text = "Parent";
|
||||
//
|
||||
// componentClassLabel
|
||||
//
|
||||
this.componentClassLabel.AutoSize = true;
|
||||
this.componentClassLabel.Location = new System.Drawing.Point(6, 11);
|
||||
this.componentClassLabel.Name = "componentClassLabel";
|
||||
this.componentClassLabel.Size = new System.Drawing.Size(89, 13);
|
||||
this.componentClassLabel.TabIndex = 7;
|
||||
this.componentClassLabel.Text = "Component Class";
|
||||
//
|
||||
// componentClassTextBox
|
||||
//
|
||||
this.componentClassTextBox.Enabled = false;
|
||||
this.componentClassTextBox.Location = new System.Drawing.Point(161, 8);
|
||||
this.componentClassTextBox.Name = "componentClassTextBox";
|
||||
this.componentClassTextBox.Size = new System.Drawing.Size(262, 20);
|
||||
this.componentClassTextBox.TabIndex = 6;
|
||||
//
|
||||
// paramsListViewEx
|
||||
//
|
||||
this.paramsListViewEx.AllowColumnReorder = true;
|
||||
this.paramsListViewEx.Dock = System.Windows.Forms.DockStyle.Fill;
|
||||
this.paramsListViewEx.DoubleClickActivation = false;
|
||||
this.paramsListViewEx.Enabled = false;
|
||||
this.paramsListViewEx.FullRowSelect = true;
|
||||
this.paramsListViewEx.GridLines = true;
|
||||
this.paramsListViewEx.LabelWrap = false;
|
||||
this.paramsListViewEx.Location = new System.Drawing.Point(0, 0);
|
||||
this.paramsListViewEx.Name = "paramsListViewEx";
|
||||
this.paramsListViewEx.Size = new System.Drawing.Size(444, 269);
|
||||
this.paramsListViewEx.TabIndex = 0;
|
||||
this.paramsListViewEx.UseCompatibleStateImageBehavior = false;
|
||||
this.paramsListViewEx.View = System.Windows.Forms.View.Details;
|
||||
this.paramsListViewEx.SubItemClicked += new Results.Forms.SubItemEventHandler(this.paramsListViewEx_SubItemClicked);
|
||||
this.paramsListViewEx.SubItemEndEditing += new Results.Forms.SubItemEndEditingEventHandler(this.paramsListViewEx_SubItemEndEditing);
|
||||
//
|
||||
// ComponentCfgCtrl
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.splitContainer1);
|
||||
this.Name = "ComponentCfgCtrl";
|
||||
this.Size = new System.Drawing.Size(444, 353);
|
||||
this.Load += new System.EventHandler(this.EntryFormCfgCtrl_Load);
|
||||
this.splitContainer1.Panel1.ResumeLayout(false);
|
||||
this.splitContainer1.Panel1.PerformLayout();
|
||||
this.splitContainer1.Panel2.ResumeLayout(false);
|
||||
((System.ComponentModel.ISupportInitialize)(this.splitContainer1)).EndInit();
|
||||
this.splitContainer1.ResumeLayout(false);
|
||||
this.ResumeLayout(false);
|
||||
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
private System.Windows.Forms.TextBox nameTextBox;
|
||||
private System.Windows.Forms.Label nameLabel;
|
||||
private System.Windows.Forms.SplitContainer splitContainer1;
|
||||
private System.Windows.Forms.ComboBox parentComboBox;
|
||||
private System.Windows.Forms.Label parentLabel;
|
||||
private System.Windows.Forms.Label componentClassLabel;
|
||||
private System.Windows.Forms.TextBox componentClassTextBox;
|
||||
private Results.Forms.ListViewEx paramsListViewEx;
|
||||
}
|
||||
}
|
||||
@@ -31,7 +31,7 @@ namespace TBF.BenchControl.DB.SensusOracle
|
||||
public class DatabaseCfg : ComponentCfgBase, Generic.IComponentCfg
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(DatabaseCfg) })[0];
|
||||
protected override XmlSerializer GetSerializer() { return Serializer; }
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl() { return new DatabaseCfgCtrl(); }
|
||||
|
||||
|
||||
@@ -4,15 +4,13 @@
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.DB.SensusOracle
|
||||
{
|
||||
public partial class DatabaseCfgCtrl : UserControl, IComponentCfgCtrl
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(DatabaseCfgCtrl));
|
||||
|
||||
public bool ShowMore { get { return false; } }
|
||||
|
||||
DatabaseCfg config;
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace TBF.BenchControl.Danfoss.VLT2800
|
||||
public class PumpCfg : ComponentCfgBase, Generic.IComponentCfg
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(PumpCfg) })[0];
|
||||
protected override XmlSerializer GetSerializer() { return Serializer; }
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl() { return new PumpCfgCtrl(); }
|
||||
|
||||
|
||||
@@ -4,15 +4,13 @@
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using System.IO.Ports;
|
||||
using log4net;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.Danfoss.VLT2800
|
||||
{
|
||||
public partial class PumpCfgCtrl : UserControl, IComponentCfgCtrl
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(PumpCfgCtrl));
|
||||
|
||||
public bool ShowMore { get { return false; } }
|
||||
|
||||
PumpCfg config;
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace TBF.BenchControl.DataEntry.Combined
|
||||
public class EntryFormCfg : ComponentCfgBase, Generic.IComponentCfg
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(EntryFormCfg) })[0];
|
||||
protected override XmlSerializer GetSerializer() { return Serializer; }
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl() { return new EntryFormCfgCtrl(); }
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.Generic;
|
||||
using TBF.Resources;
|
||||
|
||||
@@ -11,8 +11,6 @@ namespace TBF.BenchControl.DataEntry.Combined
|
||||
{
|
||||
public partial class EntryFormCfgCtrl : UserControl, IComponentCfgCtrl
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(EntryFormCfgCtrl));
|
||||
|
||||
public bool ShowMore { get { return false; } }
|
||||
|
||||
EntryFormCfg config;
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace TBF.BenchControl.DataEntry.HeatMeters12
|
||||
public class EntryFormCfg : ComponentCfgBase, Generic.IComponentCfg
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(EntryFormCfg) })[0];
|
||||
protected override XmlSerializer GetSerializer() { return Serializer; }
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl() { return new EntryFormCfgCtrl(); }
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.Generic;
|
||||
using TBF.Resources;
|
||||
using Config;
|
||||
@@ -12,8 +12,6 @@ namespace TBF.BenchControl.DataEntry.HeatMeters12
|
||||
{
|
||||
public partial class EntryFormCfgCtrl : UserControl, IComponentCfgCtrl
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(EntryFormCfgCtrl));
|
||||
|
||||
public bool ShowMore { get { return false; } }
|
||||
|
||||
EntryFormCfg config;
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace TBF.BenchControl.DataEntry.HeatMeters6
|
||||
public class EntryFormCfg : ComponentCfgBase, Generic.IComponentCfg
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(EntryFormCfg) })[0];
|
||||
protected override XmlSerializer GetSerializer() { return Serializer; }
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl() { return new EntryFormCfgCtrl(); }
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.Generic;
|
||||
using TBF.Resources;
|
||||
using Config;
|
||||
@@ -12,8 +12,6 @@ namespace TBF.BenchControl.DataEntry.HeatMeters6
|
||||
{
|
||||
public partial class EntryFormCfgCtrl : UserControl, IComponentCfgCtrl
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(EntryFormCfgCtrl));
|
||||
|
||||
public bool ShowMore { get { return false; } }
|
||||
|
||||
EntryFormCfg config;
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace TBF.BenchControl.DataEntry.Munich
|
||||
public class EntryFormCfg : ComponentCfgBase, Generic.IComponentCfg
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(EntryFormCfg) })[0];
|
||||
protected override XmlSerializer GetSerializer() { return Serializer; }
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl() { return new EntryFormCfgCtrl(); }
|
||||
|
||||
|
||||
@@ -3,15 +3,13 @@
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.DataEntry.Munich
|
||||
{
|
||||
public partial class EntryFormCfgCtrl : UserControl, IComponentCfgCtrl
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(EntryFormCfgCtrl));
|
||||
|
||||
public bool ShowMore { get { return false; } }
|
||||
|
||||
EntryFormCfg config;
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace TBF.BenchControl.DataEntry.Munich3
|
||||
public class EntryFormCfg : ComponentCfgBase, Generic.IComponentCfg
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(EntryFormCfg) })[0];
|
||||
protected override XmlSerializer GetSerializer() { return Serializer; }
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl() { return new EntryFormCfgCtrl(); }
|
||||
|
||||
|
||||
@@ -3,15 +3,13 @@
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.DataEntry.Munich3
|
||||
{
|
||||
public partial class EntryFormCfgCtrl : UserControl, IComponentCfgCtrl
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(EntryFormCfgCtrl));
|
||||
|
||||
public bool ShowMore { get { return false; } }
|
||||
|
||||
EntryFormCfg config;
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace TBF.BenchControl.DataEntry.Standard12
|
||||
public class EntryFormCfg : ComponentCfgBase, Generic.IComponentCfg
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(EntryFormCfg) })[0];
|
||||
protected override XmlSerializer GetSerializer() { return Serializer; }
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl() { return new EntryFormCfgCtrl(); }
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.Generic;
|
||||
using TBF.Resources;
|
||||
|
||||
@@ -11,8 +11,6 @@ namespace TBF.BenchControl.DataEntry.Standard12
|
||||
{
|
||||
public partial class EntryFormCfgCtrl : UserControl, IComponentCfgCtrl
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(EntryFormCfgCtrl));
|
||||
|
||||
public bool ShowMore { get { return false; } }
|
||||
|
||||
EntryFormCfg config;
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace TBF.BenchControl.DataEntry.Standard24
|
||||
public class EntryFormCfg : ComponentCfgBase, Generic.IComponentCfg
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(EntryFormCfg) })[0];
|
||||
protected override XmlSerializer GetSerializer() { return Serializer; }
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl() { return new EntryFormCfgCtrl(); }
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.Generic;
|
||||
using TBF.Resources;
|
||||
|
||||
@@ -11,8 +11,6 @@ namespace TBF.BenchControl.DataEntry.Standard24
|
||||
{
|
||||
public partial class EntryFormCfgCtrl : UserControl, IComponentCfgCtrl
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(EntryFormCfgCtrl));
|
||||
|
||||
public bool ShowMore { get { return false; } }
|
||||
|
||||
EntryFormCfg config;
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace TBF.BenchControl.DataEntry.Standard48
|
||||
public class EntryFormCfg : ComponentCfgBase, Generic.IComponentCfg
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(EntryFormCfg) })[0];
|
||||
protected override XmlSerializer GetSerializer() { return Serializer; }
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl() { return new EntryFormCfgCtrl(); }
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.Generic;
|
||||
using TBF.Resources;
|
||||
|
||||
@@ -11,8 +11,6 @@ namespace TBF.BenchControl.DataEntry.Standard48
|
||||
{
|
||||
public partial class EntryFormCfgCtrl : UserControl, IComponentCfgCtrl
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(EntryFormCfgCtrl));
|
||||
|
||||
public bool ShowMore { get { return false; } }
|
||||
|
||||
EntryFormCfg config;
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace TBF.BenchControl.DataEntry.Standard6
|
||||
public class EntryFormCfg : ComponentCfgBase, Generic.IComponentCfg
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(EntryFormCfg) })[0];
|
||||
protected override XmlSerializer GetSerializer() { return Serializer; }
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl() { return new EntryFormCfgCtrl(); }
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.Generic;
|
||||
using TBF.Resources;
|
||||
|
||||
@@ -11,8 +11,6 @@ namespace TBF.BenchControl.DataEntry.Standard6
|
||||
{
|
||||
public partial class EntryFormCfgCtrl : UserControl, IComponentCfgCtrl
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(EntryFormCfgCtrl));
|
||||
|
||||
public bool ShowMore { get { return false; } }
|
||||
|
||||
EntryFormCfg config;
|
||||
|
||||
@@ -10,7 +10,7 @@ namespace TBF.BenchControl.DataEntry.StandardCamera
|
||||
public class EntryFormCfg : ComponentCfgBase, Generic.IComponentCfg
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(EntryFormCfg) })[0];
|
||||
protected override XmlSerializer GetSerializer() { return Serializer; }
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl() { return new EntryFormCfgCtrl(); }
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.Generic;
|
||||
using TBF.Resources;
|
||||
|
||||
@@ -11,8 +11,6 @@ namespace TBF.BenchControl.DataEntry.StandardCamera
|
||||
{
|
||||
public partial class EntryFormCfgCtrl : UserControl, IComponentCfgCtrl
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(EntryFormCfgCtrl));
|
||||
|
||||
public bool ShowMore { get { return false; } }
|
||||
|
||||
EntryFormCfg config;
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace TBF.BenchControl.DataEntry.WMStates
|
||||
public class EntryFormCfg : ComponentCfgBase, Generic.IComponentCfg
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(EntryFormCfg) })[0];
|
||||
protected override XmlSerializer GetSerializer() { return Serializer; }
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl() { return new EntryFormCfgCtrl(); }
|
||||
|
||||
|
||||
@@ -3,15 +3,13 @@
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.DataEntry.WMStates
|
||||
{
|
||||
public partial class EntryFormCfgCtrl : UserControl, IComponentCfgCtrl
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(EntryFormCfgCtrl));
|
||||
|
||||
public bool ShowMore { get { return false; } }
|
||||
|
||||
EntryFormCfg config;
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace TBF.BenchControl.DataEntry.iPerl
|
||||
public class EntryFormCfg : ComponentCfgBase, Generic.IComponentCfg
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(EntryFormCfg) })[0];
|
||||
protected override XmlSerializer GetSerializer() { return Serializer; }
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl() { return new EntryFormCfgCtrl(); }
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.Generic;
|
||||
using TBF.Resources;
|
||||
|
||||
@@ -11,8 +11,6 @@ namespace TBF.BenchControl.DataEntry.iPerl
|
||||
{
|
||||
public partial class EntryFormCfgCtrl : UserControl, IComponentCfgCtrl
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(EntryFormCfgCtrl));
|
||||
|
||||
public bool ShowMore { get { return false; } }
|
||||
|
||||
EntryFormCfg config;
|
||||
|
||||
@@ -27,7 +27,10 @@ namespace TBF.BenchControl.Dummy.Diverter
|
||||
log.Debug(this.ToString());
|
||||
}
|
||||
|
||||
bool state;
|
||||
public bool State { get { return state; } }
|
||||
}
|
||||
public int DiverterNr { get { return 0; } }
|
||||
public bool State { get { return false; } }
|
||||
public int ThresholdGate { get { return 50; } }
|
||||
public int ThresholdLo { get { return 10; } }
|
||||
public int ThresholdHi { get { return 90; } }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace TBF.BenchControl.Dummy.FlowMeter
|
||||
public class FlowMeterCfg : ComponentCfgBase, IComponentCfg
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(FlowMeterCfg) })[0];
|
||||
protected override XmlSerializer GetSerializer() { return Serializer; }
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl() { return new FlowMeterCfgCtrl(); }
|
||||
|
||||
|
||||
@@ -4,15 +4,13 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.Dummy.FlowMeter
|
||||
{
|
||||
public partial class FlowMeterCfgCtrl : UserControl, IComponentCfgCtrl
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(FlowMeterCfgCtrl));
|
||||
|
||||
ComponentParametersDlg parent;
|
||||
|
||||
public bool ShowMore { get { return false; } }
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace TBF.BenchControl.Dummy.RegulValve
|
||||
public class RegulValveCfg : ComponentCfgBase, IComponentCfg
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(RegulValveCfg) })[0];
|
||||
protected override XmlSerializer GetSerializer() { return Serializer; }
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl() { return new RegulValveCfgCtrl(); }
|
||||
|
||||
|
||||
@@ -3,15 +3,13 @@
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.Dummy.RegulValve
|
||||
{
|
||||
public partial class RegulValveCfgCtrl : UserControl, IComponentCfgCtrl
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(RegulValveCfgCtrl));
|
||||
|
||||
ComponentParametersDlg parent;
|
||||
|
||||
public bool ShowMore { get { return true; } }
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace TBF.BenchControl.Elde
|
||||
EnduranceCycleStop = 13,
|
||||
}
|
||||
|
||||
#if FUZHOU300 || PT200IL || TORINO50 || BADGER_MALA_TRAT || BADGER_STREDNA_TRAT || TURA_IPERL || TURA_SPECIAL || BADGER_VELKA_TRAT || PUCHONG_PT200 || SLM_50 || GENESIS || MALTA_WSD25 || SLM_END || WARSAW_END || BERLIN || SLM_150 || PETERSBURG_50 || PETERSBURG_200 || KEMPNO_50 || BAHRAIN_50 || RUM_MOB || KRAKOW_50 || JUZNA_AFRIKA_50 || ZAMBIA || SENTEC
|
||||
#if FUZHOU300 || PT200IL || TORINO50 || BADGER_MALA_TRAT || BADGER_STREDNA_TRAT || TURA_IPERL || TURA_SPECIAL || BADGER_VELKA_TRAT || PUCHONG_PT200 || SLM_50 || GENESIS || MALTA_WSD25 || SLM_END || WARSAW_END || BERLIN || SLM_150 || PETERSBURG_50 || PETERSBURG_200 || KEMPNO_50 || BAHRAIN_50 || RUM_MOB || KRAKOW_50 || JUZNA_AFRIKA_50 || ZAMBIA || SENTEC || FUZHOU100
|
||||
public enum StatusP : ulong
|
||||
{
|
||||
RefFlowMeterMask = 0x7, /// bits 0,1,2
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace TBF.BenchControl.Elde
|
||||
public class ControlBoardCfg : ComponentCfgBase, IComponentCfg
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(ControlBoardCfg) })[0];
|
||||
protected override XmlSerializer GetSerializer() { return Serializer; }
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl() { return new ControlBoardCfgCtrl(); }
|
||||
|
||||
|
||||
@@ -3,15 +3,13 @@
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.Elde
|
||||
{
|
||||
public partial class ControlBoardCfgCtrl : UserControl, IComponentCfgCtrl
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(ControlBoardCfgCtrl));
|
||||
|
||||
public bool ShowMore { get { return false; } }
|
||||
|
||||
ControlBoardCfg config;
|
||||
|
||||
@@ -58,7 +58,7 @@ namespace TBF.BenchControl.Elde
|
||||
public uint BeginState(int wmNr0) { return controlCom.BeginState(wmNr0); }
|
||||
public double ReferenceFlow { get { return controlCom.ReferenceFlow; } }
|
||||
public float RValvePosition(int rvNr1) { return controlCom.RValvePosition(rvNr1); }
|
||||
public float DivSamples(int ms) { return controlCom.DivSamples(ms); }
|
||||
public float DivSamples(int time, int divIx0) { return controlCom.DivSamples(time, divIx0); } /// Time unit is 2 ms
|
||||
public int ScopeSamples(int i, int j, int k) { return controlCom.ScopeSamples(i, j, k); }
|
||||
public ulong DigitalInputs { get { return controlCom.DigitalInputs; } }
|
||||
public float AnalogInput(int adcNr0) { return controlCom.AnalogInput(adcNr0); }
|
||||
@@ -137,7 +137,7 @@ namespace TBF.BenchControl.Elde
|
||||
{100,500}, {100,500}, {100,500}, {100,500} };
|
||||
public byte[] MeretRS485Address = new byte[4];
|
||||
public float[] EtCalib = new float[7] { 1, 1, 1, 1, 1, 1, 1 };
|
||||
#elif MUNICH || TORINO50 || BADGER_MALA_TRAT || BADGER_STREDNA_TRAT || TORUN_PT50_2015 || CEVAK_PT40_272 || TURA_IPERL || TURA_SPECIAL || MURES_PT40 || FUZHOU_40 || SLM_50 || PETERSBURG_50 || KEMPNO_50 || BAHRAIN_50 || KRAKOW_50 || JUZNA_AFRIKA_50 || ZAMBIA
|
||||
#elif MUNICH || TORINO50 || BADGER_MALA_TRAT || BADGER_STREDNA_TRAT || TORUN_PT50_2015 || CEVAK_PT40_272 || TURA_IPERL || TURA_SPECIAL || MURES_PT40 || FUZHOU_40 || SLM_50 || PETERSBURG_50 || KEMPNO_50 || BAHRAIN_50 || KRAKOW_50 || JUZNA_AFRIKA_50 || ZAMBIA || FUZHOU100
|
||||
public uint[,] RegValveCalib = new uint[8,2] {{100,500},{100,500},{100,500},{100,500},{100,500},{100,500},{100,500},{100,500}};
|
||||
public byte[] MeretRS485Address = new byte[4];
|
||||
public float[] EtCalib = new float[5] { 1, 1, 1, 1, 1 };
|
||||
@@ -314,12 +314,12 @@ namespace TBF.BenchControl.Elde
|
||||
{
|
||||
int divertersCount = BenchControl.Elde.Diverter.Diverter.DivertersCount;
|
||||
|
||||
DiverterEdge = new uint[divertersCount * 2];
|
||||
DiverterEdge = new uint[divertersCount];
|
||||
for (int i = 0; i < divertersCount; i++)
|
||||
{
|
||||
DiverterEdge[2 * i] = (uint)BenchControl.Elde.Diverter.Diverter.DivStartingLevelPct[i];
|
||||
DiverterEdge[2 * i + 1] = (uint)BenchControl.Elde.Diverter.Diverter.DivStoppingLevelPct[i];
|
||||
controlCom.SetDivLimit(i, 10, 90);
|
||||
DiverterEdge[i] = (uint)BenchControl.Elde.Diverter.Diverter.Diverters[i].ThresholdGate;
|
||||
controlCom.SetDivLimit(i, (uint)BenchControl.Elde.Diverter.Diverter.Diverters[i].ThresholdLo,
|
||||
(uint)BenchControl.Elde.Diverter.Diverter.Diverters[i].ThresholdHi);
|
||||
}
|
||||
|
||||
controlCom.SendCalibData(RegValveCalib,
|
||||
@@ -598,14 +598,20 @@ namespace TBF.BenchControl.Elde
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Starts the measurement.
|
||||
/// Events: MeasurementStarted
|
||||
/// Read diverter samples from the control board and calculated the transition time.
|
||||
/// Events: Event.None
|
||||
/// </summary>
|
||||
/// <param name="flowMeter">Flow meter</param>
|
||||
/// <param name="readers">An array of register readers</param>
|
||||
/// <param name="refPulses">Number of reference pulses to complete the test</param>
|
||||
/// <param name="div">Diverter</param>
|
||||
/// <param name="runsCountWhenSendingCmd">State machine ticks from test start/end when diverter read command is issued (obsolete)</param>
|
||||
/// <param name="runsCountWhenReadingDiv">State machine ticks from test start/end when diverter samples are read</param>
|
||||
/// <param name="transitionTimeSec">FloatBox for the resulting transition time in s</param>
|
||||
/// <param name="plotter">Statistics for plotting diverter transitions</param>
|
||||
/// <param name="batchNr">Batch number</param>
|
||||
/// <param name="testName">Test name (without repetitions)</param>
|
||||
/// <param name="repetition">Repetition number</param>
|
||||
/// <returns>Created operation</returns>
|
||||
public IOperation ReadDiverterTransitionOp(int runsCountWhenSendingCmd, int runsCountWhenReadingDiv, TBF.Boxes.FloatBox tStart, TBF.Boxes.FloatBox tEnd)
|
||||
public IOperation ReadDiverterTransitionOp(IDiverter div, int runsCountWhenSendingCmd, int runsCountWhenReadingDiv, TBF.Boxes.FloatBox transitionTimeSec,
|
||||
Sequences.Statistics plotter, int batchNr, string testName, int repetition)
|
||||
{
|
||||
if (controlBoardCfg.DebugLevel == DebugMode.Simulate)
|
||||
{
|
||||
@@ -613,7 +619,7 @@ namespace TBF.BenchControl.Elde
|
||||
}
|
||||
else
|
||||
{
|
||||
return new ReadDiverterTransitionOp(this, runsCountWhenSendingCmd, runsCountWhenReadingDiv, tStart, tEnd);
|
||||
return new ReadDiverterTransitionOp(this, div, runsCountWhenSendingCmd, runsCountWhenReadingDiv, transitionTimeSec, plotter, batchNr, testName, repetition);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ namespace TBF.BenchControl.Elde
|
||||
public float ReferenceFlow { get { return referenceFlow; } }
|
||||
|
||||
public float RValvePosition(int rvNr1) { return 0; }
|
||||
public float DivSamples(int ms) { return 0; }
|
||||
public float DivSamples(int ms, int divIx0) { return 0; }
|
||||
public int ScopeSamples(int i, int j, int k) { return 0; }
|
||||
public ulong DigitalInputs { get { return 0; } }
|
||||
public float AnalogInput(int adcNr0) { return 0; }
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace TBF.BenchControl.Elde
|
||||
|
||||
public int EtPulses(int wmNr1) { return (int)ctrlBrdComponent.etPulses[wmNr1]; }
|
||||
|
||||
#if GENESIS || BERLIN || SLM_150 || PETERSBURG_50 || PETERSBURG_200 || KEMPNO_50 || BAHRAIN_50 || RUM_MOB || KRAKOW_50 || JUZNA_AFRIKA_50 || ZAMBIA || SENTEC
|
||||
#if GENESIS || BERLIN || SLM_150 || PETERSBURG_50 || PETERSBURG_200 || KEMPNO_50 || BAHRAIN_50 || RUM_MOB || KRAKOW_50 || JUZNA_AFRIKA_50 || ZAMBIA || SENTEC || FUZHOU100
|
||||
public int EtPulsesK { get { return (int)ctrlBrdComponent.etPulsesK; } }
|
||||
#else
|
||||
public int EtPulsesK { get { return 1; } }
|
||||
@@ -53,7 +53,7 @@ namespace TBF.BenchControl.Elde
|
||||
public UInt128 RRoute { get { return ctrlBrdComponent.rRoute; } }
|
||||
#endif
|
||||
|
||||
#if GENESIS || KEMPNO_50 || KRAKOW_50 || BAHRAIN_50 || BADGER_STREDNA_TRAT || JUZNA_AFRIKA_50 || ZAMBIA || SENTEC
|
||||
#if GENESIS || KEMPNO_50 || KRAKOW_50 || BAHRAIN_50 || BADGER_STREDNA_TRAT || JUZNA_AFRIKA_50 || ZAMBIA || SENTEC || FUZHOU100
|
||||
public uint DivTime(int id) { return ctrlBrdComponent.divTime[id]; }
|
||||
public void SetDivLimit(int divNo, uint limLoPct, uint limHiPct)
|
||||
{
|
||||
@@ -84,7 +84,14 @@ namespace TBF.BenchControl.Elde
|
||||
//return ctrlBrdComponent.RValvePosition[rvNr1 - 1];
|
||||
return ctrlBrdComponent.Analogy[rvNr1 - 1]; /// Fixes bug: RValvePosition returns 0 all the time
|
||||
}
|
||||
public float DivSamples(int ms) { return ctrlBrdComponent.DIVSamples[ms, 0]; }
|
||||
public float DivSamples(int time, int divIx0)
|
||||
{
|
||||
#if MUNICH
|
||||
return ctrlBrdComponent.DIVSamples[time, 0];
|
||||
#else
|
||||
return ctrlBrdComponent.DIVSamples[time, divIx0];
|
||||
#endif
|
||||
} /// Time unit is 2 ms
|
||||
public int ScopeSamples(int i, int j, int k) { return ctrlBrdComponent.ScopeSamples[i, j, k]; }
|
||||
public ulong DigitalInputs { get { return (ulong)ctrlBrdComponent.Vstupy; } }
|
||||
public float AnalogInput(int adcNr0) { return ctrlBrdComponent.Analogy[adcNr0]; }
|
||||
@@ -106,7 +113,7 @@ namespace TBF.BenchControl.Elde
|
||||
public uint[] WMeterCont { get { return new uint[3]; } } /// Dummy
|
||||
#endif
|
||||
|
||||
#if KEMPNO_50 || KRAKOW_50 || JUZNA_AFRIKA_50 || ZAMBIA
|
||||
#if KEMPNO_50 || KRAKOW_50 || JUZNA_AFRIKA_50 || ZAMBIA || FUZHOU100
|
||||
public float ValveOpenCloseTime { get { return ctrlBrdComponent.ValveMoveTime[0]; } }
|
||||
#else
|
||||
public float ValveOpenCloseTime { get { return 0.001f; } }
|
||||
@@ -372,7 +379,7 @@ namespace TBF.BenchControl.Elde
|
||||
uint[] pulsesArr = new uint[] { (uint)totalRefPulses, (uint)massRefPulses };
|
||||
ctrlBrdComponent.SendCommand((uint)cmd, (byte)refFlowMeterNr, (ulong)(route & (UInt128)0xFFFFFFFFFFFFFFFF), (ulong)(route >> 64), pulsesArr, (uint)testMethods,
|
||||
Convert.ToSingle(filterConstants[0]), fmFreq, (uint)regConst, (uint)shortImp, (uint)stopDevs);
|
||||
#elif JUZNA_AFRIKA_50 || ZAMBIA || SENTEC
|
||||
#elif JUZNA_AFRIKA_50 || ZAMBIA || SENTEC || FUZHOU100
|
||||
uint[] pulsesArr = new uint[] { (uint)totalRefPulses, (uint)massRefPulses };
|
||||
ctrlBrdComponent.SendCommand((uint)cmd, (byte)refFlowMeterNr, (ulong)route, pulsesArr, (uint)testMethods,
|
||||
filterConstants, fmFreq, (uint)regConst, (uint)shortImp, (uint)stopDevs);
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace TBF.BenchControl.Elde.CoverTest
|
||||
public class CoverTestCfg : ComponentCfgBase, IChildComponentCfg
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(CoverTestCfg) })[0];
|
||||
protected override XmlSerializer GetSerializer() { return Serializer; }
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl() { return new CoverTestCfgCtrl(); }
|
||||
|
||||
|
||||
@@ -3,15 +3,13 @@
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.Elde.CoverTest
|
||||
{
|
||||
public partial class CoverTestCfgCtrl : UserControl, IComponentCfgCtrl
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(CoverTestCfgCtrl));
|
||||
|
||||
ComponentParametersDlg parent;
|
||||
|
||||
public bool ShowMore { get { return false; } }
|
||||
|
||||
@@ -26,26 +26,25 @@ namespace TBF.BenchControl.Elde.Diverter
|
||||
}
|
||||
public static int DivertersCount { get { return nextIdx; } }
|
||||
public static GenericDevices.IDiverter[] Diverters;
|
||||
public static int[] DivStartingLevelPct;
|
||||
public static int[] DivStoppingLevelPct;
|
||||
|
||||
|
||||
readonly int diverterNr0; /// 0-based diverter number
|
||||
public int DiverterNr { get { return diverterNr0 + 1; } } /// 1-based public diverter number
|
||||
|
||||
|
||||
readonly DiverterCfg diverterCfg;
|
||||
readonly ControlBoardDev controlBoard;
|
||||
readonly UInt128 mask; /// derived from bitPosition in the constructor
|
||||
public int AdcNr { get { return diverterCfg.AdcNr; } }
|
||||
|
||||
readonly int flowMtrNr4Cmd;
|
||||
readonly IOperation diverterToTankOp;
|
||||
readonly IOperation diverterToSinkOp;
|
||||
|
||||
|
||||
public bool State
|
||||
{
|
||||
get { return (controlBoard.Route & mask) != 0; }
|
||||
}
|
||||
public bool State { get { return (controlBoard.Route & mask) != 0; } }
|
||||
public int ThresholdGate { get { return diverterCfg.StartingLevel; } }
|
||||
public int ThresholdLo { get { return diverterCfg.ThresholdLo; } }
|
||||
public int ThresholdHi { get { return diverterCfg.ThresholdHi; } }
|
||||
|
||||
|
||||
public Diverter()
|
||||
{
|
||||
@@ -69,26 +68,15 @@ namespace TBF.BenchControl.Elde.Diverter
|
||||
if (Diverters == null || Diverters.Length < nextIdx)
|
||||
{
|
||||
GenericDevices.IDiverter[] divertersSoFar = Diverters;
|
||||
int[] startingLevelsSoFar = DivStartingLevelPct;
|
||||
int[] stoppingLevelsSoFar = DivStoppingLevelPct;
|
||||
|
||||
Diverters = new GenericDevices.IDiverter[nextIdx];
|
||||
DivStartingLevelPct = new int[nextIdx];
|
||||
DivStoppingLevelPct = new int[nextIdx];
|
||||
|
||||
if (divertersSoFar != null)
|
||||
{
|
||||
for (int i = 0; i < divertersSoFar.Length; i++)
|
||||
{
|
||||
Diverters[i] = divertersSoFar[i];
|
||||
DivStartingLevelPct[i] = startingLevelsSoFar[i];
|
||||
DivStoppingLevelPct[i] = stoppingLevelsSoFar[i];
|
||||
}
|
||||
for (int i = 0; i < divertersSoFar.Length; i++) Diverters[i] = divertersSoFar[i];
|
||||
}
|
||||
|
||||
Diverters[nextIdx - 1] = this;
|
||||
DivStartingLevelPct[nextIdx - 1] = diverterCfg.StartingLevel;
|
||||
DivStoppingLevelPct[nextIdx - 1] = diverterCfg.StoppingLevel;
|
||||
}
|
||||
|
||||
/// Prepare arguments of SendCalibData()
|
||||
@@ -103,8 +91,20 @@ namespace TBF.BenchControl.Elde.Diverter
|
||||
Name, controlBoard.RegValveCalib.GetLength(0), diverterCfg.AdcNr);
|
||||
}
|
||||
|
||||
diverterToTankOp = new SwitchDiverterOp(controlBoard, true, Name.Contains("1") ? 1 : 3);
|
||||
diverterToSinkOp = new SwitchDiverterOp(controlBoard, false, Name.Contains("1") ? 1 : 3);
|
||||
|
||||
int divNrFromName = int.Parse(Name.Substring(3));
|
||||
#if GENESIS || PETERSBURG_50 || PETERSBURG_200 || FUZHOU_40 || FUZHOU150 || FUZHOU300
|
||||
flowMtrNr4Cmd = divNrFromName + 1;
|
||||
#elif BADGER_STREDNA_TRAT
|
||||
flowMtrNr4Cmd = (divNrFromName == 1) ? 1 : ((divNrFromName == 2) ? 9 : 20);
|
||||
#elif BADGER_VELKA_TRAT
|
||||
flowMtrNr4Cmd = ((divNrFromName % 10) == 1) ? 0x11 : (((divNrFromName % 10) == 2) ? 0x22 : 0x33);
|
||||
#else
|
||||
flowMtrNr4Cmd = (divNrFromName == 1) ? 1 : 3;
|
||||
#endif
|
||||
diverterToTankOp = new SwitchDiverterOp(controlBoard, true, flowMtrNr4Cmd);
|
||||
diverterToSinkOp = new SwitchDiverterOp(controlBoard, false, flowMtrNr4Cmd);
|
||||
|
||||
|
||||
log.Debug(this.ToString());
|
||||
}
|
||||
@@ -116,8 +116,8 @@ namespace TBF.BenchControl.Elde.Diverter
|
||||
public void Initialize() { }
|
||||
public void RunDeviceBefore()
|
||||
{
|
||||
int adc = (int)StateMachine.ControlBoard.AnalogInputRaw(diverterCfg.AdcNr, 0);
|
||||
Handlers.OnAdcChanged(this, new CmdResponseArgs(CfgChangeCmd.GetAdc, diverterCfg.BitPosition, adc));
|
||||
int adcValue = (int)StateMachine.ControlBoard.AnalogInputRaw(diverterCfg.AdcNr, 0);
|
||||
Handlers.OnAdcChanged(this, new CmdResponseArgs(CfgChangeCmd.GetAdc, diverterCfg.BitPosition, adcValue));
|
||||
}
|
||||
public void RunDeviceAfter() { }
|
||||
public void StopDevice() { }
|
||||
@@ -161,35 +161,25 @@ namespace TBF.BenchControl.Elde.Diverter
|
||||
DiverterCfg tmpcfg = args.Cfg as DiverterCfg;
|
||||
if (tmpcfg != null && tmpcfg.Name.Equals(Name))
|
||||
{
|
||||
int diverterNr = int.Parse(Name.Substring(3));
|
||||
#if GENESIS || PETERSBURG_50 || PETERSBURG_200 || FUZHOU_40 || FUZHOU150 || FUZHOU300
|
||||
int flowMtrNr = diverterNr + 1;
|
||||
#elif BADGER_STREDNA_TRAT
|
||||
int flowMtrNr = (diverterNr == 1) ? 1 : ((diverterNr == 2) ? 9 : 20);
|
||||
#else
|
||||
int flowMtrNr = (diverterNr == 1) ? 1 : 3;
|
||||
#endif
|
||||
|
||||
if (args.Command == CfgChangeCmd.CfgChange)
|
||||
{
|
||||
}
|
||||
else if (args.Command == CfgChangeCmd.GetAdc1 || args.Command == CfgChangeCmd.GetAdc2)
|
||||
{
|
||||
int adc = (int)controlBoard.AnalogInputRaw(diverterCfg.AdcNr, 0);
|
||||
// TOTEST
|
||||
DiverterCfgCtrl.OnCmdResponse(this, new CmdResponseArgs(args.Command, diverterCfg.BitPosition, adc));
|
||||
int adcValue = (int)controlBoard.AnalogInputRaw(diverterCfg.AdcNr, 0);
|
||||
DiverterCfgCtrl.OnCmdResponse(this, new CmdResponseArgs(args.Command, diverterCfg.BitPosition, adcValue));
|
||||
}
|
||||
else if (args.Command == CfgChangeCmd.DivToTank)
|
||||
{
|
||||
controlBoard.DiverterToTank(flowMtrNr);
|
||||
controlBoard.DiverterToTank(flowMtrNr4Cmd);
|
||||
}
|
||||
else if (args.Command == CfgChangeCmd.DivToSink)
|
||||
{
|
||||
controlBoard.DiverterToSink(flowMtrNr);
|
||||
controlBoard.DiverterToSink(flowMtrNr4Cmd);
|
||||
}
|
||||
else if (args.Command == CfgChangeCmd.ReadDivTransition)
|
||||
{
|
||||
controlBoard.ReadDiverterTransition(flowMtrNr);
|
||||
controlBoard.ReadDiverterTransition(flowMtrNr4Cmd);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace TBF.BenchControl.Elde.Diverter
|
||||
public class DiverterCfg : ComponentCfgBase, IChildComponentCfg
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(DiverterCfg) })[0];
|
||||
protected override XmlSerializer GetSerializer() { return Serializer; }
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl() { return new DiverterCfgCtrl(); }
|
||||
|
||||
@@ -23,7 +23,8 @@ namespace TBF.BenchControl.Elde.Diverter
|
||||
public int AdcValueToSink; /// 0..1023
|
||||
public int AdcValueToTank; /// 0..1023
|
||||
public int StartingLevel; /// 0..100 in %, threshold for the ADC value to start the test
|
||||
public int StoppingLevel; /// 0..100 in %, threshold for the ADC value to start the test
|
||||
public int ThresholdLo; /// 0..100 in %, threshold for low level when diverter transition time is measured
|
||||
public int ThresholdHi; /// 0..100 in %, threshold for high level when diverter transition time is measured
|
||||
|
||||
/// Private parameterless constructor invoked by all other (public) constructors
|
||||
DiverterCfg()
|
||||
@@ -35,8 +36,9 @@ namespace TBF.BenchControl.Elde.Diverter
|
||||
AdcValueToSink = 100;
|
||||
AdcValueToTank = 500;
|
||||
StartingLevel = 50;
|
||||
StoppingLevel = 50;
|
||||
}
|
||||
ThresholdLo = 10;
|
||||
ThresholdHi = 90;
|
||||
}
|
||||
|
||||
public DiverterCfg(IComponentFactory factory)
|
||||
: this()
|
||||
@@ -46,7 +48,7 @@ namespace TBF.BenchControl.Elde.Diverter
|
||||
|
||||
public string ToString(int i)
|
||||
{
|
||||
return string.Format("Name={0}, Parent={1}, Bit={2}, ADC#={3}, ADC2Sink={4}, ADC2Tank={5}, StartingLevel={6}%, StoppingLevel={7}%",
|
||||
return string.Format("Name={0}, Parent={1}, Bit={2}, ADC#={3}, ADC2Sink={4}, ADC2Tank={5}, Gate={6}%, Lo={7}%, Lo={8}%",
|
||||
Name,
|
||||
(string.IsNullOrEmpty(ParentName) ? "-" : ParentName),
|
||||
BitPosition,
|
||||
@@ -54,7 +56,8 @@ namespace TBF.BenchControl.Elde.Diverter
|
||||
AdcValueToSink,
|
||||
AdcValueToTank,
|
||||
StartingLevel,
|
||||
StoppingLevel);
|
||||
ThresholdLo,
|
||||
ThresholdHi);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+54
-19
@@ -40,8 +40,8 @@ namespace TBF.BenchControl.Elde.Diverter
|
||||
this.parentNameComboBox = new System.Windows.Forms.ComboBox();
|
||||
this.startingEdgeTextBox = new System.Windows.Forms.TextBox();
|
||||
this.startingEdgeLabel = new System.Windows.Forms.Label();
|
||||
this.stoppingEdgeTextBox = new System.Windows.Forms.TextBox();
|
||||
this.stoppingEdgeLabel = new System.Windows.Forms.Label();
|
||||
this.thresholdLoTextBox = new System.Windows.Forms.TextBox();
|
||||
this.thresholdLoLabel = new System.Windows.Forms.Label();
|
||||
this.label2 = new System.Windows.Forms.Label();
|
||||
this.label1 = new System.Windows.Forms.Label();
|
||||
this.startButton = new System.Windows.Forms.Button();
|
||||
@@ -70,6 +70,9 @@ namespace TBF.BenchControl.Elde.Diverter
|
||||
this.adcTextBox1 = new System.Windows.Forms.TextBox();
|
||||
this.adcNrTextBox = new System.Windows.Forms.TextBox();
|
||||
this.label7 = new System.Windows.Forms.Label();
|
||||
this.label8 = new System.Windows.Forms.Label();
|
||||
this.thresholdHiTextBox = new System.Windows.Forms.TextBox();
|
||||
this.thresholdHiLabel = new System.Windows.Forms.Label();
|
||||
this.groupBox4.SuspendLayout();
|
||||
this.groupBox2.SuspendLayout();
|
||||
this.groupBox1.SuspendLayout();
|
||||
@@ -153,22 +156,22 @@ namespace TBF.BenchControl.Elde.Diverter
|
||||
this.startingEdgeLabel.TabIndex = 13;
|
||||
this.startingEdgeLabel.Text = "Starting level";
|
||||
//
|
||||
// stoppingEdgeTextBox
|
||||
// thresholdLoTextBox
|
||||
//
|
||||
this.stoppingEdgeTextBox.Enabled = false;
|
||||
this.stoppingEdgeTextBox.Location = new System.Drawing.Point(137, 203);
|
||||
this.stoppingEdgeTextBox.Name = "stoppingEdgeTextBox";
|
||||
this.stoppingEdgeTextBox.Size = new System.Drawing.Size(46, 20);
|
||||
this.stoppingEdgeTextBox.TabIndex = 17;
|
||||
this.thresholdLoTextBox.Enabled = false;
|
||||
this.thresholdLoTextBox.Location = new System.Drawing.Point(137, 203);
|
||||
this.thresholdLoTextBox.Name = "thresholdLoTextBox";
|
||||
this.thresholdLoTextBox.Size = new System.Drawing.Size(46, 20);
|
||||
this.thresholdLoTextBox.TabIndex = 17;
|
||||
//
|
||||
// stoppingEdgeLabel
|
||||
// thresholdLoLabel
|
||||
//
|
||||
this.stoppingEdgeLabel.AutoSize = true;
|
||||
this.stoppingEdgeLabel.Location = new System.Drawing.Point(27, 206);
|
||||
this.stoppingEdgeLabel.Name = "stoppingEdgeLabel";
|
||||
this.stoppingEdgeLabel.Size = new System.Drawing.Size(74, 13);
|
||||
this.stoppingEdgeLabel.TabIndex = 16;
|
||||
this.stoppingEdgeLabel.Text = "Stopping level";
|
||||
this.thresholdLoLabel.AutoSize = true;
|
||||
this.thresholdLoLabel.Location = new System.Drawing.Point(27, 206);
|
||||
this.thresholdLoLabel.Name = "thresholdLoLabel";
|
||||
this.thresholdLoLabel.Size = new System.Drawing.Size(69, 13);
|
||||
this.thresholdLoLabel.TabIndex = 16;
|
||||
this.thresholdLoLabel.Text = "Threshold Lo";
|
||||
//
|
||||
// label2
|
||||
//
|
||||
@@ -430,10 +433,39 @@ namespace TBF.BenchControl.Elde.Diverter
|
||||
this.label7.TabIndex = 7;
|
||||
this.label7.Text = "Analog input #";
|
||||
//
|
||||
// label8
|
||||
//
|
||||
this.label8.AutoSize = true;
|
||||
this.label8.Location = new System.Drawing.Point(190, 228);
|
||||
this.label8.Name = "label8";
|
||||
this.label8.Size = new System.Drawing.Size(15, 13);
|
||||
this.label8.TabIndex = 29;
|
||||
this.label8.Text = "%";
|
||||
//
|
||||
// thresholdHiTextBox
|
||||
//
|
||||
this.thresholdHiTextBox.Enabled = false;
|
||||
this.thresholdHiTextBox.Location = new System.Drawing.Point(137, 226);
|
||||
this.thresholdHiTextBox.Name = "thresholdHiTextBox";
|
||||
this.thresholdHiTextBox.Size = new System.Drawing.Size(46, 20);
|
||||
this.thresholdHiTextBox.TabIndex = 28;
|
||||
//
|
||||
// thresholdHiLabel
|
||||
//
|
||||
this.thresholdHiLabel.AutoSize = true;
|
||||
this.thresholdHiLabel.Location = new System.Drawing.Point(27, 229);
|
||||
this.thresholdHiLabel.Name = "thresholdHiLabel";
|
||||
this.thresholdHiLabel.Size = new System.Drawing.Size(67, 13);
|
||||
this.thresholdHiLabel.TabIndex = 27;
|
||||
this.thresholdHiLabel.Text = "Threshold Hi";
|
||||
//
|
||||
// DiverterCfgCtrl
|
||||
//
|
||||
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
|
||||
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
|
||||
this.Controls.Add(this.label8);
|
||||
this.Controls.Add(this.thresholdHiTextBox);
|
||||
this.Controls.Add(this.thresholdHiLabel);
|
||||
this.Controls.Add(this.adcNrTextBox);
|
||||
this.Controls.Add(this.label7);
|
||||
this.Controls.Add(this.groupBox4);
|
||||
@@ -448,8 +480,8 @@ namespace TBF.BenchControl.Elde.Diverter
|
||||
this.Controls.Add(this.startButton);
|
||||
this.Controls.Add(this.label1);
|
||||
this.Controls.Add(this.label2);
|
||||
this.Controls.Add(this.stoppingEdgeTextBox);
|
||||
this.Controls.Add(this.stoppingEdgeLabel);
|
||||
this.Controls.Add(this.thresholdLoTextBox);
|
||||
this.Controls.Add(this.thresholdLoLabel);
|
||||
this.Controls.Add(this.startingEdgeTextBox);
|
||||
this.Controls.Add(this.startingEdgeLabel);
|
||||
this.Controls.Add(this.parentNameComboBox);
|
||||
@@ -484,8 +516,8 @@ namespace TBF.BenchControl.Elde.Diverter
|
||||
private System.Windows.Forms.ComboBox parentNameComboBox;
|
||||
private System.Windows.Forms.TextBox startingEdgeTextBox;
|
||||
private System.Windows.Forms.Label startingEdgeLabel;
|
||||
private System.Windows.Forms.TextBox stoppingEdgeTextBox;
|
||||
private System.Windows.Forms.Label stoppingEdgeLabel;
|
||||
private System.Windows.Forms.TextBox thresholdLoTextBox;
|
||||
private System.Windows.Forms.Label thresholdLoLabel;
|
||||
private System.Windows.Forms.Label label2;
|
||||
private System.Windows.Forms.Label label1;
|
||||
private System.Windows.Forms.Button startButton;
|
||||
@@ -514,5 +546,8 @@ namespace TBF.BenchControl.Elde.Diverter
|
||||
private System.Windows.Forms.TextBox adcTextBox1;
|
||||
private System.Windows.Forms.TextBox adcNrTextBox;
|
||||
private System.Windows.Forms.Label label7;
|
||||
private System.Windows.Forms.Label label8;
|
||||
private System.Windows.Forms.TextBox thresholdHiTextBox;
|
||||
private System.Windows.Forms.Label thresholdHiLabel;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,15 +4,16 @@
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.Elde.Diverter
|
||||
{
|
||||
public partial class DiverterCfgCtrl : UserControl, IComponentCfgCtrl
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(DiverterCfgCtrl));
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(DiverterCfgCtrl));
|
||||
|
||||
ComponentParametersDlg parent;
|
||||
ComponentParametersDlg parent;
|
||||
|
||||
public bool ShowMore { get { return true; } }
|
||||
|
||||
@@ -77,7 +78,8 @@ namespace TBF.BenchControl.Elde.Diverter
|
||||
adcToSinkTextBox.Text = config.AdcValueToSink.ToString();
|
||||
adcToTankTextBox.Text = config.AdcValueToTank.ToString();
|
||||
startingEdgeTextBox.Text = config.StartingLevel.ToString();
|
||||
stoppingEdgeTextBox.Text = config.StoppingLevel.ToString();
|
||||
thresholdLoTextBox.Text = config.ThresholdLo.ToString();
|
||||
thresholdHiTextBox.Text = config.ThresholdHi.ToString();
|
||||
|
||||
adcTextBox1.Text = adc1.ToString();
|
||||
adcTextBox2.Text = adc2.ToString();
|
||||
@@ -94,8 +96,9 @@ namespace TBF.BenchControl.Elde.Diverter
|
||||
adcToSinkTextBox.Enabled = true;
|
||||
adcToTankTextBox.Enabled = true;
|
||||
startingEdgeTextBox.Enabled = true;
|
||||
stoppingEdgeTextBox.Enabled = true;
|
||||
}
|
||||
thresholdLoTextBox.Enabled = true;
|
||||
thresholdHiTextBox.Enabled = true;
|
||||
}
|
||||
|
||||
public CfgUpdateFlags VerifyCfg(ref string message)
|
||||
{
|
||||
@@ -137,12 +140,17 @@ namespace TBF.BenchControl.Elde.Diverter
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + "'Starting Edge' should be between 0 and 100%";
|
||||
}
|
||||
if (!int.TryParse(stoppingEdgeTextBox.Text, out dummy) || dummy < 0 || dummy > 100)
|
||||
if (!int.TryParse(thresholdLoTextBox.Text, out dummy) || dummy < 0 || dummy > 100)
|
||||
{
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + "'Stopping Edge' should be between 0 and 100%";
|
||||
message += Environment.NewLine + "'Threshold LO' should be between 0 and 100%";
|
||||
}
|
||||
return flags;
|
||||
if (!int.TryParse(thresholdHiTextBox.Text, out dummy) || dummy < 0 || dummy > 100)
|
||||
{
|
||||
flags |= CfgUpdateFlags.Error;
|
||||
message += Environment.NewLine + "'Threshold HI' should be between 0 and 100%";
|
||||
}
|
||||
return flags;
|
||||
}
|
||||
|
||||
public CfgUpdateFlags UpdateCfg()
|
||||
@@ -200,13 +208,20 @@ namespace TBF.BenchControl.Elde.Diverter
|
||||
flags |= CfgUpdateFlags.RestartRqrd;
|
||||
}
|
||||
|
||||
tmp = int.Parse(stoppingEdgeTextBox.Text);
|
||||
if (config.StoppingLevel != tmp)
|
||||
tmp = int.Parse(thresholdLoTextBox.Text);
|
||||
if (config.ThresholdLo != tmp)
|
||||
{
|
||||
config.StoppingLevel = tmp;
|
||||
config.ThresholdLo = tmp;
|
||||
flags |= CfgUpdateFlags.RestartRqrd;
|
||||
}
|
||||
|
||||
tmp = int.Parse(thresholdHiTextBox.Text);
|
||||
if (config.ThresholdHi != tmp)
|
||||
{
|
||||
config.ThresholdHi = tmp;
|
||||
flags |= CfgUpdateFlags.RestartRqrd;
|
||||
}
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
|
||||
@@ -40,12 +40,12 @@ namespace TBF.BenchControl.Elde.FixedStartRegisterReader
|
||||
}
|
||||
|
||||
/// Retrieves parameters from UI controls
|
||||
public void UpdateParam(int i, string strValue)
|
||||
public CfgUpdateFlags UpdateParam(int i, string strValue)
|
||||
{
|
||||
switch (i)
|
||||
{
|
||||
case 0: PulsesPerLtr = Utils.ParseUDouble(strValue); return;
|
||||
default: return;
|
||||
case 0: PulsesPerLtr = Utils.ParseUDouble(strValue); return CfgUpdateFlags.None;
|
||||
default: return CfgUpdateFlags.None;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace TBF.BenchControl.Elde.FixedStartRegisterReader
|
||||
public class RegisterReaderCfg : ComponentCfgBase, Generic.IChildComponentCfg
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(RegisterReaderCfg) })[0];
|
||||
protected override XmlSerializer GetSerializer() { return Serializer; }
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl() { return new RegisterReaderCfgCtrl(); }
|
||||
|
||||
|
||||
@@ -3,15 +3,13 @@
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.Elde.FixedStartRegisterReader
|
||||
{
|
||||
public partial class RegisterReaderCfgCtrl : UserControl, IComponentCfgCtrl
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(RegisterReaderCfgCtrl));
|
||||
|
||||
ComponentParametersDlg parent;
|
||||
|
||||
public bool ShowMore { get { return false; } }
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace TBF.BenchControl.Elde.FlowMeter
|
||||
public class FlowMeterCfg : ComponentCfgBase, GenericDevices.ICalibInfoCfg, IChildComponentCfg
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(FlowMeterCfg) })[0];
|
||||
protected override XmlSerializer GetSerializer() { return Serializer; }
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl() { return new FlowMeterCfgCtrl(); }
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.Configs;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
@@ -12,8 +12,6 @@ namespace TBF.BenchControl.Elde.FlowMeter
|
||||
{
|
||||
public partial class FlowMeterCfgCtrl : ConfigCtrlUtils, IComponentCfgCtrl
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(FlowMeterCfgCtrl));
|
||||
|
||||
ComponentParametersDlg parent;
|
||||
|
||||
public bool ShowMore { get { return false; } }
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace TBF.BenchControl.Elde.FlowMeterTriplet
|
||||
public class FlowMeterCfg : ComponentCfgBase, IChildComponentCfg
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(FlowMeterCfg) })[0];
|
||||
protected override XmlSerializer GetSerializer() { return Serializer; }
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl() { return new FlowMeterCfgCtrl(); }
|
||||
|
||||
|
||||
@@ -4,15 +4,13 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.Elde.FlowMeterTriplet
|
||||
{
|
||||
public partial class FlowMeterCfgCtrl : UserControl, IComponentCfgCtrl
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(FlowMeterCfgCtrl));
|
||||
|
||||
ComponentParametersDlg parent;
|
||||
|
||||
public bool ShowMore { get { return false; } }
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace TBF.BenchControl.Elde.FlowMeterTwins
|
||||
public class FlowMeterCfg : ComponentCfgBase, Generic.IChildComponentCfg
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(FlowMeterCfg) })[0];
|
||||
protected override XmlSerializer GetSerializer() { return Serializer; }
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl() { return new FlowMeterCfgCtrl(); }
|
||||
|
||||
|
||||
@@ -4,15 +4,13 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.Elde.FlowMeterTwins
|
||||
{
|
||||
public partial class FlowMeterCfgCtrl : UserControl, IComponentCfgCtrl
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(FlowMeterCfgCtrl));
|
||||
|
||||
ComponentParametersDlg parentDlg;
|
||||
|
||||
public bool ShowMore { get { return false; } }
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace TBF.BenchControl.Elde
|
||||
uint BeginState(int wmNr0);
|
||||
float ReferenceFlow { get; }
|
||||
float RValvePosition(int rvNr1);
|
||||
float DivSamples(int ms);
|
||||
float DivSamples(int time, int divIx0); /// time unit is 2 ms
|
||||
int ScopeSamples(int i, int j, int k);
|
||||
ulong DigitalInputs { get; }
|
||||
float AnalogInput(int adcNr0);
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace TBF.BenchControl.Elde.PressureMeter
|
||||
public class PressureMeterCfg : ComponentCfgBase, Generic.IChildComponentCfg
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(PressureMeterCfg) })[0];
|
||||
protected override XmlSerializer GetSerializer() { return Serializer; }
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl() { return new PressureMeterCfgCtrl(); }
|
||||
|
||||
|
||||
@@ -3,15 +3,13 @@
|
||||
///
|
||||
using System;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.Elde.PressureMeter
|
||||
{
|
||||
public partial class PressureMeterCfgCtrl : UserControl, IComponentCfgCtrl
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(PressureMeterCfgCtrl));
|
||||
|
||||
ComponentParametersDlg parent;
|
||||
|
||||
public bool ShowMore { get { return false; } }
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace TBF.BenchControl.Elde.PressureMeterInternal
|
||||
public class PressureMeterCfg : ComponentCfgBase, IChildComponentCfg
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(PressureMeterCfg) })[0];
|
||||
protected override XmlSerializer GetSerializer() { return Serializer; }
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl() { return new PressureMeterCfgCtrl(); }
|
||||
|
||||
|
||||
@@ -1,19 +1,16 @@
|
||||
///
|
||||
/// Copyright (c) 2015 Sensus Metering Systems
|
||||
/// Author: Milan Hanajik
|
||||
/// Copyright (c) 2015-2018 Sensus Slovensko a.s.
|
||||
///
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Windows.Forms;
|
||||
using log4net;
|
||||
using Config.Entities;
|
||||
using TBF.BenchControl.Generic;
|
||||
|
||||
namespace TBF.BenchControl.Elde.PressureMeterInternal
|
||||
{
|
||||
public partial class PressureMeterCfgCtrl : UserControl, IComponentCfgCtrl
|
||||
{
|
||||
static readonly ILog log = LogManager.GetLogger(typeof(PressureMeterCfgCtrl));
|
||||
|
||||
ComponentParametersDlg parent;
|
||||
|
||||
public bool ShowMore { get { return false; } }
|
||||
|
||||
@@ -11,7 +11,7 @@ namespace TBF.BenchControl.Elde.Pump
|
||||
public class PumpCfg : ComponentCfgBase, IChildComponentCfg
|
||||
{
|
||||
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(PumpCfg) })[0];
|
||||
protected override XmlSerializer GetSerializer() { return Serializer; }
|
||||
public override XmlSerializer GetSerializer() { return Serializer; }
|
||||
|
||||
public IComponentCfgCtrl GetControl() { return new PumpCfgCtrl(); }
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user