aanpassingen
This commit is contained in:
parent
4b89e19073
commit
9d4c4993d0
12 changed files with 530 additions and 376 deletions
|
|
@ -1,237 +1,241 @@
|
|||
#include "stdafx.h"
|
||||
#include "EpdBase.h"
|
||||
|
||||
EpdBase::Epd2U::Epd2U(int comport)
|
||||
{
|
||||
port = comport;
|
||||
SetAutoCommit(0);
|
||||
Error = 123;
|
||||
//SetTimeouts(port, 20, 1000, 1000);
|
||||
//SetDiscoveryExpirationPeriod(port, 5000);
|
||||
InitRv= InitComms(port, 9600, 8, 0, 0);
|
||||
if (InitRv == 0) Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
|
||||
}
|
||||
|
||||
EpdBase::Epd2U::~Epd2U()
|
||||
{
|
||||
DeinitComms(port);
|
||||
SetAutoCommit(0);
|
||||
}
|
||||
|
||||
|
||||
void EpdBase::Epd2U::StartDiscover()
|
||||
{
|
||||
FlushDiscoveryCache(port);
|
||||
DiscRV= Discover(port, DeviceIDs, MaxDevices, &DeviceCount);
|
||||
if (DiscRV == 1 && DeviceCount == 0) {
|
||||
OnRV = EpdOn();
|
||||
Commit();
|
||||
Sleep(1100);
|
||||
DiscRV = Discover(port, DeviceIDs, MaxDevices, &DeviceCount);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void EpdBase::Epd2U::Open(DWORD DeviceID)
|
||||
{
|
||||
CurrentDeviceID = DeviceID;
|
||||
ConRV = Connect(DeviceID);
|
||||
if (ConRV == 0) Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
|
||||
else {
|
||||
OpenRV = OpenDevice(port, CurrentDeviceID);
|
||||
if (OpenRV == 0) Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
|
||||
}
|
||||
}
|
||||
|
||||
void EpdBase::Epd2U::Close()
|
||||
{
|
||||
CloseDevice();
|
||||
}
|
||||
|
||||
void EpdBase::Epd2U::DecodeFunctionFlags()
|
||||
{
|
||||
EpdType = (FunctionFlags & 0x0300) >> 8;
|
||||
}
|
||||
|
||||
void EpdBase::Epd2U::DecodeStatus()
|
||||
{
|
||||
DetectorsOn = (OperatingStatus & 1) != 0;
|
||||
EPDIssued = (OperatingStatus & 4) != 0;
|
||||
EPDLocked = (OperatingStatus & 0x10)!=0;
|
||||
EPDTesting = (OperatingStatus & 0x20) != 0;
|
||||
EPDProcSec = (OperatingStatus & 0x40) != 0;
|
||||
EPDFaulty = (OperatingStatus & 0x80) != 0;
|
||||
|
||||
EPDNewFault = (ErrorStatus & 1) != 0;
|
||||
EPDComFault = (ErrorStatus & 2) != 0;
|
||||
EPDCalFault = (ErrorStatus & 4) != 0;
|
||||
EPDDetFault = (ErrorStatus & 8) != 0;
|
||||
EPDEprFault = (ErrorStatus & 0x10) != 0;
|
||||
EPDTrhFault = (ErrorStatus & 0x20) != 0;
|
||||
EPDOthFault = (ErrorStatus & 0x80) != 0;
|
||||
|
||||
AlarmDoseHP101G = (AlarmStatus & 1) != 0;
|
||||
AlarmDoseHP102G = (AlarmStatus & 2) != 0;
|
||||
AlarmDoseHP07N = (AlarmStatus & 4) != 0;
|
||||
AlarmRateHP101G = (AlarmStatus & 8) != 0;;
|
||||
AlarmRateHP102G = (AlarmStatus & 0x10) != 0;
|
||||
AlarmRateHP07N = (AlarmStatus & 0x20) != 0;
|
||||
|
||||
//OtherAlarm
|
||||
OtherAlarmRateHp101G = (OtherAlarms & 1) != 0;
|
||||
OtherAlarmRateHp102G = (OtherAlarms & 2) != 0;
|
||||
OtherAlarmRateHp07N = (OtherAlarms & 4) != 0;
|
||||
OtherAlarmReturn = (OtherAlarms & 8) != 0;
|
||||
OtherAlarmBatLow = (OtherAlarms & 0x10) != 0;
|
||||
OtherAlarmCarrier = (OtherAlarms & 0x20) != 0;
|
||||
OtherAlarmBatVolt = (OtherAlarms & 0x40) != 0;
|
||||
|
||||
}
|
||||
|
||||
WORD EpdBase::Epd2U::ReadStatus()
|
||||
{
|
||||
memset(WearerID, 0, WearerIDLength+1);
|
||||
memset(WearerName, 0, WearerNameLength+1);
|
||||
|
||||
EpdClock = RealTime = IssueCount = OffTime = OperatingStatus = ErrorStatus = AlarmStatus = OtherAlarms = EEPROMBadSectors = 0;
|
||||
ErrorSource = ErrorReason = ErrorData = 0;
|
||||
|
||||
ReadStatusRV= ReadEpdStatus(&EpdClock, &RealTime, &IssueCount, &OffTime, &OperatingStatus, &ErrorStatus, &AlarmStatus, &OtherAlarms, &EEPROMBadSectors);
|
||||
if (ReadStatusRV == 0) {
|
||||
Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
|
||||
return ErrorReason;
|
||||
}
|
||||
|
||||
EpdID = HardVersion = SoftVersion = FunctionFlags = 0;
|
||||
ReadEpdIDRV = ReadEpdID(
|
||||
&EpdID,
|
||||
&HardVersion,
|
||||
&SoftVersion,
|
||||
&FunctionFlags);
|
||||
if (ReadEpdIDRV == 0) {
|
||||
Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
|
||||
return ErrorReason;
|
||||
}
|
||||
|
||||
CommitRV = Commit();
|
||||
if(CommitRV == 0) {
|
||||
Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
|
||||
return ErrorReason;
|
||||
}
|
||||
else {
|
||||
time_t t = RealTime;
|
||||
TimeFunctions::UnixTimeToSystemTime(t, &tRealTime);
|
||||
DecodeStatus();
|
||||
DecodeFunctionFlags();
|
||||
}
|
||||
|
||||
if (ReadStatusRV == 1 && EPDIssued == 1) {
|
||||
ReadWearerRV = 3;
|
||||
ReadWearerRV = ReadWearer(
|
||||
WearerID,
|
||||
WearerIDLength,
|
||||
WearerName,
|
||||
WearerNameLength);
|
||||
CommitRV = Commit();
|
||||
if (CommitRV == 0) {
|
||||
Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
|
||||
return ErrorReason;
|
||||
}
|
||||
}
|
||||
else
|
||||
ReadWearerRV = 4;
|
||||
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
WORD EpdBase::Epd2U::EPDReadConfig()
|
||||
{
|
||||
ReadConfigRV = ReadConfig(
|
||||
&CountDownTime,
|
||||
&ReturnTime,
|
||||
&ChirpRate,
|
||||
&TeleBaudSetting,
|
||||
&SelfTestInterval,
|
||||
&BatteryLoadTestInt,
|
||||
&GeneralControl,
|
||||
&CommsTimeout,
|
||||
&InhibitTimeout,
|
||||
&MinTxInterval,
|
||||
&MaxTxIntervals,
|
||||
&RandomiseWindow,
|
||||
&DoseIncThresh);
|
||||
if (ReadConfigRV == 0) Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
|
||||
CommitRV = Commit();
|
||||
if (CommitRV == 0) Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
|
||||
return CommitRV;
|
||||
}
|
||||
|
||||
WORD EpdBase::Epd2U::TurnOff()
|
||||
{
|
||||
OffRV = EpdOff();
|
||||
if (OffRV == 0) Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
|
||||
EndSessionRV = EndSession(AlarmCtrl,10);
|
||||
if (EndSessionRV == 0) Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
|
||||
|
||||
else {
|
||||
CommitRV = Commit();
|
||||
if (CommitRV == 0) Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
|
||||
}
|
||||
return CommitRV;
|
||||
}
|
||||
|
||||
WORD EpdBase::Epd2U::TurnOn()
|
||||
{
|
||||
|
||||
//OnRV = EpdOn();
|
||||
//if (OnRV == 0) Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
|
||||
|
||||
EndSessionRV = EndSession(AlarmCtrl, 10);
|
||||
if (EndSessionRV == 0) {
|
||||
Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
CommitRV = Commit();
|
||||
if (CommitRV == 0) Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);*/
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
WORD EpdBase::Epd2U::ReadTresHolds()
|
||||
{
|
||||
ReadDoseTresholdRV = ReadAlarmDoseThresholds(&Hp10THDose1, &Hp10THDose2, &Hp07THDose);
|
||||
ReadAlarmRateThresholdsRV = ReadAlarmRateThresholds(
|
||||
&Hp10Rate1On,
|
||||
&Hp10Rate2On,
|
||||
&Hp07RateOn,
|
||||
&Hp10Rate1Off,
|
||||
&Hp10Rate2Off,
|
||||
&Hp07RateOff);
|
||||
ReadCalibrationDataRV = ReadCalibrationData(
|
||||
&K1,
|
||||
&K2,
|
||||
&K3,
|
||||
&K4,
|
||||
&K5,
|
||||
&K6,
|
||||
&SG,
|
||||
&BC,
|
||||
&FB,
|
||||
&HG);
|
||||
CommitRV = Commit();
|
||||
if (CommitRV == 0) Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
|
||||
return CommitRV;
|
||||
}
|
||||
|
||||
WORD EpdBase::Epd2U::ReadDoses()
|
||||
{
|
||||
|
||||
ReadDosesQualityRV = ReadPeaksRV = CommitRV = 0;
|
||||
#include "stdafx.h"
|
||||
#include "EpdBase.h"
|
||||
|
||||
EpdBase::Epd2U::Epd2U(int comport)
|
||||
{
|
||||
port = comport;
|
||||
SetAutoCommit(0);
|
||||
Error = 123;
|
||||
//SetTimeouts(port, 20, 1000, 1000);
|
||||
//SetDiscoveryExpirationPeriod(port, 5000);
|
||||
InitRv= InitComms(port, 9600, 8, 0, 0);
|
||||
if (InitRv == 0) Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
|
||||
}
|
||||
|
||||
EpdBase::Epd2U::~Epd2U()
|
||||
{
|
||||
DeinitComms(port);
|
||||
SetAutoCommit(0);
|
||||
}
|
||||
|
||||
|
||||
void EpdBase::Epd2U::StartDiscover()
|
||||
{
|
||||
FlushDiscoveryCache(port);
|
||||
DiscRV= Discover(port, DeviceIDs, MaxDevices, &DeviceCount);
|
||||
if (DiscRV == 1 && DeviceCount == 0) {
|
||||
OnRV = EpdOn();
|
||||
Commit();
|
||||
Sleep(1100);
|
||||
DiscRV = Discover(port, DeviceIDs, MaxDevices, &DeviceCount);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void EpdBase::Epd2U::Open(DWORD DeviceID)
|
||||
{
|
||||
CurrentDeviceID = DeviceID;
|
||||
ConRV = Connect(DeviceID);
|
||||
if (ConRV == 0) Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
|
||||
else {
|
||||
OpenRV = OpenDevice(port, CurrentDeviceID);
|
||||
if (OpenRV == 0) Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
|
||||
}
|
||||
}
|
||||
|
||||
void EpdBase::Epd2U::Close()
|
||||
{
|
||||
CloseDevice();
|
||||
DeinitComms(port);
|
||||
}
|
||||
|
||||
void EpdBase::Epd2U::DecodeFunctionFlags()
|
||||
{
|
||||
EpdType = (FunctionFlags & 0x0300) >> 8;
|
||||
}
|
||||
|
||||
void EpdBase::Epd2U::DecodeStatus()
|
||||
{
|
||||
DetectorsOn = (OperatingStatus & 1) != 0;
|
||||
EPDIssued = (OperatingStatus & 4) != 0;
|
||||
EPDLocked = (OperatingStatus & 0x10)!=0;
|
||||
EPDTesting = (OperatingStatus & 0x20) != 0;
|
||||
EPDProcSec = (OperatingStatus & 0x40) != 0;
|
||||
EPDFaulty = (OperatingStatus & 0x80) != 0;
|
||||
|
||||
EPDNewFault = (ErrorStatus & 1) != 0;
|
||||
EPDComFault = (ErrorStatus & 2) != 0;
|
||||
EPDCalFault = (ErrorStatus & 4) != 0;
|
||||
EPDDetFault = (ErrorStatus & 8) != 0;
|
||||
EPDEprFault = (ErrorStatus & 0x10) != 0;
|
||||
EPDTrhFault = (ErrorStatus & 0x20) != 0;
|
||||
EPDOthFault = (ErrorStatus & 0x80) != 0;
|
||||
|
||||
AlarmDoseHP101G = (AlarmStatus & 1) != 0;
|
||||
AlarmDoseHP102G = (AlarmStatus & 2) != 0;
|
||||
AlarmDoseHP07N = (AlarmStatus & 4) != 0;
|
||||
AlarmRateHP101G = (AlarmStatus & 8) != 0;;
|
||||
AlarmRateHP102G = (AlarmStatus & 0x10) != 0;
|
||||
AlarmRateHP07N = (AlarmStatus & 0x20) != 0;
|
||||
|
||||
//OtherAlarm
|
||||
OtherAlarmRateHp101G = (OtherAlarms & 1) != 0;
|
||||
OtherAlarmRateHp102G = (OtherAlarms & 2) != 0;
|
||||
OtherAlarmRateHp07N = (OtherAlarms & 4) != 0;
|
||||
OtherAlarmReturn = (OtherAlarms & 8) != 0;
|
||||
OtherAlarmBatLow = (OtherAlarms & 0x10) != 0;
|
||||
OtherAlarmCarrier = (OtherAlarms & 0x20) != 0;
|
||||
OtherAlarmBatVolt = (OtherAlarms & 0x40) != 0;
|
||||
|
||||
}
|
||||
|
||||
WORD EpdBase::Epd2U::ReadStatus()
|
||||
{
|
||||
memset(WearerID, 0, WearerIDLength+1);
|
||||
memset(WearerName, 0, WearerNameLength+1);
|
||||
|
||||
EpdClock = RealTime = IssueCount = OffTime = OperatingStatus = ErrorStatus = AlarmStatus = OtherAlarms = EEPROMBadSectors = 0;
|
||||
ErrorSource = ErrorReason = ErrorData = 0;
|
||||
|
||||
ReadStatusRV= ReadEpdStatus(&EpdClock, &RealTime, &IssueCount, &OffTime, &OperatingStatus, &ErrorStatus, &AlarmStatus, &OtherAlarms, &EEPROMBadSectors);
|
||||
if (ReadStatusRV == 0) {
|
||||
Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
|
||||
return ErrorReason;
|
||||
}
|
||||
|
||||
EpdID = HardVersion = SoftVersion = FunctionFlags = 0;
|
||||
ReadEpdIDRV = ReadEpdID(
|
||||
&EpdID,
|
||||
&HardVersion,
|
||||
&SoftVersion,
|
||||
&FunctionFlags);
|
||||
if (ReadEpdIDRV == 0) {
|
||||
Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
|
||||
return ErrorReason;
|
||||
}
|
||||
|
||||
CommitRV = Commit();
|
||||
if(CommitRV == 0) {
|
||||
Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
|
||||
return ErrorReason;
|
||||
}
|
||||
else {
|
||||
time_t t = RealTime;
|
||||
TimeFunctions::UnixTimeToSystemTime(t, &tRealTime);
|
||||
DecodeStatus();
|
||||
DecodeFunctionFlags();
|
||||
}
|
||||
|
||||
if (ReadStatusRV == 1 && EPDIssued == 1) {
|
||||
ReadWearerRV = 3;
|
||||
ReadWearerRV = ReadWearer(
|
||||
WearerID,
|
||||
WearerIDLength,
|
||||
WearerName,
|
||||
WearerNameLength);
|
||||
CommitRV = Commit();
|
||||
if (CommitRV == 0) {
|
||||
Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
|
||||
return ErrorReason;
|
||||
}
|
||||
}
|
||||
else
|
||||
ReadWearerRV = 4;
|
||||
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
WORD EpdBase::Epd2U::EPDReadConfig()
|
||||
{
|
||||
ReadConfigRV = ReadConfig(
|
||||
&CountDownTime,
|
||||
&ReturnTime,
|
||||
&ChirpRate,
|
||||
&TeleBaudSetting,
|
||||
&SelfTestInterval,
|
||||
&BatteryLoadTestInt,
|
||||
&GeneralControl,
|
||||
&CommsTimeout,
|
||||
&InhibitTimeout,
|
||||
&MinTxInterval,
|
||||
&MaxTxIntervals,
|
||||
&RandomiseWindow,
|
||||
&DoseIncThresh);
|
||||
if (ReadConfigRV == 0) Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
|
||||
CommitRV = Commit();
|
||||
if (CommitRV == 0) Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
|
||||
return CommitRV;
|
||||
}
|
||||
|
||||
WORD EpdBase::Epd2U::TurnOff()
|
||||
{
|
||||
OffRV = EpdOff();
|
||||
if (OffRV == 0) Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
|
||||
EndSessionRV = EndSession(AlarmCtrl,10);
|
||||
if (EndSessionRV == 0) Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
|
||||
|
||||
else {
|
||||
CommitRV = Commit();
|
||||
if (CommitRV == 0) Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
|
||||
}
|
||||
return CommitRV;
|
||||
}
|
||||
|
||||
WORD EpdBase::Epd2U::TurnOn()
|
||||
{
|
||||
|
||||
//OnRV = EpdOn();
|
||||
//if (OnRV == 0) Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
|
||||
|
||||
EndSessionRV = EndSession(AlarmCtrl, 10);
|
||||
if (EndSessionRV == 0) {
|
||||
Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
CommitRV = Commit();
|
||||
if (CommitRV == 0) Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);*/
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
WORD EpdBase::Epd2U::ReadTresHolds()
|
||||
{
|
||||
Hp10THDose1 = Hp10THDose2 = Hp07THDose = 0;
|
||||
ReadDoseTresholdRV = ReadAlarmDoseThresholds(&Hp10THDose1, &Hp10THDose2, &Hp07THDose);
|
||||
CommitRV = Commit();
|
||||
if (CommitRV == 0) Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
|
||||
ReadAlarmRateThresholdsRV = ReadAlarmRateThresholds(
|
||||
&Hp10Rate1On,
|
||||
&Hp10Rate2On,
|
||||
&Hp07RateOn,
|
||||
&Hp10Rate1Off,
|
||||
&Hp10Rate2Off,
|
||||
&Hp07RateOff);
|
||||
ReadCalibrationDataRV = ReadCalibrationData(
|
||||
&K1,
|
||||
&K2,
|
||||
&K3,
|
||||
&K4,
|
||||
&K5,
|
||||
&K6,
|
||||
&SG,
|
||||
&BC,
|
||||
&FB,
|
||||
&HG);
|
||||
CommitRV = Commit();
|
||||
if (CommitRV == 0) Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
|
||||
return CommitRV;
|
||||
}
|
||||
|
||||
WORD EpdBase::Epd2U::ReadDoses()
|
||||
{
|
||||
|
||||
ReadDosesQualityRV = ReadPeaksRV = CommitRV = 0;
|
||||
ReadDosesQualityRV = ReadDosesQuality(
|
||||
&Hp10Dose,
|
||||
&Hp07Dose,
|
||||
|
|
@ -239,94 +243,94 @@ WORD EpdBase::Epd2U::ReadDoses()
|
|||
&Hp07Total,
|
||||
&Knocks,
|
||||
&Resets,
|
||||
&QualityData);
|
||||
|
||||
if (ReadDosesQualityRV == 0) {
|
||||
Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
&QualityData);
|
||||
|
||||
if (ReadDosesQualityRV == 0) {
|
||||
Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
ReadPeaksRV = ReadPeaks(
|
||||
&Hp10Peak,
|
||||
&Hp07Peak,
|
||||
&Hp10Time,
|
||||
&Hp07Time);
|
||||
if (ReadPeaksRV == 0) {
|
||||
Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
|
||||
return 0;
|
||||
}
|
||||
|
||||
CommitRV = Commit();
|
||||
if (CommitRV == 0) Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
|
||||
return CommitRV;
|
||||
}
|
||||
|
||||
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 = DeIssueEpd();
|
||||
if (CommitRV) CommitRV = Commit();
|
||||
if (CommitRV && DetectorsOn) {
|
||||
CommitRV = EpdOff();
|
||||
CommitRV= Commit();
|
||||
Sleep(1000);// Versie < .. Commit & Sleep
|
||||
}
|
||||
|
||||
if (CommitRV) { EndSession(0x16, 12); Commit(); }// Continuous high tone for 1.2 seconds
|
||||
else
|
||||
{
|
||||
FlushBuffers();
|
||||
Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData); EndSession(0x5E, 40); return 0;
|
||||
}
|
||||
|
||||
return CommitRV;
|
||||
|
||||
}
|
||||
|
||||
|
||||
WORD EpdBase::Epd2U::Issue()
|
||||
{
|
||||
IssueEpdRV = WriteAlarmDoseThresholdsRV = WriteAlarmRateThresholdsRV = WriteWearerNameRV = OnRV = CommitRV = 0;
|
||||
|
||||
|
||||
DWORD OKRV = SetFailFlag(); // all actions have been completed
|
||||
if (OKRV) OKRV = Commit();
|
||||
|
||||
if (OKRV) OKRV = WriteAlarmDoseThresholds(Hp10THDose1, Hp10THDose2, Hp07THDose);
|
||||
if (OKRV) OKRV = WriteAlarmRateThresholds(Hp10Rate1On, Hp10Rate2On, Hp07RateOn, Hp10Rate1Off, Hp10Rate2Off, Hp07RateOff);
|
||||
if (OKRV) OKRV = Commit();
|
||||
if (OKRV) OKRV = IssueEpd(WearerID, WearerIDLength);
|
||||
if (OKRV) OKRV = Commit();
|
||||
|
||||
if (OKRV) OKRV = WriteWearerName(WearerName,WearerNameLength);
|
||||
if (OKRV) OKRV = ClearFailFlag(); // all actions have been completed
|
||||
if (OKRV) OKRV = Commit();
|
||||
|
||||
if (!DetectorsOn) {
|
||||
OKRV = EpdOn(); OKRV=Commit(); Sleep(1000);
|
||||
}
|
||||
|
||||
if (OKRV) {
|
||||
EndSession(0x16, 12);
|
||||
Commit();
|
||||
} // Continuous high tone for 1.2 seconds
|
||||
else
|
||||
{
|
||||
FlushBuffers();
|
||||
Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData); EndSession(0x5E, 40);
|
||||
}
|
||||
|
||||
|
||||
return OKRV;
|
||||
&Hp10Time,
|
||||
&Hp07Time);
|
||||
if (ReadPeaksRV == 0) {
|
||||
Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
|
||||
return 0;
|
||||
}
|
||||
|
||||
CommitRV = Commit();
|
||||
if (CommitRV == 0) Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData);
|
||||
return CommitRV;
|
||||
}
|
||||
|
||||
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 = DeIssueEpd();
|
||||
if (CommitRV) CommitRV = Commit();
|
||||
if (CommitRV && DetectorsOn) {
|
||||
CommitRV = EpdOff();
|
||||
CommitRV= Commit();
|
||||
Sleep(1000);// Versie < .. Commit & Sleep
|
||||
}
|
||||
|
||||
if (CommitRV) { EndSession(0x16, 12); Commit(); }// Continuous high tone for 1.2 seconds
|
||||
else
|
||||
{
|
||||
FlushBuffers(port);
|
||||
Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData); EndSession(0x5E, 40); return 0;
|
||||
}
|
||||
|
||||
return CommitRV;
|
||||
|
||||
}
|
||||
|
||||
|
||||
WORD EpdBase::Epd2U::Issue()
|
||||
{
|
||||
IssueEpdRV = WriteAlarmDoseThresholdsRV = WriteAlarmRateThresholdsRV = WriteWearerNameRV = OnRV = CommitRV = 0;
|
||||
|
||||
|
||||
DWORD OKRV = SetFailFlag(); // all actions have been completed
|
||||
if (OKRV) OKRV = Commit();
|
||||
|
||||
if (OKRV) OKRV = WriteAlarmDoseThresholds(Hp10THDose1, Hp10THDose2, Hp07THDose);
|
||||
if (OKRV) OKRV = WriteAlarmRateThresholds(Hp10Rate1On, Hp10Rate2On, Hp07RateOn, Hp10Rate1Off, Hp10Rate2Off, Hp07RateOff);
|
||||
if (OKRV) OKRV = Commit();
|
||||
if (OKRV) OKRV = IssueEpd(WearerID, WearerIDLength);
|
||||
if (OKRV) OKRV = Commit();
|
||||
|
||||
if (OKRV) OKRV = WriteWearerName(WearerName,WearerNameLength);
|
||||
if (OKRV) OKRV = ClearFailFlag(); // all actions have been completed
|
||||
if (OKRV) OKRV = Commit();
|
||||
|
||||
if (!DetectorsOn) {
|
||||
OKRV = EpdOn(); OKRV=Commit(); Sleep(1000);
|
||||
}
|
||||
|
||||
if (OKRV) {
|
||||
EndSession(0x16, 12);
|
||||
Commit();
|
||||
} // Continuous high tone for 1.2 seconds
|
||||
else
|
||||
{
|
||||
FlushBuffers(port);
|
||||
Error = GetErrorDetails(&ErrorSource, &ErrorReason, &ErrorData); EndSession(0x5E, 40);
|
||||
}
|
||||
|
||||
|
||||
return OKRV;
|
||||
}
|
||||
|
|
@ -10,6 +10,16 @@ EpdBaseClr::Epd2::Epd2(int port)
|
|||
|
||||
}
|
||||
|
||||
EpdBaseClr::Epd2::~Epd2()
|
||||
{
|
||||
delete b;
|
||||
this->!Epd2();
|
||||
}
|
||||
|
||||
EpdBaseClr::Epd2::!Epd2()
|
||||
{
|
||||
}
|
||||
|
||||
int EpdBaseClr::Epd2::Connect()
|
||||
{
|
||||
b->CurrentDeviceID = 0;
|
||||
|
|
@ -19,6 +29,16 @@ int EpdBaseClr::Epd2::Connect()
|
|||
return DiscRV;
|
||||
}
|
||||
|
||||
int EpdBaseClr::Epd2::Close()
|
||||
{
|
||||
b->CurrentDeviceID = 0;
|
||||
epd->Close();
|
||||
delete epd;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int EpdBaseClr::Epd2::GetStatus()
|
||||
{
|
||||
//ReadStatus
|
||||
|
|
@ -29,6 +49,16 @@ int EpdBaseClr::Epd2::GetStatus()
|
|||
WearerID = gcnew String((char *)epd->WearerID);
|
||||
WearerName = gcnew String((char *)epd->WearerName);
|
||||
isOn = (epd->DetectorsOn != 0);
|
||||
epdType = epd->EpdType;
|
||||
alarmStatus = epd->AlarmStatus;
|
||||
otherAlarms = epd->OtherAlarms;
|
||||
errorStatus = epd->ErrorStatus;
|
||||
operatingStatus = epd->OperatingStatus;
|
||||
|
||||
EpdID = epd->EpdID;
|
||||
HardVersion = epd->HardVersion;
|
||||
SoftVersion = epd->SoftVersion;
|
||||
FunctionFlags = epd->FunctionFlags;
|
||||
|
||||
return StatusRV;
|
||||
}
|
||||
|
|
@ -36,19 +66,22 @@ int EpdBaseClr::Epd2::GetStatus()
|
|||
int EpdBaseClr::Epd2::GetDoses()
|
||||
{
|
||||
Hp10 = Hp07 = 0.0;
|
||||
ReadDosesRV = epd->ReadDoses();
|
||||
|
||||
if (ReadDosesRV == 1) {
|
||||
Hp10 = (double)epd->Hp10Dose / 64.0;
|
||||
Hp07 = (double)epd->Hp07Dose / 64.0;
|
||||
Hp07Peak = (double)epd->Hp07Peak / 64.0;
|
||||
Hp10Peak = (double)epd->Hp10Peak / 64.0;
|
||||
}
|
||||
|
||||
//epd->SoftVersion
|
||||
return ReadDosesRV;
|
||||
}
|
||||
|
||||
ReadDosesRV = epd->ReadDoses();
|
||||
|
||||
if (ReadDosesRV == 1) {
|
||||
Hp10 = (double)epd->Hp10Dose / 64.0;
|
||||
Hp07 = (double)epd->Hp07Dose / 64.0;
|
||||
Hp07Peak = (double)epd->Hp07Peak / 64.0;
|
||||
Hp10Peak = (double)epd->Hp10Peak / 64.0;
|
||||
}
|
||||
|
||||
Hp10PeakTime = System::DateTime::Now.AddSeconds(-(epd->Hp10Time - epd->EpdClock));
|
||||
Hp07PeakTime = System::DateTime::Now.AddSeconds(-(epd->Hp07Time - epd->EpdClock));
|
||||
|
||||
|
||||
return ReadDosesRV;
|
||||
}
|
||||
|
||||
int EpdBaseClr::Epd2::SetDeIssued()
|
||||
{
|
||||
return epd->DeIssue();
|
||||
|
|
@ -56,8 +89,9 @@ int EpdBaseClr::Epd2::SetDeIssued()
|
|||
|
||||
int EpdBaseClr::Epd2::SetIssued()
|
||||
{
|
||||
epd->AlarmDoseHP07N = alarmHP07;
|
||||
epd->AlarmDoseHP101G = alarmHP10;
|
||||
epd->AlarmDoseHP07N = Hp07THDose;
|
||||
epd->AlarmDoseHP101G = Hp10THDose1;
|
||||
epd->AlarmDoseHP102G = Hp10THDose1;
|
||||
|
||||
memset(epd->WearerID, ' ', WearerIDLength); epd->WearerID[WearerIDLength] = 0;
|
||||
char* str1 = (char*)(void *)Runtime::InteropServices::Marshal::StringToHGlobalAnsi(WearerID);
|
||||
|
|
@ -66,7 +100,6 @@ int EpdBaseClr::Epd2::SetIssued()
|
|||
_memccpy( epd->WearerID+WearerIDLength-l, str1, l, WearerIDLength);
|
||||
Runtime::InteropServices::Marshal::FreeHGlobal((IntPtr)str1);
|
||||
|
||||
|
||||
memset(epd->WearerName, 0, WearerNameLength + 1);
|
||||
char* str2 = (char*)(void*)Runtime::InteropServices::Marshal::StringToHGlobalAnsi(WearerName);
|
||||
_memccpy(epd->WearerName, str2, strlen(str2), WearerNameLength);
|
||||
|
|
@ -74,5 +107,34 @@ int EpdBaseClr::Epd2::SetIssued()
|
|||
|
||||
|
||||
epd->Issue();
|
||||
return 0;
|
||||
}
|
||||
|
||||
int EpdBaseClr::Epd2::ReadTresholds()
|
||||
{
|
||||
epd->ReadTresHolds();
|
||||
|
||||
Hp10THDose1 = (double)epd->Hp10THDose1 / 64.0;
|
||||
Hp10THDose2 = (double)epd->Hp10THDose2 / 64.0;
|
||||
Hp07THDose = (double)epd->Hp07THDose / 64.0;
|
||||
|
||||
Hp10Rate1On = (double)epd->Hp10Rate1On;
|
||||
Hp10Rate2On = (double)epd->Hp10Rate2On ;
|
||||
Hp07RateOn = (double)epd->Hp07RateOn ;
|
||||
Hp10Rate1Off = (double)epd->Hp10Rate1Off ;
|
||||
Hp10Rate2Off = (double)epd->Hp10Rate2Off ;
|
||||
Hp07RateOff = (double)epd->Hp07RateOff ;
|
||||
|
||||
K1 = epd->K1;
|
||||
K2 = epd->K2;
|
||||
K3 = epd->K3;
|
||||
K4 = epd->K4;
|
||||
K5 = epd->K5;
|
||||
K6 = epd->K6;
|
||||
SG = epd->SG;
|
||||
BC = epd->BC;
|
||||
FB = epd->FB;
|
||||
HG = epd->HG;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
@ -5,11 +5,11 @@ using namespace System;
|
|||
|
||||
namespace EpdBaseClr {
|
||||
|
||||
public ref class sEpdBase
|
||||
{
|
||||
public :
|
||||
DateTime^ RealTime;
|
||||
unsigned int CurrentDeviceID;
|
||||
public ref class sEpdBase
|
||||
{
|
||||
public :
|
||||
DateTime^ RealTime;
|
||||
unsigned int CurrentDeviceID;
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -36,16 +36,58 @@ namespace EpdBaseClr {
|
|||
double Hp10;
|
||||
double Hp07Peak;
|
||||
double Hp10Peak;
|
||||
System::DateTime Hp10PeakTime;
|
||||
System::DateTime Hp07PeakTime;
|
||||
|
||||
|
||||
double alarmHP07;
|
||||
double alarmHP10;
|
||||
|
||||
|
||||
double Hp10THDose1;
|
||||
double Hp10THDose2;
|
||||
double Hp07THDose;
|
||||
|
||||
double Hp10Rate1On;
|
||||
double Hp10Rate2On;
|
||||
double Hp07RateOn;
|
||||
double Hp10Rate1Off;
|
||||
double Hp10Rate2Off;
|
||||
double Hp07RateOff;
|
||||
|
||||
int K1;
|
||||
int K2;
|
||||
int K3;
|
||||
int K4;
|
||||
int K5;
|
||||
int K6;
|
||||
int SG;
|
||||
int BC;
|
||||
int FB;
|
||||
int HG;
|
||||
|
||||
|
||||
|
||||
|
||||
int epdType;
|
||||
int alarmStatus ;
|
||||
int otherAlarms ;
|
||||
int errorStatus ;
|
||||
int operatingStatus ;
|
||||
unsigned int EpdID ;
|
||||
int HardVersion ;
|
||||
int SoftVersion ;
|
||||
int FunctionFlags ;
|
||||
|
||||
|
||||
Epd2(int port);
|
||||
~Epd2();
|
||||
!Epd2();
|
||||
|
||||
int Connect();
|
||||
|
||||
int Close();
|
||||
|
||||
int GetStatus();
|
||||
|
||||
int GetDoses();
|
||||
|
|
@ -54,6 +96,8 @@ namespace EpdBaseClr {
|
|||
|
||||
int SetIssued();
|
||||
|
||||
int ReadTresholds();
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
|
|
|||
|
|
@ -1,6 +1,18 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<sectionGroup name="userSettings" type="System.Configuration.UserSettingsGroup, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" >
|
||||
<section name="eDosStation.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" allowExeDefinition="MachineToLocalUser" requirePermission="false" />
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
<startup>
|
||||
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.7.2" />
|
||||
</startup>
|
||||
<userSettings>
|
||||
<eDosStation.Properties.Settings>
|
||||
<setting name="comport" serializeAs="String">
|
||||
<value>6</value>
|
||||
</setting>
|
||||
</eDosStation.Properties.Settings>
|
||||
</userSettings>
|
||||
</configuration>
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:eDosStation"
|
||||
mc:Ignorable="d"
|
||||
Title="Entry" Height="450" Width="800" Loaded="Window_Loaded">
|
||||
Title="Entry" Height="450" Width="800" Loaded="Window_Loaded" Unloaded="Window_Unloaded">
|
||||
<DockPanel>
|
||||
<StatusBar DockPanel.Dock="Bottom" >
|
||||
<StatusBarItem Name="statusEPD" Content="Epd" />
|
||||
|
|
@ -34,12 +34,15 @@
|
|||
<TextBox Grid.Row="1" Grid.Column="1" Name="wName" Text="..Name .." />
|
||||
|
||||
<TextBlock Grid.Row="2" Grid.Column="0" Text="Hp07Alarm" />
|
||||
<TextBox Grid.Row="2" Grid.Column="1" Name="aHP07" Text="100" />
|
||||
<TextBox Grid.Row="2" Grid.Column="1" Name="HP07AlarmDose" Text="100" />
|
||||
|
||||
<TextBlock Grid.Row="3" Grid.Column="0" Text="Hp10Alarm" />
|
||||
<TextBox Grid.Row="3" Grid.Column="1" Name="aHP10" Text="100" />
|
||||
<TextBox Grid.Row="3" Grid.Column="1" Name="HP10AlarmDose1" Text="100" />
|
||||
|
||||
<Button Grid.Row="4" Grid.Column="1" Name="bIssue" Content="Issue" Click="BIssue_Click" Height="20" VerticalAlignment="Top" />
|
||||
<TextBlock Grid.Row="4" Grid.Column="0" Text="Hp10 Alarm2" />
|
||||
<TextBox Grid.Row="4" Grid.Column="1" Name="HP10AlarmDose2" Text="100" />
|
||||
|
||||
<Button Grid.Row="5" Grid.Column="1" Name="bIssue" Content="Issue" Click="BIssue_Click" Height="20" VerticalAlignment="Top" />
|
||||
|
||||
|
||||
</Grid>
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ namespace eDosStation
|
|||
|
||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ep = new EpdBaseClr.Epd2(3);
|
||||
ep = new EpdBaseClr.Epd2(Properties.Settings.Default.comport);
|
||||
ep.Connect();
|
||||
if (ep.DiscRV == 1 && ep.b.CurrentDeviceID > 0)
|
||||
{
|
||||
|
|
@ -98,14 +98,20 @@ namespace eDosStation
|
|||
private void BIssue_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
bIssue.IsEnabled = false;
|
||||
ep.alarmHP07 = double.Parse(aHP07.Text);
|
||||
ep.alarmHP10 = double.Parse(aHP10.Text);
|
||||
ep.Hp07THDose = double.Parse(HP07AlarmDose.Text);
|
||||
ep.Hp10THDose1 = double.Parse(HP10AlarmDose1.Text);
|
||||
ep.Hp10THDose2 = double.Parse(HP10AlarmDose2.Text);
|
||||
ep.WearerID = wID.Text;
|
||||
ep.WearerName = wName.Text;
|
||||
ep.SetIssued();
|
||||
this.Close();
|
||||
|
||||
}
|
||||
|
||||
private void Window_Unloaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ep.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ namespace eDosStation
|
|||
|
||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ep = new EpdBaseClr.Epd2(3);
|
||||
ep = new EpdBaseClr.Epd2(Properties.Settings.Default.comport);
|
||||
ep.Connect();
|
||||
if (ep.DiscRV == 1 && ep.b.CurrentDeviceID > 0)
|
||||
{
|
||||
|
|
|
|||
0
eDosStation/LOG.INI
Normal file
0
eDosStation/LOG.INI
Normal file
34
eDosStation/Properties/Settings.Designer.cs
generated
34
eDosStation/Properties/Settings.Designer.cs
generated
|
|
@ -8,23 +8,31 @@
|
|||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace eDosStation.Properties
|
||||
{
|
||||
|
||||
|
||||
namespace eDosStation.Properties {
|
||||
|
||||
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "11.0.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase
|
||||
{
|
||||
|
||||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "15.9.0.0")]
|
||||
internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
|
||||
|
||||
private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
|
||||
|
||||
public static Settings Default
|
||||
{
|
||||
get
|
||||
{
|
||||
|
||||
public static Settings Default {
|
||||
get {
|
||||
return defaultInstance;
|
||||
}
|
||||
}
|
||||
|
||||
[global::System.Configuration.UserScopedSettingAttribute()]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Configuration.DefaultSettingValueAttribute("6")]
|
||||
public int comport {
|
||||
get {
|
||||
return ((int)(this["comport"]));
|
||||
}
|
||||
set {
|
||||
this["comport"] = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,7 +1,9 @@
|
|||
<?xml version='1.0' encoding='utf-8'?>
|
||||
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
|
||||
<Profiles>
|
||||
<Profile Name="(Default)" />
|
||||
</Profiles>
|
||||
<Settings />
|
||||
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)" GeneratedClassNamespace="eDosStation.Properties" GeneratedClassName="Settings">
|
||||
<Profiles />
|
||||
<Settings>
|
||||
<Setting Name="comport" Type="System.Int32" Scope="User">
|
||||
<Value Profile="(Default)">6</Value>
|
||||
</Setting>
|
||||
</Settings>
|
||||
</SettingsFile>
|
||||
|
|
@ -5,7 +5,7 @@
|
|||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:local="clr-namespace:eDosStation"
|
||||
mc:Ignorable="d"
|
||||
Title="ShowEPDDose" Height="450" Width="800" Loaded="Window_Loaded">
|
||||
Title="ShowEPDDose" Height="450" Width="800" Loaded="Window_Loaded" Unloaded="Window_Unloaded">
|
||||
<DockPanel>
|
||||
<StatusBar DockPanel.Dock="Bottom" >
|
||||
<StatusBarItem Name="statusEPD" Content="Epd" />
|
||||
|
|
@ -14,7 +14,7 @@
|
|||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition />
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
|
|
@ -26,11 +26,17 @@
|
|||
|
||||
<CheckBox Grid.Row="0" Grid.Column="0" Content="Issued" IsChecked="False" Name ="isIssued"/>
|
||||
<TextBlock Grid.Row="0" Grid.Column="1" Name ="Wearer" Text=""/>
|
||||
<TextBlock Grid.Row="1" Grid.Column="0" Text="Dose" />
|
||||
<TextBlock Grid.Row="1" Grid.Column="0" Text="Dose Alarm" />
|
||||
<StackPanel Grid.Row="1" Grid.Column="1" Orientation="Vertical" >
|
||||
<TextBlock Name="HpDose07" />
|
||||
<TextBlock Name="HpDose10" />
|
||||
</StackPanel>
|
||||
<TextBlock Grid.Row="2" Grid.Column="0" Text="Dose" />
|
||||
<StackPanel Grid.Row="2" Grid.Column="1" Orientation="Vertical" >
|
||||
<TextBlock Name="HP07AlarmDose" />
|
||||
<TextBlock Name="HP10AlarmDose1" />
|
||||
<TextBlock Name="HP10AlarmDose2" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</DockPanel>
|
||||
</Window>
|
||||
|
|
|
|||
|
|
@ -30,8 +30,6 @@ namespace eDosStation
|
|||
InitializeComponent();
|
||||
}
|
||||
|
||||
|
||||
|
||||
private void LoadDoses()
|
||||
{
|
||||
ep.GetStatus();
|
||||
|
|
@ -42,13 +40,17 @@ namespace eDosStation
|
|||
HpDose07.Text = $"HP07: {ep.Hp07:0.00 µ Sv} ";
|
||||
HpDose10.Text = $"Hp10: {ep.Hp10:0.00 µ Sv}";
|
||||
|
||||
|
||||
|
||||
ep.ReadTresholds();
|
||||
HP10AlarmDose1.Text = $"Alarm HP10(1) {ep.Hp10THDose1:0.00 µ Sv}";
|
||||
HP10AlarmDose2.Text = $"Alarm HP10(2) {ep.Hp10THDose2:0.00 µ Sv}";
|
||||
HP07AlarmDose.Text = $"Alarm HP07 {ep.Hp07THDose:0.00 µ Sv}";
|
||||
//int Hp10THDose2;
|
||||
//int Hp07THDose;
|
||||
}
|
||||
|
||||
private void Window_Loaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ep = new EpdBaseClr.Epd2(3);
|
||||
ep = new EpdBaseClr.Epd2(Properties.Settings.Default.comport);
|
||||
ep.Connect();
|
||||
if (ep.DiscRV == 1 && ep.b.CurrentDeviceID > 0)
|
||||
{
|
||||
|
|
@ -92,5 +94,10 @@ namespace eDosStation
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
private void Window_Unloaded(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ep.Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue