00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
#ifndef __M_DEVHW_H
00013
#define __M_DEVHW_H
00014
00015
#include <fstream.h>
00016
#include "detecuse\detecuse.h"
00017
#include "detecuse\detectorcontroller.h"
00018
00019
00020
00021
00022 #define R_MeasInProcess 205
00023 #define R_HardOverflow 217
00024
00025
00026
00027
Controller*
GetController(EDeviceType DeviceID, LPTSTR HardwareID,
00028
ControllerList* Controllers,
DeviceList* Drivers, DWORD* index= 0);
00029
00030
00031
00032
00033
00034 class TGenericDetector :
public TZeroDimDetector
00035 {
00036
public:
00037
TGenericDetector(
int id);
00038
virtual ~TGenericDetector();
00039
00040 BOOL
Initialize(
void );
00041 EDetectorType GetDetectorType()
const
00042
{
00043
return GenericDetector;
00044 };
00045
00046
int MeasureStart(
void );
00047
int MeasureStop(
void );
00048
int PollDetector(
void );
00049
00050
void LookUp(LPCSTR Section);
00051
00052
protected:
00053 BOOL
_SetParameters(
void );
00054
00055
private:
00057
TGenericController* Hardware;
00058
int nBaseAddr;
00059
float fTimeCorrection;
00060 };
00061
00062 class TRadicon :
public TZeroDimDetector
00063 {
00064
00065
public:
00066
TRadicon(
int id);
00067
virtual ~TRadicon( );
00068
00069 BOOL
Initialize(
void );
00070 BOOL
InitializeEvent( HWND,
int );
00071
static void CALLBACK
EventHandler( UINT, UINT, DWORD, DWORD, DWORD );
00072 EDetectorType GetDetectorType()
const
00073
{
00074
return CounterDetector;
00075 };
00076
00078 WORD
GetHighVoltage()
const
00079
{
00080
return wHighVoltage;
00081 };
00082
00084
void SetHighVoltage(WORD);
00085
00086
00087
void SetDacThresh(WORD, WORD);
00088
00089
00090 const TRange<WORD>&
GetDacThresh()
const
00091
{
00092
return DacThresh;
00093 };
00094
00095
int MeasureStart(
void );
00096
int MeasureStop(
void );
00097
int PollDetector(
void );
00098 BOOL
RunSpecificParametersDlg(
void );
00099 BOOL
HasSpecificParametersDlg(
void )
const
00100
{
00101
return TRUE;
00102 };
00103
00104
private:
00105 BOOL
_SetParameters(
void );
00106 BOOL SetSound(
void );
00107
void LoadDetectorSettings();
00108
void SaveDetectorSettings() const;
00109
00110
double dRealTime;
00111
00113
int Rdd;
00114
00116
int Rcc;
00117
00118
00119
TRange<WORD> DacThresh;
00120 static const
TRange<WORD> DacThreshLimits;
00121
00123 static const
TRange<WORD> VoltageLimits;
00124
00126 WORD wHighVoltage;
00127
00129
TRadiconController* Hardware;
00130
00133 static
TRadiconController* TheEventHardware;
00134 };
00135
00136
00137
00138
00139
00140 class
Testdev : public
TZeroDimDetector
00141 {
00151
class TestdevData
00152 {
00160
public:
00161 TestdevData();
00162
virtual ~TestdevData();
00163
00165
long value(
int x,
int y,
int z)
const;
00166
00167
private:
00169 BOOL parseCC(ifstream& file);
00170
00172
long** parseTL(ifstream& file);
00173
00175
long* parseDF(ifstream& file);
00176
00181
static int instanceCounter;
00182
00184
static long ***data;
00185
00188 BOOL initData();
00189 };
00190
00191
public:
00192
Testdev(
int id);
00193
virtual ~
Testdev();
00194
00195
int PollDetector(
void );
00196 EDetectorType GetDetectorType()
const
00197
{
00198
return CounterDetector;
00199 };
00200
00201
private:
00203 TestdevData* data;
00204
00206
double CalculateIntensity() const;
00207
00209
double InterPolate(
int ccI,
int tlI,
int dfI,
int tlB ) const;
00210 };
00211
00212 class
TZeroDimSimpleTestDetector : public TZeroDimDetector
00213 {
00214
public:
00215
TZeroDimSimpleTestDetector(
int id);
00216 virtual ~
TZeroDimSimpleTestDetector() {}
00217
00218
int PollDetector(
void );
00219 };
00220
00221 class TOneDimTestDetector :
public TOneDimDetector
00222 {
00223
public:
00224
TOneDimTestDetector(
int id);
00225 virtual ~
TOneDimTestDetector() {}
00226
00227
int PsdReadOut( EHowReadOutPsd eReadType);
00228 };
00229
00230
00231
00232
00233
00234 class TStoePsd :
public TOneDimDetector
00235 {
00236
public:
00237
TStoePsd(
int id);
00238
virtual ~
TStoePsd(
void );
00239
00240
int PollDetector(
void );
00241
00242 EDetectorType GetDetectorType()
const
00243
{
00244
return PsdDetector;
00245 };
00246
00247
protected:
00248
void LoadDetectorSettings();
00249
void SaveDetectorSettings() const;
00250
00251 private:
00252
int nBaseAddr;
00253 BOOL bLong;
00254 BOOL Initialize(
void );
00255
int PsdReadOut( EHowReadOutPsd );
00256
int PsdRead(
int, LPWORD );
00257
int PsdInit(
void );
00258
int PsdStart(
void );
00259
int PsdStop(
void );
00260
00261
00262
00263 LPWORD hStoeBuf;
00264
00265
00266
int nReadBufItems;
00267
00270 BOOL bReadyForRead;
00271
00272
HardwareIo Hardware;
00273 };
00274
00275 class
TBraunPsd : public
TOneDimDetector
00276 {
00277
public:
00278
TBraunPsd(
int id);
00279
virtual ~
TBraunPsd(
void );
00280
00281 BOOL
Initialize(
void );
00282
00283
int PsdInit(
void );
00284
int PsdStart(
void );
00285
00286
int PsdReadOut(
EHowReadOutPsd );
00287
virtual int GetBufferSize(
void )
const;
00288 BOOL SetEnergyRange( UINT, UINT );
00289 void GetEnergyRange( UINT& ler, UINT& her )
const
00290
{
00291 her= uEnergyHigh;
00292 ler= uEnergyLow;
00293 };
00294
00295
int PsdStop(
void );
00296
00297
int GetChannelNumber() const;
00298
00299 int nErrorCode;
00300 BOOL bSetError;
00301 int nHVRegelung_OK;
00302 EDetectorType GetDetectorType()
const
00303
{
00304
return PsdDetector;
00305 };
00306
00307
protected:
00308
int BuildOperation( BYTE*, BYTE*,
int );
00309
int LoadHexFile(
void );
00310
void ResetDelayTime(
void );
00311 BYTE konvert(
char );
00312
int SynchronHexFile( BYTE&, BYTE& );
00313
int Look_till_BaseAddr1(
int );
00314
void LoadDetectorSettings();
00315
void SaveDetectorSettings() const;
00316
00317 private:
00318
int nBaseAddr;
00319
00320 static BYTE echo[ 30 ][ 16 ];
00321 static BYTE befehl[ 30 ][ 16 ];
00322 UINT uMuxTimeDet1;
00323 LONG PositionsDatenHeader[ 16 ];
00324 UINT uEnergyScale;
00325 UINT uPositionScale;
00326 UINT uEnergyHigh;
00327 UINT uEnergyLow;
00328 LONG lPositionStop;
00329
00330 BOOL bAbbruchmitShutter;
00331
int nDeathTime;
00332 BOOL bRatemeter;
00333 BOOL bRealLifeTime;
00334 LONG lMeasTime;
00335
00336
00337
00338
int nDelayFast;
00339
int nDelaySlow;
00340
00341
int nReadBufItems;
00342
int nHVControl_OK;
00343
00344
TBraunPsdController* Hardware;
00345 };
00346 #endif