From 5cc711e94694517c8366b2e81417311a3fe0ae6c Mon Sep 17 00:00:00 2001 From: Luc Date: Wed, 12 May 2021 16:31:01 +0200 Subject: [PATCH] layout --- EpdBase/EpdBase.cpp | 10 +-- SetupProject1/Product.wxs | 2 +- eDosStation/EntryBadge.xaml | 22 +++---- eDosStation/EntryBadge.xaml.cs | 50 +++++---------- eDosStation/EpdExit.xaml | 8 ++- eDosStation/EpdExit.xaml.cs | 27 +++----- eDosStation/InstMessage.xaml | 35 ++++++++--- eDosStation/InstMessage.xaml.cs | 27 ++++++-- eDosStation/MainWindow.xaml | 15 +++-- eDosStation/Properties/AssemblyInfo.cs | 4 +- eDosStation/Settings.xaml | 3 +- eDosStation/Settings.xaml.cs | 48 +++++++------- eDosStation/ShowEPDDose.xaml | 34 +++++----- eDosStation/ShowEPDDose.xaml.cs | 87 +++++++++++--------------- eDosStation/Station.cs | 6 +- 15 files changed, 188 insertions(+), 190 deletions(-) diff --git a/EpdBase/EpdBase.cpp b/EpdBase/EpdBase.cpp index 2204412..e8ccdff 100644 --- a/EpdBase/EpdBase.cpp +++ b/EpdBase/EpdBase.cpp @@ -35,16 +35,12 @@ 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)); - 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)); Sleep(300); DeinitComms(port); } else { SetRetryCounts(RxRetryCount, TxRetryCount); - //SetDiscoveryTimeslotCount(port, 2); SetDiscoveryTimeslotPeriod(port, DiscoveryTimeslotPeriod); SetDiscoveryExpirationPeriod(port, DiscoveryExpirationPeriod); } @@ -75,10 +71,7 @@ int EpdBase::Epd2U::StartDiscover( int EpdTimeout) Ev1 = CreateWaitableTimer(NULL, TRUE, NULL); LARGE_INTEGER wt; wt.QuadPart = Int32x32To64(maxDiscoverTime, -10000); //10 seconden proberen - //wt.QuadPart = -100000000LL; if (Ev1 != NULL) SetWaitableTimer(Ev1, &wt, 0, NULL, NULL, FALSE); - - int maxtries = 100; DeviceCount = 0; DiscRV = 1; DWORD wo = 1; // ongeveer 43 tries in 10 seconden int tries = 0; while (DeviceCount == 0 && wo != 0) //tries-- > 0 && @@ -88,7 +81,8 @@ int EpdBase::Epd2U::StartDiscover( int EpdTimeout) if (DiscRV == 0) { Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData); } - wo = WaitForSingleObject(Ev1, 0); + Sleep(100); + wo = WaitForSingleObject(Ev1,0); } CloseHandle(Ev1); Ev1 = INVALID_HANDLE_VALUE; diff --git a/SetupProject1/Product.wxs b/SetupProject1/Product.wxs index 7bd86a7..7e9b40e 100644 --- a/SetupProject1/Product.wxs +++ b/SetupProject1/Product.wxs @@ -3,7 +3,7 @@ - + diff --git a/eDosStation/EntryBadge.xaml b/eDosStation/EntryBadge.xaml index 0f4c323..83c8a85 100644 --- a/eDosStation/EntryBadge.xaml +++ b/eDosStation/EntryBadge.xaml @@ -1,20 +1,20 @@ - + WindowStartupLocation="CenterScreen" WindowState="Maximized" Closing="Window_Closing" + > - + @@ -23,9 +23,9 @@ - + - + @@ -48,11 +48,10 @@ - - + @@ -65,14 +64,13 @@ - - + diff --git a/eDosStation/EntryBadge.xaml.cs b/eDosStation/EntryBadge.xaml.cs index 2c633e0..cc2800d 100644 --- a/eDosStation/EntryBadge.xaml.cs +++ b/eDosStation/EntryBadge.xaml.cs @@ -1,9 +1,9 @@ - -using System; +using System; using System.Data; using System.Text; using System.Windows; using System.Windows.Controls; +using System.Windows.Documents; using System.Windows.Threading; namespace eDosStation @@ -70,7 +70,18 @@ namespace eDosStation statusEPD.Text = $"EPD: {ep.EpdID}"; if (ep.Issued) { - MessageBox.Show("EPD is currently issued\nPlease take an other", "EDP", MessageBoxButton.OK, MessageBoxImage.Hand, MessageBoxResult.OK, MessageBoxOptions.ServiceNotification); + TextBlock il = new TextBlock(); + il.Inlines.Add(new Run("This EPD is currently issued") { + FontSize = 36 + }); ; + il.Inlines.Add(new LineBreak()); + il.Inlines.Add(new Run("Please take an other.")); + il.HorizontalAlignment = HorizontalAlignment.Center; + il.TextAlignment = System.Windows.TextAlignment.Center; + (new InstMessage(il)).ShowDialog(); + + + //MessageBox.Show("EPD is currently issued\nPlease take an other", "EDP", MessageBoxButton.OK, MessageBoxImage.Hand, MessageBoxResult.OK, MessageBoxOptions.ServiceNotification); this.Close(); return false; } @@ -85,7 +96,7 @@ namespace eDosStation this.Close(); return false; } - bool isBG = (ep.epdType == 0); + bool isBG = ep.epdType == 0; if (isBG != CurTaskRow.EPDRad.Equals("BG")) { MessageBox.Show("Wrong EPD Type", "EDP", MessageBoxButton.OK, MessageBoxImage.Hand, MessageBoxResult.OK, MessageBoxOptions.ServiceNotification); @@ -155,8 +166,6 @@ namespace eDosStation dataInterface.VisitInitCommand.Parameters["EPD_InternalID"].Value = (int)ep.EpdID; dataInterface.VisitInitCommand.Parameters["isBG"].Value = isBG; dataInterface.VisitInitCommand.Parameters["ENTRY_EPD_CLOCK"].Value = ep.CountsClock; - - using (var l = new SqlLog()) try { @@ -194,7 +203,6 @@ namespace eDosStation ep.Hp10THDose1 = CurTaskRow.Hp10Dose1; ep.Hp10THDose2 = CurTaskRow.Hp10Dose2; ep.Hp07THDose = CurTaskRow.Hp07Dose; - int? kx = null; if (!CurTaskRow.IsFNGain_ANGainValueNull()) kx = (int)CurTaskRow.FNGain_ANGainValue; if (kx != null && (ep.K3 != kx || ep.K4 != kx)) @@ -233,7 +241,7 @@ namespace eDosStation int ok = ep.Connect(false,thisStation.EPDTimeOut); if (ok != 1) { - statusEPD.Text= $"GetEpd {ok} ConnectError: {ep.ConnectError}"; + statusEPD.Text= $"GetEpd {ok} Connect Error: {ep.ConnectError}"; } if (ep.DeviceCount == 1 && ep.b.CurrentDeviceID > 0) @@ -245,15 +253,7 @@ namespace eDosStation if (!EpdFound) { MessageBox.Show("EPD niet gevonden"); - this.Close(); endPage(); - //statusEPD.Text = $"EPD: Wait "; - //Search = 100; - //dispatcherTimer = new DispatcherTimer(); - //dispatcherTimer.Tick += DispatcherTimer_Tick; - //dispatcherTimer.Interval = new TimeSpan(0, 0, 2); - //dispatcherTimer.Start(); - //return; } } @@ -563,8 +563,6 @@ namespace eDosStation private void AddTestButtons() { - //pTestButtons - //