Compare commits

..
Author SHA1 Message Date
Milan Hanajik 162cb2a4e6 Reconfigured for SENTEC 2018-09-28 14:17:33 +02:00
Milan Hanajik 19d77a9ad9 SENTEC : FlyingStartMassCollectionSeq : Tank draining is completed before the flow control starts (as in Berlin). 2018-09-28 14:16:12 +02:00
Milan Hanajik e77c0460de UltrasoundLevelMeter parent name is 'Modbus' only. 2018-09-27 15:20:34 +02:00
Milan Hanajik 2ad5843f4f Cleanup: bool Output.SensusTestInfo.AreCompatible(.,. ) introduced, etc, ver. 2.18.1008 2018-09-27 15:02:36 +02:00
Milan Hanajik 631ef5fe20 SensusOracle.Database : Bug fix in TestInfo comparison, Qbz. Just == Just1 allowed now, ver. 2.18.1007 2018-09-25 16:36:43 +02:00
Milan Hanajik cd246e89c8 RequiredGroupMembership: Users.Grp.GID --> Users.Grp.GID[] (initial version), ver. 2.18.1006 2018-09-25 09:05:51 +02:00
Milan Hanajik 438374532f BatchResults.IsProduction( ) modified, ver. 2.18.1005 2018-09-24 13:06:01 +02:00
Milan Hanajik 92609b9ead iPerl CalibrationStructV4 related stuff added, ver. 2.18.1004 2018-09-24 10:06:19 +02:00
Milan Hanajik 07b51f12a2 Prevent SW crash in bool Results.Output.Printers.Table.IsEmpty( ) 2018-09-20 12:23:24 +02:00
Milan Hanajik 16494389c6 ver. 2.18.1001 2018-09-20 08:24:05 +02:00
Milan Hanajik be86f0278f FEWA_50 component added, FEWA_50 define processing added, ver. 2.18.1000 2018-09-19 12:17:38 +02:00
Milan Hanajik 7e7ae86f65 iPerlHead : 'LogType' procedure parameter added and used when creating 'optoDataLogFileName'. 2018-09-19 11:14:10 +02:00
Milan Hanajik 3b2139d3df (1) Output.FileWriters.IperlLogger uses definitions stored in Output.SensusTestInfo objects, (2) sensusOracle.Database OK for Suez, searches for appropriate SensusTestInfo-s. 2018-09-19 11:10:48 +02:00
Milan Hanajik 16c59b5c47 (1) MessageBoxOp, AskYesNoOp and CoverTest do not use Bridge.OnCloseQandAForm, (2) ChangeOfFlowDirection --> ChangeFlowDirection, (3) code cleanup, 2018-09-18 16:44:32 +02:00
Milan Hanajik 49cc584914 (1) Closing iPerlCommunicationForm fixed once again, (2) Czech translations fixed. 2018-09-18 15:24:33 +02:00
Milan Hanajik aeefac1d4e iPerlCommunication activity "Write Q2 correction R-L" and "Write Q2 correction L-R" added, ver. 2.18.999 2018-09-17 14:16:40 +02:00
Milan Hanajik 2b30607d9c ver. 2.18.998 2018-09-17 12:46:11 +02:00
Milan Hanajik cef8d3ff95 Stubs of Hart.Common and Hart.Nivotrack components added. 2018-09-14 12:13:15 +02:00
Milan Hanajik 64646486e9 All DataEntry forms bug fix : PurchaseOrder of water meters is updated only when a form was closed by OK, ver. 2.18.997 2018-09-14 09:52:11 +02:00
Milan Hanajik 769e68d49b Output.Printers.Enhanced : "Nr. of copies' option added, ver. 2.18.996 2018-09-14 09:02:21 +02:00
Milan Hanajik 3dcb134aa1 Output.Printers.Enhanced : 'Good only' option fixed. 2018-09-14 08:27:12 +02:00
Milan Hanajik 81cb0eae64 Results.ItemID : Procedure_description, Test_bench_name, Address1-5 and respective WMeterRsltItemSpec added, ver. 2.18.995 2018-09-14 08:25:22 +02:00
Milan Hanajik 4fad9925ec ResultsBrowser: CEVAK specific code commented out, ver. 2.18.995 2018-09-13 17:56:02 +02:00
Milan Hanajik 92d246eda0 TBF : Processing keys in MainWnd disabled for CEVAK_200 2018-09-13 17:54:03 +02:00
Milan Hanajik 34479778b9 CEVAK_40, FUZHOU_50/_100/_150/_300, MURES_40, PUCHONG_200, TORINO_50, TORUN_50 introduced, ver. 2.18.995 2018-09-13 14:17:03 +02:00
Milan Hanajik 163d209071 TBF bug fixes : (1) RegulValve adcChannel for CEVAK, (2) ComponentsManagerDlg columns. 2018-09-13 12:49:31 +02:00
Milan Hanajik 8eb601f24d UltrasoundLevelMeter component added. 2018-09-13 12:48:09 +02:00
Milan Hanajik ac9407b59d TestMethods.PulsesTestManual added, ver. 2.18.994 2018-09-13 09:02:24 +02:00
Milan Hanajik 00dd0ed8fd Output.FileWriters.IperlLogger modifications : LogType.DEWA added. 2018-09-12 13:30:39 +02:00
Milan Hanajik 6a53417b62 TBF : (1) SensusOracle component moved from DB to Output.DB, (2) Output.SensusCommon class, (3) Output.SensusTestInfo class. 2018-09-11 14:03:05 +02:00
Milan Hanajik 90f2b83fc0 iPerlCommunicationForm : Fixed closing the form when editing check boxes. 2018-09-11 11:31:00 +02:00
Milan Hanajik 3382c6e77a (1) Output.FileWriters.IperlLogger configuration for LogType.Suez, (2) DB.SensusOracle Quality DB + dead code/parameters cleanup, ver. 2.18.993 2018-09-11 11:30:08 +02:00
Milan Hanajik 072de642e1 ComponentsManagerDlg : Components sorting controlled by click-able column headers. 2018-09-10 12:28:53 +02:00
Milan Hanajik 489ebd04aa TestMethods.ChangeOfFlowDirection added. 2018-09-10 10:06:31 +02:00
Milan Hanajik 2a68934b0e More logging in all Output.FileWriters, ver. 2.18.992 2018-09-07 12:40:32 +02:00
Milan Hanajik f3a502b7df iPerlCommunicationForm : minimizing, maximizing and closing this form is disabled, ver. 2.18.992 2018-09-07 10:18:32 +02:00
Milan Hanajik 2b0e66c71d MessageBoxOp : Form has a windows title so that it can be moved. 2018-09-06 17:16:22 +02:00
Milan Hanajik e5c01a14d9 Bug fix in last graphs batch numbers. 2018-09-06 16:52:11 +02:00
Milan Hanajik e5ef10beac Bug fix in ErrorFlags evaluation. 2018-09-06 15:49:10 +02:00
Milan Hanajik 4c3c499ad5 Output.FileWriters.IperlLogger component added (generalized, loop over tests), ver. 2.18.990 2018-09-06 15:48:39 +02:00
Milan Hanajik bdc7f5abd8 RoiDetectionSeq : More logging (display) 2018-09-06 15:25:48 +02:00
Milan Hanajik 0ff78b9d4c (1) Multiple instances of SensusOracle.Database component possible, (2) Test.ItemNr updated properly, ver. 2.18.988 2018-09-04 13:48:50 +02:00
Milan Hanajik 41959d863f Changes for CEVAK PT200, ver. 2.18.986 2018-09-03 08:28:45 +02:00
Milan Hanajik e7d495e47d ver. 2.18.985 2018-08-31 14:16:08 +02:00
Milan Hanajik e4f5be3f41 iPerlCommunication : (1) Bug fix for iPerlSpecial, (2) Save button position, (3) Activity is a ComboBox, (4) DN is a ComboBox, ver. 2.18.984 2018-08-31 12:46:12 +02:00
Milan Hanajik f42c1b7f0c CEVAK PT200 component upgraded (initial version dated 30.08.2018). 2018-08-30 14:13:31 +02:00
Milan Hanajik 9dbca87429 Copying users from a remote database fixed (UI) and done as a database transaction, ver. 2.18.982 2018-08-30 14:11:40 +02:00
Milan Hanajik 49ae2a84c4 Remote DB : (1) Bug fix in DatabaseSettings.Clone(), (2) Compatibility check on startup. 2018-08-30 14:10:20 +02:00
Milan Hanajik 34073844bc Config.FluentCommon cleanup : SaveToDb( ) and DeleteFromDb( ) removed. 2018-08-30 08:04:19 +02:00
Milan Hanajik 6f3b9be77e TBF : LoginDlg displayed after a double-click on the status strip with current user name. 2018-08-28 13:11:55 +02:00
Milan Hanajik f675c7ada2 Output.DB.ProductionTracing.TracingDB : Workplace registration. 2018-08-28 13:10:31 +02:00
Milan Hanajik 6aee0a71ed TBF : Output.DB.ProductionMonitoring --> Output.DB.ProductionTracing. 2018-08-28 10:12:39 +02:00
Milan Hanajik fa818c5cf8 TracingDB : WorkplaceRegistration, etc. added, TrivialLoginDlg removed, ver. 1.5.61 --> 2.0.65 2018-08-28 09:58:58 +02:00
Milan Hanajik 0ef9505af1 MonitoringDB --> TracingDB, TBF ver. 2.18.981 2018-08-28 09:44:39 +02:00
Milan Hanajik bf69524fd8 TBF : (1) Elde.RegisterReader has a new proc. parameter int Filter, (2) Filters 'int[]' are passed everywhere in the TBF application istead of test.TolerRed. 2018-08-23 12:45:13 +02:00
Milan Hanajik 58df07300e TestMethods.GenesisHead and TestMethods.GenHead folders added. 2018-08-22 18:48:37 +02:00
Milan Hanajik bef4928162 Genesis : (1) component upgraded (dated 22.08.18), (2) bug fixes, ver. 2.18.980
more
2018-08-22 18:46:17 +02:00
Milan Hanajik 5995204d8d ver. 2.18.979 2018-08-22 08:36:32 +02:00
Milan Hanajik 69b7c94176 Users.Forms.UserManagementDlg : Sorting by data in columns including a surname, ver. 2.18.981 2018-08-14 14:37:15 +02:00
Milan Hanajik 540bc8ca74 ver. 2.18.979 2018-08-08 11:34:17 +02:00
Milan Hanajik 03920d5b90 ver. 2.18.978 2018-08-06 15:59:58 +02:00
Milan Hanajik 765637ce2d TestMethods.PulsesTest : (1) Fixes in forms, (2) MinPulsesCount test parameter introduced, ver. 2.18.977 2018-08-03 11:16:13 +02:00
Milan Hanajik b4596ae6e9 User.Grp.GID.TracabilityManagement user level added for TYRA_IPERL only. 2018-08-03 08:08:14 +02:00
Milan Hanajik 4c92cb7af0 MonitoringDB merged with ProductionTracing, ver. 1.5.61 2018-08-02 13:41:10 +02:00
Milan Hanajik 770b8447ac Default connection string for central DB of users updated. 2018-08-02 13:41:09 +02:00
Milan Hanajik f3532fc3cb Unnecessary references removed, ver. 2.18.976 2018-07-30 09:31:45 +02:00
Milan Hanajik a7cfbc0b76 Fuzhou 100 component updated : Initial version dated 25.07.2018 2018-07-25 15:13:56 +02:00
Milan Hanajik 608dd087b8 Sequences.Statistics.ApplyFilter() cleanup, ver. 2.18.975 2018-07-23 16:02:02 +02:00
Milan Hanajik 5d2871b9ed PulsesTest : Puses count = '---' and rectangles are red on startup. 2018-07-19 17:29:43 +02:00
Milan Hanajik 779c870613 Comparison (VolumeMaster == 0) done when calculating Constmaster in all mass based methods, ver. 2.18.972 2018-07-19 13:20:48 +02:00
Milan Hanajik 3cd585fe41 Modbus.CometAmbient.Ambient comments only. 2018-07-19 11:03:28 +02:00
Milan Hanajik ff27ae7635 ver. 2.18.971 2018-07-18 17:43:17 +02:00
Milan Hanajik a41e805e8d DUBAJ_50 and CEVAK_200 added, ver. 2.18.970 2018-07-18 17:27:42 +02:00
Milan Hanajik 9bcf3aa7f6 TestMethods.PulsesTest : Texts in forms fixed. 2018-07-18 16:31:55 +02:00
Milan Hanajik ff2248720c TestMethods.PulsesTest added. 2018-07-18 10:00:37 +02:00
Milan Hanajik 9bd2cd2634 Error message after a wrong test or procedure parameter, ver. 2.18.969 2018-07-17 12:16:52 +02:00
Milan Hanajik 9ba1b58d2e CombinedWithDetTestParams.OffsetPulsesFreq parameter introduced, use in Qfall detection, ver. 2.18.968 2018-07-17 10:53:34 +02:00
Milan Hanajik 1d8728c7ce TURA_SPECIAL : 'Stop draining' in BenchControlPanel is not protected by a password, ver. 2.18.967 2018-07-16 15:56:03 +02:00
Milan Hanajik af68f35400 (1) ComponentsManagerDlg displays all components that failed to load, (2) Diverter.divNrFromName fixed for Berlin (DivEx), ver. 2.18.966 2018-07-16 15:05:06 +02:00
313 changed files with 18234 additions and 3276 deletions
+2 -2
View File
@@ -8,8 +8,8 @@ GemCard/bin
GemCard/obj
GraphLib/bin
GraphLib/obj
MonitoringDB/bin
MonitoringDB/obj
TracingDB/bin
TracingDB/obj
Results/bin/
Results/obj/
ResultsBrowser/bin/
+2 -2
View File
@@ -18,7 +18,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;PETERSBURG_200;LANG_RU</DefineConstants>
<DefineConstants>TRACE;DEBUG;SENTEC</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;PETERSBURG_200;LANG_RU</DefineConstants>
<DefineConstants>TRACE;SENTEC</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
+11 -5
View File
@@ -14,31 +14,37 @@ namespace Config
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = 3;
#elif DN100 || BADGER_STREDNA_TRAT || BADGER_VELKA_TRAT
#elif DN100 || BADGER_STREDNA_TRAT || BADGER_VELKA_TRAT || CEVAK_200
public const int WMsCount = 3;
public const int LineSize = 3;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = WMsCount / LineSize;
#elif FUZHOU300 || FUZHOU150 || PT200IL || PUCHONG_PT200 || GENESIS || SLM_150 || PETERSBURG_200
#elif FUZHOU_300 || FUZHOU_150 || PT200IL || PUCHONG_200 || GENESIS || SLM_150 || PETERSBURG_200
public const int WMsCount = 6;
public const int LineSize = 6;
public const int CompoundWMsCount = 3;
public const int HeatMetersCount = 0;
public const int MaxPartNr = 3;
#elif FUZHOU100
#elif DUBAJ_50
public const int WMsCount = 10;
public const int LineSize = 5;
public const int CompoundWMsCount = 0;
public const int HeatMetersCount = 0;
public const int MaxPartNr = WMsCount / LineSize;
#elif FUZHOU_100
public const int WMsCount = 10;
public const int LineSize = 10;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = WMsCount / LineSize;
#elif TORINO50 || BADGER_MALA_TRAT || BERLIN
#elif TORINO_50 || BADGER_MALA_TRAT || BERLIN
public const int WMsCount = 6;
public const int LineSize = 6;
public const int CompoundWMsCount = 1;
public const int HeatMetersCount = 0;
public const int MaxPartNr = 1;
#elif TORUN_PT50_2015 || CEVAK_PT40_272 || MURES_PT40 || FUZHOU_40 || PETERSBURG_50 || KEMPNO_50 || BAHRAIN_50 || KRAKOW_50 || JUZNA_AFRIKA_50 || ZAMBIA
#elif TORUN_50 || CEVAK_40 || MURES_40 || FUZHOU_50 || PETERSBURG_50 || KEMPNO_50 || BAHRAIN_50 || KRAKOW_50 || JUZNA_AFRIKA_50 || ZAMBIA || FEWA_50
public const int WMsCount = 20;
public const int LineSize = 10;
public const int CompoundWMsCount = 1;
+1 -1
View File
@@ -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;
}
+1 -61
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
///
using System;
using System.Windows.Forms;
@@ -127,41 +127,6 @@ namespace Config
return SessionFactories[ix].OpenSession();
}
public static void SaveToDb(Users.Entities.DBKind database, object obj)
{
SaveToDb(CreateSession(database), obj);
}
public static void SaveToDb(ISession session, object obj)
{
using (var transaction = session.BeginTransaction())
{
try
{
session.SaveOrUpdate(obj);
transaction.Commit();
}
catch
{
transaction.Rollback();
}
}
}
public static void DeleteFromDb(Users.Entities.DBKind database, object obj)
{
DeleteFromDb(CreateSession(database), obj);
}
public static void DeleteFromDb(ISession session, object obj)
{
using (var transaction = session.BeginTransaction())
{
session.Delete(obj);
transaction.Commit();
}
}
/// <summary>
/// Create an empty users database.
/// Database contains only the user 'admin' and the control board component 'CB'.
@@ -218,30 +183,5 @@ namespace Config
return true;
}
/// <summary>
/// Create an empty water meters database
/// </summary>
/// <param name="dbType">DBType.SQLite or DBType.MySql</param>
/// <param name="connectionString">Connection string</param>
/// <returns>true=success, false=error</returns>
public static bool CreateEmptyResultsDB(Users.Entities.DBType dbType, string connectionString)
{
ISessionFactory sessionFactory = CreateSessionFactory(Users.Entities.DBKind.Results, dbType, connectionString, true);
if (sessionFactory == null) return false;
/// Populate the database
//using (var session = sessionFactory.OpenSession())
//{
// using (var transaction = session.BeginTransaction())
// {
// /// Create one component
// var cmpnt = (new BenchControl.Elde.ControlBoardCfg("CB", 1)).CreateDbEntity();
// session.SaveOrUpdate(cmpnt);
// transaction.Commit();
// }
//}
return true;
}
}
}
+2 -2
View File
@@ -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.928.0")]
[assembly: AssemblyFileVersion("2.18.928.0")]
[assembly: AssemblyVersion("2.18.982.0")]
[assembly: AssemblyFileVersion("2.18.982.0")]
-15
View File
@@ -121,21 +121,6 @@
<Reference Include="System.Xml">
<Name>System.XML</Name>
</Reference>
<COMReference Include="GemCardExLib">
<Guid>{F1FF634B-BEDF-461C-A409-5B88E05F5117}</Guid>
<VersionMajor>1</VersionMajor>
<VersionMinor>0</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>tlbimp</WrapperTool>
<Isolated>False</Isolated>
</COMReference>
<COMReference Include="SCARDSSPLib">
<Guid>{82C38704-19F1-11D3-A11F-00C04F79F800}</Guid>
<VersionMajor>1</VersionMajor>
<VersionMinor>0</VersionMinor>
<Lcid>0</Lcid>
<WrapperTool>tlbimp</WrapperTool>
</COMReference>
<COMReference Include="stdole">
<Guid>{00020430-0000-0000-C000-000000000046}</Guid>
<VersionMajor>2</VersionMajor>
-68
View File
@@ -1,68 +0,0 @@
using System;
using System.Collections.Generic;
namespace MonitoringDB.Entities
{
public class Process
{
public virtual int Id { get; protected set; }
public virtual int ItemNr { get; set; }
public virtual string Name { get; set; }
public virtual string Description { get; set; }
public virtual ReleaseStatus ReleaseStatus { get; set; }
public virtual DateTime TimeStamp { get; set; }
public virtual string UserName { get; set; }
public virtual IList<Part> Parts { get; set; }
public virtual IList<Workstep> Worksteps { get; set; }
/// <summary>
/// Default (private) constructor inicializing lists
/// </summary>
protected Process()
{
Parts = new List<Part>();
Worksteps = new List<Workstep>();
}
/// <summary>
/// Constructor used when this process is created
/// </summary>
/// <param name="name"></param>
public Process(string name)
: this()
{
Name = name;
Description = string.Empty;
ReleaseStatus = ReleaseStatus.In_preparation;
TimeStamp = DateTime.Now;
UserName = "admin";
}
/// <summary>
/// Create a copy of a process with a new name
/// </summary>
/// <param name="name"></param>
/// <returns></returns>
public virtual Process Clone(string name)
{
Process rslt = new Process(name);
rslt.Description = Description;
foreach (var part in Parts) rslt.Parts.Add(part.Clone(rslt));
foreach (var workstep in Worksteps) rslt.Worksteps.Add(workstep.Clone(rslt));
return rslt;
}
public override string ToString()
{
return string.Format("{0} '{1}' ({2}) {3} {4}",
ItemNr,
Name,
TimeStamp.Date.ToShortDateString(),
(Description == null) ? string.Empty : Description,
ReleaseStatus);
}
}
}
-94
View File
@@ -1,94 +0,0 @@
namespace MonitoringDB
{
public enum CodeType
{
UniqueNr,
FlowtubeNr, /// prvé 3 znaky sa zhodujú s poslednými 3 znakmi názvu
FlowtubeNrLU, /// začiatok kódu sa zhoduje s názvom
BatchNr,
BatchNrContainingPartName,
DateMMYY,
QualityCheck,
}
public enum CodeForm
{
Barcode,
QRCode,
Keyboard,
OkNok,
}
public enum CodeLocation
{
OnPart,
OnPallet,
}
public enum LifetimeManagement
{
None,
OneYear,
Count,
}
public enum ReleaseStatus
{
In_preparation,
Released,
ReleasedActive,
Deactivated,
Count,
}
public enum Mode
{
Debug, // Debug mode - no Oracle database used
Test, // Test database used
Production, // Production database used
Count,
}
public enum LoginLevel
{
None,
TeamLeader,
Administrator,
MH,
Count,
}
public enum ItemSpecID
{
RefRecordID = 0,
TimeStamp,
Workstep,
Workplace,
UserName,
Barcode,
PartBarcode,
TimeStamp2,
Workstep2,
Workplace2,
UserName2,
Barcode2,
PartBarcode2,
SerialNr,
PurchaseOrder,
TestResult,
MaxPruefindex,
Process,
}
public enum ItemSpecCaps
{
None = 0,
ReferenceRecord = 1,
AssociatedRecord = 2,
OracleQuery = 4,
}
}
-87
View File
@@ -1,87 +0,0 @@
using System;
using System.Windows.Forms;
namespace MonitoringDB.Forms
{
public partial class SettingsDlg : Form
{
public string WorkplaceName
{
set { workplaceNameTextBox.Text = value; }
get { return workplaceNameTextBox.Text; }
}
public string ConnectionString
{
set { connectionStringTextBox.Text = value; }
get { return connectionStringTextBox.Text; }
}
public string UsersDBConnString
{
set { usersDBConnStringTextBox.Text = value; }
get { return usersDBConnStringTextBox.Text; }
}
public bool OracleBattery
{
set { oracleBatteryCheckBox.Checked = value; }
get { return oracleBatteryCheckBox.Checked; }
}
public bool CheckPcbIsInOracle
{
set { checkPcbIsInOracleCheckBox.Checked = value; }
get { return checkPcbIsInOracleCheckBox.Checked; }
}
public int ExtraBatterLifetime
{
get
{
int extraLifetime;
if (int.TryParse(extraBatteryLifetimeTextBox.Text, out extraLifetime) && extraLifetime >= 0) return extraLifetime;
return 0;
}
}
public MonitoringDB.Mode Mode
{
set
{
radioButton1.Checked = (value == MonitoringDB.Mode.Test);
radioButton2.Checked = (value == MonitoringDB.Mode.Production);
}
get
{
return radioButton1.Checked ? MonitoringDB.Mode.Test : MonitoringDB.Mode.Production;
}
}
/// <summary>
/// Basic configuration dialog
/// </summary>
/// <param name="isWorkplace">false = Konfiguracia pracovisk, true = Pracovisko</param>
public SettingsDlg(bool isWorkplace)
{
InitializeComponent();
if (isWorkplace)
{
oracleGroupBox.Visible = true;
}
extraBatteryLifetimeTextBox.Text = "0";
}
private void saveButton_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.OK;
Close();
}
private void cancelButton_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
Close();
}
}
}
-49
View File
@@ -1,49 +0,0 @@
using System;
using System.Windows.Forms;
namespace MonitoringDB.Forms
{
public partial class TrivialLoginDlg : Form
{
public LoginLevel LoginLevel;
public TrivialLoginDlg()
{
InitializeComponent();
LoginLevel = LoginLevel.None;
}
private void okButton_Click(object sender, EventArgs e)
{
if (passwordTextBox.Text.ToLower().Equals("barcode"))
{
LoginLevel = LoginLevel.Administrator;
DialogResult = DialogResult.OK;
Close();
}
else if (passwordTextBox.Text.ToLower().Equals("teamleader"))
{
LoginLevel = LoginLevel.TeamLeader;
DialogResult = DialogResult.OK;
Close();
}
else if (passwordTextBox.Text.ToLower().Equals("kremik"))
{
LoginLevel = LoginLevel.MH;
DialogResult = DialogResult.OK;
Close();
}
else
{
DialogResult = DialogResult.Cancel;
Close();
}
}
private void cancelButton_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
Close();
}
}
}
-105
View File
@@ -1,105 +0,0 @@
namespace MonitoringDB.Forms
{
partial class TrivialLoginDlg
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.passwordGroupBox = new System.Windows.Forms.GroupBox();
this.passwordTextBox = new System.Windows.Forms.TextBox();
this.okButton = new System.Windows.Forms.Button();
this.cancelButton = new System.Windows.Forms.Button();
this.passwordGroupBox.SuspendLayout();
this.SuspendLayout();
//
// passwordGroupBox
//
this.passwordGroupBox.Controls.Add(this.passwordTextBox);
this.passwordGroupBox.Location = new System.Drawing.Point(12, 10);
this.passwordGroupBox.Name = "passwordGroupBox";
this.passwordGroupBox.Size = new System.Drawing.Size(200, 49);
this.passwordGroupBox.TabIndex = 0;
this.passwordGroupBox.TabStop = false;
this.passwordGroupBox.Text = "Heslo";
//
// passwordTextBox
//
this.passwordTextBox.Location = new System.Drawing.Point(51, 18);
this.passwordTextBox.Name = "passwordTextBox";
this.passwordTextBox.PasswordChar = '*';
this.passwordTextBox.Size = new System.Drawing.Size(100, 20);
this.passwordTextBox.TabIndex = 0;
//
// okButton
//
this.okButton.Location = new System.Drawing.Point(237, 18);
this.okButton.Name = "okButton";
this.okButton.Size = new System.Drawing.Size(75, 39);
this.okButton.TabIndex = 1;
this.okButton.Text = "OK";
this.okButton.UseVisualStyleBackColor = true;
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// cancelButton
//
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelButton.Location = new System.Drawing.Point(330, 18);
this.cancelButton.Name = "cancelButton";
this.cancelButton.Size = new System.Drawing.Size(75, 39);
this.cancelButton.TabIndex = 2;
this.cancelButton.Text = "Cancel";
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
//
// LoginDlg
//
this.AcceptButton = this.okButton;
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.cancelButton;
this.ClientSize = new System.Drawing.Size(426, 73);
this.Controls.Add(this.cancelButton);
this.Controls.Add(this.okButton);
this.Controls.Add(this.passwordGroupBox);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "LoginDlg";
this.Text = "LoginDlg";
this.passwordGroupBox.ResumeLayout(false);
this.passwordGroupBox.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.GroupBox passwordGroupBox;
private System.Windows.Forms.TextBox passwordTextBox;
private System.Windows.Forms.Button okButton;
private System.Windows.Forms.Button cancelButton;
}
}
-25
View File
@@ -1,25 +0,0 @@
using FluentNHibernate.Mapping;
namespace MonitoringDB.Mappings
{
class ProcessMap : ClassMap<Entities.Process>
{
public ProcessMap()
{
Id(x => x.Id);
Map(x => x.ItemNr);
Map(x => x.Name);
Map(x => x.Description);
Map(x => x.ReleaseStatus);
Map(x => x.TimeStamp);
Map(x => x.UserName);
HasMany(x => x.Parts)
.OrderBy("Name")
.Cascade.All();
HasMany(x => x.Worksteps)
.OrderBy("WorkstepNr")
.Cascade.All();
}
}
}
+13 -5
View File
@@ -27,8 +27,8 @@ namespace Results
public Batch Batch;
public WaterMeter[] WaterMeters;
public static BatchResults NewFromProcedure(int batchNr, int benchId, string user, int userNr, string programVer,
Config.Entities.Procedure procedure,
public static BatchResults NewFromProcedure(int batchNr, int benchId, string benchName, string a1, string a2, string a3, string a4, string a5,
string user, int userNr, string programVer, Config.Entities.Procedure procedure,
WaterMeterData[] waterMeterDatas, int[] waterMeterParts, double densityCorr)
{
BatchResults d = new BatchResults(waterMeterDatas.Length);
@@ -37,8 +37,14 @@ namespace Results
/// Create new batch
d.Batch = new Batch()
{
TestBenchId = benchId,
BatchNr = batchNr,
BatchNr = batchNr,
TestBenchId = benchId,
TestBenchName = benchName,
Address1 = a1,
Address2 = a2,
Address3 = a3,
Address4 = a4,
Address5 = a5,
ProgramVersion = programVer,
UserName = user,
UserNumber = userNr,
@@ -199,8 +205,10 @@ namespace Results
{
foreach (var mtr in WaterMeters[i].MeterTestRslts)
{
if (mtr.TestData().Name.ToLower().Contains("adj"))
if (mtr.TestData().Name.ToLower().Contains("adj") || mtr.TestData().Name.ToLower().Contains("just"))
{
return true;
}
}
}
}
+7 -1
View File
@@ -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; }
+36 -4
View File
@@ -58,9 +58,11 @@ namespace Results.Entities
#if IPERL
public virtual int SerialNrEx { get; set; } /// Aux s/n for compound meters, Serial number for iPerl water meter
public virtual double OrigCalibFactor { get; set; } /// iPerl calibration factor used during the test
public virtual double CalibFactor { get; set; } /// iPerl calibration factor used during the test
public virtual double Q2ErrWOCorrection { get; set; }
public virtual double OrigCalibFactor { get; set; } /// Original iPerl calibration factor used during the test
public virtual double CalibFactor { get; set; } /// iPerl calibration factor used during the test
public virtual double OrigCalibFactorLNA { get; set; } /// Original iPerl LNA calibration factor used during the test
public virtual double CalibFactorLNA { get; set; } /// iPerl LNA calibration factor used during the test
public virtual double Q2ErrWOCorrection { get; set; }
public virtual bool Q2CorrectionDone { get; set; } /// true = iPerl Q2 correction was done
public virtual double Q2Correction { get; set; } /// !!! obsolete
public virtual int Q2CorrRFlow { get; set; } /// iPerl Q2 correction for the R-flow written to iPerl
@@ -117,7 +119,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 +266,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 +293,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>
+104
View File
@@ -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();
}
}
}
}
}
+31
View File
@@ -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);
}
}
}
+31
View File
@@ -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);
}
}
}
+9 -1
View File
@@ -71,7 +71,7 @@ namespace Results
Pulse__liter, /// 61 Water meter constant (pulses per liter) specific for one test
Reference_pulses_ni, /// 62 Reference pulses gated for specific meter (synchro method)
Reference_energy, /// 63
Test_bench_ID, /// 64
Bench_ID, /// 64 Test bench ID (int) obtained from a component implementing IBenchInfo
Program_version, /// 65
User_name, /// 66
User_nr, /// 67
@@ -253,6 +253,14 @@ namespace Results
ConstMasterRaw, /// 219 ConstMaster (like 194) uncorrected
Reference_error_corr, /// 220 Reference flow meter error after correction using correction curve
Proc_description, /// 221 Procedure description (CEVAK, not mapped to DB)
Bench_name, /// 222 'Test bench name' (string) obtained from a component implementing IBenchInfo
Bench_address1, /// 223 'Address 1' from IBenchInfo
Bench_address2, /// 224 'Address 2' from IBenchInfo
Bench_address3, /// 225 'Address 3' from IBenchInfo
Bench_address4, /// 226 'Address 4' from IBenchInfo
Bench_address5, /// 227 'Address 5' from IBenchInfo
Count,
}
}
+2 -3
View File
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2015-2018 Sensus Slovensko a.s.
/// Copyright (c) 2015 Sensus Metering Systems
///
using FluentNHibernate.Mapping;
using Results.Entities;
@@ -12,8 +12,7 @@ namespace Results.Mappings
{
Id(x => x.Id);
Map(x => x.CompoundMeterId);
Map(x => x.RegReaderType);
Map(x => x.PulsesMeter);
Map(x => x.PulsesMeter);
Map(x => x.PulsesMaster);
Map(x => x.PulsesPerLiter);
Map(x => x.VolumeStart);
-3
View File
@@ -16,7 +16,6 @@ namespace Results.Mappings
References<Components>(x => x.Components);
Map(x => x.Part);
Map(x => x.RepetitionNr);
Map(x => x.MethodClass);
Map(x => x.TestDone);
Map(x => x.Remark)
@@ -27,8 +26,6 @@ namespace Results.Mappings
Map(x => x.FlowSetTime);
Map(x => x.TestTime);
Map(x => x.PulsesMaster);
Map(x => x.ConstMasterRaw);
Map(x => x.ConstMasterCorr);
Map(x => x.ConstMaster);
Map(x => x.MassStartRaw);
Map(x => x.MassStart);
-2
View File
@@ -42,8 +42,6 @@ namespace Results.Mappings
Map(x => x.MetrologicalClassAux);
Map(x => x.ApprovalInfoAux);
Map(x => x.Medium);
Map(x => x.Text1);
Map(x => x.Text2);
Map(x => x.Text3);
+7 -1
View File
@@ -31,7 +31,13 @@ namespace Results.Mappings
Map(x => x.SerialNrEx);
Map(x => x.OrigCalibFactor);
Map(x => x.CalibFactor);
Map(x => x.Q2ErrWOCorrection);
#endif
#if IPERL2
Map(x => x.OrigCalibFactorLNA);
Map(x => x.CalibFactorLNA);
#endif
#if IPERL
Map(x => x.Q2ErrWOCorrection);
Map(x => x.Q2CorrectionDone);
Map(x => x.Q2Correction);
Map(x => x.Q2CorrRFlow);
@@ -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);
}
}
+14 -3
View File
@@ -57,10 +57,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 +128,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];
+2 -2
View File
@@ -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.20.963.0")]
[assembly: AssemblyFileVersion("2.20.963.0")]
[assembly: AssemblyVersion("2.18.995.0")]
[assembly: AssemblyFileVersion("2.18.995.0")]
+36
View File
@@ -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>
@@ -123,6 +132,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 +663,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>
+39
View File
@@ -213,4 +213,43 @@
<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>
</root>
+12
View File
@@ -723,4 +723,16 @@
<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>
</root>
+5 -2
View File
@@ -18,7 +18,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;PETERSBURG_200;LANG_RU</DefineConstants>
<DefineConstants>TRACE;DEBUG;SENTEC</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;PETERSBURG_200;LANG_RU</DefineConstants>
<DefineConstants>TRACE;SENTEC</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>
+2 -2
View File
@@ -54,9 +54,9 @@ namespace Results
public static string PassedColorStr(bool passed, bool useRedGreenColor)
{
#if PUCHONG_PT200
#if PUCHONG_200
return (useRedGreenColor) ? (passed ? "OK|Green" : "NG|Red") : (passed ? "OK|White" : "NG|White");
#elif BAHRAIN_50
#elif BAHRAIN_50 || DUBAJ_50
return (useRedGreenColor) ? (passed ? "PASSED|Green" : "FAILED|Red") : (passed ? "PASSED|White" : "FAILED|White");
#elif LANG_PL
return (useRedGreenColor) ? (passed ? "+|Green" : "-|Red") : (passed ? "+|White" : "-|White");
+13 -6
View File
@@ -144,10 +144,11 @@ namespace Results
AllItems.Add(new WMeterRsltItemSpec(ItemID.Separator, "Separator", "", Quantity.String, ItemCategory.Other, (w, t, u, f, p) => string.Empty));
/// Common
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_name, Strings.Test + "()", Quantity.String, ItemCategory.TestData, (w, t, u, f, p) => FormatStr(f, (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).Name())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Procedure_name, Strings.Procedure, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, w.ProcedureName())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Batch_number, Strings.Batch_nr, Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => FormatInt(f, w.BatchNr())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_method, Strings.Test_method + "()", Quantity.String, ItemCategory.TestData, (w, t, u, f, p) => FormatStr(f, (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).Method())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_name, Strings.Test + "()", Quantity.String, ItemCategory.TestData, (w, t, u, f, p) => FormatStr(f, (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).Name())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Procedure_name, Strings.Procedure, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, w.ProcedureName())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Proc_description, Strings.Procedure_description, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, w.Batch.ProcedureDescription)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Batch_number, Strings.Batch_nr, Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => FormatInt(f, w.BatchNr())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_method, Strings.Test_method + "()", Quantity.String, ItemCategory.TestData, (w, t, u, f, p) => FormatStr(f, (w.GetTestRslt(t) == null) ? "" : w.GetTestRslt(t).Method())));
///
/// Volume
@@ -375,8 +376,14 @@ namespace Results
AllItems.Add(new WMeterRsltItemSpec(ItemID.End_state_aux, Strings.EndState_aux, Quantity.String, ItemCategory.MeterResult, (w, t, u, f, p) => FormatStr(f, w.EndStateAux)));
/// Batch info
AllItems.Add(new WMeterRsltItemSpec(ItemID.Test_bench_ID, Strings.Bench, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, w.Batch.TestBenchId.ToString())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Program_version, Strings.Ver, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, w.Batch.ProgramVersion)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Bench_ID, Strings.Bench_ID, Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, w.Batch.TestBenchId.ToString())));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Bench_name, Strings.Bench_name, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, !string.IsNullOrEmpty(w.Batch.TestBenchName) ? w.Batch.TestBenchName : "")));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Bench_address1, Strings.Address + " 1", Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, !string.IsNullOrEmpty(w.Batch.Address1) ? w.Batch.Address1 : "")));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Bench_address2, Strings.Address + " 2", Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, !string.IsNullOrEmpty(w.Batch.Address2) ? w.Batch.Address2 : "")));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Bench_address3, Strings.Address + " 3", Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, !string.IsNullOrEmpty(w.Batch.Address3) ? w.Batch.Address3 : "")));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Bench_address4, Strings.Address + " 4", Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, !string.IsNullOrEmpty(w.Batch.Address4) ? w.Batch.Address4 : "")));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Bench_address5, Strings.Address + " 5", Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, !string.IsNullOrEmpty(w.Batch.Address5) ? w.Batch.Address5 : "")));
AllItems.Add(new WMeterRsltItemSpec(ItemID.Program_version, Strings.Ver, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, w.Batch.ProgramVersion)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.User_nr, Strings.User_nr, Quantity.Number, ItemCategory.Other, (w, t, u, f, p) => FormatInt(f, w.Batch.UserNumber)));
AllItems.Add(new WMeterRsltItemSpec(ItemID.User_name, Strings.User, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, Users.Entities.User.EncodedStrToUserName(w.Batch.UserName))));
AllItems.Add(new WMeterRsltItemSpec(ItemID.User_description, Strings.User_description, Quantity.String, ItemCategory.Other, (w, t, u, f, p) => FormatStr(f, Users.Entities.User.EncodedStrToFullName(w.Batch.UserName))));
+2 -2
View File
@@ -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.856.0")]
[assembly: AssemblyFileVersion("2.18.856.0")]
[assembly: AssemblyVersion("2.18.995.0")]
[assembly: AssemblyFileVersion("2.18.995.0")]
+2 -2
View File
@@ -21,7 +21,7 @@
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>TRACE;DEBUG;PETERSBURG_200;LANG_RU</DefineConstants>
<DefineConstants>TRACE;DEBUG;SENTEC</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;PETERSBURG_200;LANG_RU</DefineConstants>
<DefineConstants>TRACE;SENTEC</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
+9 -9
View File
@@ -398,21 +398,21 @@ namespace ResultsBrowser
{
new Results.Output.Printers.Munich.MunichPrintDocument(string.Format("4/13 - {0}", BenchName()), wm, Config.Entities.PageOrientation.Portrait).Print();
}
#elif CEVAK_PT40_272
#elif CEVAK_40
IList<Results.Entities.Batch> batches = new List<Results.Entities.Batch>();
foreach (var wm in waterMeters)
{
if (!batches.Contains(wm.Batch)) batches.Add(wm.Batch);
}
foreach (var batch in batches)
{
new Results.Output.Printers.Cevak.PrintDocumentCevak(batch,
Config.Entities.PageOrientation.Portrait,
60, 60, 60,
"PT40 Z/E-35-A",
"0111-OOP-C035-13").Print();
}
//foreach (var batch in batches)
//{
// new Results.Output.Printers.Cevak.PrintDocumentCevak(batch,
// Config.Entities.PageOrientation.Portrait,
// 60, 60, 60,
// "PT40 Z/E-35-A",
// "0111-OOP-C035-13").Print();
//}
#else
if (string.IsNullOrEmpty(filtersConfig.PrinterClass))
{
+1 -1
View File
@@ -42,7 +42,7 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GraphLib", "GraphLib\GraphL
{743DF7DB-C7B6-42EB-986D-0F485E5588E4} = {743DF7DB-C7B6-42EB-986D-0F485E5588E4}
EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MonitoringDB", "MonitoringDB\MonitoringDB.csproj", "{EFEC8A31-3022-4DA7-A8F6-16D30A94C3FF}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TracingDB", "TracingDB\TracingDB.csproj", "{EFEC8A31-3022-4DA7-A8F6-16D30A94C3FF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "GemCard", "GemCard\GemCard.csproj", "{8B10D15A-39DE-4B56-8DD1-710C1EB3A697}"
EndProject
@@ -23,6 +23,11 @@ namespace TBF.BenchControl.BenchInfo.Extended
public string TestBenchName { get { return myCfg.TestBenchName; } }
public int TestBenchId { get { return myCfg.TestBenchId; } }
public string Address1 { get { return myCfg.Address1; } }
public string Address2 { get { return myCfg.Address2; } }
public string Address3 { get { return myCfg.Address3; } }
public string Address4 { get { return myCfg.Address4; } }
public string Address5 { get { return myCfg.Address5; } }
public RemoteDBUse RemoteDBUse { get { return myCfg.RemoteDBUse; } }
public Component()
@@ -46,11 +46,6 @@ namespace TBF.BenchControl.BenchInfo.Extended
InitializeAll();
}
public string ToString(char a)
{
return string.Format("Name={0}, Parent={1}, ...", Name, ParentName);
}
public string ComponentName { get { return Name; } }
public void InitializeAll()
@@ -104,6 +99,11 @@ namespace TBF.BenchControl.BenchInfo.Extended
public string ToString(int i)
{
if (i == -1)
{
return string.Format("{0}: Bench name={1}, Bench Id={2}, Procedures={3}", Name, TestBenchName, TestBenchId, RemoteDBUse.ToDescription());
}
switch (i)
{
case 0: return TestBenchName;
@@ -23,6 +23,11 @@ namespace TBF.BenchControl.BenchInfo.Munich
public string TestBenchName { get { return benchInfoCfg.TestBenchName; } }
public int TestBenchId { get { return benchInfoCfg.TestBenchId; } }
public string Address1 { get { return string.Empty; } }
public string Address2 { get { return string.Empty; } }
public string Address3 { get { return string.Empty; } }
public string Address4 { get { return string.Empty; } }
public string Address5 { get { return string.Empty; } }
public RemoteDBUse RemoteDBUse { get { return RemoteDBUse.LocalDBOnly; } }
public Component()
File diff suppressed because it is too large Load Diff
@@ -1,311 +0,0 @@
///
/// Copyright (c) 2015 Sensus Metering Systems
/// Author: Milan Hanajík
///
namespace TBF.BenchControl.DB.SensusOracle
{
partial class DatabaseCfgCtrl
{
/// <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.destinationTextBox = new System.Windows.Forms.TextBox();
this.destinationLabel = new System.Windows.Forms.Label();
this.dayFoldersCheckBox = new System.Windows.Forms.CheckBox();
this.destinationButton = new System.Windows.Forms.Button();
this.yearFoldersCheckBox = new System.Windows.Forms.CheckBox();
this.monthFoldersCheckBox = new System.Windows.Forms.CheckBox();
this.eliminateSpacesCheckBox = new System.Windows.Forms.CheckBox();
this.separatorLabel = new System.Windows.Forms.Label();
this.separatorComboBox = new System.Windows.Forms.ComboBox();
this.benchIdTextBox = new System.Windows.Forms.TextBox();
this.benchIdLabel = new System.Windows.Forms.Label();
this.dbUsedComboBox = new System.Windows.Forms.ComboBox();
this.dbUsedLabel = new System.Windows.Forms.Label();
this.baujahrTextBox = new System.Windows.Forms.TextBox();
this.baujahrLabel = new System.Windows.Forms.Label();
this.logsFolderButton = new System.Windows.Forms.Button();
this.logsFolderTextBox = new System.Windows.Forms.TextBox();
this.logsFolderLabel = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// nameTextBox
//
this.nameTextBox.Enabled = false;
this.nameTextBox.Location = new System.Drawing.Point(110, 30);
this.nameTextBox.Name = "nameTextBox";
this.nameTextBox.Size = new System.Drawing.Size(146, 20);
this.nameTextBox.TabIndex = 2;
//
// nameLabel
//
this.nameLabel.AutoSize = true;
this.nameLabel.Location = new System.Drawing.Point(19, 33);
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(107, 8);
this.classNameLabel.Name = "classNameLabel";
this.classNameLabel.Size = new System.Drawing.Size(83, 13);
this.classNameLabel.TabIndex = 0;
this.classNameLabel.Text = "ComonentName";
//
// destinationTextBox
//
this.destinationTextBox.Enabled = false;
this.destinationTextBox.Location = new System.Drawing.Point(110, 117);
this.destinationTextBox.Name = "destinationTextBox";
this.destinationTextBox.Size = new System.Drawing.Size(145, 20);
this.destinationTextBox.TabIndex = 10;
//
// destinationLabel
//
this.destinationLabel.AutoSize = true;
this.destinationLabel.Location = new System.Drawing.Point(19, 120);
this.destinationLabel.Name = "destinationLabel";
this.destinationLabel.Size = new System.Drawing.Size(71, 13);
this.destinationLabel.TabIndex = 9;
this.destinationLabel.Text = "Results folder";
//
// dayFoldersCheckBox
//
this.dayFoldersCheckBox.AutoSize = true;
this.dayFoldersCheckBox.Enabled = false;
this.dayFoldersCheckBox.Location = new System.Drawing.Point(207, 166);
this.dayFoldersCheckBox.Name = "dayFoldersCheckBox";
this.dayFoldersCheckBox.Size = new System.Drawing.Size(79, 17);
this.dayFoldersCheckBox.TabIndex = 17;
this.dayFoldersCheckBox.Text = "Day folders";
this.dayFoldersCheckBox.UseVisualStyleBackColor = true;
//
// destinationButton
//
this.destinationButton.Enabled = false;
this.destinationButton.Location = new System.Drawing.Point(261, 117);
this.destinationButton.Name = "destinationButton";
this.destinationButton.Size = new System.Drawing.Size(30, 20);
this.destinationButton.TabIndex = 11;
this.destinationButton.Text = "...";
this.destinationButton.UseVisualStyleBackColor = true;
this.destinationButton.Click += new System.EventHandler(this.destinationButton_Click);
//
// yearFoldersCheckBox
//
this.yearFoldersCheckBox.AutoSize = true;
this.yearFoldersCheckBox.Enabled = false;
this.yearFoldersCheckBox.Location = new System.Drawing.Point(23, 166);
this.yearFoldersCheckBox.Name = "yearFoldersCheckBox";
this.yearFoldersCheckBox.Size = new System.Drawing.Size(82, 17);
this.yearFoldersCheckBox.TabIndex = 15;
this.yearFoldersCheckBox.Text = "Year folders";
this.yearFoldersCheckBox.UseVisualStyleBackColor = true;
//
// monthFoldersCheckBox
//
this.monthFoldersCheckBox.AutoSize = true;
this.monthFoldersCheckBox.Enabled = false;
this.monthFoldersCheckBox.Location = new System.Drawing.Point(111, 166);
this.monthFoldersCheckBox.Name = "monthFoldersCheckBox";
this.monthFoldersCheckBox.Size = new System.Drawing.Size(90, 17);
this.monthFoldersCheckBox.TabIndex = 16;
this.monthFoldersCheckBox.Text = "Month folders";
this.monthFoldersCheckBox.UseVisualStyleBackColor = true;
//
// eliminateSpacesCheckBox
//
this.eliminateSpacesCheckBox.AutoSize = true;
this.eliminateSpacesCheckBox.Enabled = false;
this.eliminateSpacesCheckBox.Location = new System.Drawing.Point(111, 208);
this.eliminateSpacesCheckBox.Name = "eliminateSpacesCheckBox";
this.eliminateSpacesCheckBox.Size = new System.Drawing.Size(165, 17);
this.eliminateSpacesCheckBox.TabIndex = 20;
this.eliminateSpacesCheckBox.Text = "Eliminate spaces in each field";
this.eliminateSpacesCheckBox.UseVisualStyleBackColor = true;
//
// separatorLabel
//
this.separatorLabel.AutoSize = true;
this.separatorLabel.Location = new System.Drawing.Point(19, 188);
this.separatorLabel.Name = "separatorLabel";
this.separatorLabel.Size = new System.Drawing.Size(53, 13);
this.separatorLabel.TabIndex = 18;
this.separatorLabel.Text = "Separator";
//
// separatorComboBox
//
this.separatorComboBox.Enabled = false;
this.separatorComboBox.FormattingEnabled = true;
this.separatorComboBox.Location = new System.Drawing.Point(110, 185);
this.separatorComboBox.Name = "separatorComboBox";
this.separatorComboBox.Size = new System.Drawing.Size(146, 21);
this.separatorComboBox.TabIndex = 19;
//
// benchIdTextBox
//
this.benchIdTextBox.Enabled = false;
this.benchIdTextBox.Location = new System.Drawing.Point(110, 51);
this.benchIdTextBox.Name = "benchIdTextBox";
this.benchIdTextBox.Size = new System.Drawing.Size(57, 20);
this.benchIdTextBox.TabIndex = 4;
//
// benchIdLabel
//
this.benchIdLabel.AutoSize = true;
this.benchIdLabel.Location = new System.Drawing.Point(19, 54);
this.benchIdLabel.Name = "benchIdLabel";
this.benchIdLabel.Size = new System.Drawing.Size(76, 13);
this.benchIdLabel.TabIndex = 3;
this.benchIdLabel.Text = "Test Bench ID";
//
// dbUsedComboBox
//
this.dbUsedComboBox.Enabled = false;
this.dbUsedComboBox.FormattingEnabled = true;
this.dbUsedComboBox.Location = new System.Drawing.Point(110, 73);
this.dbUsedComboBox.Name = "dbUsedComboBox";
this.dbUsedComboBox.Size = new System.Drawing.Size(145, 21);
this.dbUsedComboBox.TabIndex = 6;
//
// dbUsedLabel
//
this.dbUsedLabel.AutoSize = true;
this.dbUsedLabel.Location = new System.Drawing.Point(19, 76);
this.dbUsedLabel.Name = "dbUsedLabel";
this.dbUsedLabel.Size = new System.Drawing.Size(79, 13);
this.dbUsedLabel.TabIndex = 5;
this.dbUsedLabel.Text = "Database used";
//
// baujahrTextBox
//
this.baujahrTextBox.Enabled = false;
this.baujahrTextBox.Location = new System.Drawing.Point(110, 95);
this.baujahrTextBox.Name = "baujahrTextBox";
this.baujahrTextBox.Size = new System.Drawing.Size(57, 20);
this.baujahrTextBox.TabIndex = 8;
//
// baujahrLabel
//
this.baujahrLabel.AutoSize = true;
this.baujahrLabel.Location = new System.Drawing.Point(19, 98);
this.baujahrLabel.Name = "baujahrLabel";
this.baujahrLabel.Size = new System.Drawing.Size(43, 13);
this.baujahrLabel.TabIndex = 7;
this.baujahrLabel.Text = "Baujahr";
//
// logsFolderButton
//
this.logsFolderButton.Enabled = false;
this.logsFolderButton.Location = new System.Drawing.Point(261, 139);
this.logsFolderButton.Name = "logsFolderButton";
this.logsFolderButton.Size = new System.Drawing.Size(30, 20);
this.logsFolderButton.TabIndex = 14;
this.logsFolderButton.Text = "...";
this.logsFolderButton.UseVisualStyleBackColor = true;
this.logsFolderButton.Click += new System.EventHandler(this.logsFolderButton_Click);
//
// logsFolderTextBox
//
this.logsFolderTextBox.Enabled = false;
this.logsFolderTextBox.Location = new System.Drawing.Point(110, 139);
this.logsFolderTextBox.Name = "logsFolderTextBox";
this.logsFolderTextBox.Size = new System.Drawing.Size(145, 20);
this.logsFolderTextBox.TabIndex = 13;
//
// logsFolderLabel
//
this.logsFolderLabel.AutoSize = true;
this.logsFolderLabel.Location = new System.Drawing.Point(19, 142);
this.logsFolderLabel.Name = "logsFolderLabel";
this.logsFolderLabel.Size = new System.Drawing.Size(59, 13);
this.logsFolderLabel.TabIndex = 12;
this.logsFolderLabel.Text = "Logs folder";
//
// DatabaseCfgCtrl
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.logsFolderButton);
this.Controls.Add(this.logsFolderTextBox);
this.Controls.Add(this.logsFolderLabel);
this.Controls.Add(this.baujahrTextBox);
this.Controls.Add(this.baujahrLabel);
this.Controls.Add(this.dbUsedComboBox);
this.Controls.Add(this.dbUsedLabel);
this.Controls.Add(this.benchIdTextBox);
this.Controls.Add(this.benchIdLabel);
this.Controls.Add(this.separatorComboBox);
this.Controls.Add(this.separatorLabel);
this.Controls.Add(this.eliminateSpacesCheckBox);
this.Controls.Add(this.monthFoldersCheckBox);
this.Controls.Add(this.yearFoldersCheckBox);
this.Controls.Add(this.destinationButton);
this.Controls.Add(this.dayFoldersCheckBox);
this.Controls.Add(this.destinationTextBox);
this.Controls.Add(this.destinationLabel);
this.Controls.Add(this.nameTextBox);
this.Controls.Add(this.nameLabel);
this.Controls.Add(this.classNameLabel);
this.Name = "DatabaseCfgCtrl";
this.Size = new System.Drawing.Size(300, 230);
this.Load += new System.EventHandler(this.WriterCfgCtrl_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.TextBox destinationTextBox;
private System.Windows.Forms.Label destinationLabel;
private System.Windows.Forms.CheckBox dayFoldersCheckBox;
private System.Windows.Forms.Button destinationButton;
private System.Windows.Forms.CheckBox yearFoldersCheckBox;
private System.Windows.Forms.CheckBox monthFoldersCheckBox;
private System.Windows.Forms.CheckBox eliminateSpacesCheckBox;
private System.Windows.Forms.Label separatorLabel;
private System.Windows.Forms.ComboBox separatorComboBox;
private System.Windows.Forms.TextBox benchIdTextBox;
private System.Windows.Forms.Label benchIdLabel;
private System.Windows.Forms.ComboBox dbUsedComboBox;
private System.Windows.Forms.Label dbUsedLabel;
private System.Windows.Forms.TextBox baujahrTextBox;
private System.Windows.Forms.Label baujahrLabel;
private System.Windows.Forms.Button logsFolderButton;
private System.Windows.Forms.TextBox logsFolderTextBox;
private System.Windows.Forms.Label logsFolderLabel;
}
}
@@ -150,7 +150,7 @@ namespace TBF.BenchControl.DataEntry.Combined
PurchaseOrder = orderComboBox.Text;
Program.LocalSettings.UpdateHistory(orderComboBox.Text,
ref Program.LocalSettings.PurchaseOrderHistory
#if FUZHOU150 || FUZHOU300
#if FUZHOU_150 || FUZHOU_300
, 20
#endif
);
@@ -274,8 +274,11 @@ namespace TBF.BenchControl.DataEntry.Combined
{
foreach (var wm in batchResults.WaterMeters)
{
if (wm != null && !wm.Disabled) wm.PurchaseOrder = PurchaseOrder;
}
if ((wm != null) && !wm.Disabled && (PurchaseOrder != null))
{
wm.PurchaseOrder = PurchaseOrder; /// PurchaseOrder == null if form button OK has not been used => no update
}
}
}
}
}
@@ -241,7 +241,7 @@ namespace TBF.BenchControl.DataEntry.HeatMeters12
PurchaseOrder = orderComboBox.Text;
Program.LocalSettings.UpdateHistory(orderComboBox.Text,
ref Program.LocalSettings.PurchaseOrderHistory
#if FUZHOU150 || FUZHOU300
#if FUZHOU_150 || FUZHOU_300
, 20
#endif
);
@@ -313,8 +313,11 @@ namespace TBF.BenchControl.DataEntry.HeatMeters12
{
foreach (var wm in batchResults.WaterMeters)
{
if (wm != null && !wm.Disabled) wm.PurchaseOrder = PurchaseOrder;
}
if ((wm != null) && !wm.Disabled && (PurchaseOrder != null))
{
wm.PurchaseOrder = PurchaseOrder; /// PurchaseOrder == null if form button OK has not been used => no update
}
}
}
}
}
@@ -234,7 +234,7 @@ namespace TBF.BenchControl.DataEntry.HeatMeters6
PurchaseOrder = orderComboBox.Text;
Program.LocalSettings.UpdateHistory(orderComboBox.Text,
ref Program.LocalSettings.PurchaseOrderHistory
#if FUZHOU150 || FUZHOU300
#if FUZHOU_150 || FUZHOU_300
, 20
#endif
);
@@ -313,7 +313,10 @@ namespace TBF.BenchControl.DataEntry.HeatMeters6
{
foreach (var wm in batchResults.WaterMeters)
{
if (wm != null && !wm.Disabled) wm.PurchaseOrder = PurchaseOrder;
if ((wm != null) && !wm.Disabled && (PurchaseOrder != null))
{
wm.PurchaseOrder = PurchaseOrder; /// PurchaseOrder == null if form button OK has not been used => no update
}
}
}
}
@@ -241,7 +241,7 @@ namespace TBF.BenchControl.DataEntry.Standard12
PurchaseOrder = orderComboBox.Text;
Program.LocalSettings.UpdateHistory(orderComboBox.Text,
ref Program.LocalSettings.PurchaseOrderHistory
#if FUZHOU150 || FUZHOU300
#if FUZHOU_150 || FUZHOU_300
, 20
#endif
);
@@ -272,8 +272,11 @@ namespace TBF.BenchControl.DataEntry.Standard12
{
foreach (var wm in batchResults.WaterMeters)
{
if (wm != null && !wm.Disabled) wm.PurchaseOrder = PurchaseOrder;
}
if ((wm != null) && !wm.Disabled && (PurchaseOrder != null))
{
wm.PurchaseOrder = PurchaseOrder; /// PurchaseOrder == null if form button OK has not been used => no update
}
}
}
}
}
@@ -161,7 +161,7 @@ namespace TBF.BenchControl.DataEntry.Standard24
PurchaseOrder = orderComboBox.Text;
Program.LocalSettings.UpdateHistory(orderComboBox.Text,
ref Program.LocalSettings.PurchaseOrderHistory
#if FUZHOU150 || FUZHOU300
#if FUZHOU_150 || FUZHOU_300
, 20
#endif
);
@@ -272,7 +272,10 @@ namespace TBF.BenchControl.DataEntry.Standard24
{
foreach (var wm in batchResults.WaterMeters)
{
if (wm != null && !wm.Disabled) wm.PurchaseOrder = PurchaseOrder;
if ((wm != null) && !wm.Disabled && (PurchaseOrder != null))
{
wm.PurchaseOrder = PurchaseOrder; /// PurchaseOrder == null if form button OK has not been used => no update
}
}
}
}
@@ -165,7 +165,7 @@ namespace TBF.BenchControl.DataEntry.Standard48
PurchaseOrder = orderComboBox.Text;
Program.LocalSettings.UpdateHistory(orderComboBox.Text,
ref Program.LocalSettings.PurchaseOrderHistory
#if FUZHOU150 || FUZHOU300
#if FUZHOU_150 || FUZHOU_300
, 20
#endif
);
@@ -272,8 +272,11 @@ namespace TBF.BenchControl.DataEntry.Standard48
{
foreach (var wm in batchResults.WaterMeters)
{
if (wm != null && !wm.Disabled) wm.PurchaseOrder = PurchaseOrder;
}
if ((wm != null) && !wm.Disabled && (PurchaseOrder != null))
{
wm.PurchaseOrder = PurchaseOrder; /// PurchaseOrder == null if form button OK has not been used => no update
}
}
}
}
}
@@ -124,7 +124,7 @@ namespace TBF.BenchControl.DataEntry.Standard6
PurchaseOrder = orderComboBox.Text;
Program.LocalSettings.UpdateHistory(orderComboBox.Text,
ref Program.LocalSettings.PurchaseOrderHistory
#if FUZHOU150 || FUZHOU300
#if FUZHOU_150 || FUZHOU_300
, 20
#endif
);
@@ -285,8 +285,11 @@ namespace TBF.BenchControl.DataEntry.Standard6
foreach (var wm in batchResults.WaterMeters)
{
if (wm != null && !wm.Disabled) wm.PurchaseOrder = PurchaseOrder;
}
if ((wm != null) && !wm.Disabled && (PurchaseOrder != null))
{
wm.PurchaseOrder = PurchaseOrder; /// PurchaseOrder == null if form button OK has not been used => no update
}
}
}
}
}
@@ -166,7 +166,7 @@ namespace TBF.BenchControl.DataEntry.StandardCamera
PurchaseOrder = orderComboBox.Text;
Program.LocalSettings.UpdateHistory(orderComboBox.Text,
ref Program.LocalSettings.PurchaseOrderHistory
#if FUZHOU150 || FUZHOU300
#if FUZHOU_150 || FUZHOU_300
, 20
#endif
);
@@ -397,8 +397,11 @@ namespace TBF.BenchControl.DataEntry.StandardCamera
{
foreach (var wm in batchResults.WaterMeters)
{
if (wm != null && !wm.Disabled) wm.PurchaseOrder = PurchaseOrder;
}
if ((wm != null) && !wm.Disabled && (PurchaseOrder != null))
{
wm.PurchaseOrder = PurchaseOrder; /// PurchaseOrder == null if form button OK has not been used => no update
}
}
}
}
}
@@ -257,7 +257,10 @@ namespace TBF.BenchControl.DataEntry.iPerl
{
foreach (var wm in batchResults.WaterMeters)
{
if (wm != null && !wm.Disabled) wm.PurchaseOrder = PurchaseOrder;
if ((wm != null) && !wm.Disabled && (PurchaseOrder != null))
{
wm.PurchaseOrder = PurchaseOrder; /// PurchaseOrder == null if form button OK has not been used => no update
}
}
}
}
+2 -2
View File
@@ -19,7 +19,7 @@ namespace TBF.BenchControl.Elde
EnduranceCycleStop = 13,
}
#if FUZHOU300 || PT200IL || TORINO50 || BADGER_MALA_TRAT || BADGER_STREDNA_TRAT || TURA_IPERL || TURA_SPECIAL || BADGER_VELKA_TRAT || PUCHONG_PT200 || SLM_50 || GENESIS || MALTA_WSD25 || SLM_END || WARSAW_END || BERLIN || SLM_150 || PETERSBURG_50 || PETERSBURG_200 || KEMPNO_50 || BAHRAIN_50 || RUM_MOB || KRAKOW_50 || JUZNA_AFRIKA_50 || ZAMBIA || SENTEC || FUZHOU100
#if FUZHOU_300 || PT200IL || TORINO_50 || BADGER_MALA_TRAT || BADGER_STREDNA_TRAT || TURA_IPERL || TURA_SPECIAL || BADGER_VELKA_TRAT || PUCHONG_200 || SLM_50 || GENESIS || MALTA_WSD25 || SLM_END || WARSAW_END || BERLIN || SLM_150 || PETERSBURG_50 || PETERSBURG_200 || KEMPNO_50 || BAHRAIN_50 || RUM_MOB || KRAKOW_50 || JUZNA_AFRIKA_50 || ZAMBIA || FEWA_50 || SENTEC || FUZHOU_100 || CEVAK_200 || DUBAJ_50
public enum StatusP : ulong
{
RefFlowMeterMask = 0x7, /// bits 0,1,2
@@ -46,7 +46,7 @@ namespace TBF.BenchControl.Elde
ErrorPressMeter4 = 0x8000000000000, /// bit 51
EndurCycleRunning = 0x200000000000000, /// bit 57
}
#else // DN100 || MUNICH || FUZHOU150 || TORUN_PT50_2015 || CEVAK_PT40_272 || MURES_PT40 || FUZHOU_40
#else // DN100 || MUNICH || FUZHOU_150 || TORUN_50 || CEVAK_40 || MURES_40 || FUZHOU_50
public enum StatusP : ulong
{
RefFlowMeterMask = 0x7,
+23 -18
View File
@@ -46,7 +46,7 @@ namespace TBF.BenchControl.Elde
public int EtPulsesK { get { return controlCom.EtPulsesK; } }
public UInt16 WMeterPulses(int wmNr1) { return controlCom.WMeterPulses(wmNr1); }
public int WMeterReference(int wmNr0) { return controlCom.WMeterReference(wmNr0); }
public uint RegulValveDAC { get { return controlCom.RegulValveDAC; } }
public uint RegulValveDAC(int rvNr0) { return controlCom.RegulValveDAC(rvNr0); }
public float Pressure(int prsNr0) { return controlCom.Pressure(prsNr0); }
public float Temperature(int tmpNr0) { return controlCom.Temperature(tmpNr0); }
public RegulValveState RegulValveState(int rvNr1) { return (RegulValveState)controlCom.RegulValveState(rvNr1); }
@@ -126,7 +126,7 @@ namespace TBF.BenchControl.Elde
public uint[] DiverterEdge; /// Created and initialized in this.Initialize()
// Array length is the reference flowmeters count plus one
#if DN100 || FUZHOU150 || FUZHOU300 || PT200IL || PUCHONG_PT200 || SLM_150 || SENTEC
#if DN100 || FUZHOU_150 || FUZHOU_300 || PT200IL || PUCHONG_200 || SLM_150 || SENTEC || CEVAK_200
public uint[,] RegValveCalib = new uint[8,2] {{100,500},{100,500},{100,500},{100,500},{100,500},{100,500},{100,500},{100,500}};
public byte[] MeretRS485Address = new byte[4];
public float[] EtCalib = new float[6] { 1, 1, 1, 1, 1, 1 };
@@ -137,7 +137,7 @@ namespace TBF.BenchControl.Elde
{100,500}, {100,500}, {100,500}, {100,500} };
public byte[] MeretRS485Address = new byte[4];
public float[] EtCalib = new float[7] { 1, 1, 1, 1, 1, 1, 1 };
#elif MUNICH || TORINO50 || BADGER_MALA_TRAT || BADGER_STREDNA_TRAT || TORUN_PT50_2015 || CEVAK_PT40_272 || TURA_IPERL || TURA_SPECIAL || MURES_PT40 || FUZHOU_40 || SLM_50 || PETERSBURG_50 || KEMPNO_50 || BAHRAIN_50 || KRAKOW_50 || JUZNA_AFRIKA_50 || ZAMBIA || FUZHOU100
#elif MUNICH || TORINO_50 || BADGER_MALA_TRAT || BADGER_STREDNA_TRAT || TORUN_50 || CEVAK_40 || TURA_IPERL || TURA_SPECIAL || MURES_40 || FUZHOU_50 || SLM_50 || PETERSBURG_50 || KEMPNO_50 || BAHRAIN_50 || KRAKOW_50 || JUZNA_AFRIKA_50 || ZAMBIA || FEWA_50 || FUZHOU_100 || DUBAJ_50
public uint[,] RegValveCalib = new uint[8,2] {{100,500},{100,500},{100,500},{100,500},{100,500},{100,500},{100,500},{100,500}};
public byte[] MeretRS485Address = new byte[4];
public float[] EtCalib = new float[5] { 1, 1, 1, 1, 1 };
@@ -168,7 +168,7 @@ namespace TBF.BenchControl.Elde
int totalRefPulses;
int massRefPulses;
TestMethods testMethods;
float filterConstant;
int[] filters;
float[] FMFreq;
int regConst;
int shortImp;
@@ -181,7 +181,7 @@ namespace TBF.BenchControl.Elde
/// <param name="power">Power (0.0f .. 100.0f)</param>
public void SetFMFreq(int index, float power)
{
#if DN100 || MUNICH || FUZHOU150
#if DN100 || MUNICH || FUZHOU_150
if ((FMFreq == null) || (FMFreq.Length != 2))
{
FMFreq = new float[2];
@@ -247,7 +247,7 @@ namespace TBF.BenchControl.Elde
{
controlBoardCfg = cfg as ControlBoardCfg;
#if DN100 || MUNICH || FUZHOU150
#if DN100 || MUNICH || FUZHOU_150
FMFreq = new float[2] { 0, 0 }; /// Nr. of pumps: Fuzhou150=2, Fuzhou300=6, newer=6
#elif SLM_END || WARSAW_END
FMFreq = new float[4] { 0, 0, 0, 0 };
@@ -276,11 +276,11 @@ namespace TBF.BenchControl.Elde
public void InitializeComponent(
#if DN100
ControlCom2VB.ControlCom2panel ctrlBrdComponent,
#elif MUNICH || FUZHOU150
#elif MUNICH || FUZHOU_150
ControlComponent3Munich.UserControl1 ctrlBrdComponent,
#elif FUZHOU300
#elif FUZHOU_300
ControlComponent3F300.UserControl1 ctrlBrdComponent,
#elif PT200IL || PUCHONG_PT200 || GENESIS || BERLIN || SLM_150 || PETERSBURG_200
#elif PT200IL || PUCHONG_200 || GENESIS || BERLIN || SLM_150 || PETERSBURG_200
ControlComponent_Izrael2014.UserControl1 ctrlBrdComponent,
#else /// all newer benches
ControlComponent_Torino2015.UserControl1 ctrlBrdComponent,
@@ -420,7 +420,7 @@ namespace TBF.BenchControl.Elde
this.testMethods = 0;
this.stopDevs = 0;
}
this.filterConstant = 0;
this.filters = new int[] { 0, 0, 0, 0, 0, 0, 0, 0, };
this.regConst = 0;
this.shortImp = 0;
}
@@ -430,13 +430,18 @@ namespace TBF.BenchControl.Elde
{
if (DebugLevel == DebugMode.Simulate) return;
uint filter = Convert.ToUInt32(filterConstant);
uint[] uintFilters = new uint[8];
for (int i = 0; i < 8; i++)
{
uintFilters[i] = (filters.Length > i) ? (uint)filters[i] : uintFilters[i - 1];
}
///
if (sendCommandFlag)
{
controlCom.SendCommand(cmd, refNr, (benchModelRoute & routeMask),
totalRefPulses, massRefPulses, testMethods,
new uint[] { filter, filter, filter, filter, filter, filter, filter, filter },
uintFilters,
FMFreq, regConst, shortImp, stopDevs);
}
@@ -470,7 +475,7 @@ namespace TBF.BenchControl.Elde
/// <param name="stopDevs">What to stop</param>
public void SendCommand(Command cmd, int refFlowmtrNr, UInt128 route,
int totalRefPulses, int massRefPulses, TestMethods testMethods,
float filterConstant, int regConst, int shortImp, StopDevs stopDevs)
int[] filters, int regConst, int shortImp, StopDevs stopDevs)
{
this.cmd = cmd;
this.refNr = refFlowmtrNr;
@@ -478,7 +483,7 @@ namespace TBF.BenchControl.Elde
this.totalRefPulses = totalRefPulses;
this.massRefPulses = massRefPulses;
this.testMethods = testMethods;
this.filterConstant = filterConstant;
this.filters = filters;
this.regConst = regConst;
this.shortImp = shortImp;
this.stopDevs = stopDevs;
@@ -561,7 +566,7 @@ namespace TBF.BenchControl.Elde
/// <returns>Created operation</returns>
public IOperation StartMeasurementOp(OutputPath outputPath, TestMethods method,
float requiredFlowLo, float requiredFlowHi,
int refPulses, float filterConstant)
int refPulses, int[] filterConstants)
{
if (controlBoardCfg.DebugLevel == DebugMode.Simulate)
{
@@ -570,7 +575,7 @@ namespace TBF.BenchControl.Elde
else
{
return new StartMeasurementOp(this, outputPath, method, requiredFlowLo, requiredFlowHi,
refPulses, filterConstant);
refPulses, filterConstants);
}
}
@@ -584,7 +589,7 @@ namespace TBF.BenchControl.Elde
/// <returns>Created operation</returns>
public IOperation StartProlongedMeasurementOp(OutputPath outputPath, TestMethods method,
float requiredFlowLo, float requiredFlowHi,
int totalRefPulses, int massRefPulses, float filterConstant)
int totalRefPulses, int massRefPulses, int[] filters)
{
if (controlBoardCfg.DebugLevel == DebugMode.Simulate)
{
@@ -593,7 +598,7 @@ namespace TBF.BenchControl.Elde
else
{
return new StartMeasurementOp(this, outputPath, method, requiredFlowLo, requiredFlowHi,
totalRefPulses, massRefPulses, filterConstant);
totalRefPulses, massRefPulses, filters);
}
}
+3 -3
View File
@@ -43,7 +43,7 @@ namespace TBF.BenchControl.Elde
return wMeterReference[wmNr1];
}
public uint RegulValveDAC { get { return 0; } }
public uint RegulValveDAC(int rvNr0) { return 0; }
public float Pressure(int prsNr0) { return 0; }
public float Temperature(int tmpNr0) { return (float)(20 + tmpNr0); }
@@ -197,11 +197,11 @@ namespace TBF.BenchControl.Elde
this.cmd = cmd;
this.refFlowmtrNr = refFlowmtrNr;
#if FUZHOU300
#if FUZHOU_300
///
/// The following code deals with the situation that all FM controlled pums share bit #39.
/// In settings the bits of pumps should be sent as follows: P1=50, P2=51, P3=52, P4=53, P5=54 and P7=55
/// (in FUZHOU300 the FM pump bit should be set set to value FMIndex+50).
/// (in FUZHOU_300 the FM pump bit should be set set to value FMIndex+50).
///
bool bit39 = (route & 0x00FC000000000000) != 0; /// true if any of bits 50 through 55 is set
route = route & 0xFF03FFFFFFFFFFFF;
+38 -25
View File
@@ -19,7 +19,7 @@ namespace TBF.BenchControl.Elde
///
public StatusP StatusP { get { return (StatusP)ctrlBrdComponent.StatusP; } }
#if DN100 || MUNICH || FUZHOU150
#if DN100 || MUNICH || FUZHOU_150
public float ReferenceFreq { get { return 1000.0f * ctrlBrdComponent.referenceFreq; } } /// In [Hz] 0..2500, nom.=2000
#else /// all newer benches
/// <summary>
@@ -35,7 +35,7 @@ namespace TBF.BenchControl.Elde
public int EtPulses(int wmNr1) { return (int)ctrlBrdComponent.etPulses[wmNr1]; }
#if GENESIS || BERLIN || SLM_150 || PETERSBURG_50 || PETERSBURG_200 || KEMPNO_50 || BAHRAIN_50 || RUM_MOB || KRAKOW_50 || JUZNA_AFRIKA_50 || ZAMBIA || SENTEC || FUZHOU100
#if GENESIS || BERLIN || SLM_150 || PETERSBURG_50 || PETERSBURG_200 || KEMPNO_50 || BAHRAIN_50 || RUM_MOB || KRAKOW_50 || JUZNA_AFRIKA_50 || ZAMBIA || FEWA_50 || SENTEC || FUZHOU_100 || CEVAK_200 || DUBAJ_50
public int EtPulsesK { get { return (int)ctrlBrdComponent.etPulsesK; } }
#else
public int EtPulsesK { get { return 1; } }
@@ -43,7 +43,16 @@ namespace TBF.BenchControl.Elde
public UInt16 WMeterPulses(int wmNr1) { return (UInt16)ctrlBrdComponent.wMeterPuls[wmNr1]; }
public int WMeterReference(int wmNr0) { return (int)ctrlBrdComponent.wMeterReference[wmNr0]; }
public uint RegulValveDAC { get { return ctrlBrdComponent.StavDA; } }
public uint RegulValveDAC(int rvNr0)
{
#if CEVAK_200
return ctrlBrdComponent.StavDA[rvNr0];
#else
return ctrlBrdComponent.StavDA;
#endif
}
public float Pressure(int prsNr0) { return ctrlBrdComponent.pressure[prsNr0]; }
public float Temperature(int tmpNr0) { return ctrlBrdComponent.temperature[tmpNr0]; }
public RegulValveState RegulValveState(int rvNr1) { return (RegulValveState)ctrlBrdComponent.rValveStatus[rvNr1 - 1]; }
@@ -53,7 +62,7 @@ namespace TBF.BenchControl.Elde
public UInt128 RRoute { get { return ctrlBrdComponent.rRoute; } }
#endif
#if GENESIS || KEMPNO_50 || KRAKOW_50 || BAHRAIN_50 || BADGER_STREDNA_TRAT || JUZNA_AFRIKA_50 || ZAMBIA || SENTEC || FUZHOU100
#if GENESIS || KEMPNO_50 || KRAKOW_50 || BAHRAIN_50 || BADGER_STREDNA_TRAT || JUZNA_AFRIKA_50 || ZAMBIA || FEWA_50 || SENTEC || FUZHOU_100 || DUBAJ_50 || CEVAK_200
public uint DivTime(int id) { return ctrlBrdComponent.divTime[id]; }
public void SetDivLimit(int divNo, uint limLoPct, uint limHiPct)
{
@@ -72,7 +81,7 @@ namespace TBF.BenchControl.Elde
public float ImpulseTime(int wmNr1) { return ctrlBrdComponent.ImpulseTime[wmNr1]; }
#endif
#if DN100 || MUNICH || FUZHOU150
#if DN100 || MUNICH || FUZHOU_150
public uint FmState { get { return ctrlBrdComponent.fMState; } }
#else //if everything newer
public uint FmState { get { return ctrlBrdComponent.fMState[0]; } } /// TODO: index
@@ -97,7 +106,7 @@ namespace TBF.BenchControl.Elde
public float AnalogInput(int adcNr0) { return ctrlBrdComponent.Analogy[adcNr0]; }
public uint AnalogInputRaw(int adcNr0, int bank) { return ctrlBrdComponent.AnalogyRaw[adcNr0, bank]; } /// bank0=RV, bank1=Temp
#if DN100 || MUNICH || BADGER_MALA_TRAT || BADGER_VELKA_TRAT || FUZHOU_40 || FUZHOU150 || FUZHOU300 || PT200IL || PUCHONG_PT200 || TORINO50 || TORUN_PT50_2015 || CEVAK_PT40_272 || MURES_PT40
#if DN100 || MUNICH || BADGER_MALA_TRAT || BADGER_VELKA_TRAT || FUZHOU_50 || FUZHOU_150 || FUZHOU_300 || PT200IL || PUCHONG_200 || TORINO_50 || TORUN_50 || CEVAK_40 || MURES_40
public float TotalRefVolume { get { return ctrlBrdComponent.ReferenceVolume; } }
public float MassRefVolume { get { return ctrlBrdComponent.ReferenceVolume; } }
#else /// all new test benches
@@ -113,7 +122,7 @@ namespace TBF.BenchControl.Elde
public uint[] WMeterCont { get { return new uint[3]; } } /// Dummy
#endif
#if KEMPNO_50 || KRAKOW_50 || JUZNA_AFRIKA_50 || ZAMBIA || FUZHOU100
#if KEMPNO_50 || KRAKOW_50 || JUZNA_AFRIKA_50 || ZAMBIA || FEWA_50 || FUZHOU_100
public float ValveOpenCloseTime { get { return ctrlBrdComponent.ValveMoveTime[0]; } }
#else
public float ValveOpenCloseTime { get { return 0.001f; } }
@@ -145,11 +154,11 @@ namespace TBF.BenchControl.Elde
///
#if DN100
private ControlCom2VB.ControlCom2panel ctrlBrdComponent;
#elif MUNICH || FUZHOU150
#elif MUNICH || FUZHOU_150
private ControlComponent3Munich.UserControl1 ctrlBrdComponent;
#elif FUZHOU300
#elif FUZHOU_300
private ControlComponent3F300.UserControl1 ctrlBrdComponent;
#elif PT200IL || PUCHONG_PT200 || GENESIS || BERLIN || SLM_150 || PETERSBURG_200
#elif PT200IL || PUCHONG_200 || GENESIS || BERLIN || SLM_150 || PETERSBURG_200
private ControlComponent_Izrael2014.UserControl1 ctrlBrdComponent;
#else /// newer benches
private ControlComponent_Torino2015.UserControl1 ctrlBrdComponent;
@@ -161,11 +170,11 @@ namespace TBF.BenchControl.Elde
/// <param name="ctrlBrdComponent"></param>
#if DN100
public ControlComWrap(ControlCom2VB.ControlCom2panel ctrlBrdComponent)
#elif MUNICH || FUZHOU150
#elif MUNICH || FUZHOU_150
public ControlComWrap(ControlComponent3Munich.UserControl1 ctrlBrdComponent)
#elif FUZHOU300
#elif FUZHOU_300
public ControlComWrap(ControlComponent3F300.UserControl1 ctrlBrdComponent)
#elif PT200IL || PUCHONG_PT200 || GENESIS || BERLIN || SLM_150 || PETERSBURG_200
#elif PT200IL || PUCHONG_200 || GENESIS || BERLIN || SLM_150 || PETERSBURG_200
public ControlComWrap(ControlComponent_Izrael2014.UserControl1 ctrlBrdComponent)
#else /// all newer benches
public ControlComWrap(ControlComponent_Torino2015.UserControl1 ctrlBrdComponent)
@@ -212,16 +221,16 @@ namespace TBF.BenchControl.Elde
// rvCalib[0,0], rvCalib[0,1], rvCalib[1,0], rvCalib[1,1]));
#if DN100
log.FatalFormat("Component: {0}", ControlCom2VB.ControlCom2panel.ProgVersion);
#elif MUNICH || FUZHOU150
#elif MUNICH || FUZHOU_150
log.FatalFormat("Component: {0}", ControlComponent3Munich.UserControl1.ProgVersion);
#elif FUZHOU300
#elif FUZHOU_300
log.FatalFormat("Component: {0}", ControlComponent3F300.UserControl1.ProgVersion);
#elif PT200IL || PUCHONG_PT200 || GENESIS || BERLIN || SLM_150 || PETERSBURG_200
#elif PT200IL || PUCHONG_200 || GENESIS || BERLIN || SLM_150 || PETERSBURG_200
log.FatalFormat("Component: {0}", ControlComponent_Izrael2014.UserControl1.ProgVersion);
#else /// newer benches
log.FatalFormat("Component: {0}", ControlComponent_Torino2015.UserControl1.ProgVersion);
#endif
log.Fatal("SendCalibData(...)");
log.Fatal("SendCalibData(...)");
for (int i = 0; i < rvCalib.GetLength(0); i++)
for (int j = 0; j < rvCalib.GetLength(1); j++)
log.FatalFormat(" rvCalib[{0},{1}] = {2}", i, j, rvCalib[i,j]);
@@ -236,7 +245,7 @@ namespace TBF.BenchControl.Elde
ctrlBrdComponent.ExternalCom = true;
#if SENTEC
#if SENTEC || CEVAK_200
ctrlBrdComponent.SendCalibData(rvCalib, meretA, (byte)usedCom, tempCalib, etCalib, divEdge, balanceRange, (byte)123);
#else
ctrlBrdComponent.SendCalibData(rvCalib, meretA, (byte)usedCom, tempCalib, etCalib, divEdge, balanceRange);
@@ -270,7 +279,7 @@ namespace TBF.BenchControl.Elde
///
private void DoValveMove(int valveNo, RegulValveMode valveMode, float[] valveValue, int stableTime)
{
#if DN100 || MUNICH || FUZHOU150
#if DN100 || MUNICH || FUZHOU_150
log.InfoFormat("ValveMove(#={0}, md={1}, [{2}, {3}])", valveNo, valveMode, valveValue[0], valveValue[1]);
ctrlBrdComponent.ValveMove((byte)valveNo, (byte)valveMode, valveValue);
#else /// all newer benches
@@ -335,11 +344,11 @@ namespace TBF.BenchControl.Elde
// stopDevs));
#if FUZHOU300
#if FUZHOU_300
///
/// The following code deals with the situation that all FM controlled pumps share bit #39.
/// In settings the bits of pumps should be sent as follows: P1=50, P2=51, P3=52, P4=53, P5=54 and P7=55
/// (in FUZHOU300 the FM pump bit should be set set to value FMIndex+50).
/// (in FUZHOU_300 the FM pump bit should be set set to value FMIndex+50).
///
bool bit39 = (route & 0x00FC000000000000) != 0; /// true if any of bits 50 through 55 is set
route = route & 0xFF03FFFFFFFFFFFF;
@@ -372,18 +381,22 @@ namespace TBF.BenchControl.Elde
#if DN100 || MUNICH
ctrlBrdComponent.SendCommand((uint)cmd, (byte)refFlowMeterNr, (ulong)route, (uint)totalRefPulses, (uint)testMethods,
Convert.ToSingle(filterConstants[0]), fmFreq[0], (uint)regConst, (uint)shortImp, (uint)stopDevs);
#elif BADGER_MALA_TRAT || BADGER_VELKA_TRAT || FUZHOU_40 || FUZHOU150 || FUZHOU300 || PT200IL || PUCHONG_PT200 || TORINO50 || TORUN_PT50_2015 || CEVAK_PT40_272 || MURES_PT40
#elif BADGER_MALA_TRAT || BADGER_VELKA_TRAT || FUZHOU_50 || FUZHOU_150 || FUZHOU_300 || PT200IL || PUCHONG_200 || TORINO_50 || TORUN_50 || CEVAK_40 || MURES_40
ctrlBrdComponent.SendCommand((uint)cmd, (byte)refFlowMeterNr, (ulong)route, (uint)totalRefPulses, (uint)testMethods,
Convert.ToSingle(filterConstants[0]), fmFreq, (uint)regConst, (uint)shortImp, (uint)stopDevs);
#elif GENESIS || BERLIN || SLM_150 || PETERSBURG_200
#elif BERLIN || SLM_150 || PETERSBURG_200
uint[] pulsesArr = new uint[] { (uint)totalRefPulses, (uint)massRefPulses };
ctrlBrdComponent.SendCommand((uint)cmd, (byte)refFlowMeterNr, (ulong)(route & (UInt128)0xFFFFFFFFFFFFFFFF), (ulong)(route >> 64), pulsesArr, (uint)testMethods,
Convert.ToSingle(filterConstants[0]), fmFreq, (uint)regConst, (uint)shortImp, (uint)stopDevs);
#elif JUZNA_AFRIKA_50 || ZAMBIA || SENTEC || FUZHOU100
#elif GENESIS
uint[] pulsesArr = new uint[] { (uint)totalRefPulses, (uint)massRefPulses };
ctrlBrdComponent.SendCommand((uint)cmd, (byte)refFlowMeterNr, (ulong)(route & (UInt128)0xFFFFFFFFFFFFFFFF), (ulong)(route >> 64), pulsesArr, (uint)testMethods,
filterConstants, fmFreq, (uint)regConst, (uint)shortImp, (uint)stopDevs);
#elif JUZNA_AFRIKA_50 || ZAMBIA || FEWA_50 || SENTEC || FUZHOU_100 || CEVAK_200
uint[] pulsesArr = new uint[] { (uint)totalRefPulses, (uint)massRefPulses };
ctrlBrdComponent.SendCommand((uint)cmd, (byte)refFlowMeterNr, (ulong)route, pulsesArr, (uint)testMethods,
filterConstants, fmFreq, (uint)regConst, (uint)shortImp, (uint)stopDevs);
#else /// if TURA_IPERL || TURA_SPECIAL || MALTA_WSD25 || SLM_50 || SLM_END || WARSAW_END || PETERSBURG_50 || KEMPNO_50 || BAHRAIN_50 || RUM_MOB || KRAKOW_50 || BADGER_STREDNA_TRAT
#else /// if TURA_IPERL || TURA_SPECIAL || MALTA_WSD25 || SLM_50 || SLM_END || WARSAW_END || PETERSBURG_50 || KEMPNO_50 || BAHRAIN_50 || RUM_MOB || KRAKOW_50 || BADGER_STREDNA_TRAT || DUBAJ_50
uint[] pulsesArr = new uint[] { (uint)totalRefPulses, (uint)massRefPulses };
ctrlBrdComponent.SendCommand((uint)cmd, (byte)refFlowMeterNr, (ulong)route, pulsesArr, (uint)testMethods,
Convert.ToSingle(filterConstants[0]), fmFreq, (uint)regConst, (uint)shortImp, (uint)stopDevs);
+8 -8
View File
@@ -24,7 +24,7 @@ namespace TBF.BenchControl.Elde.CoverTest
readonly ulong mask; /// derived from bitPosition in the constructor
readonly ulong target;
readonly string message;
readonly Users.Grp.GID bypassLevel;
readonly Users.Grp.GID[] bypassLevel;
public CoverTest()
{
@@ -69,7 +69,7 @@ namespace TBF.BenchControl.Elde.CoverTest
}
CoverTestForm modelessDlg;
CoverTestForm coverTestForm;
bool completed = false;
@@ -77,8 +77,8 @@ namespace TBF.BenchControl.Elde.CoverTest
///
void OpenFormDlg(CoverTest myRef)
{
myRef.modelessDlg = new CoverTestForm(message, bypassLevel, bypassLog);
modelessDlg.Show();
myRef.coverTestForm = new CoverTestForm(message, bypassLevel, bypassLog);
coverTestForm.Show();
}
@@ -106,7 +106,7 @@ namespace TBF.BenchControl.Elde.CoverTest
completed = true;
}
if (completed || modelessDlg.Completed)
if (completed || coverTestForm.Completed)
{
completed = true;
CloseModelessDlg();
@@ -127,10 +127,10 @@ namespace TBF.BenchControl.Elde.CoverTest
void CloseModelessDlg()
{
if (modelessDlg is GenericDevices.IHasCompleted)
if (coverTestForm != null)
{
UiBridge.Bridge.OnCloseQandAForm(this, null);
modelessDlg = null;
coverTestForm.OnCloseThisForm(this, null);
coverTestForm = null;
}
}
}
@@ -22,7 +22,7 @@ namespace TBF.BenchControl.Elde.CoverTest
public int BitPosition;
public bool Invert;
public string Message;
public Users.Grp.GID BypassLevel;
public Users.Grp.GID[] BypassLevel;
/// Private parameterless constructor invoked by all other (public) constructors
CoverTestCfg()
@@ -35,7 +35,7 @@ namespace TBF.BenchControl.Elde.CoverTest
Invert = false;
Message = Strings.Close_the_cover;
BypassLevel = Users.Grp.GID.TestingSpecialists;
BypassLevel = new Users.Grp.GID[] { Users.Grp.GID.TestingSpecialists };
}
public CoverTestCfg(IComponentFactory factory)
@@ -68,7 +68,7 @@ namespace TBF.BenchControl.Elde.CoverTest
bitPositionTextBox.Text = config.BitPosition.ToString();
invertCheckBox.Checked = config.Invert;
messageTextBox.Text = config.Message;
bypassLevelComboBox.Text = config.BypassLevel.ToString();
bypassLevelComboBox.Text = config.BypassLevel == null ? "---" : ((config.BypassLevel.Length > 0) ? config.BypassLevel[0].ToString() : "---");
}
public void Unlock()
@@ -93,11 +93,12 @@ namespace TBF.BenchControl.Elde.CoverTest
config.Invert = invertCheckBox.Checked;
config.Message = messageTextBox.Text;
config.BypassLevel = null;
for (Users.Grp.GID gid = 0; gid < Users.Grp.GID.NrOfGroups; gid++)
{
if (bypassLevelComboBox.Text == gid.ToString())
{
config.BypassLevel = gid;
config.BypassLevel = new Users.Grp.GID[] { gid };
break;
}
}
@@ -9,7 +9,7 @@ using TBF.Resources;
namespace TBF.BenchControl.Elde.CoverTest
{
public partial class CoverTestForm : Form, GenericDevices.IHasCompleted
public partial class CoverTestForm : Form
{
ILog bypassLog;
string message;
@@ -18,9 +18,9 @@ namespace TBF.BenchControl.Elde.CoverTest
public bool Completed { get { return completed; } }
bool completed;
Users.Grp.GID bypassLevel;
Users.Grp.GID[] bypassLevel;
public CoverTestForm(string message, Users.Grp.GID bypassLevel, ILog bypassLog)
public CoverTestForm(string message, Users.Grp.GID[] bypassLevel, ILog bypassLog)
{
InitializeComponent();
ControlBox = false;
@@ -74,12 +74,31 @@ namespace TBF.BenchControl.Elde.CoverTest
#region Forced close handling
/// <summary>
/// Used by CoverTest, AskYesNoOp and MessageBoxOp.
/// </summary>
public void OnCloseThisForm(object sender, EventArgs args)
{
if (CloseThisFormHandler == null) return;
try
{
CloseThisFormHandler(sender, null);
}
catch (Exception e)
{
}
}
public event EventHandler<EventArgs> CloseThisFormHandler;
public void StartForceCloseHandler()
{
UiBridge.Bridge.CloseQandAFormHandler += delegate(object sender, EventArgs args)
CloseThisFormHandler += delegate(object sender, EventArgs args)
{
if (InvokeRequired) { Invoke(new EventHandler<EventArgs>(OnForceClose), sender, args); }
else OnForceClose(sender, args);
if (InvokeRequired)
Invoke(new EventHandler<EventArgs>(OnForceClose), sender, args);
else
OnForceClose(sender, args);
};
}
+6 -2
View File
@@ -92,8 +92,12 @@ namespace TBF.BenchControl.Elde.Diverter
}
int divNrFromName = int.Parse(Name.Substring(3));
#if GENESIS || PETERSBURG_50 || PETERSBURG_200 || FUZHOU_40 || FUZHOU150 || FUZHOU300
int divNrFromName;
if (!int.TryParse(Name.Substring(3), out divNrFromName))
{
divNrFromName = nextIdx;
}
#if GENESIS || PETERSBURG_50 || PETERSBURG_200 || FUZHOU_50 || FUZHOU_150 || FUZHOU_300
flowMtrNr4Cmd = divNrFromName + 1;
#elif BADGER_STREDNA_TRAT
flowMtrNr4Cmd = (divNrFromName == 1) ? 1 : ((divNrFromName == 2) ? 9 : 20);
+2 -2
View File
@@ -56,7 +56,7 @@ namespace TBF.BenchControl.Elde
public void Start()
{
controlBoard.SyncRoute();
controlBoard.SendCommand(commandOnStartOp, 0, controlBoard.Route, 0, 0, testMethod, 0, 20, 0, StopDevs.None);
controlBoard.SendCommand(commandOnStartOp, 0, controlBoard.Route, 0, 0, testMethod, new int[] { 0, 0, 0, 0, 0, 0, 0, 0 }, 20, 0, StopDevs.None);
opState = OpState.StartingCommand;
}
@@ -99,7 +99,7 @@ namespace TBF.BenchControl.Elde
if (commandOnStopOp != Command.None)
{
controlBoard.SyncRoute();
controlBoard.SendCommand(commandOnStopOp, 0, controlBoard.Route, 0, 0, testMethod, 0, 20, 0, StopDevs.None);
controlBoard.SendCommand(commandOnStopOp, 0, controlBoard.Route, 0, 0, testMethod, new int[] { 0, 0, 0, 0, 0, 0, 0, 0 }, 20, 0, StopDevs.None);
}
}
}
+1 -1
View File
@@ -14,7 +14,7 @@ namespace TBF.BenchControl.Elde
int EtPulsesK { get; }
UInt16 WMeterPulses(int wmNr1);
int WMeterReference(int wmNr0);
uint RegulValveDAC { get; }
uint RegulValveDAC(int rvNr0);
float Pressure(int prsNr0);
float Temperature(int tmpNr0);
RegulValveState RegulValveState(int rvNr1);
@@ -132,7 +132,7 @@ namespace TBF.BenchControl.Elde
void SendCommand()
{
controlBoard.SyncRoute();
controlBoard.SendCommand(Command.ReadDivTransition, 0, controlBoard.Route, 0, 0, 0, 0, 0, 0, StopDevs.None);
controlBoard.SendCommand(Command.ReadDivTransition, 0, controlBoard.Route, 0, 0, 0, new int[] { 0, 0, 0, 0, 0, 0, 0, 0 }, 0, 0, StopDevs.None);
cmdSent = true;
}
@@ -1,5 +1,5 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
/// Copyright (c) 2013-2018 Sensus Slovensko a.s.
///
using System;
using System.IO;
@@ -17,15 +17,18 @@ namespace TBF.BenchControl.Elde.RegisterReader
public override XmlSerializer GetSerializer() { return Serializer; }
public double PulsesPerLtr; /// [l^-1]
public int Filter;
public override void InitializeAll()
{
PulsesPerLtr = 1.0;
Filter = 0;
}
string[] paramNames = new string[]
{
Strings.PulsesPerLtr,
Strings.Filter,
};
public override string ParamName(int i) { return paramNames[i]; }
public override int ParamsCount() { return paramNames.Length; }
@@ -35,7 +38,8 @@ namespace TBF.BenchControl.Elde.RegisterReader
switch (i)
{
case 0: return PulsesPerLtr.ToString();
default: return string.Empty;
case 1: return Filter.ToString();
default: return string.Empty;
}
}
@@ -45,6 +49,7 @@ namespace TBF.BenchControl.Elde.RegisterReader
switch (i)
{
case 0: PulsesPerLtr = Utils.ParseUDouble(strValue); return CfgUpdateFlags.None;
case 1: Filter = int.Parse(strValue); return CfgUpdateFlags.None;
default: return CfgUpdateFlags.None;
}
}
@@ -55,12 +60,18 @@ namespace TBF.BenchControl.Elde.RegisterReader
message = string.Empty;
double dummy;
int idummy;
switch (i)
{
case 0:
if (Utils.TryParseUDouble(strValue, out dummy)) return true;
break;
default:
case 1:
if (int.TryParse(strValue, out idummy) && (idummy >= 0)) return true;
break;
default:
message = "Invalid index";
return false;
}
@@ -72,6 +83,7 @@ namespace TBF.BenchControl.Elde.RegisterReader
void CopyContentTo(RRProcedureParams prms)
{
prms.PulsesPerLtr = this.PulsesPerLtr;
prms.Filter = this.Filter;
}
public IParamsProvider Clone()
@@ -20,6 +20,7 @@ namespace TBF.BenchControl.Elde.RegisterReader
public Config.Entities.RegisterReaderType RegisterReaderType { get { return Config.Entities.RegisterReaderType.Pulses; } }
public double PulsesPerLtr { get { return registerReaderCfg.ProcParams.PulsesPerLtr; } }
public double LtrsPerPulse { get { return (PulsesPerLtr <= float.Epsilon) ? 1.0 : (1 / PulsesPerLtr); ; } }
public int Filter { get { return registerReaderCfg.ProcParams.Filter; } }
public int WMPulses { get { return wmPulses; } }
public int WMRefPulses { get { return wmRefPulses; } }
@@ -112,6 +112,8 @@ namespace TBF.BenchControl.Elde.RegulValve
adcChannel = (Idx1 < 6) ? (Idx1 - 1) : (Idx1 - 2);
#elif SENTEC
adcChannel = (Idx1 < 3) ? (Idx1 - 1) : (Idx1 - 2);
#elif CEVAK_200
adcChannel = Math.Max(Idx1 - 3, 0);
#else
adcChannel = Idx1 - 1;
#endif
@@ -202,7 +202,7 @@ namespace TBF.BenchControl.Elde.RegulValve
// '_regulValve.RegulValveCfg.PidCoef' replaced by a casted operation parameter 'pidCoef'
controlBoard.SendCommand(Command.Start, flowMeter.Idx1, controlBoard.Route,
int.MaxValue, int.MaxValue, tm,
0.0f, (int)pidCoef, 0, sd);
new int[] { 0, 0, 0, 0, 0, 0, 0, 0 }, (int)pidCoef, 0, sd);
}
/// <summary>Run this operation</summary>
@@ -251,7 +251,7 @@ namespace TBF.BenchControl.Elde.RegulValve
// '_regulValve.RegulValveCfg.PidCoef' replaced by a casted operation parameter 'pidCoef'
controlBoard.SendCommand(Command.Start, flowMeter.Idx1, controlBoard.Route,
int.MaxValue, int.MaxValue, tm,
0.0f, (int)pidCoef, 0, sd);
new int[] { 0, 0, 0, 0, 0, 0, 0, 0 }, (int)pidCoef, 0, sd);
return Event.None;
}
else if (opState == OpState.ValveMoveToPosition1)
@@ -453,7 +453,7 @@ namespace TBF.BenchControl.Elde.RegulValve
StopDevs sd = StopDevs.RegValveRegulation;
controlBoard.SendCommand(Command.Stop, flowMeter.Idx1, controlBoard.Route,
50000, 50000, tm,
0.0f, (int)pidCoef, 0, sd);
new int[] { 0, 0, 0, 0, 0, 0, 0, 0 }, (int)pidCoef, 0, sd);
}
}
}
@@ -214,7 +214,7 @@ namespace TBF.BenchControl.Elde.RegulValveCoax
// '_regulValve.RegulValveCfg.PidCoef' replaced by a casted operation parameter 'pidCoef'
controlBoard.SendCommand(Command.Start, flowMeterNr, controlBoard.Route,
int.MaxValue, int.MaxValue, tm,
0.0f, (int)pidCoef, 0, sd);
new int[] { 0, 0, 0, 0, 0, 0, 0, 0 }, (int)pidCoef, 0, sd);
}
/// <summary>Run this operation</summary>
@@ -265,7 +265,7 @@ namespace TBF.BenchControl.Elde.RegulValveCoax
// '_regulValve.RegulValveCfg.PidCoef' replaced by a casted operation parameter 'pidCoef'
controlBoard.SendCommand(Command.Start, flowMeterNr, controlBoard.Route,
int.MaxValue, int.MaxValue, tm,
0.0f, (int)pidCoef, 0, sd);
new int[] { 0, 0, 0, 0, 0, 0, 0, 0 }, (int)pidCoef, 0, sd);
log.DebugFormat(" return Event.None");
return Event.None;
}
@@ -483,7 +483,7 @@ namespace TBF.BenchControl.Elde.RegulValveCoax
StopDevs sd = StopDevs.RegValveRegulation;
controlBoard.SendCommand(Command.Stop, flowMeterNr, controlBoard.Route,
50000, 50000, tm,
0.0f, (int)pidCoef, 0, sd);
new int[] { 0, 0, 0, 0, 0, 0, 0, 0 }, (int)pidCoef, 0, sd);
log.WarnFormat("Stop() SendCommand(Stop, {0}, ...)", flowMeterNr);
}
@@ -219,7 +219,7 @@ namespace TBF.BenchControl.Elde.RegulValveTandem
// '_regulValve.RegulValveTandemCfg.PidCoef' replaced by a casted operation parameter 'pidCoef'
controlBoard.SendCommand(Command.Start, flowMeterNr, controlBoard.Route,
int.MaxValue, int.MaxValue, tm,
0.0f, (int)pidCoef, 0, sd);
new int[] { 0, 0, 0, 0, 0, 0, 0, 0 }, (int)pidCoef, 0, sd);
}
/// <summary>Run this operation</summary>
@@ -374,7 +374,7 @@ namespace TBF.BenchControl.Elde.RegulValveTandem
StopDevs sd = StopDevs.RegValveRegulation;
controlBoard.SendCommand(Command.Stop, flowMeterNr, controlBoard.Route,
50000, 50000, tm,
0.0f, 20, 0, sd);
new int[] { 0, 0, 0, 0, 0, 0, 0, 0 }, 20, 0, sd);
}
}
}
+7 -7
View File
@@ -25,7 +25,7 @@ namespace TBF.BenchControl.Elde
readonly int totalRefPulses; /// Number of reference pulses for a complete test
readonly int massRefPulses; /// Number of reference pulses for mass collection
readonly TestMethods testMethod;
readonly float filterConstant;
readonly int[] filters;
readonly int diverterNr;
bool started = false;
@@ -55,8 +55,8 @@ namespace TBF.BenchControl.Elde
/// <param name="filterConstant">Specifies filter for watermeter pulses</param>
public StartMeasurementOp(ControlBoardDev controlBoard, OutputPath outputPath, TestMethods method,
float requiredFlowLo, float requiredFlowHi,
int refPulses, float filterConstant)
: this(controlBoard, outputPath, method, requiredFlowLo, requiredFlowHi, refPulses, refPulses, filterConstant)
int refPulses, int[] filters)
: this(controlBoard, outputPath, method, requiredFlowLo, requiredFlowHi, refPulses, refPulses, filters)
{
}
@@ -71,7 +71,7 @@ namespace TBF.BenchControl.Elde
/// <param name="filterConstant">Specifies filter for watermeter pulses</param>
public StartMeasurementOp(ControlBoardDev controlBoard, OutputPath outputPath, TestMethods method,
float requiredFlowLo, float requiredFlowHi,
int totalRefPulses, int massRefPulses, float filterConstant)
int totalRefPulses, int massRefPulses, int[] filters)
{
if (controlBoard == null) throw new ArgumentNullException("controlBoardDev");
this.controlBoard = controlBoard;
@@ -111,7 +111,7 @@ namespace TBF.BenchControl.Elde
this.totalRefPulses = totalRefPulses;
this.massRefPulses = massRefPulses;
this.testMethod = method;
this.filterConstant = filterConstant;
this.filters = filters;
log.Debug(this.ToString());
}
@@ -127,11 +127,11 @@ namespace TBF.BenchControl.Elde
int flowMeterIdxAndDiv = flowMeterNr;
#endif
log.InfoFormat("Start() : SendCommand(Cmd.Start, {0}, route, {1}, {1}, {2}, {3}, {4}, 0, Stop.None)",
flowMeterIdxAndDiv, totalRefPulses, testMethod, filterConstant, (int)pidCoef);
flowMeterIdxAndDiv, totalRefPulses, testMethod, filters[0], (int)pidCoef);
controlBoard.SendCommand(Command.Start, flowMeterIdxAndDiv, controlBoard.Route,
totalRefPulses, massRefPulses, testMethod,
filterConstant, (int)pidCoef, 0, StopDevs.None);
filters, (int)pidCoef, 0, StopDevs.None);
}
/// <summary>Start this operation</summary>
+1 -1
View File
@@ -48,7 +48,7 @@ namespace TBF.BenchControl.Elde
controlBoard.Route, /// route
0, 0, /// ref. pulses
TestMethods.Diverter,
0.0f,
new int[] { 0, 0, 0, 0, 0, 0, 0, 0 },
20,
0,
StopDevs.Diverter | StopDevs.GatePulse | StopDevs.Reference | StopDevs.RegValveRegulation);
+1 -1
View File
@@ -175,7 +175,7 @@ namespace TBF.BenchControl
OuterLoopStart,
OuterLoopEnd,
/// Production monitoring
/// Production tracing
CheckDone,
CheckNotDone,
@@ -1,6 +1,5 @@
///
/// Copyright (c) 2015 Sensus Metering Systems
/// Author: Milan Hanajík
/// Copyright (c) 2015-2018 Sensus Slovensko a.s.
///
using Config.Entities;
using TBF.BenchControl.Generic;
@@ -14,6 +13,11 @@ namespace TBF.BenchControl.GenericDevices
{
string TestBenchName { get; }
int TestBenchId { get; }
string Address1 { get; }
string Address2 { get; }
string Address3 { get; }
string Address4 { get; }
string Address5 { get; }
RemoteDBUse RemoteDBUse { get; }
}
}
+31
View File
@@ -0,0 +1,31 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System.Collections.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.GenericDevices
{
public interface IHart : IComponent
{
/// <summary>
/// Send an arbitrary modbus message.
/// When the message length is N, however only bytes 1..N-2 have to be set.
/// The last two message bytes (CRC) may be uninitialized or zero.
/// They are calculated inside this function as required by Modbus specification.
/// </summary>
/// <param name="message">Message incl CRC fields, CRC bytes dont have to be set</param>
void SendMessage(byte[] message);
/// <summary>
/// Send a structured modbus message.
/// </summary>
/// <param name="modbusAddress">Device address (1..255) or 0 = broadcast</param>
/// <param name="function">Function (0..127)</param>
/// <param name="dataAddress">Address of data to be transferred (0..65535)</param>
/// <param name="dataCount">Count of data bytes to be transferred (0..65535)</param>
void SendMessage(byte modbusAddress, byte function, ushort dataAddress, ushort dataCount);
Queue<byte[]>[] ReceivedTelegrams { get; }
}
}
+26
View File
@@ -0,0 +1,26 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System.Collections.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Hart.Common
{
public class Factory : IComponentFactory
{
public string ClassName { get { return this.GetType().Namespace.Substring(17); } }
public void ResetStaticProperties() { Hart.ResetStaticProperties(); }
public IComponent DummyComponent() { return new Hart(); }
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Hart(cfg); }
public IComponentCfg DefaultConfig() { return new HartCfg(this.GetType().Namespace.Substring(17), this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(HartCfg.Serializer, component, this);
}
}
}
+211
View File
@@ -0,0 +1,211 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO.Ports;
using System.Text;
using System.Threading;
using Config.Entities;
using log4net;
using TBF.BenchControl.Generic;
using TBF.Boxes;
namespace TBF.BenchControl.Hart.Common
{
/// <summary>
/// Root component for Modbus communication via serial port (RS485)
/// </summary>
public class Hart : ComponentBase, IDevice, GenericDevices.IModbus
{
private static readonly ILog log = LogManager.GetLogger(typeof(Hart));
public override string ToString() { return string.Format("Modbus({0})", Cfg.ToString(1)); }
private readonly HartCfg modbusCommonCfg;
/// Private fields
SerialPort serialPort;
DateTime lastSerialPortWrite;
public Queue<byte[]>[] ReceivedTelegrams
{
get { return receivedTelegrams; }
}
Queue<byte[]>[] receivedTelegrams;
Queue<byte[]> telegramsToSend;
public Hart()
{
}
/// <summary>
/// Ambient temperature / humidity / pressure meter 'Greco' connected via serial interface (RS232)
/// Connection settings: 19200 Bd 8-bits No-parity 1-stop-bit Flow control: none or hardware.
/// </summary>
public Hart(Generic.IComponentCfg cfg)
: base(cfg)
{
receivedTelegrams = new Queue<byte[]>[256];
for (int i = 0; i < receivedTelegrams.Length; i++)
{
receivedTelegrams[i] = new Queue<byte[]>();
}
telegramsToSend = new Queue<byte[]>();
serialPort = null;
modbusCommonCfg = cfg as HartCfg;
log.Debug(this.ToString());
}
~Hart()
{
}
public void Initialize()
{
if (modbusCommonCfg.DebugLevel == DebugMode.Simulate)
{
serialPort = null;
log.FatalFormat("{0} - Device simulated", Name);
return;
}
string comPortName = "COM" + modbusCommonCfg.ComPortNr.ToString();
serialPort = new SerialPort(comPortName, modbusCommonCfg.BaudRate, modbusCommonCfg.Parity, modbusCommonCfg.DataBits, modbusCommonCfg.StopBits);
serialPort.Handshake = modbusCommonCfg.Handshake;
serialPort.Open();
//stopWorkerThread = false;
//workerThread = new Thread(Worker);
//workerThread.Start();
log.FatalFormat("{0} - Device successfully initialized", Name);
}
/// <summary>
/// Send an arbitrary modbus message.
/// When the message length is N, however only bytes 1..N-2 have to be set.
/// The last two message bytes (CRC) may be uninitialized or zero.
/// They are calculated inside this function as required by Modbus specification.
/// </summary>
/// <param name="message">Message incl CRC fields, CRC bytes dont have to be set</param>
public void SendMessage(byte[] message)
{
if (serialPort == null) return;
Telegram.UpdateTelegramCRC(message);
if ((DateTime.Now - lastSerialPortWrite) > new TimeSpan(0, 0, 0, 0, 100))
{
/// More then 100 ms since last 'send' --> do not enqueue the message
SendMessageNow(message);
}
else
{
telegramsToSend.Enqueue(message);
string s = Telegram.LogTelegram(string.Format("{0} - Enqueueing message ", Name), message);
Debug.WriteLine(s);
log.Debug(s);
}
}
/// <summary>
/// Send a structured modbus message.
/// </summary>
/// <param name="modbusAddress">Device address (1..255) or 0 = broadcast</param>
/// <param name="function">Function (0..127)</param>
/// <param name="dataAddress">Address of data to be transferred (0..65535)</param>
/// <param name="dataCount">Count of data bytes to be transferred (0..65535)</param>
public void SendMessage(byte modbusAddress, byte function, ushort dataAddress, ushort dataCount)
{
if (serialPort == null) return;
byte[] message = new byte[8]
{
modbusAddress,
function,
(byte)(dataAddress / 256),
(byte)(dataAddress % 256),
(byte)(dataCount / 256),
(byte)(dataCount % 256),
0,
0,
};
SendMessage(message);
}
public void SendMessageNow(byte[] message)
{
serialPort.Write(message, 0, message.Length);
lastSerialPortWrite = DateTime.Now;
string s = Telegram.LogTelegram(string.Format("{0} - Sending message ", Name), message);
Debug.WriteLine(s);
log.Debug(s);
}
/// <summary>Run this device</summary>
public void RunDeviceBefore()
{
if (serialPort == null) return;
int nrBytes = serialPort.BytesToRead;
if (nrBytes > 0)
{
byte[] buffer = new byte[nrBytes];
serialPort.Read(buffer, 0, nrBytes);
int deviceAddress = (nrBytes >= 1) ? buffer[0] : 0;
int function = (nrBytes >= 2) ? buffer[1] : 0;
if ((nrBytes >= 4) && Telegram.VerifyTelegramCRC(buffer))
{
receivedTelegrams[deviceAddress].Enqueue(buffer);
string s = string.Format("{0} - {1} address={2} count={3}", Name, Telegram.LogTelegram("Telegram received: ", buffer), deviceAddress, receivedTelegrams[deviceAddress].Count);
Debug.WriteLine(s);
log.Debug(s);
}
else
{
string s = Telegram.LogTelegram(string.Format("{0} - Invalid data received ", Name), buffer);
Debug.WriteLine(s);
log.Debug(s);
}
}
}
/// <summary>Run this device</summary>
public void RunDeviceAfter()
{
if (serialPort == null) return;
if (telegramsToSend.Count > 0 && (DateTime.Now - lastSerialPortWrite) > new TimeSpan(0, 0, 0, 0, 500))
{
SendMessageNow(telegramsToSend.Dequeue());
}
}
/// <summary>Stop this device</summary>
public void StopDevice()
{
if (serialPort != null)
{
//stopWorkerThread = true;
//workerThread.Join(2000);
serialPort.Close();
serialPort = null;
}
}
public void StopDevice2() { }
}
}
+248
View File
@@ -0,0 +1,248 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System.IO;
using System.Collections.Generic;
using System.IO.Ports;
using System.Xml.Serialization;
using Config.Entities;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Hart.Common
{
public class HartCfg : ComponentCfgBase, Generic.IComponentCfg, Config.Entities.IParamsProvider
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(HartCfg) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
static readonly int[] AllBaudRates = new int[] { 300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200 };
static readonly Parity[] AllParities = new Parity[] { Parity.None, Parity.Even, Parity.Odd };
static readonly int[] AllDataBits = new int[] { 7, 8 };
static readonly StopBits[] AllStopBits = new StopBits[] { StopBits.None, StopBits.One, StopBits.OnePointFive, StopBits.Two };
static readonly Handshake[] AllHandshakes = new Handshake[] { Handshake.None, Handshake.XOnXOff, Handshake.RequestToSend, Handshake.RequestToSendXOnXOff };
public IComponentCfgCtrl GetControl()
{
return new Configs.ParamsProvider.ComponentCfgCtrl(this, null);
}
///
/// Serialized parameters
///
public int ComPortNr;
public int BaudRate;
public int DataBits;
public Parity Parity;
public StopBits StopBits;
public Handshake Handshake;
/// Private parameterless constructor invoked by all other (public) constructors
HartCfg()
{
}
public HartCfg(string name, IComponentFactory factory)
: this()
{
Name = name;
Factory = factory;
ParentName = string.Empty;
InitializeAll();
}
public string ComponentName { get { return Name; } }
public void InitializeAll()
{
ComPortNr = 3;
BaudRate = 9600;
DataBits = 8;
Parity = System.IO.Ports.Parity.None;
StopBits = System.IO.Ports.StopBits.One;
Handshake = System.IO.Ports.Handshake.None;
}
string[] paramNames = new string[]
{
"Com port number",
"Baud rate",
"Data bits",
"Parity",
"Stop bits",
"Handshake"
};
public string ParamName(int i) { return paramNames[i]; }
public int ParamsCount() { return paramNames.Length; }
public IList<string> ParamValues(int i)
{
IList<string> list = new List<string>();
switch (i)
{
case 1: foreach (var v in AllBaudRates) list.Add(v.ToString()); break;
case 2: foreach (var v in AllDataBits) list.Add(v.ToString()); break;
case 3: foreach (var v in AllParities) list.Add(v.ToString()); break;
case 4: foreach (var v in AllStopBits) list.Add(v.ToString()); break;
case 5: foreach (var v in AllHandshakes) list.Add(v.ToString()); break;
default: return null;
}
return list;
}
public string ToString(int i)
{
if (i == -1)
{
return string.Format("Com{0}, {1}Bd, {2}-bits, parity={3}, stopBits={4}, {5}",
ComPortNr, BaudRate, DataBits, Parity, StopBits, Handshake);
}
switch (i)
{
case 0: return ComPortNr.ToString();
case 1: return BaudRate.ToString();
case 2: return DataBits.ToString();
case 3: return Parity.ToString();
case 4: return StopBits.ToString();
case 5: return Handshake.ToString();
default: return string.Empty;
}
}
public CfgUpdateFlags UpdateParam(int i, string strValue)
{
switch (i)
{
case 0:
if (ComPortNr != int.Parse(strValue))
{
ComPortNr = int.Parse(strValue);
return CfgUpdateFlags.RestartRqrd;
}
else
{
return CfgUpdateFlags.None;
}
case 1:
foreach (var v in AllBaudRates)
{
if ((strValue == v.ToString()) && (BaudRate != v))
{
BaudRate = v;
return CfgUpdateFlags.RestartRqrd;
}
}
return CfgUpdateFlags.None;
case 2:
foreach (var v in AllDataBits)
{
if ((strValue == v.ToString()) && (DataBits != v))
{
DataBits = v;
return CfgUpdateFlags.RestartRqrd;
}
}
return CfgUpdateFlags.None;
case 3:
foreach (var v in AllParities)
{
if ((strValue == v.ToString()) && (Parity != v))
{
Parity = v;
return CfgUpdateFlags.RestartRqrd;
}
}
return CfgUpdateFlags.None;
case 4:
foreach (var v in AllStopBits)
{
if ((strValue == v.ToString()) && (StopBits != v))
{
StopBits = v;
return CfgUpdateFlags.RestartRqrd;
}
}
return CfgUpdateFlags.None;
case 5:
foreach (var v in AllHandshakes)
{
if ((strValue == v.ToString()) && (Handshake != v))
{
Handshake = v;
return CfgUpdateFlags.RestartRqrd;
}
}
return CfgUpdateFlags.None;
default:
return CfgUpdateFlags.None;
}
}
public bool ValidateParam(int i, string strValue, out string message)
{
message = string.Empty;
switch (i)
{
case 0:
int comPortNr;
if (int.TryParse(strValue, out comPortNr) && comPortNr > 0 && comPortNr <= 999) return true;
break;
case 1:
foreach (var v in AllBaudRates) if (strValue == v.ToString()) return true;
break;
case 2:
foreach (var v in AllDataBits) if (strValue == v.ToString()) return true;
break;
case 3:
foreach (var v in AllParities) if (strValue == v.ToString()) return true;
break;
case 4:
foreach (var v in AllStopBits) if (strValue == v.ToString()) return true;
break;
case 5:
foreach (var v in AllHandshakes) if (strValue == v.ToString()) return true;
break;
default:
message = "Invalid index";
return false;
}
message = ParamName(i) + " is invalid";
return false;
}
void CopyContentTo(HartCfg prms)
{
prms.ParentName = this.ParentName;
prms.ComPortNr = this.ComPortNr;
prms.BaudRate = this.BaudRate;
prms.DataBits = this.DataBits;
prms.Parity = this.Parity;
prms.StopBits = this.StopBits;
prms.Handshake = this.Handshake;
}
public Config.Entities.IParamsProvider Clone()
{
HartCfg pars = new HartCfg();
CopyContentTo(pars);
return pars;
}
public void UpdateEmbeddedDbEntity()
{
/// Do nothing
}
}
}
@@ -0,0 +1,26 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System.Collections.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Hart.Nivotrack
{
public class Factory : IComponentFactory
{
public string ClassName { get { return this.GetType().Namespace.Substring(17); } }
public void ResetStaticProperties() { Nivotrack.ResetStaticProperties(); }
public IComponent DummyComponent() { return new Nivotrack(); }
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new Nivotrack(cfg); }
public IComponentCfg DefaultConfig() { return new NivotrackCfg(this.GetType().Namespace.Substring(17), this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(NivotrackCfg.Serializer, component, this);
}
}
}
@@ -0,0 +1,211 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Globalization;
using System.IO.Ports;
using System.Text;
using System.Threading;
using Config.Entities;
using log4net;
using TBF.BenchControl.Generic;
using TBF.Boxes;
namespace TBF.BenchControl.Hart.Nivotrack
{
/// <summary>
/// Root component for Modbus communication via serial port (RS485)
/// </summary>
public class Nivotrack : ComponentBase, IDevice, GenericDevices.IHart
{
private static readonly ILog log = LogManager.GetLogger(typeof(Nivotrack));
public override string ToString() { return string.Format("Modbus({0})", Cfg.ToString(1)); }
private readonly NivotrackCfg modbusCommonCfg;
/// Private fields
SerialPort serialPort;
DateTime lastSerialPortWrite;
public Queue<byte[]>[] ReceivedTelegrams
{
get { return receivedTelegrams; }
}
Queue<byte[]>[] receivedTelegrams;
Queue<byte[]> telegramsToSend;
public Nivotrack()
{
}
/// <summary>
/// Ambient temperature / humidity / pressure meter 'Greco' connected via serial interface (RS232)
/// Connection settings: 19200 Bd 8-bits No-parity 1-stop-bit Flow control: none or hardware.
/// </summary>
public Nivotrack(Generic.IComponentCfg cfg)
: base(cfg)
{
receivedTelegrams = new Queue<byte[]>[256];
for (int i = 0; i < receivedTelegrams.Length; i++)
{
receivedTelegrams[i] = new Queue<byte[]>();
}
telegramsToSend = new Queue<byte[]>();
serialPort = null;
modbusCommonCfg = cfg as NivotrackCfg;
log.Debug(this.ToString());
}
~Nivotrack()
{
}
public void Initialize()
{
if (modbusCommonCfg.DebugLevel == DebugMode.Simulate)
{
serialPort = null;
log.FatalFormat("{0} - Device simulated", Name);
return;
}
string comPortName = "COM" + modbusCommonCfg.ComPortNr.ToString();
serialPort = new SerialPort(comPortName, modbusCommonCfg.BaudRate, modbusCommonCfg.Parity, modbusCommonCfg.DataBits, modbusCommonCfg.StopBits);
serialPort.Handshake = modbusCommonCfg.Handshake;
serialPort.Open();
//stopWorkerThread = false;
//workerThread = new Thread(Worker);
//workerThread.Start();
log.FatalFormat("{0} - Device successfully initialized", Name);
}
/// <summary>
/// Send an arbitrary modbus message.
/// When the message length is N, however only bytes 1..N-2 have to be set.
/// The last two message bytes (CRC) may be uninitialized or zero.
/// They are calculated inside this function as required by Modbus specification.
/// </summary>
/// <param name="message">Message incl CRC fields, CRC bytes dont have to be set</param>
public void SendMessage(byte[] message)
{
if (serialPort == null) return;
Telegram.UpdateTelegramCRC(message);
if ((DateTime.Now - lastSerialPortWrite) > new TimeSpan(0, 0, 0, 0, 100))
{
/// More then 100 ms since last 'send' --> do not enqueue the message
SendMessageNow(message);
}
else
{
telegramsToSend.Enqueue(message);
string s = Telegram.LogTelegram(string.Format("{0} - Enqueueing message ", Name), message);
Debug.WriteLine(s);
log.Debug(s);
}
}
/// <summary>
/// Send a structured modbus message.
/// </summary>
/// <param name="modbusAddress">Device address (1..255) or 0 = broadcast</param>
/// <param name="function">Function (0..127)</param>
/// <param name="dataAddress">Address of data to be transferred (0..65535)</param>
/// <param name="dataCount">Count of data bytes to be transferred (0..65535)</param>
public void SendMessage(byte modbusAddress, byte function, ushort dataAddress, ushort dataCount)
{
if (serialPort == null) return;
byte[] message = new byte[8]
{
modbusAddress,
function,
(byte)(dataAddress / 256),
(byte)(dataAddress % 256),
(byte)(dataCount / 256),
(byte)(dataCount % 256),
0,
0,
};
SendMessage(message);
}
public void SendMessageNow(byte[] message)
{
serialPort.Write(message, 0, message.Length);
lastSerialPortWrite = DateTime.Now;
string s = Telegram.LogTelegram(string.Format("{0} - Sending message ", Name), message);
Debug.WriteLine(s);
log.Debug(s);
}
/// <summary>Run this device</summary>
public void RunDeviceBefore()
{
if (serialPort == null) return;
int nrBytes = serialPort.BytesToRead;
if (nrBytes > 0)
{
byte[] buffer = new byte[nrBytes];
serialPort.Read(buffer, 0, nrBytes);
int deviceAddress = (nrBytes >= 1) ? buffer[0] : 0;
int function = (nrBytes >= 2) ? buffer[1] : 0;
if ((nrBytes >= 4) && Telegram.VerifyTelegramCRC(buffer))
{
receivedTelegrams[deviceAddress].Enqueue(buffer);
string s = string.Format("{0} - {1} address={2} count={3}", Name, Telegram.LogTelegram("Telegram received: ", buffer), deviceAddress, receivedTelegrams[deviceAddress].Count);
Debug.WriteLine(s);
log.Debug(s);
}
else
{
string s = Telegram.LogTelegram(string.Format("{0} - Invalid data received ", Name), buffer);
Debug.WriteLine(s);
log.Debug(s);
}
}
}
/// <summary>Run this device</summary>
public void RunDeviceAfter()
{
if (serialPort == null) return;
if (telegramsToSend.Count > 0 && (DateTime.Now - lastSerialPortWrite) > new TimeSpan(0, 0, 0, 0, 500))
{
SendMessageNow(telegramsToSend.Dequeue());
}
}
/// <summary>Stop this device</summary>
public void StopDevice()
{
if (serialPort != null)
{
//stopWorkerThread = true;
//workerThread.Join(2000);
serialPort.Close();
serialPort = null;
}
}
public void StopDevice2() { }
}
}
@@ -0,0 +1,248 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System.IO;
using System.Collections.Generic;
using System.IO.Ports;
using System.Xml.Serialization;
using Config.Entities;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Hart.Nivotrack
{
public class NivotrackCfg : ComponentCfgBase, Generic.IComponentCfg, Config.Entities.IParamsProvider
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(NivotrackCfg) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
static readonly int[] AllBaudRates = new int[] { 300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 57600, 115200 };
static readonly Parity[] AllParities = new Parity[] { Parity.None, Parity.Even, Parity.Odd };
static readonly int[] AllDataBits = new int[] { 7, 8 };
static readonly StopBits[] AllStopBits = new StopBits[] { StopBits.None, StopBits.One, StopBits.OnePointFive, StopBits.Two };
static readonly Handshake[] AllHandshakes = new Handshake[] { Handshake.None, Handshake.XOnXOff, Handshake.RequestToSend, Handshake.RequestToSendXOnXOff };
public IComponentCfgCtrl GetControl()
{
return new Configs.ParamsProvider.ComponentCfgCtrl(this, null);
}
///
/// Serialized parameters
///
public int ComPortNr;
public int BaudRate;
public int DataBits;
public Parity Parity;
public StopBits StopBits;
public Handshake Handshake;
/// Private parameterless constructor invoked by all other (public) constructors
NivotrackCfg()
{
}
public NivotrackCfg(string name, IComponentFactory factory)
: this()
{
Name = name;
Factory = factory;
ParentName = string.Empty;
InitializeAll();
}
public string ComponentName { get { return Name; } }
public void InitializeAll()
{
ComPortNr = 3;
BaudRate = 9600;
DataBits = 8;
Parity = System.IO.Ports.Parity.None;
StopBits = System.IO.Ports.StopBits.One;
Handshake = System.IO.Ports.Handshake.None;
}
string[] paramNames = new string[]
{
"Com port number",
"Baud rate",
"Data bits",
"Parity",
"Stop bits",
"Handshake"
};
public string ParamName(int i) { return paramNames[i]; }
public int ParamsCount() { return paramNames.Length; }
public IList<string> ParamValues(int i)
{
IList<string> list = new List<string>();
switch (i)
{
case 1: foreach (var v in AllBaudRates) list.Add(v.ToString()); break;
case 2: foreach (var v in AllDataBits) list.Add(v.ToString()); break;
case 3: foreach (var v in AllParities) list.Add(v.ToString()); break;
case 4: foreach (var v in AllStopBits) list.Add(v.ToString()); break;
case 5: foreach (var v in AllHandshakes) list.Add(v.ToString()); break;
default: return null;
}
return list;
}
public string ToString(int i)
{
if (i == -1)
{
return string.Format("Com{0}, {1}Bd, {2}-bits, parity={3}, stopBits={4}, {5}",
ComPortNr, BaudRate, DataBits, Parity, StopBits, Handshake);
}
switch (i)
{
case 0: return ComPortNr.ToString();
case 1: return BaudRate.ToString();
case 2: return DataBits.ToString();
case 3: return Parity.ToString();
case 4: return StopBits.ToString();
case 5: return Handshake.ToString();
default: return string.Empty;
}
}
public CfgUpdateFlags UpdateParam(int i, string strValue)
{
switch (i)
{
case 0:
if (ComPortNr != int.Parse(strValue))
{
ComPortNr = int.Parse(strValue);
return CfgUpdateFlags.RestartRqrd;
}
else
{
return CfgUpdateFlags.None;
}
case 1:
foreach (var v in AllBaudRates)
{
if ((strValue == v.ToString()) && (BaudRate != v))
{
BaudRate = v;
return CfgUpdateFlags.RestartRqrd;
}
}
return CfgUpdateFlags.None;
case 2:
foreach (var v in AllDataBits)
{
if ((strValue == v.ToString()) && (DataBits != v))
{
DataBits = v;
return CfgUpdateFlags.RestartRqrd;
}
}
return CfgUpdateFlags.None;
case 3:
foreach (var v in AllParities)
{
if ((strValue == v.ToString()) && (Parity != v))
{
Parity = v;
return CfgUpdateFlags.RestartRqrd;
}
}
return CfgUpdateFlags.None;
case 4:
foreach (var v in AllStopBits)
{
if ((strValue == v.ToString()) && (StopBits != v))
{
StopBits = v;
return CfgUpdateFlags.RestartRqrd;
}
}
return CfgUpdateFlags.None;
case 5:
foreach (var v in AllHandshakes)
{
if ((strValue == v.ToString()) && (Handshake != v))
{
Handshake = v;
return CfgUpdateFlags.RestartRqrd;
}
}
return CfgUpdateFlags.None;
default:
return CfgUpdateFlags.None;
}
}
public bool ValidateParam(int i, string strValue, out string message)
{
message = string.Empty;
switch (i)
{
case 0:
int comPortNr;
if (int.TryParse(strValue, out comPortNr) && comPortNr > 0 && comPortNr <= 999) return true;
break;
case 1:
foreach (var v in AllBaudRates) if (strValue == v.ToString()) return true;
break;
case 2:
foreach (var v in AllDataBits) if (strValue == v.ToString()) return true;
break;
case 3:
foreach (var v in AllParities) if (strValue == v.ToString()) return true;
break;
case 4:
foreach (var v in AllStopBits) if (strValue == v.ToString()) return true;
break;
case 5:
foreach (var v in AllHandshakes) if (strValue == v.ToString()) return true;
break;
default:
message = "Invalid index";
return false;
}
message = ParamName(i) + " is invalid";
return false;
}
void CopyContentTo(NivotrackCfg prms)
{
prms.ParentName = this.ParentName;
prms.ComPortNr = this.ComPortNr;
prms.BaudRate = this.BaudRate;
prms.DataBits = this.DataBits;
prms.Parity = this.Parity;
prms.StopBits = this.StopBits;
prms.Handshake = this.Handshake;
}
public Config.Entities.IParamsProvider Clone()
{
NivotrackCfg pars = new NivotrackCfg();
CopyContentTo(pars);
return pars;
}
public void UpdateEmbeddedDbEntity()
{
/// Do nothing
}
}
}
@@ -31,9 +31,9 @@ namespace TBF.BenchControl.Modbus.CometAmbient
///
/// Measured values when MsrmntState == MsrmntState.Valid
///
float temperature; /// [deg C]
float temperature; /// [°C]
float pressure; /// [bar]
float humidity; /// [%]
float humidity; /// [R%]
/// <summary>Measurement time stamp when MsrmntState == MsrmntState.Valid</summary>
int msrmntTimeStamp;
+54
View File
@@ -0,0 +1,54 @@
///
/// Copyright (c) 2015-2016 Sensus Metering Systems
///
using System.IO;
using System.Collections.Generic;
using System.IO.Ports;
using System.Xml.Serialization;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Modbus.Common
{
public class HartCfg : ComponentCfgBase, Generic.IComponentCfg
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(HartCfg) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl() { return new ModbusCfgCtrl(); }
///
/// Serialized parameters
///
public int ComPortNr;
public int BaudRate;
public Parity Parity;
public int DataBits;
public StopBits StopBits;
public Handshake Handshake;
/// Private parameterless constructor invoked by all other (public) constructors
HartCfg()
{
Name = "Modbus";
ParentName = string.Empty;
ComPortNr = 3;
BaudRate = 9600;
Parity = System.IO.Ports.Parity.None;
DataBits = 8;
StopBits = System.IO.Ports.StopBits.One;
Handshake = System.IO.Ports.Handshake.None;
}
public HartCfg(IComponentFactory factory)
: this()
{
this.Factory = factory;
}
public string ToString(int i)
{
return string.Format("Name={0}, Com{1}, {2}Bd, {3}-bits, parity={4}, stopBits={5}, {6}",
Name, ComPortNr, BaudRate, DataBits, Parity, StopBits, Handshake);
}
}
}
@@ -0,0 +1,26 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System.Collections.Generic;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Modbus.UltrasoundLevelMeter
{
public class Factory : IComponentFactory
{
public string ClassName { get { return this.GetType().Namespace.Substring(17); } }
public void ResetStaticProperties() { LevelMeter.ResetStaticProperties(); }
public IComponent DummyComponent() { return new LevelMeter(); }
public IComponent GetComponent(IComponentCfg cfg, IList<IComponent> components) { return new LevelMeter(cfg, components); }
public IComponentCfg DefaultConfig() { return new LevelMeterCfg(this); }
public IComponentCfg CmpntCfgFromCmpntEntity(Config.Entities.Component component)
{
return ComponentCfgBase.CreateFromDbEntity(LevelMeterCfg.Serializer, component, this);
}
}
}
@@ -0,0 +1,119 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using log4net;
using TBF.BenchControl.Generic;
using TBF.Boxes;
namespace TBF.BenchControl.Modbus.UltrasoundLevelMeter
{
public class LevelMeter : ComponentBase, GenericDevices.IPressureMeter, IDevice
{
private static readonly ILog log = LogManager.GetLogger(typeof(LevelMeter));
public override string ToString() { return string.Format("LevelMeter({0})", Cfg.ToString(1)); }
readonly LevelMeterCfg myCfg;
readonly GenericDevices.IModbus modbus;
private float receivedLevel;
const ushort WatchdogBitMask = 0x0010;
public LevelMeter()
{
}
public LevelMeter(Generic.IComponentCfg cfg, IList<Generic.IComponent> components)
: base(cfg)
{
myCfg = cfg as LevelMeterCfg;
modbus = (GenericDevices.IModbus)TbfComponents.FindComponent(cfg.ParentName, components);
if (modbus == null) throw new Exception("Cannot find " + Name + " parent");
/// Connect to handler
//ModbusAddress.MeretRS485Address[Idx0] = ModbusAddress;
log.Debug(this.ToString());
}
/// <summary>Initialize this device</summary>
public void Initialize()
{
}
/// <summary>
/// Returns the water pressure
/// </summary>
/// <returns>Pressure in mBar</returns>
public float ReadLevel()
{
return (float)Config.Units.ConvertFrom(Config.Unit.mm, receivedLevel);
}
/// <summary>
/// Events: PressureDone, Error
/// </summary>
/// <param name="pressure">Reference to a variable for the pressure in Bar</param>
/// <returns>ReadPressureOp instance reference casted to IOperaton</returns>
public IOperation ReadPressureOp(ref FloatBox pressure)
{
return new ReadLevelOp(this, ref pressure);
}
/// <summary>
/// Events: pressureDone, Error
/// </summary>
/// <param name="pressure">Reference to a variable for the pressure in Bar</param>
/// <param name="pressureDone">Event returned when measurement done</param>
/// <returns>ReadPressureOp instance reference casted to IOperaton</returns>
public IOperation ReadPressureOp(ref FloatBox pressure, Event pressureDone)
{
return new ReadLevelOp(this, ref pressure, pressureDone);
}
/// <summary>Run this device</summary>
public void RunDeviceBefore()
{
if (myCfg.DebugLevel == Config.Entities.DebugMode.Simulate ||
myCfg.DebugLevel == Config.Entities.DebugMode.FailureDuringOperation)
{
return;
}
if (modbus.ReceivedTelegrams[myCfg.ModbusAddress].Count > 0)
{
byte[] telegram = modbus.ReceivedTelegrams[myCfg.ModbusAddress].Dequeue();
if (telegram.Length == 9 && telegram[1] == 4 && telegram[2] == 4)
{
/// Swap byte order
byte t1 = telegram[3];
byte t2 = telegram[4];
byte t3 = telegram[5];
byte t4 = telegram[6];
telegram[3] = t4;
telegram[4] = t3;
telegram[5] = t2;
telegram[6] = t1;
receivedLevel = System.BitConverter.ToSingle(telegram, 3);
}
}
if ((StateMachine.Time % 3) == (myCfg.ModbusAddress % 3)) /// Each 3 seconds
{
const byte Function = 4; /// Read input registers
const ushort Address = 0; /// Pressure
modbus.SendMessage(myCfg.ModbusAddress, Function, Address, 2);
}
}
public void RunDeviceAfter() { }
public void StopDevice() { }
public void StopDevice2() { }
}
}
@@ -0,0 +1,144 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System;
using System.Collections.Generic;
using System.IO;
using System.Xml.Serialization;
using Config.Entities;
using TBF.BenchControl.Generic;
namespace TBF.BenchControl.Modbus.UltrasoundLevelMeter
{
public class LevelMeterCfg : ComponentCfgBase, Generic.IChildComponentCfg, Config.Entities.IParamsProvider
{
public static XmlSerializer Serializer = XmlSerializer.FromTypes(new[] { typeof(LevelMeterCfg) })[0];
public override XmlSerializer GetSerializer() { return Serializer; }
public IComponentCfgCtrl GetControl()
{
IList<string> parents = new List<string>();
// TODO:
//if (StateMachine.Components != null)
//{
// foreach (var cmpnt in StateMachine.Components)
// {
// if (TbfComponents.CmpntFactoryFromClassName(cmpnt.ClassName) is TBF.BenchControl.Modbus.Common.Factory)
// {
// parents.Add(cmpnt.Name);
// }
// }
//}
parents.Add("Modbus");
return new Configs.ParamsProvider.ComponentCfgCtrl(this, parents);
}
///
/// Serialized parameters
///
public byte ModbusAddress; /// 1..255
/// Private parameterless constructor invoked by all other (public) constructors
LevelMeterCfg() {}
public LevelMeterCfg(IComponentFactory factory)
: this()
{
Factory = factory;
Name = "ULM";
ParentName = "Modbus";
InitializeAll();
}
public string ComponentName { get { return Name; } }
public void InitializeAll()
{
ModbusAddress = 49;
}
string[] paramNames = new string[]
{
"Modbus address",
};
public string ParamName(int i) { return paramNames[i]; }
public int ParamsCount() { return paramNames.Length; }
public IList<string> ParamValues(int i) { return null; }
public string ToString(int i)
{
if (i == -1)
{
return string.Format("ModbusAddr={0}", ModbusAddress);
}
switch (i)
{
case 0: return ModbusAddress.ToString();
default: return string.Empty;
}
}
public CfgUpdateFlags UpdateParam(int i, string strValue)
{
switch (i)
{
case 0:
byte addr = byte.Parse(strValue);
if (ModbusAddress != addr)
{
ModbusAddress = addr;
return CfgUpdateFlags.RestartRqrd;
}
else
{
return CfgUpdateFlags.None;
}
default:
return CfgUpdateFlags.None;
}
}
public bool ValidateParam(int i, string strValue, out string message)
{
message = string.Empty;
int dummy;
switch (i)
{
case 0:
if (int.TryParse(strValue, out dummy) && dummy >= 0 && dummy <= 255) return true;
break;
default:
message = "Invalid index";
return false;
}
message = ParamName(i) + " is invalid";
return false;
}
void CopyContentTo(LevelMeterCfg prms)
{
prms.ParentName = this.ParentName;
prms.ModbusAddress = this.ModbusAddress;
}
public Config.Entities.IParamsProvider Clone()
{
LevelMeterCfg pars = new LevelMeterCfg();
CopyContentTo(pars);
return pars;
}
public void UpdateEmbeddedDbEntity()
{
/// Do nothing
}
}
}
@@ -0,0 +1,64 @@
///
/// Copyright (c) 2018 Sensus Slovensko a.s.
///
using System;
using log4net;
using TBF.Boxes;
namespace TBF.BenchControl.Modbus.UltrasoundLevelMeter
{
public class ReadLevelOp : IOperation
{
private static readonly ILog log = LogManager.GetLogger(typeof(ReadLevelOp));
public override string ToString() { return string.Format("ReadLevelOp(.,{0},.)", eventDone); }
/// Set by the constructor
readonly LevelMeter levelMeter;
readonly Event eventDone;
/// Measured value
FloatBox level;
/// <summary>
/// Events: PressureInDone, PressureOutDone or Error
/// </summary>
/// <param name="levelMeter">Pressure meter reference</param>
/// <param name="pressure">Reference to the measured pressure variable, value is in bar</param>
/// <param name="eventDone">Event to be returned by Run() when completed OK</param>
public ReadLevelOp(LevelMeter levelMeter, ref FloatBox pressure, Event eventDone)
{
if (levelMeter == null) throw new ArgumentNullException("levelMeter");
this.levelMeter = levelMeter;
this.level = pressure;
this.eventDone = eventDone;
log.Debug(this.ToString());
}
public ReadLevelOp(LevelMeter pressureMeter, ref FloatBox pressure)
: this(pressureMeter, ref pressure, Event.PressureDone)
{
}
/// <summary>Start this operation</summary>
public void Start()
{
level.Val = levelMeter.ReadLevel();
}
/// <summary>Run this operation</summary>
/// <returns>
/// Event.PressureInDone or Event.PressureOutDone
/// </returns>
public Event Run()
{
level.Val = levelMeter.ReadLevel();
return eventDone;
}
/// <summary>Stop this operation</summary>
public void Stop()
{
}
}
}
+48 -2
View File
@@ -4,13 +4,16 @@
using System;
using System.Drawing;
using System.Windows.Forms;
using log4net;
using TBF.Resources;
namespace TBF.BenchControl.Operations
{
public partial class AskYesNoForm : Form
{
/// One of the following two variables set to 'true' when the form closes
static readonly ILog log = LogManager.GetLogger(typeof(MessageBoxForm));
/// One of the following two variables set to 'true' when the form closes
public bool CompletedYes;
public bool CompletedNo;
@@ -33,6 +36,10 @@ namespace TBF.BenchControl.Operations
yesButton.Left += shift;
noButton.Left += shift;
}
CompletedYes = false;
CompletedNo = false;
StartForceCloseHandler();
}
void Localize()
@@ -53,5 +60,44 @@ namespace TBF.BenchControl.Operations
CompletedNo = true;
Close();
}
}
#region Forced close handling
/// <summary>
/// Used by CoverTest, AskYesNoOp and MessageBoxOp.
/// </summary>
public void OnCloseThisForm(object sender, EventArgs args)
{
if (CloseThisFormHandler == null) return;
try
{
CloseThisFormHandler(sender, null);
}
catch (Exception e)
{
log.Error("CloseThisFormHandler(...) failed", e);
}
}
public event EventHandler<EventArgs> CloseThisFormHandler;
public void StartForceCloseHandler()
{
CloseThisFormHandler += delegate(object sender, EventArgs args)
{
if (InvokeRequired)
Invoke(new EventHandler<EventArgs>(OnForceClose), sender, args);
else
OnForceClose(sender, args);
};
}
private void OnForceClose(object sender, EventArgs args)
{
DialogResult = DialogResult.Cancel;
Close();
}
#endregion
}
}
+11 -7
View File
@@ -10,7 +10,7 @@ namespace TBF.BenchControl.Operations
{
public class AskYesNoOp : IOperation
{
AskYesNoForm modelessDlg;
AskYesNoForm askYesNoForm;
string question;
@@ -29,8 +29,8 @@ namespace TBF.BenchControl.Operations
///
void OpenFormDlg(AskYesNoOp myRef)
{
myRef.modelessDlg = new AskYesNoForm(question);
modelessDlg.Show();
myRef.askYesNoForm = new AskYesNoForm(question);
askYesNoForm.Show();
}
/// <summary>Start this operation</summary>
@@ -43,15 +43,19 @@ namespace TBF.BenchControl.Operations
/// <returns>Event.ResultsPrinted</returns>
public Event Run()
{
if (modelessDlg.CompletedYes) return Event.Yes;
if (modelessDlg.CompletedNo) return Event.No;
if (askYesNoForm.CompletedYes) return Event.Yes;
if (askYesNoForm.CompletedNo) return Event.No;
return Event.None;
}
/// <summary>Stop this operation</summary>
public void Stop()
{
modelessDlg = null;
}
if (askYesNoForm != null)
{
askYesNoForm.OnCloseThisForm(this, null);
askYesNoForm = null;
}
}
}
}
+3
View File
@@ -66,10 +66,13 @@ namespace TBF.BenchControl.Operations
this.Controls.Add(this.messageLabel);
this.Controls.Add(this.okButton);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "MessageBoxForm";
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.TopMost = true;
this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MessageBoxForm_FormClosing);
this.ResumeLayout(false);
this.PerformLayout();
+33 -5
View File
@@ -4,12 +4,15 @@
using System;
using System.Drawing;
using System.Windows.Forms;
using log4net;
using TBF.Resources;
namespace TBF.BenchControl.Operations
{
public partial class MessageBoxForm : Form, GenericDevices.IHasCompleted
public partial class MessageBoxForm : Form
{
static readonly ILog log = LogManager.GetLogger(typeof(MessageBoxForm));
/// Set to 'true' when the form closes
public bool Completed { get { return completed; } }
bool completed;
@@ -18,7 +21,7 @@ namespace TBF.BenchControl.Operations
public MessageBoxForm(string message, Color backgroundColor)
{
InitializeComponent();
ControlBox = false;
//ControlBox = false;
Localize();
messageLabel.Text = message;
@@ -49,14 +52,39 @@ namespace TBF.BenchControl.Operations
Close();
}
private void MessageBoxForm_FormClosing(object sender, FormClosingEventArgs e)
{
completed = true;
}
#region Forced close handling
/// <summary>
/// Used by CoverTest, AskYesNoOp and MessageBoxOp.
/// </summary>
public void OnCloseThisForm(object sender, EventArgs args)
{
if (CloseThisFormHandler == null) return;
try
{
CloseThisFormHandler(sender, null);
}
catch (Exception e)
{
log.Error("CloseThisFormHandler(...) failed", e);
}
}
public event EventHandler<EventArgs> CloseThisFormHandler;
public void StartForceCloseHandler()
{
UiBridge.Bridge.CloseQandAFormHandler += delegate(object sender, EventArgs args)
CloseThisFormHandler += delegate(object sender, EventArgs args)
{
if (InvokeRequired) { Invoke(new EventHandler<EventArgs>(OnForceClose), sender, args); }
else OnForceClose(sender, args);
if (InvokeRequired)
Invoke(new EventHandler<EventArgs>(OnForceClose), sender, args);
else
OnForceClose(sender, args);
};
}
+8 -8
View File
@@ -11,7 +11,7 @@ namespace TBF.BenchControl.Operations
{
public class MessageBoxOp : IOperation
{
MessageBoxForm modelessDlg;
MessageBoxForm messageBoxForm;
string message;
Color backColor;
@@ -38,8 +38,8 @@ namespace TBF.BenchControl.Operations
///
void OpenFormDlg(MessageBoxOp myRef)
{
myRef.modelessDlg = new MessageBoxForm(message, backColor);
modelessDlg.Show();
myRef.messageBoxForm = new MessageBoxForm(message, backColor);
messageBoxForm.Show();
}
/// <summary>Start this operation</summary>
@@ -53,10 +53,10 @@ namespace TBF.BenchControl.Operations
/// <returns>Event.ResultsPrinted</returns>
public Event Run()
{
if (completed || modelessDlg.Completed)
if (completed || messageBoxForm.Completed)
{
completed = true;
modelessDlg = null;
messageBoxForm = null;
return Event.OK;
}
@@ -66,10 +66,10 @@ namespace TBF.BenchControl.Operations
/// <summary>Stop this operation</summary>
public void Stop()
{
if (modelessDlg is GenericDevices.IHasCompleted)
if (messageBoxForm != null)
{
UiBridge.Bridge.OnCloseQandAForm(this, null);
modelessDlg = null;
messageBoxForm.OnCloseThisForm(this, null);
messageBoxForm = null;
}
}
}
@@ -3,7 +3,7 @@
///
using System;
namespace TBF.BenchControl.Output.DB.ProductionMonitoring
namespace TBF.BenchControl.Output.DB.ProductionTracing
{
public enum CodeType
{

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