diff --git a/EpdBase3/Epd3Base.cpp b/EpdBase3/Epd3Base.cpp index f2d954f..4add79a 100644 --- a/EpdBase3/Epd3Base.cpp +++ b/EpdBase3/Epd3Base.cpp @@ -74,7 +74,9 @@ Epd3Base::Epd3U::Epd3U(int _comport) Hp10Peak = Hp07Peak = 0; Hp10Time = Hp07Time = 0; Hp10FTime = Hp07FTime = 0; + Hp07THDose = 0; Hp07RateOn = 0; Hp07RateOff = 0; + Hp07THDoseA = 0; Hp07RateAOn = 0; Hp07RateAOff = 0; Hp10THDose1 = 0; Hp10Rate1On = 0; Hp10Rate1Off = 0; Hp10THDose2 = 0; Hp10Rate2On = 0; Hp10Rate2Off = 0; @@ -233,7 +235,6 @@ BYTE checkStatus(FaultStatusFlags status, FaultStatusFlags flag) { if (((uint32_t)status & (uint32_t)flag) == (uint32_t)flag) return 1; else return 0; } - BYTE checkStatus(AlarmStatusFlags status, AlarmStatusFlags flag) { uint32_t ustatus = (uint32_t)status; @@ -566,7 +567,8 @@ void Epd3Base::Epd3U::decodeTreshold(Mk3AlarmThresholds_t* th) Hp07THDose = 0; Hp07RateOn = 0; Hp07RateOff = 0; pThDose = &Hp07THDose; pThRate = &Hp07RateOn; - pTHDoseWarning = pTHRateWarning = nullptr; + pTHDoseWarning = &Hp07THDoseA; + pTHRateWarning = &Hp07RateAOn; break; case MeasurementId::Meas_Hp10: Hp10THDose1 = 0; Hp10THDose2 = 0; @@ -592,15 +594,18 @@ void Epd3Base::Epd3U::encodeTreshold(Mk3AlarmThresholds_t* th) { //th.MeasId float* pThDose, * pThRate, * pTHDoseWarning, * pTHRateWarning; - + //Voorlopig + Hp07THDoseA = Hp07THDose * 0.8; + Hp07RateAOn = Hp07RateOn * 0.8; + // einde voorlopig th->NumberThresholds = 4; switch ((MeasurementId)th->MeasId) { case MeasurementId::Meas_Hp07: case MeasurementId::Meas_Hp10N: pThDose = &Hp07THDose; - pTHDoseWarning = &Hp07THDose; + pTHDoseWarning = &Hp07THDoseA; pThRate = &Hp07RateOn; - pTHRateWarning = &Hp07RateOff; + pTHRateWarning = &Hp07RateAOn; RatePct[0].MeasId = th->MeasId; RatePct[0].Value = 85; // (int)(Hp07RateOff * 100.0 / Hp07RateOn); break; @@ -615,9 +620,9 @@ void Epd3Base::Epd3U::encodeTreshold(Mk3AlarmThresholds_t* th) break; default: pThDose = &Hp07THDose; - pTHDoseWarning = &Hp07THDose; + pTHDoseWarning = &Hp07THDoseA; pThRate = &Hp07RateOn; - pTHRateWarning = &Hp07RateOff; + pTHRateWarning = &Hp07RateAOn; } th->Thresholds[0].Id = (uint16_t)ThresholdId::Thres_DoseAlarm; @@ -925,7 +930,7 @@ WORD Epd3Base::Epd3U::WriteAlarmTresholds() { if (isNeutron) measID = (uint8_t)MeasurementId::Meas_Hp10N; else measID = (uint8_t)MeasurementId::Meas_Hp07; hp07tresholds.MeasId = measID; encodeTreshold(&hp07tresholds); - hp07tresholds.NumberThresholds = 2; + hp07tresholds.NumberThresholds = 4; token = BeginWriteAlarmThresholds(epdComsHandle, (uint8_t)hp07tresholds.MeasId, (uint8_t)hp07tresholds.NumberThresholds, hp07tresholds.Thresholds, nullptr); r = Commit3(epdComsHandle); if (r != 0) @@ -934,7 +939,6 @@ WORD Epd3Base::Epd3U::WriteAlarmTresholds() { if (r != 0) goto error; - token = BeginWriteRateOffPercentage(epdComsHandle, RatePct, 2, nullptr); r = Commit3(epdComsHandle); if (r != 0) diff --git a/EpdBase3/Epd3Base.h b/EpdBase3/Epd3Base.h index 2263dc9..7cc6057 100644 --- a/EpdBase3/Epd3Base.h +++ b/EpdBase3/Epd3Base.h @@ -138,14 +138,17 @@ namespace Epd3Base { //AlarmDoseTreshold float Hp10THDose1; float Hp10THDose2; + float Hp07THDoseA; //Alarm float Hp07THDose; float Hp10Rate1On; float Hp10Rate2On; float Hp07RateOn; + float Hp07RateAOn; float Hp10Rate1Off; float Hp10Rate2Off; float Hp07RateOff; + float Hp07RateAOff; float K1; diff --git a/eDosPrep/eDosPrep.cpp b/eDosPrep/eDosPrep.cpp new file mode 100644 index 0000000..b2ad26f --- /dev/null +++ b/eDosPrep/eDosPrep.cpp @@ -0,0 +1,39 @@ +// eDosPrep.cpp : This file contains the 'main' function. Program execution begins and ends there. +// +#include +#include +#include + +#pragma comment(lib, "netapi32.lib") + +USER_INFO_1 ui; +DWORD parm_err; +const wchar_t *n = L"eDosStation"; +const wchar_t* p = L"HPHEdos123"; + +int CreateUser() +{ + memset(&ui, 0, sizeof(ui)); + ui.usri1_name = (LPWSTR)n; + ui.usri1_password = (LPWSTR)p; + ui.usri1_priv = USER_PRIV_USER; + ui.usri1_flags = UF_DONT_EXPIRE_PASSWD; + DWORD rv = NetUserAdd(NULL,1,(LPBYTE)&ui,&parm_err ); + return rv; +} +int main() +{ + CreateUser(); + std::cout << "Hello World!\n"; +} + +// Run program: Ctrl + F5 or Debug > Start Without Debugging menu +// Debug program: F5 or Debug > Start Debugging menu + +// Tips for Getting Started: +// 1. Use the Solution Explorer window to add/manage files +// 2. Use the Team Explorer window to connect to source control +// 3. Use the Output window to see build output and other messages +// 4. Use the Error List window to view errors +// 5. Go to Project > Add New Item to create new code files, or Project > Add Existing Item to add existing code files to the project +// 6. In the future, to open this project again, go to File > Open > Project and select the .sln file diff --git a/eDosPrep/eDosPrep.vcxproj b/eDosPrep/eDosPrep.vcxproj new file mode 100644 index 0000000..abd6eeb --- /dev/null +++ b/eDosPrep/eDosPrep.vcxproj @@ -0,0 +1,147 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {294068af-ea7b-4851-97b2-2ab5f64167d9} + eDosPrep + 10.0 + + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + Application + true + v142 + Unicode + + + Application + false + v142 + true + Unicode + + + + + + + + + + + + + + + + + + + + + true + + + false + + + true + + + false + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + \ No newline at end of file diff --git a/eDosPrep/eDosPrep.vcxproj.filters b/eDosPrep/eDosPrep.vcxproj.filters new file mode 100644 index 0000000..5db580e --- /dev/null +++ b/eDosPrep/eDosPrep.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Source Files + + + \ No newline at end of file diff --git a/eDosStation.sln b/eDosStation.sln index 12ab6b8..21966a8 100644 --- a/eDosStation.sln +++ b/eDosStation.sln @@ -29,6 +29,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestEPD3Dll", "TestEPD3Dll\ EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Epd3Base", "EpdBase3\EpdBase3.vcxproj", "{E6BB4F4E-4774-4FE3-B341-7F4C24DC61E7}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "eDosPrep", "eDosPrep\eDosPrep.vcxproj", "{294068AF-EA7B-4851-97B2-2AB5F64167D9}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -245,6 +247,20 @@ Global {E6BB4F4E-4774-4FE3-B341-7F4C24DC61E7}.Release|x64.Build.0 = Release|x64 {E6BB4F4E-4774-4FE3-B341-7F4C24DC61E7}.Release|x86.ActiveCfg = Release|Win32 {E6BB4F4E-4774-4FE3-B341-7F4C24DC61E7}.Release|x86.Build.0 = Release|Win32 + {294068AF-EA7B-4851-97B2-2AB5F64167D9}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {294068AF-EA7B-4851-97B2-2AB5F64167D9}.Debug|ARM.ActiveCfg = Debug|Win32 + {294068AF-EA7B-4851-97B2-2AB5F64167D9}.Debug|ARM64.ActiveCfg = Debug|Win32 + {294068AF-EA7B-4851-97B2-2AB5F64167D9}.Debug|x64.ActiveCfg = Debug|x64 + {294068AF-EA7B-4851-97B2-2AB5F64167D9}.Debug|x64.Build.0 = Debug|x64 + {294068AF-EA7B-4851-97B2-2AB5F64167D9}.Debug|x86.ActiveCfg = Debug|Win32 + {294068AF-EA7B-4851-97B2-2AB5F64167D9}.Debug|x86.Build.0 = Debug|Win32 + {294068AF-EA7B-4851-97B2-2AB5F64167D9}.Release|Any CPU.ActiveCfg = Release|Win32 + {294068AF-EA7B-4851-97B2-2AB5F64167D9}.Release|ARM.ActiveCfg = Release|Win32 + {294068AF-EA7B-4851-97B2-2AB5F64167D9}.Release|ARM64.ActiveCfg = Release|Win32 + {294068AF-EA7B-4851-97B2-2AB5F64167D9}.Release|x64.ActiveCfg = Release|x64 + {294068AF-EA7B-4851-97B2-2AB5F64167D9}.Release|x64.Build.0 = Release|x64 + {294068AF-EA7B-4851-97B2-2AB5F64167D9}.Release|x86.ActiveCfg = Release|Win32 + {294068AF-EA7B-4851-97B2-2AB5F64167D9}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/eDosStation/DataInterface.cs b/eDosStation/DataInterface.cs index 690b796..3f7bef3 100644 --- a/eDosStation/DataInterface.cs +++ b/eDosStation/DataInterface.cs @@ -357,7 +357,7 @@ namespace eDosStation u.VisitIDLocked = 0; u.ReasonNoAccess = "Not found"; u.UserComment = ""; - u.AllOk = !CheckUser || (u.AccessAllow == true & u.VisitIDLocked == 0); + u.AllOk = !CheckUser || (u.AccessAllow == true && u.VisitIDLocked == 0); } rs.Close(); } diff --git a/eDosStation/EntryBadge.xaml.cs b/eDosStation/EntryBadge.xaml.cs index 22b913a..c3672b7 100644 --- a/eDosStation/EntryBadge.xaml.cs +++ b/eDosStation/EntryBadge.xaml.cs @@ -24,17 +24,9 @@ namespace eDosStation private System.Threading.Tasks.Task ReaderTask = null; private DataInterface dataInterface; public LSWDesfirePublic.CCard dfReader = null; - //System.Threading.Thread t; - //bool nextCSN = false; - //bool nextSite = false; - //bool nextCode = false; - //bool nextFinish = false; - //string csn, site, code; static User _User; - DataSet1.GetTaskInfoRow CurTaskRow; private DateTime ResultTime; - enum eCOE { quiz = 1 }; #if SimulateEPD @@ -415,15 +407,16 @@ namespace eDosStation else boxComment.Visibility = Visibility.Hidden; - if (!string.IsNullOrWhiteSpace(ReasonNoAccess)) UserAccess.Text = ReasonNoAccess; - else UserAccess.Text = "Welcome to eDOS"; + if (!string.IsNullOrWhiteSpace(ReasonNoAccess)) + UserAccess.Text = ReasonNoAccess; + else + //UserAccess.Text = "Welcome to eDOS"; Username.Text = string.Concat(_User.FirstName, " ", _User.LastName); pUserSeconds.Maximum = UserSeconds; pUserSeconds.Value = UserSeconds; tReasonNoAccess.Text = ReasonNoAccess; dispatcherTimer = new DispatcherTimer(DispatcherPriority.Background); dispatcherTimer.Interval = TimeSpan.FromSeconds(1); dispatcherTimer.Tick += SwitchToTask; - dispatcherTimer.Start(); } return doCancel; @@ -440,7 +433,7 @@ namespace eDosStation { dispatcherTimer.Stop(); dispatcherTimer.Tick -= SwitchToTask; - if (_User.AccessAllow == true) + if (_User.AllOk == true) AskTask(); else Close(); } @@ -602,7 +595,7 @@ namespace eDosStation { dispatcherTimer.Stop(); dispatcherTimer.Tick -= SwitchToTask; - if (_User.AccessAllow == true) + if (_User.AllOk == true) AskTask(); else Close(); }