diff --git a/EpdBase3/Epd3Base.cpp b/EpdBase3/Epd3Base.cpp index 02f768a..4d4c40e 100644 --- a/EpdBase3/Epd3Base.cpp +++ b/EpdBase3/Epd3Base.cpp @@ -41,15 +41,56 @@ Epd3Base::Epd3U::Epd3U(int _comport) isBG = isNG = VersionOK = 0; Error = 123; current = this; + + DeviceCount = 0; + BaseCountsClock = 0; + CurrentDeviceID = 0; + countsRead = 0; utc = 0; seconds = 0; + memset(WearerID, 0, WearerIDLength + 1); + memset(WearerName, 0, WearerNameLength + 1); + Error = 0; + EpdID = 4567; + EpdType = EpdTypes::Mk2BetaGamma; + isBG = 1; isNG = 0; VersionOK = 1; + isMK3 = true; + FunctionFlags = 0x000; + Epd.Gen = EpdGeneration::None; + Epd.MaxBaud = 0; + Epd.Id = EpdID; + + OperatingStatus = (OpStatusFlags)0U; + AlarmStatus = (AlarmStatusFlags)0U; + ErrorStatus = (FaultStatusFlags)0; + IssueCount = OtherAlarms = EEPROMBadSectors = 0; + RealTime = EpdClock = OffTime = EpdID = 0; + ErrorSource = ErrorReason = ErrorData = 0; + HardVersion = SoftVersion = FunctionFlags = 0; + + K1 = K2 = K3 = K4 = K4 = K6 = 0.0F; + HG = SG = BC = FB = 0; + D1 = D2 = D3 = D4 = 0; + Hp10Total = Hp07Total = 0; + Hp10Dose = Hp07Dose = 0; + Hp10Peak = Hp07Peak = 0; + Hp10Time = Hp07Time = 0; + Hp10FTime = Hp07FTime = 0; + Hp07THDose = 0; Hp07RateOn = 0; Hp07RateOff = 0; + Hp10THDose1 = 0; Hp10Rate1On = 0; Hp10Rate1Off = 0; + Hp10THDose2 = 0; Hp10Rate2On = 0; Hp10Rate2Off = 0; + + if (_comport == 0) return; if (hCompletion == 0) hCompletion = CreateEvent(NULL, TRUE, FALSE, NULL); - if (hWaitTimer == 0) hWaitTimer = CreateEvent(NULL, TRUE, FALSE, NULL); + //if (hWaitTimer == 0) hWaitTimer = CreateEvent(NULL, TRUE, FALSE, NULL); + + } Epd3Base::Epd3U::~Epd3U() { EndCom(); if (hCompletion != 0) { CloseHandle(hCompletion); hCompletion = 0; } + //if (hWaitTimer != 0) { CloseHandle(hWaitTimer); hWaitTimer = 0; } } DWORD Epd3Base::Epd3U::StartCom() @@ -504,6 +545,7 @@ void Epd3Base::Epd3U::decodeCounters(int count) } void Epd3Base::Epd3U::decodeBaseCounters(int count) { + D1 = D2 = D3 = D4 = 0; for (int ix = 0; ix < count; ix++) { switch ((CounterType)Counts[ix].type) { diff --git a/EpdBase3/Epd3Base.h b/EpdBase3/Epd3Base.h index 496c8d2..2263dc9 100644 --- a/EpdBase3/Epd3Base.h +++ b/EpdBase3/Epd3Base.h @@ -37,7 +37,7 @@ namespace Epd3Base { int32_t Dll3RV; UINT16 EndSessionControl; public: - HANDLE hWaitTimer = 0; + //HANDLE hWaitTimer = 0; HANDLE hCompletion = 0; @@ -60,7 +60,7 @@ namespace Epd3Base { BYTE EPDFaulty = 0; - //ERrrostatus + //ErrorStatus BYTE EPDNewFault = 0; BYTE EPDComFault = 0; BYTE EPDCalFault = 0;