00001
00002
00003
00004
00005
00006
00007
00008
00009
#ifndef _WORKFLOW_H_
00010
#define _WORKFLOW_H_
00011
00012
#include "detecuse\detecuse.h"
00013
00014
#include "workflow\Enums.h"
00015
00016
00028 class TSteering
00029 {
00030
friend class TCmd;
00031
00032
00033
00034
00035
public:
00036
00039
TSteering (
void );
00040
00043
virtual ~TSteering (
void );
00044
00045
private:
00046
00049
TSteering (
TSteering& ) {}
00050
00053
TSteering& operator= (
const TSteering& ) {
return *
this; }
00054
00055
00056
00057
00058
public:
00059
00074 BOOL
Initialize (
const HWND hwnd,
const int mid,
TDetector* d );
00075
00082 BOOL
LoadMacroByUser (
void );
00083
00084
00085
public:
00086
00094 BOOL
StartUp (
const HWND hwnd,
const int mid,
TDetector* d );
00095
00100
void Visualising ( BOOL a, BOOL b );
00101
00102
00103
public:
00104
00114 BOOL
StartMacroExecution (
TMacroTag* macro, HWND hwnd );
00115
00124
int StartCmdExecution (
ECmdId id,
int p1,
int p2, LPSTR p3, HWND );
00125
00126
00127
public:
00128
00133 BOOL
ToggleInterrupt (
void );
00134
00140 BOOL
Reset ( BOOL=TRUE );
00141
00142
00143
public:
00144
00148 BOOL
DetectorRequest (
void );
00149
00152
void WakeUp (
void );
00153
00154
00155
public:
00156
00161
TMacroTag *
GetMacroById (
EMacroId id );
00162
00167
TMacroTag *
GetMacroByNumber (
int );
00168
00173
TMacroTag *
GetMacroByName ( LPSTR s );
00174
00179 BOOL
DeleteMacro (
TMacroTag* macro );
00180
00184
int GetMacroCount (
void );
00185
00186
00187
public:
00188
00192 BOOL
IsActive (
void );
00193
00197 BOOL
IsReset (
void );
00198
00208 BOOL
GetProgress (
int& ind, LPSTR s,
int& n);
00209
00210
00211
public:
00212
00216 BOOL
IsPositionValid (
void );
00217
00221
double GetDistance (
void );
00222
00227
void SetStartPoint (
double p );
00228
00233
double GetStartPoint (
void );
00234
00238
float GetIntensity (
void );
00239
00243
float GetSigma (
void );
00244
00249
void SetNoiseLevel (
float nl );
00250
00255
float GetNoiseLevel (
void );
00256
00257
00262
void SetNorm (
float norm );
00263
00268
float GetNorm (
void );
00269
00274
void SetResponse ( BOOL sr );
00275
00280 BOOL
IsResponding (
void );
00281
00288
void SetHwb (
double hwb );
00289
00294
double GetHwb (
void );
00295
00296
00297
00298
private:
00299
00300
00301 BOOL LoadMacro ( LPSTR, LPSTR );
00302
00303
00304
int StartCmdExecution (
TCmdTag );
00305
00306
00307 BOOL ReadyReaction (
void );
00308
00309
00310
int ExecuteNextCmd (
void );
00311
00312
00313
void NotifyCmdReady (
void );
00314
void NotifyMacroReady (
void );
00315
00316
00317 BOOL StartTimer (
void );
00318
void StopTimer (
void );
00319
static void CALLBACK RecallSteering ( UINT, UINT, DWORD, DWORD, DWORD );
00320
00321
00322
void SendReport (
void );
00323
00324
00325 BOOL ParsingMacroId (
TMacroTag&, LPSTR );
00326 BOOL ParsingCmd (
TCmdTag&, LPSTR, LPSTR, LPSTR, LPSTR );
00327
static ECmdParam ParsingCmdParam ( LPSTR param );
00328
00329
00330
00331
00332
00333
00334
00335
00336
00337
00338
public:
00339
00340 double dGoalDistance;
00341 double dPeakPoint;
00342 double dStartPoint;
00343
00344
00345 float fGoalIntensity;
00346 float fPeakIntensity;
00347 float fStartIntensity;
00348
00349
00350 double dCalcResult;
00351 double dCalcArg[
nMaxArg];
00352
00353
public:
00354
00355 TDetector *
Monitor;
00356
00357
00358
00359
private:
00360
00361
TMacroTag aMacroList[
_MAXMACROCOUNT];
00362
int nMacroNumber;
00363
00364
00365
TMacroTag *TheMacro;
00366
TCmdTag *TheCmdList;
00367
int nCmdIdx;
00368
00369
00370
TCmd *TheCmd;
00371
00372
00373 BOOL bInterrupted;
00374 BOOL bSteeringActive;
00375 BOOL bReset;
00376
00377
00378 HWND hControlWnd;
00379
00380 HWND hHostWindow;
00381
00382
00383 BOOL bSendReport;
00384
char MessageBuffer[
MaxString];
00385 HWND hReportList;
00386
00387
00388
00389 UINT nEvent;
00390
00391
00392
static const UINT nAskTicks;
00393
00394
00395
int nMotor;
00396
TDetector *Detector;
00397
00398
00399
float fIncomingIntensity;
00400
float fIntensityNorm;
00401
float fNoiseLevel;
00402
00403
00404
float fHWB;
00405 BOOL bInquireResult;
00406
00407
00408
TExposureSettings exposure;
00409
00410
00411
00412
00413
00414
00415
00416
00417
00418
00419 };
00420
00421
00422
00423
00424
00425 class TMacroExecuteDlg :
public TModelessDlg
00426 {
00427
public:
00428
TMacroExecuteDlg(
TModelessDlg** );
00429
private:
00430
TMacroTag *TheMacro;
00431
TDetector *Detector;
00432 HWND hMacroList;
00433 BOOL Dlg_OnInit( HWND, HWND, LPARAM );
00434
void Dlg_OnCommand( HWND,
int, HWND, UINT );
00435 BOOL
CanClose(
void );
00436
void LeaveDialog(
void );
00437
int MessageLine;
00438 BOOL bInterrupted;
00439 BOOL bActionCaused;
00440
int SetupTask;
00441 BOOL bCheckMacro;
00442 };
00443
00444
#endif //_WORKFLOW_H_
00445
00446
00447
00448