From 43ab98dfe46b06c592124c89bf5ee189abc61ed5 Mon Sep 17 00:00:00 2001 From: Luc Vandenbroucke Date: Thu, 8 Oct 2020 13:48:36 +0200 Subject: [PATCH] 8 oktober, voor afwerking --- EpdBase/EpdBase.cpp | 26 ++--- EpdBase/EpdBase.vcxproj | 10 +- EpdBase/TimeFunctions.cpp | 1 + EpdBaseClr/EpdBaseClr.cpp | 4 - EpdBaseClr/EpdBaseClr.vcxproj | 10 +- OkReadBadge/OkReadBadge.h | 4 +- OkReadBadge/OkReadBadge.vcxproj | 10 +- TestDirect/TestDirect.vcxproj | 10 +- TestEdosBase/TestEdosBase.vcxproj | 10 +- eDosStation/EntryBadge.xaml | 14 ++- eDosStation/EntryBadge.xaml.cs | 19 ++- eDosStation/EpdExit.xaml | 16 +-- eDosStation/EpdExit.xaml.cs | 15 ++- eDosStation/LocalRemote.cs | 187 +++++++++++++++++++++--------- eDosStation/MainWindow.xaml.cs | 1 + eDosStation/User.cs | 55 +-------- 16 files changed, 211 insertions(+), 181 deletions(-) diff --git a/EpdBase/EpdBase.cpp b/EpdBase/EpdBase.cpp index ae9fb5e..2d15ec0 100644 --- a/EpdBase/EpdBase.cpp +++ b/EpdBase/EpdBase.cpp @@ -6,7 +6,7 @@ #define RxRetryCount 5 #define TxRetryCount 5 - +#pragma unmanaged EpdBase::Epd2U::Epd2U(int comport) { port = comport; @@ -30,11 +30,11 @@ DWORD EpdBase::Epd2U::StartCom() if (CommsInitialized==0) do { InitRv = InitComms(port, 9600, 8, 0, 0); - System::Diagnostics::Trace::WriteLine(System::String::Format("InitCOms RV={0} Port={1}", InitRv, port)); + //System::Diagnostics::Trace::WriteLine(System::String::Format("InitCOms RV={0} Port={1}", InitRv, port)); if (InitRv == 0) { rv= GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData); - System::Diagnostics::Trace::WriteLine(System::String::Format("InitCOms ErrorReason={0} ErrorData={1} Port={2}", ErrorReason, ErrorData, port)); + //System::Diagnostics::Trace::WriteLine(System::String::Format("InitCOms ErrorReason={0} ErrorData={1} Port={2}", ErrorReason, ErrorData, port)); Sleep(300); DeinitComms(port); } else { @@ -58,7 +58,7 @@ EpdBase::Epd2U::~Epd2U() int EpdBase::Epd2U::StartDiscover() { WORD rv; - System::Diagnostics::Trace::WriteLine("StartDiscover"); + //System::Diagnostics::Trace::WriteLine("StartDiscover"); Error = 0; //SetDiscoveryTimeslotCount(port, 2); @@ -75,13 +75,13 @@ int EpdBase::Epd2U::StartDiscover() { //memset(DeviceIDs, 0, sizeof(DeviceIDs)); DiscRV = Discover(port, DeviceIDs, MaxDevices, &DeviceCount); - System::Diagnostics::Trace::WriteLine(System::String::Format("Discover try: {0} RV={1}", tries, DiscRV)); + //System::Diagnostics::Trace::WriteLine(System::String::Format("Discover try: {0} RV={1}", tries, DiscRV)); if (DiscRV ==0 ) { Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData); - System::Diagnostics::Trace::WriteLine(System::String::Format("StartDiscover Error Connect Reason: {0} ErrorData {1}", ErrorReason, ErrorData)); + //System::Diagnostics::Trace::WriteLine(System::String::Format("StartDiscover Error Connect Reason: {0} ErrorData {1}", ErrorReason, ErrorData)); } } - System::Diagnostics::Trace::WriteLine(System::String::Format("Discover DeviceCount = {0}", DeviceCount)); + //System::Diagnostics::Trace::WriteLine(System::String::Format("Discover DeviceCount = {0}", DeviceCount)); return DiscRV; } @@ -379,16 +379,14 @@ WORD EpdBase::Epd2U::PrepareForIssue() WORD EpdBase::Epd2U::DeIssue() { ClearDoseRV = ClearTotalDoseRV = ClearPeakRatesRV = DeIssueEpdRV = 0; - - CommitRV = ClearFailFlag(); - if (CommitRV) CommitRV = ClearFaultFlags(); - if (CommitRV) CommitRV = ClearLatchedAlarms(); - if (CommitRV) CommitRV = Commit(); - if (CommitRV) CommitRV = ClearDose(); if (CommitRV) CommitRV = ClearTotalDose(); if (CommitRV) CommitRV = ClearPeakRates(); - + if (CommitRV) CommitRV = Commit(); + if (CommitRV) CommitRV = ClearFaultFlags(); + if (CommitRV) CommitRV = ClearLatchedAlarms();//Hp10Rate1; Hp10Rate2; Hp07Rate; ReturnForRead + if (CommitRV) CommitRV = Commit(); + CommitRV = ClearFailFlag(); if (CommitRV) CommitRV = DeIssueEpd(); if (CommitRV) CommitRV = Commit(); if (CommitRV && DetectorsOn) { diff --git a/EpdBase/EpdBase.vcxproj b/EpdBase/EpdBase.vcxproj index 033330a..c346332 100644 --- a/EpdBase/EpdBase.vcxproj +++ b/EpdBase/EpdBase.vcxproj @@ -24,34 +24,34 @@ v4.7.2 ManagedCProj EpdBase - 10.0.17763.0 + 10.0 StaticLibrary true - v141 + v142 true Unicode StaticLibrary false - v141 + v142 true Unicode StaticLibrary true - v141 + v142 true Unicode StaticLibrary false - v141 + v142 true Unicode diff --git a/EpdBase/TimeFunctions.cpp b/EpdBase/TimeFunctions.cpp index b31212f..0ca6217 100644 --- a/EpdBase/TimeFunctions.cpp +++ b/EpdBase/TimeFunctions.cpp @@ -1,6 +1,7 @@ #include "stdafx.h" #include "TimeFunctions.h" +#pragma unmanaged TimeFunctions::TimeFunctions() { diff --git a/EpdBaseClr/EpdBaseClr.cpp b/EpdBaseClr/EpdBaseClr.cpp index 4f1dad5..89f18d4 100644 --- a/EpdBaseClr/EpdBaseClr.cpp +++ b/EpdBaseClr/EpdBaseClr.cpp @@ -103,10 +103,6 @@ int EpdBaseClr::Epd2::GetStatus() errorStatus = epd->ErrorStatus; operatingStatus = epd->OperatingStatus; - - - - EpdID = epd->EpdID; HardVersion = epd->HardVersion; SoftVersion = epd->SoftVersion; diff --git a/EpdBaseClr/EpdBaseClr.vcxproj b/EpdBaseClr/EpdBaseClr.vcxproj index 0db116d..533a29a 100644 --- a/EpdBaseClr/EpdBaseClr.vcxproj +++ b/EpdBaseClr/EpdBaseClr.vcxproj @@ -24,34 +24,34 @@ v4.7.2 ManagedCProj EpdBaseClr - 10.0.17763.0 + 10.0 DynamicLibrary true - v141 + v142 true Unicode DynamicLibrary false - v141 + v142 true Unicode DynamicLibrary true - v141 + v142 true Unicode DynamicLibrary false - v141 + v142 true Unicode diff --git a/OkReadBadge/OkReadBadge.h b/OkReadBadge/OkReadBadge.h index 34ed36f..3eaf36b 100644 --- a/OkReadBadge/OkReadBadge.h +++ b/OkReadBadge/OkReadBadge.h @@ -11,8 +11,7 @@ namespace OkReadBadge { - - public class BadgeUnmanaged + public class BadgeUnmanaged { private: @@ -35,7 +34,6 @@ namespace OkReadBadge char CSN[50]; char Site[20]; char Badge[20]; - int parse(char *rall) { diff --git a/OkReadBadge/OkReadBadge.vcxproj b/OkReadBadge/OkReadBadge.vcxproj index f81c810..dded5c1 100644 --- a/OkReadBadge/OkReadBadge.vcxproj +++ b/OkReadBadge/OkReadBadge.vcxproj @@ -23,35 +23,35 @@ {F98F3496-8A4C-4BDB-9F17-C7AF47A60739} ManagedCProj OkReadBadge - 10.0.16299.0 + 10.0 4.7.2 DynamicLibrary true - v141 + v142 true Unicode DynamicLibrary false - v141 + v142 true Unicode DynamicLibrary true - v141 + v142 true Unicode DynamicLibrary false - v141 + v142 true Unicode diff --git a/TestDirect/TestDirect.vcxproj b/TestDirect/TestDirect.vcxproj index 42f82d9..c9e3646 100644 --- a/TestDirect/TestDirect.vcxproj +++ b/TestDirect/TestDirect.vcxproj @@ -23,32 +23,32 @@ {3655B312-F7C2-4825-BD5F-E087F6AF2D90} Win32Proj TestDirect - 10.0.16299.0 + 10.0 Application true - v141 + v142 Unicode Application false - v141 + v142 true Unicode Application true - v141 + v142 Unicode Application false - v141 + v142 true Unicode diff --git a/TestEdosBase/TestEdosBase.vcxproj b/TestEdosBase/TestEdosBase.vcxproj index fac2a13..668084a 100644 --- a/TestEdosBase/TestEdosBase.vcxproj +++ b/TestEdosBase/TestEdosBase.vcxproj @@ -23,32 +23,32 @@ {7B3DD1C5-D8D0-408C-A272-FF5E4A30DF24} Win32Proj TestEdosBase - 10.0.16299.0 + 10.0 Application true - v141 + v142 Unicode Application false - v141 + v142 true Unicode Application true - v141 + v142 Unicode Application false - v141 + v142 true Unicode diff --git a/eDosStation/EntryBadge.xaml b/eDosStation/EntryBadge.xaml index 8039e48..646afa3 100644 --- a/eDosStation/EntryBadge.xaml +++ b/eDosStation/EntryBadge.xaml @@ -20,11 +20,17 @@ - + - - - + + + Welcome to eDOS + + Entry Process is ready + + Please scan your badge on the badge reader + + diff --git a/eDosStation/EntryBadge.xaml.cs b/eDosStation/EntryBadge.xaml.cs index 0144c6c..55635bd 100644 --- a/eDosStation/EntryBadge.xaml.cs +++ b/eDosStation/EntryBadge.xaml.cs @@ -41,7 +41,6 @@ namespace eDosStation string csn, site, code; static User _User; - DataSet1.CommentOnEventDataTable dtCOE; DataSet1.GetTaskInfoRow CurTaskRow; enum eCOE { quiz=1} ; private bool StopReadBadge=true; @@ -258,7 +257,7 @@ namespace eDosStation public string getCommentUnknown() { StringBuilder res = new StringBuilder(); - DataSet1.CommentOnEventRow r = dtCOE.FindByID_CommnentOnEvent(3); + var r = LocalRemote.GetCommentOnEventRow(3); res.AppendLine(r.Comment_NL).Replace("\\n", "\n"); res.AppendLine("---"); res.AppendLine(r.Comment_FR).Replace("\\n", "\n"); @@ -272,7 +271,7 @@ namespace eDosStation { string res=string.Empty; if (!string.IsNullOrWhiteSpace(prefix)) res = prefix + "\n"; - DataSet1.CommentOnEventRow r = dtCOE.FindByID_CommnentOnEvent(id); + var r = LocalRemote.GetCommentOnEventRow(id); string l = _User?.Language ?? "E"; if (r!=null) @@ -351,17 +350,14 @@ namespace eDosStation { Naam.Text = _User.FirstName + " " + _User.LastName; eDosStation.DataSet1 dataSet1 = ((eDosStation.DataSet1)(this.FindResource("dataSet1"))); - using (var dataSet1GetTaskInfoTableAdapter = new eDosStation.DataSet1TableAdapters.GetTaskInfoTableAdapter()) - { - dataSet1GetTaskInfoTableAdapter.Fill(dataSet1.GetTaskInfo, null, _User.Margin); - } + LocalRemote.FillTaskInfo(_User, dataSet1); tbTask.IsSelected = true; bool isAlara = (cbAlara.IsChecked == true); SetFilter(isAlara); } void CheckBadge() { - _User = new User(CSN.Text, Code.Text); + _User = LocalRemote.GetUser(CSN.Text, Code.Text); ShowUserInfo(); //AskTask(); } public void showBadge() @@ -516,7 +512,7 @@ namespace eDosStation private void BTestPerson_Click(object sender, RoutedEventArgs e) { Button b = sender as Button; - _User = new User("TP"+b.Tag, ""); + _User = LocalRemote.GetUser("TP"+b.Tag.ToString().ToUpper(), ""); ShowUserInfo(); //AskTask(); } @@ -573,6 +569,7 @@ namespace eDosStation } private void Window_Loaded(object sender, RoutedEventArgs e) { + LocalRemote.checkCon(); EpdFound = false; initialising = true; tbEntry.IsSelected = true; @@ -590,7 +587,7 @@ namespace eDosStation cbInst2.IsChecked = Inst2; } - LocalRemote.FillComment(dtCOE); + LocalRemote.FillComment(); string TestCSN = thisStation.TestCSN; initialising = false; @@ -606,7 +603,7 @@ namespace eDosStation else { ////Debug - _User = new User(TestCSN, string.Empty); + _User = LocalRemote.GetUser(TestCSN, string.Empty); if (_User.Error > 0) { MessageBox.Show(_User.ErrorMessage, "DB Error", MessageBoxButton.OK, MessageBoxImage.Exclamation); diff --git a/eDosStation/EpdExit.xaml b/eDosStation/EpdExit.xaml index eb28d50..d7396ac 100644 --- a/eDosStation/EpdExit.xaml +++ b/eDosStation/EpdExit.xaml @@ -45,14 +45,15 @@ - - + + Your dose and/or doserate has been above the alarmlevel during your visit ! - Please contact the Radioprotection officer of the building.> + Please contact the Radioprotection officer of the building. + He needs to validate and clear your alarm(s). @@ -65,11 +66,12 @@ - Your EPD has encounterd a problem. + Your EPD has encountered a problem. + + Please contactthe Radioprotection officer of the building. - Please contact the Radioprotection officer of the building. - - He needs to investigate it’. + + He needs to investigate the alarm.