ngc 1.5.0
 
Loading...
Searching...
No Matches
ngcdcsACQ.hpp
Go to the documentation of this file.
1
8#ifndef ngcdcsACQ_H
9#define ngcdcsACQ_H
10
11
12#ifndef __cplusplus
13#error This is a C++ include file and cannot be used from plain C
14#endif
15
16#include <ngc/core/ngcb.h>
17#include <ngc/core/ngcbSocket.h>
18#include <ngc/core/ngcbOBJ.hpp>
21#include <ngc/core/ngcbDIC.hpp>
23#include <ngc/core/ngcppInt.h>
31
32/*
33 * Error codes
34 */
35#define ngcdcsACQ_ERR_EXP_FILE -3 //< exposure file-i/o error
36#define ngcdcsACQ_ERR_EXP_PROC -2 //< exposure post-processing error
37#define ngcdcsACQ_ERR_FATAL -1 //< fatal error
38#define ngcdcsACQ_ERR_IO 1 //< i/o-error
39#define ngcdcsACQ_ERR_OVERRUN 2 //< run-time error: buffer overrun
40#define ngcdcsACQ_ERR_OVERFLOW 3 //< run-time error: FIFO overflow
41#define ngcdcsACQ_ERR_EXEC 4 //< acquisition process exec failed
42
43/*
44 * Shared memory libraries
45 */
46#define ngcdcsSHM_LIB_NONE 0 //< shared memory interface disabled
47#define ngcdcsSHM_LIB_TPL 1 //< shared memory interface template
48#define ngcdcsSHM_LIB_IPC 2 //< System V IPC shared memory interface
49#define ngcdcsSHM_LIB_RTD 3 //< rtd/rtdcore library
50
51/*
52 * Acquisition module soft states
53 */
54#define ngcdcsACQ_STAT_IDLE 0x00000000 //< idle
55#define ngcdcsACQ_STAT_READY 0x00000001 //< ready
56#define ngcdcsACQ_STAT_RUNNING 0x00000002 //< running
57#define ngcdcsACQ_STAT_FAILURE 0x00000004 //< failure
58#define ngcdcsACQ_STAT_PAUSED 0x00000008 //< paused
59
60/*
61 * Test error defintions
62 */
63#define ngcdcsACQ_TESTERR_DATA_IO 0x400 //< data i/o failed
64#define ngcdcsACQ_TESTERR_STORE 0x401 //< failed to store data to disk
65#define ngcdcsACQ_TESTERR_POSTPROC 0x402 //< post-processing error
66#define ngcdcsACQ_TESTERR_FATAL 0x404 //< fatal error
67
71#define ngcdcsACQ_MAX_PROC ngcdcsEXP_MAX_CLIENTS
72
76#define ngcdcsACQ_DEFAULT_BUFSIZE (2048 * 2048 * 4)
77
81#define ngcdcsACQ_MAX_FILESIZE (2147483647 - ngcbFITS_BLOCK_LEN)
82
83/*
84 * Streaming modes
85 */
86#define ngcdcsACQ_STREAMING_NONE 0 //< no streaming buffer
87#define ngcdcsACQ_STREAMING_DEFAULT -1 //< default streaming size
88#define ngcdcsACQ_STREAMING_AUTO -2 //< automatic streaming size
89#define ngcdcsACQ_STREAMING_PARALLEL -3 //< parallel streaming
90#define ngcdcsACQ_STREAMING_REQ -4 //< requested streaming size
91#define ngcdcsCV16_SIZE 8192 //< buffer size for CV16
92
97 int numDet; //< Number of detectors in mosaic
98 int haveChipIndex; //< Explicit chip index present
99 int addIdx; //< Flag to add detector index to filename
100 int det0; //< First detector in this instance
101 int sx; //< Lower left x (for HW-window)
102 int sy; //< Lower left y (for HW-window)
103 int nx; //< X-Dimension (for HW-window)
104 int ny; //< Y-Dimension (for HW-window)
105 int splitX; //< Split to FITS extension
106 int splitY; //< Split to FITS extension
107 ngcdcs_chip_t *chip; //< Chip info
108
111 numDet = 1;
112 haveChipIndex = 1;
113 addIdx = 0;
114 det0 = 0;
115 sx = 1;
116 sy = 1;
117 nx = 0;
118 ny = 0;
119 splitX = 1;
120 splitY = 1;
121 chip = NULL;
122 }
123};
124
129public:
130 double val; //< Mean value
131 double max; //< Maximum value
132
135 Clear();
136 }
137
139 void Clear() {
140 val = 0.0; max = 0.0; n_ = 0.0;
141 }
142
144 void Add(double d) {
145 if (d > 0.0)
146 {
147 n_ += 1.0;
148 if (d > max) max = d;
149 val = ((val * (n_ - 1.0)) + d) / n_;
150 }
151 }
152
153protected:
154
155private:
157 double n_;
158};
159
164public:
167
170
173
176
179
182
185
188
191
195
198 size.Add(p.size.val); net.Add(p.net.val); disk.Add(p.disk.val);
199 close.Add(p.close.val); file.Add(p.file.val); fits.Add(p.fits.val);
200 proc.Add(p.proc.val); total.Add(p.total.val); exp.Add(p.exp.val);
201 }
202
204 void Clear() {
205 size.Clear(); net.Clear(); disk.Clear(); close.Clear(); file.Clear();
206 fits.Clear(); proc.Clear(); total.Clear(); exp.Clear();
207 }
208
209protected:
210private:
211};
212
219
222
225
228
231
234
237
240
243
246
248 char erms[256];
249
252 if (this != &other)
253 {
254 semStart = new ngcbSEM(0);
255 semCfg = new ngcbSEMC(1);
257 simErr_io = other.simErr_io;
261 status = other.status;
262 strcpy(erms, other.erms);
264 }
265 return (*this);
266 }
267
270 semStart = new ngcbSEM(0);
271 semCfg = new ngcbSEMC(1);
273 simErr_io = other.simErr_io;
277 status = other.status;
278 strcpy(erms, other.erms);
280 }
281
284 semStart = new ngcbSEM(0);
285 semCfg = new ngcbSEMC(1);
286 transferring = 0;
287 simErr_io = 0;
288 simErr_store = 0;
289 simErr_fatal = 0;
290 simErr_postproc = 0;
292 erms[0] = '\0';
293 lastTransfer = 0;
294 }
295
298 if (semStart != NULL) delete semStart;
299 if (semCfg != NULL) delete semCfg;
300 }
301};
302
307{
308public:
311
314
316 virtual int FrameHandler(void *buffer, ngcdcs_finfo_t *finfo, char *erms) {
317 USE(buffer); USE(finfo); USE(erms);
318 return (ngcbSUCCESS);
319 }
320
322 virtual int FitsMerger(ngcbFITS *hdr, char *erms) {
323 USE(hdr); USE(erms);
324 return (ngcbSUCCESS);
325 }
326
328 virtual void AcqError(const char *erms, int id, void *descriptor) {
329 USE(erms); USE(id); USE(descriptor);
330 }
331
332protected:
333
334private:
335
336};
337
338
342class ngcdcsACQ: public ngcbOBJ, public ngcbTHREAD
343{
344public:
346 ngcdcsACQ();
347
349 explicit ngcdcsACQ(const ngcdcs_acq_cfg_t &cfg);
350
352 explicit ngcdcsACQ(ngcbPARAM_LIST *p);
353
356
358 virtual ~ngcdcsACQ();
359
362
365
368
370 char shmName[64];
371
374
376 int status;
377
380
382 char procName[256];
383
385 char burstProcess[256];
386
389
391 ssize_t allocSize;
392
395
398
401
403 int exp;
404
407
410
413
416
419
422
424 int flush;
425
428
431
433 char diskMemPath[256];
434
437
440
443
445 char moduleName[64];
446
449
452
455
457 int ppRev;
458
461
464
467
469 char rtdCmd[256];
470
473
476
479
482
484 char darkFrame[256];
485
487 char flatField[256];
488
490 char badPixMask[256];
491
493 char extName[80];
494
497
500
503
505 void ErrState(const char *msg, int id);
506
508 void SimError(int error);
509
512
514 int StartDebugger();
515
517 int StopDebugger();
518
520 int DebuggerRunning();
521
522 /*
523 * Configuration
524 */
525
527 void Profile(const char *id);
528
530 void Configure(const ngcdcs_acq_cfg_t &newConf);
531
533 void GetCfg(ngcdcs_acq_cfg_t *currentConf);
534
536 int Streaming(ssize_t size);
537
539 int Alloc(ssize_t size);
540
542 int Alloc();
543
545 void Free();
546
548 int ShmSelect(const char *libName, const char *nameSpace=NULL, int n=0);
549
551 int ShmName(const char *nameSpace);
552
554 int ShmNumBuf(int n);
555
557 int ShmNoWait(int flag);
558
560 int ShmNoWait() {return (shmNoWait_);}
561
563 void Sim(int flag);
564
566 int Sim() {return (sim_);}
567
569 void SofwMode(char *s);
570
572 char *Host();
573
575 int DataPath(const char *path);
576
578 const char *DataPath();
579
581 const char *Dev(int n=0);
582
584 int Pid();
585
587 void Release();
588
590 int Reset();
591
593 int GetRecvStatus(int *err, int *stat);
594
595
596 /*
597 * Process execution
598 */
599
601 int Exec();
602
604 int Exec(const char *newProcess);
605
607 void Abort();
608
610 int FdCmd();
611
613 int FdErr();
614
616 void HandleFdCmdEvt();
617
619 int HandleFdErrEvt();
620
621
622 /*
623 * Run control
624 */
625
627 char *StatusString();
628
630 int Start(double absTime = 0.0);
631
633 int Stop();
634
636 int ResumeSim();
637
639 int Restart(double absTime = 0.0);
640
642 void SetupId(int id = -1);
643
645 int NewSetup();
646
648 int End();
649
651 int ResetCnt();
652
654 int Pause();
655
657 int Cont();
658
660 int Cmd(const char *cmd, char *reply);
661
663 int UploadFits(int id, const char *path, int noCheck=0);
664
666 int UploadBuf(int id, void *buffer, int size, int noCheck=0);
667
669 int Clear(int id);
670
672 int DarkFrame(const char *path);
673
675 int FlatField(const char *path);
676
678 int BadPixMask(const char *path);
679
681 int ChanSelect(int chan);
682
684 int SimTime(int ms);
685
687 int SimTime();
688
689
690
691 /*
692 * Burst modes
693 */
694
696 int Burst(int num);
697
699 int BurstSkip(int num);
700
702 int Queue(int num);
703
705 void QueueWin(int sx, int sy, int nx, int ny);
706
708 void QueueAlign();
709
711 int DiskMem(int flag);
712
714 int DiskMemPath(const char *path);
715
717 int DiskMemCreate(int size);
718
720 int DiskMemDelete();
721
722
723 /*
724 * Parameter interface
725 */
726
728 void Dictionary(ngcbDIC *dictionary);
729
731 int HwWin(int sx, int sy, int nx, int ny);
732
733 // synchronize parameter setup
734 int SyncParam(int timeout = 20);
735
736 // set parameter
737 int SetParam(const char *paramName, const char *paramValue, int sync=1);
738
740 int GetParam(const char *paramName, char *paramValue);
741
743 int ApplyParamList(ngcbPARAM_LIST *list, int sync = 1);
744
746 int ApplyParamList(int sync = 1);
747
748
749 /*
750 * Exposure and frame setup
751 */
752
754 void Exposure(ngcdcsEXP *exposure);
755
758
760 void NumExtBlocks(int n);
761
763 int LocalMedia();
764
766 int FrameDef(ngcdcs_framedef_t *frameDef);
767
769 ngcdcs_framedef_t *Frame(const char *name);
770
772 ngcdcs_framedef_t *Frame(int idx);
773
775 int FrameGen(const char *name, int flag);
776
778 void SeqStartTime(struct timeval &timeVal);
779
781 const char *SeqStartTime();
782
784 void ExpStartTime(struct timeval &timeVal);
785
787 const char *ExpStartTime();
788
790 double ExpStartTimeMJD();
791
793 double ExpStartTimeUTC();
794
796 int ExpSeqNo();
797
799 int ExpActive();
800
802 int StartExposure();
803
805 void StopExposure();
806
808 int ExtDtt() {return dtt_.enabled;}
809
811 size_t FramesProcessed();
812
814 size_t SizeRecorded();
815
816 /*
817 * Asynchronous data transfer
818 */
819
822
824 int StartTransferring();
825
827 void StopTransferring();
828
830 int Transferring();
831
833 int LastTransfer();
834
836 int GetServiceConfig(ngcpp_cfg_t *config);
837
839 int Transfer(int flag);
840
842 int Guiding(int flag);
843
844
845 /*
846 * Statistics
847 */
848
850 unsigned int DmaCnt(int idx = 0);
851
853 double Perf();
854
856 double FrameRate();
857
859 void Statistics(ngcdcs_acqperf_t *stat);
860
862 void ClearStatistics();
863
865 char *ErrMsg();
866
867protected:
869 virtual int DataConnect();
870
872 virtual int Store(char *buffer, ngcdcs_finfo_t finfo, char *where,
873 int store2tmp = 0);
874
876 virtual ngcdcsSHM *NewShm(const char *name);
877
878private:
880 char ermsMain_[256];
881
883 char ermsThr_[256];
884
886 ngcdcsACQ_SERVICE *services_;
887
889 ngcbTHREAD *debugThread_;
890
892 int debugService_;
893
895 int debugPort_;
896
898 void Init_();
899
901 void CheckResult_(int result);
902
904 void Debugger_(ngcbTHREAD *thr, void *arg);
905
906
907
908 /*
909 * Configuration
910 */
911
913 void NewStatus_(int);
914
916 char statStr_[32];
917
919 char profile_[32];
920
922 int sim_;
923
925 int simTime_;
926
928 ngcdcs_acq_cfg_t cfg_;
929
931 int errPort_;
932
934 int fdCmd_;
935
937 int fdErr_;
938
940 int pid_;
941
943 char acqCmdLine_[256];
944
946 int vb_;
947
949 char thisHost_[64];
950
952 char acqHost_[64];
953
955 char acqDataPathReq_[256];
956
958 char acqDataPath_[256];
959
961 char procNameOrig_[256];
962
963
964 /*
965 * Dynamic parameters
966 */
967
969 int numParam_;
970
972 ngcppPARAM_NAMES paramName_;
973
975 int paramType_[ngcppMAX_PARAMSIZE];
976
978 int setupId_;
979
981 ngcbDIC *dictionary_;
982
984 ngcbPARAM_LIST *paramList_;
985
987 void Export_(ngcppPARAM_VALUES paramBuf);
988
989
990 /*
991 * Data reception process
992 */
993
995 ngcdcsDTT_COM dtt_;
996
998 ngcdcsEXP expLocal_;
999
1001 ngcdcsEXP *exposure_;
1002
1004 char seqStartTime_[64];
1005
1007 void RecvProc_(ngcbTHREAD *thr, void *arg);
1008
1010 ngcbTHREAD *recvThread_;
1011
1013 void RecvEvt_(ngcdcs_expevt_t evt);
1014
1016 ngcdcs_recv_t recv_;
1017
1019 int expActive_;
1020
1022 int numStore_;
1023
1025 ngcdcs_acqperf_t statistics_;
1026
1028 double expTime_;
1029
1031 int suspended_;
1032
1034 size_t framesProcessed_;
1035
1037 size_t sizeRecorded_;
1038
1039 /*
1040 * Background receiver
1041 */
1042
1044 void RecvBgProc_(ngcbTHREAD *thr, void *arg);
1045
1047 ngcbTHREAD *recvBgThread_;
1048
1050 ngcdcs_recv_t recvBg_;
1051
1053 int RecvBgStart_();
1054
1056 int RecvBgStop_();
1057
1059 int RecvBgOn_();
1060
1061
1062 /*
1063 * Frame type definitions
1064 */
1065
1067 int types_;
1068
1071
1073 char *frameBuf_;
1074
1076 size_t frameBufSize_;
1077
1079 int queueType_;
1080
1082 int qsx_;
1083
1085 int qsy_;
1086
1088 int qnx_;
1089
1091 int qny_;
1092
1093
1094 /*
1095 * Share memory interface
1096 */
1097
1099 int shmNoWait_;
1100
1102 void *ShMemAlloc_(size_t);
1103
1105 void ShMemFree_();
1106
1107
1108 /*
1109 * Streaming buffer
1110 */
1111
1113 ssize_t streamBufSize_;
1114
1116 int streamBufMode_;
1117
1119 void Streaming_(FILE *fd);
1120
1122 void AutoStreaming_();
1123
1124
1125 /*
1126 * Data cube routines
1127 */
1128
1130 int CubeOpen_(ngcdcs_framedef_t *f);
1131
1133 int CubeHeader_();
1134
1136 int CubeHeader_(ngcbFITS *fhdr, ngcdcsCUBE *cube);
1137
1139 int CubeClose_(ngcdcsCUBE *cube, const char *fileName=NULL);
1140
1142 int CubeNext_(ngcdcsCUBE *cube);
1143
1144
1145 /*
1146 * FITS-routines
1147 */
1148 unsigned short *cv16Buf_;
1149
1151 ngcbFITS fits_;
1152
1154 ngcbFITS cubeHdr_;
1155
1157 ngcbFITS efits_;
1158
1160 ngcb_off_t hdrSeek_;
1161
1163 ngcbFITS cfits_;
1164
1166 FILE *fdExt_;
1167
1169 int ExtFitsOpen_();
1170
1172 int ExtFitsPrimHeader_();
1173
1175 int ExtFitsHeader_(ngcdcs_finfo_t finfo);
1176
1178 void ExtFitsClear_(FILE *fd, ngcb_off_t offset);
1179
1181 int ExtFitsUpdate_(FILE *fd);
1182
1184 int ExtFitsClose_(int immediate=1);
1185
1187 char extFitsFileName_[512];
1188
1190 int MosaicWin_(ngcdcs_finfo_t finfo, int x, int y, int *sx, int *sy,
1191 int *nx, int *ny, int *px, int *py);
1192
1194 int Chip2Fits_(ngcbFITS *f, int idx, int splitX, int splitY, int doIdx=0);
1195
1197 int WrCv16_(FILE *fd, const char *buffer, size_t size);
1198
1200 int Win2File_(FILE *fd, char *buffer, int fx, int fy, int bitPix,
1201 int sx, int sy, int nx, int ny, int rot);
1202
1204 int CompleteFits_(ngcbFITS *hdr);
1205
1207 int StoreFits_(char *buffer, ngcdcs_finfo_t finfo, char *where,
1208 int store2Tmp = 0);
1209
1211 int StoreFitsCube_(char *buffer, ngcdcs_finfo_t finfo, char *where);
1212
1214 int StoreFitsExt_(char *buffer, ngcdcs_finfo_t finfo, char *where);
1215};
1216
1217#endif
Definition ngcbDIC.hpp:51
Definition ngcbFITS.hpp:25
Definition ngcbIMGOP.hpp:20
ngcbOBJ()
Constructor.
Definition ngcbOBJ.cpp:35
Definition ngcbPARAM.hpp:201
Definition ngcbTHREAD.hpp:159
Definition ngcbTHREAD.hpp:68
ngcbSERVICE()
Constructor.
Definition ngcbSERVICE.hpp:39
ngcbTHREAD()
Normal constructor.
Definition ngcbTHREAD.cpp:53
Definition ngcdcsACQ_DATA.hpp:218
Definition ngcdcsACQ.hpp:307
virtual ~ngcdcsACQ_SERVICE()
Destructor.
Definition ngcdcsACQ.hpp:313
ngcdcsACQ_SERVICE()
Constructor.
Definition ngcdcsACQ.hpp:310
virtual int FitsMerger(ngcbFITS *hdr, char *erms)
FITS-merger.
Definition ngcdcsACQ.hpp:322
virtual int FrameHandler(void *buffer, ngcdcs_finfo_t *finfo, char *erms)
Frame post-processing handler.
Definition ngcdcsACQ.hpp:316
virtual void AcqError(const char *erms, int id, void *descriptor)
Acquisition module error state handler.
Definition ngcdcsACQ.hpp:328
int ChanSelect(int chan)
Select DMA channels in use.
Definition ngcdcsACQ.cpp:1459
int UploadBuf(int id, void *buffer, int size, int noCheck=0)
Upload data buffer to acq.-process.
Definition ngcdcsACQ.cpp:1283
void Profile(const char *id)
Apply profile.
Definition ngcdcsACQ.cpp:332
char badPixMask[256]
Bad-pixel-mask.
Definition ngcdcsACQ.hpp:490
int BurstSkip(int num)
Set frames to skip before burst.
Definition ngcdcsAcqBurst.cpp:163
int FlatField(const char *path)
Upload flat-field.
Definition ngcdcsACQ.cpp:1394
char extName[80]
Extension name for "cube-ext" format.
Definition ngcdcsACQ.hpp:493
int End()
Set flag to end processing a.s.a.p.
Definition ngcdcsACQ.cpp:892
void StopTransferring()
Stop data transfer.
Definition ngcdcsAcqRecv.cpp:118
int ResetCnt()
Set flag to reset process counters.
Definition ngcdcsACQ.cpp:931
int flush
Flush stream after each image.
Definition ngcdcsACQ.hpp:424
int LocalMedia()
Return 1 in case any frame is store to local media on the NGC-LLCU.
Definition ngcdcsAcqExp.cpp:157
int Transferring()
Check protected transferring flag.
Definition ngcdcsAcqRecv.cpp:142
ngcdcsACQ_DATA data
Data interface.
Definition ngcdcsACQ.hpp:821
int queueSize
Queue size.
Definition ngcdcsACQ.hpp:415
int ExtDtt()
External DTT enabled.
Definition ngcdcsACQ.hpp:808
int ShmSelect(const char *libName, const char *nameSpace=NULL, int n=0)
Select shared memory interface type.
Definition ngcdcsAcqShm.cpp:123
void Statistics(ngcdcs_acqperf_t *stat)
Get transfer statistics.
Definition ngcdcsACQ.cpp:523
int StartDebugger()
Start debugger.
Definition ngcdcsAcqProc.cpp:1569
int continuous
Continuous mode flag (no counter reset)
Definition ngcdcsACQ.hpp:406
char flatField[256]
Flat-field.
Definition ngcdcsACQ.hpp:487
ngcdcsEXP * Exposure()
Return current exposure setup.
Definition ngcdcsAcqExp.cpp:186
ngcdcsSHM * shm
Shared memory object.
Definition ngcdcsACQ.hpp:364
char * ErrMsg()
Error message.
Definition ngcdcsACQ.cpp:302
int largeFile
Flag to enable/disable large file extension.
Definition ngcdcsACQ.hpp:436
int Transfer(int flag)
Enable/disable sustained transfer.
Definition ngcdcsAcqRecv.cpp:156
void GetCfg(ngcdcs_acq_cfg_t *currentConf)
Get configuration.
Definition ngcdcsACQ.cpp:383
const char * DataPath()
Return acquisition process local data path.
Definition ngcdcsAcqStore.cpp:1461
void NumExtBlocks(int n)
Set umber of reserved extension header blocks.
Definition ngcdcsAcqExtFits.cpp:1209
int ShmNoWait()
Return shared-memory no-wait flag.
Definition ngcdcsACQ.hpp:560
const char * SeqStartTime()
Get sequencer start time.
Definition ngcdcsAcqExp.cpp:650
int ShmNumBuf(int n)
Set number of shared memory buffers.
Definition ngcdcsAcqShm.cpp:298
double ExpStartTimeUTC()
Get exposure start time (UTC seconds since midnight)
Definition ngcdcsAcqExp.cpp:631
int ExpActive()
An exposure is running.
Definition ngcdcsAcqExp.cpp:191
int StopDebugger()
Stop debugger.
Definition ngcdcsAcqProc.cpp:1621
int FrameDef(ngcdcs_framedef_t *frameDef)
Currently defined frames.
Definition ngcdcsAcqFrames.cpp:27
int HwWin(int sx, int sy, int nx, int ny)
Set HW read-out window.
Definition ngcdcsAcqParam.cpp:402
int exp
Enable exposure.
Definition ngcdcsACQ.hpp:403
int appDataInline
Pre-processor application meta data inline flag.
Definition ngcdcsACQ.hpp:463
int HandleFdErrEvt()
Handle input on FdErr() - run-time error.
Definition ngcdcsAcqProc.cpp:1486
char burstProcess[256]
Process name for burst.
Definition ngcdcsACQ.hpp:385
int Reset()
Internal cleanup.
Definition ngcdcsACQ.cpp:494
int Stop()
Send stop-cmd to acq.-process.
Definition ngcdcsACQ.cpp:807
virtual ngcdcsSHM * NewShm(const char *name)
Shared memory creator.
Definition ngcdcsAcqShm.cpp:97
char shmName[64]
Shared memory interface name-space.
Definition ngcdcsACQ.hpp:370
int dataPort
Actual data server port.
Definition ngcdcsACQ.hpp:454
void QueueWin(int sx, int sy, int nx, int ny)
Align detector queue window.
Definition ngcdcsAcqBurst.cpp:254
int ResumeSim()
Resume suspended simulation.
Definition ngcdcsACQ.cpp:839
int diskMemSize
Disk-memory extension size.
Definition ngcdcsACQ.hpp:430
const char * ExpStartTime()
Get exposure start time.
Definition ngcdcsAcqExp.cpp:621
int diskMem
Disk-memory extension flag.
Definition ngcdcsACQ.hpp:421
int SimTime()
Get simulation interval (milliseconds)
Definition ngcdcsACQ.cpp:1517
void Dictionary(ngcbDIC *dictionary)
Attach to dictionary.
Definition ngcdcsACQ.cpp:327
int transfer
Transfer flag (sustained connection)
Definition ngcdcsACQ.hpp:409
int ppRev
Pre-processor framework revision.
Definition ngcdcsACQ.hpp:457
size_t FramesProcessed()
Return number of processed frames in recording sequence.
Definition ngcdcsACQ.cpp:1615
int Exec()
Launch last acq.-process.
Definition ngcdcsAcqProc.cpp:25
double ExpStartTimeMJD()
Get exposure start time (MJD)
Definition ngcdcsAcqExp.cpp:626
int shmLib
Shared memory interface library.
Definition ngcdcsACQ.hpp:367
int guiding
Guiding flag (sustained connection)
Definition ngcdcsACQ.hpp:412
int Streaming(ssize_t size)
Set streaming buffer size.
Definition ngcdcsAcqStream.cpp:68
void ErrState(const char *msg, int id)
Go to error state.
Definition ngcdcsACQ.cpp:314
int Burst(int num)
Set number of burst-frames.
Definition ngcdcsAcqBurst.cpp:27
ngcdcsRTD * rtd
RTD connection database.
Definition ngcdcsACQ.hpp:472
int payloadSize
Payload size for RTMS (bytes)
Definition ngcdcsACQ.hpp:466
void SimError(int error)
Trigger an error simulation.
Definition ngcdcsACQ.cpp:1693
int FdCmd()
Returns command server file descriptor.
Definition ngcdcsAcqProc.cpp:1439
char * Host()
Return acquisition process host name.
Definition ngcdcsACQ.cpp:404
ngcdcs_framedef_t * Frame(const char *name)
Get frame info.
Definition ngcdcsAcqFrames.cpp:272
int UploadFits(int id, const char *path, int noCheck=0)
Upload FITS-file to acq.-process.
Definition ngcdcsACQ.cpp:1156
int Cmd(const char *cmd, char *reply)
Send ASCII command to acq.-process.
Definition ngcdcsACQ.cpp:1055
int DiskMemPath(const char *path)
Set disk-memory extension path.
Definition ngcdcsAcqBurst.cpp:286
ngcdcs_acq_dcf_t detCfg
Detector configuration.
Definition ngcdcsACQ.hpp:388
int BadPixMask(const char *path)
Upload bad-pixel-mask.
Definition ngcdcsACQ.cpp:1426
int shmNumBuf
Number of shared memory buffers.
Definition ngcdcsACQ.hpp:373
int simHighSpeed
Flag to enable/disabel high-speed simulation.
Definition ngcdcsACQ.hpp:439
int appRev
Pre-processor application revision.
Definition ngcdcsACQ.hpp:460
void HandleFdCmdEvt()
Handle input on FdCmd() - i/o error case.
Definition ngcdcsAcqProc.cpp:1449
void QueueAlign()
Align queue-mode frame parameters.
Definition ngcdcsAcqProc.cpp:1282
unsigned int DmaCnt(int idx=0)
Return current DMA counter.
Definition ngcdcsACQ.cpp:1633
int Guiding(int flag)
Enable/disable guiding mode.
Definition ngcdcsAcqRecv.cpp:217
int status
Soft state: idle, ready, running ...
Definition ngcdcsACQ.hpp:376
char * StatusString()
Get status string.
Definition ngcdcsACQ.cpp:518
void Free()
Release frame buffer.
Definition ngcdcsAcqExp.cpp:138
int autoWinX
Apply automatic window in X.
Definition ngcdcsACQ.hpp:496
void Release()
Release module.
Definition ngcdcsACQ.cpp:471
void ClearStatistics()
Clear transfer statistics.
Definition ngcdcsACQ.cpp:533
int NewSetup()
Mark new setup.
Definition ngcdcsACQ.cpp:1107
int connect
Enable data connection.
Definition ngcdcsACQ.hpp:400
int cmdPort
Actual command server port.
Definition ngcdcsACQ.hpp:451
const char * Dev(int n=0)
Return acquisition process device name.
Definition ngcdcsACQ.cpp:423
int GetRecvStatus(int *err, int *stat)
Get errno and status from the receiver devices.
Definition ngcdcsACQ.cpp:1650
virtual int DataConnect()
Establish data connection.
Definition ngcdcsACQ.cpp:543
ngcdcsSUBFRM * subFrames
Sub-frames.
Definition ngcdcsACQ.hpp:475
char rtdCmd[256]
RTD startup command.
Definition ngcdcsACQ.hpp:469
void Abort()
Abort acq.-process.
Definition ngcdcsAcqProc.cpp:1300
ngcbIMGOP imgop
Image operations.
Definition ngcdcsACQ.hpp:481
int burstSkip
Frames to skip before starting burst.
Definition ngcdcsACQ.hpp:397
int FrameGen(const char *name, int flag)
Switch frame generation on/off.
Definition ngcdcsAcqFrames.cpp:302
int LastTransfer()
Check last-transfer flag.
Definition ngcdcsAcqRecv.cpp:250
int Sim()
Get simulation mode.
Definition ngcdcsACQ.hpp:566
int GetParam(const char *paramName, char *paramValue)
Get parameter.
Definition ngcdcsAcqParam.cpp:188
char darkFrame[256]
Dark-frame (bias)
Definition ngcdcsACQ.hpp:484
int ioError
Flag for io-error.
Definition ngcdcsACQ.hpp:379
int DiskMemDelete()
Delete disk-memory.
Definition ngcdcsAcqBurst.cpp:397
int Queue(int num)
Setup queue mode.
Definition ngcdcsAcqBurst.cpp:229
int StartExposure()
Start exposure.
Definition ngcdcsAcqExp.cpp:202
size_t ppStackSize
Post-processor stack size in bytes (0 = use system default)
Definition ngcdcsACQ.hpp:361
int queueDump
Queue dump mode.
Definition ngcdcsACQ.hpp:418
int ExpSeqNo()
Get exposure sequence number.
Definition ngcdcsAcqExp.cpp:636
int relaunch
relaunch flag - restet at Exec()
Definition ngcdcsACQ.hpp:502
int ShmName(const char *nameSpace)
Set shared memory interface name-space.
Definition ngcdcsAcqShm.cpp:224
ngcbTHREAD_T mainThread
Main thread id.
Definition ngcdcsACQ.hpp:478
int timestamp_table
Cube timestamp table enabled.
Definition ngcdcsACQ.hpp:427
int updateFrames
Flags that frame config. has changed.
Definition ngcdcsACQ.hpp:442
ngcdcsACQ()
Constructor.
Definition ngcdcsACQ.cpp:30
char moduleName[64]
Optional module name.
Definition ngcdcsACQ.hpp:445
double Perf()
Current CPU load in percent.
Definition ngcdcsACQ.cpp:1557
int chanSelect
DMA channel selection.
Definition ngcdcsACQ.hpp:448
virtual int Store(char *buffer, ngcdcs_finfo_t finfo, char *where, int store2tmp=0)
Store data to file.
Definition ngcdcsAcqStore.cpp:1337
int GetServiceConfig(ngcpp_cfg_t *config)
Retrieve acqusition microservice configuration.
Definition ngcdcsACQ.cpp:1489
void SetupId(int id=-1)
Set new setup id (or use auto-increment)
Definition ngcdcsACQ.cpp:1087
void Configure(const ngcdcs_acq_cfg_t &newConf)
Configure system.
Definition ngcdcsACQ.cpp:337
int SyncParam(int timeout=20)
Definition ngcdcsAcqParam.cpp:254
void StopExposure()
Stop exposure.
Definition ngcdcsAcqExp.cpp:552
int Cont()
Continue acquisition.
Definition ngcdcsACQ.cpp:1015
double FrameRate()
Current frame rate.
Definition ngcdcsACQ.cpp:1586
int Start(double absTime=0.0)
Send start-cmd to acq.-process.
Definition ngcdcsACQ.cpp:673
int StartTransferring()
Start data transfer.
Definition ngcdcsAcqRecv.cpp:28
ssize_t allocSize
Frame buffer size preset (in bytes)
Definition ngcdcsACQ.hpp:391
virtual ~ngcdcsACQ()
Destructor.
Definition ngcdcsACQ.cpp:61
void SofwMode(char *s)
Get software operational mode (string)
Definition ngcdcsACQ.cpp:440
int autoWinY
Apply automatic window in Y.
Definition ngcdcsACQ.hpp:499
char diskMemPath[256]
Disk-memory extension path.
Definition ngcdcsACQ.hpp:433
int Pid()
Return actual process id.
Definition ngcdcsACQ.cpp:430
int Pause()
Pause acquisition.
Definition ngcdcsACQ.cpp:975
int DiskMem(int flag)
Enable/disable disk-memory extension.
Definition ngcdcsAcqBurst.cpp:262
int DarkFrame(const char *path)
Upload dark-frame.
Definition ngcdcsACQ.cpp:1362
int Restart(double absTime=0.0)
Restart process.
Definition ngcdcsACQ.cpp:863
int Clear(int id)
Clear uploaded data (invalidate)
Definition ngcdcsACQ.cpp:1347
void AttachServices(ngcdcsACQ_SERVICE *s)
Attach services.
Definition ngcdcsACQ.cpp:296
size_t SizeRecorded()
Return recorded data size (in bytes)
Definition ngcdcsACQ.cpp:1624
char procName[256]
Process name.
Definition ngcdcsACQ.hpp:382
int ApplyParamList(ngcbPARAM_LIST *list, int sync=1)
Apply spec. list.
Definition ngcdcsAcqParam.cpp:279
int FdErr()
Returns error-stack file descriptor.
Definition ngcdcsAcqProc.cpp:1444
int SetParam(const char *paramName, const char *paramValue, int sync=1)
Definition ngcdcsAcqParam.cpp:69
int Alloc()
Apply frame buffer size preset.
Definition ngcdcsAcqExp.cpp:133
int burstNum
Number of bursts.
Definition ngcdcsACQ.hpp:394
int DiskMemCreate(int size)
Create disk-memory.
Definition ngcdcsAcqBurst.cpp:342
int DebuggerRunning()
Check, if debugger is running.
Definition ngcdcsAcqProc.cpp:1644
Definition ngcdcsFINFO.hpp:287
Definition ngcdcsDTT_COM.hpp:126
Definition ngcdcsEXP.hpp:179
Definition ngcdcsRTD.hpp:58
Definition ngcdcsSHM.hpp:41
Definition ngcdcsSUBFRM.hpp:49
Definition ngcdcsACQ.hpp:128
double val
Definition ngcdcsACQ.hpp:130
void Clear()
Clear statistics.
Definition ngcdcsACQ.hpp:139
double max
Definition ngcdcsACQ.hpp:131
void Add(double d)
Add measurement.
Definition ngcdcsACQ.hpp:144
ngcdcs_acq_stat_t()
Constructor.
Definition ngcdcsACQ.hpp:134
Definition ngcdcsACQ.hpp:163
void Add(ngcdcs_acqperf_t &p)
Add measurement.
Definition ngcdcsACQ.hpp:197
ngcdcs_acq_stat_t total
Total transfer overhead in seconds.
Definition ngcdcsACQ.hpp:187
ngcdcs_acq_stat_t proc
Post-processing overhead in seconds.
Definition ngcdcsACQ.hpp:172
ngcdcs_acq_stat_t disk
Disk overhead in seconds.
Definition ngcdcsACQ.hpp:178
ngcdcs_acqperf_t()
Constructor.
Definition ngcdcsACQ.hpp:193
ngcdcs_acq_stat_t net
Network overhead in seconds.
Definition ngcdcsACQ.hpp:169
ngcdcs_acq_stat_t close
File closing overhead in seconds.
Definition ngcdcsACQ.hpp:181
ngcdcs_acq_stat_t exp
Total exposure time in seconds.
Definition ngcdcsACQ.hpp:190
ngcdcs_acq_stat_t file
File creation overhead in seconds.
Definition ngcdcsACQ.hpp:175
void Clear()
Clear all measurments.
Definition ngcdcsACQ.hpp:204
ngcdcs_acq_stat_t size
Reference size for rate in bytes.
Definition ngcdcsACQ.hpp:166
ngcdcs_acq_stat_t fits
FITS-header overhead in seconds.
Definition ngcdcsACQ.hpp:184
pthread_t ngcbTHREAD_T
Definition ngcbTHREAD.hpp:58
off_t ngcb_off_t
Definition ngcb.h:46
#define USE(x)
Definition ngcb.h:29
#define ngcbSUCCESS
Definition ngcb.h:138
#define ngcdcsMAX_FRAME_TYPES
Definition ngcdcsFINFO.hpp:25
#define ngcppMAX_PARAMSIZE
Definition ngcppInt.h:267
char ngcppPARAM_NAMES[ngcppMAX_PARAMSIZE][256]
Definition ngcppInt.h:280
int ngcppPARAM_VALUES[ngcppMAX_PARAMSIZE]
Definition ngcppInt.h:285
Definition ngcdcsACQ_DATA.hpp:25
Definition ngcdcsACQ.hpp:96
int det0
Definition ngcdcsACQ.hpp:100
int splitX
Definition ngcdcsACQ.hpp:105
int haveChipIndex
Definition ngcdcsACQ.hpp:98
ngcdcs_chip_t * chip
Definition ngcdcsACQ.hpp:107
int splitY
Definition ngcdcsACQ.hpp:106
int sx
Definition ngcdcsACQ.hpp:101
int ny
Definition ngcdcsACQ.hpp:104
int sy
Definition ngcdcsACQ.hpp:102
int addIdx
Definition ngcdcsACQ.hpp:99
int nx
Definition ngcdcsACQ.hpp:103
ngcdcs_acq_dcf_t()
Constructor.
Definition ngcdcsACQ.hpp:110
int numDet
Definition ngcdcsACQ.hpp:97
Definition ngcdcsFINFO.hpp:35
Definition ngcdcsEXP.hpp:113
Definition ngcdcsFINFO.hpp:468
Definition ngcdcsACQ_DATA.hpp:121
Definition ngcdcsACQ.hpp:216
ngcbSEM * semStart
Start semaphore.
Definition ngcdcsACQ.hpp:218
int simErr_io
Simulate i/o-error.
Definition ngcdcsACQ.hpp:227
int status
Transfer status.
Definition ngcdcsACQ.hpp:239
int simErr_fatal
Simulate fatal error.
Definition ngcdcsACQ.hpp:233
~ngcdcs_recv_t()
Destructor.
Definition ngcdcsACQ.hpp:297
ngcdcs_acqperf_t statistics
Transfer statistics.
Definition ngcdcsACQ.hpp:245
int simErr_store
Simulate storage error.
Definition ngcdcsACQ.hpp:230
ngcbSEM * semCfg
Configuration access semaphore.
Definition ngcdcsACQ.hpp:221
int simErr_postproc
Simulate post-processing error.
Definition ngcdcsACQ.hpp:236
ngcdcs_recv_t(const ngcdcs_recv_t &other)
Copy constructor.
Definition ngcdcsACQ.hpp:269
int transferring
Transferring...
Definition ngcdcsACQ.hpp:224
ngcdcs_recv_t()
Constructor.
Definition ngcdcsACQ.hpp:283
char erms[256]
Error-message.
Definition ngcdcsACQ.hpp:248
ngcdcs_recv_t & operator=(const ngcdcs_recv_t &other)
Operator =.
Definition ngcdcsACQ.hpp:251
int lastTransfer
Last transfer of exposure.
Definition ngcdcsACQ.hpp:242
Definition ngcppInt.h:571