Compare commits

..
Author SHA1 Message Date
michal d3acd5ebb3 Working NfcC7_DLL, tests, clean up
"Remove unused NfcHanler classes and utilities"

This commit deletes several obsolete and unused files from the NfcHanler directory, including utility classes, enums, and a large command handling class. This cleanup improves code maintainability by eliminating unnecessary dependencies and clutter.
2025-10-14 13:15:30 +02:00
michal d2ca40d151 Add initial implementation for AppDiagnostic project
This commit introduces the AppDiagnostic project structure, including core components like `MainForm`, logging utilities (`LogAdapter`, `LogFilter`), and configuration files. It integrates with `log4net` for logging and uses `SharedComponents` for shared utilities.
2025-09-07 22:13:57 +02:00
michal 64bfe937fa Add FluentNHibernate and log4net dependencies
This commit restores the FluentNHibernate package in various configurations and adds log4net references across multiple projects for enhanced logging. Additionally, several exceptions were reformatted to use `string.Format` for consistency. Updates to the solution structure and new configuration files support these changes.
2025-01-23 16:50:14 +01:00
michal 1440e08341 Remove outdated NHibernate and FluentNHibernate config files
Deleted deprecated configuration files related to FireBird and FluentNHibernate. These files are no longer required for the project and their removal helps streamline the codebase, reducing clutter and potential confusion.
2025-01-16 15:44:01 +01:00
michal 3da36187f9 Add IntelliJ config and gitignore files for projects
Introduce `.idea` configuration files and `.gitignore` entries for `NfcS5_DLL` and `TBF` projects. These changes include settings for encodings, VCS mappings, and index layout configurations. Helps streamline project setup and improve tooling compatibility.
2024-12-22 12:32:34 +01:00
Jan Augustin 13bf73104f Ingo Fritz - Add rest client for security server 2024-07-25 12:14:58 +02:00
Jan Augustin 334d43fbda Manuel Stein:
added errormessages (in method MCI_TxRequest_RxResponse, for better NFC error analysis)
CRC check included. If the meter CRC doesn't match the calculated CRC an error is returned.
removed method MCI_Raw_Read/write (same as MCI_Read/Write, which autoselects the correct password)
Refactoring
more detailed errorcodes(no more unidentified, separated host (>=20) and Meter messages (0..8))
2024-04-05 13:44:07 +02:00
Jan Augustin 2405a49dcc Nfc S4.5 DLL - Initial commit 2024-02-07 11:14:20 +01:00
1057 changed files with 3158 additions and 293375 deletions
+7 -7
View File
@@ -1,7 +1,7 @@
TestBenchFramework/bin/
TestBenchFramework/obj/
ResultsBrowser/bin/
ResultsBrowser/obj/
TBFSetup/
Doc/
*.suo
bin/
obj/
.vs/
*.suo
*.bak
*.pdb
+13
View File
@@ -0,0 +1,13 @@
# Default ignored files
/shelf/
/workspace.xml
# Rider ignored files
/projectSettingsUpdater.xml
/.idea.NfcS5_DLL.iml
/modules.xml
/contentModel.xml
# Editor-based HTTP Client requests
/httpRequests/
# Datasource local storage ignored files
/dataSources/
/dataSources.local.xml
+4
View File
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="Encoding" addBOMForNewFiles="with BOM under Windows, with no BOM otherwise" />
</project>
+8
View File
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="UserContentModel">
<attachedFolders />
<explicitIncludes />
<explicitExcludes />
</component>
</project>
+6
View File
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="" vcs="Git" />
</component>
</project>
+10
View File
@@ -0,0 +1,10 @@
<?xml version="1.0" encoding="utf-8"?><configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="NHibernate" publicKeyToken="aa95f207798dfdb4" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.5.0.0" newVersion="5.5.0.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>
-525
View File
@@ -1,525 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<diagram program="umlet" version="12.2">
<zoom_level>8</zoom_level>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>0</y>
<w>40</w>
<h>64</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;48;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.InitialState</type>
<coordinates>
<x>416</x>
<y>8</y>
<w>16</w>
<h>16</h>
</coordinates>
<panel_attributes>i</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.custom.State</type>
<coordinates>
<x>328</x>
<y>48</y>
<w>192</w>
<h>32</h>
</coordinates>
<panel_attributes>'Test Start' transition sequence</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>56</y>
<w>40</w>
<h>56</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;40;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.RegionEndState</type>
<coordinates>
<x>416</x>
<y>96</y>
<w>16</w>
<h>16</h>
</coordinates>
<panel_attributes/>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>88</y>
<w>40</w>
<h>56</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;40;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.State</type>
<coordinates>
<x>344</x>
<y>128</y>
<w>160</w>
<h>32</h>
</coordinates>
<panel_attributes>Initialize (single) test results</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>136</y>
<w>40</w>
<h>56</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;40;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.Decision</type>
<coordinates>
<x>408</x>
<y>176</y>
<w>32</w>
<h>32</h>
</coordinates>
<panel_attributes/>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>184</y>
<w>40</w>
<h>56</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;40;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.Decision</type>
<coordinates>
<x>408</x>
<y>224</y>
<w>32</w>
<h>32</h>
</coordinates>
<panel_attributes/>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.custom.RegionEndState</type>
<coordinates>
<x>416</x>
<y>272</y>
<w>16</w>
<h>16</h>
</coordinates>
<panel_attributes/>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>232</y>
<w>40</w>
<h>56</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;40;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>264</y>
<w>40</w>
<h>56</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;40;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.State</type>
<coordinates>
<x>344</x>
<y>304</y>
<w>160</w>
<h>32</h>
</coordinates>
<panel_attributes>Make the water tank empty</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>312</y>
<w>40</w>
<h>56</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;40;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.RegionEndState</type>
<coordinates>
<x>416</x>
<y>352</y>
<w>16</w>
<h>16</h>
</coordinates>
<panel_attributes/>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>344</y>
<w>40</w>
<h>56</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;40;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>272</x>
<y>168</y>
<w>160</w>
<h>128</h>
</coordinates>
<panel_attributes>lt=&lt;-
m2=[Emptying always]</panel_attributes>
<additional_attributes>144;112;24;112;24;24;136;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>408</x>
<y>216</y>
<w>176</w>
<h>160</h>
</coordinates>
<panel_attributes>lt=&lt;-
m2=[Enough room in tank]</panel_attributes>
<additional_attributes>24;144;160;144;160;24;32;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.State</type>
<coordinates>
<x>344</x>
<y>384</y>
<w>160</w>
<h>32</h>
</coordinates>
<panel_attributes>Set the required water flow</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>392</y>
<w>40</w>
<h>56</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;40;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.State</type>
<coordinates>
<x>328</x>
<y>432</y>
<w>192</w>
<h>32</h>
</coordinates>
<panel_attributes>Measure the 'start' mass of water</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>440</y>
<w>40</w>
<h>56</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;40;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.State</type>
<coordinates>
<x>344</x>
<y>480</y>
<w>160</w>
<h>32</h>
</coordinates>
<panel_attributes>Start the test (diverter, etc.)</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>488</y>
<w>40</w>
<h>56</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;40;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.RegionEndState</type>
<coordinates>
<x>416</x>
<y>528</y>
<w>16</w>
<h>16</h>
</coordinates>
<panel_attributes/>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.custom.State</type>
<coordinates>
<x>344</x>
<y>560</y>
<w>160</w>
<h>32</h>
</coordinates>
<panel_attributes>Read intermediate results</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>520</y>
<w>40</w>
<h>56</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;40;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>568</y>
<w>40</w>
<h>56</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;40;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.Decision</type>
<coordinates>
<x>408</x>
<y>608</y>
<w>32</w>
<h>32</h>
</coordinates>
<panel_attributes/>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>272</x>
<y>512</y>
<w>160</w>
<h>128</h>
</coordinates>
<panel_attributes>lt=&lt;-
m2=[Test in progress]</panel_attributes>
<additional_attributes>144;24;24;24;24;112;136;112</additional_attributes>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>616</y>
<w>40</w>
<h>64</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;48;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.Text</type>
<coordinates>
<x>424</x>
<y>640</y>
<w>104</w>
<h>24</h>
</coordinates>
<panel_attributes>[Test completed]</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.custom.State</type>
<coordinates>
<x>328</x>
<y>664</y>
<w>192</w>
<h>32</h>
</coordinates>
<panel_attributes>Measure the 'end' mass of water</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.custom.State</type>
<coordinates>
<x>328</x>
<y>712</y>
<w>192</w>
<h>32</h>
</coordinates>
<panel_attributes>Calculate and save this test results</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>672</y>
<w>40</w>
<h>56</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;40;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>720</y>
<w>40</w>
<h>56</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;40;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.Decision</type>
<coordinates>
<x>408</x>
<y>760</y>
<w>32</w>
<h>32</h>
</coordinates>
<panel_attributes/>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>768</y>
<w>40</w>
<h>64</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;48;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>408</x>
<y>80</y>
<w>216</w>
<h>712</h>
</coordinates>
<panel_attributes>lt=&lt;-
m2=[More repetitions to be done]</panel_attributes>
<additional_attributes>24;24;200;24;200;696;32;696</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.Text</type>
<coordinates>
<x>264</x>
<y>792</y>
<w>160</w>
<h>24</h>
</coordinates>
<panel_attributes>[All test repetitions completed]</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.custom.State</type>
<coordinates>
<x>328</x>
<y>816</y>
<w>192</w>
<h>32</h>
</coordinates>
<panel_attributes>Stop any running tests, etc. (?)</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.custom.State</type>
<coordinates>
<x>328</x>
<y>864</y>
<w>192</w>
<h>32</h>
</coordinates>
<panel_attributes>'Test End' transition sequence</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>824</y>
<w>40</w>
<h>56</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;40;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>400</x>
<y>872</y>
<w>40</w>
<h>64</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>24;48;24;24</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.FinalState</type>
<coordinates>
<x>416</x>
<y>920</y>
<w>16</w>
<h>16</h>
</coordinates>
<panel_attributes/>
<additional_attributes/>
</element>
</diagram>
-261
View File
@@ -1,261 +0,0 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<diagram program="umlet" version="12.2">
<zoom_level>10</zoom_level>
<element>
<type>com.umlet.element.custom.State</type>
<coordinates>
<x>400</x>
<y>120</y>
<w>120</w>
<h>40</h>
</coordinates>
<panel_attributes>Load the default
procedure
</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>430</x>
<y>40</y>
<w>50</w>
<h>100</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>30;80;30;30</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.InitialState</type>
<coordinates>
<x>450</x>
<y>60</y>
<w>20</w>
<h>20</h>
</coordinates>
<panel_attributes>i</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.custom.State</type>
<coordinates>
<x>400</x>
<y>190</y>
<w>120</w>
<h>40</h>
</coordinates>
<panel_attributes>Reset valves,
pumps, etc.
</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>430</x>
<y>130</y>
<w>50</w>
<h>80</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>30;60;30;30</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.State</type>
<coordinates>
<x>400</x>
<y>260</y>
<w>120</w>
<h>40</h>
</coordinates>
<panel_attributes>Detect cameras</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>430</x>
<y>200</y>
<w>50</w>
<h>80</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>30;60;30;30</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.State</type>
<coordinates>
<x>370</x>
<y>550</y>
<w>180</w>
<h>110</h>
</coordinates>
<panel_attributes>complex
state
--
some more...
-.</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.custom.State</type>
<coordinates>
<x>370</x>
<y>390</y>
<w>180</w>
<h>60</h>
</coordinates>
<panel_attributes>Display prompt, enable
'Cycle' and 'Test' buttons
and wait for a selection</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>430</x>
<y>320</y>
<w>50</w>
<h>90</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>30;70;30;30</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.RegionEndState</type>
<coordinates>
<x>450</x>
<y>330</y>
<w>20</w>
<h>20</h>
</coordinates>
<panel_attributes/>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>430</x>
<y>270</y>
<w>50</w>
<h>80</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>30;60;30;30</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.Decision</type>
<coordinates>
<x>440</x>
<y>480</y>
<w>40</w>
<h>40</h>
</coordinates>
<panel_attributes/>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>430</x>
<y>420</y>
<w>50</w>
<h>80</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>30;60;30;30</additional_attributes>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>430</x>
<y>490</y>
<w>50</w>
<h>80</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>30;60;30;30</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.State</type>
<coordinates>
<x>620</x>
<y>430</y>
<w>160</w>
<h>40</h>
</coordinates>
<panel_attributes>Disable 'Cycle'
and 'Test' buttons</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.custom.State</type>
<coordinates>
<x>620</x>
<y>360</y>
<w>160</w>
<h>40</h>
</coordinates>
<panel_attributes>Empty the tank</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>450</x>
<y>440</y>
<w>270</w>
<h>80</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>250;30;250;60;30;60</additional_attributes>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>670</x>
<y>370</y>
<w>50</w>
<h>80</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>30;30;30;60</additional_attributes>
</element>
<element>
<type>com.umlet.element.Relation</type>
<coordinates>
<x>440</x>
<y>310</y>
<w>280</w>
<h>70</h>
</coordinates>
<panel_attributes>lt=&lt;-</panel_attributes>
<additional_attributes>30;30;260;30;260;50</additional_attributes>
</element>
<element>
<type>com.umlet.element.custom.Text</type>
<coordinates>
<x>490</x>
<y>480</y>
<w>180</w>
<h>20</h>
</coordinates>
<panel_attributes>'Empty a tank' selected
</panel_attributes>
<additional_attributes/>
</element>
<element>
<type>com.umlet.element.custom.Text</type>
<coordinates>
<x>290</x>
<y>520</y>
<w>160</w>
<h>20</h>
</coordinates>
<panel_attributes>'Cycle' or 'Test' selected
</panel_attributes>
<additional_attributes/>
</element>
</diagram>
Binary file not shown.
-73
View File
@@ -1,73 +0,0 @@
Otazky:
-------
- ako pouzit T6
- co je 'T to Open' pri RV
- na co sluzia VI2P, VI3P a VI4P
TODO:
-----
- nefunguje pumpa P3
- nahlad na cestu v procedure
- purgeStart a purgeEnd --> transitionSteps/Sequences
- horeuvedene pre RegulValve
- volba procedury nie je zablokovana pocas testov
- vsetky Target... v Process tabe
- Hmotnosti:
1 netarovat, merat okamzitu,
2 nulovacia procedura na tlacitko manualne,
3 pri starte sa spytat ci vynulovat vahy
- Preco sa nenacitaju zmeny v Test-e ???
- pouzit oneskorenie na ventily
- skontrolovat doc (freq v Hz)
Demo version:
- pouzit progress bary na vyber testu
- vycistit Measurement
- simulacia skonci pri druhom 'start_measurement'
- pri simulacii sa meni mass pri merani end-mass (klapka by mala byt vypnuta!)
- otvorit Proceduru (v dalsom okne v zamknutom stave) aj ked je okno Procedures zamknute
- pridat seriove cisla do parametrov komponentov
- zapamatavat si sirky stlpcov v PathsDlg, ... (aj inde)
- skontroluj vsetky ListViewEx-y + skorsie spracovanie vysledkov (dolezite aj pre spravnu tvorbu noveho mena)
- preco posledne okno skace
- chyba spracovanie procedure / metrology2 Tol.Abzug, Fehl.Korr -+
- vsetky mena stlpcov a tabov do Strings.xxx
Testovanie na stanici:
- pouzivat skutocne 'rvalves'
- ked vyberiem priamo Q1, Q2, Q3 (poskonceni predchadzajuceho testu), neprepise sa obsah combo boxu
- prislusne EtPulses by mali ist cez RegisterReader komponent + common RegisterReader pre Master
- ako je to s WM0 ...
- na zaciatku zmerat vahu a dovolit vypustit tanky
- updatovat vahu - obrazok = je nespravna kapacita vahy
- spracovanie vysledkov podla excelu: corr. na hustotu vzduchu (zavazie), corr. na hustotu vody v zav. od teploty
- podpora pre zbieranie vysledkov
- logovanie vysledkov do excelu
- zastavit vodu na konci skusky
- Pri nastavovani prietoku nie je nic vidno
- pouzivat skutocne 'rvalves'
- pri vytvarani testov vyberat cesty podla prietoku
- ked sa zada cesta napisanim mena = skontrolovat
- zapamatat si stav ventilu pri prietoku
- nulovanie = nulovanie vahy
- zmenit text: tarovanie -> vypustanie
- pripravit IDC100: !ReadRegisterOp, Idc100.GetValue-SetValue (na konci), GetState a ukoncenie operacie
- sub-sekvencie pre Q-set a metody
- zobrazit typizovanu schemu
Neskor:
- nevidno ci su neulozene zmeny
- upozornenie pri cancel ak su neulozene zmeny
- spravne updatovat tlacitka ked su FixedItems (FixedRows)
- ked odomknem Komponenty tak sa zrusi vyber
- vaha ToString - prve zobrazit capacity
- moznost menenia poradia aj v components
- rozdelit ventily podla ciest?
Binary file not shown.
Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

-91
View File
@@ -1,91 +0,0 @@
Assumption
----------
The installation consists of one or more similar test benches. Each test bench is controlled by one PC-based computer. In addition, one or more PC-s can run the same application and manipulated data shared by the test benches (e.g. PC located in offices). All PC-s run the same version of software (this is a must now - Munich - in the future we can try to deal with backward/forward compatibility issues).
Development environment
-----------------------
- Visual Studio 2012 Professional
- Database: MySQL (???)
User iterface
-------------
- WindowsFormsApplication
- Main part of the window occupies a tab control with hidden tabs
(see http://weblogs.asp.net/kdente/archive/2005/11/14/430591.aspx)
Tabs swithing is done programatically
Tabs:
Procedure
- Procedure Info (summary, header)
- Procedure History (changes)
- Procedure Metrology
- Procedure Technical
- Procedure Purge
- Procedure End
- Procedure Adjustment
- Procedure View
- Procedure Inputs
Home
Insert
Results
- Results
- Results D
- Meters Ch
- Temp Ch
- Pressure
Bench parameters
- Technical
- Balance
- Temperature
- Pressure
- Flowmeter
- Density
Logs
Sensus Testbench Framework application settings consist of
----------------------------------------------------------
S1. Local settings stored on each PC
S1.1 language settings, appearance, etc. (no other impact on the system function)
S1.2 specification of databases used to store other settings (see 2.)
There might be several sets of DB settings (1.2) when one should be able to access more test benches. When starting the system, this is indicated on the login screen as 'Test bench'/'Pruefstation'.
S2. Settings stored in databases:
S2.1 'users' (typically shared between all benches - centralized access control)
S2.2 'watermeter_types' info (typically shared between more benches)
S2.3 'test_procedures' (typically shared between more identical benches)
S2.4 'metrological_parameters' of the system (always unique for each system, not shared)
S2.5 'watermeters' info (typically centralized / shared)
S2.6 'test_results' (typically centralized / shared)
etc.
The databases might be running either on the local PC or remote,
each database might be used by a single bench, or shared by more test benches. This configured in 1.2.
Application can be used to:
---------------------------
A1. Change local settings (S1.1, S1.2)
A2. Change settings stored in the databases
A3. Control system and run test procedures - this is only possible on PC-s controlling the benches. When procedure is started, local copy of necessary information from the DB-s is made to avoid problems.
User access control:
--------------------
U1. Access to
U1.1 information read
U1.2 information write/modify
U1.3 action start
is controlled by an access control mechanism.
U2. Users
U3. Groups
Each user is a member of one or more groups. In case needed, a group with a single user is created. Access to information/actions is granted to groups.
Muenich: Grooups are 'Tester',
'Testing specialist',
'Head of lab'
'Maintenance specialist'
'Metrologist'
'Calibration specialist'
U4. When necessary, system prompts user to authenticate himself/herself (login dialog). Authentication is invalidated as follows (optional):
U4.1 When user closes the dialog, which was protected.
U4.2 After certain time period
U4.3 Never
Binary file not shown.
-25
View File
@@ -1,25 +0,0 @@
<log4net>
<!-- A1 is set to be a ConsoleAppender -->
<appender name="A1" type="log4net.Appender.ConsoleAppender">
<!-- A1 uses PatternLayout -->
<layout type="log4net.Layout.PatternLayout">
<!-- Print the date in ISO 8601 format -->
<conversionPattern value="%date [%thread] %-5level %logger %ndc - %message%newline" />
</layout>
</appender>
<!-- Set root logger level to DEBUG and its only appender to A1 -->
<root>
<level value="DEBUG" />
<appender-ref ref="A1" />
</root>
<!-- Print only messages of level WARN or above in the package NHibernate -->
<logger name="NHibernate">
<level value="WARN" />
</logger>
<logger name="TestBenchFramework.BenchControl.StateMachine">
<level value="WARN" />
</logger>
</log4net>
-27
View File
@@ -1,27 +0,0 @@
foreach (var device in devices) device.RunDeviceBefore(); . . . . . . in StateMachine.Worker()
State.Create(...).AddOperation(...).AddOperation(...).EnterState() . . in the sequence in Execute(...)
foreach (var device in devices) device.RunDeviceAfter(); . . . . . . . in WaitRunDevsRunOps()
WaitNextTick() (may throw QuitStateMachineException) . . . . . . . . in WaitRunDevsRunOps()
foreach (var device in devices) device.RunDeviceBefore(); . . . . . . in WaitRunDevsRunOps()
IList<Event> events = State.RunOperations(); . . . . . . . . . . . . . in WaitRunDevsRunOps()
foreach (var device in devices) device.RunDeviceAfter(); . . . . . . . in WaitRunDevsRunOps()
WaitNextTick() (may throw QuitStateMachineException) . . . . . . . . in WaitRunDevsRunOps()
foreach (var device in devices) device.RunDeviceBefore(); . . . . . . in WaitRunDevsRunOps()
IList<Event> events = State.RunOperations(); . . . . . . . . . . . . . in WaitRunDevsRunOps()
State.Create(...).AddOperation(...).AddOperation(...).EnterState() . . in the sequence in Execute(...)
foreach (var device in devices) device.RunDeviceAfter(); . . . . . . . in WaitRunDevsRunOps()
WaitNextTick() (may throw QuitStateMachineException) . . . . . . . . in WaitRunDevsRunOps()
foreach (var device in devices) device.RunDeviceBefore(); . . . . . . in WaitRunDevsRunOps()
IList<Event> events = State.RunOperations(); . . . . . . . . . . . . . in WaitRunDevsRunOps()
foreach (var device in devices) device.RunDeviceAfter(); . . . . . . . in WaitRunDevsRunOps()
WaitNextTick() (assume QuitStateMachineException thrown) . . . . . . in WaitRunDevsRunOps()
foreach (var device in devices) device.RunDeviceBefore(); . . . . . . in StateMachine.Worker() catch()
State.RunOperations(); . . . . . . . . . . . . . . . . . . . . . . . . in StateMachine.Worker() catch()
State.Empty.EnterState(); . . . . . . . . . . . . . . . . . . . . . . in StateMachine.Worker() catch()
foreach (var device in devices) device.RunDeviceAfter(); . . . . . . . in StateMachine.Worker() catch()
foreach (var device in devices) device.StopDevice(); . . . . . . . . . in StateMachine.Worker() catch()
BIN
View File
Binary file not shown.

After

Width:  |  Height:  |  Size: 30 KiB

-11
View File
@@ -1,11 +0,0 @@
Showing tabs in the designer:
- select mainTabControl
- in Properies change SizeMode to normal
- in Properies change ItemSize to 0; 20
Hiding tabs in the designer:
- select mainTabControl
- in Properies change SizeMode to Fixed
- in Poperties change ItemSize to 0; 1
-4
View File
@@ -1,4 +0,0 @@
af242843887f3bdcc52e485483356eaccd37ba67a35941530bd195a8310fc7d5aca8560576dfb62ad5a4bd2df789a5e8be068e62e7c976d6eeed8d63abbd9909
= staratura
+249
View File
@@ -0,0 +1,249 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Timers;
using System.IO.Ports;
//*****************************************************************************
// Copyright 2020 Sensus GmbH Ludwigshafen. All rights reserved.
// Author: Venkat, Rajeshwar
//*****************************************************************************
namespace Sensus.iPerl.NfcHandler
{
public class CR95HF_Reader
{
private readonly byte [] CR95HF_CMD_ECHO = { 0x55 };
private readonly byte[] CR95HF_CMD_IDN = { 0x01, 0x00 }; //CommandCode(0x01), Length(0x00)
private readonly byte[] CR95HF_CMD_PROTOCOL_SELECT_ON = { 0x02, 0x02, 0x01, 0x0D }; //CommandCode(0x02), Length(0x02), ISO/IEC 15693(0x01), 26 Kbps H, Wait for SOF, 10% modulation, Single subcarrier S, CRC appended (0x0D)
private readonly byte[] CR95HF_CMD_PROTOCOL_SELECT_OFF = { 0x02, 0x02, 0x00, 0x00 }; //CommandCode(0x02), Length(0x02), Protocol off (0x00), Protocol off (0x00)
private List<byte> CR95HF_CMD_SEND_RECEIVE = new List<byte>(); // Command code (0x04), Length (this is number of bytes after this length byte), REQUEST_FLAGS(0x02) and payload (this varies based on device command)
private readonly byte REQUEST_FLAGS = 0x02; // Single subcarrier freq, High data rate, No Inventory/ProtExtn/Select/Address/Option flags
private SERIAL_Driver _SERIAL_Driver;
public event DelNfc_CR95HF_MessageHandler MessageEvent;
private static readonly Dictionary<byte, string> CR95HF_ErrorCodes = new Dictionary<byte, string>
{
{ 0x00 , "Success, No error" },
{ 0x80 , "Success, No error" },
{ 0xA0 , "Success, No error" },
{ 0xC0 , "Success, No error" },
{ 0x82 , "Invalid command length" },
{ 0x83 , "Invalid protocol"},
{ 0x63 , "EEmdSOFerror23, SOF error in high part(duration 2 to 3 etu) in ISO/IEC 14443B"},
{ 0x65 , "EEmdSOFerror10, SOF error in low part(duration 10 to 11 etu) in ISO/IEC 14443B"},
{ 0x66 , "EEmdEgt error, Extended Guard Time error in ISO/IEC 14443B"},
{ 0x67 , "ETr1 Too Big Too long, TR1 send by the card, reception stopped in ISO/IEC 14443BT"},
{ 0x68 , "ETr1Too small Too small, TR1 send by the card in ISO/IEC 14443B"},
{ 0x71 , "EinternalError, Wrong frame format decoded"},
{ 0x85 , "EUserStop, Stopped by user(used only in Card mode)"},
{ 0x86 , "ECommError, Hardware communication error"},
{ 0x87 , "EFrameWaitTOut,Frame wait time out (no valid reception)"},
{ 0x88 , "EInvalidSof,Invalid SOF" },
{ 0x89 , "EBufOverflow,Too many bytes received and data still arriving" },
{ 0x8A , "EFramingError,if start bit = 1 or stop bit = 0"},
{ 0x8B , "EEgtError,EGT time out" },
{ 0x8C , "EInvalidLen,Valid for ISO/IEC 18092, if Length<3" },
{ 0x8D , "ECrcError,CRC error, Valid only for ISO/IEC 18092" },
{ 0x8E , "ERecvLost,CRC error,When reception is lost without EOF received(or subcarrier was lost)"},
{ 0x8F , "ENoField,CRC error,When Listen command detects the absence of external field)"},
{ 0x90 , "EUnintByte,Residual bits in last byte. Useful for ACK/NAK reception of ISO/IEC 14443 Type A"},
{ 0xFF , "Invalid COM port, request Failed" },
};
public CR95HF_Reader(SERIAL_Driver serialdriver)
{
_SERIAL_Driver = serialdriver;
}
#region Message Event
private void OnMessageEvent(string message)
{
NfcMessageEventArgs e = new NfcMessageEventArgs();
e.Message = message;
if (MessageEvent != null)
{
MessageEvent(this, e);
}
e = null;
}
#endregion
public bool OpenConnection(string comport, int baudrate, int databits, Parity parity, StopBits stopbits)
{
return _SERIAL_Driver.OpenConnection(comport, baudrate, databits, parity, stopbits);//Port Intialization and Port Open;
}
public bool CR95HF_Connect()
{
byte[] bytesReceived;
if (_SERIAL_Driver.isOpen())
{
//OnMessageEvent("Tx- " + Tools.ByteArrayToHexString(CR95HF_CMD_IDN));
_SERIAL_Driver.SendMessage(CR95HF_CMD_IDN, CR95HF_CMD_IDN.Length);
if (_SERIAL_Driver.GetRawData().Length == 0) return false;
bytesReceived = _SERIAL_Driver.GetRawData();
//OnMessageEvent("Rx- " + Tools.ByteArrayToHexString(bytesReceived));
if (bytesReceived.Length == 17 && (bytesReceived[0] == 0x00 || bytesReceived[0] == 0x80))
{
string strReader = System.Text.Encoding.ASCII.GetString(bytesReceived);
strReader = strReader.Substring(2, 12);
OnMessageEvent("CombiHead '" + strReader + "'");
}
else
{
if (CR95HF_ErrorCodes.ContainsKey(bytesReceived[0]))
OnMessageEvent("NFC CR95HF error: " + CR95HF_ErrorCodes[bytesReceived[0]]);
else
OnMessageEvent("NFC CR95HF error: Unidentified");
return false;
}
//OnMessageEvent("Tx- " + Tools.ByteArrayToHexString(CR95HF_CMD_PROTOCOL_SELECT_ON));
_SERIAL_Driver.SendMessage(CR95HF_CMD_PROTOCOL_SELECT_ON, CR95HF_CMD_PROTOCOL_SELECT_ON.Length);
if (_SERIAL_Driver.GetRawData().Length == 0) return false;
bytesReceived = _SERIAL_Driver.GetRawData();
//OnMessageEvent("Rx- " + Tools.ByteArrayToHexString(bytesReceived));
if ((bytesReceived[0] != 0x00) && (bytesReceived[0] != 0x80))
{
if (CR95HF_ErrorCodes.ContainsKey(bytesReceived[0]))
OnMessageEvent("NFC CR95HF error: " + CR95HF_ErrorCodes[bytesReceived[0]]);
else
OnMessageEvent("NFC CR95HF error: Unidentified");
return false;
}
}
else
{
OnMessageEvent(_SERIAL_Driver.ErrorMessage);
return false;
}
OnMessageEvent("NFC CR95HF: Protocol ON");
return true;
}
public bool CR95HF_RFProtocolOn()
{
byte[] bytesReceived;
if (_SERIAL_Driver.isOpen())
{
//OnMessageEvent("Tx- " + Tools.ByteArrayToHexString(CR95HF_CMD_PROTOCOL_SELECT_ON));
_SERIAL_Driver.SendMessage(CR95HF_CMD_PROTOCOL_SELECT_ON, CR95HF_CMD_PROTOCOL_SELECT_ON.Length);
if (_SERIAL_Driver.GetRawData().Length == 0) return false;
bytesReceived = _SERIAL_Driver.GetRawData();
//OnMessageEvent("Rx- " + Tools.ByteArrayToHexString(bytesReceived));
if ((bytesReceived[0] != 0x00) && (bytesReceived[0] != 0x80))
{
if (CR95HF_ErrorCodes.ContainsKey(bytesReceived[0]))
OnMessageEvent("NFC CR95HF error: " + CR95HF_ErrorCodes[bytesReceived[0]]);
else
OnMessageEvent("NFC CR95HF error: Unidentified");
return false;
}
}
else
{
OnMessageEvent(_SERIAL_Driver.ErrorMessage);
return false;
}
return true;
}
public bool CR95HF_RFProtocolOff()
{
byte[] bytesReceived;
if (_SERIAL_Driver.isOpen())
{
//OnMessageEvent("Tx- " + Tools.ByteArrayToHexString(CR95HF_CMD_PROTOCOL_SELECT_OFF));
_SERIAL_Driver.SendMessage(CR95HF_CMD_PROTOCOL_SELECT_OFF, CR95HF_CMD_PROTOCOL_SELECT_OFF.Length);
if (_SERIAL_Driver.GetRawData().Length == 0) return false;
bytesReceived = _SERIAL_Driver.GetRawData();
//OnMessageEvent("Rx- " + Tools.ByteArrayToHexString(bytesReceived));
if ((bytesReceived[0] != 0x00) && (bytesReceived[0] != 0x80))
{
if (CR95HF_ErrorCodes.ContainsKey(bytesReceived[0]))
OnMessageEvent("NFC CR95HF error: " + CR95HF_ErrorCodes[bytesReceived[0]]);
else
OnMessageEvent("NFC CR95HF error: Unidentified");
return false;
}
}
else
{
OnMessageEvent(_SERIAL_Driver.ErrorMessage);
return false;
}
return true;
}
public bool CR95HF_SendRecv(byte[] fromDevice, out byte[] toDevice)
{
CR95HF_CMD_SEND_RECEIVE = new List<byte>();
toDevice = null;
if (_SERIAL_Driver.isOpen())
{
CR95HF_CMD_SEND_RECEIVE.Add(0x04);//Command Code
CR95HF_CMD_SEND_RECEIVE.Add((byte)(1 + fromDevice.Length)); // This is bytes from device + 1 (because request flags byte added here)
CR95HF_CMD_SEND_RECEIVE.Add(REQUEST_FLAGS);
CR95HF_CMD_SEND_RECEIVE.AddRange(fromDevice);
//OnMessageEvent("Tx- " + Tools.ByteArrayToHexString(CR95HF_CMD_SEND_RECEIVE.ToArray()));
_SERIAL_Driver.SendMessage(CR95HF_CMD_SEND_RECEIVE.ToArray(), CR95HF_CMD_SEND_RECEIVE.Count);
if (_SERIAL_Driver.GetRawData().Length == 0) return false;
byte[] bytesReceived = _SERIAL_Driver.GetRawData();
//OnMessageEvent("Rx- " + Tools.ByteArrayToHexString(bytesReceived));
if ((bytesReceived[0] == 0x00) || (bytesReceived[0] == 0x80) || (bytesReceived[0] == 0xA0) || (bytesReceived[0] == 0xC0))
{
toDevice = new byte[bytesReceived[1]];
for (int i = 0; i < Convert.ToInt32(bytesReceived[1]); i++)
{
toDevice[i] = bytesReceived[2 + i];
}
}
else
{
if (CR95HF_ErrorCodes.ContainsKey(bytesReceived[0]))
OnMessageEvent("NFC CR95HF error: " + CR95HF_ErrorCodes[bytesReceived[0]]);
else
OnMessageEvent("NFC CR95HF error: Unidentified");
return false;
}
}
else
{
OnMessageEvent(_SERIAL_Driver.ErrorMessage);
return false;
}
return true;
}
public bool CR95HF_Echo()
{
if (_SERIAL_Driver.isOpen())
{
if (_SERIAL_Driver.SendMessage(CR95HF_CMD_ECHO, 1))
{
if (_SERIAL_Driver.GetRawData().Length == 0) return false;
byte[] bytesReceived = _SERIAL_Driver.GetRawData();
if ((bytesReceived.Length == 1) && (bytesReceived[0] == CR95HF_CMD_ECHO[0]))
return true;
}
}
else
{
OnMessageEvent(_SERIAL_Driver.ErrorMessage);
return false;
}
return false;
}
}
}
+771
View File
@@ -0,0 +1,771 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Threading;
using System.Diagnostics;
using System.IO.Ports;
using System.Timers;
using System.Runtime.CompilerServices;
//*****************************************************************************
// Copyright 2020 Sensus GmbH Ludwigshafen. All rights reserved.
// Author: Venkat, Rajeshwar
//*****************************************************************************
namespace Sensus.iPerl.NfcHandler
{
public class MCI_Protocol
{
private bool MCI_CycleResponseMsgTimeoutFlag = false;
private readonly byte STX = (byte) 0x02;
private readonly byte ETX = (byte) 0x03;
private readonly byte RX_ACK_RESPONSE_MSG_ID = (byte) 0xC9;
private readonly ushort[] MciPasswords = { 0x0000, 0x55AA, 0x1234, 0x97D1 };
public event DelNfc_MCI_MessageHandler MessageEvent;
public enum StructName
{
Calibration,
Configuration,
Status,
Power,
LCD,
unused1,
unused2,
Diagnostics,
ProductionInfo,
AckResponse,
RadioParams,
RadioInfo,
Command,
EEPROM_Metro,
ST25_Chip_Registers,
IndexReset,
NfcSecurity
}
public static readonly Dictionary<byte, string> StructName_id_to_str = new Dictionary<byte, string>
{
{0, "Calibration"},
{1, "Configuration"},
{2, "Status"},
{3, "Power"},
{4, "LCD"},
{5, "unused1"},
{6, "unused2"},
{7, "Diagnostics"},
{8, "ProductionInfo"},
{9, "AckResponse"},
{10, "RadioParams"},
{11, "RadioInfo"},
{12, "Command"},
{13, "EEPROM_Metro"},
{14, "ST25_Chip_Registers"},
{15, "IndexReset"},
{16, "NfcSecurity"}
};
private string StructToStr(StructName StName)
{
return StructName_id_to_str[Convert.ToByte(StName)];
}
private bool IsValidStruct(StructName StName)
{
return MCI_Protocol.StructName_id_to_str.ContainsKey(Convert.ToByte(StName));
}
public enum MCI_ErrorCodes
{
// these first 0..8 error codes are defined both in
// radio and metro. They can return these codes.
// higher codes will not be returned
Success_No_error = 0,
MCI_Error_MeterAns_Timeout = 1,
MCI_Error_MeterAns_Wrong_CRC = 2,
MCI_Error_MeterAns_Wrong_password = 3,
MCI_Error_MeterAns_Data_not_available = 4,
MCI_Error_MeterAns_Invalid_access = 5,
MCI_Error_MeterAns_Command_not_supported = 6,
MCI_Error_MeterAns_Command_not_executed = 7,
MCI_Error_MeterAns_Unidentified = 8,
// in case higher errors will be defined for the IMI in future
// we keep some distance with the errorcodes...
// host error codes from MCI_Read/Write start from 20:
MCI_Error_Host_Bad_MCI_ID = 20,
MCI_Error_Host_WriteReq_denied = 21,
MCI_Error_Host_WriteReq_bad_device_ans = 22,
MCI_Error_Host_ReadReq_denied = 23,
MCI_Error_Host_ReadReq_bad_device_ans = 24,
MCI_Error_Host_Bad_Payload_Len = 25,
MCI_Error_Host_MeterCRCDoesNotMatch = 26,
MCI_Error_Host_ReadReqBadResponseStructure = 27,
MCI_Error_Host_InvalidStructureID_CannotSendMsg = 28,
MCI_Error_Host_CommandNotInCmdCodeList = 29,
// host error codes from method MCI_TxRequest_RxResponse start from 40
MCI_Error_Host_MB_CTRL_Reg_Read1 = 40,
MCI_Error_Host_MB_disabled1 = 41,
MCI_Error_Host_MB_LEN_Reg_read1 = 42,
MCI_Error_Host_MB_msg_read1 = 43,
MCI_Error_Host_req_not_sent = 44,
MCI_Error_Host_req_not_read_by_iperl = 45,
MCI_Error_Host_MB_CTRL_Reg_Read2 = 46,
MCI_Error_Host_MB_disabled2 = 47,
MCI_Error_Host_MB_LEN_Reg_read2 = 48,
MCI_Error_Host_MB_msg_read2 = 49,
MCI_Error_Host_Timeout = 50,
MCI_Error_Host_msg_write = 51
}
public static string GetMCIErrorMessage(byte ErrorCode)
{
// this is called reflection. The variable names will be
// returned. No need of copys of variable names to string values.
return ((MCI_ErrorCodes) ErrorCode).ToString();
}
public static readonly Dictionary<byte, string> MCI_CmdCodes = new Dictionary<byte, string>
{
{0x00 , "Command: No Operation" },
{0x01 , "Command: Clear Alarms" },
{0x04 , "Command: Clear Diag" },
{0x05 , "Command: Clear Peak flowrate" },
{0x06 , "Command: Enter Active mode" },
{0x07 , "Command: Enter Test mode" },
{0x09 , "Command: Reset Accumulated Volume" },
{0x0A , "Command: Factory Default" },
{0x0B , "Command: Seal" },
{0x0C , "Command: Send radio address to radio FW" },
{0x0D , "Command: Adjust Field" },
{0x0E , "Command: LCD All segments ON" },
{0x0F , "Command: LCD All segments OFF" },
{0x10 , "Command: LCD Even segments ON" },
{0x11 , "Command: LCD Odd segments ON" },
{0x12 , "Command: LNA ON" },
{0x13 , "Command: LNA OFF" },
{0x14 , "Command: EPD ON" },
{0x15 , "Command: EPD OFF" },
{0x16 , "Command: Enter LPM4" },
{0x17 , "Command: Select drive coil connectivity" },
{0x1A , "Command: Enter VRTM" },
{0x1B , "Custom Package Mode ON" },
{0x1C , "Custom Package Mode OFF" },
{0x20 , "Command: Deinstall" },
{0x21 , "Command: Audit Mode" },
{0x22 , "Command: Diagnostic Refresh" },
{0x23 , "Command: NFC Security Reset Access Level" }
};
Dictionary<int, byte[]> MCI_Write_Info = new Dictionary<int, byte[]>();
Dictionary<int, byte[]> MCI_Read_Info = new Dictionary<int, byte[]>();
Dictionary<int, byte[]> MCI_ReadResponse_Info = new Dictionary<int, byte[]>();
private byte MB_Ctrl_Reg_Value;
private byte MB_LEN_Dyn_Register;
private ST25DV_Device _ST25DV_Device;
Tools.Crc16Ccitt Crc = new Tools.Crc16Ccitt(Tools.InitialCrcValue.NonZero1);
private System.Timers.Timer _ReqResCycleTimeoutTimer = new System.Timers.Timer();
public MCI_Protocol(ST25DV_Device ST25DVDevice)
{
_ST25DV_Device = ST25DVDevice;
Init_MCI_Info_MsgId_Password();
}
private void Init_MCI_Info_MsgId_Password()
{
//Write request
byte[] value1 = { 0x40, 0xD1, 0x97 };
MCI_Write_Info.Add(0, value1);//Calibration
byte [] value2 = { 0x41, 0xD1, 0x97 };
MCI_Write_Info.Add(1, value2); //Configuration
byte[] value3 = { 0x42, 0x34, 0x12 };
MCI_Write_Info.Add(2, value3); //Status
byte[] value4 = { 0x43, 0x34, 0x12 };
MCI_Write_Info.Add(3, value4);//Power
byte[] value5 = { 0x44, 0xAA, 0x55 };
MCI_Write_Info.Add(4, value5); //LCD
byte[] value6 = { 0x48, 0xD1, 0x97 };
MCI_Write_Info.Add(8, value6);//ProductionInfo
byte[] value7 = { 0x4E, 0xD1, 0x97 };
MCI_Write_Info.Add(10, value7);//RadioParams
byte[] value8 = { 0x4E, 0xD1, 0x97 };
MCI_Write_Info.Add(11, value8);//RadioInfo
byte[] value9 = { 0x4A, 0xD1, 0x97 };
MCI_Write_Info.Add(12, value9);//Command
byte[] valueIndexResetWrite = { 0x52, 0xD1, 0x97 };
MCI_Write_Info.Add(15, valueIndexResetWrite);//Index reset
byte[] valueNfcSecuritySignedWrite = { 0x54, 0xD1, 0x97 };
MCI_Write_Info.Add(16, valueNfcSecuritySignedWrite);//NFC Security signed message - while writing
//Read request
byte[] value10 = { 0x00, 0xD1, 0x97 };
MCI_Read_Info.Add(0, value10);//Calibration
byte[] value11 = { 0x01, 0xD1, 0x97 };
MCI_Read_Info.Add(1, value11); //Configuration
byte[] value12 = { 0x02, 0x34, 0x12 };
MCI_Read_Info.Add(2, value12); //Status
byte[] value13 = { 0x03, 0x34, 0x12 };
MCI_Read_Info.Add(3, value13);//Power
byte[] value14 = { 0x04, 0xAA, 0x55 };
MCI_Read_Info.Add(4, value14); //LCD
byte[] value15 = { 0x07, 0xAA, 0x55 };
MCI_Read_Info.Add(7, value15); //Diag
byte[] value16 = { 0x08, 0xD1, 0x97 };
MCI_Read_Info.Add(8, value16);//ProductionInfo
byte[] value17 = { 0x0E, 0xD1, 0x97 };
MCI_Read_Info.Add(10, value17);//RadioParams
byte[] value18 = { 0x0E, 0xD1, 0x97 };
MCI_Read_Info.Add(11, value18);//RadioInfo
byte[] valueIndexResetRead = { 0x12, 0xD1, 0x97 };
MCI_Read_Info.Add(15, valueIndexResetRead);//Index reset
byte[] valueNfcSecurityUnsignedRead = { 0x14, 0xD1, 0x97 };
MCI_Read_Info.Add(16, valueNfcSecurityUnsignedRead);//NFC Security non-signed message - while reading
//Read response
byte[] value19 = { 0xC0, 0xD1, 0x97 };
MCI_ReadResponse_Info.Add(0, value19);//Calibration
byte[] value20 = { 0xC1, 0xD1, 0x97 };
MCI_ReadResponse_Info.Add(1, value20); //Configuration
byte[] value21 = { 0xC2, 0x34, 0x12 };
MCI_ReadResponse_Info.Add(2, value21); //Status
byte[] value22 = { 0xC3, 0x34, 0x12 };
MCI_ReadResponse_Info.Add(3, value22);//Power
byte[] value23 = { 0xC4, 0xAA, 0x55 };
MCI_ReadResponse_Info.Add(4, value23); //LCD
byte[] value24 = { 0xC7, 0xAA, 0x55 };
MCI_ReadResponse_Info.Add(7, value24); //Diag
byte[] value25 = { 0xC8, 0xD1, 0x97 };
MCI_ReadResponse_Info.Add(8, value25);//ProductionInfo
byte[] value26 = { 0xC9, 0x00, 0x00 };
MCI_ReadResponse_Info.Add(9, value26);//Ack response
byte[] value27 = { 0xCE, 0xD1, 0x97 };
MCI_ReadResponse_Info.Add(10, value27);//RadioParams
byte[] value28 = { 0xCE, 0xD1, 0x97 };
MCI_ReadResponse_Info.Add(11, value28);//RadioInfo
byte[] valueIndexResetReadResponse = { 0xD2, 0xD1, 0x97 };
MCI_ReadResponse_Info.Add(15, valueIndexResetReadResponse);//Index reset
byte[] valueNfcSecurityUnsignedReadResponse = { 0xD4, 0xD1, 0x97 };
MCI_ReadResponse_Info.Add(16, valueNfcSecurityUnsignedReadResponse);//NFC Security non-signed message response - while reading
}
public bool MCI_Write(StructName StName, ushort offset, byte payloadlength, byte[] inBuffer, int timeoutMs,
out byte errorCode)
{
List<byte> RequestMessage = new List<byte>();
byte[] ResponseMessage = null;
byte[] crcValue = new byte[2];
errorCode = (byte) MCI_ErrorCodes.Success_No_error;
if (payloadlength != inBuffer.Length)
{
// Insufficient Payload length
errorCode = (byte)MCI_ErrorCodes.MCI_Error_Host_Bad_Payload_Len;
return false;
}
if (StName == StructName.Command)
{
if (! MCI_Protocol.MCI_CmdCodes.ContainsKey(inBuffer[0]))
{
// Command not supported
errorCode = (byte)MCI_ErrorCodes.MCI_Error_Host_CommandNotInCmdCodeList;
return false;
}
}
else // not a command => should be struct
{
if (!IsValidStruct(StName))
{
errorCode = (byte)MCI_ErrorCodes.MCI_Error_Host_InvalidStructureID_CannotSendMsg;
return false;
}
}
byte[] MsgId_Password = MCI_Write_Info[(int)StName];
RequestMessage.Add(STX);
RequestMessage.Add(Convert.ToByte(6 + payloadlength));
RequestMessage.Add(MsgId_Password[0]);
RequestMessage.Add((byte)(offset & 0x00FF));
RequestMessage.Add((byte)((offset & 0xFF00) >> 8));
RequestMessage.Add(payloadlength);
for (int i = 0; i < payloadlength; i++) // copy Buffer -> Request Payload
{
RequestMessage.Add(inBuffer[i]);
}
RequestMessage.Add(MsgId_Password[1]);
RequestMessage.Add(MsgId_Password[2]);
// calc CRC and add to request
crcValue = Crc.calcCRCfromMessage(RequestMessage.ToArray());
RequestMessage.Add(crcValue[0]);
RequestMessage.Add(crcValue[1]);
RequestMessage.Add(ETX);
OnMessageEvent("Write " + StructToStr(StName) + "Request: " + Tools.BytesToHex(RequestMessage.ToArray()));
errorCode = MCI_TxRequest_RxResponse(RequestMessage.ToArray(), out ResponseMessage, timeoutMs);
if (errorCode != (byte)MCI_ErrorCodes.Success_No_error)
{
return false;
}
//Response message received
byte[] RxCrcComputed = Crc.calcCRCfromMessage(ResponseMessage);
byte[] RxCrcMeter = new byte[2];
// CRC starts at length + STX(1) + lenbyte(1) = RespMsg[1] + 2.
Array.Copy(ResponseMessage, ResponseMessage[1] + 2, RxCrcMeter, 0, 2);
if (!Crc.crc_do_match(RxCrcMeter, RxCrcComputed))
{
OnMessageEvent(Crc.commentCRC(RxCrcMeter, RxCrcComputed));
errorCode = (byte) MCI_ErrorCodes.MCI_Error_Host_MeterCRCDoesNotMatch;
return false;
}
if ((ResponseMessage[0] == STX)
&& (ResponseMessage[1] == 0x07)
&& (ResponseMessage[2] == RX_ACK_RESPONSE_MSG_ID)
&& (ResponseMessage[11] == ETX))
{
errorCode = ResponseMessage[6]; // meter error. Must be between 0..8.
// Will be converted to errormessage string from the calling method.
if (errorCode != 0)
{
OnMessageEvent("Write " + StructToStr(StName) + " failed. Request Response: " + Tools.BytesToHex(ResponseMessage));
return false;
}
OnMessageEvent("Write : Success");
return true;
}
errorCode = (byte) MCI_ErrorCodes.MCI_Error_Host_WriteReq_bad_device_ans;
return false;
}
public bool MCI_Write_Read(StructName StName, ushort offset, byte payloadlength, byte[] inBuffer, out byte[] outBuffer, int timeoutMs,
out byte errorCode)
{
List<byte> RequestMessage = new List<byte>();
byte[] ResponseMessage = null;
byte[] crcValue = new byte[2];
byte RxMsgLength;
byte RxMsgId;
byte[] RxOffset = new byte[2];
byte RxPayloadlength;
byte[] RxCrcMeter = new byte[2];
outBuffer = null;
errorCode = (byte)MCI_ErrorCodes.Success_No_error;
if (payloadlength != inBuffer.Length)
{
// Insufficient Payload length
errorCode = (byte)MCI_ErrorCodes.MCI_Error_Host_Bad_Payload_Len;
return false;
}
if (StName == StructName.Command)
{
if (!MCI_Protocol.MCI_CmdCodes.ContainsKey(inBuffer[0]))
{
// Command not supported
errorCode = (byte)MCI_ErrorCodes.MCI_Error_Host_CommandNotInCmdCodeList;
return false;
}
}
else // not a command => should be struct
{
if (!IsValidStruct(StName))
{
errorCode = (byte)MCI_ErrorCodes.MCI_Error_Host_InvalidStructureID_CannotSendMsg;
return false;
}
}
byte[] MsgId_Password = MCI_Write_Info[(int)StName];
RequestMessage.Add(STX);
RequestMessage.Add(Convert.ToByte(6 + payloadlength));
RequestMessage.Add(MsgId_Password[0]);
RequestMessage.Add((byte)(offset & 0x00FF));
RequestMessage.Add((byte)((offset & 0xFF00) >> 8));
RequestMessage.Add(payloadlength);
for (int i = 0; i < payloadlength; i++) // copy Buffer -> Request Payload
{
RequestMessage.Add(inBuffer[i]);
}
RequestMessage.Add(MsgId_Password[1]);
RequestMessage.Add(MsgId_Password[2]);
// calc CRC and add to request
crcValue = Crc.calcCRCfromMessage(RequestMessage.ToArray());
RequestMessage.Add(crcValue[0]);
RequestMessage.Add(crcValue[1]);
RequestMessage.Add(ETX);
OnMessageEvent("Write " + StructToStr(StName) + "Request: " + Tools.BytesToHex(RequestMessage.ToArray()));
errorCode = MCI_TxRequest_RxResponse(RequestMessage.ToArray(), out ResponseMessage, timeoutMs);
if (errorCode != (byte)MCI_ErrorCodes.Success_No_error)
{
return false;
}
if ((ResponseMessage[0] == STX) && (ResponseMessage[11] == ETX)
&& (ResponseMessage[1] == 0x07)
&& (ResponseMessage[2] == RX_ACK_RESPONSE_MSG_ID))
{
//Ack message received, not served the read request
errorCode = ResponseMessage[6]; // forward error message from meter
OnMessageEvent("Read " + StructToStr(StName) + ": Failed with error "
+ Tools.ByteToHexString(errorCode));
return false;
}
//Response message received
RxMsgLength = ResponseMessage[1];
RxMsgId = ResponseMessage[2];
// RxOffset[0] = ResponseMessage[3];
// RxOffset[1] = ResponseMessage[4];
RxPayloadlength = ResponseMessage[5];
// RxPassword[0] = ResponseMessage[6 + RxPayloadlength];
// RxPassword[1] = ResponseMessage[7 + RxPayloadlength];
RxCrcMeter[0] = ResponseMessage[8 + RxPayloadlength];
RxCrcMeter[1] = ResponseMessage[9 + RxPayloadlength];
byte[] RxCrcComputed = Crc.calcCRCfromMessage(ResponseMessage);
// OnMessageEvent(Crc.commentCRC(RxCrcMeter, RxCrcComputed));
if (!Crc.crc_do_match(RxCrcMeter, RxCrcComputed))
{
errorCode = (byte)MCI_ErrorCodes.MCI_Error_Host_MeterCRCDoesNotMatch;
return false;
}
//TODO, verify received password matches with expected password or not?
if (!((ResponseMessage[0] == STX) && (ResponseMessage[10 + RxPayloadlength] == ETX)
&& ((ResponseMessage[2] & 0x3F) == (MsgId_Password[0] & 0x3F))))
{
errorCode = (byte)MCI_ErrorCodes.MCI_Error_Host_ReadReqBadResponseStructure;
return false;
}
outBuffer = new byte[RxPayloadlength];
for (int i = 0; i < RxPayloadlength; i++)
{
outBuffer[i] = (ResponseMessage[6 + i]);
}
if (IsValidStruct(StName))
{
OnMessageEvent("Read " + StructToStr(StName) + ": " + Tools.BytesToHex(outBuffer)
+ " Success");
}
else
{
OnMessageEvent("Read Failed! Unknown MCI ID: " + Convert.ToByte(StName));
errorCode = (byte)MCI_ErrorCodes.MCI_Error_Host_Bad_MCI_ID;
return false;
}
errorCode = (byte)0x00; //Success, No error
return true;
}
public bool MCI_Read(StructName StName, ushort offset, byte payloadlength, int timeoutMs,
out byte[] outBuffer, out byte errorCode)
{
List<byte> RequestMessage = new List<byte>();
byte[] ResponseMessage = null;
byte RxMsgLength;
byte RxMsgId;
byte [] RxOffset = new byte[2];
byte RxPayloadlength;
byte[] RxCrcMeter = new byte[2];
byte[] RxPassword = new byte[2];
byte[] MsgId_Password = MCI_Read_Info[(byte)StName];
byte[] crcValue;
outBuffer = null;
errorCode = (byte)0x00; //Success, No error
if (! IsValidStruct(StName))
{
errorCode = (byte)MCI_ErrorCodes.MCI_Error_Host_InvalidStructureID_CannotSendMsg;
OnMessageEvent("Read request:" + MCI_Protocol.GetMCIErrorMessage(errorCode));
return false;
}
RequestMessage.Add(STX);
RequestMessage.Add(0x06);
RequestMessage.Add(MsgId_Password[0]);
RequestMessage.Add((byte)(offset & 0x00FF));
RequestMessage.Add((byte)((offset & 0xFF00) >> 8));
RequestMessage.Add(payloadlength);
RequestMessage.Add(MsgId_Password[1]);
RequestMessage.Add(MsgId_Password[2]);
crcValue = Crc.calcCRCfromMessage(RequestMessage.ToArray());
RequestMessage.AddRange(crcValue);
RequestMessage.Add(ETX);
OnMessageEvent("Read Request: " + Tools.BytesToHex(RequestMessage.ToArray()));
errorCode = MCI_TxRequest_RxResponse(RequestMessage.ToArray(), out ResponseMessage, timeoutMs);
if (errorCode != (byte) MCI_ErrorCodes.Success_No_error)
{
return false;
}
if ((ResponseMessage[0] == STX) && (ResponseMessage[11] == ETX)
&& (ResponseMessage[1] == 0x07)
&& (ResponseMessage[2] == RX_ACK_RESPONSE_MSG_ID))
{
//Ack message received, not served the read request
errorCode = ResponseMessage[6]; // forward error message from meter
OnMessageEvent("Read " + StructToStr(StName) + ": Failed with error "
+ Tools.ByteToHexString(errorCode));
return false;
}
//Response message received
RxMsgLength = ResponseMessage[1];
RxMsgId = ResponseMessage[2];
// RxOffset[0] = ResponseMessage[3];
// RxOffset[1] = ResponseMessage[4];
RxPayloadlength = ResponseMessage[5];
// RxPassword[0] = ResponseMessage[6 + RxPayloadlength];
// RxPassword[1] = ResponseMessage[7 + RxPayloadlength];
RxCrcMeter[0] = ResponseMessage[8 + RxPayloadlength];
RxCrcMeter[1] = ResponseMessage[9 + RxPayloadlength];
byte[] RxCrcComputed = Crc.calcCRCfromMessage(ResponseMessage);
// OnMessageEvent(Crc.commentCRC(RxCrcMeter, RxCrcComputed));
if (!Crc.crc_do_match(RxCrcMeter, RxCrcComputed))
{
errorCode = (byte) MCI_ErrorCodes.MCI_Error_Host_MeterCRCDoesNotMatch;
return false;
}
//TODO, verify received password matches with expected password or not?
if (!((ResponseMessage[0] == STX) && (ResponseMessage[10 + RxPayloadlength] == ETX)
&& ((ResponseMessage[2] & 0x3F) == (MsgId_Password[0] & 0x3F))))
{
errorCode = (byte)MCI_ErrorCodes.MCI_Error_Host_ReadReqBadResponseStructure;
return false;
}
outBuffer = new byte[RxPayloadlength];
for (int i = 0; i < RxPayloadlength; i++)
{
outBuffer[i] = (ResponseMessage[6 + i]);
}
if (IsValidStruct(StName))
{
OnMessageEvent("Read " + StructToStr(StName) + ": " + Tools.BytesToHex(outBuffer)
+ " Success");
}
else
{
OnMessageEvent("Read Failed! Unknown MCI ID: " + Convert.ToByte(StName));
errorCode = (byte)MCI_ErrorCodes.MCI_Error_Host_Bad_MCI_ID;
return false;
}
errorCode = (byte)0x00; //Success, No error
return true;
}
private byte MCI_TxRequest_RxResponse(byte[] InBuffer, out byte[] OutBuffer, int timeout)
{
// return message is the errorcode, 0 means no error.
byte[] responseMsg = null;
OutBuffer = null;
MCI_CycleResponseMsgTimeoutFlag = false;
StartReqResCycleTimeoutTimer(timeout);
if (!_ST25DV_Device.ST25DV_ReadMailboxControlReg(out MB_Ctrl_Reg_Value))
{
MCI_CycleResponseMsgTimeoutFlag = false;
stopReqResCycleTimeoutTimer();
return (byte) MCI_ErrorCodes.MCI_Error_Host_MB_CTRL_Reg_Read1;
}
//Mailbox enable/disable check, proceed further only if enabled
if ((MB_Ctrl_Reg_Value & 0x01) == 0x00)
{
MCI_CycleResponseMsgTimeoutFlag = false;
stopReqResCycleTimeoutTimer();
OnMessageEvent(">> REMARK: Check if Metorlogy firmware-version is at least: 5.1.24 <<");
return (byte)MCI_ErrorCodes.MCI_Error_Host_MB_disabled1;
}
//Checking iPERL previous message is in mailbox or not, if present then read it and return failure
if ((MB_Ctrl_Reg_Value & 0x02) == 0x02)
{
byte returnError;
OnMessageEvent("NFC DLL Error: Previous message not read, reading now !");
if (!_ST25DV_Device.ST25DV_ReadMailboxMessageLength(out MB_LEN_Dyn_Register))
{
returnError = (byte)MCI_ErrorCodes.MCI_Error_Host_MB_LEN_Reg_read1;
}
else
{
OnMessageEvent("NFC DLL Error: Previous message length " + MB_LEN_Dyn_Register);
if (!_ST25DV_Device.ST25DV_ReadMessage(MB_LEN_Dyn_Register, out responseMsg))
{
returnError = (byte)MCI_ErrorCodes.MCI_Error_Host_MB_msg_read1;
}
else
{
OnMessageEvent("NFC DLL Error: Previous message read as " + Tools.BytesToHex(responseMsg));
OnMessageEvent("NFC DLL Error: Present request not sent, retry again !");
returnError = (byte)MCI_ErrorCodes.MCI_Error_Host_req_not_sent;
}
}
MCI_CycleResponseMsgTimeoutFlag = false;
stopReqResCycleTimeoutTimer();
return returnError;
}
//Checking previous app message is in mailbox or not, if present then return failure !
if ((MB_Ctrl_Reg_Value & 0x04) == 0x04)
{
// Previous sent request is not read by iPERL
MCI_CycleResponseMsgTimeoutFlag = false;
stopReqResCycleTimeoutTimer();
return (byte)MCI_ErrorCodes.MCI_Error_Host_req_not_read_by_iperl;
}
//Mailbox free, so sending request message
if (_ST25DV_Device.ST25DV_WriteMessage(InBuffer))
{
while (true)
{
if (!_ST25DV_Device.ST25DV_ReadMailboxControlReg(out MB_Ctrl_Reg_Value))
{
MCI_CycleResponseMsgTimeoutFlag = false;
stopReqResCycleTimeoutTimer();
return (byte)MCI_ErrorCodes.MCI_Error_Host_MB_CTRL_Reg_Read2;
}
//Mailbox enable/disable check, proceed further only if enabled
if ((MB_Ctrl_Reg_Value & 0x01) == 0x00)
{
MCI_CycleResponseMsgTimeoutFlag = false;
stopReqResCycleTimeoutTimer();
return (byte)MCI_ErrorCodes.MCI_Error_Host_MB_disabled2;
}
//Proceed further only if host replied response message, otherwise wait in this loop
if ((MB_Ctrl_Reg_Value & 0x02) == 0x02)
{
if (!_ST25DV_Device.ST25DV_ReadMailboxMessageLength(out MB_LEN_Dyn_Register))
{
MCI_CycleResponseMsgTimeoutFlag = false;
stopReqResCycleTimeoutTimer();
return (byte)MCI_ErrorCodes.MCI_Error_Host_MB_LEN_Reg_read2;
}
else
{
if (!_ST25DV_Device.ST25DV_ReadMessage(MB_LEN_Dyn_Register, out responseMsg))
{
MCI_CycleResponseMsgTimeoutFlag = false;
stopReqResCycleTimeoutTimer();
return (byte)MCI_ErrorCodes.MCI_Error_Host_MB_msg_read2;
}
else
{
OutBuffer = new byte[responseMsg.Length];
OutBuffer = responseMsg;
MCI_CycleResponseMsgTimeoutFlag = false;
stopReqResCycleTimeoutTimer();
return (byte)MCI_ErrorCodes.Success_No_error;
}
}
}
//Checking timeout occured or not
if(MCI_CycleResponseMsgTimeoutFlag)
{
MCI_CycleResponseMsgTimeoutFlag = false;
stopReqResCycleTimeoutTimer();
return (byte)MCI_ErrorCodes.MCI_Error_Host_Timeout;
}
}
}
else
{
MCI_CycleResponseMsgTimeoutFlag = false;
stopReqResCycleTimeoutTimer();
return (byte)MCI_ErrorCodes.MCI_Error_Host_msg_write;
}
}
#region Message Event
private void OnMessageEvent(string message)
{
NfcMessageEventArgs e = new NfcMessageEventArgs();
e.Message = message;
if (MessageEvent != null)
{
MessageEvent(this, e);
}
e = null;
}
#endregion
private void StartReqResCycleTimeoutTimer(int timeoutMilliSec)
{
_ReqResCycleTimeoutTimer.Elapsed += new ElapsedEventHandler(ReqResCycleTimeoutEvent);
_ReqResCycleTimeoutTimer.Interval = timeoutMilliSec;
_ReqResCycleTimeoutTimer.Enabled = true;
_ReqResCycleTimeoutTimer.Stop();
_ReqResCycleTimeoutTimer.Start();
}
private void stopReqResCycleTimeoutTimer()
{
_ReqResCycleTimeoutTimer.Stop();
}
#region Timer Event
private void ReqResCycleTimeoutEvent(object sender, ElapsedEventArgs e)
{
MCI_CycleResponseMsgTimeoutFlag = true;
}
#endregion
}
}
+655
View File
@@ -0,0 +1,655 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
//*****************************************************************************
// Copyright 2020 Sensus GmbH Ludwigshafen. All rights reserved.
// Author: Venkat, Rajeshwar
//*****************************************************************************
namespace Sensus.iPerl.NfcHandler
{
public class NFCHeadConfig
{
private SERIAL_Driver _SERIAL_Driver;
public event DelNfc_NFCHeadConfig_MessageHandler MessageEvent;
private readonly byte NFC_HEAD_CONFIG_MAX_RETRIES = 5;
private readonly byte[] NFCHeadConfig_OK_res_msg = Encoding.ASCII.GetBytes("OK\n"); //'OK\n' - ack - request is implemented successfully
private readonly byte[] NFCHeadConfig_crst_req_msg = Encoding.ASCII.GetBytes("crst\r\n"); //'crst\r\n' - command - reset message
private readonly byte[] NFCHeadConfig_cdoff_req_msg = Encoding.ASCII.GetBytes("cdoff\r\n"); //'cdoff\r\n' - command - data mode off request message
private readonly byte[] NFCHeadConfig_cdon_req_msg = Encoding.ASCII.GetBytes("cdon\r\n"); //'cdon\r\n' - command - data mode on request message
private readonly byte[] NFCHeadConfig_cpon_req_msg = Encoding.ASCII.GetBytes("cpon\r\n"); //'cpon\r\n' - command - pulse output enable command request message
private readonly byte[] NFCHeadConfig_cnfc_req_msg = Encoding.ASCII.GetBytes("cnfc\r\n"); //'cnfc\r\n' - command - nfc interface configure request message
private readonly byte[] NFCHeadConfig_crfid_req_msg = Encoding.ASCII.GetBytes("crfid\r\n"); //'crfid\r\n' - command - rfid interface configure request message
private readonly byte[] NFCHeadConfig_cadc_req_msg = Encoding.ASCII.GetBytes("cadc\r\n"); //'cadc\r\n' - command - adc sampling start request message
private byte[] NFCHeadConfig_gw_write_req_msg = Encoding.ASCII.GetBytes("gw00\r\n"); //'gw00\r\n' - write request - gain write request message. here 00 are hex digits and to be replaced with value to be written
private readonly byte[] NFCHeadConfig_ir_read_req_msg = Encoding.ASCII.GetBytes("ir\r\n"); //'ir\r\n' - read request - interface read request message
private readonly byte[] NFCHeadConfig_ir_read_res_msg_nfc = Encoding.ASCII.GetBytes("INFC\n"); //'INFC\n' - read response - NFC interface read response message
private readonly byte[] NFCHeadConfig_ir_read_res_msg_rfid = Encoding.ASCII.GetBytes("IRFID\n"); //'IRFID\n' - read response - RFID interface read response message
private readonly byte[] NFCHeadConfig_gr_read_req_msg = Encoding.ASCII.GetBytes("gr\r\n"); //'gr\r\n' - read request - gain read request message
private readonly byte[] NFCHeadConfig_gr_read_res_msg = Encoding.ASCII.GetBytes("GR00\n"); //'GR00\n' - read response - gain read response message. here 00 are hex digits
private readonly byte[] NFCHeadConfig_opr_read_req_msg = Encoding.ASCII.GetBytes("opr\r\n"); //'opr\r\n' - read request - opamp output read request message
private readonly byte[] NFCHeadConfig_opr_read_res_msg = Encoding.ASCII.GetBytes("OP0000\n"); //'OP0000\n' - read response - opamp output read response message. here 0000 are hex digits
private readonly byte[] NFCHeadConfig_fr_read_req_msg = Encoding.ASCII.GetBytes("fr\r\n"); //'fr\r\n' - read request - firmware read request message
private readonly byte[] NFCHeadConfig_fr_read_res_msg = Encoding.ASCII.GetBytes("V1.23\n"); //'V1.23\n' - read response - firmware read response message. here 1 is major number and 23 is minor numer
public NFCHeadConfig(SERIAL_Driver serialdriver)
{
_SERIAL_Driver = serialdriver;
}
#region Message Event
private void OnMessageEvent(string message)
{
NfcMessageEventArgs e = new NfcMessageEventArgs();
e.Message = message;
if (MessageEvent != null)
{
MessageEvent(this, e);
}
e = null;
}
#endregion
private byte HexToAscii(byte u8HexDigit)
{
if (u8HexDigit < 10)
{
u8HexDigit += 0x30; //'0' - 0x30
}
else if (u8HexDigit < 16)
{
u8HexDigit -= 10;
u8HexDigit += 0x61; //'a' - 0x61
}
else
{
u8HexDigit = 0xFF;
}
return u8HexDigit;
}
static byte AsciiToHex(byte u8AsciiByte)
{
if (('0' <= u8AsciiByte) && ('9' >= u8AsciiByte))
{
u8AsciiByte -= 0x30; //'0' - 0x30
}
else if (('A' <= u8AsciiByte) && ('F' >= u8AsciiByte))
{
u8AsciiByte -= 0x41; //'A' - 0x41
u8AsciiByte += 0xA;
}
else if (('a' <= u8AsciiByte) && ('f' >= u8AsciiByte))
{
u8AsciiByte -= 0x61; //'a' - 0x61
u8AsciiByte += 0xA;
}
else
{
u8AsciiByte = 0xFF;
}
return u8AsciiByte;
}
public bool NFCHeadConfig_PulseLedOutputEnable()
{
//Switching off data mode or changing to command mode ("cdoff\r\n")
if (NFCHeadConfig_cmd_tx(NFCHeadConfig_cdoff_req_msg, NFC_HEAD_CONFIG_MAX_RETRIES) == false)
{
return false; // true - success, false - failed
}
//Pulse output enable command ("cpon\r\n")
if (NFCHeadConfig_cmd_tx(NFCHeadConfig_cpon_req_msg, NFC_HEAD_CONFIG_MAX_RETRIES) == false)
{
return false; // true - success, false - failed
}
return true; // true - success, false - failed
}
public bool NFCHeadConfig_DataLedOutputEnable()
{
//Switching on data mode ("cdon\r\n")
if (NFCHeadConfig_cmd_tx(NFCHeadConfig_cdon_req_msg, NFC_HEAD_CONFIG_MAX_RETRIES) == false)
{
return false; // true - success, false - failed
}
return true; // true - success, false - failed
}
public ushort NFCHeadConfig_ReadOpampOutput()
{
ushort temp = 0;
byte[] bytesReceived;
int retryCounter = 0;
ushort retVal = 0; // 0 - failed, any other value is Opamp Output
//Switching off data mode (means command mode is on)
if (NFCHeadConfig_cmd_tx(NFCHeadConfig_cdoff_req_msg, NFC_HEAD_CONFIG_MAX_RETRIES) == false)
{
retVal = 0;
OnMessageEvent("NFCHeadConfig_ReadOpampOutput........Failed");
return retVal; // 0 - failed, any other value is Opamp Output
}
//NFC head is in command mode
//Sending command 'cadc\r\n' for starting sampling of OP_OUT
if (NFCHeadConfig_cmd_tx(NFCHeadConfig_cadc_req_msg, NFC_HEAD_CONFIG_MAX_RETRIES) == false)
{
retVal = 0;
OnMessageEvent("NFCHeadConfig_ReadOpampOutput........Failed");
return retVal; // 0 - failed, any other value is Opamp Output
}
OnMessageEvent("NFCHeadConfig_ReadOpampOutput........Start");
while (retryCounter++ <= NFC_HEAD_CONFIG_MAX_RETRIES)
{
//OnMessageEvent("Tx- " + Encoding.ASCII.GetString(NFCHeadConfig_opr_read_req_msg) + "=0x" + Tools.ByteArrayToHexString(NFCHeadConfig_opr_read_req_msg));
OnMessageEvent("Tx- " + Encoding.ASCII.GetString(NFCHeadConfig_opr_read_req_msg));
if (_SERIAL_Driver.SendMessage(NFCHeadConfig_opr_read_req_msg, NFCHeadConfig_opr_read_req_msg.Length))
{
bytesReceived = _SERIAL_Driver.GetRawData();
//OnMessageEvent("Rx- " + Encoding.ASCII.GetString(bytesReceived) + "=0x" + Tools.ByteArrayToHexString(bytesReceived));
if ((bytesReceived[0] == NFCHeadConfig_opr_read_res_msg[0]) && (bytesReceived[1] == NFCHeadConfig_opr_read_res_msg[1]))
{
OnMessageEvent("Rx- " + Encoding.ASCII.GetString(bytesReceived));
//'OP' received as first 2 charaters in the response. 3rd to 6th are hex digits of OP_OUT from MSB to LSB respectively
temp = AsciiToHex(bytesReceived[2]);
retVal = (ushort)(temp << 12);
temp = AsciiToHex(bytesReceived[3]);
retVal += (ushort)(temp << 8);
temp = AsciiToHex(bytesReceived[4]);
retVal += (ushort)(temp << 4);
temp = AsciiToHex(bytesReceived[5]);
retVal += temp;
break;
}
else
{
Thread.Sleep(1000);
}
}
else
{
OnMessageEvent(_SERIAL_Driver.ErrorMessage);
Thread.Sleep(1000);
}
}
if (retVal == 0)
{
OnMessageEvent("NFCHeadConfig_ReadOpampOutput........Failed");
}
else
{
OnMessageEvent("NFCHeadConfig_ReadOpampOutput: " + retVal + " ........Success");
}
//Switching data mode on (means command mode is off)
NFCHeadConfig_cmd_tx(NFCHeadConfig_cdon_req_msg, NFC_HEAD_CONFIG_MAX_RETRIES);
return retVal; // 0 - failed, any other value is gain
}
public bool NFCHeadConfig_SetGain(byte gain)
{
byte[] bytesReceived;
int retryCounter = 0;
bool bRetVal = false;
//Switching off data mode (means command mode is on)
if (NFCHeadConfig_cmd_tx(NFCHeadConfig_cdoff_req_msg, NFC_HEAD_CONFIG_MAX_RETRIES) == false)
{
bRetVal = false;
OnMessageEvent("NFCHeadConfig_SetGain........Failed");
return bRetVal; // true - success, false - failed
}
OnMessageEvent("NFCHeadConfig_SetGain........Start");
NFCHeadConfig_gw_write_req_msg[2] = HexToAscii((byte)((gain & 0xF0) >> 4)); //Higher nibble of gain
NFCHeadConfig_gw_write_req_msg[3] = HexToAscii((byte)(gain & 0x0F)); //Lower nibble of gain
while (retryCounter++ <= NFC_HEAD_CONFIG_MAX_RETRIES)
{
//OnMessageEvent("Tx- " + Encoding.ASCII.GetString(NFCHeadConfig_gw_write_req_msg) + "=0x" + Tools.ByteArrayToHexString(NFCHeadConfig_gw_write_req_msg));
OnMessageEvent("Tx- " + Encoding.ASCII.GetString(NFCHeadConfig_gw_write_req_msg));
if (_SERIAL_Driver.SendMessage(NFCHeadConfig_gw_write_req_msg, NFCHeadConfig_gw_write_req_msg.Length))
{
bytesReceived = _SERIAL_Driver.GetRawData();
//OnMessageEvent("Rx- " + Encoding.ASCII.GetString(bytesReceived) + "=0x" + Tools.ByteArrayToHexString(bytesReceived));
if ((bytesReceived[0] == NFCHeadConfig_OK_res_msg[0]) && (bytesReceived[1] == NFCHeadConfig_OK_res_msg[1])
&& (bytesReceived[2] == NFCHeadConfig_OK_res_msg[2]))
{
OnMessageEvent("Rx- " + Encoding.ASCII.GetString(bytesReceived));
//'OK\n' received
bRetVal = true;
break;
}
else
{
Thread.Sleep(1000);
}
}
else
{
OnMessageEvent(_SERIAL_Driver.ErrorMessage);
Thread.Sleep(1000);
}
}
if (bRetVal)
{
OnMessageEvent("NFCHeadConfig_SetGain........Success");
}
else
{
OnMessageEvent("NFCHeadConfig_SetGain........Failed");
}
//Switching data mode on (means command mode is off)
NFCHeadConfig_cmd_tx(NFCHeadConfig_cdon_req_msg, NFC_HEAD_CONFIG_MAX_RETRIES);
return bRetVal;
}
public byte NFCHeadConfig_ReadGain()
{
byte temp = 0;
byte[] bytesReceived;
int retryCounter = 0;
byte retVal = 0; // 0 - failed, any other value is gain
//Switching off data mode (means command mode is on)
if (NFCHeadConfig_cmd_tx(NFCHeadConfig_cdoff_req_msg, NFC_HEAD_CONFIG_MAX_RETRIES) == false)
{
retVal = 0;
OnMessageEvent("NFCHeadConfig_ReadGain........Failed");
return retVal; // 0 - failed, any other value is gain
}
OnMessageEvent("NFCHeadConfig_ReadGain........Start");
//NFC head is in command mode
while (retryCounter++ <= NFC_HEAD_CONFIG_MAX_RETRIES)
{
//OnMessageEvent("Tx- " + Encoding.ASCII.GetString(NFCHeadConfig_gr_read_req_msg) + "=0x" + Tools.ByteArrayToHexString(NFCHeadConfig_gr_read_req_msg));
OnMessageEvent("Tx- " + Encoding.ASCII.GetString(NFCHeadConfig_gr_read_req_msg));
if (_SERIAL_Driver.SendMessage(NFCHeadConfig_gr_read_req_msg, NFCHeadConfig_gr_read_req_msg.Length))
{
bytesReceived = _SERIAL_Driver.GetRawData();
//OnMessageEvent("Rx- " + Encoding.ASCII.GetString(bytesReceived) + "=0x" + Tools.ByteArrayToHexString(bytesReceived));
if ((bytesReceived[0] == NFCHeadConfig_gr_read_res_msg[0]) && (bytesReceived[1] == NFCHeadConfig_gr_read_res_msg[1])
&& (bytesReceived[4] == NFCHeadConfig_gr_read_res_msg[4]))
{
OnMessageEvent("Rx- " + Encoding.ASCII.GetString(bytesReceived));
//'GR' received as first 2 charaters in the response. 3rd and 4th are gain as hex digits
temp = AsciiToHex(bytesReceived[2]);
retVal = (byte)(temp << 4);
temp = AsciiToHex(bytesReceived[3]);
retVal += temp; // 0 - failed, any other value is gain
break;
}
else
{
Thread.Sleep(1000);
}
}
else
{
OnMessageEvent(_SERIAL_Driver.ErrorMessage);
Thread.Sleep(1000);
}
}
if (retVal == 0)
{
OnMessageEvent("NFCHeadConfig_ReadGain........Failed");
}
else
{
OnMessageEvent("NFCHeadConfig_ReadGain: " + retVal + " ........Success");
}
//Switching data mode on (means command mode is off)
NFCHeadConfig_cmd_tx(NFCHeadConfig_cdon_req_msg, NFC_HEAD_CONFIG_MAX_RETRIES);
return retVal; // 0 - failed, any other value is gain
}
public bool NFCHeadConfig_SetInterface(bool value)
{
byte[] bytesTransmit;
byte[] bytesReceived;
int retryCounter = 0;
bool bRetVal = false;
//Switching off data mode (means command mode is on)
if (NFCHeadConfig_cmd_tx(NFCHeadConfig_cdoff_req_msg, NFC_HEAD_CONFIG_MAX_RETRIES) == false)
{
bRetVal = false;
OnMessageEvent("NFCHeadConfig_SetInterface........Failed");
return bRetVal; // true - success, false - failed
}
//NFC head is in command mode
if (value) //true - NFC, false - RFID
{
bytesTransmit = NFCHeadConfig_cnfc_req_msg;
OnMessageEvent("NFCHeadConfig_SetInterface: NFC........Start");
}
else
{
bytesTransmit = NFCHeadConfig_crfid_req_msg;
OnMessageEvent("NFCHeadConfig_SetInterface: RFID........Start");
}
while (retryCounter++ <= NFC_HEAD_CONFIG_MAX_RETRIES)
{
//OnMessageEvent("Tx- " + Encoding.ASCII.GetString(bytesTransmit) + "=0x" + Tools.ByteArrayToHexString(bytesTransmit));
OnMessageEvent("Tx- " + Encoding.ASCII.GetString(bytesTransmit));
if (_SERIAL_Driver.SendMessage(bytesTransmit, bytesTransmit.Length))
{
bytesReceived = _SERIAL_Driver.GetRawData();
//OnMessageEvent("Rx- " + Encoding.ASCII.GetString(bytesReceived) + "=0x" + Tools.ByteArrayToHexString(bytesReceived));
if ((bytesReceived[0] == NFCHeadConfig_OK_res_msg[0]) && (bytesReceived[1] == NFCHeadConfig_OK_res_msg[1])
&& (bytesReceived[2] == NFCHeadConfig_OK_res_msg[2]))
{
OnMessageEvent("Rx- " + Encoding.ASCII.GetString(bytesReceived));
//'OK\n' received
bRetVal = true;
break;
}
else
{
Thread.Sleep(1000);
}
}
else
{
OnMessageEvent(_SERIAL_Driver.ErrorMessage);
Thread.Sleep(1000);
}
}
if (bRetVal)
{
OnMessageEvent("NFCHeadConfig_SetInterface........Success");
}
else
{
OnMessageEvent("NFCHeadConfig_SetInterface........Failed");
}
//Switching data mode on (means command mode is off)
NFCHeadConfig_cmd_tx(NFCHeadConfig_cdon_req_msg, NFC_HEAD_CONFIG_MAX_RETRIES);
return bRetVal;
}
public byte NFCHeadConfig_ReadInterface()
{
byte[] bytesReceived;
int retryCounter = 0;
byte retVal = 0; // 0 - failed, 1 - NFC, 2 - RFID
//Switching off data mode (means command mode is on)
if (NFCHeadConfig_cmd_tx(NFCHeadConfig_cdoff_req_msg, NFC_HEAD_CONFIG_MAX_RETRIES) == false)
{
retVal = 0;
OnMessageEvent("NFCHeadConfig_ReadInterface........Failed");
return retVal; // 0 - failed, any other value is gain
}
OnMessageEvent("NFCHeadConfig_ReadInterface........Start");
//NFC head is in command mode
while (retryCounter++ < NFC_HEAD_CONFIG_MAX_RETRIES)
{
//OnMessageEvent("Tx- " + Encoding.ASCII.GetString(NFCHeadConfig_ir_read_req_msg) + "=0x" + Tools.ByteArrayToHexString(NFCHeadConfig_ir_read_req_msg));
OnMessageEvent("Tx- " + Encoding.ASCII.GetString(NFCHeadConfig_ir_read_req_msg));
if (_SERIAL_Driver.SendMessage(NFCHeadConfig_ir_read_req_msg, NFCHeadConfig_ir_read_req_msg.Length))
{
bytesReceived = _SERIAL_Driver.GetRawData();
//OnMessageEvent("Rx- " + Encoding.ASCII.GetString(bytesReceived) + "=0x" + Tools.ByteArrayToHexString(bytesReceived));
if ((bytesReceived[0] == NFCHeadConfig_ir_read_res_msg_nfc[0]) && (bytesReceived[1] == NFCHeadConfig_ir_read_res_msg_nfc[1])
&& (bytesReceived[2] == NFCHeadConfig_ir_read_res_msg_nfc[2]) && (bytesReceived[3] == NFCHeadConfig_ir_read_res_msg_nfc[3]))
{
OnMessageEvent("Rx- " + Encoding.ASCII.GetString(bytesReceived));
retVal = 1; // 0 - failed, 1 - NFC, 2 - RFID
break;
}
else if ((bytesReceived[0] == NFCHeadConfig_ir_read_res_msg_rfid[0]) && (bytesReceived[1] == NFCHeadConfig_ir_read_res_msg_rfid[1])
&& (bytesReceived[2] == NFCHeadConfig_ir_read_res_msg_rfid[2]) && (bytesReceived[3] == NFCHeadConfig_ir_read_res_msg_rfid[3])
&& (bytesReceived[4] == NFCHeadConfig_ir_read_res_msg_rfid[4]))
{
OnMessageEvent("Rx- " + Encoding.ASCII.GetString(bytesReceived));
retVal = 2; // 0 - failed, 1 - NFC, 2 - RFID
break;
}
else
{
Thread.Sleep(1000);
}
}
else
{
OnMessageEvent(_SERIAL_Driver.ErrorMessage);
Thread.Sleep(1000);
}
}
if (retVal == 0)
{
OnMessageEvent("NFCHeadConfig_ReadInterface........Failed");
}
else if (retVal == 1)
{
OnMessageEvent("NFCHeadConfig_ReadInterface: NFC ........Success");
}
else if (retVal == 2)
{
OnMessageEvent("NFCHeadConfig_ReadInterface: RFID ........Success");
}
//Switching data mode on (means command mode is off)
NFCHeadConfig_cmd_tx(NFCHeadConfig_cdon_req_msg, NFC_HEAD_CONFIG_MAX_RETRIES);
return retVal; // 0 - failed, 1 - NFC, 2 - RFID
}
public byte[] NFCHeadConfig_ReadFirmwareVersion()
{
byte[] bytesReceived = { 0 };
int retryCounter = 0;
//Switching off data mode (means command mode is on)
if (NFCHeadConfig_cmd_tx(NFCHeadConfig_cdoff_req_msg, NFC_HEAD_CONFIG_MAX_RETRIES) == false)
{
OnMessageEvent("NFCHeadConfig_ReadFirmwareVersion........Failed");
return bytesReceived; // 0 - failed
}
OnMessageEvent("NFCHeadConfig_ReadFirmwareVersion........Start");
//NFC head is in command mode
while (retryCounter++ <= NFC_HEAD_CONFIG_MAX_RETRIES)
{
//OnMessageEvent("Tx- " + Encoding.ASCII.GetString(NFCHeadConfig_fr_read_req_msg) + "=0x" + Tools.ByteArrayToHexString(NFCHeadConfig_fr_read_req_msg));
OnMessageEvent("Tx- " + Encoding.ASCII.GetString(NFCHeadConfig_fr_read_req_msg));
if (_SERIAL_Driver.SendMessage(NFCHeadConfig_fr_read_req_msg, NFCHeadConfig_fr_read_req_msg.Length))
{
bytesReceived = _SERIAL_Driver.GetRawData();
//OnMessageEvent("Rx- " + Encoding.ASCII.GetString(bytesReceived) + "=0x" + Tools.ByteArrayToHexString(bytesReceived));
if (bytesReceived[0] == NFCHeadConfig_fr_read_res_msg[0])
{
//'V' is received as first character in the response. So, the firmware version string is followed and ended with '\n'
OnMessageEvent("Rx- " + Encoding.ASCII.GetString(bytesReceived));
break;
}
else
{
Thread.Sleep(1000);
}
}
else
{
OnMessageEvent(_SERIAL_Driver.ErrorMessage);
Thread.Sleep(1000);
}
}
if (bytesReceived[0] == 0)
{
OnMessageEvent("NFCHeadConfig_ReadFirmwareVersion........Failed");
}
else
{
OnMessageEvent("NFCHeadConfig_ReadFirmwareVersion........Success");
}
//Switching data mode on (means command mode is off)
NFCHeadConfig_cmd_tx(NFCHeadConfig_cdon_req_msg, NFC_HEAD_CONFIG_MAX_RETRIES);
return bytesReceived; // 0 - failed, any other value is firmware version
}
private bool NFCHeadConfig_cmd_tx(byte[] requestTxMessage, int retries)
{
byte[] bytesReceived;
int retryCounter = 0;
bool bRetVal = false;
if (requestTxMessage == NFCHeadConfig_cpon_req_msg)
{
OnMessageEvent("NFCHeadConfig_cpon........Start");
}
else if (requestTxMessage == NFCHeadConfig_cdoff_req_msg)
{
OnMessageEvent("NFCHeadConfig_cdoff........Start");
}
else if (requestTxMessage == NFCHeadConfig_cdon_req_msg)
{
OnMessageEvent("NFCHeadConfig_cdon........Start");
}
else if (requestTxMessage == NFCHeadConfig_cnfc_req_msg)
{
OnMessageEvent("NFCHeadConfig_cnfc........Start");
}
else if (requestTxMessage == NFCHeadConfig_crfid_req_msg)
{
OnMessageEvent("NFCHeadConfig_crfid........Start");
}
else if (requestTxMessage == NFCHeadConfig_cadc_req_msg)
{
OnMessageEvent("NFCHeadConfig_cadc........Start");
}
else if (requestTxMessage == NFCHeadConfig_crst_req_msg)
{
OnMessageEvent("NFCHeadConfig_crst........Start");
}
else
{
OnMessageEvent("NFCHeadConfig_cmd_tx: unidentified command........Failed");
bRetVal = false;
return bRetVal;
}
while (++retryCounter <= retries)
{
//OnMessageEvent("Tx- " + Encoding.ASCII.GetString(requestTxMessage) + "=0x" + Tools.ByteArrayToHexString(requestTxMessage));
OnMessageEvent("Tx- " + Encoding.ASCII.GetString(requestTxMessage));
if (_SERIAL_Driver.SendMessage(requestTxMessage, requestTxMessage.Length))
{
bytesReceived = _SERIAL_Driver.GetRawData();
//OnMessageEvent("Rx- " + Encoding.ASCII.GetString(bytesReceived) + "=0x" + Tools.ByteArrayToHexString(bytesReceived));
if ((bytesReceived[0] == NFCHeadConfig_OK_res_msg[0]) && (bytesReceived[1] == NFCHeadConfig_OK_res_msg[1])
&& (bytesReceived[2] == NFCHeadConfig_OK_res_msg[2]))
{
OnMessageEvent("Rx- " + Encoding.ASCII.GetString(NFCHeadConfig_OK_res_msg));
//'OK\n' received
bRetVal = true;
break;
}
else
{
Thread.Sleep(1000);
}
}
else
{
OnMessageEvent(_SERIAL_Driver.ErrorMessage);
Thread.Sleep(1000);
}
}
if (bRetVal == true)
{
if (requestTxMessage == NFCHeadConfig_cpon_req_msg)
{
OnMessageEvent("NFCHeadConfig_cpon........Success");
}
else if (requestTxMessage == NFCHeadConfig_cdoff_req_msg)
{
OnMessageEvent("NFCHeadConfig_cdoff........Success");
}
else if (requestTxMessage == NFCHeadConfig_cdon_req_msg)
{
OnMessageEvent("NFCHeadConfig_cdon........Success");
}
else if (requestTxMessage == NFCHeadConfig_cnfc_req_msg)
{
OnMessageEvent("NFCHeadConfig_cnfc........Success");
}
else if (requestTxMessage == NFCHeadConfig_crfid_req_msg)
{
OnMessageEvent("NFCHeadConfig_crfid........Success");
}
else if (requestTxMessage == NFCHeadConfig_cadc_req_msg)
{
OnMessageEvent("NFCHeadConfig_cadc........Success");
}
else if (requestTxMessage == NFCHeadConfig_crst_req_msg)
{
OnMessageEvent("NFCHeadConfig_crst........Success");
}
}
else
{
if (requestTxMessage == NFCHeadConfig_cpon_req_msg)
{
OnMessageEvent("NFCHeadConfig_cpon........Failed");
}
else if (requestTxMessage == NFCHeadConfig_cdoff_req_msg)
{
OnMessageEvent("NFCHeadConfig_cdoff........Failed");
}
else if (requestTxMessage == NFCHeadConfig_cdon_req_msg)
{
OnMessageEvent("NFCHeadConfig_cdon........Failed");
}
else if (requestTxMessage == NFCHeadConfig_cnfc_req_msg)
{
OnMessageEvent("NFCHeadConfig_cnfc........Failed");
}
else if (requestTxMessage == NFCHeadConfig_crfid_req_msg)
{
OnMessageEvent("NFCHeadConfig_crfid........Failed");
}
else if (requestTxMessage == NFCHeadConfig_cadc_req_msg)
{
OnMessageEvent("NFCHeadConfig_cadc........Failed");
}
else if (requestTxMessage == NFCHeadConfig_crst_req_msg)
{
OnMessageEvent("NFCHeadConfig_crst........Failed");
}
}
return bRetVal;
}
}
}
+550
View File
@@ -0,0 +1,550 @@
using System;
using System.IO.Ports;
using System.Text;
using System.Threading;
//*****************************************************************************
// Copyright 2020 Sensus GmbH Ludwigshafen. All rights reserved.
// Author: Venkat, Rajeshwar
//*****************************************************************************
namespace Sensus.iPerl.NfcHandler
{
public sealed class NfcDataHandler
{
private string _ComPort = "";
private readonly byte[] readCommand = { 0x80, 0x08, 0x00, 0x03, 0x00, 0x00 };
public SERIAL_Driver _SERIAL_Driver;
public SERIAL_Driver _SERIAL_Driver_Head_Config;
public CR95HF_Reader _CR95HF_Reader;
public ST25DV_Device _ST25DV_Device;
public MCI_Protocol _MCI_Protocol;
public NFCHeadConfig _NFCHead_Config;
public byte LastErrorCode { get; set; }
public string LastErrorMessage { get; set; }
public byte[] LastData { get; set; }
public event DelNfcMessageHandler MessageEvent;
public NfcDataHandler()
{
_SERIAL_Driver = new SERIAL_Driver();
_SERIAL_Driver_Head_Config = new SERIAL_Driver();
_CR95HF_Reader = new CR95HF_Reader(_SERIAL_Driver);
_ST25DV_Device = new ST25DV_Device(_CR95HF_Reader);
_MCI_Protocol = new MCI_Protocol(_ST25DV_Device);
_NFCHead_Config = new NFCHeadConfig(_SERIAL_Driver_Head_Config);
LastErrorCode = 0;
}
public bool OpenConnection(string comport, int baudrate, int databits, Parity parity, StopBits stopbits)
{
_ComPort = comport;
bool isopen = _SERIAL_Driver.OpenConnection(comport, baudrate, databits, parity, stopbits);
if (!isopen) OnMessageEvent(_SERIAL_Driver.ErrorMessage);
return isopen;
}
public bool isOpen()
{
return _SERIAL_Driver.isOpen();
}
public void Close()
{
_SERIAL_Driver.Close();
_SERIAL_Driver.Dispose();
}
public bool OpenConnectionSTM(string comport)
{
// helper for lazy people who don't know the comport settings or don't have
// parameters of type 'Parity' or 'StopBits' in their language (Python) at hand
// used here: https://slm.sms-esaap.com/iPERL/tetoo/-/tree/dev/tetoo/nfcs5_dll_wrapper
return OpenConnection(comport, 57600, 8, Parity.None, StopBits.Two);
}
public bool NFCHead_OpenConnection(string comport)
{
if (isOpen() && _ComPort == comport)
{
OnMessageEvent(comport + "......... Already in use ");
return false;
}
bool isopen = _SERIAL_Driver_Head_Config.OpenConnection(comport, 9600, 8, Parity.None, StopBits.Two);
OnMessageEvent(_SERIAL_Driver_Head_Config.ErrorMessage);
return isopen;
}
public bool isNFCHeadOpen()
{
return _SERIAL_Driver_Head_Config.isOpen();
}
public void NFCHeadClose()
{
if (_SERIAL_Driver_Head_Config.isOpen())
{
_SERIAL_Driver_Head_Config.Close();
_SERIAL_Driver_Head_Config.Dispose();
}
}
public bool ConnectReader()
{
if (_CR95HF_Reader.CR95HF_Connect())
{
OnMessageEvent("CombiHead.......Connected");
return true;
}
else
{
OnMessageEvent("CombiHead.......Not connected");
return false;
}
}
public bool RFProtocolON()
{
if (_CR95HF_Reader.CR95HF_RFProtocolOn())
{
OnMessageEvent("NFC CR95HF RF Protocol ON........Success");
return true;
}
else
{
OnMessageEvent("NFC CR95HF RF Protocol ON........Failed");
return false;
}
}
public bool RFProtocolOFF()
{
if (_CR95HF_Reader.CR95HF_RFProtocolOff())
{
OnMessageEvent("NFC CR95HF RF Protocol OFF........Success");
return true;
}
else
{
OnMessageEvent("NFC CR95HF RF Protocol OFF........Failed");
return false;
}
}
public bool ConnectDevice()
{
byte[] responseData;
if (_CR95HF_Reader.CR95HF_RFProtocolOn())
{
if (GetSystemInfo())
{
responseData = LastData;
if (responseData[0] == 0x0F)
OnMessageEvent("Device -> ST25DV04K");
else
OnMessageEvent("Device -> ST25DV16K or 64K");
OnMessageEvent("UID -> " + Tools.ByteToHexString(responseData[1]) + " " + Tools.ByteToHexString(responseData[2]) + " " + Tools.ByteToHexString(responseData[3]) + " " + Tools.ByteToHexString(responseData[4]) +
" " + Tools.ByteToHexString(responseData[5]) + " " + Tools.ByteToHexString(responseData[6]) + " " + Tools.ByteToHexString(responseData[7]) + " " + Tools.ByteToHexString(responseData[8]));
//OnMessageEvent("DSFID -> " + Tools.ByteToHexString(responseData[9]));
//OnMessageEvent("AFI -> " + Tools.ByteToHexString(responseData[10]));
//OnMessageEvent("Block size -> " + Tools.ByteToHexString(responseData[11]));
//OnMessageEvent("Memory size -> " + Tools.ByteToHexString(responseData[12]));
//if (responseData[13] == 0x24)
// OnMessageEvent("IC Ref -> ST25DV04K");
//else
// OnMessageEvent("IC Ref -> ST25DV16K or 64K");
OnMessageEvent("iPERL.......Connected");
return true;
}
else
{
OnMessageEvent("iPERL.......Not connected");
}
}
return false;
}
public bool GetSystemInfo()
{
byte[] responseData = null;
try
{
if (_ST25DV_Device.ST25DV_GetSystemInfo(out responseData))
{
LastData = responseData;
return true;
}
}
catch (Exception ex)
{
OnMessageEvent(ex.Message);
}
return false;
}
public bool ST25DV_ReadSingleBlock(byte blockNumber, out byte[] outBuffer)
{
return _ST25DV_Device.ST25DV_ReadSingleBlock(blockNumber, out outBuffer);
}
public bool ST25DV_WriteSingleBlock(byte blockNumber, byte[] inBuffer)
{
return _ST25DV_Device.ST25DV_WriteSingleBlock(blockNumber, inBuffer);
}
public bool ST25DV_ReadMultipleBlocks(byte startingBlockNumber, byte numberOfBlocks, out byte[] OutBuffer)
{
return _ST25DV_Device.ST25DV_ReadMultipleBlocks(startingBlockNumber, numberOfBlocks, out OutBuffer);
}
public bool Echo()
{
if (!_CR95HF_Reader.CR95HF_Echo())
{
OnMessageEvent("Echo..Failed. CombiHead connection...Lost");
return false;
}
return true;
}
public bool ST25DV_ReadConfiguration(byte pointer, out byte value)
{
return _ST25DV_Device.ST25DV_ReadConfiguration(pointer, out value, true);
}
public bool ST25DV_ReadDynamicConfiguration(byte regAddress, out byte OutBuffer)
{
return _ST25DV_Device.ST25DV_ReadDynamicConfiguration(regAddress, out OutBuffer, true);
}
public bool ST25DV_WriteDynamicConfiguration(byte regAddress, byte regValue)
{
return _ST25DV_Device.ST25DV_WriteDynamicConfiguration(regAddress, regValue, true);
}
public bool ST25DV_ReadMailboxMessageLength(out byte MessageLength)
{
return _ST25DV_Device.ST25DV_ReadMailboxMessageLength(out MessageLength, true);
}
// This function-header is needed for calls to the DLL without need for using enums.
// In python 3.11 the module pythonnet (v3.x) does not support casting 'int' to 'enum' aynmore,
// so this workaround is needed.
public bool MCI_Read_pythonwrapper_enum(int STIndex, ushort offset, byte payloadlength, int timeoutMs)
{
return MCI_Read((MCI_Protocol.StructName)STIndex, offset, payloadlength, timeoutMs);
}
public bool MCI_Read(MCI_Protocol.StructName StName, ushort offset, byte payloadlength, int timeoutMs)
{
LastErrorMessage = string.Empty;
byte[] response;
byte errorCode = 0;
if (ST25DV_MailboxCommStart())
{
bool worked = _MCI_Protocol.MCI_Read(StName, offset, payloadlength, timeoutMs, out response, out errorCode);
LastErrorCode = errorCode;
LastData = response;
if (!worked)
{
SetLastErrorMesage();
return false;
}
return true;
}
return false;
}
// This function-header is needed for calls to the DLL without need for using enums.
// In python 3.11 the module pythonnet (v3.x) does not support casting 'int' to 'enum' aynmore,
// so this workaround is needed.
public bool MCI_Write_pythonwrapper_enum(int STIndex, ushort offset, byte payloadlength, byte[] payload, int timeoutMs)
{
return MCI_Write((MCI_Protocol.StructName)STIndex, offset, payloadlength, payload, timeoutMs);
}
public bool MCI_Write(MCI_Protocol.StructName StName, ushort offset, byte payloadlength, byte[] payload, int timeoutMs)
{
LastErrorMessage = string.Empty;
LastData = null;
byte errorCode = 0;
if (ST25DV_MailboxCommStart())
{
bool ans = _MCI_Protocol.MCI_Write(StName, offset, payloadlength, payload, timeoutMs, out errorCode);
LastErrorCode = errorCode;
if (!ans)
{
SetLastErrorMesage();
return false;
}
return true;
}
return false;
}
public bool MCI_Write_Read(MCI_Protocol.StructName StName, ushort offset, byte payloadlength, byte[] payload, int timeoutMs)
{
LastErrorMessage = string.Empty;
LastData = null;
byte[] response;
byte errorCode = 0;
if (ST25DV_MailboxCommStart())
{
bool ans = _MCI_Protocol.MCI_Write_Read(StName, offset, payloadlength, payload, out response, timeoutMs, out errorCode);
LastErrorCode = errorCode;
LastData = response;
if (!ans)
{
SetLastErrorMesage();
return false;
}
return true;
}
return false;
}
private bool ST25DV_MailboxCommStart()
{
// wake up the ST25DV by setting the GPO pin to output a pulse -> INT on Metro (set highest bit to one -> causes a pulse on GPO)
if (_ST25DV_Device.ST25DV_WriteGPOManageCommand(_ST25DV_Device.GPO_MANAGE_SET_PULSE, false))
{
Thread.Sleep(10); // wait 10ms to give metro some time
byte MB_Ctrl_Reg_Value = 0x00;
for (int i = 0; i < 20; i++) // do 20 retries max (20 times 100ms = 2sec, which should be more than enough)
{
if (_ST25DV_Device.ST25DV_ReadMailboxControlReg(out MB_Ctrl_Reg_Value))
{
if ((MB_Ctrl_Reg_Value & 0x01) == 0x01)
{
return true; //With this we proceed for mailbox communication with ST25
}
else
{
Thread.Sleep(100); // wait 100ms, then try again
LastErrorMessage = "Mailbox was not activated by Firmware (ST25DV_MailboxCommStart), try again";
}
}
else
{
Thread.Sleep(100); // wait 100ms, then try again
LastErrorMessage = "Mailbox state could not be read (ST25DV_MailboxCommStart), try again";
}
}
LastErrorCode = 0x08; //MCI Error: Unidentified
OnMessageEvent(">> REMARK: Check if Metorlogy firmware-version is at least: 5.1.24 <<");
return false;
}
else
{
LastErrorCode = 0x08; //MCI Error: Unidentified
LastErrorMessage = "GPO config writing failed(ST25DV_MailboxCommStart), try again";
return false;
}
}
private void SetLastErrorMesage()
{
try
{
LastErrorMessage = MCI_Protocol.GetMCIErrorMessage(LastErrorCode);
}
catch
{
LastErrorMessage = "MCI Error: The Errorcode '" + LastErrorCode as string +
"' couldn't be converted to string with the enum MCI_ErrorCodes!";
}
}
public bool NFCHeadConfig_PulseLedOutputEnable()
{
return _NFCHead_Config.NFCHeadConfig_PulseLedOutputEnable(); // true - success, false - failed
}
public bool NFCHeadConfig_DataLedOutputEnable()
{
return _NFCHead_Config.NFCHeadConfig_DataLedOutputEnable(); // true - success, false - failed
}
public ushort NFCHeadConfig_ReadOpampOutput()
{
return _NFCHead_Config.NFCHeadConfig_ReadOpampOutput(); // 0 - failed, any other value is opamp output
}
public bool NFCHeadConfig_SetGain(byte gain)
{
return _NFCHead_Config.NFCHeadConfig_SetGain(gain); // true - success, false - failed
}
public byte NFCHeadConfig_ReadGain()
{
return _NFCHead_Config.NFCHeadConfig_ReadGain(); // 0 - failed, any other value is gain
}
public bool NFCHeadConfig_SetInterface(bool value)
{
return _NFCHead_Config.NFCHeadConfig_SetInterface(value); // true - success, false - failed
}
public byte NFCHeadConfig_ReadInterface()
{
return _NFCHead_Config.NFCHeadConfig_ReadInterface(); // 0 - failed, 1 - NFC, 2 - RFID
}
public byte[] NFCHeadConfig_ReadFirmwareVersion()
{
return _NFCHead_Config.NFCHeadConfig_ReadFirmwareVersion(); // 0 - failed, any other value is firmware version
}
public bool NFCSecurity_SendSignedCommand(byte[] payload, int timeoutMs)
{
byte payloadLength = Convert.ToByte(payload.Length);
ushort offset = 0;
try
{
if ((!MCI_Write(MCI_Protocol.StructName.NfcSecurity, offset, payloadLength, payload, timeoutMs)) || (LastErrorCode != 0x00))
{
return false;
}
}
catch (Exception ex)
{
OnMessageEvent(ex.Message);
}
return true; // true - success, false - failed
}
public string NFCSecurity_Read_EndpointId(int timeoutMs)
{
string result = string.Empty;
byte[] payload = readCommand;
byte payloadLength = Convert.ToByte(payload.Length);
ushort offset = 0;
try
{
if ((!MCI_Write_Read(MCI_Protocol.StructName.NfcSecurity, offset, payloadLength, payload, timeoutMs)) || (LastErrorCode != 0x00))
{
return string.Empty;
}
}
catch (Exception ex)
{
OnMessageEvent(ex.Message);
return string.Empty;
}
//Check response header
if (LastData[0] != 0x05 || LastData[1] != 0x00)
{
LastErrorMessage = "Wrong response header";
return string.Empty;
}
//Check length byte
if (LastData[2] == 0x00)
{
LastErrorMessage = "Response length is 0";
return string.Empty;
}
//Check length of message
int lengthMessage = LastData[2] + 3; // two header bytes and one length byte
if (LastData.Length != lengthMessage)
{
LastErrorMessage = "Response length is wrong";
return string.Empty;
}
//Check identifier for information
if (LastData[3] != 0x00 || LastData[4] != 0x00)
{
LastErrorMessage = "Wrong identifier";
return string.Empty;
}
int lengthEndpointId = LastData[2] - 2; //Identifier bytes
byte[] id = new byte[lengthEndpointId];
Array.Copy(LastData, 5, id, 0, lengthEndpointId);
result = Encoding.ASCII.GetString(id);
return result;
}
public byte NFCSecurity_ReadPrivilegeLevel(int timeoutMs)
{
ushort offset = 0;
byte payloadLength = 1;
byte payload = 4;
try
{
if ((!MCI_Read(MCI_Protocol.StructName.NfcSecurity, offset, payloadLength, timeoutMs)) || (LastErrorCode != 0x00))
{
payload = 4;
}
else
{
payload = LastData[0];
}
}
catch (Exception ex)
{
OnMessageEvent(ex.Message);
}
return payload; // 0 - No Security, 1 - Customer Maintenance, 2 - Customer Admin, 3 - Sensus Admin, 4 and above - failed
}
public bool NFCSecurity_ClearPrivilegeLevel(int timeoutMs)
{
ushort offset = 0;
byte payloadLength = 1;
byte[] payload = { 0x23 }; // 0x23 - Command code for 'NFC Security reset access level'
try
{
if ((!MCI_Write(MCI_Protocol.StructName.Command, offset, payloadLength, payload, timeoutMs)) || (LastErrorCode != 0x00))
{
return false;
}
}
catch (Exception ex)
{
OnMessageEvent(ex.Message);
}
return true; // true - success, false - failed
}
public string GetDllVersion()
{
Version dll_version = System.Reflection.Assembly.GetExecutingAssembly().GetName().Version;
return "NfcS5 DLL v" + String.Format("{0}.{1}.{2}", dll_version.Major, dll_version.Minor, dll_version.Build); //, dll_version.MajorRevision);
}
#region Message Event
private void OnMessageEvent(string message)
{
NfcMessageEventArgs e = new NfcMessageEventArgs();
e.Message = message;
if (MessageEvent != null)
{
MessageEvent(this, e);
}
e = null;
}
#endregion
}
}
+23
View File
@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
//*****************************************************************************
// Copyright 2020 Sensus GmbH Ludwigshafen. All rights reserved.
// Author: Venkat, Rajeshwar
//*****************************************************************************
namespace Sensus.iPerl.NfcHandler
{
public delegate void DelNfcMessageHandler(object sender, NfcMessageEventArgs e);
public delegate void DelNfc_ST25DV_MessageHandler(object sender, NfcMessageEventArgs e);
public delegate void DelNfc_CR95HF_MessageHandler(object sender, NfcMessageEventArgs e);
public delegate void DelNfc_MCI_MessageHandler(object sender, NfcMessageEventArgs e);
public delegate void DelNfc_NFCHeadConfig_MessageHandler(object sender, NfcMessageEventArgs e);
public class NfcMessageEventArgs
{
public string Message;
}
}
+155
View File
@@ -0,0 +1,155 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO.Ports;
using System.Threading;
using System.Diagnostics;
using System.Collections.ObjectModel;
//*****************************************************************************
// Copyright 2020 Sensus GmbH Ludwigshafen. All rights reserved.
// Author: Venkat, Rajeshwar
//*****************************************************************************
namespace Sensus.iPerl.NfcHandler
{
public class SERIAL_Driver
{
public string ErrorMessage { get; private set; }
public Collection<byte> SerialPortReadBuffer = new Collection<byte>();
private SerialPort _serialPort;
private List<byte[]> _binMessages = new List<byte[]>();
private bool _isReading;
private Parity Parity { get; set; }
private StopBits StopBits { get; set; }
public SERIAL_Driver()
{
_serialPort = new SerialPort();
}
public bool OpenConnection(string comPort, int baudrate, int dataBits, Parity parity, StopBits stopbits, int readTimeout=1000, int writeTimeout = 1000)
{
lock (this)
{
if ((_serialPort != null) && (_serialPort.IsOpen))
{
_serialPort.DataReceived -= DataReceivedHandler;
_serialPort.Close();
_serialPort.Dispose();
_serialPort = null;
}
try
{
ErrorMessage = "";
//_serialPort = new SerialPort(comPort, 57600, Parity.None, 8, StopBits.Two);
_serialPort = new SerialPort(comPort, baudrate, parity, dataBits, stopbits);
_serialPort.ReadTimeout = readTimeout;
_serialPort.WriteTimeout = writeTimeout;
_serialPort.DataReceived += new SerialDataReceivedEventHandler(DataReceivedHandler);
_serialPort.Open();
}
catch (Exception ex)
{
ErrorMessage = String.Format("COM error: Open failed {0}.{1}", comPort, ex.Message);
return false;
}
if (!_serialPort.IsOpen)
{
ErrorMessage = String.Format("COM error: Can't Open {0}.", comPort);
return false;
}
}//End Lock
return true;
}
public bool SendMessage(byte[] sendDataBytes, int length, int readTimeout = 1000, int writeTimeout=1000)
{
if (!isOpen()) return false;
if (sendDataBytes.Length == 0) return true; // nothing to send - no error
try
{
PrepareReading(); //clear read buffer etc.
_serialPort.WriteTimeout = writeTimeout;
_serialPort.ReadTimeout = readTimeout;
_serialPort.Write(sendDataBytes, 0, length);
_isReading = true;
Thread.Sleep(100);
var stopWatch = Stopwatch.StartNew(); //start stop watch for data recevie timeout
while (_isReading) //wait until reading finishes or timeout occur
{
if (stopWatch.ElapsedMilliseconds > readTimeout)
{
stopWatch.Stop();
ErrorMessage = "COM error: Receive timeout";
return false;
}
}
}
catch (Exception ex)
{
ErrorMessage = String.Format("COM error: Transmit timeout {0}.{1}", _serialPort.PortName, ex.Message);
return false; // Exception in send function
}
return true;
}
private void PrepareReading()
{
_serialPort.DiscardInBuffer();
if(_binMessages != null) _binMessages.Clear();
_isReading = true;
}
public byte[] GetRawData()
{
try
{
return _binMessages[0].ToArray();
}
catch(Exception)
{
byte[] err = { 0xFF };
return err;
}
}
private void DataReceivedHandler(object sender, SerialDataReceivedEventArgs e)
{
if (!_serialPort.IsOpen) return;
lock (this)
{
Thread.Sleep(100);
SerialPortReadBuffer = new Collection<byte>();
while (_serialPort.BytesToRead > 0)
{
SerialPortReadBuffer.Add((byte)_serialPort.ReadByte());
}
_binMessages.Add(SerialPortReadBuffer.ToArray());
_isReading = false;
}
}
public void Close()
{
if (isOpen())
{
_serialPort.Close();
}
}
public void Dispose()
{
if (_serialPort != null)
{
_serialPort.Dispose();
}
}
public bool isOpen()
{
if(_serialPort != null)
return _serialPort.IsOpen;
return false;
}
}
}
+433
View File
@@ -0,0 +1,433 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
//*****************************************************************************
// Copyright 2020 Sensus GmbH Ludwigshafen. All rights reserved.
// Author: Venkat, Rajeshwar
//*****************************************************************************
namespace Sensus.iPerl.NfcHandler
{
public class ST25DV_Device
{
private readonly byte[] ST25DV_CMD_GET_SYSTEM_INFO = { 0x2B }; //Command code
private byte[] ST25DV_CMD_READ_SINGLE_BLOCK = { 0x20, 0x00 }; //Command code, EEPROM block number (this will be received from caller).
private byte[] ST25DV_CMD_WRITE_SINGLE_BLOCK = { 0x21, 0x00, 0x00, 0x00, 0x00, 0x00 }; //Command code, EEPROM block number (this will be received from caller), 4-byte payload to be written (this will be received from caller).
private byte[] ST25DV_CMD_READ_MULTIPLE_BLOCKS = { 0x23, 0x00, 0x00 }; //Command code, EEPROM starting block number (this will be received from caller), number of blocks (this will be received from caller)
private byte[] ST25DV_CMD_READ_CONFIG = { 0xA0, 0x02, 0x00 }; //Command code, IC Mfg Code, Register address (this will be received from caller)
private byte[] ST25DV_CMD_READ_DYNAMIC_CONFIG = { 0xAD, 0x02, 0x00 }; //Command code, IC Mfg Code, Register address (this will be received from caller)
private byte[] ST25DV_CMD_WRITE_DYNAMIC_CONFIG = { 0xAE, 0x02, 0x00, 0x00 }; //Command code, IC Mfg Code, Register address, register value to be written
private readonly byte[] ST25DV_CMD_READ_MAILBOX_CONTROL_REG = { 0xAD, 0x02, 0x0D }; //Command code, IC Mfg Code, MB_CTRL_Dyn Register address
private readonly byte[] ST25DV_CMD_READ_MAILBOX_MESSAGE_LENGTH = { 0xAB, 0x02 }; //Command code, IC Mfg Code
private byte[] ST25DV_CMD_READ_MESSAGE = { 0xAC, 0x02, 0x00, 0x00 }; //Command code, IC Mfg Code, Mailbox pointer(mostly this is 0), NumberofBytesToRead (this will be received from caller)
private byte[] ST25DV_CMD_MANAGE_GPO = { 0xA9, 0x02, 0x00 }; //Command code, IC Mfg Code, GPO value
public readonly byte GPO_MANAGE_SET_PULSE = 0x80; // Command code to set a pulse on the GPO pin (if enabled by FW in the Meter)
private CR95HF_Reader _CR95HF_Reader;
private System.Timers.Timer _CycleTimeoutTimer = new System.Timers.Timer();
private static readonly Dictionary<byte, string> ST25DV_ErrorCodes = new Dictionary<byte, string>
{
{0x00 , "Success, No error" },
{0x01 , "Command is not supported" },
{0x02 , "Command is not recognized(format error)" },
{0x03 , "Option not supported" },
{0x0F , "Error with no information given" },
{0x10 , "The specified block is not available" },
{0x11 , "The specified block is already locked and thus cannot be locked again" },
{0x12 , "The specified block is locked and its contents cannot be changed" },
{0x13 , "The specified block was not successfully programmed" },
{0x14 , "The specified block was not successfully locked" },
{0x15 , "The specified block is protected in read" }
};
public event DelNfc_ST25DV_MessageHandler MessageEvent;
public ST25DV_Device(CR95HF_Reader CR95HFReader)
{
_CR95HF_Reader = CR95HFReader;
}
#region Message Event
private void OnMessageEvent(string message)
{
NfcMessageEventArgs e = new NfcMessageEventArgs();
e.Message = message;
if (MessageEvent != null)
{
MessageEvent(this, e);
}
e = null;
}
#endregion
public bool ST25DV_GetSystemInfo(out byte[] responseData)
{
byte[] response = new byte[20];
responseData = null;
if (_CR95HF_Reader.CR95HF_SendRecv(ST25DV_CMD_GET_SYSTEM_INFO, out response))
{
if (response == null)
{
return false;
}
//Success - ResponseFlags = 0x00, 14 bytes payload
//Error - ResponseFlags = 0x01, 1 byte error code
if (response[0] == 0x00)
{
responseData = new byte[14];
for (int i=0; i<14; i++)
{
responseData[i] = response[i + 1];
}
//OnMessageEvent("Read GetSystemInfo: " + Tools.ByteArrayToHexString(responseData));
return true;
}
else
{
if ((responseData[0] == 0x01) && (ST25DV_ErrorCodes.ContainsKey(responseData[1])))
OnMessageEvent("Read GetSystemInfo: Failed with ST25DV error - " + ST25DV_ErrorCodes[responseData[1]]);
}
}
OnMessageEvent("Read GetSystemInfo: Failed with ST25DV Unidentified error");
return false;
}
public bool ST25DV_ReadSingleBlock(byte blockNumber, out byte[] outBuffer, bool logEnabled = false)
{
byte[] response = null;
outBuffer = null;
int StartingByteAddress = Convert.ToInt32(blockNumber) * 4;
ST25DV_CMD_READ_SINGLE_BLOCK[1] = blockNumber;
if (logEnabled)
{
OnMessageEvent("Read EEPROM: 0x04" + " bytes from the address 0x" + Tools.DecimalToHexString(StartingByteAddress.ToString(), 1));
}
if (_CR95HF_Reader.CR95HF_SendRecv(ST25DV_CMD_READ_SINGLE_BLOCK, out response))
{
//Success - ResponseFlags = 0x00, payload
//Error - ResponseFlags = 0x01, 1 byte error code
if (response[0] == 0x00)
{
outBuffer = new byte[4];
for (int i = 0; i < 4; i++)
{
outBuffer[i] = response[1 + i];
}
if (logEnabled)
{
OnMessageEvent("Read EEPROM: " + Tools.BytesToHex(outBuffer));
}
return true;
}
else
{
if ((response[0] == 0x01) && (ST25DV_ErrorCodes.ContainsKey(response[1])))
OnMessageEvent("Read EEPROM: Failed with ST25DV error - " + ST25DV_ErrorCodes[response[1]]);
}
}
OnMessageEvent("Read EEPROM: Failed with ST25DV Unidentified error");
return false;
}
public bool ST25DV_WriteSingleBlock(byte blockNumber, byte[] inBuffer, bool logEnabled = false)
{
byte[] response = null;
int StartingByteAddress = Convert.ToInt32(blockNumber) * 4;
ST25DV_CMD_WRITE_SINGLE_BLOCK[1] = blockNumber;
for (int i = 0; i < 4; i++)
{
ST25DV_CMD_WRITE_SINGLE_BLOCK[2 + i] = inBuffer[i];
}
if (logEnabled)
{
OnMessageEvent("Write EEPROM: 0x04 bytes 0x" + Tools.BytesToHex(inBuffer) + " to the address 0x" + Tools.DecimalToHexString(StartingByteAddress.ToString(), 1));
}
//This will disable MB, 0x0D is MB_CTRL_Dyn register pointer and 0x00 is the value written
if (ST25DV_WriteDynamicConfiguration(0x0D, 0x00, false))
{
_CR95HF_Reader.CR95HF_SendRecv(ST25DV_CMD_WRITE_SINGLE_BLOCK, out response);
}
else
{
OnMessageEvent("Write EEPROM: MB disable failed");
return false;
}
//This function will leave ST25DV with MB disabled state and it needs to be enabled by I2C interface
return true;
}
public bool ST25DV_ReadMultipleBlocks(byte startingBlockNumber, byte numberOfBlocks, out byte [] outBuffer)
{
byte[] response = new byte[16]; //Maximum allowed to read is 16 bytes (4 blocks) with this command
outBuffer = null;
ST25DV_CMD_READ_MULTIPLE_BLOCKS[1] = startingBlockNumber;
ST25DV_CMD_READ_MULTIPLE_BLOCKS[2] = numberOfBlocks;
if (Convert.ToInt32(numberOfBlocks) >= 4) //maximum allowed to read with one command is 4 blocks (means 3)
{
OnMessageEvent("Read EEPROM: Invalid Input"); //TBD-needs to validate startingBlockNumber based on 4K or 16K or 64K chip read info
return false;
}
int totalReadBytes = (Convert.ToInt32(numberOfBlocks) + 1) * 4;
int StartingByteAddress = Convert.ToInt32(startingBlockNumber) * 4;
OnMessageEvent("Read EEPROM: " + "0x" + Tools.DecimalToHexString(totalReadBytes.ToString(),1) + " bytes from the byte " + "0x" + Tools.DecimalToHexString(StartingByteAddress.ToString(), 1));
if (_CR95HF_Reader.CR95HF_SendRecv(ST25DV_CMD_READ_MULTIPLE_BLOCKS, out response))
{
//Success - ResponseFlags = 0x00, payload
//Error - ResponseFlags = 0x01, 1 byte error code
if (response[0] == 0x00)
{
outBuffer = new byte[response.Length-4];
for (int i = 0; i < response.Length-4; i++)
{
outBuffer[i] = response[1 + i];
}
OnMessageEvent("Read EEPROM: " + Tools.BytesToHex(outBuffer));
return true;
}
else
{
if ((response[0] == 0x01) && (ST25DV_ErrorCodes.ContainsKey(response[1])))
OnMessageEvent("Read EEPROM: Failed with ST25DV error - " + ST25DV_ErrorCodes[response[1]]);
}
}
OnMessageEvent("Read EEPROM: Failed with ST25DV Unidentified error");
return false;
}
public bool ST25DV_ReadConfiguration(byte regAddress, out byte outBuffer, bool logEnabled = false)
{
byte[] response = null;
ST25DV_CMD_READ_CONFIG[2] = regAddress;
outBuffer = 0x00;
if (_CR95HF_Reader.CR95HF_SendRecv(ST25DV_CMD_READ_CONFIG, out response))
{
//Success - ResponseFlags = 0x00, 1 byte payload
//Error - ResponseFlags = 0x01, 1 byte error code
if (response[0] == 0x00)
{
outBuffer = response[1];
if (logEnabled)
{
OnMessageEvent("Read Static Config Register @address: " + "0x" + Tools.DecimalToHexString(Convert.ToInt32(regAddress).ToString(), 1) + " as " + Tools.ByteToHexString(outBuffer));
}
return true;
}
else
{
if ((response[0] == 0x01) && (ST25DV_ErrorCodes.ContainsKey(response[1])))
OnMessageEvent("Read Static Config Register: Failed with ST25DV error - " + ST25DV_ErrorCodes[response[1]]);
}
}
OnMessageEvent("Read Static Config Register: Failed with ST25DV Unidentified error");
return false;
}
public bool ST25DV_ReadDynamicConfiguration(byte regAddress, out byte outBuffer, bool logEnabled = false)
{
byte[] response = null;
ST25DV_CMD_READ_DYNAMIC_CONFIG[2] = regAddress;
outBuffer = 0x00;
if (_CR95HF_Reader.CR95HF_SendRecv(ST25DV_CMD_READ_DYNAMIC_CONFIG, out response))
{
//Success - ResponseFlags = 0x00, 1 byte payload
//Error - ResponseFlags = 0x01, 1 byte error code
if (response[0] == 0x00)
{
outBuffer = response[1];
if (logEnabled)
{
OnMessageEvent("Read Dynamic Config Register @address: " + "0x" + Tools.DecimalToHexString(Convert.ToInt32(regAddress).ToString(), 1) + " as " + Tools.ByteToHexString(outBuffer));
}
return true;
}
else
{
if ((response[0] == 0x01) && (ST25DV_ErrorCodes.ContainsKey(response[1])))
OnMessageEvent("Read Dynamic Config Register: Failed with ST25DV error - " + ST25DV_ErrorCodes[response[1]]);
}
}
OnMessageEvent("Read Dynamic Config Register: Failed with ST25DV Unidentified error");
return false;
}
public bool ST25DV_WriteGPOManageCommand(byte regValue, bool logEnabled)
{
byte[] response = null;
ST25DV_CMD_MANAGE_GPO[2] = regValue;
if (_CR95HF_Reader.CR95HF_SendRecv(ST25DV_CMD_MANAGE_GPO, out response))
{
//Success - ResponseFlags = 0x00, success
//Error - ResponseFlags = 0x01, 1 byte error code
if (response[0] == 0x00)
{
if (logEnabled)
{
OnMessageEvent("Write GPO Manage: Success");
}
return true;
}
else
{
if ((response[0] == 0x01) && (ST25DV_ErrorCodes.ContainsKey(response[1])))
OnMessageEvent("Write GPO Manage: Failed with ST25DV error - " + ST25DV_ErrorCodes[response[1]]);
}
}
OnMessageEvent("Write GPO Manage: Failed with ST25DV Unidentified error");
return false;
}
public bool ST25DV_WriteDynamicConfiguration(byte regAddress, byte regValue, bool logEnabled)
{
byte[] response = null;
ST25DV_CMD_WRITE_DYNAMIC_CONFIG[2] = regAddress;
ST25DV_CMD_WRITE_DYNAMIC_CONFIG[3] = regValue;
if (_CR95HF_Reader.CR95HF_SendRecv(ST25DV_CMD_WRITE_DYNAMIC_CONFIG, out response))
{
//Success - ResponseFlags = 0x00, success
//Error - ResponseFlags = 0x01, 1 byte error code
if (response[0] == 0x00)
{
if (logEnabled)
{
OnMessageEvent("Write Dynamic Config Register: Success");
}
return true;
}
else
{
if ((response[0] == 0x01) && (ST25DV_ErrorCodes.ContainsKey(response[1])))
OnMessageEvent("Write Dynamic Config Register: Failed with ST25DV error - " + ST25DV_ErrorCodes[response[1]]);
}
}
OnMessageEvent("Write Dynamic Config Register: Failed with ST25DV Unidentified error");
return false;
}
public bool ST25DV_ReadMailboxControlReg(out byte outBuffer)
{
byte[] response = null;
outBuffer = 0x00;
if (_CR95HF_Reader.CR95HF_SendRecv(ST25DV_CMD_READ_MAILBOX_CONTROL_REG, out response))
{
//Success - ResponseFlags = 0x00, 1 byte payload
//Error - ResponseFlags = 0x01, 1 byte error code
if (response[0] == 0x00)
{
outBuffer = response[1];
//OnMessageEvent("Read Dynamic Config Register MBCtrl @address: 0x0D" + " as " + Tools.ByteToHexString(outBuffer));
return true;
}
else
{
if ((response[0] == 0x01) && (ST25DV_ErrorCodes.ContainsKey(response[1])))
OnMessageEvent("Read Dynamic Config Register MBCtrl: Failed with ST25DV error - " + ST25DV_ErrorCodes[response[1]]);
}
}
OnMessageEvent("Read Dynamic Config Register MBCtrl: Failed with ST25DV Unidentified error");
return false;
}
public bool ST25DV_ReadMailboxMessageLength(out byte outBuffer, bool logEnabled = false)
{
byte[] response = null;
outBuffer = 0x00;
if (_CR95HF_Reader.CR95HF_SendRecv(ST25DV_CMD_READ_MAILBOX_MESSAGE_LENGTH, out response))
{
//Success - ResponseFlags = 0x00, 1 byte payload
//Error - ResponseFlags = 0x01, 1 byte error code
if (response[0] == 0x00)
{
outBuffer = response[1];
if (logEnabled)
{
OnMessageEvent("Read Mailbox Message Length: " + Tools.ByteToHexString(outBuffer));
}
return true;
}
else
{
if ((response[0] == 0x01) && (ST25DV_ErrorCodes.ContainsKey(response[1])))
OnMessageEvent("Read Mailbox Message Length: Failed with ST25DV error - " + ST25DV_ErrorCodes[response[1]]);
}
}
OnMessageEvent("Read Mailbox Message Length: Failed with ST25DV Unidentified error");
return false;
}
public bool ST25DV_ReadMessage(byte bytesToRead, out byte[] outBuffer)
{
byte[] response = null;
outBuffer = null;
ST25DV_CMD_READ_MESSAGE[2] = 0x00; //Pointer in mailbox, 0x00 indicates reads from beginning
ST25DV_CMD_READ_MESSAGE[3] = bytesToRead;
if (_CR95HF_Reader.CR95HF_SendRecv(ST25DV_CMD_READ_MESSAGE, out response))
{
outBuffer = new byte[response.Length-4];
//Success - ResponseFlags = 0x00, payload
//Error - ResponseFlags = 0x01, 1 byte error code
if (response[0] == 0x00)
{
for (int i = 0; i < response.Length-4; i++)
{
outBuffer[i] = response[1 + i];
}
OnMessageEvent("Read Message: " + Tools.BytesToHex(outBuffer));
return true;
}
if ((response[0] == 0x01) && ST25DV_ErrorCodes.ContainsKey(response[1]))
OnMessageEvent("Read Message Failed: With ST25DV error - " + ST25DV_ErrorCodes[response[1]]);
}
OnMessageEvent("Read Message Failed: With ST25DV Unidentified error");
return false;
}
public bool ST25DV_WriteMessage(byte [] inBuffer)
{
byte[] response = null;
List<byte> ST25DV_CMD_WRITE_MESSAGE = new List<byte>();
ST25DV_CMD_WRITE_MESSAGE.Add(0xAA); //Write message command code
ST25DV_CMD_WRITE_MESSAGE.Add(0x02); //IC Mfg Code
ST25DV_CMD_WRITE_MESSAGE.Add(Convert.ToByte(inBuffer.Length - 1)); //This is the app given payload - 1
ST25DV_CMD_WRITE_MESSAGE.AddRange(inBuffer);
if (_CR95HF_Reader.CR95HF_SendRecv(ST25DV_CMD_WRITE_MESSAGE.ToArray(), out response))
{
//Success - ResponseFlags = 0x00
//Error - ResponseFlags = 0x01, 1 byte error code
if (response[0] == 0x00)
{
//OnMessageEvent("Write Message: " + Tools.ByteArrayToHexString(inBuffer));
return true;
}
if ((response[0] == 0x01) && ST25DV_ErrorCodes.ContainsKey(response[1]))
OnMessageEvent("Write Message Failed: With ST25DV error - " + ST25DV_ErrorCodes[response[1]]);
}
OnMessageEvent("Write Message Failed: With ST25DV Unidentified error");
return false;
}
}
}
+160
View File
@@ -0,0 +1,160 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Security.Cryptography;
using System.Text;
//*****************************************************************************
// Copyright 2020 Sensus GmbH Ludwigshafen. All rights reserved.
// Author: Venkat, Rajeshwar
//*****************************************************************************
namespace Sensus.iPerl.NfcHandler
{
public static class Tools
{
public static bool ByteArrayCompare(byte[] a1, byte[] a2)
{
// thanks to https://stackoverflow.com/questions/43289/comparing-two-byte-arrays-in-net
if (a1.Length != a2.Length)
return false;
for (int i = 0; i < a1.Length; i++)
if (a1[i] != a2[i])
return false;
return true;
}
public static string SwapHex(string sHex)
{
string sResult = "";
int iPos = sHex.Length - 2;
while (iPos >= 0)
{
sResult += sHex.Substring(iPos, 2);
sHex = sHex.Remove(iPos, 2);
iPos = sHex.Length - 2;
}
return sResult;
}
public static string DecimalToHexString(string value, int size = 1)
{
try
{
long Lval = long.Parse(value);
if (size == 1) return Lval.ToString("X2");
if (size == 2) return Lval.ToString("X4");
if (size == 4) return Lval.ToString("X8");
}
catch (Exception)
{
if (size == 1) return "00";
if (size == 2) return "0000";
if (size == 4) return "00000000";
}
return "00";
}
public static string ByteToHexString(byte data)
{
List<byte> val = new List<byte>();
val.Add(data);
byte[] arr = val.ToArray();
return BytesToHex(arr);
}
public static string BytesToHex(byte[] data)
{
StringBuilder sb = new StringBuilder();
foreach (byte b in data)
sb.Append(b.ToString("X2"));
return sb.ToString();
}
public static byte[] HexStringToByteArray(String hexString)
{
int numberChars = hexString.Length;
byte[] bytes = new byte[numberChars / 2];
for (int i = 0; i < numberChars; i += 2)
{
bytes[i / 2] = Convert.ToByte(hexString.Substring(i, 2), 16);
}
return bytes;
}
public enum InitialCrcValue
{
Zeros,
NonZero1 = 0xffff,
NonZero2 = 0x1D0F
}
public class Crc16Ccitt
{
private const ushort poly = 0x1021;
ushort[] table = new ushort[256];
ushort initialValue = 0;
public ushort ComputeChecksum(byte[] bytes)
{
ushort crc = this.initialValue;
for (int i = 0; i < bytes.Length; ++i)
{
crc = (ushort)((crc << 8) ^ table[((crc >> 8) ^ (0xff & bytes[i]))]);
}
return crc;
}
public byte[] ComputeChecksumBytes(byte[] bytes)
{
ushort crc = ComputeChecksum(bytes);
return BitConverter.GetBytes(crc);
}
public Crc16Ccitt(InitialCrcValue initialValue)
{
this.initialValue = (ushort) initialValue;
ushort temp, a;
for (int i = 0; i < table.Length; ++i)
{
temp = 0;
a = (ushort) (i << 8);
for (int j = 0; j < 8; ++j)
{
if (((temp ^ a) & 0x8000) != 0)
{
temp = (ushort) ((temp << 1) ^ poly);
}
else
{
temp <<= 1;
}
a <<= 1;
}
table[i] = temp;
}
}
public byte[] calcCRCfromMessage(byte[] message)
{
// CRC calculation goes from MessageID to Password
// For Read this means MsgID (1) + Offset (2) + PayloadLength (1) + Password (2) = 6
// for write the length of the payload comes on top.
// STX(1), length(1), CRC(2) and ETX(1) are excluded, in total 5 bytes.
//
// the method works both for sending messages (where the CRC and ETX are not in message)
// and for receiving messages (where the CRC and ETX are included at the end)
byte[] crc_msg = new byte[message[1]]; // message length is 2nd byte
Array.Copy(message, 2, crc_msg, 0, crc_msg.Length);
return ComputeChecksumBytes(crc_msg);
}
public string commentCRC(byte[] crc_meter, byte[] crc_computed)
{
bool crc_do_match = Tools.ByteArrayCompare(crc_meter, crc_computed);
string crcComment = crc_do_match ? "ok." : "CRC DOESN'T MATCH!!";
return "CRC Meter: " + Tools.BytesToHex(crc_meter) + (crc_do_match ? " == " : " != ")
+ "CRC Computed: " + Tools.BytesToHex(crc_computed) + ". " + crcComment;
}
public bool crc_do_match(byte[] a, byte[] b)
{
return ByteArrayCompare(a, b);
}
}
}
}
+97
View File
@@ -0,0 +1,97 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{5954D496-CAAB-4F7A-BDE2-BDC8F47DAB19}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Sensus.iPerl</RootNamespace>
<AssemblyName>NfcS5_DLL</AssemblyName>
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
<TargetFrameworkProfile />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE;IPERL</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE;IPERL;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Antlr3.Runtime, Version=3.5.0.2, Culture=neutral, PublicKeyToken=eb42632606e9261f, processorArchitecture=MSIL">
<HintPath>..\tbf\packages\Antlr3.Runtime.3.5.1\lib\net40-client\Antlr3.Runtime.dll</HintPath>
</Reference>
<Reference Include="FluentNHibernate, Version=3.4.0.0, Culture=neutral, PublicKeyToken=8aa435e3cb308880, processorArchitecture=MSIL">
<HintPath>..\tbf\packages\FluentNHibernate.3.4.0\lib\net461\FluentNHibernate.dll</HintPath>
</Reference>
<Reference Include="Iesi.Collections, Version=4.0.0.4000, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
<HintPath>..\tbf\packages\Iesi.Collections.4.0.4\lib\net461\Iesi.Collections.dll</HintPath>
</Reference>
<Reference Include="log4net, Version=3.0.4.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
<HintPath>..\tbf\packages\log4net.3.0.4\lib\net462\log4net.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualBasic, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\tbf\packages\VisualBasic.PowerPacks.Vs.1.0.0\lib\Microsoft.VisualBasic.dll</HintPath>
</Reference>
<Reference Include="Microsoft.VisualBasic.PowerPacks.Vs, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\tbf\packages\VisualBasic.PowerPacks.Vs.1.0.0\lib\Microsoft.VisualBasic.PowerPacks.Vs.dll</HintPath>
</Reference>
<Reference Include="NHibernate, Version=5.5.0.0, Culture=neutral, PublicKeyToken=aa95f207798dfdb4, processorArchitecture=MSIL">
<HintPath>..\tbf\packages\NHibernate.5.5.2\lib\net461\NHibernate.dll</HintPath>
</Reference>
<Reference Include="Remotion.Linq, Version=2.2.0.0, Culture=neutral, PublicKeyToken=fee00910d6e5f53b, processorArchitecture=MSIL">
<HintPath>..\tbf\packages\Remotion.Linq.2.2.0\lib\net45\Remotion.Linq.dll</HintPath>
</Reference>
<Reference Include="Remotion.Linq.EagerFetching, Version=2.2.0.0, Culture=neutral, PublicKeyToken=fee00910d6e5f53b, processorArchitecture=MSIL">
<HintPath>..\tbf\packages\Remotion.Linq.EagerFetching.2.2.0\lib\net45\Remotion.Linq.EagerFetching.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.Transactions" />
<Reference Include="System.Web" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="NfcHandler\CR95HF_Reader.cs" />
<Compile Include="NfcHandler\MCI_Protocol.cs" />
<Compile Include="NfcHandler\NfcDataHandler.cs" />
<Compile Include="NfcHandler\NFCHeadConfig.cs" />
<Compile Include="NfcHandler\NfcMessageEventArgs.cs" />
<Compile Include="NfcHandler\SERIAL_Driver.cs" />
<Compile Include="NfcHandler\ST25DV_Device.cs" />
<Compile Include="NfcHandler\Tools.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="App.config" />
<None Include="packages.config" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>
@@ -5,12 +5,12 @@ using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("ResultsBrowser")]
[assembly: AssemblyTitle("NfcS5_DLL")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("ResultsBrowser")]
[assembly: AssemblyCopyright("Copyright © 2015")]
[assembly: AssemblyProduct("NfcS5_DLL")]
[assembly: AssemblyCopyright("Copyright © 2024")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -20,7 +20,7 @@ using System.Runtime.InteropServices;
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("52c39793-b492-49c6-aa6a-1820ebef1d6e")]
[assembly: Guid("5954d496-caab-4f7a-bde2-bdc8f47dab19")]
// Version information for an assembly consists of the following four values:
//
@@ -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("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyVersion("1.18.0.0")]
[assembly: AssemblyFileVersion("1.18.0.0")]
-137
View File
@@ -1,137 +0,0 @@
namespace ResultsBrowser
{
partial class BenchesDlg
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(BenchesDlg));
this.okButton = new System.Windows.Forms.Button();
this.cancelButton = new System.Windows.Forms.Button();
this.testBenchesListBox = new System.Windows.Forms.ListBox();
this.label1 = new System.Windows.Forms.Label();
this.editButton = new System.Windows.Forms.Button();
this.addButton = new System.Windows.Forms.Button();
this.removeButton = new System.Windows.Forms.Button();
this.copyButton = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// okButton
//
resources.ApplyResources(this.okButton, "okButton");
this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK;
this.okButton.ImageKey = global::TBF.Resources.Strings.String1;
this.okButton.Name = "okButton";
this.okButton.UseVisualStyleBackColor = true;
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// cancelButton
//
resources.ApplyResources(this.cancelButton, "cancelButton");
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelButton.ImageKey = global::TBF.Resources.Strings.String1;
this.cancelButton.Name = "cancelButton";
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
//
// testBenchesListBox
//
resources.ApplyResources(this.testBenchesListBox, "testBenchesListBox");
this.testBenchesListBox.FormattingEnabled = true;
this.testBenchesListBox.Name = "testBenchesListBox";
this.testBenchesListBox.DoubleClick += new System.EventHandler(this.testBenchesListBox_DoubleClick);
//
// label1
//
resources.ApplyResources(this.label1, "label1");
this.label1.ImageKey = global::TBF.Resources.Strings.String1;
this.label1.Name = "label1";
//
// editButton
//
resources.ApplyResources(this.editButton, "editButton");
this.editButton.ImageKey = global::TBF.Resources.Strings.String1;
this.editButton.Name = "editButton";
this.editButton.UseVisualStyleBackColor = true;
this.editButton.Click += new System.EventHandler(this.editButton_Click);
//
// addButton
//
resources.ApplyResources(this.addButton, "addButton");
this.addButton.ImageKey = global::TBF.Resources.Strings.String1;
this.addButton.Name = "addButton";
this.addButton.UseVisualStyleBackColor = true;
this.addButton.Click += new System.EventHandler(this.addButton_Click);
//
// removeButton
//
resources.ApplyResources(this.removeButton, "removeButton");
this.removeButton.ImageKey = global::TBF.Resources.Strings.String1;
this.removeButton.Name = "removeButton";
this.removeButton.UseVisualStyleBackColor = true;
this.removeButton.Click += new System.EventHandler(this.removeButton_Click);
//
// copyButton
//
resources.ApplyResources(this.copyButton, "copyButton");
this.copyButton.ImageKey = global::TBF.Resources.Strings.String1;
this.copyButton.Name = "copyButton";
this.copyButton.UseVisualStyleBackColor = true;
this.copyButton.Click += new System.EventHandler(this.copyButton_Click);
//
// BenchesDlg
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.copyButton);
this.Controls.Add(this.removeButton);
this.Controls.Add(this.addButton);
this.Controls.Add(this.editButton);
this.Controls.Add(this.label1);
this.Controls.Add(this.testBenchesListBox);
this.Controls.Add(this.okButton);
this.Controls.Add(this.cancelButton);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MaximizeBox = false;
this.Name = "BenchesDlg";
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button okButton;
private System.Windows.Forms.Button cancelButton;
private System.Windows.Forms.ListBox testBenchesListBox;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Button editButton;
private System.Windows.Forms.Button addButton;
private System.Windows.Forms.Button removeButton;
private System.Windows.Forms.Button copyButton;
}
}
-199
View File
@@ -1,199 +0,0 @@
using System;
using System.Windows.Forms;
namespace ResultsBrowser
{
/// <summary>
/// Dialog to edit local settings that specify database parameters (S1.2)
/// </summary>
public partial class BenchesDlg : Form
{
// Local copy of 'local settings' initialized to Program.localSettings.
// Dialog modifies this copy and updates Program.localSettings just
// when 'OK' is pressed.
LocalSettings localSettings;
/// <summary>
/// Constructor, initializes the dialog
/// </summary>
public BenchesDlg()
{
localSettings = new LocalSettings();
localSettings.Assign(Program.LocalSettings);
InitializeComponent();
RedrawTestBenchesListBox();
}
void RedrawTestBenchesListBox()
{
testBenchesListBox.Items.Clear();
if (localSettings.testBenches != null)
{
int nrBenches = localSettings.testBenches.GetLength(0);
for (int i = 0; i < nrBenches; i++)
{
testBenchesListBox.Items.Add(localSettings.testBenches[i].BenchName);
}
}
}
/// <summary>
/// Create a new test bench DB specification and append it to the list
/// </summary>
/// <param name="sender">Not used</param>
/// <param name="e">Not used</param>
private void addButton_Click(object sender, EventArgs e)
{
DatabaseSettings bench = new DatabaseSettings();
DatabaseSettingsDlg dlg = new DatabaseSettingsDlg(bench);
DialogResult dr = dlg.ShowDialog();
if (dr == DialogResult.OK)
{
int nrBenches =
(localSettings.testBenches == null) ? 0 : localSettings.testBenches.GetLength(0);
if (nrBenches == 0)
{
localSettings.testBenches = new DatabaseSettings[1];
localSettings.testBenches[0] = bench;
}
else
{
DatabaseSettings[] newTestBenches = new DatabaseSettings[nrBenches + 1];
for (int i = 0; i < nrBenches; i++)
{
newTestBenches[i] = localSettings.testBenches[i];
}
newTestBenches[nrBenches] = bench;
localSettings.testBenches = newTestBenches;
}
testBenchesListBox.Items.Add(bench.BenchName);
}
}
/// <summary>
/// Create a new test bench DB specification,which is a copy of the
/// selected bench, and append it to the list
/// </summary>
/// <param name="sender">Not used</param>
/// <param name="e">Not used</param>
private void copyButton_Click(object sender, EventArgs e)
{
if (testBenchesListBox.SelectedIndex >= 0)
{
DatabaseSettings ori = localSettings.testBenches[testBenchesListBox.SelectedIndex];
DatabaseSettings bench = (DatabaseSettings)ori.Clone();
DatabaseSettingsDlg dlg = new DatabaseSettingsDlg(bench);
DialogResult dr = dlg.ShowDialog();
if (dr == DialogResult.OK)
{
int nrBenches =
(localSettings.testBenches == null) ? 0 : localSettings.testBenches.GetLength(0);
DatabaseSettings[] newTestBenches = new DatabaseSettings[nrBenches + 1];
for (int i = 0; i < nrBenches; i++)
{
newTestBenches[i] = localSettings.testBenches[i];
}
newTestBenches[nrBenches] = bench;
localSettings.testBenches = newTestBenches;
testBenchesListBox.Items.Add(bench.BenchName);
}
}
}
/// <summary>
/// Edit selected test bench DB specification
/// </summary>
/// <param name="sender">Not used</param>
/// <param name="e">Not used</param>
private void editButton_Click(object sender, EventArgs e)
{
if (testBenchesListBox.SelectedIndex >= 0)
{
DatabaseSettingsDlg dlg = new DatabaseSettingsDlg(localSettings.testBenches[testBenchesListBox.SelectedIndex]);
DialogResult dr = dlg.ShowDialog();
if (dr == DialogResult.OK)
{
// Update the item name
testBenchesListBox.Items[testBenchesListBox.SelectedIndex] =
localSettings.testBenches[testBenchesListBox.SelectedIndex].BenchName;
}
}
}
/// <summary>
/// Remove selected test bench DB specification from the list
/// </summary>
/// <param name="sender">Not used</param>
/// <param name="e">Not used</param>
private void removeButton_Click(object sender, EventArgs e)
{
int selectedIx = testBenchesListBox.SelectedIndex;
if (selectedIx >= 0)
{
int nrBenches =
(localSettings.testBenches == null) ? 0 : localSettings.testBenches.GetLength(0);
if (nrBenches == 1)
{
localSettings.testBenches = null;
}
else
{
DatabaseSettings[] newTestBenches = new DatabaseSettings[nrBenches - 1];
for (int i = 0; i < selectedIx; i++)
{
newTestBenches[i] = localSettings.testBenches[i];
}
for (int i = selectedIx + 1; i < nrBenches; i++)
{
newTestBenches[i - 1] = localSettings.testBenches[i];
}
localSettings.testBenches = newTestBenches;
}
RedrawTestBenchesListBox();
}
}
/// <summary>
/// Update setting, return 'OK'
/// </summary>
/// <param name="sender">Not used</param>
/// <param name="e">Not used</param>
private void okButton_Click(object sender, EventArgs e)
{
Program.LocalSettings.Assign(localSettings); // Update Program.localSettings
DialogResult = DialogResult.OK;
Close();
return;
}
/// <summary>
/// Throw away changes, return 'Cancel'
/// </summary>
/// <param name="sender">Not used</param>
/// <param name="e">Not used</param>
private void cancelButton_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
Close();
return;
}
/// <summary>
/// Double click on an item = edit item
/// </summary>
/// <param name="sender">Not used</param>
/// <param name="e">Not used</param>
private void testBenchesListBox_DoubleClick(object sender, EventArgs e)
{
editButton_Click(sender, e);
}
}
}
-148
View File
@@ -1,148 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="okButton.Text" xml:space="preserve">
<value>&amp;OK</value>
</data>
<data name="cancelButton.Text" xml:space="preserve">
<value>&amp;Abbrechen</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>58, 13</value>
</data>
<data name="label1.Text" xml:space="preserve">
<value>Prüfstände</value>
</data>
<data name="editButton.Text" xml:space="preserve">
<value>&amp;Bearbeiten...</value>
</data>
<data name="addButton.Text" xml:space="preserve">
<value>&amp;Neu...</value>
</data>
<data name="removeButton.Text" xml:space="preserve">
<value>&amp;Löschen</value>
</data>
<data name="copyButton.Text" xml:space="preserve">
<value>&amp;Kopieren</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>Datenbank Einstellungen</value>
</data>
</root>
-339
View File
@@ -1,339 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="testBenchesListBox.TabIndex" type="System.Int32, mscorlib">
<value>13</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="editButton.Location" type="System.Drawing.Point, System.Drawing">
<value>192, 105</value>
</data>
<data name="&gt;&gt;copyButton.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="cancelButton.Size" type="System.Drawing.Size, System.Drawing">
<value>105, 28</value>
</data>
<data name="addButton.Location" type="System.Drawing.Point, System.Drawing">
<value>192, 37</value>
</data>
<data name="testBenchesListBox.Size" type="System.Drawing.Size, System.Drawing">
<value>164, 134</value>
</data>
<data name="addButton.Text" xml:space="preserve">
<value>&amp;Add</value>
</data>
<data name="&gt;&gt;removeButton.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="editButton.TabIndex" type="System.Int32, mscorlib">
<value>15</value>
</data>
<data name="&gt;&gt;editButton.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;cancelButton.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>BenchesDlg</value>
</data>
<data name="&gt;&gt;testBenchesListBox.ZOrder" xml:space="preserve">
<value>5</value>
</data>
<data name="&gt;&gt;label1.Name" xml:space="preserve">
<value>label1</value>
</data>
<data name="removeButton.Text" xml:space="preserve">
<value>&amp;Remove</value>
</data>
<data name="cancelButton.Location" type="System.Drawing.Point, System.Drawing">
<value>344, 71</value>
</data>
<data name="&gt;&gt;cancelButton.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="cancelButton.Text" xml:space="preserve">
<value>Cancel</value>
</data>
<data name="&gt;&gt;testBenchesListBox.Name" xml:space="preserve">
<value>testBenchesListBox</value>
</data>
<data name="copyButton.Location" type="System.Drawing.Point, System.Drawing">
<value>192, 71</value>
</data>
<data name="&gt;&gt;okButton.Name" xml:space="preserve">
<value>okButton</value>
</data>
<data name="&gt;&gt;label1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;testBenchesListBox.Type" xml:space="preserve">
<value>System.Windows.Forms.ListBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="editButton.Size" type="System.Drawing.Size, System.Drawing">
<value>105, 28</value>
</data>
<data name="copyButton.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="label1.TabIndex" type="System.Int32, mscorlib">
<value>14</value>
</data>
<data name="&gt;&gt;editButton.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>79, 13</value>
</data>
<data name="addButton.Size" type="System.Drawing.Size, System.Drawing">
<value>105, 28</value>
</data>
<data name="&gt;&gt;removeButton.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>459, 185</value>
</data>
<data name="cancelButton.TabIndex" type="System.Int32, mscorlib">
<value>11</value>
</data>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 13</value>
</data>
<data name="okButton.Size" type="System.Drawing.Size, System.Drawing">
<value>105, 28</value>
</data>
<data name="editButton.Text" xml:space="preserve">
<value>&amp;Edit</value>
</data>
<data name="&gt;&gt;addButton.Name" xml:space="preserve">
<value>addButton</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="$this.StartPosition" type="System.Windows.Forms.FormStartPosition, System.Windows.Forms">
<value>CenterParent</value>
</data>
<data name="&gt;&gt;okButton.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="removeButton.Location" type="System.Drawing.Point, System.Drawing">
<value>192, 139</value>
</data>
<data name="&gt;&gt;cancelButton.ZOrder" xml:space="preserve">
<value>7</value>
</data>
<data name="okButton.Location" type="System.Drawing.Point, System.Drawing">
<value>344, 37</value>
</data>
<data name="copyButton.Size" type="System.Drawing.Size, System.Drawing">
<value>105, 28</value>
</data>
<data name="removeButton.TabIndex" type="System.Int32, mscorlib">
<value>17</value>
</data>
<data name="&gt;&gt;removeButton.Name" xml:space="preserve">
<value>removeButton</value>
</data>
<data name="copyButton.Text" xml:space="preserve">
<value>&amp;Copy</value>
</data>
<data name="testBenchesListBox.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 37</value>
</data>
<data name="&gt;&gt;label1.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="&gt;&gt;addButton.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;okButton.ZOrder" xml:space="preserve">
<value>6</value>
</data>
<data name="&gt;&gt;addButton.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;copyButton.Name" xml:space="preserve">
<value>copyButton</value>
</data>
<data name="removeButton.Size" type="System.Drawing.Size, System.Drawing">
<value>105, 28</value>
</data>
<data name="label1.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="&gt;&gt;editButton.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="&gt;&gt;editButton.Name" xml:space="preserve">
<value>editButton</value>
</data>
<data name="&gt;&gt;cancelButton.Name" xml:space="preserve">
<value>cancelButton</value>
</data>
<data name="label1.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 15</value>
</data>
<data name="&gt;&gt;removeButton.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;copyButton.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;testBenchesListBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;addButton.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="okButton.Text" xml:space="preserve">
<value>OK</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>Database Settings</value>
</data>
<data name="&gt;&gt;okButton.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label1.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;copyButton.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="okButton.TabIndex" type="System.Int32, mscorlib">
<value>12</value>
</data>
<data name="addButton.TabIndex" type="System.Int32, mscorlib">
<value>16</value>
</data>
<data name="label1.Text" xml:space="preserve">
<value>Test Benches :</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>de</value>
</metadata>
</root>
-28
View File
@@ -1,28 +0,0 @@
using System;
namespace ResultsBrowser
{
/// <summary>
/// Database settings required to make a connection
/// </summary>
public class DBSettings : ICloneable
{
public DBType DbType;
public string ConnectionString;
public DBSettings()
{
}
public DBSettings(DBType dbType, string connectionString)
{
this.DbType = dbType;
this.ConnectionString = connectionString;
}
public object Clone()
{
return new DBSettings(DbType, ConnectionString);
}
}
}
-48
View File
@@ -1,48 +0,0 @@
using System;
using System.Text;
using System.Xml.Serialization;
namespace ResultsBrowser
{
/// <summary>
/// Test bench database settings, contains bench name and settings od several databases
/// </summary>
public class DatabaseSettings : ICloneable
{
// Public fields
public string BenchName;
public bool IsRealBench;
public DBSettings UsersDBSettings;
public DBSettings BenchDBSettings;
public DBSettings ProceduresDBSettings;
public DBSettings WMTypesDBSettings;
public DBSettings WaterMetersDBSettings;
// Constructor
public DatabaseSettings()
{
BenchName = String.Empty; /// Empty string to avoid null
IsRealBench = false;
UsersDBSettings = new DBSettings(DBType.MySql, "SERVER=localhost; DATABASE=tbf_users; UID=root; PASSWORD=;");
BenchDBSettings = new DBSettings(DBType.MySql, "SERVER=localhost; DATABASE=tbf_bench; UID=root; PASSWORD=;");
ProceduresDBSettings = new DBSettings(DBType.MySql, "SERVER=localhost; DATABASE=tbf_procedures; UID=root; PASSWORD=;");
WMTypesDBSettings = new DBSettings(DBType.MySql, "SERVER=localhost; DATABASE=tbf_wmtypes; UID=root; PASSWORD=;");
WaterMetersDBSettings = new DBSettings(DBType.MySql, "SERVER=localhost; DATABASE=tbf_watermeters; UID=root; PASSWORD=;");
}
public object Clone()
{
DatabaseSettings result = new DatabaseSettings();
result.BenchName = BenchName;
result.IsRealBench = IsRealBench;
result.UsersDBSettings = (DBSettings)UsersDBSettings.Clone();
result.BenchDBSettings = (DBSettings)BenchDBSettings.Clone();
result.ProceduresDBSettings = (DBSettings)ProceduresDBSettings.Clone();
result.WMTypesDBSettings = (DBSettings)WMTypesDBSettings.Clone();
result.WaterMetersDBSettings = (DBSettings)WaterMetersDBSettings.Clone();
return result;
}
}
}
-370
View File
@@ -1,370 +0,0 @@
namespace ResultsBrowser
{
partial class DatabaseSettingsDlg
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(DatabaseSettingsDlg));
this.okButton = new System.Windows.Forms.Button();
this.cancelButton = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.benchNameTextBox = new System.Windows.Forms.TextBox();
this.usersConnectionStringTextBox = new System.Windows.Forms.TextBox();
this.connectionStringLabel = new System.Windows.Forms.Label();
this.benchConnectionStringTextBox = new System.Windows.Forms.TextBox();
this.proceduresConnectionStringTextBox = new System.Windows.Forms.TextBox();
this.wmTypesConnectionStringTextBox = new System.Windows.Forms.TextBox();
this.watermetersConnectionStringTextBox = new System.Windows.Forms.TextBox();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.label4 = new System.Windows.Forms.Label();
this.label5 = new System.Windows.Forms.Label();
this.label6 = new System.Windows.Forms.Label();
this.testConnUsersBtn = new System.Windows.Forms.Button();
this.createUsersDbBtn = new System.Windows.Forms.Button();
this.realBenchCheckBox = new System.Windows.Forms.CheckBox();
this.dbTypeLabel = new System.Windows.Forms.Label();
this.usersDbTypeComboBox = new System.Windows.Forms.ComboBox();
this.benchDbTypeComboBox = new System.Windows.Forms.ComboBox();
this.proceduresDbTypeComboBox = new System.Windows.Forms.ComboBox();
this.wmTypesDbTypeComboBox = new System.Windows.Forms.ComboBox();
this.watermetersDbTypeComboBox = new System.Windows.Forms.ComboBox();
this.testConnBenchBtn = new System.Windows.Forms.Button();
this.testConnProceduresBtn = new System.Windows.Forms.Button();
this.testConnWMTypesBtn = new System.Windows.Forms.Button();
this.testConnWaterMetersBtn = new System.Windows.Forms.Button();
this.createBenchDbBtn = new System.Windows.Forms.Button();
this.createProceduresDbBtn = new System.Windows.Forms.Button();
this.createWMTypesDbBtn = new System.Windows.Forms.Button();
this.createWaterMetersDbBtn = new System.Windows.Forms.Button();
this.SuspendLayout();
//
// okButton
//
this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK;
this.okButton.ImageKey = global::TBF.Resources.Strings.String1;
resources.ApplyResources(this.okButton, "okButton");
this.okButton.Name = "okButton";
this.okButton.UseVisualStyleBackColor = true;
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// cancelButton
//
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelButton.ImageKey = global::TBF.Resources.Strings.String1;
resources.ApplyResources(this.cancelButton, "cancelButton");
this.cancelButton.Name = "cancelButton";
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
//
// label1
//
resources.ApplyResources(this.label1, "label1");
this.label1.ImageKey = global::TBF.Resources.Strings.String1;
this.label1.Name = "label1";
//
// benchNameTextBox
//
resources.ApplyResources(this.benchNameTextBox, "benchNameTextBox");
this.benchNameTextBox.Name = "benchNameTextBox";
//
// usersConnectionStringTextBox
//
resources.ApplyResources(this.usersConnectionStringTextBox, "usersConnectionStringTextBox");
this.usersConnectionStringTextBox.Name = "usersConnectionStringTextBox";
//
// connectionStringLabel
//
resources.ApplyResources(this.connectionStringLabel, "connectionStringLabel");
this.connectionStringLabel.ImageKey = global::TBF.Resources.Strings.String1;
this.connectionStringLabel.Name = "connectionStringLabel";
//
// benchConnectionStringTextBox
//
resources.ApplyResources(this.benchConnectionStringTextBox, "benchConnectionStringTextBox");
this.benchConnectionStringTextBox.Name = "benchConnectionStringTextBox";
//
// proceduresConnectionStringTextBox
//
resources.ApplyResources(this.proceduresConnectionStringTextBox, "proceduresConnectionStringTextBox");
this.proceduresConnectionStringTextBox.Name = "proceduresConnectionStringTextBox";
//
// wmTypesConnectionStringTextBox
//
resources.ApplyResources(this.wmTypesConnectionStringTextBox, "wmTypesConnectionStringTextBox");
this.wmTypesConnectionStringTextBox.Name = "wmTypesConnectionStringTextBox";
//
// watermetersConnectionStringTextBox
//
resources.ApplyResources(this.watermetersConnectionStringTextBox, "watermetersConnectionStringTextBox");
this.watermetersConnectionStringTextBox.Name = "watermetersConnectionStringTextBox";
//
// label2
//
resources.ApplyResources(this.label2, "label2");
this.label2.ImageKey = global::TBF.Resources.Strings.String1;
this.label2.Name = "label2";
//
// label3
//
resources.ApplyResources(this.label3, "label3");
this.label3.ImageKey = global::TBF.Resources.Strings.String1;
this.label3.Name = "label3";
//
// label4
//
resources.ApplyResources(this.label4, "label4");
this.label4.ImageKey = global::TBF.Resources.Strings.String1;
this.label4.Name = "label4";
//
// label5
//
resources.ApplyResources(this.label5, "label5");
this.label5.ImageKey = global::TBF.Resources.Strings.String1;
this.label5.Name = "label5";
//
// label6
//
resources.ApplyResources(this.label6, "label6");
this.label6.ImageKey = global::TBF.Resources.Strings.String1;
this.label6.Name = "label6";
//
// testConnUsersBtn
//
this.testConnUsersBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.testConnUsersBtn.ImageKey = global::TBF.Resources.Strings.String1;
resources.ApplyResources(this.testConnUsersBtn, "testConnUsersBtn");
this.testConnUsersBtn.Name = "testConnUsersBtn";
this.testConnUsersBtn.UseVisualStyleBackColor = true;
this.testConnUsersBtn.Click += new System.EventHandler(this.testConnUsersBtn_Click);
//
// createUsersDbBtn
//
this.createUsersDbBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.createUsersDbBtn.ImageKey = global::TBF.Resources.Strings.String1;
resources.ApplyResources(this.createUsersDbBtn, "createUsersDbBtn");
this.createUsersDbBtn.Name = "createUsersDbBtn";
this.createUsersDbBtn.UseVisualStyleBackColor = true;
this.createUsersDbBtn.Click += new System.EventHandler(this.createDatabasesButton_Click);
//
// realBenchCheckBox
//
resources.ApplyResources(this.realBenchCheckBox, "realBenchCheckBox");
this.realBenchCheckBox.ImageKey = global::TBF.Resources.Strings.String1;
this.realBenchCheckBox.Name = "realBenchCheckBox";
this.realBenchCheckBox.UseVisualStyleBackColor = true;
//
// dbTypeLabel
//
resources.ApplyResources(this.dbTypeLabel, "dbTypeLabel");
this.dbTypeLabel.ImageKey = global::TBF.Resources.Strings.String1;
this.dbTypeLabel.Name = "dbTypeLabel";
//
// usersDbTypeComboBox
//
this.usersDbTypeComboBox.FormattingEnabled = true;
resources.ApplyResources(this.usersDbTypeComboBox, "usersDbTypeComboBox");
this.usersDbTypeComboBox.Name = "usersDbTypeComboBox";
//
// benchDbTypeComboBox
//
this.benchDbTypeComboBox.FormattingEnabled = true;
resources.ApplyResources(this.benchDbTypeComboBox, "benchDbTypeComboBox");
this.benchDbTypeComboBox.Name = "benchDbTypeComboBox";
//
// proceduresDbTypeComboBox
//
this.proceduresDbTypeComboBox.FormattingEnabled = true;
resources.ApplyResources(this.proceduresDbTypeComboBox, "proceduresDbTypeComboBox");
this.proceduresDbTypeComboBox.Name = "proceduresDbTypeComboBox";
//
// wmTypesDbTypeComboBox
//
this.wmTypesDbTypeComboBox.FormattingEnabled = true;
resources.ApplyResources(this.wmTypesDbTypeComboBox, "wmTypesDbTypeComboBox");
this.wmTypesDbTypeComboBox.Name = "wmTypesDbTypeComboBox";
//
// watermetersDbTypeComboBox
//
this.watermetersDbTypeComboBox.FormattingEnabled = true;
resources.ApplyResources(this.watermetersDbTypeComboBox, "watermetersDbTypeComboBox");
this.watermetersDbTypeComboBox.Name = "watermetersDbTypeComboBox";
//
// testConnBenchBtn
//
this.testConnBenchBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.testConnBenchBtn.ImageKey = global::TBF.Resources.Strings.String1;
resources.ApplyResources(this.testConnBenchBtn, "testConnBenchBtn");
this.testConnBenchBtn.Name = "testConnBenchBtn";
this.testConnBenchBtn.UseVisualStyleBackColor = true;
this.testConnBenchBtn.Click += new System.EventHandler(this.testConnBenchBtn_Click);
//
// testConnProceduresBtn
//
this.testConnProceduresBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.testConnProceduresBtn.ImageKey = global::TBF.Resources.Strings.String1;
resources.ApplyResources(this.testConnProceduresBtn, "testConnProceduresBtn");
this.testConnProceduresBtn.Name = "testConnProceduresBtn";
this.testConnProceduresBtn.UseVisualStyleBackColor = true;
this.testConnProceduresBtn.Click += new System.EventHandler(this.testConnProceduresBtn_Click);
//
// testConnWMTypesBtn
//
this.testConnWMTypesBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.testConnWMTypesBtn.ImageKey = global::TBF.Resources.Strings.String1;
resources.ApplyResources(this.testConnWMTypesBtn, "testConnWMTypesBtn");
this.testConnWMTypesBtn.Name = "testConnWMTypesBtn";
this.testConnWMTypesBtn.UseVisualStyleBackColor = true;
this.testConnWMTypesBtn.Click += new System.EventHandler(this.testConnWMTypesBtn_Click);
//
// testConnWaterMetersBtn
//
this.testConnWaterMetersBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.testConnWaterMetersBtn.ImageKey = global::TBF.Resources.Strings.String1;
resources.ApplyResources(this.testConnWaterMetersBtn, "testConnWaterMetersBtn");
this.testConnWaterMetersBtn.Name = "testConnWaterMetersBtn";
this.testConnWaterMetersBtn.UseVisualStyleBackColor = true;
this.testConnWaterMetersBtn.Click += new System.EventHandler(this.testConnWaterMetersBtn_Click);
//
// createBenchDbBtn
//
this.createBenchDbBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.createBenchDbBtn.ImageKey = global::TBF.Resources.Strings.String1;
resources.ApplyResources(this.createBenchDbBtn, "createBenchDbBtn");
this.createBenchDbBtn.Name = "createBenchDbBtn";
this.createBenchDbBtn.UseVisualStyleBackColor = true;
this.createBenchDbBtn.Click += new System.EventHandler(this.createbenchDbBtn_Click);
//
// createProceduresDbBtn
//
this.createProceduresDbBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.createProceduresDbBtn.ImageKey = global::TBF.Resources.Strings.String1;
resources.ApplyResources(this.createProceduresDbBtn, "createProceduresDbBtn");
this.createProceduresDbBtn.Name = "createProceduresDbBtn";
this.createProceduresDbBtn.UseVisualStyleBackColor = true;
this.createProceduresDbBtn.Click += new System.EventHandler(this.createProecduresDbBtn_Click);
//
// createWMTypesDbBtn
//
this.createWMTypesDbBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.createWMTypesDbBtn.ImageKey = global::TBF.Resources.Strings.String1;
resources.ApplyResources(this.createWMTypesDbBtn, "createWMTypesDbBtn");
this.createWMTypesDbBtn.Name = "createWMTypesDbBtn";
this.createWMTypesDbBtn.UseVisualStyleBackColor = true;
this.createWMTypesDbBtn.Click += new System.EventHandler(this.createWMTypesDbBtn_Click);
//
// createWaterMetersDbBtn
//
this.createWaterMetersDbBtn.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.createWaterMetersDbBtn.ImageKey = global::TBF.Resources.Strings.String1;
resources.ApplyResources(this.createWaterMetersDbBtn, "createWaterMetersDbBtn");
this.createWaterMetersDbBtn.Name = "createWaterMetersDbBtn";
this.createWaterMetersDbBtn.UseVisualStyleBackColor = true;
this.createWaterMetersDbBtn.Click += new System.EventHandler(this.createWaterMetersDbBtn_Click);
//
// DatabaseSettingsDlg
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.createWaterMetersDbBtn);
this.Controls.Add(this.createWMTypesDbBtn);
this.Controls.Add(this.createProceduresDbBtn);
this.Controls.Add(this.createBenchDbBtn);
this.Controls.Add(this.testConnWaterMetersBtn);
this.Controls.Add(this.testConnWMTypesBtn);
this.Controls.Add(this.testConnProceduresBtn);
this.Controls.Add(this.testConnBenchBtn);
this.Controls.Add(this.watermetersDbTypeComboBox);
this.Controls.Add(this.wmTypesDbTypeComboBox);
this.Controls.Add(this.proceduresDbTypeComboBox);
this.Controls.Add(this.benchDbTypeComboBox);
this.Controls.Add(this.usersDbTypeComboBox);
this.Controls.Add(this.dbTypeLabel);
this.Controls.Add(this.realBenchCheckBox);
this.Controls.Add(this.createUsersDbBtn);
this.Controls.Add(this.testConnUsersBtn);
this.Controls.Add(this.label6);
this.Controls.Add(this.label5);
this.Controls.Add(this.label4);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.watermetersConnectionStringTextBox);
this.Controls.Add(this.wmTypesConnectionStringTextBox);
this.Controls.Add(this.proceduresConnectionStringTextBox);
this.Controls.Add(this.benchConnectionStringTextBox);
this.Controls.Add(this.connectionStringLabel);
this.Controls.Add(this.usersConnectionStringTextBox);
this.Controls.Add(this.benchNameTextBox);
this.Controls.Add(this.label1);
this.Controls.Add(this.okButton);
this.Controls.Add(this.cancelButton);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.MinimizeBox = false;
this.Name = "DatabaseSettingsDlg";
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.Load += new System.EventHandler(this.BenchSettingsDlg_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button okButton;
private System.Windows.Forms.Button cancelButton;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.TextBox benchNameTextBox;
private System.Windows.Forms.TextBox usersConnectionStringTextBox;
private System.Windows.Forms.Label connectionStringLabel;
private System.Windows.Forms.TextBox benchConnectionStringTextBox;
private System.Windows.Forms.TextBox proceduresConnectionStringTextBox;
private System.Windows.Forms.TextBox wmTypesConnectionStringTextBox;
private System.Windows.Forms.TextBox watermetersConnectionStringTextBox;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.Label label4;
private System.Windows.Forms.Label label5;
private System.Windows.Forms.Label label6;
private System.Windows.Forms.Button testConnUsersBtn;
private System.Windows.Forms.Button createUsersDbBtn;
private System.Windows.Forms.CheckBox realBenchCheckBox;
private System.Windows.Forms.Label dbTypeLabel;
private System.Windows.Forms.ComboBox usersDbTypeComboBox;
private System.Windows.Forms.ComboBox benchDbTypeComboBox;
private System.Windows.Forms.ComboBox proceduresDbTypeComboBox;
private System.Windows.Forms.ComboBox wmTypesDbTypeComboBox;
private System.Windows.Forms.ComboBox watermetersDbTypeComboBox;
private System.Windows.Forms.Button testConnBenchBtn;
private System.Windows.Forms.Button testConnProceduresBtn;
private System.Windows.Forms.Button testConnWMTypesBtn;
private System.Windows.Forms.Button testConnWaterMetersBtn;
private System.Windows.Forms.Button createBenchDbBtn;
private System.Windows.Forms.Button createProceduresDbBtn;
private System.Windows.Forms.Button createWMTypesDbBtn;
private System.Windows.Forms.Button createWaterMetersDbBtn;
}
}
-261
View File
@@ -1,261 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using TBF.Resources;
namespace TBF
{
/// <summary>
/// Dialog to process test bench name and database settings (BenchSettings)
/// </summary>
public partial class DatabaseSettingsDlg : Form
{
// Reference to bench DB settins (not a local copy)
DatabaseSettings bench;
/// <summary>
/// Constructor
/// </summary>
/// <param name="bench">Test bench database settings</param>
public DatabaseSettingsDlg(DatabaseSettings bench)
{
this.bench = bench;
InitializeComponent();
}
void Localize()
{
Text = Strings.Test_Bench_Databases_Specification;
label1.Text = Strings.Test_bench_name;
realBenchCheckBox.Text = Strings.Test_bench_is_controlled_by_this_computer;
dbTypeLabel.Text = Strings.Database_type;
connectionStringLabel.Text = Strings.Connection_string;
label2.Text = Strings.Users_and_groups;
label3.Text = Strings.Bench_parameters;
label4.Text = Strings.Procedures;
label5.Text = Strings.Water_meter_types;
label6.Text = Strings.Water_meter_data;
okButton.Text = Strings.OkBtnText;
cancelButton.Text = Strings.CancelBtnText;
testConnBenchBtn.Text = Strings.Test_connection;
testConnProceduresBtn.Text = Strings.Test_connection;
testConnUsersBtn.Text = Strings.Test_connection;
testConnWaterMetersBtn.Text = Strings.Test_connection;
testConnWMTypesBtn.Text = Strings.Test_connection;
createBenchDbBtn.Text = Strings.Create_DB;
createProceduresDbBtn.Text = Strings.Create_DB;
createUsersDbBtn.Text = Strings.Create_DB;
createWaterMetersDbBtn.Text = Strings.Create_DB;
createWMTypesDbBtn.Text = Strings.Create_DB;
}
private void BenchSettingsDlg_Load(object sender, EventArgs e)
{
Localize();
benchNameTextBox.Text = bench.BenchName;
realBenchCheckBox.Checked = bench.IsRealBench;
/// Initialize 'Database type' combo-boxes
for (int i = 0; i < (int)DBType.DbTypesCount; i++)
{
DBType dbType = (DBType)i;
usersDbTypeComboBox.Items.Add(dbType);
benchDbTypeComboBox.Items.Add(dbType);
proceduresDbTypeComboBox.Items.Add(dbType);
wmTypesDbTypeComboBox.Items.Add(dbType);
watermetersDbTypeComboBox.Items.Add(dbType);
}
usersDbTypeComboBox.SelectedIndex = (int)bench.UsersDBSettings.DbType;
benchDbTypeComboBox.SelectedIndex = (int)bench.BenchDBSettings.DbType;
proceduresDbTypeComboBox.SelectedIndex = (int)bench.ProceduresDBSettings.DbType;
wmTypesDbTypeComboBox.SelectedIndex = (int)bench.WMTypesDBSettings.DbType;
watermetersDbTypeComboBox.SelectedIndex = (int)bench.WaterMetersDBSettings.DbType;
/// Initialize connection strings
usersConnectionStringTextBox.Text = bench.UsersDBSettings.ConnectionString;
benchConnectionStringTextBox.Text = bench.BenchDBSettings.ConnectionString;
proceduresConnectionStringTextBox.Text = bench.ProceduresDBSettings.ConnectionString;
wmTypesConnectionStringTextBox.Text = bench.WMTypesDBSettings.ConnectionString;
watermetersConnectionStringTextBox.Text = bench.WaterMetersDBSettings.ConnectionString;
}
bool UpdateBenchFromUIControls()
{
for (int i = 0; i < Program.LocalSettings.BenchesCount; i++)
{
if (bench != Program.LocalSettings.TestBenches[i] &&
benchNameTextBox.Text == Program.LocalSettings.TestBenches[i].BenchName)
{
MessageBox.Show(Strings.Bench_name_conflict_Use_another_name_pls, Strings.Error, MessageBoxButtons.OK);
return false;
}
}
bench.BenchName = benchNameTextBox.Text;
bench.IsRealBench = realBenchCheckBox.Checked;
bench.UsersDBSettings.ConnectionString = usersConnectionStringTextBox.Text;
bench.BenchDBSettings.ConnectionString = benchConnectionStringTextBox.Text;
bench.ProceduresDBSettings.ConnectionString = proceduresConnectionStringTextBox.Text;
bench.WMTypesDBSettings.ConnectionString = wmTypesConnectionStringTextBox.Text;
bench.WaterMetersDBSettings.ConnectionString = watermetersConnectionStringTextBox.Text;
bench.UsersDBSettings.DbType = (DBType)usersDbTypeComboBox.SelectedIndex;
bench.BenchDBSettings.DbType = (DBType)benchDbTypeComboBox.SelectedIndex;
bench.ProceduresDBSettings.DbType = (DBType)proceduresDbTypeComboBox.SelectedIndex;
bench.WMTypesDBSettings.DbType = (DBType)wmTypesDbTypeComboBox.SelectedIndex;
bench.WaterMetersDBSettings.DbType = (DBType)watermetersDbTypeComboBox.SelectedIndex;
return true;
}
/// <summary>
/// Update bench DB setting, return 'OK'
/// </summary>
/// <param name="sender">Not used</param>
/// <param name="e">Not used</param>
private void okButton_Click(object sender, EventArgs e)
{
if (UpdateBenchFromUIControls())
{
DialogResult = DialogResult.OK;
Close();
return;
}
DialogResult = DialogResult.None;
}
/// <summary>
/// Throw away changes, return 'Cancel'
/// </summary>
/// <param name="sender">Not used</param>
/// <param name="e">Not used</param>
private void cancelButton_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
Close();
}
private void createDatabasesButton_Click(object sender, EventArgs e)
{
if (!UpdateBenchFromUIControls()) return;
if (DialogResult.OK == MessageBox.Show(Strings.DB_will_be_overwritten + Environment.NewLine +
Strings.Do_you_want_to_proceed, Strings.Warning,
MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation))
try
{
Cursor.Current = Cursors.WaitCursor;
FluentCommon.CreateEmptyUsersDB(bench.UsersDBSettings);
MessageBox.Show(Strings.DB_was_successfully_created, Strings.Notification);
Cursor.Current = Cursors.Default;
DialogResult = DialogResult.None;
}
catch (Exception exception)
{
Cursor.Current = Cursors.Default;
MessageBox.Show(Strings.Error_while_creating_DB_Reason + exception.Message, Strings.Error);
}
}
private void createbenchDbBtn_Click(object sender, EventArgs e)
{
if (!UpdateBenchFromUIControls()) return;
if (DialogResult.OK == MessageBox.Show(Strings.DB_will_be_overwritten + Environment.NewLine +
Strings.Do_you_want_to_proceed, Strings.Warning,
MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation))
try
{
Cursor.Current = Cursors.WaitCursor;
FluentCommon.CreateEmptyBenchDB(bench.BenchDBSettings);
MessageBox.Show(Strings.DB_was_successfully_created, Strings.Notification);
Cursor.Current = Cursors.Default;
DialogResult = DialogResult.None;
}
catch (Exception exception)
{
Cursor.Current = Cursors.Default;
MessageBox.Show(Strings.Error_while_creating_DB_Reason + exception.Message, Strings.Error);
}
}
private void createProecduresDbBtn_Click(object sender, EventArgs e)
{
if (!UpdateBenchFromUIControls()) return;
if (DialogResult.OK == MessageBox.Show(Strings.DB_will_be_overwritten + Environment.NewLine +
Strings.Do_you_want_to_proceed, Strings.Warning,
MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation))
try
{
Cursor.Current = Cursors.WaitCursor;
FluentCommon.CreateEmptyProceduresDB(bench.ProceduresDBSettings);
MessageBox.Show(Strings.DB_was_successfully_created, Strings.Notification);
Cursor.Current = Cursors.Default;
DialogResult = DialogResult.None;
}
catch (Exception exception)
{
Cursor.Current = Cursors.Default;
MessageBox.Show(Strings.Error_while_creating_DB_Reason + exception.Message, Strings.Error);
}
}
private void createWMTypesDbBtn_Click(object sender, EventArgs e)
{
}
private void createWaterMetersDbBtn_Click(object sender, EventArgs e)
{
if (!UpdateBenchFromUIControls()) return;
if (DialogResult.OK == MessageBox.Show(Strings.DB_will_be_overwritten + Environment.NewLine +
Strings.Do_you_want_to_proceed, Strings.Warning,
MessageBoxButtons.OKCancel, MessageBoxIcon.Exclamation))
try
{
Cursor.Current = Cursors.WaitCursor;
FluentCommon.CreateEmptyWaterMetersDB(bench.WaterMetersDBSettings);
MessageBox.Show(Strings.DB_was_successfully_created, Strings.Notification);
Cursor.Current = Cursors.Default;
DialogResult = DialogResult.None;
}
catch (Exception exception)
{
Cursor.Current = Cursors.Default;
MessageBox.Show(Strings.Error_while_creating_DB_Reason + exception.Message, Strings.Error);
}
}
private void testConnUsersBtn_Click(object sender, EventArgs e)
{
}
private void testConnBenchBtn_Click(object sender, EventArgs e)
{
}
private void testConnProceduresBtn_Click(object sender, EventArgs e)
{
}
private void testConnWMTypesBtn_Click(object sender, EventArgs e)
{
}
private void testConnWaterMetersBtn_Click(object sender, EventArgs e)
{
}
}
}
-930
View File
@@ -1,930 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="okButton.Location" type="System.Drawing.Point, System.Drawing">
<value>614, 15</value>
</data>
<data name="okButton.Size" type="System.Drawing.Size, System.Drawing">
<value>217, 28</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="okButton.TabIndex" type="System.Int32, mscorlib">
<value>14</value>
</data>
<data name="okButton.Text" xml:space="preserve">
<value>OK</value>
</data>
<data name="&gt;&gt;okButton.Name" xml:space="preserve">
<value>okButton</value>
</data>
<data name="&gt;&gt;okButton.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;okButton.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;okButton.ZOrder" xml:space="preserve">
<value>30</value>
</data>
<data name="cancelButton.Location" type="System.Drawing.Point, System.Drawing">
<value>614, 49</value>
</data>
<data name="cancelButton.Size" type="System.Drawing.Size, System.Drawing">
<value>217, 28</value>
</data>
<data name="cancelButton.TabIndex" type="System.Int32, mscorlib">
<value>13</value>
</data>
<data name="cancelButton.Text" xml:space="preserve">
<value>Cancel</value>
</data>
<data name="&gt;&gt;cancelButton.Name" xml:space="preserve">
<value>cancelButton</value>
</data>
<data name="&gt;&gt;cancelButton.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;cancelButton.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;cancelButton.ZOrder" xml:space="preserve">
<value>31</value>
</data>
<data name="label1.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label1.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 18</value>
</data>
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>93, 13</value>
</data>
<data name="label1.TabIndex" type="System.Int32, mscorlib">
<value>15</value>
</data>
<data name="label1.Text" xml:space="preserve">
<value>Test Bench Name</value>
</data>
<data name="&gt;&gt;label1.Name" xml:space="preserve">
<value>label1</value>
</data>
<data name="&gt;&gt;label1.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;label1.ZOrder" xml:space="preserve">
<value>29</value>
</data>
<data name="benchNameTextBox.Location" type="System.Drawing.Point, System.Drawing">
<value>116, 15</value>
</data>
<data name="benchNameTextBox.Size" type="System.Drawing.Size, System.Drawing">
<value>315, 20</value>
</data>
<data name="benchNameTextBox.TabIndex" type="System.Int32, mscorlib">
<value>16</value>
</data>
<data name="&gt;&gt;benchNameTextBox.Name" xml:space="preserve">
<value>benchNameTextBox</value>
</data>
<data name="&gt;&gt;benchNameTextBox.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;benchNameTextBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;benchNameTextBox.ZOrder" xml:space="preserve">
<value>28</value>
</data>
<data name="usersConnectionStringTextBox.Location" type="System.Drawing.Point, System.Drawing">
<value>202, 101</value>
</data>
<data name="usersConnectionStringTextBox.Size" type="System.Drawing.Size, System.Drawing">
<value>406, 20</value>
</data>
<data name="usersConnectionStringTextBox.TabIndex" type="System.Int32, mscorlib">
<value>17</value>
</data>
<data name="&gt;&gt;usersConnectionStringTextBox.Name" xml:space="preserve">
<value>usersConnectionStringTextBox</value>
</data>
<data name="&gt;&gt;usersConnectionStringTextBox.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;usersConnectionStringTextBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;usersConnectionStringTextBox.ZOrder" xml:space="preserve">
<value>27</value>
</data>
<data name="connectionStringLabel.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="connectionStringLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>199, 82</value>
</data>
<data name="connectionStringLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>89, 13</value>
</data>
<data name="connectionStringLabel.TabIndex" type="System.Int32, mscorlib">
<value>18</value>
</data>
<data name="connectionStringLabel.Text" xml:space="preserve">
<value>Connection string</value>
</data>
<data name="&gt;&gt;connectionStringLabel.Name" xml:space="preserve">
<value>connectionStringLabel</value>
</data>
<data name="&gt;&gt;connectionStringLabel.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;connectionStringLabel.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;connectionStringLabel.ZOrder" xml:space="preserve">
<value>26</value>
</data>
<data name="benchConnectionStringTextBox.Location" type="System.Drawing.Point, System.Drawing">
<value>202, 127</value>
</data>
<data name="benchConnectionStringTextBox.Size" type="System.Drawing.Size, System.Drawing">
<value>406, 20</value>
</data>
<data name="benchConnectionStringTextBox.TabIndex" type="System.Int32, mscorlib">
<value>19</value>
</data>
<data name="&gt;&gt;benchConnectionStringTextBox.Name" xml:space="preserve">
<value>benchConnectionStringTextBox</value>
</data>
<data name="&gt;&gt;benchConnectionStringTextBox.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;benchConnectionStringTextBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;benchConnectionStringTextBox.ZOrder" xml:space="preserve">
<value>25</value>
</data>
<data name="proceduresConnectionStringTextBox.Location" type="System.Drawing.Point, System.Drawing">
<value>202, 153</value>
</data>
<data name="proceduresConnectionStringTextBox.Size" type="System.Drawing.Size, System.Drawing">
<value>406, 20</value>
</data>
<data name="proceduresConnectionStringTextBox.TabIndex" type="System.Int32, mscorlib">
<value>20</value>
</data>
<data name="&gt;&gt;proceduresConnectionStringTextBox.Name" xml:space="preserve">
<value>proceduresConnectionStringTextBox</value>
</data>
<data name="&gt;&gt;proceduresConnectionStringTextBox.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;proceduresConnectionStringTextBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;proceduresConnectionStringTextBox.ZOrder" xml:space="preserve">
<value>24</value>
</data>
<data name="wmTypesConnectionStringTextBox.Location" type="System.Drawing.Point, System.Drawing">
<value>202, 179</value>
</data>
<data name="wmTypesConnectionStringTextBox.Size" type="System.Drawing.Size, System.Drawing">
<value>406, 20</value>
</data>
<data name="wmTypesConnectionStringTextBox.TabIndex" type="System.Int32, mscorlib">
<value>21</value>
</data>
<data name="&gt;&gt;wmTypesConnectionStringTextBox.Name" xml:space="preserve">
<value>wmTypesConnectionStringTextBox</value>
</data>
<data name="&gt;&gt;wmTypesConnectionStringTextBox.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;wmTypesConnectionStringTextBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;wmTypesConnectionStringTextBox.ZOrder" xml:space="preserve">
<value>23</value>
</data>
<data name="watermetersConnectionStringTextBox.Location" type="System.Drawing.Point, System.Drawing">
<value>202, 205</value>
</data>
<data name="watermetersConnectionStringTextBox.Size" type="System.Drawing.Size, System.Drawing">
<value>406, 20</value>
</data>
<data name="watermetersConnectionStringTextBox.TabIndex" type="System.Int32, mscorlib">
<value>22</value>
</data>
<data name="&gt;&gt;watermetersConnectionStringTextBox.Name" xml:space="preserve">
<value>watermetersConnectionStringTextBox</value>
</data>
<data name="&gt;&gt;watermetersConnectionStringTextBox.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;watermetersConnectionStringTextBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;watermetersConnectionStringTextBox.ZOrder" xml:space="preserve">
<value>22</value>
</data>
<data name="label2.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label2.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 104</value>
</data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>90, 13</value>
</data>
<data name="label2.TabIndex" type="System.Int32, mscorlib">
<value>47</value>
</data>
<data name="label2.Text" xml:space="preserve">
<value>Users and groups</value>
</data>
<data name="&gt;&gt;label2.Name" xml:space="preserve">
<value>label2</value>
</data>
<data name="&gt;&gt;label2.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label2.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;label2.ZOrder" xml:space="preserve">
<value>21</value>
</data>
<data name="label3.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label3.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 130</value>
</data>
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>93, 13</value>
</data>
<data name="label3.TabIndex" type="System.Int32, mscorlib">
<value>48</value>
</data>
<data name="label3.Text" xml:space="preserve">
<value>Bench parameters</value>
</data>
<data name="&gt;&gt;label3.Name" xml:space="preserve">
<value>label3</value>
</data>
<data name="&gt;&gt;label3.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label3.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;label3.ZOrder" xml:space="preserve">
<value>20</value>
</data>
<data name="label4.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label4.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 156</value>
</data>
<data name="label4.Size" type="System.Drawing.Size, System.Drawing">
<value>61, 13</value>
</data>
<data name="label4.TabIndex" type="System.Int32, mscorlib">
<value>49</value>
</data>
<data name="label4.Text" xml:space="preserve">
<value>Procedures</value>
</data>
<data name="&gt;&gt;label4.Name" xml:space="preserve">
<value>label4</value>
</data>
<data name="&gt;&gt;label4.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label4.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;label4.ZOrder" xml:space="preserve">
<value>19</value>
</data>
<data name="label5.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label5.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 182</value>
</data>
<data name="label5.Size" type="System.Drawing.Size, System.Drawing">
<value>90, 13</value>
</data>
<data name="label5.TabIndex" type="System.Int32, mscorlib">
<value>50</value>
</data>
<data name="label5.Text" xml:space="preserve">
<value>Watermeter types</value>
</data>
<data name="&gt;&gt;label5.Name" xml:space="preserve">
<value>label5</value>
</data>
<data name="&gt;&gt;label5.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label5.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;label5.ZOrder" xml:space="preserve">
<value>18</value>
</data>
<data name="label6.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label6.Location" type="System.Drawing.Point, System.Drawing">
<value>12, 208</value>
</data>
<data name="label6.Size" type="System.Drawing.Size, System.Drawing">
<value>67, 13</value>
</data>
<data name="label6.TabIndex" type="System.Int32, mscorlib">
<value>51</value>
</data>
<data name="label6.Text" xml:space="preserve">
<value>Watermeters</value>
</data>
<data name="&gt;&gt;label6.Name" xml:space="preserve">
<value>label6</value>
</data>
<data name="&gt;&gt;label6.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label6.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;label6.ZOrder" xml:space="preserve">
<value>17</value>
</data>
<data name="testConnUsersBtn.Location" type="System.Drawing.Point, System.Drawing">
<value>614, 99</value>
</data>
<data name="testConnUsersBtn.Size" type="System.Drawing.Size, System.Drawing">
<value>95, 23</value>
</data>
<data name="testConnUsersBtn.TabIndex" type="System.Int32, mscorlib">
<value>52</value>
</data>
<data name="testConnUsersBtn.Text" xml:space="preserve">
<value>Test Connection</value>
</data>
<data name="&gt;&gt;testConnUsersBtn.Name" xml:space="preserve">
<value>testConnUsersBtn</value>
</data>
<data name="&gt;&gt;testConnUsersBtn.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;testConnUsersBtn.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;testConnUsersBtn.ZOrder" xml:space="preserve">
<value>16</value>
</data>
<data name="createUsersDbBtn.Location" type="System.Drawing.Point, System.Drawing">
<value>711, 99</value>
</data>
<data name="createUsersDbBtn.Size" type="System.Drawing.Size, System.Drawing">
<value>120, 23</value>
</data>
<data name="createUsersDbBtn.TabIndex" type="System.Int32, mscorlib">
<value>53</value>
</data>
<data name="createUsersDbBtn.Text" xml:space="preserve">
<value>Create DB</value>
</data>
<data name="&gt;&gt;createUsersDbBtn.Name" xml:space="preserve">
<value>createUsersDbBtn</value>
</data>
<data name="&gt;&gt;createUsersDbBtn.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;createUsersDbBtn.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;createUsersDbBtn.ZOrder" xml:space="preserve">
<value>15</value>
</data>
<data name="realBenchCheckBox.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="realBenchCheckBox.Location" type="System.Drawing.Point, System.Drawing">
<value>116, 47</value>
</data>
<data name="realBenchCheckBox.Size" type="System.Drawing.Size, System.Drawing">
<value>219, 17</value>
</data>
<data name="realBenchCheckBox.TabIndex" type="System.Int32, mscorlib">
<value>54</value>
</data>
<data name="realBenchCheckBox.Text" xml:space="preserve">
<value>Test bench is controlled by this computer</value>
</data>
<data name="&gt;&gt;realBenchCheckBox.Name" xml:space="preserve">
<value>realBenchCheckBox</value>
</data>
<data name="&gt;&gt;realBenchCheckBox.Type" xml:space="preserve">
<value>System.Windows.Forms.CheckBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;realBenchCheckBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;realBenchCheckBox.ZOrder" xml:space="preserve">
<value>14</value>
</data>
<data name="dbTypeLabel.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="dbTypeLabel.Location" type="System.Drawing.Point, System.Drawing">
<value>113, 82</value>
</data>
<data name="dbTypeLabel.Size" type="System.Drawing.Size, System.Drawing">
<value>76, 13</value>
</data>
<data name="dbTypeLabel.TabIndex" type="System.Int32, mscorlib">
<value>55</value>
</data>
<data name="dbTypeLabel.Text" xml:space="preserve">
<value>Database type</value>
</data>
<data name="&gt;&gt;dbTypeLabel.Name" xml:space="preserve">
<value>dbTypeLabel</value>
</data>
<data name="&gt;&gt;dbTypeLabel.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;dbTypeLabel.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;dbTypeLabel.ZOrder" xml:space="preserve">
<value>13</value>
</data>
<data name="usersDbTypeComboBox.Location" type="System.Drawing.Point, System.Drawing">
<value>116, 101</value>
</data>
<data name="usersDbTypeComboBox.Size" type="System.Drawing.Size, System.Drawing">
<value>80, 21</value>
</data>
<data name="usersDbTypeComboBox.TabIndex" type="System.Int32, mscorlib">
<value>56</value>
</data>
<data name="&gt;&gt;usersDbTypeComboBox.Name" xml:space="preserve">
<value>usersDbTypeComboBox</value>
</data>
<data name="&gt;&gt;usersDbTypeComboBox.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;usersDbTypeComboBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;usersDbTypeComboBox.ZOrder" xml:space="preserve">
<value>12</value>
</data>
<data name="benchDbTypeComboBox.Location" type="System.Drawing.Point, System.Drawing">
<value>116, 127</value>
</data>
<data name="benchDbTypeComboBox.Size" type="System.Drawing.Size, System.Drawing">
<value>80, 21</value>
</data>
<data name="benchDbTypeComboBox.TabIndex" type="System.Int32, mscorlib">
<value>57</value>
</data>
<data name="&gt;&gt;benchDbTypeComboBox.Name" xml:space="preserve">
<value>benchDbTypeComboBox</value>
</data>
<data name="&gt;&gt;benchDbTypeComboBox.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;benchDbTypeComboBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;benchDbTypeComboBox.ZOrder" xml:space="preserve">
<value>11</value>
</data>
<data name="proceduresDbTypeComboBox.Location" type="System.Drawing.Point, System.Drawing">
<value>116, 153</value>
</data>
<data name="proceduresDbTypeComboBox.Size" type="System.Drawing.Size, System.Drawing">
<value>80, 21</value>
</data>
<data name="proceduresDbTypeComboBox.TabIndex" type="System.Int32, mscorlib">
<value>58</value>
</data>
<data name="&gt;&gt;proceduresDbTypeComboBox.Name" xml:space="preserve">
<value>proceduresDbTypeComboBox</value>
</data>
<data name="&gt;&gt;proceduresDbTypeComboBox.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;proceduresDbTypeComboBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;proceduresDbTypeComboBox.ZOrder" xml:space="preserve">
<value>10</value>
</data>
<data name="wmTypesDbTypeComboBox.Location" type="System.Drawing.Point, System.Drawing">
<value>116, 179</value>
</data>
<data name="wmTypesDbTypeComboBox.Size" type="System.Drawing.Size, System.Drawing">
<value>80, 21</value>
</data>
<data name="wmTypesDbTypeComboBox.TabIndex" type="System.Int32, mscorlib">
<value>59</value>
</data>
<data name="&gt;&gt;wmTypesDbTypeComboBox.Name" xml:space="preserve">
<value>wmTypesDbTypeComboBox</value>
</data>
<data name="&gt;&gt;wmTypesDbTypeComboBox.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;wmTypesDbTypeComboBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;wmTypesDbTypeComboBox.ZOrder" xml:space="preserve">
<value>9</value>
</data>
<data name="watermetersDbTypeComboBox.Location" type="System.Drawing.Point, System.Drawing">
<value>116, 205</value>
</data>
<data name="watermetersDbTypeComboBox.Size" type="System.Drawing.Size, System.Drawing">
<value>80, 21</value>
</data>
<data name="watermetersDbTypeComboBox.TabIndex" type="System.Int32, mscorlib">
<value>60</value>
</data>
<data name="&gt;&gt;watermetersDbTypeComboBox.Name" xml:space="preserve">
<value>watermetersDbTypeComboBox</value>
</data>
<data name="&gt;&gt;watermetersDbTypeComboBox.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;watermetersDbTypeComboBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;watermetersDbTypeComboBox.ZOrder" xml:space="preserve">
<value>8</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="testConnBenchBtn.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="testConnBenchBtn.Location" type="System.Drawing.Point, System.Drawing">
<value>614, 125</value>
</data>
<data name="testConnBenchBtn.Size" type="System.Drawing.Size, System.Drawing">
<value>95, 23</value>
</data>
<data name="testConnBenchBtn.TabIndex" type="System.Int32, mscorlib">
<value>61</value>
</data>
<data name="testConnBenchBtn.Text" xml:space="preserve">
<value>Test Connection</value>
</data>
<data name="&gt;&gt;testConnBenchBtn.Name" xml:space="preserve">
<value>testConnBenchBtn</value>
</data>
<data name="&gt;&gt;testConnBenchBtn.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;testConnBenchBtn.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;testConnBenchBtn.ZOrder" xml:space="preserve">
<value>7</value>
</data>
<data name="testConnProceduresBtn.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="testConnProceduresBtn.Location" type="System.Drawing.Point, System.Drawing">
<value>614, 151</value>
</data>
<data name="testConnProceduresBtn.Size" type="System.Drawing.Size, System.Drawing">
<value>95, 23</value>
</data>
<data name="testConnProceduresBtn.TabIndex" type="System.Int32, mscorlib">
<value>62</value>
</data>
<data name="testConnProceduresBtn.Text" xml:space="preserve">
<value>Test Connection</value>
</data>
<data name="&gt;&gt;testConnProceduresBtn.Name" xml:space="preserve">
<value>testConnProceduresBtn</value>
</data>
<data name="&gt;&gt;testConnProceduresBtn.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;testConnProceduresBtn.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;testConnProceduresBtn.ZOrder" xml:space="preserve">
<value>6</value>
</data>
<data name="testConnWMTypesBtn.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="testConnWMTypesBtn.Location" type="System.Drawing.Point, System.Drawing">
<value>614, 177</value>
</data>
<data name="testConnWMTypesBtn.Size" type="System.Drawing.Size, System.Drawing">
<value>95, 23</value>
</data>
<data name="testConnWMTypesBtn.TabIndex" type="System.Int32, mscorlib">
<value>63</value>
</data>
<data name="testConnWMTypesBtn.Text" xml:space="preserve">
<value>Test Connection</value>
</data>
<data name="&gt;&gt;testConnWMTypesBtn.Name" xml:space="preserve">
<value>testConnWMTypesBtn</value>
</data>
<data name="&gt;&gt;testConnWMTypesBtn.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;testConnWMTypesBtn.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;testConnWMTypesBtn.ZOrder" xml:space="preserve">
<value>5</value>
</data>
<data name="testConnWaterMetersBtn.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="testConnWaterMetersBtn.Location" type="System.Drawing.Point, System.Drawing">
<value>614, 203</value>
</data>
<data name="testConnWaterMetersBtn.Size" type="System.Drawing.Size, System.Drawing">
<value>95, 23</value>
</data>
<data name="testConnWaterMetersBtn.TabIndex" type="System.Int32, mscorlib">
<value>64</value>
</data>
<data name="testConnWaterMetersBtn.Text" xml:space="preserve">
<value>Test Connection</value>
</data>
<data name="&gt;&gt;testConnWaterMetersBtn.Name" xml:space="preserve">
<value>testConnWaterMetersBtn</value>
</data>
<data name="&gt;&gt;testConnWaterMetersBtn.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;testConnWaterMetersBtn.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;testConnWaterMetersBtn.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="createBenchDbBtn.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="createBenchDbBtn.Location" type="System.Drawing.Point, System.Drawing">
<value>711, 124</value>
</data>
<data name="createBenchDbBtn.Size" type="System.Drawing.Size, System.Drawing">
<value>120, 23</value>
</data>
<data name="createBenchDbBtn.TabIndex" type="System.Int32, mscorlib">
<value>65</value>
</data>
<data name="createBenchDbBtn.Text" xml:space="preserve">
<value>Create DB</value>
</data>
<data name="&gt;&gt;createBenchDbBtn.Name" xml:space="preserve">
<value>createBenchDbBtn</value>
</data>
<data name="&gt;&gt;createBenchDbBtn.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;createBenchDbBtn.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;createBenchDbBtn.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="createProceduresDbBtn.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="createProceduresDbBtn.Location" type="System.Drawing.Point, System.Drawing">
<value>711, 150</value>
</data>
<data name="createProceduresDbBtn.Size" type="System.Drawing.Size, System.Drawing">
<value>120, 23</value>
</data>
<data name="createProceduresDbBtn.TabIndex" type="System.Int32, mscorlib">
<value>66</value>
</data>
<data name="createProceduresDbBtn.Text" xml:space="preserve">
<value>Create DB</value>
</data>
<data name="&gt;&gt;createProceduresDbBtn.Name" xml:space="preserve">
<value>createProceduresDbBtn</value>
</data>
<data name="&gt;&gt;createProceduresDbBtn.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;createProceduresDbBtn.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;createProceduresDbBtn.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="createWMTypesDbBtn.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="createWMTypesDbBtn.Location" type="System.Drawing.Point, System.Drawing">
<value>711, 176</value>
</data>
<data name="createWMTypesDbBtn.Size" type="System.Drawing.Size, System.Drawing">
<value>120, 23</value>
</data>
<data name="createWMTypesDbBtn.TabIndex" type="System.Int32, mscorlib">
<value>67</value>
</data>
<data name="createWMTypesDbBtn.Text" xml:space="preserve">
<value>Create DB</value>
</data>
<data name="&gt;&gt;createWMTypesDbBtn.Name" xml:space="preserve">
<value>createWMTypesDbBtn</value>
</data>
<data name="&gt;&gt;createWMTypesDbBtn.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;createWMTypesDbBtn.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;createWMTypesDbBtn.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="createWaterMetersDbBtn.ImeMode" type="System.Windows.Forms.ImeMode, System.Windows.Forms">
<value>NoControl</value>
</data>
<data name="createWaterMetersDbBtn.Location" type="System.Drawing.Point, System.Drawing">
<value>711, 202</value>
</data>
<data name="createWaterMetersDbBtn.Size" type="System.Drawing.Size, System.Drawing">
<value>120, 23</value>
</data>
<data name="createWaterMetersDbBtn.TabIndex" type="System.Int32, mscorlib">
<value>68</value>
</data>
<data name="createWaterMetersDbBtn.Text" xml:space="preserve">
<value>Create DB</value>
</data>
<data name="&gt;&gt;createWaterMetersDbBtn.Name" xml:space="preserve">
<value>createWaterMetersDbBtn</value>
</data>
<data name="&gt;&gt;createWaterMetersDbBtn.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;createWaterMetersDbBtn.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;createWaterMetersDbBtn.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 13</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>836, 241</value>
</data>
<data name="$this.StartPosition" type="System.Windows.Forms.FormStartPosition, System.Windows.Forms">
<value>CenterParent</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>Test Bench Databases Specification</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>DatabaseSettingsDlg</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
</root>
-78
View File
@@ -1,78 +0,0 @@
using System;
using System.Collections.Generic;
namespace ResultsBrowser.Entities
{
public class BenchPath : IHasItemNr, IHasValves
{
public virtual int Id { get; protected set; }
public virtual int ItemNr { get; set; }
public virtual string Name { get; set; }
public virtual float Qfrom { get; set; } /// Water flow in [m3/h]
public virtual float Qto { get; set; } /// Water flow in [m3/h]
public virtual string TempIn { get; set; }
public virtual string TempOut { get; set; }
public virtual string PressIn { get; set; }
public virtual string PressOut { get; set; }
/// Valves
public virtual string ValvesOpen { get; set; }
public virtual string ValvesClose { get; set; }
/// ------------- Additional stuff not mapped into the database -------------
public BenchPath()
{
}
public BenchPath(string name, int itemNr)
: this()
{
Name = name;
ItemNr = itemNr;
}
public BenchPath(BenchControl.BenchPath path)
: this(path.Name, path.ItemNr)
{
Qfrom = path.Qfrom;
Qto = path.Qto;
TempIn = (path.TempIn != null) ? path.TempIn.Cfg.Name : null;
TempOut = (path.TempOut != null) ? path.TempOut.Cfg.Name : null;
PressIn = (path.PressIn != null) ? path.PressIn.Cfg.Name : null;
PressOut = (path.PressOut != null) ? path.PressOut.Cfg.Name : null;
string vOpen = string.Empty;
foreach (var valve in path.ValvesOpen)
{
if (vOpen != string.Empty) vOpen += ";";
vOpen += valve.Cfg.Name;
}
ValvesOpen = vOpen;
string vClose = string.Empty;
foreach (var valve in path.ValvesClose)
{
if (vClose != string.Empty) vClose += ";";
vClose += valve.Cfg.Name;
}
ValvesClose = vClose;
}
public virtual BenchPath Clone(string name, int itemNr)
{
BenchPath result = new BenchPath(name, itemNr);
result.Qfrom = Qfrom;
result.Qto = Qto;
result.TempIn = TempIn;
result.TempOut = TempOut;
result.PressIn = PressIn;
result.PressOut = PressOut;
result.ValvesOpen = ValvesOpen;
result.ValvesClose = ValvesClose;
return result;
}
}
}
-71
View File
@@ -1,71 +0,0 @@
using System;
using System.Collections.Generic;
namespace ResultsBrowser.Entities
{
public class Component : IHasItemNr
{
public virtual int Id { get; protected set; }
public virtual int ItemNr { get; set; }
public virtual string Name { get; set; }
public virtual string ClassName { get; set; }
public virtual string ParentName { get; set; }
public virtual DebugMode Mode { get; set; }
public virtual LogLevel Logging { get; set; }
public virtual string Parameters { get; set; }
public virtual IList<MeasurementCorrection> Corrections { get; set; }
/// ------------- Additional stuff not mapped into the database -------------
public Component()
{
Corrections = new List<MeasurementCorrection>();
}
public static Component CreateFromCfg(string name, string className, string parentName, int itemNr,
DebugMode debugLevel, LogLevel logLevel, string parameters)
{
Component result = new Component();
result.ItemNr = itemNr;
result.Name = name;
result.ClassName = className;
result.ParentName = parentName;
result.Mode = debugLevel;
result.Logging = logLevel;
result.Parameters = parameters;
return result;
}
// Makes a new copy of this object (not just a reference)
public virtual Component Clone()
{
Component result = new Component();
result.ItemNr = ItemNr;
result.Name = Name;
result.ClassName = ClassName;
result.ParentName = ParentName;
result.Mode = Mode;
result.Logging = Logging;
result.Parameters = Parameters;
return result;
}
public virtual string ToString(string indent)
{
string result = string.Empty;
result += indent + "ItemNr = " + (ItemNr + 1).ToString() + Environment.NewLine;
result += indent + "Name = " + Name + Environment.NewLine;
result += indent + "ClassName = " + ClassName + Environment.NewLine;
if (ParentName != null)
{
result += indent + "ParentName = " + ParentName + Environment.NewLine;
}
result += indent + "DebugLevel = " + Mode.ToString() + Environment.NewLine;
result += indent + "LogLevel = " + Logging.ToString() + Environment.NewLine;
result += indent + "Parameters = " + Parameters + Environment.NewLine;
return result;
}
}
}
@@ -1,20 +0,0 @@
namespace ResultsBrowser.Entities
{
public class ComponentProcedure
{
public virtual int Id { get; protected set; }
public virtual string CmpntName { get; set; } /// Component name
public virtual string Parameters { get; set; }
public virtual Procedure Procedure { get; set; }
public virtual ComponentProcedure Clone()
{
ComponentProcedure result = new ComponentProcedure();
result.CmpntName = CmpntName;
result.Parameters = Parameters;
result.Procedure = Procedure;
return result;
}
}
}
-20
View File
@@ -1,20 +0,0 @@
namespace ResultsBrowser.Entities
{
public class ComponentTest
{
public virtual int Id { get; protected set; }
public virtual string CmpntName { get; set; } /// Component name
public virtual string Parameters { get; set; }
public virtual Test Test { get; set; }
public virtual ComponentTest Clone()
{
ComponentTest result = new ComponentTest();
result.CmpntName = CmpntName;
result.Parameters = Parameters;
result.Test = Test;
return result;
}
}
}
-85
View File
@@ -1,85 +0,0 @@
using System;
using System.Collections.Generic;
namespace ResultsBrowser.Entities
{
/// <summary>
/// Kind of meters for the procedure / test
/// </summary>
public enum MetersKind
{
Single,
Combined,
}
/// <summary>
/// Flow set method Std/ComposedMeter
/// </summary>
public enum QSetMethod
{
Std,
ComposedMeter,
Count,
}
/// <summary>
/// Procedure method FSS/SSS
/// </summary>
public enum TestMethod2
{
FSS,
SSS,
Count,
}
public enum TestRedType
{
Fix,
/// etc.
Count,
}
public enum FQC1
{
FQC1,
FQP1,
Count,
}
public enum Device
{
Screen,
Printer,
Disk,
}
/// <summary>
/// Possible modes of operation of components and devices.
/// </summary>
public enum DebugMode
{
DetectedOff = -2,
DetectedOn = -1,
Normal = 0, /// Normal operation
AutoDetect, /// The component (device) will be auto-detected
Off, /// The component is off
Record,
Reply,
Simulate, /// Test bench simulation, this mode does not require any hardware
Inherit,
Count,
}
public enum LogLevel
{
Off,
Fatal,
Error,
Warn,
Info,
Debug,
All,
Count,
}
}
-69
View File
@@ -1,69 +0,0 @@
using System;
using System.Collections.Generic;
namespace ResultsBrowser.Entities
{
public class FeedingPath : IHasItemNr, IHasValves
{
public virtual int Id { get; protected set; }
public virtual int ItemNr { get; set; }
public virtual string Name { get; set; }
public virtual float Qfrom { get; set; } /// Water flow in [m3/h]
public virtual float Qto { get; set; } /// Water flow in [m3/h]
public virtual string Pump { get; set; }
/// Valves
public virtual string ValvesOpen { get; set; }
public virtual string ValvesClose { get; set; }
/// ------------- Additional stuff not mapped into the database -------------
public FeedingPath()
{
}
public FeedingPath(string name, int itemNr)
: this()
{
Name = name;
ItemNr = itemNr;
}
public FeedingPath(BenchControl.FeedingPath path)
: this(path.Name, path.ItemNr)
{
Qfrom = path.Qfrom;
Qto = path.Qto;
Pump = (path.Pump != null) ? path.Pump.Cfg.Name : null;
string vOpen = string.Empty;
foreach (var valve in path.ValvesOpen)
{
if (vOpen != string.Empty) vOpen += ";";
vOpen += valve.Cfg.Name;
}
ValvesOpen = vOpen;
string vClose = string.Empty;
foreach (var valve in path.ValvesClose)
{
if (vClose != string.Empty) vClose += ";";
vClose += valve.Cfg.Name;
}
ValvesClose = vClose;
}
public virtual FeedingPath Clone(string name, int itemNr)
{
FeedingPath result = new FeedingPath(name, itemNr);
result.Qfrom = Qfrom;
result.Qto = Qto;
result.Pump = Pump;
result.ValvesOpen = ValvesOpen;
result.ValvesClose = ValvesClose;
return result;
}
}
}
-12
View File
@@ -1,12 +0,0 @@
using System;
using System.Collections.Generic;
namespace ResultsBrowser.Entities
{
public class Group
{
public virtual int Id { get; protected set; }
public virtual int Gid { get; set; }
public virtual string Name { get; set; }
}
}
-9
View File
@@ -1,9 +0,0 @@
namespace ResultsBrowser.Entities
{
interface IHasItemNr
{
int Id { get; }
int ItemNr { get; set; }
}
}
-9
View File
@@ -1,9 +0,0 @@
namespace ResultsBrowser.Entities
{
public interface IHasValves
{
string ValvesOpen { get; set; } /// List of valves to be opened
string ValvesClose { get; set; } /// List of valves to be closed
}
}
@@ -1,11 +0,0 @@
using System;
namespace ResultsBrowser.Entities
{
public class MeasurementCorrection
{
public virtual int Id { get; protected set; }
public virtual float Measurement { get; set; }
public virtual float Correction { get; set; }
}
}
@@ -1,51 +0,0 @@
using System;
namespace ResultsBrowser.Entities
{
public class MeterTestResult
{
public virtual int Id { get; protected set; }
public virtual TestResult TestResult { get; set; } /// reference to the TestResult entity
public virtual string SerialNr { get; set; }
public virtual string EndState { get; set; }
public virtual float VolumeStart { get; set; } /// liter
public virtual float VolumeEnd { get; set; } /// liter
public virtual float VolumeMeter { get; set; } /// liter
public virtual float VolumeRef { get; set; } /// liter
public virtual float VolumeErrorPct { get; set; } /// %
public virtual float PulsesMeter { get; set; } /// Not applicable for a combined meter
public virtual float PulsesMaster { get; set; }
public virtual float Time { get; set; } /// sec.
public virtual bool Passed { get; set; } /// true = test passed
public MeterTestResult()
{
}
public MeterTestResult(TestResult testResult)
: this()
{
TestResult = testResult;
}
public virtual MeterTestResult Clone(TestResult testResult)
{
MeterTestResult result = new MeterTestResult(testResult);
result.SerialNr = SerialNr;
result.EndState = EndState;
result.VolumeStart = VolumeStart;
result.VolumeEnd = VolumeEnd;
result.VolumeMeter = VolumeMeter;
result.VolumeRef = VolumeRef;
result.VolumeErrorPct = VolumeErrorPct;
result.PulsesMeter = PulsesMeter;
result.PulsesMaster = PulsesMaster;
result.Time = Time;
result.Passed = Passed;
return result;
}
}
}
-157
View File
@@ -1,157 +0,0 @@
using System;
using System.Collections.Generic;
namespace ResultsBrowser.Entities
{
public class MetersPath : IHasItemNr
{
public virtual int Id { get; protected set; }
public virtual int ItemNr { get; set; }
public virtual string Name { get; set; }
public virtual float Qfrom { get; set; } /// Water flow in [m3/h]
public virtual float Qto { get; set; } /// Water flow in [m3/h]
/// Sensors
public virtual string Sensor1 { get; set; }
public virtual string Sensor2 { get; set; }
public virtual string Sensor3 { get; set; }
public virtual string Sensor4 { get; set; }
public virtual string Sensor5 { get; set; }
public virtual string Sensor6 { get; set; }
public virtual string Sensor7 { get; set; }
public virtual string Sensor8 { get; set; }
public virtual string Sensor9 { get; set; }
public virtual string Sensor10 { get; set; }
public virtual string Sensor11 { get; set; }
public virtual string Sensor12 { get; set; }
public virtual string Sensor13 { get; set; }
public virtual string Sensor14 { get; set; }
public virtual string Sensor15 { get; set; }
public virtual string Sensor16 { get; set; }
public virtual string Sensor17 { get; set; }
public virtual string Sensor18 { get; set; }
public virtual string Sensor19 { get; set; }
public virtual string Sensor20 { get; set; }
/// ------------- Additional stuff not mapped into the database -------------
public MetersPath()
{
}
public MetersPath(string name, int itemNr)
: this()
{
Name = name;
ItemNr = itemNr;
}
public MetersPath(BenchControl.MetersPath path)
: this(path.Name, path.ItemNr)
{
Qfrom = path.Qfrom;
Qto = path.Qto;
Sensor1 = (path.RegisterReaders[0] != null) ? path.RegisterReaders[0].Cfg.Name : null;
#pragma warning disable
if (Program.WMsCount >= 2) Sensor2 = (path.RegisterReaders[1] != null) ? path.RegisterReaders[1].Cfg.Name : null;
if (Program.WMsCount >= 3) Sensor3 = (path.RegisterReaders[2] != null) ? path.RegisterReaders[2].Cfg.Name : null;
if (Program.WMsCount >= 4) Sensor4 = (path.RegisterReaders[3] != null) ? path.RegisterReaders[3].Cfg.Name : null;
if (Program.WMsCount >= 5) Sensor5 = (path.RegisterReaders[4] != null) ? path.RegisterReaders[4].Cfg.Name : null;
if (Program.WMsCount >= 6) Sensor6 = (path.RegisterReaders[5] != null) ? path.RegisterReaders[5].Cfg.Name : null;
if (Program.WMsCount >= 7) Sensor7 = (path.RegisterReaders[6] != null) ? path.RegisterReaders[6].Cfg.Name : null;
if (Program.WMsCount >= 8) Sensor8 = (path.RegisterReaders[7] != null) ? path.RegisterReaders[7].Cfg.Name : null;
if (Program.WMsCount >= 9) Sensor9 = (path.RegisterReaders[8] != null) ? path.RegisterReaders[8].Cfg.Name : null;
if (Program.WMsCount >= 10) Sensor10 = (path.RegisterReaders[9] != null) ? path.RegisterReaders[9].Cfg.Name : null;
if (Program.WMsCount >= 11) Sensor11 = (path.RegisterReaders[10] != null) ? path.RegisterReaders[10].Cfg.Name : null;
if (Program.WMsCount >= 12) Sensor12 = (path.RegisterReaders[11] != null) ? path.RegisterReaders[11].Cfg.Name : null;
if (Program.WMsCount >= 13) Sensor13 = (path.RegisterReaders[12] != null) ? path.RegisterReaders[12].Cfg.Name : null;
if (Program.WMsCount >= 14) Sensor14 = (path.RegisterReaders[13] != null) ? path.RegisterReaders[13].Cfg.Name : null;
if (Program.WMsCount >= 15) Sensor15 = (path.RegisterReaders[14] != null) ? path.RegisterReaders[14].Cfg.Name : null;
if (Program.WMsCount >= 16) Sensor16 = (path.RegisterReaders[15] != null) ? path.RegisterReaders[15].Cfg.Name : null;
if (Program.WMsCount >= 17) Sensor17 = (path.RegisterReaders[16] != null) ? path.RegisterReaders[16].Cfg.Name : null;
if (Program.WMsCount >= 18) Sensor18 = (path.RegisterReaders[17] != null) ? path.RegisterReaders[17].Cfg.Name : null;
if (Program.WMsCount >= 19) Sensor19 = (path.RegisterReaders[18] != null) ? path.RegisterReaders[18].Cfg.Name : null;
if (Program.WMsCount >= 20) Sensor20 = (path.RegisterReaders[19] != null) ? path.RegisterReaders[19].Cfg.Name : null;
#pragma warning restore
}
public virtual MetersPath Clone(string name, int itemNr)
{
MetersPath result = new MetersPath(name, itemNr);
result.Qfrom = Qfrom;
result.Qto = Qto;
result.Sensor1 = Sensor1;
result.Sensor2 = Sensor2;
result.Sensor3 = Sensor3;
result.Sensor4 = Sensor4;
result.Sensor5 = Sensor5;
result.Sensor6 = Sensor6;
result.Sensor7 = Sensor7;
result.Sensor8 = Sensor8;
result.Sensor9 = Sensor9;
result.Sensor10 = Sensor10;
result.Sensor11 = Sensor11;
result.Sensor12 = Sensor12;
result.Sensor13 = Sensor13;
result.Sensor14 = Sensor14;
result.Sensor15 = Sensor15;
result.Sensor16 = Sensor16;
result.Sensor17 = Sensor17;
result.Sensor18 = Sensor18;
result.Sensor19 = Sensor19;
result.Sensor20 = Sensor20;
return result;
}
/// Returns the component name
public virtual string GetSensor(int i)
{
if (i == 0) return Sensor1;
else if (i == 1) return Sensor2;
else if (i == 2) return Sensor3;
else if (i == 3) return Sensor4;
else if (i == 4) return Sensor5;
else if (i == 5) return Sensor6;
else if (i == 6) return Sensor7;
else if (i == 7) return Sensor8;
else if (i == 8) return Sensor9;
else if (i == 9) return Sensor10;
else if (i == 10) return Sensor11;
else if (i == 11) return Sensor12;
else if (i == 12) return Sensor13;
else if (i == 13) return Sensor14;
else if (i == 14) return Sensor15;
else if (i == 15) return Sensor16;
else if (i == 16) return Sensor17;
else if (i == 17) return Sensor18;
else if (i == 18) return Sensor19;
else if (i == 19) return Sensor20;
else return null;
}
/// Sets the component name
public virtual void SetSensor(int i, string cmpntName)
{
if (i == 0) Sensor1 = cmpntName;
else if (i == 1) Sensor2 = cmpntName;
else if (i == 2) Sensor3 = cmpntName;
else if (i == 3) Sensor4 = cmpntName;
else if (i == 4) Sensor5 = cmpntName;
else if (i == 5) Sensor6 = cmpntName;
else if (i == 6) Sensor7 = cmpntName;
else if (i == 7) Sensor8 = cmpntName;
else if (i == 8) Sensor9 = cmpntName;
else if (i == 9) Sensor10 = cmpntName;
else if (i == 10) Sensor11 = cmpntName;
else if (i == 11) Sensor12 = cmpntName;
else if (i == 12) Sensor13 = cmpntName;
else if (i == 13) Sensor14 = cmpntName;
else if (i == 14) Sensor15 = cmpntName;
else if (i == 15) Sensor16 = cmpntName;
else if (i == 16) Sensor17 = cmpntName;
else if (i == 17) Sensor18 = cmpntName;
else if (i == 18) Sensor19 = cmpntName;
else if (i == 19) Sensor20 = cmpntName;
}
}
}
-91
View File
@@ -1,91 +0,0 @@
using System;
using System.Collections.Generic;
namespace ResultsBrowser.Entities
{
public class OutputPath : IHasItemNr, IHasValves
{
public virtual int Id { get; protected set; }
public virtual int ItemNr { get; set; }
public virtual string Name { get; set; }
public virtual float Qfrom { get; set; } /// Water flow in [m3/h]
public virtual float Qto { get; set; } /// Water flow in [m3/h]
public virtual string RegulValve { get; set; }
public virtual string FlowMeter { get; set; }
public virtual float PidCoef { get; set; } /// PID coefficient for the regulation path
public virtual string StartValve { get; set; }
public virtual string Diverter { get; set; }
public virtual string TempDiv { get; set; }
public virtual string Balance { get; set; }
public virtual string EmptyTankValve { get; set; }
/// Valves
public virtual string ValvesOpen { get; set; }
public virtual string ValvesClose { get; set; }
/// ------------- Additional stuff not mapped into the database -------------
public OutputPath()
{
}
public OutputPath(string name, int itemNr)
: this()
{
Name = name;
ItemNr = itemNr;
}
public OutputPath(BenchControl.OutputPath path)
: this(path.Name, path.ItemNr)
{
Qfrom = path.Qfrom;
Qto = path.Qto;
RegulValve = (path.RegulValve != null) ? path.RegulValve.Cfg.Name : null;
FlowMeter = (path.FlowMeter != null) ? path.FlowMeter.Cfg.Name : null;
PidCoef = path.PidCoef;
StartValve = (path.StartValve != null) ? path.StartValve.Cfg.Name : null;
Diverter = (path.Diverter != null) ? path.Diverter.Cfg.Name : null;
TempDiv = (path.TempDiv != null) ? path.TempDiv.Cfg.Name : null;
Balance = (path.Balance != null) ? path.Balance.Cfg.Name : null;
EmptyTankValve = (path.EmptyTankValve != null) ? path.EmptyTankValve.Cfg.Name : null;
string vOpen = string.Empty;
foreach (var valve in path.ValvesOpen)
{
if (vOpen != string.Empty) vOpen += ";";
vOpen += valve.Cfg.Name;
}
ValvesOpen = vOpen;
string vClose = string.Empty;
foreach (var valve in path.ValvesClose)
{
if (vClose != string.Empty) vClose += ";";
vClose += valve.Cfg.Name;
}
ValvesClose = vClose;
}
public virtual OutputPath Clone(string name, int itemNr)
{
OutputPath result = new OutputPath(name, itemNr);
result.Name = Name;
result.Qfrom = Qfrom;
result.Qto = Qto;
result.RegulValve = RegulValve;
result.FlowMeter = FlowMeter;
result.PidCoef = PidCoef;
result.StartValve = StartValve;
result.Diverter = Diverter;
result.TempDiv = TempDiv;
result.Balance = Balance;
result.EmptyTankValve = EmptyTankValve;
result.ValvesOpen = ValvesOpen;
result.ValvesClose = ValvesClose;
return result;
}
}
}
-90
View File
@@ -1,90 +0,0 @@
using System;
using System.Collections.Generic;
using TBF.Resources;
namespace ResultsBrowser.Entities
{
/// <summary>
/// Stores one test procedure, supports revisions and history log
/// </summary>
public class Procedure : IHasItemNr
{
public virtual int Id { get; protected set; }
public virtual int ItemNr { get; set; }
public virtual string Name { get; set; }
public virtual MetersKind MetersKind { get; set; }
public virtual string Description { get; set; } /// Short description
public virtual string CreationUser { get; set; } /// Name of the user who has created or changed this procedure
public virtual DateTime CreationTime { get; set; } /// Date and time of the creation or change
public virtual string LastChgUser { get; set; } /// Name of the user who has created or changed this procedure
public virtual DateTime LastChgTime { get; set; } /// Date and time of the creation or change
public virtual string LongDescription { get; set; } /// Long description (notes)
public virtual string Watermeters { get; set; } /// Water meter name or Id
public virtual string ProtocolTitle { get; set; } /// Title of the printed and saved protocol
public virtual string DataEntry { get; set; } /// Component to use for data entry
public virtual string ResultsPrinter { get; set; } /// Component to use for printing the results
public virtual string ResultsWriter { get; set; } /// Component to use for saving the results into the file
public virtual string TransitionStart { get; set; }
public virtual string TransitionEnd { get; set; }
public virtual IList<ComponentProcedure> MoreParams { get; set; }
public virtual IList<Test> Tests { get; set; }
////public virtual string MetrologicalClass { get; set; }
////public virtual IList<WMType> WMTypes { get; set; }
/// ------------- Additional stuff not mapped into the database -------------
public Procedure()
{
MoreParams = new List<ComponentProcedure>();
Tests = new List<Test>();
///
/// Default values
///
CreationUser = (User.CurrentUser != null) ? User.CurrentUser.Name : null;
CreationTime = DateTime.Now;
LastChgUser = CreationUser;
LastChgTime = CreationTime;
MetersKind = Entities.MetersKind.Single;
ProtocolTitle = "Watermeter test protocol";
}
public Procedure(string name, int itemNr)
: this()
{
Name = name;
ItemNr = itemNr;
}
public virtual Procedure Clone()
{
Procedure result = new Procedure();
result.Name = Name;
result.MetersKind = MetersKind;
result.Description = Description;
result.CreationUser = CreationUser;
result.CreationTime = CreationTime;
result.LastChgUser = LastChgUser;
result.LastChgTime = LastChgTime;
result.LongDescription = LongDescription;
result.Watermeters = Watermeters;
result.DataEntry = DataEntry;
result.ResultsPrinter = ResultsPrinter;
result.ResultsWriter = ResultsWriter;
result.TransitionStart = TransitionStart;
result.TransitionEnd = TransitionEnd;
foreach (var prms in MoreParams) { result.MoreParams.Add(prms.Clone()); }
foreach (var test in Tests) { result.Tests.Add(test.Clone()); }
//result.MetrologicalClass = MetrologicalClass;
//result.WMType = WMType.Clone();
return result;
}
}
}
@@ -1,28 +0,0 @@
using System;
using System.Collections.Generic;
namespace ResultsBrowser.Entities
{
public class ProcedureHistory
{
public virtual int Id { get; protected set; }
public virtual Procedure Current { get; set; }
public virtual IList<Procedure> OldProcedures { get; set; }
/// ------------- Additional stuff not mapped into the database -------------
public ProcedureHistory()
{
Current = new Procedure();
OldProcedures = new List<Procedure>();
}
public virtual ProcedureHistory Clone()
{
ProcedureHistory result = new ProcedureHistory();
result.Current = Current.Clone();
foreach (Procedure p in OldProcedures) result.OldProcedures.Add(p.Clone());
return result;
}
}
}
-97
View File
@@ -1,97 +0,0 @@
using System;
using System.Collections.Generic;
namespace ResultsBrowser.Entities
{
/// <summary>
/// Test, consisting of one or more repetitions of the test 'SingleTest'.
/// </summary>
public class Test : IHasItemNr
{
public virtual int Id { get; protected set; }
public virtual int ItemNr { get; set; }
public virtual string Name { get; set; }
public virtual int Part { get; set; } /// Part=0 ... test of all WM-s
/// Part>0 ... part of a set of tests with the same Name: subset of WM-s is given by MetersPath
public virtual float Qfrom { get; set; } /// Water flow low limit in [m3/h]
public virtual float Qto { get; set; } /// Water flow high limit in [m3/h]
public virtual float Volume { get; set; } /// Test volume (target) in [l]
public virtual float TstTime { get; set; } /// Test time (estimate) in [s]
public virtual int Repeats { get; set; }
public virtual bool Emptying { get; set; }
public virtual bool Zeroing { get; set; }
public virtual float PumpPower { get; set; } /// Power of the pump in [%] in the range 0 .. 100.0f, use values 0% and 100% for non-FM pumps
public virtual int Time2MassMsrmt { get; set; } /// Delay time from the test end (diverted) to the 2nd mass measuremen in [s]
public virtual string Method { get; set; }
public virtual float ErrLimLo { get; set; } /// in [%] (usually < 0)
public virtual float ErrLimHi { get; set; } /// in [%] (usually > 0)
public virtual double TolerRed { get; set; } /// = Filter
public virtual TestRedType RedType { get; set; }
public virtual string FeedingPath { get; set; }
public virtual string BenchPath { get; set; }
public virtual string OutputPath { get; set; }
public virtual string MetersPath { get; set; }
public virtual string TransitionStart { get; set; }
public virtual string TransitionEnd { get; set; }
public virtual IList<ComponentTest> MoreParams { get; set; }
public virtual Procedure Procedure { get; set; }
/// ------------- Additional stuff not mapped into the database -------------
public Test()
{
MoreParams = new List<ComponentTest>();
///
/// Default values
///
Repeats = 1;
Emptying = false;
Zeroing = false;
PumpPower = 60.0f; /// [%]
Time2MassMsrmt = 5; /// [s] between the test end and the final mass measurement
ErrLimLo = -2.0f; /// [%] lower error limit
ErrLimHi = 2.0f; /// [%] upper error limit
TolerRed = 5.0; /// = Filter parameter
}
public Test(string name, int itemNr, Procedure procedure)
: this()
{
Name = name;
ItemNr = itemNr;
Procedure = procedure;
}
// Makes a new copy of this object (not just a reference)
public virtual Test Clone()
{
Test result = new Test(Name, ItemNr, Procedure);
result.Part = Part;
result.Qfrom = Qfrom;
result.Qto = Qto;
result.Volume = Volume;
result.TstTime = TstTime;
result.Repeats = Repeats;
result.Emptying = Emptying;
result.Zeroing = Zeroing;
result.PumpPower = PumpPower;
result.Time2MassMsrmt = Time2MassMsrmt;
result.Method = Method;
result.ErrLimLo = ErrLimLo;
result.ErrLimHi = ErrLimHi;
result.TolerRed = TolerRed;
result.RedType = RedType;
result.FeedingPath = FeedingPath;
result.BenchPath = BenchPath;
result.OutputPath = OutputPath;
result.MetersPath = MetersPath;
foreach (var prms in MoreParams) { result.MoreParams.Add(prms.Clone()); }
return result;
}
}
}
-161
View File
@@ -1,161 +0,0 @@
using System;
using System.Collections.Generic;
namespace ResultsBrowser.Entities
{
public class TestResult
{
public virtual int Id { get; protected set; }
public virtual string Name { get; set; }
public virtual int BatchNr { get; set; }
public virtual MetersKind MetersKind { get; set; }
public virtual IList<MeterTestResult> Meters { get; set; }
public virtual IList<MeterTestResult> CombinedMeters { get; set; }
/// Value copied from the procedure (Entities.Procedure)
public virtual string ProcedureName { get; set; }
public virtual string ProtocolTitle { get; set; }
/// Values copied from the test (Entities.Test)
public virtual int TestId { get; set; } /// Test entity ID to distinguish between tests with the same name
public virtual string TestName { get; set; }
public virtual int Part { get; set; }
public virtual bool DoNotEvaluate { get; set; } /// Not mapped to the database
public virtual bool DoNotPublish { get; set; } /// Not mapped to the database
public virtual float Qfrom { get; set; } /// Water flow low limit in [m3/h]
public virtual float Qto { get; set; } /// Water flow high limit in [m3/h]
public virtual float Volume { get; set; } /// Test volume (target) in [l]
public virtual float TstTime { get; set; } /// Test time (estimate) in [s]
public virtual int Repeats { get; set; }
public virtual bool Emptying { get; set; }
public virtual bool Zeroing { get; set; }
public virtual float PumpPower { get; set; } /// Power of the pump in [%] in the range 0 .. 100.0f, use values 0% and 100% for non-FM pumps
public virtual int Time2MassMsrmt { get; set; }
public virtual string Method { get; set; }
public virtual float ErrLimLo { get; set; } /// in [%] (usually < 0)
public virtual float ErrLimHi { get; set; } /// in [%] (usually > 0)
/// To be replaced by the virtual bench component parameters
public virtual string FeedingPath { get; set; }
public virtual string BenchPath { get; set; }
public virtual string OutputPath { get; set; }
public virtual string MetersPath { get; set; }
/// Results
public virtual DateTime TimeStart { get; set; } /// Date and time of the test start
public virtual DateTime TimeEnd { get; set; } /// Date and time of the test end
public virtual int RepetitionNr { get; set; } /// Repetition number from the set of repeated tests (1...)
public virtual float AmbientTempAve { get; set; } /// Average ambient air temperature [degC]
public virtual float AmbientPressAve { get; set; } /// Average ambient air pressure
public virtual float AmbientHumiAve { get; set; } /// Average ambient air relative humidity [%]
public virtual float PressInAvrg { get; set; } /// Input water pressure (average) [Bar]
public virtual float PressInStart { get; set; }
public virtual float PressInEnd { get; set; }
public virtual float PressOutAvrg { get; set; }
public virtual float PressOutStart { get; set; }
public virtual float PressOutEnd { get; set; }
public virtual float TempInAvrg { get; set; }
public virtual float TempInStart { get; set; }
public virtual float TempInEnd { get; set; }
public virtual float TempOutAvrg { get; set; }
public virtual float TempOutStart { get; set; }
public virtual float TempOutEnd { get; set; }
public virtual float TempDivAvrg { get; set; }
public virtual float TempDivStart { get; set; }
public virtual float TempDivEnd { get; set; }
public virtual float MassStartRaw { get; set; }
public virtual float MassStart { get; set; }
public virtual float MassEndRaw { get; set; }
public virtual float MassEnd { get; set; }
public virtual float MassDiff { get; set; }
public virtual float DensityIn { get; set; }
public virtual float DensityOut { get; set; }
public virtual float DensityDiv { get; set; }
public virtual float Buoyancy { get; set; } ///TODO -> map
public virtual float FlowMass { get; set; } /// from conventional true value
public virtual float FlowVolume { get; set; } /// from conventional true value
public virtual float VolumeCTV { get; set; } /// volume conventional true value
public virtual float VolumeMaster { get; set; } /// volume from the master flow meter
public virtual float Time { get; set; } /// measurement time in seconds
public virtual float ErrorMaster { get; set; }
public virtual float PulsesMaster { get; set; }
public virtual float ConstMaster { get; set; } /// Pulses per liter master flow meter
public virtual float QRise { get; set; } /// Detected Q_rise of a composed meter
public virtual float QFall { get; set; } /// Detected Q_fall of a composed meter
public virtual float TimeDivStart0 { get; set; }
public virtual float TimeDivStart1 { get; set; }
public virtual float TimeDivStart2 { get; set; }
public virtual float TimeDivStart3 { get; set; }
public virtual float TimeDivStart4 { get; set; }
public virtual float TimeDivStart5 { get; set; }
public virtual float TimeDivEnd0 { get; set; }
public virtual float TimeDivEnd1 { get; set; }
public virtual float TimeDivEnd2 { get; set; }
public virtual float TimeDivEnd3 { get; set; }
public virtual float TimeDivEnd4 { get; set; }
public virtual float TimeDivEnd5 { get; set; }
public TestResult()
{
Meters = new List<MeterTestResult>();
CombinedMeters = new List<MeterTestResult>();
}
public TestResult(MetersKind kind)
: this()
{
MetersKind = kind;
if (kind == MetersKind.Single)
{
for (int i = 0; i < Program.WMsCount; i++) Meters.Add(new MeterTestResult(this));
}
else if (kind == MetersKind.Combined)
{
int combinedCount = Program.WMsCount / 2;
for (int i = 0; i < 2 * combinedCount; i++) Meters.Add(new MeterTestResult(this));
for (int i = 0; i < combinedCount; i++) CombinedMeters.Add(new MeterTestResult(this));
}
}
public TestResult(Test test, int repetitionNr, MetersKind kind)
: this(kind)
{
if (test.Repeats == 1)
{
Name = test.Name;
}
else
{
Name = string.Format("{0} ({1}/{2})", test.Name, repetitionNr, test.Repeats);
}
RepetitionNr = repetitionNr;
/// Copy test parameters from Entities.Procedure object
ProcedureName = test.Procedure.Name;
ProtocolTitle = test.Procedure.ProtocolTitle;
/// Copy test parameters from Entities.Test object
TestId = test.Id;
TestName = test.Name;
Part = test.Part;
Qfrom = test.Qfrom;
Qto = test.Qto;
Volume = test.Volume;
TstTime = test.TstTime;
Repeats = test.Repeats;
Emptying = test.Emptying;
Zeroing = test.Zeroing;
PumpPower = PumpPower;
Time2MassMsrmt = test.Time2MassMsrmt;
Method = test.Method;
ErrLimLo = test.ErrLimLo;
ErrLimHi = test.ErrLimHi;
FeedingPath = test.FeedingPath;
BenchPath = test.BenchPath;
OutputPath = test.OutputPath;
MetersPath = test.MetersPath;
}
}
}
@@ -1,37 +0,0 @@
using System.Collections.Generic;
namespace ResultsBrowser.Entities
{
/// <summary>
/// Stores one transition sequence containing a list of transition steps
/// </summary>
public class TransitionSequence : IHasItemNr
{
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; } /// Short description
public virtual IList<TransitionStep> TransitionSteps { get; set; }
public TransitionSequence()
{
TransitionSteps = new List<TransitionStep>();
}
public TransitionSequence(string name, int itemNr)
: this()
{
Name = name;
ItemNr = itemNr;
}
public virtual TransitionSequence Clone()
{
TransitionSequence result = new TransitionSequence();
result.Name = Name;
result.Description = Description;
foreach (var step in TransitionSteps) { result.TransitionSteps.Add(step.Clone()); }
return result;
}
}
}
-58
View File
@@ -1,58 +0,0 @@
using System;
using System.Collections.Generic;
namespace ResultsBrowser.Entities
{
public class TransitionStep : IHasItemNr, IHasValves
{
public virtual int Id { get; protected set; }
public virtual int ItemNr { get; set; } /// Order of the preparation step
public virtual int Duration { get; set; } /// Duration in seconds
public virtual string Message { get; set; } /// Message
public virtual string ValvesOpen { get; set; } /// List of valves to be opened
public virtual string ValvesClose { get; set; } /// List of valves to be closed
public virtual string RegulValvesPct { get; set; } /// Positions of regulation valves in % separated by ';'
public virtual string PumpWithFMPcts { get; set; } /// Power of FM controlled pumps in % separated by ';'
public virtual TransitionSequence TransitionSequence { get; set; }
/// ------------- Additional stuff not mapped into the database -------------
public TransitionStep()
{
Duration = 5; /// sec.
}
public TransitionStep(int itemNr, TransitionSequence sequence)
: this()
{
ItemNr = itemNr;
TransitionSequence = sequence;
}
public virtual TransitionStep Clone()
{
TransitionStep result = new TransitionStep(ItemNr, TransitionSequence);
result.Duration = Duration;
result.Message = Message;
result.ValvesOpen = ValvesOpen;
result.ValvesClose = ValvesClose;
result.RegulValvesPct = RegulValvesPct;
result.PumpWithFMPcts = PumpWithFMPcts;
return result;
}
public virtual string ToString(string indent)
{
string result = "";
result += indent + "ItemNr = " + ItemNr.ToString() + ", ";
result += indent + "Duration = " + Duration.ToString() + ", ";
result += indent + "Message = " + Message + ", ";
result += indent + "ValvesOpen = " + ValvesOpen.ToString() + ", ";
result += indent + "ValvesClose = " + ValvesClose.ToString() + ", ";
result += indent + "RegulValvesPct = " + RegulValvesPct.ToString() + ", ";
result += indent + "PumpsWithFMPct = " + RegulValvesPct.ToString() + Environment.NewLine;
return result;
}
}
}
-257
View File
@@ -1,257 +0,0 @@
using System;
using System.Collections.Generic;
using System.Security.Cryptography;
using System.Text;
using System.Diagnostics;
using TBF.Resources;
namespace ResultsBrowser.Entities
{
public class User
{
public virtual int Id { get; protected set; }
public virtual string Name { get; set; }
public virtual string Password { get; set; }
public virtual string Description { get; set; }
public virtual DateTime LastPwChange { get; set; }
public virtual IList<Group> Groups { get; set; } //User can be a member of a list of groups
private bool powerUser; /// Set to tue for built-in users, power users have full access even with empty Groups
public User()
{
this.powerUser = false;
Groups = new List<Group>();
}
public virtual void AddGroup(Group group)
{
Groups.Add(group);
}
public User(string name)
{
this.powerUser = true;
Name = name;
Groups = new List<Group>();
Description = "Power user";
}
/// ------------- Additional stuff not mapped into the database -------------
///
/// Authorized user (static)
///
private static User currentUser = null; /// Updated by instance methods Authorize, Unauthorize
public static User CurrentUser
{
get { return currentUser; }
set { currentUser = value; }
}
private static DateTime lastAuthorization = DateTime.Now;
public static DateTime LastAuthorization { get { return lastAuthorization; } }
/// <summary>
/// Check whether user is a member of a group.
/// </summary>
/// <param name="groupId">Group GID</param>
/// <returns>true is user is a member of the specified group</returns>
public virtual bool IsMemberOf(Grp.GID groupId)
{
if (groupId == Grp.GID.None || powerUser)
{
return true;
}
else if (groupId >= 0 && (int)groupId < Grp.Count)
{
// for all group elements in User.groups
for (int i = 0; i < Groups.Count; ++i)
{
// element GID = parameter GroupId ?
if (((Group)Groups[i]).Gid == (int)groupId)
{
return true;
}
}
return false;
}
else
{
return false;
}
}
/// <summary>
/// Sets users password. It then will be encrypted.
/// </summary>
/// <param name="password">Password</param>
public virtual void SetPassword(string password)
{
this.Password = EncryptedPassword(password);
LastPwChange = DateTime.Now;
}
public virtual string EncryptedPassword(string password)
{
return getHash(password);
}
/// <summary>
/// Verifies users password. Used by static bool Authorisation(...)
/// </summary>
/// <param name="password">Password</param>
/// <returns>true if password is correct</returns>
public virtual bool CheckPassword(string password)
{
return (Password == EncryptedPassword(password));
}
/// <summary>
/// The FIRST of TWO possible user authorization method to be used
/// when a specific group membership is required (you can use Grp.GID.None).
/// If the user is not authorized, the current user remains to be a current user
/// (i.e. the access rights were not risen to a higher level).
/// If you require different behavior, use Unauthorize() before calling Authorize().
/// </summary>
/// <param name="userName"></param>
/// <param name="password"></param>
/// <param name="requiredGrupMembership"></param>
/// <returns>true = authorized</returns>
public virtual bool Authorize(string userName, string password, TBF.Grp.GID requiredGroupMembership)
{
if (Entities.User.IsPowerUser(userName, password))
{
currentUser = this;
lastAuthorization = DateTime.Now;
return true;
}
if (Name.ToLower() == userName.ToLower())
{
if (IsMemberOf(requiredGroupMembership) && CheckPassword(password))
{
currentUser = this;
lastAuthorization = DateTime.Now;
return true;
}
else
{
return false;
}
}
return false;
}
/// <summary>
/// The SECOND of TWO possible user authorization method to be used when
/// no specific group membership is required.
/// If the user is not authorized, the current user remains to be a current user
/// (i.e. the access rights were not risen to a higher level).
/// If you require different behavior, use Unauthorize() before calling Authorize().
/// </summary>
/// <param name="userName"></param>
/// <param name="password"></param>
/// <param name="requiredGroupMembership"></param>
/// <returns>true = authorized</returns>
public virtual bool Authorize(string userName, string password)
{
return Authorize(userName, password, Grp.GID.None);
}
/// <summary>
/// Returns a 'User' with a given username from a database.
/// </summary>
/// <param name="username">User name for the query</param>
/// <returns>reference to a 'User' (if it exists) or null</returns>
public static User AuthorizeDummyUser(string username)
{
User user = new User();
user.Name = username;
currentUser = user;
return user;
}
/// <summary>
/// Returns a 'User' with a given username from an ARBITRARY database.
/// </summary>
/// <param name="username">User name for the query</param>
/// <returns>reference to a 'User' (if it exists) or null</returns>
public static User LoadUserByName(string username, DBSettings dbSettings)
{
IList<User> listOfUsers = FluentCommon.CreateSessionFactory(Database.Users, dbSettings, false)
.OpenSession()
.CreateQuery("FROM User WHERE LOWER(Name) = :username")
.SetParameter("username", username.ToLower())
.List<User>();
if (listOfUsers.Count > 0) return listOfUsers[0];
return null;
}
/// <summary>
/// Returns a 'User' with a given username from the users database.
/// </summary>
/// <param name="username">User name for the query</param>
/// <returns>reference to a 'User' (if it exists) or null</returns>
public static User LoadUserByName(string username)
{
IList<User> listOfUsers = FluentCommon.CreateSession(Database.Users)
.CreateQuery("FROM User WHERE LOWER(Name) = :username")
.SetParameter("username", username.ToLower())
.List<User>();
if (listOfUsers.Count > 0) return listOfUsers[0];
return null;
}
/// <summary>
/// returns an IList of all Users
/// </summary>
public static IList<User> GetAllUsers()
{
return FluentCommon.CreateSession(Database.Users)
.CreateQuery("FROM User")
.List<User>();
}
/// <summary>
/// Unauthorize, abandon current users authorization.
/// </summary>
public static void Unauthorize()
{
currentUser = null;
lastAuthorization = DateTime.Now;
}
/// <summary>
/// getHash encrypts a string
/// </summary>
/// <param name="text">the string to encrypt</param>
/// <returns></returns>
public static string getHash(string text)
{
byte[] bytes = Encoding.Unicode.GetBytes(text);
SHA512Managed hashstring = new SHA512Managed();
byte[] hash = hashstring.ComputeHash(bytes);
string hashString = string.Empty;
foreach (byte x in hash)
{
hashString += String.Format("{0:x2}", x);
}
return hashString;
}
/// <summary>
/// Returns 'true' when authentication data are valid for a power user.
/// </summary>
/// <param name="userName">User name</param>
/// <param name="password">Password</param>
/// <returns>true = authenticated, false = refused</returns>
public static bool IsPowerUser(string userName, string password)
{
return false;
}
}
}
@@ -1,35 +0,0 @@
using System;
using System.Collections.Generic;
namespace ResultsBrowser.Entities
{
public class VirtualBenchSequence : IHasItemNr
{
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; } /// Short description
public virtual IList<VirtualBenchStep> VirtualBenchSteps { get; set; }
public VirtualBenchSequence()
{
VirtualBenchSteps = new List<VirtualBenchStep>();
}
public VirtualBenchSequence(string name, int itemNr)
: this()
{
Name = name;
ItemNr = itemNr;
}
public virtual VirtualBenchSequence Clone()
{
VirtualBenchSequence result = new VirtualBenchSequence();
result.Name = Name;
result.Description = Description;
foreach (var step in VirtualBenchSteps) { result.VirtualBenchSteps.Add(step.Clone()); }
return result;
}
}
}
@@ -1,36 +0,0 @@
using System;
using System.Collections.Generic;
namespace ResultsBrowser.Entities
{
public class VirtualBenchStep : IHasItemNr
{
public virtual int Id { get; protected set; }
public virtual int ItemNr { get; set; } /// Order of the preparation step
public virtual int Duration { get; set; } /// Duration in seconds
///
public virtual VirtualBenchSequence VirtualBenchSequence { get; set; }
/// ------------- Additional stuff not mapped into the database -------------
public VirtualBenchStep()
{
Duration = 5; /// sec.
}
public VirtualBenchStep(int itemNr, VirtualBenchSequence sequence)
: this()
{
ItemNr = itemNr;
VirtualBenchSequence = sequence;
}
public virtual VirtualBenchStep Clone()
{
VirtualBenchStep result = new VirtualBenchStep(ItemNr, VirtualBenchSequence);
return result;
}
}
}
-75
View File
@@ -1,75 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
/// This class holds the watermeter type specific data
/// that have all watermaters of the same type in common
namespace ResultsBrowser.Entities
{
public class WMType
{
// mapped
public virtual int Id { get; protected set; } /// primary key
public virtual DateTime CreateTime { get; set; } /// Date and time of the creation or change
public virtual string CreateUserName { get; set; } /// Name of the user who has created or changed this procedure
public virtual string CreateDescription { get; set; } /// Description\
public virtual string Name { get; set; } /// type name
public virtual float PulseRate { get; set; } /// Pulses per Liter
// not yet mapped
public virtual int IdentNr { get; protected set; } /// identification number of watermeter tzpe
public virtual int Diameter { get; set; } /// nominal diameter
public virtual int Pressure { get; set; } /// nominal pressure
public virtual int Length { get; set; } /// construction length
public virtual int Temperatur { get; set; } /// nominal temperature in C
public virtual float NominalFlow { get; set; } /// nominal flow Qn
/// ------------- Additional stuff not mapped into the database -------------
public WMType()
{
}
public static WMType DefaultWMType()
{
WMType procedure = new WMType()
{
CreateTime = DateTime.Now,
CreateUserName = User.CurrentUser.Name,
CreateDescription = "A default water meter created.",
Name = "Watermeter",
PulseRate = 1000,
};
return procedure;
}
public virtual WMType Clone()
{
WMType result = new WMType();
result.CreateTime = CreateTime;
result.CreateUserName = CreateUserName;
result.CreateDescription = CreateDescription;
result.Name = Name;
result.PulseRate = PulseRate;
return result;
}
public override string ToString()
{
string result = "";
result += "WMTpe: " + Environment.NewLine;
result += " Name = " + Name + Environment.NewLine;
result += " Created by = " + CreateUserName + Environment.NewLine;
result += " Created on = " + CreateTime.ToString() + Environment.NewLine;
result += " Description = " + CreateDescription + Environment.NewLine;
result += " Pulse rate = " + PulseRate.ToString() + Environment.NewLine;
return result;
}
}
}
-38
View File
@@ -1,38 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using TBF;
using NHibernate;
using FluentNHibernate;
namespace ResultsBrowser.Entities
{
public class Watermeter
{
public virtual int Id { get; protected set; } /// primary key
public virtual DateTime CreateTime { get; set; } /// Date and time of the creation or change
public virtual string CreateUserName { get; set; } /// Name of the user who has created or changed this procedure
public virtual string CreateDescription { get; set; } /// Description
/// mapped
public virtual string Serial { get; set; } /// serial number
public virtual WMType WMType { get; set; } /// type of watermeter
///
/// <summary>
/// Load a watermeter from the database
/// </summary>
public static Watermeter LoadBySerialnr(string SerialNr)
{
IList<Watermeter> ListOfWatermeters = FluentCommon.CreateSession(Database.WaterMeters)
.CreateQuery("FROM Watermeter WHERE Serial = :SerialNrParameter")
.SetParameter("SerialNrParameter", SerialNr)
.List<Watermeter>();
if (ListOfWatermeters.Count > 0) return ListOfWatermeters.ElementAt(0);
return null;
}
}
}
-316
View File
@@ -1,316 +0,0 @@
using System;
using FluentNHibernate.Cfg;
using FluentNHibernate.Cfg.Db;
using NHibernate;
using NHibernate.Cfg;
using NHibernate.Tool.hbm2ddl;
namespace ResultsBrowser
{
/// <summary>
/// Identifies the content of a database
/// </summary>
public enum Database
{
Users,
Bench,
Procedures,
WaterMeters,
Count,
}
/// <summary>
/// Identifies the type of a database
/// </summary>
public enum DBType
{
SQLite, /// SQLite
MySql, /// MySQL database
DbTypesCount,
}
public static class FluentCommon
{
/// <summary>
/// Session factories for regular sessions.
/// </summary>
public static ISessionFactory[] SessionFactories = new ISessionFactory[(int)Database.Count];
/// <summary>
/// NHibernate session factory (to create the database session 'SessionFactory')
/// </summary>
/// <returns>A database session</returns>
static ISessionFactory CreateSessionFactory(Database database)
{
DBType dbType;
string connectionString;
switch (database)
{
default:
case Database.Users:
dbType = Program.CurrentBench.UsersDBSettings.DbType;
connectionString = Program.CurrentBench.UsersDBSettings.ConnectionString;
break;
case Database.Bench:
dbType = Program.CurrentBench.BenchDBSettings.DbType;
connectionString = Program.CurrentBench.BenchDBSettings.ConnectionString;
break;
case Database.Procedures:
dbType = Program.CurrentBench.ProceduresDBSettings.DbType;
connectionString = Program.CurrentBench.ProceduresDBSettings.ConnectionString;
break;
case Database.WaterMeters:
dbType = Program.CurrentBench.WaterMetersDBSettings.DbType;
connectionString = Program.CurrentBench.WaterMetersDBSettings.ConnectionString;
break;
}
return CreateSessionFactory(database, new DBSettings(dbType, connectionString), false);
}
/// <summary>
/// NHibernate session factory (to create the database session 'SessionFactory')
/// </summary>
/// <returns>A database session</returns>
public static ISessionFactory CreateSessionFactory(Database database, DBSettings dbSettings, bool createDB)
{
try
{
FluentConfiguration cfg = Fluently.Configure();
switch (dbSettings.DbType)
{
default:
case DBType.SQLite:
cfg = cfg.Database(SQLiteConfiguration.Standard.UsingFile(dbSettings.ConnectionString));
break;
case DBType.MySql:
cfg = cfg.Database(MySQLConfiguration.Standard.ConnectionString(dbSettings.ConnectionString));
break;
}
switch (database)
{
default:
case Database.Users:
cfg = cfg.Mappings(m => m.FluentMappings.AddFromAssemblyOf<Program>());
break;
case Database.Bench:
cfg = cfg.Mappings(m => m.FluentMappings.AddFromAssemblyOf<Program>());
break;
case Database.Procedures:
cfg = cfg.Mappings(m => m.FluentMappings.AddFromAssemblyOf<Program>());
break;
case Database.WaterMeters:
cfg = cfg.Mappings(m => m.FluentMappings.AddFromAssemblyOf<Program>());
break;
}
if (createDB)
{
return cfg.ExposeConfiguration(BuildSchemaCreate).BuildSessionFactory();
}
else
{
return cfg.ExposeConfiguration(BuildSchema).BuildSessionFactory();
}
}
catch (Exception)
{
return null;
}
}
public delegate void BuildSchemaDlgt(Configuration config);
static void BuildSchema(Configuration config)
{
/// This NHibernate tool takes a configuration (with mapping info in)
/// and exports a database schema from it
new SchemaExport(config).SetOutputFile("db_schema");
}
static void BuildSchemaCreate(Configuration config)
{
/// This NHibernate tool takes a configuration (with mapping info in)
/// and exports a database schema from it
new SchemaExport(config).Create(true, true);
}
/// Create a NHibernate session for the given database
public static ISession CreateSession(Database database)
{
int ix = (int)database;
if (ix < 0 || ix >= (int)Database.Count) return null;
if (SessionFactories[ix] == null) SessionFactories[ix] = CreateSessionFactory(database);
return SessionFactories[ix].OpenSession();
}
public static void SaveToDb(Database database, object obj)
{
ISession session = FluentCommon.CreateSession(database);
SaveToDb(session, obj);
}
public static void SaveToDb(ISession session, object obj)
{
using (var transaction = session.BeginTransaction())
{
session.SaveOrUpdate(obj);
try { transaction.Commit(); }
catch { }
}
}
public static void DeleteFromDb(Database database, object obj)
{
ISession session = FluentCommon.CreateSession(database);
SaveToDb(session, 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'.
/// </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 CreateEmptyUsersDB(DBSettings dbSettings)
{
ISessionFactory sessionFactory = CreateSessionFactory(Database.Users, dbSettings, true);
if (sessionFactory == null) return false;
/// Populate the database
using (var session = sessionFactory.OpenSession())
{
using (var transaction = session.BeginTransaction())
{
///
/// Prepare all groups
///
var testers = new Entities.Group { Gid = (int)TBF.Grp.GID.Testers, Name = Strings.Tester };
var testingSpecialists = new Entities.Group { Gid = (int)TBF.Grp.GID.TestingSpecialists, Name = Strings.Testing_Specialist };
var headOfLab = new Entities.Group { Gid = (int)TBF.Grp.GID.HeadOfLab, Name = Strings.Head_of_Lab };
var maintenanceSpecialists = new Entities.Group { Gid = (int)TBF.Grp.GID.MaintenanceSpecialists, Name = Strings.Maintenance_Specialist };
var metrologists = new Entities.Group { Gid = (int)TBF.Grp.GID.Metrologists, Name = Strings.Metrologist };
var calibrationSpecialists = new Entities.Group { Gid = (int)TBF.Grp.GID.CalibrationSpecialists, Name = Strings.Calibration_Specialist };
var administrators = new Entities.Group { Gid = (int)TBF.Grp.GID.Administrators, Name = Strings.Administrator };
/// Create the user 'admin' add his groups
var admin = new Entities.User
{
Name = Program.AdminUsername,
Description = "Administrator",
LastPwChange = DateTime.Now
};
admin.SetPassword(Program.AdminPassword);
admin.AddGroup(testers);
admin.AddGroup(testingSpecialists);
admin.AddGroup(headOfLab);
admin.AddGroup(maintenanceSpecialists);
admin.AddGroup(metrologists);
admin.AddGroup(calibrationSpecialists);
admin.AddGroup(administrators);
session.SaveOrUpdate(admin);
/// Create the control board component
var cmpnt = (new BenchControl.Elde.ControlBoardCfg(new BenchControl.Elde.ControlBoardFactory())).CreateDbEntity();
session.SaveOrUpdate(cmpnt);
transaction.Commit();
}
}
return true;
}
/// <summary>
/// Create an empty bench 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 CreateEmptyBenchDB(DBSettings dbSettings)
{
ISessionFactory sessionFactory = CreateSessionFactory(Database.Users, dbSettings, 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;
}
/// <summary>
/// Create an empty procedures 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 CreateEmptyProceduresDB(DBSettings dbSettings)
{
ISessionFactory sessionFactory = CreateSessionFactory(Database.Users, dbSettings, 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;
}
/// <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 CreateEmptyWaterMetersDB(DBSettings dbSettings)
{
ISessionFactory sessionFactory = CreateSessionFactory(Database.Users, dbSettings, 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;
}
}
}
-107
View File
@@ -1,107 +0,0 @@
namespace ResultsBrowser.Forms
{
partial class LoginDlg
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LoginDlg));
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.passwordTextBox = new System.Windows.Forms.TextBox();
this.cancelButton = new System.Windows.Forms.Button();
this.okButton = new System.Windows.Forms.Button();
this.userNameTextBox = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// label1
//
resources.ApplyResources(this.label1, "label1");
this.label1.Name = "label1";
//
// label2
//
resources.ApplyResources(this.label2, "label2");
this.label2.Name = "label2";
//
// passwordTextBox
//
resources.ApplyResources(this.passwordTextBox, "passwordTextBox");
this.passwordTextBox.Name = "passwordTextBox";
this.passwordTextBox.UseSystemPasswordChar = true;
//
// cancelButton
//
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
resources.ApplyResources(this.cancelButton, "cancelButton");
this.cancelButton.Name = "cancelButton";
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
//
// okButton
//
this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK;
resources.ApplyResources(this.okButton, "okButton");
this.okButton.Name = "okButton";
this.okButton.UseVisualStyleBackColor = true;
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// userNameTextBox
//
resources.ApplyResources(this.userNameTextBox, "userNameTextBox");
this.userNameTextBox.Name = "userNameTextBox";
//
// LoginDlg
//
this.AcceptButton = this.okButton;
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.cancelButton;
this.Controls.Add(this.userNameTextBox);
this.Controls.Add(this.okButton);
this.Controls.Add(this.cancelButton);
this.Controls.Add(this.passwordTextBox);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Name = "LoginDlg";
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.Load += new System.EventHandler(this.LoginDlg_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.TextBox userNameTextBox;
private System.Windows.Forms.TextBox passwordTextBox;
private System.Windows.Forms.Button cancelButton;
private System.Windows.Forms.Button okButton;
}
}
-137
View File
@@ -1,137 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using ResultsBrowser.Resources;
namespace ResultsBrowser.Forms
{
/// <summary>
/// Provides login dialog as well as user authorization using TBF.User.Authorize(...)
/// (i.e. when DialogResult is OK, user was authorized).
/// </summary>
public partial class LoginDlg : Form
{
// Private fields
string user;
string password;
Grp.GID requiredGroupMembership = Grp.GID.Invalid;
bool noDatabase;
/// <summary>
/// Constructor.
/// </summary>
public LoginDlg()
{
InitializeComponent();
}
/// <summary>
/// Constructor with a predefined user.
/// </summary>
public LoginDlg(string predefinedUser)
: this()
{
user = predefinedUser;
userNameTextBox.Text = predefinedUser;
}
/// <summary>
/// Constructor with 'no Database' flag.
/// </summary>
public LoginDlg(bool noDatabase)
: this()
{
this.noDatabase = noDatabase;
}
/// <summary>
/// Constructor when a specific group membership is required.
/// </summary>
public LoginDlg(Grp.GID requiredGroupMembership)
: this()
{
this.requiredGroupMembership = requiredGroupMembership;
}
/// <summary>
/// Constructor with a predefined user when a specific group membership is required.
/// </summary>
public LoginDlg(string predefinedUser, Grp.GID requiredGroupMembership)
: this()
{
user = predefinedUser;
userNameTextBox.Text = predefinedUser;
this.requiredGroupMembership = requiredGroupMembership;
}
private void LoginDlg_Load(object sender, EventArgs e)
{
Text = Strings.User_Login;
label1.Text = Strings.Username;
label2.Text = Strings.Password;
okButton.Text = Strings.OkBtnText;
cancelButton.Text = Strings.CancelBtnText;
if (user == null) userNameTextBox.Select();
else passwordTextBox.Select();
}
/// <summary>
/// Try to authorize the user when OK clicked.
/// </summary>
private void okButton_Click(object sender, EventArgs e)
{
user = userNameTextBox.Text;
password = passwordTextBox.Text;
bool authorized = Entities.User.IsPowerUser(user, password);
if (!authorized && !noDatabase)
{
Entities.User loadedUser = Entities.User.LoadUserByName(user);
if (loadedUser != null)
{
if (requiredGroupMembership == Grp.GID.Invalid)
{
authorized = loadedUser.Authorize(user, password);
}
else
{
authorized = loadedUser.Authorize(user, password, requiredGroupMembership);
}
}
}
if (authorized)
{
DialogResult = DialogResult.OK;
Close();
if (Program.MainWnd != null) Program.MainWnd.UpdateUser();
return;
}
MessageBox.Show(Strings.Invalid_username_or_password, Strings.Error, MessageBoxButtons.OK);
DialogResult = DialogResult.None;
return;
}
/// <summary>
/// Cancel clicked, do not try to authorize.
/// </summary>
private void cancelButton_Click(object sender, EventArgs e)
{
if (requiredGroupMembership == Grp.GID.Invalid)
{
Entities.User.Unauthorize();
}
DialogResult = DialogResult.Cancel;
Close();
return;
}
}
}
-142
View File
@@ -1,142 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 13</value>
</data>
<data name="label1.Text" xml:space="preserve">
<value>Benutzername</value>
</data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>50, 13</value>
</data>
<data name="label2.Text" xml:space="preserve">
<value>Passwort</value>
</data>
<data name="cancelButton.Text" xml:space="preserve">
<value>&amp;Abbrechen</value>
</data>
<data name="okButton.Text" xml:space="preserve">
<value>&amp;OK</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>Anmelden</value>
</data>
</root>
-288
View File
@@ -1,288 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="label1.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="passwordTextBox.Size" type="System.Drawing.Size, System.Drawing">
<value>168, 20</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="$this.StartPosition" type="System.Windows.Forms.FormStartPosition, System.Windows.Forms">
<value>CenterScreen</value>
</data>
<data name="&gt;&gt;cancelButton.Name" xml:space="preserve">
<value>cancelButton</value>
</data>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 13</value>
</data>
<data name="&gt;&gt;okButton.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="okButton.Size" type="System.Drawing.Size, System.Drawing">
<value>105, 28</value>
</data>
<data name="&gt;&gt;passwordTextBox.Name" xml:space="preserve">
<value>passwordTextBox</value>
</data>
<data name="cancelButton.Size" type="System.Drawing.Size, System.Drawing">
<value>105, 28</value>
</data>
<data name="label2.Location" type="System.Drawing.Point, System.Drawing">
<value>8, 51</value>
</data>
<data name="passwordTextBox.Location" type="System.Drawing.Point, System.Drawing">
<value>96, 48</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="label1.Text" xml:space="preserve">
<value>User name</value>
</data>
<data name="&gt;&gt;cancelButton.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="&gt;&gt;label2.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="cancelButton.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="passwordTextBox.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="label1.Location" type="System.Drawing.Point, System.Drawing">
<value>8, 24</value>
</data>
<data name="&gt;&gt;label2.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>LoginDlg</value>
</data>
<data name="userNameTextBox.Size" type="System.Drawing.Size, System.Drawing">
<value>168, 20</value>
</data>
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>402, 88</value>
</data>
<data name="&gt;&gt;label1.ZOrder" xml:space="preserve">
<value>5</value>
</data>
<data name="okButton.Location" type="System.Drawing.Point, System.Drawing">
<value>285, 14</value>
</data>
<data name="&gt;&gt;okButton.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;label1.Name" xml:space="preserve">
<value>label1</value>
</data>
<data name="&gt;&gt;label2.Name" xml:space="preserve">
<value>label2</value>
</data>
<data name="cancelButton.Text" xml:space="preserve">
<value>Cancel</value>
</data>
<data name="&gt;&gt;cancelButton.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;okButton.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;okButton.Name" xml:space="preserve">
<value>okButton</value>
</data>
<data name="label2.Text" xml:space="preserve">
<value>Password</value>
</data>
<data name="&gt;&gt;passwordTextBox.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label1.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="label1.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>53, 13</value>
</data>
<data name="userNameTextBox.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="cancelButton.Location" type="System.Drawing.Point, System.Drawing">
<value>285, 48</value>
</data>
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>58, 13</value>
</data>
<data name="okButton.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="label2.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="&gt;&gt;passwordTextBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;userNameTextBox.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="okButton.Text" xml:space="preserve">
<value>OK</value>
</data>
<data name="&gt;&gt;userNameTextBox.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<data name="&gt;&gt;userNameTextBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="userNameTextBox.Location" type="System.Drawing.Point, System.Drawing">
<value>96, 22</value>
</data>
<data name="label2.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="&gt;&gt;cancelButton.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;passwordTextBox.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>User login</value>
</data>
<data name="&gt;&gt;label2.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="&gt;&gt;label1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;userNameTextBox.Name" xml:space="preserve">
<value>userNameTextBox</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
</root>
@@ -1,111 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using ResultsBrowser.Resources;
namespace ResultsBrowser.Forms
{
/// <summary>
/// Provides login dialog that includes test bench selection.
/// It is used only once on program startup. Does not do authorisation
/// as User.users have not been loadded from the DB yet.
/// </summary>
public partial class LoginDlgWithBenchSelection : Form
{
// Private fields
string user;
string password;
string benchName = null;
// Readonly public properties to do the authorization.
public string User { get { return user; } }
public string Password { get { return password; } }
public string BenchName { get { return benchName; } }
/// <summary>
/// Constructor.
/// </summary>
public LoginDlgWithBenchSelection()
{
InitializeComponent();
}
/// <summary>
/// Constructor with a predefined bench.
/// </summary>
public LoginDlgWithBenchSelection(string predefinedBench)
: this()
{
benchName = predefinedBench;
}
private void LoginDlgWithBenchSelection_Load(object sender, EventArgs e)
{
#if DEBUG
userNameTextBox.Text = Program.AdminUsername;
passwordTextBox.Text = Program.AdminPassword;
#endif
int nrOfBenches = Program.LocalSettings.testBenches == null ? 0 : Program.LocalSettings.testBenches.GetLength(0);
for (int i = 0; i < nrOfBenches; i++)
{
testBenchComboBox.Items.Add(Program.LocalSettings.testBenches[i].BenchName);
if (benchName != null && benchName == Program.LocalSettings.testBenches[i].BenchName)
{
testBenchComboBox.Text = benchName;
}
}
}
/// <summary>
/// OK clicked (authorization is done outside this dialog).
/// </summary>
private void okButton_Click(object sender, EventArgs e)
{
if (testBenchComboBox.SelectedItem != null)
{
user = userNameTextBox.Text;
password = passwordTextBox.Text;
benchName = testBenchComboBox.SelectedItem.ToString();
DialogResult = DialogResult.OK;
Close();
return;
}
else
{
MessageBox.Show(Strings.PLs_select_testbench, Strings.Warning, MessageBoxButtons.OK);
}
}
/// <summary>
/// Cancel clicked.
/// </summary>
private void cancelButton_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Cancel;
Close();
return;
}
private void passwordTextBox_TextChanged(object sender, EventArgs e)
{
if (passwordTextBox.Text != "")
{
this.AcceptButton = okButton;
}
}
private void userNameTextBox_KeyPress(object sender, KeyPressEventArgs e)
{
if (Convert.ToInt32(e.KeyChar) == 13)
{
passwordTextBox.Focus();
}
}
}
}
@@ -1,145 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>75, 13</value>
</data>
<data name="label1.Text" xml:space="preserve">
<value>Benutzername</value>
</data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>50, 13</value>
</data>
<data name="label2.Text" xml:space="preserve">
<value>Passwort</value>
</data>
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>52, 13</value>
</data>
<data name="label3.Text" xml:space="preserve">
<value>Prüfstand</value>
</data>
<data name="cancelButton.Text" xml:space="preserve">
<value>Abbrechen</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>Anmelden am Prüfstand</value>
</data>
</root>
@@ -1,130 +0,0 @@
namespace ResultsBrowser.Forms
{
partial class LoginDlgWithBenchSelection
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(LoginDlgWithBenchSelection));
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.label3 = new System.Windows.Forms.Label();
this.testBenchComboBox = new System.Windows.Forms.ComboBox();
this.passwordTextBox = new System.Windows.Forms.TextBox();
this.cancelButton = new System.Windows.Forms.Button();
this.okButton = new System.Windows.Forms.Button();
this.userNameTextBox = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// label1
//
resources.ApplyResources(this.label1, "label1");
this.label1.ImageKey = global::TBF.Resources.Strings.String1;
this.label1.Name = "label1";
//
// label2
//
resources.ApplyResources(this.label2, "label2");
this.label2.ImageKey = global::TBF.Resources.Strings.String1;
this.label2.Name = "label2";
//
// label3
//
resources.ApplyResources(this.label3, "label3");
this.label3.ImageKey = global::TBF.Resources.Strings.String1;
this.label3.Name = "label3";
//
// testBenchComboBox
//
resources.ApplyResources(this.testBenchComboBox, "testBenchComboBox");
this.testBenchComboBox.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList;
this.testBenchComboBox.FormattingEnabled = true;
this.testBenchComboBox.Name = "testBenchComboBox";
//
// passwordTextBox
//
resources.ApplyResources(this.passwordTextBox, "passwordTextBox");
this.passwordTextBox.Name = "passwordTextBox";
this.passwordTextBox.UseSystemPasswordChar = true;
this.passwordTextBox.TextChanged += new System.EventHandler(this.passwordTextBox_TextChanged);
//
// cancelButton
//
resources.ApplyResources(this.cancelButton, "cancelButton");
this.cancelButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.cancelButton.ImageKey = global::TBF.Resources.Strings.String1;
this.cancelButton.Name = "cancelButton";
this.cancelButton.UseVisualStyleBackColor = true;
this.cancelButton.Click += new System.EventHandler(this.cancelButton_Click);
//
// okButton
//
resources.ApplyResources(this.okButton, "okButton");
this.okButton.DialogResult = System.Windows.Forms.DialogResult.OK;
this.okButton.ImageKey = global::TBF.Resources.Strings.String1;
this.okButton.Name = "okButton";
this.okButton.UseVisualStyleBackColor = true;
this.okButton.Click += new System.EventHandler(this.okButton_Click);
//
// userNameTextBox
//
resources.ApplyResources(this.userNameTextBox, "userNameTextBox");
this.userNameTextBox.Name = "userNameTextBox";
this.userNameTextBox.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.userNameTextBox_KeyPress);
//
// LoginDlgWithBenchSelection
//
resources.ApplyResources(this, "$this");
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.userNameTextBox);
this.Controls.Add(this.okButton);
this.Controls.Add(this.cancelButton);
this.Controls.Add(this.passwordTextBox);
this.Controls.Add(this.testBenchComboBox);
this.Controls.Add(this.label3);
this.Controls.Add(this.label2);
this.Controls.Add(this.label1);
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Name = "LoginDlgWithBenchSelection";
this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
this.Load += new System.EventHandler(this.LoginDlgWithBenchSelection_Load);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.TextBox userNameTextBox;
private System.Windows.Forms.TextBox passwordTextBox;
private System.Windows.Forms.ComboBox testBenchComboBox;
private System.Windows.Forms.Button cancelButton;
private System.Windows.Forms.Button okButton;
}
}
@@ -1,339 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="label1.Text" xml:space="preserve">
<value>User name</value>
</data>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.ClientSize" type="System.Drawing.Size, System.Drawing">
<value>402, 102</value>
</data>
<data name="cancelButton.Size" type="System.Drawing.Size, System.Drawing">
<value>105, 28</value>
</data>
<data name="cancelButton.Location" type="System.Drawing.Point, System.Drawing">
<value>285, 48</value>
</data>
<data name="cancelButton.Text" xml:space="preserve">
<value>Cancel</value>
</data>
<data name="&gt;&gt;cancelButton.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;testBenchComboBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;$this.Name" xml:space="preserve">
<value>LoginDlgWithBenchSelection</value>
</data>
<data name="&gt;&gt;label1.Name" xml:space="preserve">
<value>label1</value>
</data>
<data name="&gt;&gt;passwordTextBox.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<assembly alias="mscorlib" name="mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="testBenchComboBox.TabIndex" type="System.Int32, mscorlib">
<value>5</value>
</data>
<data name="&gt;&gt;label3.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="userNameTextBox.Location" type="System.Drawing.Point, System.Drawing">
<value>96, 15</value>
</data>
<data name="label3.Size" type="System.Drawing.Size, System.Drawing">
<value>61, 13</value>
</data>
<data name="&gt;&gt;cancelButton.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="testBenchComboBox.Location" type="System.Drawing.Point, System.Drawing">
<value>96, 67</value>
</data>
<data name="&gt;&gt;label3.Name" xml:space="preserve">
<value>label3</value>
</data>
<data name="label3.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
<data name="$this.StartPosition" type="System.Windows.Forms.FormStartPosition, System.Windows.Forms">
<value>CenterScreen</value>
</data>
<data name="&gt;&gt;label1.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="label3.Location" type="System.Drawing.Point, System.Drawing">
<value>8, 70</value>
</data>
<data name="&gt;&gt;label1.ZOrder" xml:space="preserve">
<value>7</value>
</data>
<data name="passwordTextBox.Location" type="System.Drawing.Point, System.Drawing">
<value>96, 41</value>
</data>
<data name="&gt;&gt;userNameTextBox.Name" xml:space="preserve">
<value>userNameTextBox</value>
</data>
<data name="label2.TabIndex" type="System.Int32, mscorlib">
<value>1</value>
</data>
<data name="label1.Size" type="System.Drawing.Size, System.Drawing">
<value>58, 13</value>
</data>
<data name="&gt;&gt;testBenchComboBox.ZOrder" xml:space="preserve">
<value>4</value>
</data>
<data name="&gt;&gt;label2.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;passwordTextBox.ZOrder" xml:space="preserve">
<value>3</value>
</data>
<data name="$this.AutoScaleDimensions" type="System.Drawing.SizeF, System.Drawing">
<value>6, 13</value>
</data>
<data name="&gt;&gt;label2.ZOrder" xml:space="preserve">
<value>6</value>
</data>
<data name="label2.Size" type="System.Drawing.Size, System.Drawing">
<value>53, 13</value>
</data>
<data name="&gt;&gt;testBenchComboBox.Name" xml:space="preserve">
<value>testBenchComboBox</value>
</data>
<data name="userNameTextBox.Size" type="System.Drawing.Size, System.Drawing">
<value>168, 20</value>
</data>
<data name="okButton.Size" type="System.Drawing.Size, System.Drawing">
<value>105, 28</value>
</data>
<data name="&gt;&gt;userNameTextBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="testBenchComboBox.Size" type="System.Drawing.Size, System.Drawing">
<value>168, 21</value>
</data>
<data name="label1.TabIndex" type="System.Int32, mscorlib">
<value>0</value>
</data>
<data name="passwordTextBox.Size" type="System.Drawing.Size, System.Drawing">
<value>168, 20</value>
</data>
<data name="&gt;&gt;cancelButton.ZOrder" xml:space="preserve">
<value>2</value>
</data>
<data name="okButton.Location" type="System.Drawing.Point, System.Drawing">
<value>285, 14</value>
</data>
<data name="&gt;&gt;userNameTextBox.Type" xml:space="preserve">
<value>System.Windows.Forms.TextBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="label3.Text" xml:space="preserve">
<value>Test bench</value>
</data>
<data name="&gt;&gt;okButton.Name" xml:space="preserve">
<value>okButton</value>
</data>
<data name="&gt;&gt;label2.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;okButton.ZOrder" xml:space="preserve">
<value>1</value>
</data>
<data name="&gt;&gt;testBenchComboBox.Type" xml:space="preserve">
<value>System.Windows.Forms.ComboBox, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="label2.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="userNameTextBox.TabIndex" type="System.Int32, mscorlib">
<value>3</value>
</data>
<data name="label1.AutoSize" type="System.Boolean, mscorlib">
<value>True</value>
</data>
<data name="&gt;&gt;label2.Name" xml:space="preserve">
<value>label2</value>
</data>
<data name="&gt;&gt;passwordTextBox.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="passwordTextBox.TabIndex" type="System.Int32, mscorlib">
<value>4</value>
</data>
<data name="&gt;&gt;cancelButton.Name" xml:space="preserve">
<value>cancelButton</value>
</data>
<data name="label1.Location" type="System.Drawing.Point, System.Drawing">
<value>8, 17</value>
</data>
<data name="$this.Text" xml:space="preserve">
<value>User login</value>
</data>
<data name="&gt;&gt;passwordTextBox.Name" xml:space="preserve">
<value>passwordTextBox</value>
</data>
<data name="label2.Text" xml:space="preserve">
<value>Password</value>
</data>
<data name="label3.TabIndex" type="System.Int32, mscorlib">
<value>2</value>
</data>
<data name="label2.Location" type="System.Drawing.Point, System.Drawing">
<value>8, 44</value>
</data>
<data name="cancelButton.TabIndex" type="System.Int32, mscorlib">
<value>7</value>
</data>
<data name="okButton.Text" xml:space="preserve">
<value>OK</value>
</data>
<data name="&gt;&gt;okButton.Type" xml:space="preserve">
<value>System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;okButton.Parent" xml:space="preserve">
<value>$this</value>
</data>
<data name="&gt;&gt;$this.Type" xml:space="preserve">
<value>System.Windows.Forms.Form, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;label3.ZOrder" xml:space="preserve">
<value>5</value>
</data>
<data name="&gt;&gt;label1.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="okButton.TabIndex" type="System.Int32, mscorlib">
<value>6</value>
</data>
<data name="&gt;&gt;label3.Type" xml:space="preserve">
<value>System.Windows.Forms.Label, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</data>
<data name="&gt;&gt;userNameTextBox.ZOrder" xml:space="preserve">
<value>0</value>
</data>
<metadata name="$this.Localizable" type="System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</metadata>
<metadata name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>de</value>
</metadata>
</root>
-120
View File
@@ -1,120 +0,0 @@
namespace ResultsBrowser.Forms
{
partial class NoBenchOrDatabaseDlg
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(NoBenchOrDatabaseDlg));
this.exitButton = new System.Windows.Forms.Button();
this.retryButton = new System.Windows.Forms.Button();
this.configureButton = new System.Windows.Forms.Button();
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.errorMessageLabel = new System.Windows.Forms.Label();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.SuspendLayout();
//
// exitButton
//
this.exitButton.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.exitButton.Location = new System.Drawing.Point(42, 68);
this.exitButton.Name = "exitButton";
this.exitButton.Size = new System.Drawing.Size(246, 33);
this.exitButton.TabIndex = 0;
this.exitButton.Text = "Exit";
this.exitButton.UseVisualStyleBackColor = true;
this.exitButton.Click += new System.EventHandler(this.exitButton_Click);
//
// retryButton
//
this.retryButton.Location = new System.Drawing.Point(42, 146);
this.retryButton.Name = "retryButton";
this.retryButton.Size = new System.Drawing.Size(246, 33);
this.retryButton.TabIndex = 1;
this.retryButton.Text = "Retry database connection";
this.retryButton.UseVisualStyleBackColor = true;
this.retryButton.Click += new System.EventHandler(this.retryButton_Click);
//
// configureButton
//
this.configureButton.Location = new System.Drawing.Point(42, 107);
this.configureButton.Name = "configureButton";
this.configureButton.Size = new System.Drawing.Size(246, 33);
this.configureButton.TabIndex = 2;
this.configureButton.Text = "Configure test benches (password required)";
this.configureButton.UseVisualStyleBackColor = true;
this.configureButton.Click += new System.EventHandler(this.configureButton_Click);
//
// pictureBox1
//
this.pictureBox1.ErrorImage = ((System.Drawing.Image)(resources.GetObject("pictureBox1.ErrorImage")));
this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
this.pictureBox1.InitialImage = null;
this.pictureBox1.Location = new System.Drawing.Point(42, 21);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(32, 32);
this.pictureBox1.TabIndex = 3;
this.pictureBox1.TabStop = false;
//
// errorMessageLabel
//
this.errorMessageLabel.AutoSize = true;
this.errorMessageLabel.Location = new System.Drawing.Point(80, 31);
this.errorMessageLabel.Name = "errorMessageLabel";
this.errorMessageLabel.Size = new System.Drawing.Size(160, 13);
this.errorMessageLabel.TabIndex = 4;
this.errorMessageLabel.Text = "Cannot connect to the database";
//
// NoBenchOrDatabaseDlg
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.CancelButton = this.exitButton;
this.ClientSize = new System.Drawing.Size(328, 194);
this.Controls.Add(this.errorMessageLabel);
this.Controls.Add(this.pictureBox1);
this.Controls.Add(this.configureButton);
this.Controls.Add(this.retryButton);
this.Controls.Add(this.exitButton);
this.Name = "NoBenchOrDatabaseDlg";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Error";
this.Load += new System.EventHandler(this.NoDatabaseMsgDlg_Load);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Button exitButton;
private System.Windows.Forms.Button retryButton;
private System.Windows.Forms.Button configureButton;
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.Label errorMessageLabel;
}
}
@@ -1,48 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ResultsBrowser.Resources;
namespace ResultsBrowser.Forms
{
public partial class NoBenchOrDatabaseDlg : Form
{
public string Message;
public bool ShowRetry;
public NoBenchOrDatabaseDlg()
{
InitializeComponent();
}
private void NoDatabaseMsgDlg_Load(object sender, EventArgs e)
{
Text = Strings.Error;
errorMessageLabel.Text = (Message != null) ? Message : Strings.Error;
exitButton.Text = Strings.ExitBtnText;
retryButton.Text = Strings.RetryDatabaseText;
configureButton.Text = Strings.ConfigureDatabaseText;
if (!ShowRetry) retryButton.Enabled = false;
}
private void exitButton_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Abort;
}
private void retryButton_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.Retry;
}
private void configureButton_Click(object sender, EventArgs e)
{
DialogResult = DialogResult.OK;
}
}
}
@@ -1,272 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<assembly alias="System.Drawing" name="System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="pictureBox1.ErrorImage" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAA0sAAALBCAIAAAAGeq0rAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAF7tJREFUeF7t3Vtw
l/Wdx3HvCEkQldrOdJiOhx6o2GqrUEAQFDlExcNuW7fVqb2o3c44g9Orbhc7uDe7nemO2M5gdXWtBBYS
BA0oa1By4BwIIWAgIYEi4aCEJFhd123VKfvk0O1h2t274H7m9Zonmf/h9/s+t+95kv/zv+Dc/6qnp2fn
jh3VVVVLHn304UWLHlq4sDiKB8XT4sXirWLB8FIAAD4a/mLhdXZ2rq6ufmTx4srKysbGxq6urrP9/R8M
Kh4UT4sXi7eKBcWyYvHwNgAAzrc/U3i9vb01NTVLlixpaGjoK550HjpZV3dkVVXH0scP/OOP9/5o8Ws/
+efOymXd9Y1nOjv7zpwplhWLiy3F2uERAACcP39aeIc6OpYuXbqxtvatvr5TW7Z2P7/29L8+c+yhh7rv
u+/4X321++67Xr/zzsN33tl+192td9/ddP/9bcuWHWva+ebJk8WWYmOxfXgQAADnyR8V3v79+3/62GNt
bW19+/a9Xr26r7LyxAMPvHH33SfvvPPkgjuPLVjw+oIFRxYsOFxx+6Fbb22vmHdg3rzmioqtt92279FH
T+9pKTYW24shw+MAADgffl94hzo6ij7r7u4+vmHDyZWrTv3g704Ntt3xO+4o2u7o7bcfue22wxUVHfPn
H5w3r23OnP1z5rTOnr3n5pubZ87cMnv2v8+Ze2Tt2mJ7McSVPACA82i48Hp7e5cuXdrW1jaQd888c/y7
f/vGXXccmzu3a8aMI7fcMtB28+d3zpt/cO7cttm37J89u/Xmm1tm39Q0bdr2a760ddKkrdOn18+YsWHm
rCNr1hRDilH+Jw8A4HwZLryampqNtbV9+/YdXrLkxPe+d/yOOw7PurHngQf+a/36kw888NoNUzvmzj0w
e/ZQ2zXPmrV75sxt113XfMcdx595pvXe+1656vObJk+unTJ13Y0ze5qbi1HFwKHJAACMsIHC6+zsXLJk
yVt9fe2PP35i0aJjty04fNNNb9x//7k33xxY0tNz5Jvf3H3ddUNtt2vGjKYbZ2y59tpd8+f/srHx6Nm+
Y/v27fzq116cMOGlL3953fXXv/zXXy1GFQPdQgUA4LwYKLzV1dX19fVv7N51+Id///rttxd5d+yee86d
OTO0YsCbpzvuvXfHF7+468Ybt0+btvmLVzdV3PrLLVu6Tpw4cPBgW1dXZ/PuV+fNW/uZz6yZePXzX77u
0Ip/a2hoKMYObwcAYARd0NPT88jixb09PV2rVh3+9rcPz5vTPn360Xv+5tw77wwvGfTr06cP3Htv3YQJ
dROv2l5RcXjr1q6TJw8ePLhv795Tp0+/++67L1RUrLz88pVXXVU98erae77Wd+ZMMdY3XgAAjLwLdu7Y
UVlZeaazq/XBBztuuaV99k1tN9/ccv31h7/znXNvvVWs+PDDD9977713P/zwV93H99x11+ZZs4q8O9Td
ffDAgdbW1oG8e+edylmzniwvrxw79tmxY/917Njqa649vX//8uXLi+FDpwEAYMRcUF1V1djY2P1KXevX
vn7gpptemzlz78yZe2bM2HrV1W3f+tZ7vb3vnzv39ttvn+3v7/nVr9547bX2urq2rq6i7Xbv2nX81Kn/
ePvtZ6dNe6K8fHlZ2S/Kyp4ZPFaMH9/29NObN28uhg+fBwCAkXLBkkcf7erqOvjU0y0VFftm3Lh3xvTd
06c3TZu2c+oNdRMm7Lnvvv5Tp/rfffeNU6eOHj3aeeRIW2dnS0tLU1NT91DezZz5ZHn5itLSZWVlzw4e
RedVjhvX+OCDxdhi+PB5AAAYKRc8vGjR2f7+5kcW77lp1lDbNU2bsm3KlC2TJzdOnfrylZdvufXWo83N
R44da29vb3vttb0tLbt27eo+fvydt99efvPNQ3k3dCwvKyuOIvWWXXhhzexbirHF8OHzAAAwUi54aOHC
Dz74oP4b39h9ww1F3m37yle2TJrUOHly/eTJtVdeuW706FWlpfUVFQfa2/e3tQ1dvdu6bVt/f/+L99//
RHl58e7K3x1F5A39XlFWtvILXyjGFsOHzwMAwEgZKLzf/OY3m7/73YHrdkXbXX99/aRJm6699qVx49aO
Hl1VWvripz61b/Xqlra2PXv2DOTd1q2bt2xp2Latef36lyZOLHquWFMc1X94FIX3pS+9//77Cg8AYOQN
/JW290zvzod/1DBlSn2Rd5Mn1V51Vc3o0WsG827d+PH71q/f09HR3NzctHPn1qLwduzY3NBQV1e3afv2
vbW1Gz7/+WJZsbjIwRd+d9SUl78wb15/X5+/0gIAjLyBT1p0HOrc/+STr06Zsmny5JevvrpoterBP7a+
MH5867p1ze3tzXv27Ny5s/vkybN9fS+vWbNpy5aG+vrGxsYdra0HN2+u/dznisJbP3i8VBwlJRsuvLBh
4cKBr8rwSQsAgBE3cLeU+vr6I6++8vLUabXXXDOUdytLS9dcemnr2rVF3u1ubt6xY0eRd2+dPbtsypTK
K66ofW5NY1NT086dLS0tnd3d3bubNn3600XYbSwpeaWk5NWSkucuHHuwclmRgO6WAgAw8gbuePzssmdP
drS/OG3a2ksuqRq8erd63LjW554byLvdu4u8OzaYd0M3Rini77kJExrWr9976NCh9vZjx471/+d7/fv3
N47/VP2oUQ2jRjWOGrX6sst7DrYtX17pjscAACNv+FvLTp04sX7u3KqPfazIu2fLyqovv3x3XV3Tvn3b
t2/vPnHirf7+Z2688YnBvBv6UEXNxIktjY3Hz5zp7e399W9/e7a/v27ChG2jRu0cXbJt7NjmH/9TX2/v
PzzyiG8tAwAYeRcUP6urqxsaGg4+9dTK8eOXlZf/oqzsX8rKVk2aVL9hw+tvvFHk3dPTp/988L53ReEV
ebd29Oia0aM3fPazR/fu/eDcubfPnn1l/vxNJSUtpaV7y8qeu/jiY431DY0NxdihcwAAMJIGCm/gIxFL
lrzV17duzpwVH//4U2VlT5aXP15eXnnddfs2bnxq2tSl5eXLysqKwltVWvpcaWmRdy+VlLxcUrLlmmuO
P/98w2231Y8atb+srK28fM+4j62bP78YVQwsxg6dAwCAkTRQeIWampqNtbWnd+9e/unP/GLcuJ+XlxdV
Vxw/Hfz9zODXkRWFVzV4AW/96NG1JSWbSkoaR40qfm8fNapou44xY/Zfcsmqyy7rbWl5ZePGYuDQZAAA
Rthw4fX29i5durStra2zqmrFZZc9NW7czwbbrki9J/+g8Ab+A2/wAt6rg3m3o7R0z+jRRd4dGjOmbdy4
qk9+8uja5w8cOFCMKgYOTQYAYIQNF17hUEfHTx97rLu7u6uq6tkrr3z60kt/NmZMEXn/U3gDt1D5gwt4
W0tKdpWX7ysvbx8zpnXcuOorrjj6wgvF9mJIMWp4KAAAI+73hVfYv39/0WdtbW2nd++umX3Lk5/4xNMX
X/xEeflTf1x4r5SUNIwa1TS6bO+YMXsuvviFiy5aX3Frb2trsbHYXgwZHgcAwPnwR4VXONTRsXTp0o21
tW/19b3e2LjtBz989vIrnrrkkhUXXVRVXr6mtPSl0tKNpaX1Y8asGzt25cUX137960fWPl8sLrYUG129
AwA47/608Aq9vb01NTVLliypq6vr7enp6ez85YYNLT/5ycvf/EbV1K+suHriuopbN3//+x2Vy063tfWe
OdNQX18sLrb43zsAgI+CP1N4Qzo7O1dXVz+yeHFlZWVjY2NXV9fZ/v4PBhUPiqfFi8VbxYJimRujAAB8
dPzFwhvS09Ozc8eO6qqqJY8++vCiRQ8tXFgcxYPiafFi8ZZvrQAA+Kj5PwoPAID/dxQeAEAahQcAkEbh
AQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCk
UXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgA
AGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkU
HgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBA
GoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUH
AJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG
4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEA
pFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4
AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABp
FB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4A
QBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqF
BwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQ
RuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEB
AKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRR
eAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAA
aRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQe
AEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAa
hQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcA
kEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbh
AQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCk
UXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgA
AGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkU
HgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBA
GoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUH
AJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG
4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEA
pFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4
AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABp
FB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4A
QBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqF
BwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQ
RuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEB
AKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRR
eAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAA
aRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQe
AEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAa
hQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcA
kEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbh
AQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCk
UXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgA
AGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkU
HgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBA
GoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUH
AJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG
4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEA
pFF4AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4
AABpFB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABp
FB4AQBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4A
QBqFBwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqF
BwCQRuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQ
RuEBAKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEB
AKRReAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRR
eAAAaRQeAEAahQcAkEbhAQCkUXgAAGkUHgBAGoUHAJBG4QEApFF4AABpFB4AQBqFBwCQRuEBAKRReAAA
Wc6d+2/gNp2ukwoN8QAAAABJRU5ErkJggg==
</value>
</data>
<data name="pictureBox1.Image" type="System.Drawing.Bitmap, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAIAAAD8GO2jAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8
YQUAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAAlwSFlzAAAOvwAA
Dr8BOAVTJAAACG1JREFUSEu1lmlQW9cVx/mG0GIZZCczGcZjvCQEiLHNYpABAQKEwBjTeqmXCfkQ3Mx4
xp58SlMnY/dLmxl3TJIZu3UhBAQBsYNsisBoByS0C21oMUhCYIQkbFzqxo4n9C89TElqt/3SM1dv3tM7
93fOPfecc1/M+n+UQCCgnJzs5PPrb9787OrVK5cvY+AGj/gTr6Cwofoaea0Bh8PR1dl5/do1Ho8nlUqd
TudKOPxDVHCDR/yJV1CAGpQ3pv2bvMJAMBgcGBior6+XSCQhPDhm/CKRu4Nvv3Xb8vsv9J9fm77xRwev
xSuWLjscoeVlqEEZU6C7gdgiPzcwY7ffunVrRCh8FAotyBXevt6lb5o8V654L1zw/eKkt+bEXHW1q7ra
dqLGUFOjqq01t7R4VMqHfj+mYCKmb4Beyk8MmEymr7780mw2h4zGuc6uEI83X1e3WFPjr672V1V7qqrm
qqrcVVUu7rGZigobl2PhcDRcrqKy0njz5pJWh4mYDsgGLir/MgDjeO31en1DQ/72joVPfrMQRfuOHwd6
9tgxd2Wli8u1l5dbORxzaamptNTAZmuLizUslpzN/mtpmbu3F9MB2bqODQMIHxYIFyL0pibfxV8vnjju
KStz5ue7S0oi6PJyB6fcWlZmZpeY2GxDcbGOXaRiMifSDymyshR5eeL8/CFWobunBxCgNvdjwwC2CEFE
ZFz19fMffQSvXYUFgbq6fwgE/rq66aO59rIyC5tNoDWFhWoWazwjQ3P8uK+pyXD+wmjKu2PZ2cKc3MEC
VkCjAQpAghwxgCRDGmBXbbdvz1+96qmschUVLdbWrj98GFEJBNznzqkzMgj0VH6+qiBffvDgVHn5A6l0
diXkMRqVJ0/dTU6+d/jwYGbm8C9PAgUgkbsRA0hksVi8qJ5yffrbuWPHQPecObO+vByhE/JwyX7+/OSB
A1MFBRNMpuxAmopb8UAud87PW6xWs9Pp0Kjvczi9+/f3pKb1Hc6YafsOuQsspsagFFEswUDA2dHh+uAD
F6fUlpc3e+ZX60+eEHBCvl9aspw/L0pOFqWmTHC5LoXC6fdbrVajXr+wtLS2ttbP5bYnJbWnpHSmpgnP
nEJ9AAt4DModBbnscBouXbKXlNjYRWZsYGam68MP1x89AvrFixdPnz5de/HisdenPXFCVlgI+ozXa7VY
DAZDhP7kCa+w8A6VyqPTm+n0b+j0zvSDSyZTa2sr4DFoKSh676jIcOq0pahomsXSs1ja/HxFSpr5/fef
BoPP19dXV1fRHgKPHy9OT9tEIsQEaPXUlG9h4W+rq81M5p+p1FYK5VsKpSk62hITzY2NMpkM8Bi0LTQW
a0Ojjss15hfo8/PUeXnIP2XuUQREe+FCeGEhvLa2uLAwOzvrcLvNDodOp1OpVF6CzmLB9zYyuYVCaY4O
mOExGNJLl4AFPAatEd5prl/TFhUSaBUzZzwnR56dLc3NHd6bJK+omNVo3B6PzWYzT0/rdbqpqSmvz/dk
dbW1uJigEwOLwICllm3bBtglwAIeg/aLBik+e1Z99Cjo40eOyLOypNnZYuT13r2DcXEdZLKYy7XYbCaz
mfBdMT4eDofv1tYiMnjb/nLABnFto1Da33sPWMAjBp49eya7eDHiNdCZmeKsrLGDB+8xGL1xcXwy+e6u
XcauLjQarVYboSsUMrlcMj6uEQjupaYCBx2Mzq0DBg4dev78ecQAVhFcDio/+1ySkyMGPTtLmJIyEBfX
E6UPJiYaBQKt3a7RaFRKpQIGJidlEolIJBqbmNALhUPvvgs1KMOb/pdjgErt53DCoVAkRNgH+4zDdOfO
/ZwclPtwWhpU4QVc609MNAwOamw2jVarVCq9fv9KKDTc0zOGFYjFyL1Jg8EqkwnfeQcGBNFxD4NEGtq2
TXL5cqRBYJORSShj9/3R4VymMD2doCOUPTt3Gnp7QVdrNJOTk6A/Wllpycnh7dkj7O6RIlhKJbbEgf6p
Vo3t2wfuCIk0SiLdJ5G6t9GtvBZ4EElT1EJzS7PfbrvLZPYmJGC98L2LwTB0d0foajXoniidyEjY7k5O
lggE+pmZGZvN4/GE//40bDJJE3eJY2MlsbHS2Niu3UkBq7m1lRcpNKJVLMzPC8rK+Dt2gI5c7kxKUotE
KqNxYmLCOz//KBxuKihAzoBO7OdAaqpOKvUtL6Mtf//jj8hIFM14bKwyjjROp2u++APO2t9dvx5pFWgG
6EroTdaGhvbExBYqFZXyFwqlIytLPDQ0t7gIemNe3p+i+Q4DoCOMyIKht9+e1et/QJ2vrIyWl4+RSDoy
WU+hdMfHe6RiifRls8Nvs10Plpa2vfFGA4WCUNxGb8nIMI6MNDBzb1GpKB8YQNZ3w/3oTg6TSPL0dF9f
n6SyEsExUShmKlXL2DFYXv7zdg0hDpwltbp13/5vGQz4CyjGV9Er2gviBgOID9xHtghJJLiMcOM6ERsL
tJ1GMyUkdOzeHdTpRkdGfnLgQDaPTAef37Z7dwOD8XUUDUtYzaaBSPSj7iNVQJ8kk7VxcaDP0GhmBoP/
1luzvX0Wi+UVRyZk89B38vnNe/c27tz5NY0GG5sGIrm7xX0FiTRFpRqpVBuNZmAwOvfsme3vf+2hT8jm
ZwtihW515803G+PjkTzYla0GkOxIR1UcRU+jaePj+7dvF3ArggbDf/lsIQTGsUDiw2tOKh3/5NPmpD0N
CQlt27fzqdQeMvkemTyC9kejDdLp7fHxwtOn3b19UP6fPrwIQfiwRUgDNBwcpQGH48HQkO7GjeFzZ/m5
R9rSUge5FbKPP7bzWpbM5iA+HcViKGPKZty3yisMEIIkQyL/Xz5+twoWgHJHS0HbQmtE+8XADR7xJ15B
YUP1lbK+/k8KJ49ubHudCAAAAABJRU5ErkJggg==
</value>
</data>
</root>
-312
View File
@@ -1,312 +0,0 @@
using System;
using System.IO;
using System.Text;
using System.Xml.Serialization;
namespace ResultsBrowser
{
/// <summary>
/// Class to be serialized to an XML file...
/// Public members are local settings.
/// These settings are modified by dialogs invoked by menu items
/// Edit->Preferences ... PreferencesDlg ... S1.1(language, etc. local settings), and
/// Edit->Advanced settings ... AdvancedSettingsDlg ... S1.2(spec. where bench settings are stored)
/// </summary>
[XmlRootAttribute("TestBenchFramework")]
public class LocalSettings
{
/// <summary>
/// Available languages.
/// Method ToString should give a supported culture info string:
/// ("en","de","fr","es","it","cn", etc.).
/// </summary>
public enum Languages
{
en,
de,
sk,
Count,
}
/// <summary>
/// User interface language ("en","de","fr","es","it","cn", etc.).
/// </summary>
public string Language = "en";
/// <summary>
/// Names and database settings of test benches.
/// </summary>
[XmlArrayAttribute("TestBenches")]
public DatabaseSettings[] testBenches;
[XmlIgnore]
public DatabaseSettings[] TestBenches { get { return testBenches; } }
[XmlIgnore]
public int BenchesCount { get { return (testBenches != null) ? testBenches.GetLength(0) : 0; } }
/// <summary>
/// Currently selected bench name (local or remote) or null (= no selection done).
/// </summary>
[XmlElementAttribute("LastBench")]
public string LastBenchName;
/// <summary>
/// Currently selected procedure name or null (= no selection done yet).
/// </summary>
[XmlElementAttribute("LastProcedure")]
public string LastProcedureName;
public int BatchNr;
public int RightPaneHorizSplitterDistance;
/// MainWnd
public int MainWndLeft;
public int MainWndTop;
public int MainWndWidth;
public int MainWndHeight;
public bool ManiWndMaximized;
/// Components
public int ComponentsDlgLeft;
public int ComponentsDlgTop;
public int ComponentsDlgWidth;
public int ComponentsDlgHeight;
/// Paths
public int PathsDlgLeft;
public int PathsDlgTop;
public int PathsDlgWidth;
public int PathsDlgHeight;
[XmlArrayAttribute("FeedingColumnWidths")]
public int[] FeedingColumnWidths;
[XmlIgnore]
public int FeedingColumnCount { get { return (FeedingColumnWidths != null) ? FeedingColumnWidths.Length : 0; } }
[XmlArrayAttribute("BenchColumnWidths")]
public int[] BenchColumnWidths;
[XmlIgnore]
public int BenchColumnCount { get { return (BenchColumnWidths != null) ? BenchColumnWidths.Length : 0; } }
[XmlArrayAttribute("OutputColumnWidths")]
public int[] OutputColumnWidths;
[XmlIgnore]
public int OutputColumnCount { get { return (OutputColumnWidths != null) ? OutputColumnWidths.Length : 0; } }
[XmlArrayAttribute("MetersColumnWidths")]
public int[] MetersColumnWidths;
[XmlIgnore]
public int MetersColumnCount { get { return (MetersColumnWidths != null) ? MetersColumnWidths.Length : 0; } }
/// Transitions
public int TransitionsDlgLeft;
public int TransitionsDlgTop;
public int TransitionsDlgWidth;
public int TransitionsDlgHeight;
[XmlArrayAttribute("TransitionsColumnWidths")]
public int[] TransitionsColumnWidths;
[XmlIgnore]
public int TransitionsColumnCount { get { return (TransitionsColumnWidths != null) ? TransitionsColumnWidths.Length : 0; } }
/// Metrology
public int MetrologyDlgLeft;
public int MetrologyDlgTop;
public int MetrologyDlgWidth;
public int MetrologyDlgHeight;
/// Procedures
public int ProceduresDlgLeft;
public int ProceduresDlgTop;
public int ProceduresDlgWidth;
public int ProceduresDlgHeight;
/// OneProcedure
public int OneProcedureDlgLeft;
public int OneProcedureDlgTop;
public int OneProcedureDlgWidth;
public int OneProcedureDlgHeight;
/// Configuration of results
public Forms.ResultsConfig.Meters ResultsConfigMeters;
public Forms.ResultsConfig.TestsAre ResultsConfigTests;
public string[] RsltItems_Screen_SingleWM;
public string[] RsltItems_Screen_CombinedWM;
public string[] RsltItems_Printer_SingleWM;
public string[] RsltItems_Printer_CombinedWM;
public string[] RsltItems_Disk_SingleWM;
public string[] RsltItems_Disk_CombinedWM;
[XmlArrayAttribute("RsltsSingleClmnWdths")]
public int[] RsltsSingleClmnWdths;
[XmlIgnore]
public int RsltsSingleClmnCount { get { return (RsltsSingleClmnWdths != null) ? RsltsSingleClmnWdths.Length : 0; } }
[XmlArrayAttribute("RsltsCombinedClmnWdths")]
public int[] RsltsCombinedClmnWdths;
[XmlIgnore]
public int RsltsCombinedClmnCount { get { return (RsltsCombinedClmnWdths != null) ? RsltsCombinedClmnWdths.Length : 0; } }
/// <summary>
/// Copy public fields from a LocalSettings object to this object.
/// </summary>
/// <param name="ls">Origin</param>
public void Assign(LocalSettings ls)
{
if (ls != null)
{
Language = ls.Language;
testBenches = new DatabaseSettings[ls.BenchesCount];
for (int i = 0; i < BenchesCount; i++)
testBenches[i] = ls.testBenches[i];
LastBenchName = ls.LastBenchName;
LastProcedureName = ls.LastProcedureName;
BatchNr = ls.BatchNr;
MainWndLeft = ls.MainWndLeft;
MainWndTop = ls.MainWndTop;
MainWndWidth = ls.MainWndWidth;
MainWndHeight = ls.MainWndHeight;
ManiWndMaximized = ls.ManiWndMaximized;
RightPaneHorizSplitterDistance = ls.RightPaneHorizSplitterDistance;
ComponentsDlgLeft = ls.ComponentsDlgLeft;
ComponentsDlgTop = ls.ComponentsDlgTop;
ComponentsDlgWidth = ls.ComponentsDlgWidth;
ComponentsDlgHeight = ls.ComponentsDlgHeight;
PathsDlgLeft = ls.PathsDlgLeft;
PathsDlgTop = ls.PathsDlgTop;
PathsDlgWidth = ls.PathsDlgWidth;
PathsDlgHeight = ls.PathsDlgHeight;
FeedingColumnWidths = new int[ls.FeedingColumnCount];
for (int i = 0; i < FeedingColumnCount; i++)
FeedingColumnWidths[i] = ls.FeedingColumnWidths[i];
BenchColumnWidths = new int[ls.BenchColumnCount];
for (int i = 0; i < BenchColumnCount; i++)
BenchColumnWidths[i] = ls.BenchColumnWidths[i];
OutputColumnWidths = new int[ls.OutputColumnCount];
for (int i = 0; i < OutputColumnCount; i++)
OutputColumnWidths[i] = ls.OutputColumnWidths[i];
MetersColumnWidths = new int[ls.MetersColumnCount];
for (int i = 0; i < MetersColumnCount; i++)
MetersColumnWidths[i] = ls.MetersColumnWidths[i];
TransitionsDlgLeft = ls.TransitionsDlgLeft;
TransitionsDlgTop = ls.TransitionsDlgTop;
TransitionsDlgWidth = ls.TransitionsDlgWidth;
TransitionsDlgHeight = ls.TransitionsDlgHeight;
TransitionsColumnWidths = new int[ls.TransitionsColumnCount];
for (int i = 0; i < TransitionsColumnCount; i++)
TransitionsColumnWidths[i] = ls.TransitionsColumnWidths[i];
MetrologyDlgLeft = ls.MetrologyDlgLeft;
MetrologyDlgTop = ls.MetrologyDlgTop;
MetrologyDlgWidth = ls.MetrologyDlgWidth;
MetrologyDlgHeight = ls.MetrologyDlgHeight;
ProceduresDlgLeft = ls.ProceduresDlgLeft;
ProceduresDlgTop = ls.ProceduresDlgTop;
ProceduresDlgWidth = ls.ProceduresDlgWidth;
ProceduresDlgHeight = ls.ProceduresDlgHeight;
OneProcedureDlgLeft = ls.OneProcedureDlgLeft;
OneProcedureDlgTop = ls.OneProcedureDlgTop;
OneProcedureDlgWidth = ls.OneProcedureDlgWidth;
OneProcedureDlgHeight = ls.OneProcedureDlgHeight;
ResultsConfigMeters = ls.ResultsConfigMeters;
ResultsConfigTests = ls.ResultsConfigTests;
int count = (ls.RsltItems_Screen_SingleWM != null) ? ls.RsltItems_Screen_SingleWM.Length : 0;
RsltItems_Screen_SingleWM = new string[count];
for (int i = 0; i < count; i++) RsltItems_Screen_SingleWM[i] = ls.RsltItems_Screen_SingleWM[i];
count = (ls.RsltItems_Screen_CombinedWM != null) ? ls.RsltItems_Screen_CombinedWM.Length : 0;
RsltItems_Screen_CombinedWM = new string[count];
for (int i = 0; i < count; i++) RsltItems_Screen_CombinedWM[i] = ls.RsltItems_Screen_CombinedWM[i];
count = (ls.RsltItems_Printer_SingleWM != null) ? ls.RsltItems_Printer_SingleWM.Length : 0;
RsltItems_Printer_SingleWM = new string[count];
for (int i = 0; i < count; i++) RsltItems_Printer_SingleWM[i] = ls.RsltItems_Printer_SingleWM[i];
count = (ls.RsltItems_Printer_CombinedWM != null) ? ls.RsltItems_Printer_CombinedWM.Length : 0;
RsltItems_Printer_CombinedWM = new string[count];
for (int i = 0; i < count; i++) RsltItems_Printer_CombinedWM[i] = ls.RsltItems_Printer_CombinedWM[i];
count = (ls.RsltItems_Disk_SingleWM != null) ? ls.RsltItems_Disk_SingleWM.Length : 0;
RsltItems_Disk_SingleWM = new string[count];
for (int i = 0; i < count; i++) RsltItems_Disk_SingleWM[i] = ls.RsltItems_Disk_SingleWM[i];
count = (ls.RsltItems_Disk_CombinedWM != null) ? ls.RsltItems_Disk_CombinedWM.Length : 0;
RsltItems_Disk_CombinedWM = new string[count];
for (int i = 0; i < count; i++) RsltItems_Disk_CombinedWM[i] = ls.RsltItems_Disk_CombinedWM[i];
RsltsSingleClmnWdths = new int[ls.RsltsSingleClmnCount];
for (int i = 0; i < RsltsSingleClmnCount; i++)
RsltsSingleClmnWdths[i] = ls.RsltsSingleClmnWdths[i];
RsltsCombinedClmnWdths = new int[ls.RsltsCombinedClmnCount];
for (int i = 0; i < RsltsCombinedClmnCount; i++)
RsltsCombinedClmnWdths[i] = ls.RsltsCombinedClmnWdths[i];
}
}
[XmlIgnore]
public readonly bool AlwaysAskPasswdWhenUnlocking;
[XmlIgnore]
public readonly bool RestoreUserWhenLeavingDialog;
public LocalSettings()
{
AlwaysAskPasswdWhenUnlocking = false;
RestoreUserWhenLeavingDialog = true;
}
/// <summary>
/// Load public fields of this class from the XML file.
/// </summary>
public void Load()
{
try
{
using (TextReader reader = new StreamReader(Program.LocalSettingsFileName))
{
LocalSettings ls = (new XmlSerializer(typeof(LocalSettings))).Deserialize(reader) as LocalSettings;
// Copy the settings just in case De-serialize() completes OK
this.Assign(ls);
}
}
catch (Exception e)
{
string msg = e.Message;
}
}
/// <summary>
/// Save public fields of this class to the XML file.
/// </summary>
public void Save()
{
try
{
using (TextWriter writer = new StreamWriter(Program.LocalSettingsFileName))
{
(new XmlSerializer(typeof(LocalSettings))).Serialize(writer, this);
}
}
catch (Exception e)
{
string msg = e.Message;
}
}
}
}
-141
View File
@@ -1,141 +0,0 @@
namespace ResultsBrowser
{
partial class MainWnd
{
/// <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.dateFromComboBox = new System.Windows.Forms.ComboBox();
this.label1 = new System.Windows.Forms.Label();
this.label2 = new System.Windows.Forms.Label();
this.dateToComboBox = new System.Windows.Forms.ComboBox();
this.label3 = new System.Windows.Forms.Label();
this.procedureComboBox = new System.Windows.Forms.ComboBox();
this.searchButton = new System.Windows.Forms.Button();
this.resultsTextBox = new System.Windows.Forms.TextBox();
this.SuspendLayout();
//
// dateFromComboBox
//
this.dateFromComboBox.FormattingEnabled = true;
this.dateFromComboBox.Location = new System.Drawing.Point(45, 49);
this.dateFromComboBox.Name = "dateFromComboBox";
this.dateFromComboBox.Size = new System.Drawing.Size(133, 21);
this.dateFromComboBox.TabIndex = 0;
//
// label1
//
this.label1.AutoSize = true;
this.label1.Location = new System.Drawing.Point(42, 32);
this.label1.Name = "label1";
this.label1.Size = new System.Drawing.Size(53, 13);
this.label1.TabIndex = 1;
this.label1.Text = "Date from";
//
// label2
//
this.label2.AutoSize = true;
this.label2.Location = new System.Drawing.Point(206, 32);
this.label2.Name = "label2";
this.label2.Size = new System.Drawing.Size(42, 13);
this.label2.TabIndex = 3;
this.label2.Text = "Date to";
//
// dateToComboBox
//
this.dateToComboBox.FormattingEnabled = true;
this.dateToComboBox.Location = new System.Drawing.Point(209, 49);
this.dateToComboBox.Name = "dateToComboBox";
this.dateToComboBox.Size = new System.Drawing.Size(133, 21);
this.dateToComboBox.TabIndex = 2;
//
// label3
//
this.label3.AutoSize = true;
this.label3.Location = new System.Drawing.Point(367, 32);
this.label3.Name = "label3";
this.label3.Size = new System.Drawing.Size(56, 13);
this.label3.TabIndex = 5;
this.label3.Text = "Procedure";
//
// procedureComboBox
//
this.procedureComboBox.FormattingEnabled = true;
this.procedureComboBox.Location = new System.Drawing.Point(370, 49);
this.procedureComboBox.Name = "procedureComboBox";
this.procedureComboBox.Size = new System.Drawing.Size(133, 21);
this.procedureComboBox.TabIndex = 4;
//
// searchButton
//
this.searchButton.Location = new System.Drawing.Point(395, 109);
this.searchButton.Name = "searchButton";
this.searchButton.Size = new System.Drawing.Size(107, 31);
this.searchButton.TabIndex = 6;
this.searchButton.Text = "Search";
this.searchButton.UseVisualStyleBackColor = true;
//
// resultsTextBox
//
this.resultsTextBox.Location = new System.Drawing.Point(46, 175);
this.resultsTextBox.Multiline = true;
this.resultsTextBox.Name = "resultsTextBox";
this.resultsTextBox.Size = new System.Drawing.Size(456, 234);
this.resultsTextBox.TabIndex = 7;
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(550, 448);
this.Controls.Add(this.resultsTextBox);
this.Controls.Add(this.searchButton);
this.Controls.Add(this.label3);
this.Controls.Add(this.procedureComboBox);
this.Controls.Add(this.label2);
this.Controls.Add(this.dateToComboBox);
this.Controls.Add(this.label1);
this.Controls.Add(this.dateFromComboBox);
this.Name = "Form1";
this.Text = "Results Browser";
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.ComboBox dateFromComboBox;
private System.Windows.Forms.Label label1;
private System.Windows.Forms.Label label2;
private System.Windows.Forms.ComboBox dateToComboBox;
private System.Windows.Forms.Label label3;
private System.Windows.Forms.ComboBox procedureComboBox;
private System.Windows.Forms.Button searchButton;
private System.Windows.Forms.TextBox resultsTextBox;
}
}
-19
View File
@@ -1,19 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace ResultsBrowser
{
public partial class MainWnd : Form
{
public MainWnd()
{
InitializeComponent();
}
}
}
-120
View File
@@ -1,120 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
-27
View File
@@ -1,27 +0,0 @@
using FluentNHibernate.Mapping;
using ResultsBrowser.Entities;
namespace ResultsBrowser.Mappings
{
class BenchPathMap : ClassMap<BenchPath>
{
public BenchPathMap()
{
Id(x => x.Id);
Map(x => x.ItemNr);
Map(x => x.Name);
Map(x => x.Qfrom);
Map(x => x.Qto);
Map(x => x.TempIn);
Map(x => x.TempOut);
Map(x => x.PressIn);
Map(x => x.PressOut);
Map(x => x.ValvesOpen)
.CustomType("StringClob")
.CustomSqlType("varchar(8000)");
Map(x => x.ValvesClose)
.CustomType("StringClob")
.CustomSqlType("varchar(8000)");
}
}
}
-25
View File
@@ -1,25 +0,0 @@
using FluentNHibernate.Mapping;
using ResultsBrowser.Entities;
namespace ResultsBrowser.Mappings
{
class ComponentMap : ClassMap<Component>
{
public ComponentMap()
{
Id(x => x.Id);
Map(x => x.Name);
Map(x => x.ClassName);
Map(x => x.ParentName);
Map(x => x.ItemNr);
Map(x => x.Mode);
Map(x => x.Logging);
Map(x => x.Parameters)
.CustomType("StringClob")
.CustomSqlType("varchar(8000)");
HasMany(x => x.Corrections)
.OrderBy("Measurement")
.Cascade.All();
}
}
}
@@ -1,19 +0,0 @@
using FluentNHibernate.Mapping;
using ResultsBrowser.Entities;
namespace ResultsBrowser.Mappings
{
class ComponentProcedureMap : ClassMap<ComponentProcedure>
{
public ComponentProcedureMap()
{
Id(x => x.Id);
Map(x => x.CmpntName);
Map(x => x.Parameters)
.CustomType("StringClob")
.CustomSqlType("varchar(8000)");
References(x => x.Procedure);
}
}
}
@@ -1,19 +0,0 @@
using FluentNHibernate.Mapping;
using ResultsBrowser.Entities;
namespace ResultsBrowser.Mappings
{
class ComponentTestMap : ClassMap<ComponentTest>
{
public ComponentTestMap()
{
Id(x => x.Id);
Map(x => x.CmpntName);
Map(x => x.Parameters)
.CustomType("StringClob")
.CustomSqlType("varchar(8000)");
References(x => x.Test);
}
}
}
-24
View File
@@ -1,24 +0,0 @@
using FluentNHibernate.Mapping;
using ResultsBrowser.Entities;
namespace ResultsBrowser.Mappings
{
class FeedingPathMap : ClassMap<FeedingPath>
{
public FeedingPathMap()
{
Id(x => x.Id);
Map(x => x.ItemNr);
Map(x => x.Name);
Map(x => x.Qfrom);
Map(x => x.Qto);
Map(x => x.Pump);
Map(x => x.ValvesOpen)
.CustomType("StringClob")
.CustomSqlType("varchar(8000)");
Map(x => x.ValvesClose)
.CustomType("StringClob")
.CustomSqlType("varchar(8000)");
}
}
}
-14
View File
@@ -1,14 +0,0 @@
using FluentNHibernate.Mapping;
namespace ResultsBrowser.Mappings
{
class GroupMap : ClassMap<Entities.Group>
{
public GroupMap()
{
Id(x => x.Id);
Map(x => x.Gid);
Map(x => x.Name);
}
}
}
@@ -1,15 +0,0 @@
using FluentNHibernate.Mapping;
using ResultsBrowser.Entities;
namespace ResultsBrowser.Mappings
{
class MeasurementCorrectionMap : ClassMap<MeasurementCorrection>
{
public MeasurementCorrectionMap()
{
Id(x => x.Id);
Map(x => x.Measurement);
Map(x => x.Correction);
}
}
}
@@ -1,24 +0,0 @@
using FluentNHibernate.Mapping;
using ResultsBrowser.Entities;
namespace ResultsBrowser.Mappings
{
class MeterTestResultMap : ClassMap<MeterTestResult>
{
public MeterTestResultMap()
{
Id(x => x.Id);
References(x => x.TestResult);
Map(x => x.SerialNr);
Map(x => x.EndState);
Map(x => x.VolumeStart);
Map(x => x.VolumeEnd);
Map(x => x.VolumeMeter);
Map(x => x.VolumeRef);
Map(x => x.VolumeErrorPct);
Map(x => x.PulsesMeter);
Map(x => x.PulsesMaster);
Map(x => x.Time);
}
}
}
-39
View File
@@ -1,39 +0,0 @@
using FluentNHibernate.Mapping;
using ResultsBrowser.Entities;
namespace ResultsBrowser.Mappings
{
class MetersPathMap : ClassMap<MetersPath>
{
public MetersPathMap()
{
Id(x => x.Id);
Map(x => x.ItemNr);
Map(x => x.Name);
Map(x => x.Qfrom);
Map(x => x.Qto);
Map(x => x.Sensor1);
#pragma warning disable
if (Program.WMsCount >= 2) Map(x => x.Sensor2);
if (Program.WMsCount >= 3) Map(x => x.Sensor3);
if (Program.WMsCount >= 4) Map(x => x.Sensor4);
if (Program.WMsCount >= 5) Map(x => x.Sensor5);
if (Program.WMsCount >= 6) Map(x => x.Sensor6);
if (Program.WMsCount >= 7) Map(x => x.Sensor7);
if (Program.WMsCount >= 8) Map(x => x.Sensor8);
if (Program.WMsCount >= 9) Map(x => x.Sensor9);
if (Program.WMsCount >= 10) Map(x => x.Sensor10);
if (Program.WMsCount >= 11) Map(x => x.Sensor11);
if (Program.WMsCount >= 12) Map(x => x.Sensor12);
if (Program.WMsCount >= 13) Map(x => x.Sensor13);
if (Program.WMsCount >= 14) Map(x => x.Sensor14);
if (Program.WMsCount >= 15) Map(x => x.Sensor15);
if (Program.WMsCount >= 16) Map(x => x.Sensor16);
if (Program.WMsCount >= 17) Map(x => x.Sensor17);
if (Program.WMsCount >= 18) Map(x => x.Sensor18);
if (Program.WMsCount >= 19) Map(x => x.Sensor19);
if (Program.WMsCount >= 20) Map(x => x.Sensor20);
#pragma warning restore
}
}
}
-31
View File
@@ -1,31 +0,0 @@
using FluentNHibernate.Mapping;
using ResultsBrowser.Entities;
namespace ResultsBrowser.Mappings
{
class OutputPathMap : ClassMap<OutputPath>
{
public OutputPathMap()
{
Id(x => x.Id);
Map(x => x.ItemNr);
Map(x => x.Name);
Map(x => x.Qfrom);
Map(x => x.Qto);
Map(x => x.RegulValve);
Map(x => x.FlowMeter);
Map(x => x.PidCoef);
Map(x => x.StartValve);
Map(x => x.Diverter);
Map(x => x.TempDiv);
Map(x => x.Balance);
Map(x => x.EmptyTankValve);
Map(x => x.ValvesOpen)
.CustomType("StringClob")
.CustomSqlType("varchar(8000)");
Map(x => x.ValvesClose)
.CustomType("StringClob")
.CustomSqlType("varchar(8000)");
}
}
}
-36
View File
@@ -1,36 +0,0 @@
using FluentNHibernate.Mapping;
using ResultsBrowser.Entities;
namespace ResultsBrowser.Mappings
{
class ProcedureMap : ClassMap<Procedure>
{
public ProcedureMap()
{
Id(x => x.Id);
Map(x => x.ItemNr);
Map(x => x.Name);
Map(x => x.MetersKind);
Map(x => x.Description);
Map(x => x.CreationUser);
Map(x => x.CreationTime);
Map(x => x.LastChgUser);
Map(x => x.LastChgTime);
Map(x => x.LongDescription);
Map(x => x.Watermeters);
Map(x => x.ProtocolTitle);
Map(x => x.DataEntry);
Map(x => x.ResultsPrinter);
Map(x => x.ResultsWriter);
Map(x => x.TransitionStart);
Map(x => x.TransitionEnd);
////Map(x => x.MetrologicalClass);
////HasOne(x => x.WMType);
HasMany(x => x.MoreParams)
.Cascade.All();
HasMany(x => x.Tests)
.OrderBy("ItemNr")
.Cascade.All();
}
}
}
-39
View File
@@ -1,39 +0,0 @@
using FluentNHibernate.Mapping;
using ResultsBrowser.Entities;
namespace ResultsBrowser.Mappings
{
class TestMap : ClassMap<Test>
{
public TestMap()
{
Id(x => x.Id);
Map(x => x.ItemNr);
Map(x => x.Name);
Map(x => x.Part);
Map(x => x.Qfrom);
Map(x => x.Qto);
Map(x => x.Volume);
Map(x => x.TstTime);
Map(x => x.Repeats);
Map(x => x.Emptying);
Map(x => x.Zeroing);
Map(x => x.PumpPower);
Map(x => x.Time2MassMsrmt);
Map(x => x.Method);
Map(x => x.ErrLimLo);
Map(x => x.ErrLimHi);
Map(x => x.TolerRed); /// ???
Map(x => x.RedType); /// ???
Map(x => x.FeedingPath);
Map(x => x.BenchPath);
Map(x => x.OutputPath);
Map(x => x.MetersPath);
Map(x => x.TransitionStart);
Map(x => x.TransitionEnd);
HasMany(x => x.MoreParams)
.Cascade.All();
References(x => x.Procedure);
}
}
}
-105
View File
@@ -1,105 +0,0 @@
using FluentNHibernate.Mapping;
using ResultsBrowser.Entities;
namespace ResultsBrowser.Mappings
{
class TestResultMap : ClassMap<TestResult>
{
public TestResultMap()
{
Id(x => x.Id);
Map(x => x.Name);
Map(x => x.BatchNr)
.Column("CycleNr");
Map(x => x.MetersKind);
HasMany(x => x.Meters)
.Cascade.All();
HasMany(x => x.CombinedMeters)
.Cascade.All();
Map(x => x.ProcedureName);
Map(x => x.ProtocolTitle);
Map(x => x.TestId);
Map(x => x.TestName);
Map(x => x.Part);
Map(x => x.Qfrom);
Map(x => x.Qto);
Map(x => x.Volume);
Map(x => x.TstTime);
Map(x => x.Repeats);
Map(x => x.Emptying);
Map(x => x.Zeroing);
Map(x => x.PumpPower);
Map(x => x.Time2MassMsrmt);
Map(x => x.Method);
Map(x => x.ErrLimLo);
Map(x => x.ErrLimHi);
Map(x => x.FeedingPath)
.CustomType("StringClob")
.CustomSqlType("varchar(4000)");
Map(x => x.BenchPath)
.CustomType("StringClob")
.CustomSqlType("varchar(4000)");
Map(x => x.OutputPath)
.CustomType("StringClob")
.CustomSqlType("varchar(4000)");
Map(x => x.MetersPath)
.CustomType("StringClob")
.CustomSqlType("varchar(4000)");
Map(x => x.TimeStart);
Map(x => x.TimeEnd);
Map(x => x.RepetitionNr);
Map(x => x.AmbientTempAve);
Map(x => x.AmbientPressAve);
Map(x => x.AmbientHumiAve);
Map(x => x.PressInAvrg);
Map(x => x.PressInStart);
Map(x => x.PressInEnd);
Map(x => x.PressOutAvrg);
Map(x => x.PressOutStart);
Map(x => x.PressOutEnd);
Map(x => x.TempInAvrg);
Map(x => x.TempInStart);
Map(x => x.TempInEnd);
Map(x => x.TempOutAvrg);
Map(x => x.TempOutStart);
Map(x => x.TempOutEnd);
Map(x => x.TempDivAvrg);
Map(x => x.TempDivStart);
Map(x => x.TempDivEnd);
Map(x => x.MassStartRaw);
Map(x => x.MassStart);
Map(x => x.MassEndRaw);
Map(x => x.MassEnd);
Map(x => x.MassDiff);
Map(x => x.DensityIn);
Map(x => x.DensityOut);
Map(x => x.DensityDiv);
Map(x => x.FlowMass); /// from conventional true value
Map(x => x.FlowVolume); /// from conventional true value
Map(x => x.VolumeCTV); /// volume conventional true value
Map(x => x.VolumeMaster); /// volume from the master flow meter
Map(x => x.Time); /// measurement time in seconds
Map(x => x.ErrorMaster);
Map(x => x.PulsesMaster);
Map(x => x.ConstMaster); /// Pulses per liter master flow meter
Map(x => x.QRise);
Map(x => x.QFall);
Map(x => x.TimeDivStart0);
Map(x => x.TimeDivStart1);
Map(x => x.TimeDivStart2);
Map(x => x.TimeDivStart3);
Map(x => x.TimeDivStart4);
Map(x => x.TimeDivStart5);
Map(x => x.TimeDivEnd0);
Map(x => x.TimeDivEnd1);
Map(x => x.TimeDivEnd2);
Map(x => x.TimeDivEnd3);
Map(x => x.TimeDivEnd4);
Map(x => x.TimeDivEnd5);
}
}
}
@@ -1,19 +0,0 @@
using FluentNHibernate.Mapping;
using ResultsBrowser.Entities;
namespace ResultsBrowser.Mappings
{
class TransitionSequenceMap : ClassMap<TransitionSequence>
{
public TransitionSequenceMap()
{
Id(x => x.Id);
Map(x => x.ItemNr);
Map(x => x.Name);
Map(x => x.Description);
HasMany(x => x.TransitionSteps)
.OrderBy("ItemNr")
.Cascade.All();
}
}
}
@@ -1,26 +0,0 @@
using FluentNHibernate.Mapping;
using ResultsBrowser.Entities;
namespace ResultsBrowser.Mappings
{
class TransitionStepMap : ClassMap<TransitionStep>
{
public TransitionStepMap()
{
Id(x => x.Id);
Map(x => x.ItemNr);
Map(x => x.Duration);
Map(x => x.Message);
Map(x => x.ValvesOpen)
.CustomType("StringClob")
.CustomSqlType("varchar(8000)");
Map(x => x.ValvesClose)
.CustomType("StringClob")
.CustomSqlType("varchar(8000)");
Map(x => x.RegulValvesPct);
Map(x => x.PumpWithFMPcts);
References(x => x.TransitionSequence);
}
}
}
-18
View File
@@ -1,18 +0,0 @@
using FluentNHibernate.Mapping;
namespace ResultsBrowser.Mappings
{
class UserMap : ClassMap<Entities.User>
{
public UserMap()
{
Id(x => x.Id);
Map(x => x.Name);
Map(x => x.Password);
Map(x => x.Description);
Map(x => x.LastPwChange);
HasMany(x => x.Groups)
.Cascade.All();
}
}
}
@@ -1,19 +0,0 @@
using FluentNHibernate.Mapping;
using ResultsBrowser.Entities;
namespace ResultsBrowser.Mappings
{
class VirtualBenchSequenceMap : ClassMap<VirtualBenchSequence>
{
public VirtualBenchSequenceMap()
{
Id(x => x.Id);
Map(x => x.ItemNr);
Map(x => x.Name);
Map(x => x.Description);
HasMany(x => x.VirtualBenchSteps)
.OrderBy("ItemNr")
.Cascade.All();
}
}
}
@@ -1,17 +0,0 @@
using FluentNHibernate.Mapping;
using ResultsBrowser.Entities;
namespace ResultsBrowser.Mappings
{
class VirtualBenchStepMap : ClassMap<VirtualBenchStep>
{
public VirtualBenchStepMap()
{
Id(x => x.Id);
Map(x => x.ItemNr);
Map(x => x.Duration);
References(x => x.VirtualBenchSequence);
}
}
}
-17
View File
@@ -1,17 +0,0 @@
using FluentNHibernate.Mapping;
namespace ResultsBrowser.Mappings
{
class WMTypeMap : ClassMap<Entities.WMType>
{
public WMTypeMap()
{
Id(x => x.Id);
Map(x => x.CreateTime);
Map(x => x.CreateUserName);
Map(x => x.CreateDescription);
Map(x => x.Name);
Map(x => x.PulseRate);
}
}
}
-16
View File
@@ -1,16 +0,0 @@
using FluentNHibernate.Mapping;
namespace ResultsBrowser.Mappings
{
class WatermeterMap : ClassMap<Entities.Watermeter>
{
public WatermeterMap()
{
Id(x => x.Id);
Map(x => x.Serial);
// HasOne(x => x.WMType)
// .Cascade.All();
References(x => x.WMType);
}
}
}
-276
View File
@@ -1,276 +0,0 @@
///
/// Copyright (c) 2013-2015 Sensus Metering Systems
///
using System;
using System.IO;
using System.Collections.Generic;
using System.Windows.Forms;
using log4net;
using ResultsBrowser.Forms;
using ResultsBrowser.Entities;
using NHibernate;
namespace ResultsBrowser
{
public class Program
{
public const string AdminUsername = "admin";
public const string AdminPassword = "staratura";
public const string HomeDir = "C:\\Tbf\\"; /// Contains subdirectories Results, Logs, Images, ...
/// log4net
static readonly ILog log = LogManager.GetLogger(typeof(Program));
const string log4netConfigFName = "log4netConfig.xml";
/// Local settings
public static LocalSettings LocalSettings = new LocalSettings();
public const string LocalSettingsFileName = "config.xml";
/// Database related: This object reference is set after a successful user login
public static DatabaseSettings CurrentBench;
const string SQLiteDbFName = "SQLite.db";
#if DN100 || MUNICH
public const int WMsCount = 3;
public const int LineSize = 3;
public const int CompoundWMsCount = 1;
#elif FUZHOU300 || FUZHOU150 || PT200IL
public const int WMsCount = 6;
public const int LineSize = 6;
public const int CompoundWMsCount = 3;
#elif TORINO50 || BADGER_MALA_TRAT
public const int WMsCount = 6;
public const int LineSize = 6;
public const int CompoundWMsCount = 1;
#elif TORUN_PT50_2015 || CEVAK_PT40_272 || MURES_PT40
public const int WMsCount = 20;
public const int LineSize = 10;
public const int CompoundWMsCount = 1;
#elif IPERLST
public const int WMsCount = 40;
public const int LineSize = 20;
public const int CompoundWMsCount = 1;
#endif
/// <summary>
/// Selected procedure data
/// - before the main program window is open, objects referenced by this variable
/// are loaded from the database.
/// - user interface displays data stored in objects referenced by this variable.
/// When user modifies procedure settings and confirms changes (choses to save them),
/// data referenced by this variable are updated and written to the database.
/// - when users starts a test procedure, state machine creates its own copy
/// of procedure data and uses them for the test. Changes of 'SelectedProcedure'
/// done during the test do not have any influence on the currently running test.
/// </summary>
public static Entities.Procedure SelectedProcedure = null;
/// <summary>
/// Main window object.
/// </summary>
public static MainWnd MainWnd;
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
log.Fatal("--------------------------------------------------------------------------------");
/// Local program configuration directory including the trailing backslash
string locAppDataDir = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) +
Path.DirectorySeparatorChar + "TestBenchFramework" + Path.DirectorySeparatorChar;
/// Check whether local application data directory exists.
/// If not, create it and copy the initial configuration to this directory.
/// This is done only once after a clean program installation on the first program start-up
try
{
if (!Directory.Exists(locAppDataDir))
{
Directory.CreateDirectory(locAppDataDir);
Environment.CurrentDirectory = locAppDataDir;
string sampleConfig = Application.StartupPath + Path.DirectorySeparatorChar + "SampleConfig" + Path.DirectorySeparatorChar;
if (File.Exists(sampleConfig + LocalSettingsFileName)) { File.Copy(sampleConfig + LocalSettingsFileName, LocalSettingsFileName); }
if (File.Exists(sampleConfig + log4netConfigFName)) { File.Copy(sampleConfig + log4netConfigFName, log4netConfigFName); }
if (File.Exists(sampleConfig + SQLiteDbFName)) { File.Copy(sampleConfig + SQLiteDbFName, SQLiteDbFName); }
File.SetAttributes(LocalSettingsFileName, FileAttributes.Normal);
File.SetAttributes(log4netConfigFName, FileAttributes.Normal);
File.SetAttributes(SQLiteDbFName, FileAttributes.Normal);
}
else
{
Environment.CurrentDirectory = locAppDataDir;
}
}
catch (Exception e)
{
log.Error("A problem when creating the local application data directory and preparing the initial configuration", e);
return;
}
/// Configue and start logging
log4net.Config.XmlConfigurator.Configure(new System.IO.FileInfo(locAppDataDir + log4netConfigFName));
log.Info("Entering application.");
/// Load the local settings
if (Program.LocalSettings == null) return; /// Fatal error
LocalSettings.Load();
System.Threading.Thread.CurrentThread.CurrentUICulture = new System.Globalization.CultureInfo(LocalSettings.Language);
/// This belongs to Application.Run(new MainWnd()) ...
/// and should be executed before opening 'loginDlg'
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
/// Ensure that there is at least one bench in the configuration
while (Program.LocalSettings.testBenches.GetLength(0) == 0)
{
log.Warn("No test benches in the local configuration -> display an appropriate dialog.");
/// Ask what to do, ask for the password, open 'DatabaseSetingsDlg' and continue on OK
if ((new Forms.NoBenchOrDatabaseDlg { Message = "No test bench in the program configuration." }.ShowDialog() != DialogResult.OK) ||
(new LoginDlg(true).ShowDialog() == DialogResult.Cancel) ||
(new BenchesDlg().ShowDialog() == DialogResult.Cancel))
{
return; /// Exit program
}
log.Warn("Loading the local settings again.");
LocalSettings.Load();
}
/// User login
bool retryLogin = true; /// true = stay in a login loop
do {
LoginDlgWithBenchSelection loginDlgBench;
if (LocalSettings.LastBenchName != null)
{
loginDlgBench = new LoginDlgWithBenchSelection(LocalSettings.LastBenchName);
}
else
{
loginDlgBench = new LoginDlgWithBenchSelection();
}
DialogResult dr = loginDlgBench.ShowDialog();
if (dr == DialogResult.Cancel)
{
return; /// Login canceled --> Exit application
}
else
{
for (int i = 0; i < LocalSettings.BenchesCount; i++)
{
if (LocalSettings.TestBenches[i].BenchName == loginDlgBench.BenchName)
{
Entities.User loadedUser = null;
try
{
bool authorized = false;
if (Entities.User.IsPowerUser(loginDlgBench.User, loginDlgBench.Password))
{
loadedUser = new Entities.User(loginDlgBench.User);
authorized = loadedUser.Authorize(loginDlgBench.User, loginDlgBench.Password);
}
if (!authorized)
{
/// Load user from the UsersAndGroupsDB database
loadedUser = Entities.User.LoadUserByName(loginDlgBench.User,
LocalSettings.TestBenches[i].UsersDBSettings);
if (loadedUser != null)
{
authorized = loadedUser.Authorize(loginDlgBench.User, loginDlgBench.Password);
}
}
if (authorized)
{
log.InfoFormat("Password accepted, bench '{0}' parameters loaded.", LocalSettings.TestBenches[i].BenchName);
/// Copy the selected bench settings to CurrentBench.
/// Clone() guarantees that current bench settings wont be modified
/// when user modifies the database settings in DatabaseSettingsDlg.
CurrentBench = (DatabaseSettings)LocalSettings.TestBenches[i].Clone();
/// Save the selection to local settings
LocalSettings.LastBenchName = CurrentBench.BenchName;
retryLogin = false;
break;
}
if (retryLogin)
{
/// Close Fluent NHibernate
MessageBox.Show("Invalid user, password, or bench", "Error", MessageBoxButtons.OK);
}
}
catch (Exception)
{
/// Database connect failed, ask what to do
switch ((new Forms.NoBenchOrDatabaseDlg { Message = "Cannot connect to the database.", ShowRetry = true }).ShowDialog())
{
case DialogResult.Abort: return; /// Exit program
case DialogResult.Retry: break; /// Retry the loop
default:
/// Open 'DatabaseSetingsDlg' and retry DB connect on OK
if (new LoginDlg(true).ShowDialog() == DialogResult.Cancel ||
new BenchesDlg().ShowDialog() == DialogResult.Cancel)
{
return; /// Exit program
}
LocalSettings.Load();
break; /// Retry the loop
}
}
} // if benchname is OK
} // for all benches in local settings loop
} // not Canceled
} //do
while (retryLogin);
///
/// Load the last procedure or create a new, default one
///
if (LocalSettings.LastProcedureName != null)
{
IList<Entities.Procedure> listOfProcedures = FluentCommon.CreateSession(Database.Procedures)
.CreateQuery("FROM Procedure WHERE Name = :procName")
.SetParameter("procName", LocalSettings.LastProcedureName)
.List<Entities.Procedure>();
if (listOfProcedures.Count == 1)
{
log.InfoFormat("Pre-selecting the procedure {0}", LocalSettings.LastProcedureName);
SelectedProcedure = listOfProcedures[0];
}
}
/// Open the main application window
log.Info("Creating the main window");
MainWnd = new MainWnd();
log.Info("Opening the main window");
Application.Run(MainWnd);
/// Save local settings
log.Info("The main window was closed, saving the local parameters");
LocalSettings.Save();
/// Close Fluent NHibernate
/// Todo
log.Info("Exiting application.");
}
}
}

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