eDosStation/EpdBaseClr/EpdBaseClr.h

263 lines
4.6 KiB
C
Raw Normal View History

2019-02-01 17:35:18 +01:00
#pragma once
#include "..\EpdBase\EpdBase.h"
#pragma comment(lib,"dll2/Reader2.lib")
using namespace System;
namespace EpdBaseClr {
2021-05-26 16:20:40 +02:00
const char* cEpdError = "Setreader Error";
ref class Epd2;
public ref class EpdEventArgs : EventArgs
{
public:
int deviceID;
bool isIssued, isBG, isMK3;
EpdEventArgs(int epdID, bool epdIssued, bool isBG, bool isMK3) : EventArgs()
{
this->deviceID = epdID;
this->isIssued = epdIssued;
this->isBG = isBG;
this->isMK3 = isMK3;
}
};
public ref struct EpdException : System::Exception
{
public:
int errorCode;
EpdException(int r) : System::Exception(gcnew String(cEpdError))
{
this->errorCode = r;
}
};
public ref class EpdErrorEventArgs : EventArgs
{
public:
int returnValue;
EpdErrorEventArgs(int ReturnValue) : EventArgs()
{
this->returnValue = ReturnValue;
}
};
/*public ref class sEpdBase
2019-02-04 11:48:08 +01:00
{
public :
DateTime^ RealTime;
unsigned int CurrentDeviceID;
2021-05-26 16:20:40 +02:00
};*/
2019-02-01 17:35:18 +01:00
public ref class Epd2
{
2021-05-26 16:20:40 +02:00
public:
delegate void dEpdRead(Epd2^ Sender, EpdEventArgs^ e);
delegate void dEpdTO(Epd2^ Sender, EventArgs^ e);
delegate void dEpdError(Epd2^ Sender, EpdErrorEventArgs^ e);
dEpdRead^ _EpdRead;
dEpdTO^ _EpdTO;
dEpdError^ _EpdError;
event dEpdRead^ EpdRead
{
void add(dEpdRead^ handler)
{
_EpdRead += handler;
}
void remove(dEpdRead^ handler)
{
_EpdRead -= handler;
}
}
event dEpdError^ EpdError
{
void add(dEpdError^ handler)
{
_EpdError += handler;
}
void remove(dEpdError^ handler)
{
_EpdError -= handler;
}
}
event dEpdTO^ EpdTO
{
void add(dEpdTO^ handler)
{
_EpdTO += handler;
}
void remove(dEpdTO^ handler)
{
_EpdTO -= handler;
}
}
2019-02-01 17:35:18 +01:00
public:
EpdBase::Epd2U *epd;
2021-05-26 16:20:40 +02:00
//sEpdBase^ b;
2019-02-01 17:35:18 +01:00
DateTime^ RealTime;
String^ WearerName;
String^ WearerID;
bool Issued;
bool isOn;
2021-05-20 16:13:23 +02:00
bool isBG;
2021-05-26 16:20:40 +02:00
bool isMK3;
2019-02-01 17:35:18 +01:00
int InitRV;
int DiscRV;
int StatusRV;
2020-02-05 14:21:53 +01:00
int GetStatusError;
int GetDosesError;
int ReadTresholdsError;
int PrepareForIssueError;
int SetIssuedError;
int ConnectError;
2019-02-01 17:35:18 +01:00
int ReadDosesRV;
2019-02-19 15:08:06 +01:00
int DeviceCount = 0;
2019-02-01 17:35:18 +01:00
double Hp07;
double Hp10;
double Hp07Peak;
double Hp10Peak;
2019-02-12 07:33:18 +01:00
System::Nullable<System::DateTime> Hp10PeakTime;
System::Nullable<System::DateTime> Hp07PeakTime;
2019-02-11 11:34:52 +01:00
double Hp07Total;
double Hp10Total;
2019-02-01 17:35:18 +01:00
double alarmHP07;
double alarmHP10;
2019-02-04 11:48:08 +01:00
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;
2019-02-11 11:34:52 +01:00
int QualityData;
2019-02-04 11:48:08 +01:00
2021-04-22 16:52:44 +02:00
unsigned int D1, D2, D3, D4, CountsClock, CountsClockBase;
2019-02-04 11:48:08 +01:00
int epdType;
int alarmStatus ;
int otherAlarms ;
int errorStatus ;
int operatingStatus ;
unsigned int EpdID ;
int HardVersion ;
int SoftVersion ;
int FunctionFlags ;
2019-02-12 16:01:47 +01:00
unsigned short BatADC;
unsigned short SupplyADC;
2020-02-18 14:06:52 +01:00
//OperatingStatus
BYTE DetectorsOn = 0;
BYTE EPDIssued = 0;
BYTE EPDLocked = 0;
BYTE EPDTesting = 0;
BYTE EPDProcSec = 0;
BYTE EPDFaulty = 0;
//ERrrostatus
BYTE EPDNewFault = 0;
BYTE EPDComFault = 0;
BYTE EPDCalFault = 0;
BYTE EPDDetFault = 0;
BYTE EPDEprFault = 0;
BYTE EPDTrhFault = 0;
BYTE EPDOthFault = 0;
//AlarmStatus
BYTE AlarmDoseHP101G = 0;
BYTE AlarmDoseHP102G = 0;
BYTE AlarmDoseHP07N = 0;
BYTE AlarmRateHP101G = 0;
BYTE AlarmRateHP102G = 0;
BYTE AlarmRateHP07N = 0;
//OtherAlarm
BYTE OtherAlarmRateHp101G = 0;
BYTE OtherAlarmRateHp102G = 0;
BYTE OtherAlarmRateHp07N = 0;
BYTE OtherAlarmReturn = 0;
BYTE OtherAlarmBatLow = 0;
BYTE OtherAlarmCarrier = 0;
BYTE OtherAlarmBatVolt = 0;
2019-02-12 16:01:47 +01:00
2019-02-01 17:35:18 +01:00
Epd2(int port);
2019-02-04 11:48:08 +01:00
~Epd2();
!Epd2();
int SetFeedbackSound(byte sound);
2019-02-01 17:35:18 +01:00
2021-05-12 12:35:50 +02:00
int Connect(bool reinit, int EPDTimeout);
2019-02-04 11:48:08 +01:00
int Close();
2020-02-18 14:06:52 +01:00
int DecodeStatus();
2019-02-01 17:35:18 +01:00
int GetStatus();
int GetDoses();
int SetDeIssued();
int SetIssued();
int PrepareForIssue();
2019-02-12 16:01:47 +01:00
int WriteCalibration();
2019-02-04 11:48:08 +01:00
int ReadTresholds();
2019-02-12 16:01:47 +01:00
int ReadExtraStatus();
2021-05-26 16:20:40 +02:00
int ConnectAndStatus();
void WaitEpd();
System::Threading::CancellationTokenSource^ tokenSource;
int tokenSourceTimeout;
int readRetries;
System::Threading::Tasks::Task^ waitTask;
System::Threading::Tasks::Task^ Wait(int timeout, int Retries);
2019-02-01 17:35:18 +01:00
2021-05-26 16:20:40 +02:00
void WaitEnd();
2019-02-01 17:35:18 +01:00
};
}