Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
24d1ffa1d6 | ||
|
|
1a4d9b59ca | ||
|
|
01055e9516 | ||
|
|
beb2c97fb2 | ||
|
|
4c88ebf6ab | ||
|
|
c88119e64d | ||
|
|
2b35b3137f | ||
|
|
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 | ||
|
|
2a622d4aa2 | ||
|
|
baa67cfe02 | ||
|
|
d0cddd072c | ||
|
|
e20a95029c | ||
|
|
392a02b83c | ||
|
|
385825c9e8 | ||
|
|
acb5491225 | ||
|
|
5d4dedcb25 | ||
|
|
775af25d1b |
@@ -18,7 +18,7 @@
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG;SENTEC</DefineConstants>
|
||||
<DefineConstants>TRACE;DEBUG;MUNICH;LANG_DE</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;MUNICH;LANG_DE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace Config
|
||||
result.IsRealBench = IsRealBench;
|
||||
result.ProceduresDBSettings = (Users.DBSettings)ProceduresDBSettings.Clone();
|
||||
result.WaterMetersDBSettings = (Users.DBSettings)WaterMetersDBSettings.Clone();
|
||||
result.UsersDBSettings = (Users.DBSettings)ProceduresDBSettings.Clone();
|
||||
result.UsersDBSettings = (Users.DBSettings)UsersDBSettings.Clone();
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,7 +11,13 @@ namespace Results.Entities
|
||||
public virtual int Id { get; protected set; }
|
||||
public virtual int BatchNr { get; set; }
|
||||
public virtual int TestBenchId { get; set; }
|
||||
public virtual string ProgramVersion { get; set; }
|
||||
public virtual string TestBenchName { get; set; } /// CEVAK, not mapped to DB
|
||||
public virtual string Address1 { get; set; } /// CEVAK, not mapped to DB
|
||||
public virtual string Address2 { get; set; } /// CEVAK, not mapped to DB
|
||||
public virtual string Address3 { get; set; } /// CEVAK, not mapped to DB
|
||||
public virtual string Address4 { get; set; } /// CEVAK, not mapped to DB
|
||||
public virtual string Address5 { get; set; } /// CEVAK, not mapped to DB
|
||||
public virtual string ProgramVersion { get; set; }
|
||||
public virtual string UserName { get; set; }
|
||||
public virtual int UserNumber { get; set; }
|
||||
public virtual string ProcedureName { get; set; }
|
||||
|
||||
@@ -25,9 +25,12 @@ namespace Results.Entities
|
||||
public virtual DateTime EndTime { get; set; } /// Date and time of the test end
|
||||
public virtual int FlowSetTime { get; set; } /// [s] Measurement time in seconds
|
||||
public virtual double TestTime { get; set; } /// [s] Measurement time in seconds
|
||||
public virtual double PulsesMaster { get; set; }
|
||||
public virtual double 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 PulsesMaster { get; set; } /// [pls] FlyingStartMassCollectionProlonged: MID pulses of the water to the tank
|
||||
public virtual double TotalPulsesMstr { get; set; } /// [pls] FlyingStartMassCollectionProlonged: MID pulses of the complete test (not mapped to DB)
|
||||
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 +43,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 +110,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 +132,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()
|
||||
{
|
||||
|
||||
@@ -117,7 +117,7 @@ namespace Results.Entities
|
||||
ErrorFlagsMode eFlagsMode = 0; /// = ErrorFlagsMode.Off;
|
||||
foreach (var mtr in MeterTestRslts)
|
||||
{
|
||||
if (mtr.TestDone) errorFlags |= mtr.TestRslt.ErrorFlags;
|
||||
if (mtr.Evaluate() && mtr.TestDone) errorFlags |= mtr.TestRslt.ErrorFlags;
|
||||
if ((int)mtr.TestRslt.ErrorFlagsMode() > (int)eFlagsMode) eFlagsMode = mtr.TestRslt.ErrorFlagsMode();
|
||||
}
|
||||
errorFlagsMode = eFlagsMode; /// Maximum from all tests (=ErrorFlagsMode.On if at least one test is ErrorFlagsMode.On)
|
||||
@@ -264,6 +264,21 @@ namespace Results.Entities
|
||||
return null;
|
||||
}
|
||||
|
||||
public virtual bool TryGetTestRslt(string testName, out TestRslt testRslt)
|
||||
{
|
||||
MeterTestRslt mtr = GetMeterTestRslt(testName);
|
||||
if (mtr != null)
|
||||
{
|
||||
testRslt = mtr.TestRslt;
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
testRslt = null;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual TestData GetTestData(string testName)
|
||||
{
|
||||
foreach (var mtr in MeterTestRslts)
|
||||
@@ -276,6 +291,21 @@ namespace Results.Entities
|
||||
return null;
|
||||
}
|
||||
|
||||
public virtual bool TryGetTestData(string testName, out TestData testData)
|
||||
{
|
||||
foreach (var mtr in MeterTestRslts)
|
||||
{
|
||||
if (mtr.TestRslt.TestData.Name == testName)
|
||||
{
|
||||
testData = mtr.TestRslt.TestData;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
testData = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -0,0 +1,104 @@
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Results.Forms
|
||||
{
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public static class ListViewExtensions
|
||||
{
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct HDITEM
|
||||
{
|
||||
public Mask mask;
|
||||
public int cxy;
|
||||
[MarshalAs(UnmanagedType.LPTStr)]
|
||||
public string pszText;
|
||||
public IntPtr hbm;
|
||||
public int cchTextMax;
|
||||
public Format fmt;
|
||||
public IntPtr lParam;
|
||||
// _WIN32_IE >= 0x0300
|
||||
public int iImage;
|
||||
public int iOrder;
|
||||
// _WIN32_IE >= 0x0500
|
||||
public uint type;
|
||||
public IntPtr pvFilter;
|
||||
// _WIN32_WINNT >= 0x0600
|
||||
public uint state;
|
||||
|
||||
[Flags]
|
||||
public enum Mask
|
||||
{
|
||||
Format = 0x4, // HDI_FORMAT
|
||||
};
|
||||
|
||||
[Flags]
|
||||
public enum Format
|
||||
{
|
||||
SortDown = 0x200, // HDF_SORTDOWN
|
||||
SortUp = 0x400, // HDF_SORTUP
|
||||
};
|
||||
};
|
||||
|
||||
public const int LVM_FIRST = 0x1000;
|
||||
public const int LVM_GETHEADER = LVM_FIRST + 31;
|
||||
|
||||
public const int HDM_FIRST = 0x1200;
|
||||
public const int HDM_GETITEM = HDM_FIRST + 11;
|
||||
public const int HDM_SETITEM = HDM_FIRST + 12;
|
||||
|
||||
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
|
||||
public static extern IntPtr SendMessage(IntPtr hWnd, UInt32 msg, IntPtr wParam, IntPtr lParam);
|
||||
|
||||
[DllImport("user32.dll", CharSet = CharSet.Auto, SetLastError = true)]
|
||||
public static extern IntPtr SendMessage(IntPtr hWnd, UInt32 msg, IntPtr wParam, ref HDITEM lParam);
|
||||
|
||||
public static void SetSortIcon(this ListViewEx listViewControl, int columnIndex, SortOrder order)
|
||||
{
|
||||
IntPtr columnHeader = SendMessage(listViewControl.Handle, LVM_GETHEADER, IntPtr.Zero, IntPtr.Zero);
|
||||
for (int columnNumber = 0; columnNumber <= listViewControl.Columns.Count - 1; columnNumber++)
|
||||
{
|
||||
var columnPtr = new IntPtr(columnNumber);
|
||||
var item = new HDITEM
|
||||
{
|
||||
mask = HDITEM.Mask.Format
|
||||
};
|
||||
|
||||
if (SendMessage(columnHeader, HDM_GETITEM, columnPtr, ref item) == IntPtr.Zero)
|
||||
{
|
||||
throw new Win32Exception();
|
||||
}
|
||||
|
||||
if (order != SortOrder.None && columnNumber == columnIndex)
|
||||
{
|
||||
switch (order)
|
||||
{
|
||||
case SortOrder.Ascending:
|
||||
item.fmt &= ~HDITEM.Format.SortDown;
|
||||
item.fmt |= HDITEM.Format.SortUp;
|
||||
break;
|
||||
|
||||
case SortOrder.Descending:
|
||||
item.fmt &= ~HDITEM.Format.SortUp;
|
||||
item.fmt |= HDITEM.Format.SortDown;
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
item.fmt &= ~HDITEM.Format.SortDown & ~HDITEM.Format.SortUp;
|
||||
}
|
||||
|
||||
if (SendMessage(columnHeader, HDM_SETITEM, columnPtr, ref item) == IntPtr.Zero)
|
||||
{
|
||||
throw new Win32Exception();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Results.Forms
|
||||
{
|
||||
public class LviIntColumnComparer : IComparer
|
||||
{
|
||||
int column;
|
||||
SortOrder order;
|
||||
|
||||
public LviIntColumnComparer()
|
||||
{
|
||||
column = 0;
|
||||
order = SortOrder.Ascending;
|
||||
}
|
||||
|
||||
public LviIntColumnComparer(int column, SortOrder order)
|
||||
{
|
||||
this.column = column;
|
||||
this.order = order;
|
||||
}
|
||||
|
||||
public int Compare(object x, object y)
|
||||
{
|
||||
int valX = int.Parse(((ListViewItem)x).SubItems[column].Text);
|
||||
int valY = int.Parse(((ListViewItem)y).SubItems[column].Text);
|
||||
return (order == SortOrder.Descending) ? (valY - valX) : (valX - valY);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Windows.Forms;
|
||||
|
||||
namespace Results.Forms
|
||||
{
|
||||
public class LviTextColumnComparer : IComparer
|
||||
{
|
||||
private int column;
|
||||
SortOrder order;
|
||||
|
||||
public LviTextColumnComparer()
|
||||
{
|
||||
column = 0;
|
||||
order = SortOrder.Ascending;
|
||||
}
|
||||
|
||||
public LviTextColumnComparer(int column, SortOrder order)
|
||||
{
|
||||
this.column = column;
|
||||
this.order = order;
|
||||
}
|
||||
|
||||
public int Compare(object x, object y)
|
||||
{
|
||||
string txtX = ((ListViewItem)x).SubItems[column].Text;
|
||||
string txtY = ((ListViewItem)y).SubItems[column].Text;
|
||||
return (order == SortOrder.Descending) ? String.Compare(txtY, txtX) : String.Compare(txtX, txtY);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
@@ -185,7 +185,7 @@ namespace Results.Output.Printers.Enhanced
|
||||
|
||||
Table table0 = Table.Create_TestsAreRows(batch.WaterMeters[0], testItems, style);
|
||||
SizeF tableSize = table0.Measure(e);
|
||||
int wmSectionHeight = (int)tableSize.Height + 3 * SpacingOne4Header;
|
||||
int wmSectionHeight = (int)tableSize.Height + SpacingOne4Header * ((tableSize.Height > 0) ? 3 : 2);
|
||||
|
||||
nrWMsOnFirstPage = (printHeight - BodyTop + TitleY - 2 * SpacingOne) / wmSectionHeight;
|
||||
nrWMsOnNextPage = (printHeight - 2 * SpacingOne) / wmSectionHeight;
|
||||
@@ -239,7 +239,10 @@ namespace Results.Output.Printers.Enhanced
|
||||
for (int wmNr = nextWMNr; wmNr < Math.Min(nextWMNr + nrWMsOnPage, batch.WaterMeters.Count); wmNr++) /// wmNr is 0-based
|
||||
{
|
||||
int wmPosition = true ? batch.WaterMeters[wmNr].WMPosition : (wmNr + 1);
|
||||
nextWmTop = (int)PrintWM(e, batch.WaterMeters[wmNr], wmPosition, nextWmTop) + SpacingOneAndHalf4Header;
|
||||
if (!cfg.GoodOnly || batch.WaterMeters[wmNr].Passed)
|
||||
{
|
||||
nextWmTop = (int)PrintWM(e, batch.WaterMeters[wmNr], wmPosition, nextWmTop) + SpacingOneAndHalf4Header;
|
||||
}
|
||||
}
|
||||
|
||||
nextWMNr += nrWMsOnPage;
|
||||
@@ -265,7 +268,7 @@ namespace Results.Output.Printers.Enhanced
|
||||
/// <param name="top">Top coordinate of watermeter data</param>
|
||||
/// <returns>The height of the printed section</returns>
|
||||
float PrintWM(System.Drawing.Printing.PrintPageEventArgs e,
|
||||
Results.Entities.WaterMeter wm, int printedWMNr, int top)
|
||||
Results.Entities.WaterMeter wm, int printedWMNr, int top)
|
||||
{
|
||||
/// Print the water meter number and the serial number
|
||||
string wmText = string.Format("{0} {1}", Strings.Water_Meter, printedWMNr);
|
||||
@@ -278,7 +281,14 @@ namespace Results.Output.Printers.Enhanced
|
||||
|
||||
Table table = Table.Create_TestsAreRows(wm, testItems, style);
|
||||
|
||||
return table.Draw(e, leftMargin, top + SpacingOneAndHalf4Header);
|
||||
if (table.IsEmpty())
|
||||
{
|
||||
return top;
|
||||
}
|
||||
else
|
||||
{
|
||||
return table.Draw(e, leftMargin, top + SpacingOneAndHalf4Header);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -6,6 +6,8 @@ using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Drawing.Printing;
|
||||
using Config.Entities;
|
||||
using System.IO;
|
||||
using Results.Resources;
|
||||
|
||||
namespace Results.Output.Printers.Munich
|
||||
{
|
||||
@@ -38,11 +40,16 @@ namespace Results.Output.Printers.Munich
|
||||
readonly int resultsCount;
|
||||
readonly bool compound; /// true when MetersKind is MetersKind.Combined
|
||||
|
||||
/// Top coordinate of the table
|
||||
int nrPages;
|
||||
int pageNr;
|
||||
int firstTblTop;
|
||||
int secondTblTop;
|
||||
|
||||
int pageNr; /// Current page number
|
||||
int nrPages; /// Total number of pages
|
||||
float tableTop; /// Top coordinate of the table
|
||||
|
||||
int[] firstTblRowsOnPage;
|
||||
int[] secondTblRowsOnPage;
|
||||
|
||||
|
||||
PageOrientation pageOrientation;
|
||||
|
||||
/// <summary>
|
||||
/// Property variable for the Font the user wishes to use
|
||||
@@ -51,7 +58,34 @@ namespace Results.Output.Printers.Munich
|
||||
Font boldFont;
|
||||
Font fontTitle;
|
||||
|
||||
/// <summary>
|
||||
///
|
||||
/// Table style
|
||||
///
|
||||
static TableStyle tableStyle = new TableStyle
|
||||
{
|
||||
Font = new Font(FontFamilyName, 10, FontStyle.Regular),
|
||||
HeaderFont = new Font(FontFamilyName, 10, FontStyle.Regular),
|
||||
MarginX = 7,
|
||||
MarginY = 5,
|
||||
LineWidth = 1,
|
||||
TopHeadersCount = 1,
|
||||
HorizLines = TableLines.FirstSecondAndLast,
|
||||
VertLines = TableLines.All,
|
||||
ColumnWidths = new float[] { 150, 70, 75, 75, 70, 75, 75 },
|
||||
};
|
||||
static Alignment[] horizontalAlignment = new Alignment[] /// Horizontal alignment of items of one row
|
||||
{
|
||||
Alignment.Left, Alignment.Left, Alignment.Left,
|
||||
Alignment.Left, Alignment.Left, Alignment.Left, Alignment.Left
|
||||
};
|
||||
static VertAlignment[] verticalAlignment = new VertAlignment[] /// Vertical alignment of items of one row
|
||||
{
|
||||
VertAlignment.Middle, VertAlignment.Middle, VertAlignment.Middle,
|
||||
VertAlignment.Middle, VertAlignment.Middle, VertAlignment.Middle, VertAlignment.Middle
|
||||
};
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Constructor
|
||||
/// </summary>
|
||||
/// <param name="textToPrint">Text to be printed</param>
|
||||
@@ -61,7 +95,8 @@ namespace Results.Output.Printers.Munich
|
||||
{
|
||||
this.docVersion = docVersion;
|
||||
this.wm = wm;
|
||||
compound = wm.Compound();
|
||||
this.compound = wm.Compound();
|
||||
this.pageOrientation = pageOrientation;
|
||||
|
||||
string[] info = wm.ProductName().Split(new char[] { ';' });
|
||||
if (info.Length >= 2)
|
||||
@@ -81,13 +116,88 @@ namespace Results.Output.Printers.Munich
|
||||
}
|
||||
|
||||
results = wm.MeterTestRslts;
|
||||
this.resultsCount = compound ? (results.Count / 3) : results.Count;
|
||||
|
||||
int resultsCount = wm.MeterTestRslts.Count;
|
||||
if (compound) resultsCount /= 3;
|
||||
resultsCount = 0;
|
||||
foreach (var mtr in wm.MeterTestRslts)
|
||||
{
|
||||
if (mtr != null && mtr.IsPilotRslt() && mtr.Publish() == Config.Entities.Publish.Always) resultsCount++;
|
||||
}
|
||||
|
||||
pageNr = 1;
|
||||
nrPages = (compound ? (resultsCount > 7) : (resultsCount > 9)) ? 2 : 1;
|
||||
if (compound)
|
||||
{
|
||||
/// Compound meter results
|
||||
const int MaxOnFirstPage = 23;
|
||||
const int MaxOnPage = 45;
|
||||
if (resultsCount <= 7)
|
||||
{
|
||||
nrPages = 1;
|
||||
firstTblRowsOnPage = new int[] { resultsCount };
|
||||
secondTblRowsOnPage = new int[] { resultsCount };
|
||||
}
|
||||
else if (resultsCount <= MaxOnFirstPage)
|
||||
{
|
||||
nrPages = 2;
|
||||
firstTblRowsOnPage = new int[] { resultsCount, 0 };
|
||||
secondTblRowsOnPage = new int[] { 0, int.MaxValue };
|
||||
}
|
||||
else if (resultsCount <= MaxOnPage)
|
||||
{
|
||||
nrPages = 3;
|
||||
firstTblRowsOnPage = new int[] { MaxOnFirstPage, (resultsCount - MaxOnFirstPage), 0 };
|
||||
int secondTblRowsOn2ndPage = Math.Max(0, MaxOnFirstPage + MaxOnPage - 2 - resultsCount);
|
||||
secondTblRowsOnPage = new int[] { 0, secondTblRowsOn2ndPage, resultsCount - secondTblRowsOn2ndPage };
|
||||
}
|
||||
else if (resultsCount <= MaxOnFirstPage + MaxOnPage)
|
||||
{
|
||||
nrPages = 4;
|
||||
firstTblRowsOnPage = new int[] { MaxOnFirstPage, MaxOnPage, 0, 0 };
|
||||
secondTblRowsOnPage = new int[] { 0, 0, MaxOnPage, MaxOnFirstPage };
|
||||
}
|
||||
else
|
||||
{
|
||||
nrPages = 5;
|
||||
firstTblRowsOnPage = new int[] { MaxOnFirstPage, MaxOnPage, (resultsCount - MaxOnFirstPage - MaxOnPage), 0 };
|
||||
secondTblRowsOnPage = new int[] { 0, 0, Math.Max(0, MaxOnFirstPage + 2 * MaxOnPage - 2 - resultsCount), MaxOnPage, MaxOnFirstPage };
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/// Regular (single) meter results
|
||||
const int MaxOnFirstPage = 27;
|
||||
const int MaxOnPage = 45;
|
||||
if (resultsCount <= 9)
|
||||
{
|
||||
nrPages = 1;
|
||||
firstTblRowsOnPage = new int[] { resultsCount };
|
||||
secondTblRowsOnPage = new int[] { resultsCount };
|
||||
}
|
||||
else if (resultsCount <= MaxOnFirstPage)
|
||||
{
|
||||
nrPages = 2;
|
||||
firstTblRowsOnPage = new int[] { resultsCount, 0 };
|
||||
secondTblRowsOnPage = new int[] { 0, int.MaxValue };
|
||||
}
|
||||
else if (resultsCount <= MaxOnPage)
|
||||
{
|
||||
nrPages = 3;
|
||||
firstTblRowsOnPage = new int[] { MaxOnFirstPage, (resultsCount - MaxOnFirstPage), 0 };
|
||||
int secondTblRowsOn2ndPage = Math.Max(0, MaxOnFirstPage + MaxOnPage - 2 - resultsCount);
|
||||
secondTblRowsOnPage = new int[] { 0, secondTblRowsOn2ndPage, resultsCount - secondTblRowsOn2ndPage };
|
||||
}
|
||||
else if (resultsCount <= MaxOnFirstPage + MaxOnPage)
|
||||
{
|
||||
nrPages = 4;
|
||||
firstTblRowsOnPage = new int[] { MaxOnFirstPage, MaxOnPage, 0, 0 };
|
||||
secondTblRowsOnPage = new int[] { 0, 0, MaxOnPage, MaxOnFirstPage };
|
||||
}
|
||||
else
|
||||
{
|
||||
nrPages = 5;
|
||||
firstTblRowsOnPage = new int[] { MaxOnFirstPage, MaxOnPage, (resultsCount - MaxOnFirstPage - MaxOnPage), 0 };
|
||||
secondTblRowsOnPage = new int[] { 0, 0, Math.Max(0, MaxOnFirstPage + 2 * MaxOnPage - 2 - resultsCount), MaxOnPage, MaxOnFirstPage };
|
||||
}
|
||||
}
|
||||
|
||||
DefaultPageSettings.Landscape = (pageOrientation == PageOrientation.Landscape);
|
||||
}
|
||||
@@ -116,8 +226,30 @@ namespace Results.Output.Printers.Munich
|
||||
/// Run base code
|
||||
base.OnPrintPage(e);
|
||||
|
||||
/// Draw 2550 x 3507 'headpic' scaled to A4 at 100 DPI
|
||||
e.Graphics.DrawImage(Results.Properties.Resources.Headpic, new Rectangle(0, 0, 827, 1137));
|
||||
if (pageOrientation == PageOrientation.Portrait)
|
||||
{
|
||||
string[] templatePaths = new string[] { "C:\\TBF\\Templates\\MunichP.jpg", "C:\\TBF\\Templates\\MunichP.png", "C:\\TBF\\Templates\\MunichP.tif" };
|
||||
foreach (var t in templatePaths)
|
||||
{
|
||||
if (File.Exists(t))
|
||||
{
|
||||
e.Graphics.DrawImage(new Bitmap(Image.FromFile(t), 827, 1169), new Rectangle(0, 0, 827, 1169));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
string[] templatePaths = new string[] { "C:\\TBF\\Templates\\MunichL.jpg", "C:\\TBF\\Templates\\MunichL.png", "C:\\TBF\\Templates\\MunichL.tif" };
|
||||
foreach (var t in templatePaths)
|
||||
{
|
||||
if (File.Exists(t))
|
||||
{
|
||||
e.Graphics.DrawImage(new Bitmap(Image.FromFile(t), 1169, 827), new Rectangle(0, 0, 1169, 827));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/// Set print area size and margins (in dots using 80 dpi)
|
||||
int printHeight = base.DefaultPageSettings.PaperSize.Height - base.DefaultPageSettings.Margins.Top - base.DefaultPageSettings.Margins.Bottom;
|
||||
@@ -144,27 +276,21 @@ namespace Results.Output.Printers.Munich
|
||||
|
||||
if (pageNr == 1)
|
||||
{
|
||||
RectangleF printArea = new RectangleF(TitleX, TitleY, 667, 50);
|
||||
/// This is the first page, drad the title, common part and the 1st table
|
||||
|
||||
RectangleF printArea = new RectangleF(TitleX, TitleY, 667, 50);
|
||||
e.Graphics.DrawString(wm.Batch.ProtocolTitle, this.fontTitle, Brushes.Black, printArea);
|
||||
|
||||
///
|
||||
/// Common
|
||||
///
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, docVersion);
|
||||
lineNr++;
|
||||
PrintBoldAt(e, Tab1, lineNr * SpacingOne, "Prüfstand Nr :");
|
||||
PrintBoldAt(e, Tab2, lineNr * SpacingOne, wm.BenchId().ToString());
|
||||
PrintBoldAt(e, Tab3, lineNr * SpacingOne, "Datum :");
|
||||
PrintBoldAt(e, Tab4, lineNr * SpacingOne, wm.Batch.EndTime.Date.ToString("d"));
|
||||
lineNr++;
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Zählertyp :");
|
||||
PrintAt(e, Tab2, lineNr * SpacingOne, zaehlertyp);
|
||||
PrintAt(e, Tab3, lineNr * SpacingOne, "Eichjahr :");
|
||||
PrintAt(e, Tab4, lineNr * SpacingOne, wm.YearOfProduction.ToString());
|
||||
lineNr++;
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Prüfvorlage :");
|
||||
PrintAt(e, Tab2, lineNr * SpacingOne, pruefvorlage);
|
||||
DrawCommonTop(e, ref lineNr, wm, pruefvorlage, docVersion);
|
||||
|
||||
lineNr += 2;
|
||||
tableTop = SpacingOne * lineNr;
|
||||
}
|
||||
else
|
||||
{
|
||||
/// This appears on the top of the 2nd and every subsequent page.
|
||||
/// 2nd table starts from the top of the page.
|
||||
lineNr -= 3;
|
||||
|
||||
if (compound)
|
||||
{
|
||||
@@ -189,228 +315,294 @@ namespace Results.Output.Printers.Munich
|
||||
PrintAt(e, Tab3, lineNr * SpacingOne, "Seriennummer :");
|
||||
PrintAt(e, Tab4, lineNr * SpacingOne, wm.SerialNrAux);
|
||||
}
|
||||
lineNr++;
|
||||
lineNr += ((resultsCount + 2) * SpacingOneAndHalf) / SpacingOne + 2;
|
||||
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, wm.NewQnames() ? "Q3 :" : "Qn :");
|
||||
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Q3_Qn().ToString());
|
||||
if (compound)
|
||||
{
|
||||
PrintAt(e, Tab3, lineNr * SpacingOne, wm.NewQnames() ? "Q3 :" : "Qn :");
|
||||
PrintAt(e, Tab4, lineNr * SpacingOne, wm.Q3_Qn_Aux().ToString());
|
||||
}
|
||||
lineNr++;
|
||||
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Zulassungszeichen :");
|
||||
PrintAt(e, Tab2, lineNr * SpacingOne, wm.ApprovalInfo());
|
||||
if (compound)
|
||||
{
|
||||
PrintAt(e, Tab3, lineNr * SpacingOne, "Zulassungszeichen :");
|
||||
PrintAt(e, Tab4, lineNr * SpacingOne, wm.ApprovalInfoAux());
|
||||
}
|
||||
lineNr++;
|
||||
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Metr. klasse :");
|
||||
PrintAt(e, Tab2, lineNr * SpacingOne, wm.MetrologicalClass());
|
||||
if (compound)
|
||||
{
|
||||
PrintAt(e, Tab3, lineNr * SpacingOne, "Metr. klasse :");
|
||||
PrintAt(e, Tab4, lineNr * SpacingOne, wm.MetrologicalClassAux());
|
||||
}
|
||||
lineNr++;
|
||||
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Stand :");
|
||||
PrintAt(e, Tab2, lineNr * SpacingOne, wm.EndState);
|
||||
if (compound)
|
||||
{
|
||||
PrintAt(e, Tab3, lineNr * SpacingOne, "Stand :");
|
||||
PrintAt(e, Tab4, lineNr * SpacingOne, wm.EndStateAux);
|
||||
|
||||
lineNr += 2;
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Umschaltpunkte :");
|
||||
lineNr++;
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Qsteig");
|
||||
PrintAt(e, Tab2, lineNr * SpacingOne, (1000.0 * wm.QRise).ToString("F1") + " l/h");
|
||||
lineNr++;
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Qfall");
|
||||
PrintAt(e, Tab2, lineNr * SpacingOne, (1000.0 * wm.QFall).ToString("F1") + " l/h");
|
||||
}
|
||||
|
||||
lineNr += 2;
|
||||
firstTblTop = SpacingOne * lineNr;
|
||||
|
||||
///
|
||||
/// Table 1
|
||||
///
|
||||
PrintTableOne(e, firstTblTop);
|
||||
DrawTableFrame(e, resultsCount + 1, firstTblTop);
|
||||
tableTop = TitleY + (compound ? 5 : 4) * SpacingOne;
|
||||
}
|
||||
|
||||
if (firstTblRowsOnPage[pageNr - 1] > 0)
|
||||
{
|
||||
int from = 0;
|
||||
for (int pN = 0; pN < pageNr - 1; pN++) from += firstTblRowsOnPage[pN];
|
||||
Table table1 = PrepareTableOne(from, from + firstTblRowsOnPage[pageNr - 1] - 1);
|
||||
tableTop = table1.Draw(e, Tab1, tableTop) + SpacingOneAndHalf;
|
||||
}
|
||||
|
||||
if (pageNr == nrPages)
|
||||
{
|
||||
if (pageNr == 1)
|
||||
{
|
||||
secondTblTop = firstTblTop + (resultsCount + 2) * SpacingOneAndHalf;
|
||||
lineNr += ((resultsCount + 2) * SpacingOneAndHalf * 2) / SpacingOne;
|
||||
}
|
||||
else
|
||||
{
|
||||
lineNr -= 3;
|
||||
|
||||
if (compound)
|
||||
{
|
||||
PrintBoldAt(e, Tab1, lineNr * SpacingOne, "Hauptzahler");
|
||||
PrintBoldAt(e, Tab3, lineNr * SpacingOne, "Nebenzahler");
|
||||
lineNr++;
|
||||
}
|
||||
if (secondTblRowsOnPage[pageNr - 1] > 0)
|
||||
{
|
||||
int from = 0;
|
||||
for (int pN = 0; pN < pageNr - 1; pN++) from += secondTblRowsOnPage[pN];
|
||||
Table table2 = PrepareTableTwo(from, from + secondTblRowsOnPage[pageNr - 1] - 1);
|
||||
tableTop = table2.Draw(e, Tab1, tableTop) + SpacingOneAndHalf;
|
||||
}
|
||||
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Hersteller :");
|
||||
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Producer());
|
||||
if (compound)
|
||||
{
|
||||
PrintAt(e, Tab3, lineNr * SpacingOne, "Hersteller :");
|
||||
PrintAt(e, Tab4, lineNr * SpacingOne, wm.ProducerAux());
|
||||
}
|
||||
lineNr++;
|
||||
if (pageNr == nrPages)
|
||||
{
|
||||
int top = topMargin + printHeight - 8 * SpacingOne;
|
||||
DrawCommonBottom(e, top, wm);
|
||||
}
|
||||
else
|
||||
{
|
||||
e.HasMorePages = true;
|
||||
}
|
||||
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Seriennummer :");
|
||||
PrintAt(e, Tab2, lineNr * SpacingOne, wm.SerialNr);
|
||||
if (compound)
|
||||
{
|
||||
PrintAt(e, Tab3, lineNr * SpacingOne, "Seriennummer :");
|
||||
PrintAt(e, Tab4, lineNr * SpacingOne, wm.SerialNrAux);
|
||||
}
|
||||
lineNr += ((resultsCount + 2) * SpacingOneAndHalf) / SpacingOne + 2;
|
||||
|
||||
secondTblTop = TitleY + (compound ? 5 : 4) * SpacingOne;
|
||||
}
|
||||
|
||||
///
|
||||
/// Table 2
|
||||
///
|
||||
PrintTableTwo(e, secondTblTop);
|
||||
DrawTableFrame(e, resultsCount + 1, secondTblTop);
|
||||
|
||||
///
|
||||
/// Footer
|
||||
///
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Temperatur");
|
||||
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbTempMean().ToString("F1") + " \x00b0C");
|
||||
lineNr++;
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Feuchtigkeit");
|
||||
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Batch.AmbHumiMean().ToString("F0") + " %");
|
||||
lineNr++;
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Luftdruck");
|
||||
PrintAt(e, Tab2, lineNr * SpacingOne, Config.Units.ConvertTo(Config.Unit.mbar, wm.Batch.AmbPressMean()).ToString("F0") + " mbar");
|
||||
|
||||
lineNr++;
|
||||
PrintAt(e, Tab3, lineNr * SpacingOne, wm.Batch.EndTime.Date.ToString("d"));
|
||||
lineNr++;
|
||||
PrintAt(e, Tab3, lineNr * SpacingOne, "Datum");
|
||||
PrintAt(e, Tab4, lineNr * SpacingOne, "Unterschrift");
|
||||
}
|
||||
|
||||
e.HasMorePages = (pageNr != nrPages);
|
||||
pageNr++;
|
||||
}
|
||||
///
|
||||
/// Draw a footer and increment the page number
|
||||
///
|
||||
string pageNrText = string.Format("{0} {1}/{2}", Strings.Page, pageNr++, nrPages);
|
||||
int pageNrWidth = (int)e.Graphics.MeasureString(pageNrText, font).Width;
|
||||
PrintAt(e, leftMargin + (printWidth - pageNrWidth) / 2, topMargin + printHeight - SpacingOne, pageNrText);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Print table texts.
|
||||
/// Prepares content and style of the first table.
|
||||
/// </summary>
|
||||
void PrintTableOne(System.Drawing.Printing.PrintPageEventArgs e, int tblTop)
|
||||
/// <param name="from">0-based index fo the first result to print</param>
|
||||
/// <param name="to">0-based index fo the last result to print</param>
|
||||
/// <returns>Prepared table</returns>
|
||||
Table PrepareTableOne(int from = 0, int to = int.MaxValue)
|
||||
{
|
||||
PrintAt(e, GetTabItemPos(0, 0, tblTop), "Prüflauf");
|
||||
PrintAt(e, GetTabItemPos(0, 1, tblTop), "Q [l/h]");
|
||||
PrintAt(e, GetTabItemPos(0, 2, tblTop), "Prüf-Vol.[l]");
|
||||
PrintAt(e, GetTabItemPos(0, 3, tblTop), compound ? "HZ-Vol.[l]" : "Z-Vol.[l]");
|
||||
PrintAt(e, GetTabItemPos(0, 4, tblTop), compound ? "NZ-Vol.[l]" : "-");
|
||||
PrintAt(e, GetTabItemPos(0, 5, tblTop), "Fehler [%]");
|
||||
PrintAt(e, GetTabItemPos(0, 6, tblTop), "Ergebnis");
|
||||
Table table = new Table(7);
|
||||
table.Style = tableStyle;
|
||||
|
||||
int rowCnt = 1;
|
||||
string[] tableHeader = new string[]
|
||||
{
|
||||
"Prüflauf",
|
||||
"Q [l/h]",
|
||||
"Prüf-Vol.[l]",
|
||||
compound ? "HZ-Vol.[l]" : "Z-Vol.[l]",
|
||||
compound ? "NZ-Vol.[l]" : "-",
|
||||
"Fehler [%]",
|
||||
"Ergebnis",
|
||||
};
|
||||
table.AddRow(tableHeader, horizontalAlignment, verticalAlignment);
|
||||
|
||||
int rowCount = 0;
|
||||
foreach (var mtr in wm.MeterTestRslts)
|
||||
{
|
||||
if (!compound || mtr.CompoundMeterId == (byte)CompoundMeterId.Compound)
|
||||
{
|
||||
PrintAt(e, GetTabItemPos(rowCnt, 0, tblTop), mtr.Name());
|
||||
PrintAt(e, GetTabItemPos(rowCnt, 1, tblTop), mtr.TestRslt.FlowMass.ToString("F1"));
|
||||
PrintAt(e, GetTabItemPos(rowCnt, 2, tblTop), mtr.TestRslt.VolumeCTV.ToString("F2"));
|
||||
if (compound)
|
||||
{
|
||||
Results.Entities.MeterTestRslt mainMtr = wm.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundMain);
|
||||
Results.Entities.MeterTestRslt auxMtr = wm.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundAux);
|
||||
if (mtr != null && mtr.IsPilotRslt() && mtr.Publish() == Config.Entities.Publish.Always)
|
||||
{
|
||||
if (from <= rowCount && rowCount <= to)
|
||||
{
|
||||
double flow_ctv = (mtr.TestRslt.TestTime != 0) ? (3.6 * mtr.TestRslt.VolumeCTV / mtr.TestRslt.TestTime) : 0;
|
||||
|
||||
PrintAt(e, GetTabItemPos(rowCnt, 3, tblTop), mainMtr.VolumeMeter.ToString("F2"));
|
||||
PrintAt(e, GetTabItemPos(rowCnt, 4, tblTop), auxMtr.VolumeMeter.ToString("F2"));
|
||||
PrintAt(e, GetTabItemPos(rowCnt, 5, tblTop), mtr.Error.ToString("F2"));
|
||||
PrintAt(e, GetTabItemPos(rowCnt, 6, tblTop), mtr.Passed ? "iO" : "NiO");
|
||||
}
|
||||
else
|
||||
{
|
||||
PrintAt(e, GetTabItemPos(rowCnt, 3, tblTop), mtr.VolumeMeter.ToString("F2"));
|
||||
PrintAt(e, GetTabItemPos(rowCnt, 4, tblTop), "-");
|
||||
PrintAt(e, GetTabItemPos(rowCnt, 5, tblTop), mtr.Error.ToString("F2"));
|
||||
PrintAt(e, GetTabItemPos(rowCnt, 6, tblTop), mtr.Passed ? "iO" : "NiO");
|
||||
}
|
||||
if (compound)
|
||||
{
|
||||
Results.Entities.MeterTestRslt mainMtr = wm.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundMain);
|
||||
Results.Entities.MeterTestRslt auxMtr = wm.GetMeterTestRslt(mtr.Name(), CompoundMeterId.CompoundAux);
|
||||
|
||||
rowCnt++;
|
||||
table.AddRow(new string[] { mtr.Name(),
|
||||
Config.Units.ConvertTo(Config.Unit.lph, flow_ctv).ToString("F1"),
|
||||
mtr.TestRslt.VolumeCTV.ToString("F2"),
|
||||
mainMtr.VolumeMeter.ToString("F2"),
|
||||
auxMtr.VolumeMeter.ToString("F2"),
|
||||
mtr.Error.ToString("F2"),
|
||||
mtr.Passed ? "iO" : "NiO" },
|
||||
horizontalAlignment,
|
||||
verticalAlignment);
|
||||
}
|
||||
else
|
||||
{
|
||||
table.AddRow(new string[] { mtr.Name(),
|
||||
Config.Units.ConvertTo(Config.Unit.lph, flow_ctv).ToString("F1"),
|
||||
mtr.TestRslt.VolumeCTV.ToString("F2"),
|
||||
mtr.VolumeMeter.ToString("F2"),
|
||||
"-",
|
||||
mtr.Error.ToString("F2"),
|
||||
mtr.Passed ? "iO" : "NiO" },
|
||||
|
||||
horizontalAlignment,
|
||||
verticalAlignment);
|
||||
}
|
||||
}
|
||||
rowCount++;
|
||||
}
|
||||
}
|
||||
|
||||
return table;
|
||||
}
|
||||
|
||||
void PrintTableTwo(System.Drawing.Printing.PrintPageEventArgs e, int tblTop)
|
||||
/// <summary>
|
||||
/// Prepares content and style of the second table.
|
||||
/// </summary>
|
||||
/// <param name="from">0-based index fo the first result to print</param>
|
||||
/// <param name="to">0-based index fo the last result to print</param>
|
||||
/// <returns>Prepared table</returns>
|
||||
Table PrepareTableTwo(int from = 0, int to = int.MaxValue)
|
||||
{
|
||||
PrintAt(e, GetTabItemPos(0, 1, tblTop), "Q [l/h]");
|
||||
PrintAt(e, GetTabItemPos(0, 2, tblTop), "Temperatur");
|
||||
PrintAt(e, GetTabItemPos(0, 3, tblTop), "Dichte");
|
||||
PrintAt(e, GetTabItemPos(0, 4, tblTop), "Prüfzeit");
|
||||
PrintAt(e, GetTabItemPos(0, 5, tblTop), "Druck Eing.");
|
||||
PrintAt(e, GetTabItemPos(0, 6, tblTop), "Druck Ausg.");
|
||||
Table table = new Table(7);
|
||||
table.Style = tableStyle;
|
||||
|
||||
int rowCnt = 1;
|
||||
string[] tableHeader = new string[]
|
||||
{
|
||||
"",
|
||||
"Q [l/h]",
|
||||
"Temperatur",
|
||||
"Dichte",
|
||||
"Prüfzeit",
|
||||
"Druck Eing.",
|
||||
"Druck Ausg.",
|
||||
};
|
||||
table.AddRow(tableHeader, horizontalAlignment, verticalAlignment);
|
||||
|
||||
int rowCount = 0;
|
||||
foreach (var mtr in wm.MeterTestRslts)
|
||||
{
|
||||
if (!compound || mtr.CompoundMeterId == (byte)CompoundMeterId.Compound)
|
||||
{
|
||||
Point p = GetTabItemPos(rowCnt, 0, tblTop);
|
||||
PrintAt(e, p.X, p.Y, mtr.Name());
|
||||
if (mtr != null && mtr.IsPilotRslt() && mtr.Publish() == Config.Entities.Publish.Always)
|
||||
{
|
||||
if (from <= rowCount && rowCount <= to)
|
||||
{
|
||||
double flow_ctv = (mtr.TestRslt.TestTime != 0) ? (3.6 * mtr.TestRslt.VolumeCTV / mtr.TestRslt.TestTime) : 0;
|
||||
|
||||
PrintAt(e, GetTabItemPos(rowCnt, 1, tblTop), mtr.TestRslt.FlowMass.ToString("F1"));
|
||||
PrintAt(e, GetTabItemPos(rowCnt, 2, tblTop), mtr.TestRslt.TempDownMean.ToString("F2"));
|
||||
PrintAt(e, GetTabItemPos(rowCnt, 3, tblTop), mtr.TestRslt.DensityDiv.ToString("F2"));
|
||||
PrintAt(e, GetTabItemPos(rowCnt, 4, tblTop), mtr.TestTime.ToString("F1"));
|
||||
PrintAt(e, GetTabItemPos(rowCnt, 5, tblTop), Config.Units.ConvertTo(Config.Unit.bar, mtr.TestRslt.PressUpMean).ToString("F3"));
|
||||
PrintAt(e, GetTabItemPos(rowCnt, 6, tblTop), Config.Units.ConvertTo(Config.Unit.bar, mtr.TestRslt.PressDownMean).ToString("F3"));
|
||||
|
||||
rowCnt++;
|
||||
}
|
||||
table.AddRow(new string[] { mtr.Name(),
|
||||
Config.Units.ConvertTo(Config.Unit.lph, flow_ctv).ToString("F1"),
|
||||
mtr.TestRslt.TempDownMean.ToString("F2"),
|
||||
mtr.TestRslt.DensityDiv.ToString("F2"),
|
||||
mtr.TestTime.ToString("F1"),
|
||||
Config.Units.ConvertTo(Config.Unit.bar, mtr.TestRslt.PressUpMean).ToString("F3"),
|
||||
Config.Units.ConvertTo(Config.Unit.bar, mtr.TestRslt.PressDownMean).ToString("F3") },
|
||||
horizontalAlignment,
|
||||
verticalAlignment);
|
||||
}
|
||||
rowCount++;
|
||||
}
|
||||
}
|
||||
|
||||
return table;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Draw table lines.
|
||||
/// </summary>
|
||||
void DrawTableFrame(System.Drawing.Printing.PrintPageEventArgs e, int rowsCount, int tblTop)
|
||||
{
|
||||
int t = tblTop;
|
||||
int m = tblTop + SpacingOneAndHalf;
|
||||
int b = tblTop + rowsCount * SpacingOneAndHalf;
|
||||
/// <summary>
|
||||
/// Prints text on the top of the first page (title, common information).
|
||||
/// </summary>
|
||||
/// <param name="e"></param>
|
||||
/// <param name="lineNr"></param>
|
||||
/// <param name="wm"></param>
|
||||
/// <param name="pruefvorlage"></param>
|
||||
/// <param name="docVersion"></param>
|
||||
void DrawCommonTop(PrintPageEventArgs e, ref int lineNr, Entities.WaterMeter wm, string pruefvorlage, string docVersion)
|
||||
{
|
||||
///
|
||||
///
|
||||
///
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, docVersion);
|
||||
lineNr++;
|
||||
PrintBoldAt(e, Tab1, lineNr * SpacingOne, "Prüfstand Nr :");
|
||||
PrintBoldAt(e, Tab2, lineNr * SpacingOne, wm.BenchId().ToString());
|
||||
PrintBoldAt(e, Tab3, lineNr * SpacingOne, "Datum :");
|
||||
PrintBoldAt(e, Tab4, lineNr * SpacingOne, wm.Batch.EndTime.Date.ToString("d"));
|
||||
lineNr++;
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Zählertyp :");
|
||||
PrintAt(e, Tab2, lineNr * SpacingOne, zaehlertyp);
|
||||
PrintAt(e, Tab3, lineNr * SpacingOne, "Eichjahr :");
|
||||
PrintAt(e, Tab4, lineNr * SpacingOne, wm.YearOfProduction.ToString());
|
||||
lineNr++;
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Prüfvorlage :");
|
||||
PrintAt(e, Tab2, lineNr * SpacingOne, pruefvorlage);
|
||||
lineNr += 2;
|
||||
|
||||
// Horizontal lines
|
||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(80, t), new Point(747, t));
|
||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(80, m), new Point(747, m));
|
||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(80, b), new Point(747, b));
|
||||
if (compound)
|
||||
{
|
||||
PrintBoldAt(e, Tab1, lineNr * SpacingOne, "Hauptzahler");
|
||||
PrintBoldAt(e, Tab3, lineNr * SpacingOne, "Nebenzahler");
|
||||
lineNr++;
|
||||
}
|
||||
|
||||
// Vertical lines
|
||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point( 80, t), new Point( 80, b));
|
||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(267, t), new Point(267, b));
|
||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(347, t), new Point(347, b));
|
||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(427, t), new Point(427, b));
|
||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(507, t), new Point(507, b));
|
||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(587, t), new Point(587, b));
|
||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(667, t), new Point(667, b));
|
||||
e.Graphics.DrawLine(new Pen(Color.Black, BorderW), new Point(747, t), new Point(747, b));
|
||||
}
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Hersteller :");
|
||||
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Producer());
|
||||
if (compound)
|
||||
{
|
||||
PrintAt(e, Tab3, lineNr * SpacingOne, "Hersteller :");
|
||||
PrintAt(e, Tab4, lineNr * SpacingOne, wm.ProducerAux());
|
||||
}
|
||||
lineNr++;
|
||||
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Seriennummer :");
|
||||
PrintAt(e, Tab2, lineNr * SpacingOne, wm.SerialNr);
|
||||
if (compound)
|
||||
{
|
||||
PrintAt(e, Tab3, lineNr * SpacingOne, "Seriennummer :");
|
||||
PrintAt(e, Tab4, lineNr * SpacingOne, wm.SerialNrAux);
|
||||
}
|
||||
lineNr++;
|
||||
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, wm.NewQnames() ? "Q3 :" : "Qn :");
|
||||
PrintAt(e, Tab2, lineNr * SpacingOne, wm.Q3_Qn().ToString());
|
||||
if (compound)
|
||||
{
|
||||
PrintAt(e, Tab3, lineNr * SpacingOne, wm.NewQnames() ? "Q3 :" : "Qn :");
|
||||
PrintAt(e, Tab4, lineNr * SpacingOne, wm.Q3_Qn_Aux().ToString());
|
||||
}
|
||||
lineNr++;
|
||||
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Zulassungszeichen :");
|
||||
PrintAt(e, Tab2, lineNr * SpacingOne, wm.ApprovalInfo());
|
||||
if (compound)
|
||||
{
|
||||
PrintAt(e, Tab3, lineNr * SpacingOne, "Zulassungszeichen :");
|
||||
PrintAt(e, Tab4, lineNr * SpacingOne, wm.ApprovalInfoAux());
|
||||
}
|
||||
lineNr++;
|
||||
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Metr. klasse :");
|
||||
PrintAt(e, Tab2, lineNr * SpacingOne, wm.MetrologicalClass());
|
||||
if (compound)
|
||||
{
|
||||
PrintAt(e, Tab3, lineNr * SpacingOne, "Metr. klasse :");
|
||||
PrintAt(e, Tab4, lineNr * SpacingOne, wm.MetrologicalClassAux());
|
||||
}
|
||||
lineNr++;
|
||||
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Stand :");
|
||||
PrintAt(e, Tab2, lineNr * SpacingOne, wm.EndState);
|
||||
if (compound)
|
||||
{
|
||||
PrintAt(e, Tab3, lineNr * SpacingOne, "Stand :");
|
||||
PrintAt(e, Tab4, lineNr * SpacingOne, wm.EndStateAux);
|
||||
|
||||
lineNr += 2;
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Umschaltpunkte :");
|
||||
lineNr++;
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Qsteig");
|
||||
PrintAt(e, Tab2, lineNr * SpacingOne, (1000.0 * wm.QRise).ToString("F1") + " l/h");
|
||||
lineNr++;
|
||||
PrintAt(e, Tab1, lineNr * SpacingOne, "Qfall");
|
||||
PrintAt(e, Tab2, lineNr * SpacingOne, (1000.0 * wm.QFall).ToString("F1") + " l/h");
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Prints text at the bottom of the last page (footer).
|
||||
/// </summary>
|
||||
/// <param name="e"></param>
|
||||
/// <param name="lineNr"></param>
|
||||
/// <param name="wm"></param>
|
||||
void DrawCommonBottom(PrintPageEventArgs e, float top, Entities.WaterMeter wm)
|
||||
{
|
||||
int iTop = (int)top;
|
||||
|
||||
PrintAt(e, Tab1, iTop, "Temperatur");
|
||||
PrintAt(e, Tab2, iTop, wm.Batch.AmbTempMean().ToString("F1") + " \x00b0C");
|
||||
|
||||
iTop += SpacingOne;
|
||||
|
||||
PrintAt(e, Tab1, iTop, "Feuchtigkeit");
|
||||
PrintAt(e, Tab2, iTop, wm.Batch.AmbHumiMean().ToString("F0") + " %");
|
||||
|
||||
iTop += SpacingOne;
|
||||
|
||||
PrintAt(e, Tab1, iTop, "Luftdruck");
|
||||
PrintAt(e, Tab2, iTop, Config.Units.ConvertTo(Config.Unit.mbar, wm.Batch.AmbPressMean()).ToString("F0") + " mbar");
|
||||
|
||||
iTop += SpacingOne;
|
||||
|
||||
PrintAt(e, Tab3, iTop, wm.Batch.EndTime.Date.ToString("d"));
|
||||
|
||||
iTop += SpacingOne;
|
||||
|
||||
PrintAt(e, Tab3, iTop, "Datum");
|
||||
PrintAt(e, Tab4, iTop, "Unterschrift");
|
||||
}
|
||||
|
||||
|
||||
void PrintAt(System.Drawing.Printing.PrintPageEventArgs e, Point p, string text)
|
||||
@@ -434,18 +626,5 @@ namespace Results.Output.Printers.Munich
|
||||
RectangleF printArea = new RectangleF(x, y, 667, SpacingOne);
|
||||
e.Graphics.DrawString(text, this.boldFont, Brushes.Black, printArea);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get text position form a number of the test and a number of the parameter.
|
||||
/// </summary>
|
||||
/// <param name="row"></param>
|
||||
/// <param name="column">Table column (0-based)</param>
|
||||
/// <returns></returns>
|
||||
Point GetTabItemPos(int row, int column, int tblTop)
|
||||
{
|
||||
int x = MarginLeft + ((column == 0) ? 80 : 187) + column * 80; /// leftmost column is wider
|
||||
int y = MarginTop + tblTop + (row * SpacingOneAndHalf) - 2;
|
||||
return new Point(x, y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ namespace Results.Output.Printers
|
||||
public float LineWidth;
|
||||
public TableLines HorizLines;
|
||||
public TableLines VertLines;
|
||||
public float[] ColumnWidths; /// null = automatic
|
||||
}
|
||||
|
||||
public class Table
|
||||
@@ -57,10 +58,21 @@ namespace Results.Output.Printers
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Returns true when table has either rows or columns count == 0
|
||||
/// </summary>
|
||||
/// <returns>true when empty</returns>
|
||||
public bool IsEmpty()
|
||||
{
|
||||
return (Rows == null || RowsCount == 0 || Rows[0] == null || Rows[0].Length == 0);
|
||||
}
|
||||
|
||||
|
||||
public SizeF Measure(System.Drawing.Printing.PrintPageEventArgs e)
|
||||
{
|
||||
SizeF retVal = new SizeF(0, 0);
|
||||
if (RowsCount == 0) return retVal;
|
||||
|
||||
if (IsEmpty()) return retVal; /// Empty table => zero Size
|
||||
|
||||
float[] columnWidth = new float[ColumnsCount];
|
||||
float[] rowHeight = new float[RowsCount];
|
||||
@@ -117,10 +129,10 @@ namespace Results.Output.Printers
|
||||
|
||||
public float Draw(System.Drawing.Printing.PrintPageEventArgs e, float left, float top)
|
||||
{
|
||||
if (RowsCount == 0) return top;
|
||||
if (IsEmpty()) return top; /// Empty table
|
||||
|
||||
int tblColumnsCount = Rows[0].Length;
|
||||
|
||||
|
||||
float[] columnWidth = new float[tblColumnsCount];
|
||||
float[] columnPos = new float[tblColumnsCount];
|
||||
float[] vertLinePos = new float[tblColumnsCount + 1];
|
||||
@@ -143,6 +155,10 @@ namespace Results.Output.Printers
|
||||
/// In not a separator line
|
||||
bool isHeader = (colIx < Style.LeftHeadersCount) || (rowIx < Style.TopHeadersCount);
|
||||
SizeF size = PrintersCommon.Measure(e, Rows[rowIx][colIx], isHeader ? Style.HeaderFont : Style.Font);
|
||||
if ((Style.ColumnWidths != null) && (Style.ColumnWidths.Length > colIx))
|
||||
{
|
||||
size.Width = Style.ColumnWidths[colIx]; /// Override measurement if column width is defined
|
||||
}
|
||||
if (size.Width > columnWidth[colIx]) columnWidth[colIx] = size.Width;
|
||||
if (size.Height > rowHeight[rowIx]) rowHeight[rowIx] = size.Height;
|
||||
}
|
||||
|
||||
@@ -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.918.0")]
|
||||
[assembly: AssemblyFileVersion("2.18.918.0")]
|
||||
|
||||
Generated
+55
-1
@@ -69,6 +69,15 @@ namespace Results.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Address.
|
||||
/// </summary>
|
||||
internal static string Address {
|
||||
get {
|
||||
return ResourceManager.GetString("Address", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Alignment.
|
||||
/// </summary>
|
||||
@@ -105,6 +114,15 @@ namespace Results.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Batch.
|
||||
/// </summary>
|
||||
internal static string Batch {
|
||||
get {
|
||||
return ResourceManager.GetString("Batch", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Batch nr..
|
||||
/// </summary>
|
||||
@@ -123,6 +141,24 @@ namespace Results.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Bench ID.
|
||||
/// </summary>
|
||||
internal static string Bench_ID {
|
||||
get {
|
||||
return ResourceManager.GetString("Bench_ID", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Bench name.
|
||||
/// </summary>
|
||||
internal static string Bench_name {
|
||||
get {
|
||||
return ResourceManager.GetString("Bench_name", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Cancel.
|
||||
/// </summary>
|
||||
@@ -636,6 +672,15 @@ namespace Results.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Procedure description.
|
||||
/// </summary>
|
||||
internal static string Procedure_description {
|
||||
get {
|
||||
return ResourceManager.GetString("Procedure_description", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Producer.
|
||||
/// </summary>
|
||||
@@ -1023,6 +1068,15 @@ namespace Results.Resources {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Relative error of a meter in previous test/in production.
|
||||
/// </summary>
|
||||
internal static string Tooltip_E_rel_last {
|
||||
get {
|
||||
return ResourceManager.GetString("Tooltip_E_rel_last", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to Relative error of the master meter.
|
||||
/// </summary>
|
||||
@@ -1303,7 +1357,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 {
|
||||
|
||||
@@ -213,4 +213,46 @@
|
||||
<data name="Unit" xml:space="preserve">
|
||||
<value>Jednotka</value>
|
||||
</data>
|
||||
<data name="Approval" xml:space="preserve">
|
||||
<value>Schválení</value>
|
||||
</data>
|
||||
<data name="Bench" xml:space="preserve">
|
||||
<value>Stanice</value>
|
||||
</data>
|
||||
<data name="Density" xml:space="preserve">
|
||||
<value>Hustota</value>
|
||||
</data>
|
||||
<data name="Density_correction" xml:space="preserve">
|
||||
<value>Korekce hustoty</value>
|
||||
</data>
|
||||
<data name="End" xml:space="preserve">
|
||||
<value>Konec</value>
|
||||
</data>
|
||||
<data name="Procedure" xml:space="preserve">
|
||||
<value>Procedura</value>
|
||||
</data>
|
||||
<data name="Procedure_description" xml:space="preserve">
|
||||
<value>Popis procedury</value>
|
||||
</data>
|
||||
<data name="Start" xml:space="preserve">
|
||||
<value>Začátek</value>
|
||||
</data>
|
||||
<data name="User" xml:space="preserve">
|
||||
<value>Uživatel</value>
|
||||
</data>
|
||||
<data name="User_description" xml:space="preserve">
|
||||
<value>Popis uživatele</value>
|
||||
</data>
|
||||
<data name="Bench_ID" xml:space="preserve">
|
||||
<value>ID stanice</value>
|
||||
</data>
|
||||
<data name="Bench_name" xml:space="preserve">
|
||||
<value>Jméno stanice</value>
|
||||
</data>
|
||||
<data name="Address" xml:space="preserve">
|
||||
<value>Adresa</value>
|
||||
</data>
|
||||
<data name="Batch" xml:space="preserve">
|
||||
<value>Dávka</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -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>
|
||||
@@ -723,4 +723,22 @@
|
||||
<data name="Unit" xml:space="preserve">
|
||||
<value>Unit</value>
|
||||
</data>
|
||||
<data name="Procedure_description" xml:space="preserve">
|
||||
<value>Procedure description</value>
|
||||
</data>
|
||||
<data name="Bench_ID" xml:space="preserve">
|
||||
<value>Bench ID</value>
|
||||
</data>
|
||||
<data name="Bench_name" xml:space="preserve">
|
||||
<value>Bench name</value>
|
||||
</data>
|
||||
<data name="Address" xml:space="preserve">
|
||||
<value>Address</value>
|
||||
</data>
|
||||
<data name="Tooltip_E_rel_last" xml:space="preserve">
|
||||
<value>Relative error of a meter in previous test/in production</value>
|
||||
</data>
|
||||
<data name="Batch" xml:space="preserve">
|
||||
<value>Batch</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -18,7 +18,7 @@
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG;SENTEC</DefineConstants>
|
||||
<DefineConstants>TRACE;DEBUG;MUNICH;LANG_DE</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;MUNICH;LANG_DE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
@@ -77,6 +77,9 @@
|
||||
<Compile Include="Forms\ListViewEx.cs">
|
||||
<SubType>Component</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Forms\ListViewExtensions.cs" />
|
||||
<Compile Include="Forms\LviIntColumnComparer.cs" />
|
||||
<Compile Include="Forms\LviTextColumnComparer.cs" />
|
||||
<Compile Include="Forms\ResultsConfigCtrl.cs">
|
||||
<SubType>UserControl</SubType>
|
||||
</Compile>
|
||||
|
||||
@@ -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)));
|
||||
|
||||
@@ -21,7 +21,7 @@
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG;SENTEC</DefineConstants>
|
||||
<DefineConstants>TRACE;DEBUG;MUNICH;LANG_DE</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;MUNICH;LANG_DE</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; } }
|
||||
|
||||
@@ -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); }
|
||||
@@ -317,9 +317,10 @@ namespace TBF.BenchControl.Elde
|
||||
DiverterEdge = new uint[divertersCount * 2];
|
||||
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[2 * i] = (uint)BenchControl.Elde.Diverter.Diverter.Diverters[i].ThresholdGate;
|
||||
DiverterEdge[2 * i + 1] = (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 +599,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 +620,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; }
|
||||
|
||||
@@ -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]; }
|
||||
|
||||
@@ -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);
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user