ngc 1.4.0
 
Loading...
Searching...
No Matches
ngcdcsACQ.hpp
Go to the documentation of this file.
1
7#ifndef ngcdcsACQ_H
8#define ngcdcsACQ_H
9
10
11#ifndef __cplusplus
12#error This is a C++ include file and cannot be used from plain C
13#endif
14
15#include <ngc/core/ngcb.h>
16#include <ngc/core/ngcbSocket.h>
17#include <ngc/core/ngcbOBJ.hpp>
20#include <ngc/core/ngcbDIC.hpp>
22#include <ngc/core/ngcppInt.h>
30
31/*
32 * Error codes
33 */
34#define ngcdcsACQ_ERR_EXP_FILE -3 //< exposure file-i/o error
35#define ngcdcsACQ_ERR_EXP_PROC -2 //< exposure post-processing error
36#define ngcdcsACQ_ERR_FATAL -1 //< fatal error
37#define ngcdcsACQ_ERR_IO 1 //< i/o-error
38#define ngcdcsACQ_ERR_OVERRUN 2 //< run-time error: buffer overrun
39#define ngcdcsACQ_ERR_OVERFLOW 3 //< run-time error: FIFO overflow
40#define ngcdcsACQ_ERR_EXEC 4 //< acquisition process exec failed
41
42/*
43 * Shared memory libraries
44 */
45#define ngcdcsSHM_LIB_NONE 0 //< shared memory interface disabled
46#define ngcdcsSHM_LIB_TPL 1 //< shared memory interface template
47#define ngcdcsSHM_LIB_IPC 2 //< System V IPC shared memory interface
48#define ngcdcsSHM_LIB_RTD 3 //< rtd/rtdcore library
49
50/*
51 * Acquisition module soft states
52 */
53#define ngcdcsACQ_STAT_IDLE 0x00000000 //< idle
54#define ngcdcsACQ_STAT_READY 0x00000001 //< ready
55#define ngcdcsACQ_STAT_RUNNING 0x00000002 //< running
56#define ngcdcsACQ_STAT_FAILURE 0x00000004 //< failure
57#define ngcdcsACQ_STAT_PAUSED 0x00000008 //< paused
58
59/*
60 * Test error defintions
61 */
62#define ngcdcsACQ_TESTERR_DATA_IO 0x400 //< data i/o failed
63#define ngcdcsACQ_TESTERR_STORE 0x401 //< failed to store data to disk
64#define ngcdcsACQ_TESTERR_POSTPROC 0x402 //< post-processing error
65#define ngcdcsACQ_TESTERR_FATAL 0x404 //< fatal error
66
70#define ngcdcsACQ_MAX_PROC ngcdcsEXP_MAX_CLIENTS
71
75#define ngcdcsACQ_DEFAULT_BUFSIZE (2048 * 2048 * 4)
76
80#define ngcdcsACQ_MAX_FILESIZE (2147483647 - ngcbFITS_BLOCK_LEN)
81
82/*
83 * Streaming modes
84 */
85#define ngcdcsACQ_STREAMING_NONE 0 //< no streaming buffer
86#define ngcdcsACQ_STREAMING_DEFAULT -1 //< default streaming size
87#define ngcdcsACQ_STREAMING_AUTO -2 //< automatic streaming size
88#define ngcdcsACQ_STREAMING_PARALLEL -3 //< parallel streaming
89#define ngcdcsACQ_STREAMING_REQ -4 //< requested streaming size
90#define ngcdcsCV16_SIZE 8192 //< buffer size for CV16
91
96 int numDet; //< Number of detectors in mosaic
97 int haveChipIndex; //< Explicit chip index present
98 int addIdx; //< Flag to add detector index to filename
99 int det0; //< First detector in this instance
100 int sx; //< Lower left x (for HW-window)
101 int sy; //< Lower left y (for HW-window)
102 int nx; //< X-Dimension (for HW-window)
103 int ny; //< Y-Dimension (for HW-window)
104 int splitX; //< Split to FITS extension
105 int splitY; //< Split to FITS extension
106 ngcdcs_chip_t *chip; //< Chip info
107
110 numDet = 1;
111 haveChipIndex = 1;
112 addIdx = 0;
113 det0 = 0;
114 sx = 1;
115 sy = 1;
116 nx = 0;
117 ny = 0;
118 splitX = 1;
119 splitY = 1;
120 chip = NULL;
121 }
122};
123
128public:
129 double val; //< Mean value
130 double max; //< Maximum value
131
134 Clear();
135 }
136
138 void Clear() {
139 val = 0.0; max = 0.0; n_ = 0.0;
140 }
141
143 void Add(double d) {
144 if (d > 0.0)
145 {
146 n_ += 1.0;
147 if (d > max) max = d;
148 val = ((val * (n_ - 1.0)) + d) / n_;
149 }
150 }
151
152protected:
153
154private:
156 double n_;
157};
158
163public:
166
169
172
175
178
181
184
187
190
194
197 size.Add(p.size.val); net.Add(p.net.val); disk.Add(p.disk.val);
198 close.Add(p.close.val); file.Add(p.file.val); fits.Add(p.fits.val);
199 proc.Add(p.proc.val); total.Add(p.total.val); exp.Add(p.exp.val);
200 }
201
203 void Clear() {
204 size.Clear(); net.Clear(); disk.Clear(); close.Clear(); file.Clear();
205 fits.Clear(); proc.Clear(); total.Clear(); exp.Clear();
206 }
207
208protected:
209private:
210};
211
218
221
224
227
230
233
236
239
242
245
247 char erms[256];
248
251 if (this != &other)
252 {
253 semStart = new ngcbSEM(0);
254 semCfg = new ngcbSEMC(1);
256 simErr_io = other.simErr_io;
260 status = other.status;
261 strcpy(erms, other.erms);
263 }
264 return (*this);
265 }
266
269 semStart = new ngcbSEM(0);
270 semCfg = new ngcbSEMC(1);
272 simErr_io = other.simErr_io;
276 status = other.status;
277 strcpy(erms, other.erms);
279 }
280
283 semStart = new ngcbSEM(0);
284 semCfg = new ngcbSEMC(1);
285 transferring = 0;
286 simErr_io = 0;
287 simErr_store = 0;
288 simErr_fatal = 0;
289 simErr_postproc = 0;
291 erms[0] = '\0';
292 lastTransfer = 0;
293 }
294
297 if (semStart != NULL) delete semStart;
298 if (semCfg != NULL) delete semCfg;
299 }
300};
301
306{
307public:
310
313
315 virtual int FrameHandler(void *buffer, ngcdcs_finfo_t *finfo, char *erms) {
316 USE(buffer); USE(finfo); USE(erms);
317 return (ngcbSUCCESS);
318 }
319
321 virtual int FitsMerger(ngcbFITS *hdr, char *erms) {
322 USE(hdr); USE(erms);
323 return (ngcbSUCCESS);
324 }
325
327 virtual void AcqError(const char *erms, int id, void *descriptor) {
328 USE(erms); USE(id); USE(descriptor);
329 }
330
331protected:
332
333private:
334
335};
336
337
341class ngcdcsACQ: public ngcbOBJ, public ngcbTHREAD
342{
343public:
345 ngcdcsACQ();
346
348 explicit ngcdcsACQ(const ngcdcs_acq_cfg_t &cfg);
349
351 explicit ngcdcsACQ(ngcbPARAM_LIST *p);
352
355
357 virtual ~ngcdcsACQ();
358
361
364
367
369 char shmName[64];
370
373
375 int status;
376
379
381 char procName[256];
382
384 char burstProcess[256];
385
388
390 ssize_t allocSize;
391
394
397
400
402 int exp;
403
406
409
412
415
418
421
423 int flush;
424
427
429 char diskMemPath[256];
430
433
436
439
441 char moduleName[64];
442
445
448
451
453 int ppRev;
454
457
460
463
465 char rtdCmd[256];
466
469
472
475
478
480 char darkFrame[256];
481
483 char flatField[256];
484
486 char badPixMask[256];
487
489 char extName[80];
490
493
496
499
501 void ErrState(const char *msg, int id);
502
504 void SimError(int error);
505
508
510 int StartDebugger();
511
513 int StopDebugger();
514
516 int DebuggerRunning();
517
518 /*
519 * Configuration
520 */
521
523 void Profile(const char *id);
524
526 void Configure(const ngcdcs_acq_cfg_t &newConf);
527
529 void GetCfg(ngcdcs_acq_cfg_t *currentConf);
530
532 int Streaming(ssize_t size);
533
535 int Alloc(ssize_t size);
536
538 int Alloc();
539
541 void Free();
542
544 int ShmSelect(const char *libName, const char *nameSpace=NULL, int n=0);
545
547 int ShmName(const char *nameSpace);
548
550 int ShmNumBuf(int n);
551
553 int ShmNoWait(int flag);
554
556 int ShmNoWait() {return (shmNoWait_);}
557
559 void Sim(int flag);
560
562 int Sim() {return (sim_);}
563
565 void SofwMode(char *s);
566
568 char *Host();
569
571 int DataPath(const char *path);
572
574 const char *DataPath();
575
577 const char *Dev(int n=0);
578
580 int Pid();
581
583 void Release();
584
586 int Reset();
587
588
589 /*
590 * Process execution
591 */
592
594 int Exec();
595
597 int Exec(const char *newProcess);
598
600 void Abort();
601
603 int FdCmd();
604
606 int FdErr();
607
609 void HandleFdCmdEvt();
610
612 int HandleFdErrEvt();
613
614
615 /*
616 * Run control
617 */
618
620 char *StatusString();
621
623 int Start(double absTime = 0.0);
624
626 int Stop();
627
629 int ResumeSim();
630
632 int Restart(double absTime = 0.0);
633
635 void SetupId(int id = -1);
636
638 int NewSetup();
639
641 int End();
642
644 int ResetCnt();
645
647 int Pause();
648
650 int Cont();
651
653 int Cmd(const char *cmd, char *reply);
654
656 int UploadFits(int id, const char *path, int noCheck=0);
657
659 int UploadBuf(int id, void *buffer, int size, int noCheck=0);
660
662 int Clear(int id);
663
665 int DarkFrame(const char *path);
666
668 int FlatField(const char *path);
669
671 int BadPixMask(const char *path);
672
674 int ChanSelect(int chan);
675
677 int SimTime(int ms);
678
680 int SimTime();
681
682
683
684 /*
685 * Burst modes
686 */
687
689 int Burst(int num);
690
692 int BurstSkip(int num);
693
695 int Queue(int num);
696
698 void QueueWin(int sx, int sy, int nx, int ny);
699
701 void QueueAlign();
702
704 int DiskMem(int flag);
705
707 int DiskMemPath(const char *path);
708
710 int DiskMemCreate(int size);
711
713 int DiskMemDelete();
714
715
716 /*
717 * Parameter interface
718 */
719
721 void Dictionary(ngcbDIC *dictionary);
722
724 int HwWin(int sx, int sy, int nx, int ny);
725
726 // synchronize parameter setup
727 int SyncParam(int timeout = 20);
728
729 // set parameter
730 int SetParam(const char *paramName, const char *paramValue, int sync=1);
731
733 int GetParam(const char *paramName, char *paramValue);
734
736 int ApplyParamList(ngcbPARAM_LIST *list, int sync = 1);
737
739 int ApplyParamList(int sync = 1);
740
741
742 /*
743 * Exposure and frame setup
744 */
745
747 void Exposure(ngcdcsEXP *exposure);
748
751
753 void NumExtBlocks(int n);
754
756 int LocalMedia();
757
759 int FrameDef(ngcdcs_framedef_t *frameDef);
760
762 ngcdcs_framedef_t *Frame(const char *name);
763
765 ngcdcs_framedef_t *Frame(int idx);
766
768 int FrameGen(const char *name, int flag);
769
771 void SeqStartTime(struct timeval &timeVal);
772
774 const char *SeqStartTime();
775
777 void ExpStartTime(struct timeval &timeVal);
778
780 const char *ExpStartTime();
781
783 double ExpStartTimeMJD();
784
786 double ExpStartTimeUTC();
787
789 int ExpSeqNo();
790
792 int ExpActive();
793
795 int StartExposure();
796
798 void StopExposure();
799
801 int ExtDtt() {return dtt_.enabled;}
802
804 size_t FramesProcessed();
805
807 size_t SizeRecorded();
808
809 /*
810 * Asynchronous data transfer
811 */
812
815
817 int StartTransferring();
818
820 void StopTransferring();
821
823 int Transferring();
824
826 int LastTransfer();
827
829 int DataServerStatus(int *num, char **clients);
830
832 int Transfer(int flag);
833
835 int Guiding(int flag);
836
837
838 /*
839 * Statistics
840 */
841
843 unsigned int DmaCnt();
844
846 double Perf();
847
849 double FrameRate();
850
852 void Statistics(ngcdcs_acqperf_t *stat);
853
855 void ClearStatistics();
856
858 char *ErrMsg();
859
860protected:
862 virtual int DataConnect();
863
865 virtual int Store(char *buffer, ngcdcs_finfo_t finfo, char *where,
866 int store2tmp = 0);
867
869 virtual ngcdcsSHM *NewShm(const char *name);
870
871private:
873 char ermsMain_[256];
874
876 char ermsThr_[256];
877
879 ngcdcsACQ_SERVICE *services_;
880
882 ngcbTHREAD *debugThread_;
883
885 int debugService_;
886
888 int debugPort_;
889
891 void Init_();
892
894 void CheckResult_(int result);
895
897 void Debugger_(ngcbTHREAD *thr, void *arg);
898
899
900
901 /*
902 * Configuration
903 */
904
906 void NewStatus_(int);
907
909 char statStr_[32];
910
912 char profile_[32];
913
915 int sim_;
916
918 int simTime_;
919
921 ngcdcs_acq_cfg_t cfg_;
922
924 int errPort_;
925
927 int fdCmd_;
928
930 int fdErr_;
931
933 int pid_;
934
936 char acqCmdLine_[256];
937
939 int vb_;
940
942 char thisHost_[64];
943
945 char acqHost_[64];
946
948 char acqDataPathReq_[256];
949
951 char acqDataPath_[256];
952
954 char procNameOrig_[256];
955
956
957 /*
958 * Dynamic parameters
959 */
960
962 int numParam_;
963
965 ngcppPARAM_NAMES paramName_;
966
968 int paramType_[ngcppMAX_PARAMSIZE];
969
971 int setupId_;
972
974 ngcbDIC *dictionary_;
975
977 ngcbPARAM_LIST *paramList_;
978
980 void Export_(ngcppPARAM_VALUES paramBuf);
981
982
983 /*
984 * Data reception process
985 */
986
988 ngcdcsDTT_COM dtt_;
989
991 ngcdcsEXP expLocal_;
992
994 ngcdcsEXP *exposure_;
995
997 char seqStartTime_[64];
998
1000 void RecvProc_(ngcbTHREAD *thr, void *arg);
1001
1003 ngcbTHREAD *recvThread_;
1004
1006 void RecvEvt_(ngcdcs_expevt_t evt);
1007
1009 ngcdcs_recv_t recv_;
1010
1012 int expActive_;
1013
1015 int numStore_;
1016
1018 ngcdcs_acqperf_t statistics_;
1019
1021 double expTime_;
1022
1024 int suspended_;
1025
1027 size_t framesProcessed_;
1028
1030 size_t sizeRecorded_;
1031
1032 /*
1033 * Background receiver
1034 */
1035
1037 void RecvBgProc_(ngcbTHREAD *thr, void *arg);
1038
1040 ngcbTHREAD *recvBgThread_;
1041
1043 ngcdcs_recv_t recvBg_;
1044
1046 int RecvBgStart_();
1047
1049 int RecvBgStop_();
1050
1052 int RecvBgOn_();
1053
1054
1055 /*
1056 * Frame type definitions
1057 */
1058
1060 int types_;
1061
1064
1066 char *frameBuf_;
1067
1069 size_t frameBufSize_;
1070
1072 int queueType_;
1073
1075 int qsx_;
1076
1078 int qsy_;
1079
1081 int qnx_;
1082
1084 int qny_;
1085
1086
1087 /*
1088 * Share memory interface
1089 */
1090
1092 int shmNoWait_;
1093
1095 void *ShMemAlloc_(size_t);
1096
1098 void ShMemFree_();
1099
1100
1101 /*
1102 * Streaming buffer
1103 */
1104
1106 ssize_t streamBufSize_;
1107
1109 int streamBufMode_;
1110
1112 void Streaming_(FILE *fd);
1113
1115 void AutoStreaming_();
1116
1117
1118 /*
1119 * Data cube routines
1120 */
1121
1123 int CubeOpen_(ngcdcs_framedef_t *f);
1124
1126 int CubeHeader_();
1127
1129 int CubeHeader_(ngcbFITS *fhdr, ngcdcsCUBE *cube);
1130
1132 int CubeClose_(ngcdcsCUBE *cube, const char *fileName=NULL);
1133
1135 int CubeNext_(ngcdcsCUBE *cube);
1136
1137
1138 /*
1139 * FITS-routines
1140 */
1141 unsigned short *cv16Buf_;
1142
1144 ngcbFITS fits_;
1145
1147 ngcbFITS cubeHdr_;
1148
1150 ngcbFITS efits_;
1151
1153 ngcb_off_t hdrSeek_;
1154
1156 ngcbFITS cfits_;
1157
1159 FILE *fdExt_;
1160
1162 int ExtFitsOpen_();
1163
1165 int ExtFitsPrimHeader_();
1166
1168 int ExtFitsHeader_(ngcdcs_finfo_t finfo);
1169
1171 void ExtFitsClear_(FILE *fd, ngcb_off_t offset);
1172
1174 int ExtFitsUpdate_(FILE *fd);
1175
1177 int ExtFitsClose_(int immediate=1);
1178
1180 char extFitsFileName_[512];
1181
1183 int MosaicWin_(ngcdcs_finfo_t finfo, int x, int y, int *sx, int *sy,
1184 int *nx, int *ny, int *px, int *py);
1185
1187 int Chip2Fits_(ngcbFITS *f, int idx, int splitX, int splitY, int doIdx=0);
1188
1190 int WrCv16_(FILE *fd, const char *buffer, size_t size);
1191
1193 int Win2File_(FILE *fd, char *buffer, int fx, int fy, int bitPix,
1194 int sx, int sy, int nx, int ny, int rot);
1195
1197 int CompleteFits_(ngcbFITS *hdr);
1198
1200 int StoreFits_(char *buffer, ngcdcs_finfo_t finfo, char *where,
1201 int store2Tmp = 0);
1202
1204 int StoreFitsCube_(char *buffer, ngcdcs_finfo_t finfo, char *where);
1205
1207 int StoreFitsExt_(char *buffer, ngcdcs_finfo_t finfo, char *where);
1208};
1209
1210#endif
Definition ngcbDIC.hpp:50
Definition ngcbFITS.hpp:24
Definition ngcbIMGOP.hpp:19
ngcbOBJ()
Constructor.
Definition ngcbOBJ.cpp:34
Definition ngcbPARAM.hpp:200
Definition ngcbTHREAD.hpp:158
Definition ngcbTHREAD.hpp:67
ngcbSERVICE()
Constructor.
Definition ngcbSERVICE.hpp:38
ngcbTHREAD()
Normal constructor.
Definition ngcbTHREAD.cpp:52
Definition ngcdcsACQ_DATA.hpp:217
Definition ngcdcsACQ.hpp:306
virtual ~ngcdcsACQ_SERVICE()
Destructor.
Definition ngcdcsACQ.hpp:312
ngcdcsACQ_SERVICE()
Constructor.
Definition ngcdcsACQ.hpp:309
virtual int FitsMerger(ngcbFITS *hdr, char *erms)
FITS-merger.
Definition ngcdcsACQ.hpp:321
virtual int FrameHandler(void *buffer, ngcdcs_finfo_t *finfo, char *erms)
Frame post-processing handler.
Definition ngcdcsACQ.hpp:315
virtual void AcqError(const char *erms, int id, void *descriptor)
Acquisition module error state handler.
Definition ngcdcsACQ.hpp:327
int ChanSelect(int chan)
Select DMA channels in use.
Definition ngcdcsACQ.cpp:1466
int UploadBuf(int id, void *buffer, int size, int noCheck=0)
Upload data buffer to acq.-process.
Definition ngcdcsACQ.cpp:1290
void Profile(const char *id)
Apply profile.
Definition ngcdcsACQ.cpp:330
char badPixMask[256]
Bad-pixel-mask.
Definition ngcdcsACQ.hpp:486
int BurstSkip(int num)
Set frames to skip before burst.
Definition ngcdcsAcqBurst.cpp:162
int FlatField(const char *path)
Upload flat-field.
Definition ngcdcsACQ.cpp:1401
char extName[80]
Extension name for "cube-ext" format.
Definition ngcdcsACQ.hpp:489
int End()
Set flag to end processing a.s.a.p.
Definition ngcdcsACQ.cpp:890
void StopTransferring()
Stop data transfer.
Definition ngcdcsAcqRecv.cpp:117
int ResetCnt()
Set flag to reset process counters.
Definition ngcdcsACQ.cpp:929
int flush
Flush stream after each image.
Definition ngcdcsACQ.hpp:423
int LocalMedia()
Return 1 in case any frame is store to local media on the NGC-LLCU.
Definition ngcdcsAcqExp.cpp:156
int Transferring()
Check protected transferring flag.
Definition ngcdcsAcqRecv.cpp:141
ngcdcsACQ_DATA data
Data interface.
Definition ngcdcsACQ.hpp:814
int queueSize
Queue size.
Definition ngcdcsACQ.hpp:414
int ExtDtt()
External DTT enabled.
Definition ngcdcsACQ.hpp:801
int ShmSelect(const char *libName, const char *nameSpace=NULL, int n=0)
Select shared memory interface type.
Definition ngcdcsAcqShm.cpp:122
void Statistics(ngcdcs_acqperf_t *stat)
Get transfer statistics.
Definition ngcdcsACQ.cpp:521
int StartDebugger()
Start debugger.
Definition ngcdcsAcqProc.cpp:1568
int continuous
Continuous mode flag (no counter reset)
Definition ngcdcsACQ.hpp:405
char flatField[256]
Flat-field.
Definition ngcdcsACQ.hpp:483
ngcdcsEXP * Exposure()
Return current exposure setup.
Definition ngcdcsAcqExp.cpp:185
ngcdcsSHM * shm
Shared memory object.
Definition ngcdcsACQ.hpp:363
char * ErrMsg()
Error message.
Definition ngcdcsACQ.cpp:300
int largeFile
Flag to enable/disable large file extension.
Definition ngcdcsACQ.hpp:432
int Transfer(int flag)
Enable/disable sustained transfer.
Definition ngcdcsAcqRecv.cpp:155
void GetCfg(ngcdcs_acq_cfg_t *currentConf)
Get configuration.
Definition ngcdcsACQ.cpp:381
const char * DataPath()
Return acquisition process local data path.
Definition ngcdcsAcqStore.cpp:1460
void NumExtBlocks(int n)
Set umber of reserved extension header blocks.
Definition ngcdcsAcqExtFits.cpp:1207
int ShmNoWait()
Return shared-memory no-wait flag.
Definition ngcdcsACQ.hpp:556
const char * SeqStartTime()
Get sequencer start time.
Definition ngcdcsAcqExp.cpp:649
int ShmNumBuf(int n)
Set number of shared memory buffers.
Definition ngcdcsAcqShm.cpp:297
double ExpStartTimeUTC()
Get exposure start time (UTC seconds since midnight)
Definition ngcdcsAcqExp.cpp:630
int ExpActive()
An exposure is running.
Definition ngcdcsAcqExp.cpp:190
int StopDebugger()
Stop debugger.
Definition ngcdcsAcqProc.cpp:1620
int FrameDef(ngcdcs_framedef_t *frameDef)
Currently defined frames.
Definition ngcdcsAcqFrames.cpp:26
int HwWin(int sx, int sy, int nx, int ny)
Set HW read-out window.
Definition ngcdcsAcqParam.cpp:401
int exp
Enable exposure.
Definition ngcdcsACQ.hpp:402
int appDataInline
Pre-processor application meta data inline flag.
Definition ngcdcsACQ.hpp:459
int HandleFdErrEvt()
Handle input on FdErr() - run-time error.
Definition ngcdcsAcqProc.cpp:1485
char burstProcess[256]
Process name for burst.
Definition ngcdcsACQ.hpp:384
int Reset()
Internal cleanup.
Definition ngcdcsACQ.cpp:492
int Stop()
Send stop-cmd to acq.-process.
Definition ngcdcsACQ.cpp:805
virtual ngcdcsSHM * NewShm(const char *name)
Shared memory creator.
Definition ngcdcsAcqShm.cpp:96
char shmName[64]
Shared memory interface name-space.
Definition ngcdcsACQ.hpp:369
int dataPort
Actual data server port.
Definition ngcdcsACQ.hpp:450
void QueueWin(int sx, int sy, int nx, int ny)
Align detector queue window.
Definition ngcdcsAcqBurst.cpp:253
int ResumeSim()
Resume suspended simulation.
Definition ngcdcsACQ.cpp:837
int diskMemSize
Disk-memory extension size.
Definition ngcdcsACQ.hpp:426
const char * ExpStartTime()
Get exposure start time.
Definition ngcdcsAcqExp.cpp:620
int diskMem
Disk-memory extension flag.
Definition ngcdcsACQ.hpp:420
int SimTime()
Get simulation interval (milliseconds)
Definition ngcdcsACQ.cpp:1533
void Dictionary(ngcbDIC *dictionary)
Attach to dictionary.
Definition ngcdcsACQ.cpp:325
int transfer
Transfer flag (sustained connection)
Definition ngcdcsACQ.hpp:408
int ppRev
Pre-processor framework revision.
Definition ngcdcsACQ.hpp:453
size_t FramesProcessed()
Return number of processed frames in recording sequence.
Definition ngcdcsACQ.cpp:1631
int Exec()
Launch last acq.-process.
Definition ngcdcsAcqProc.cpp:24
double ExpStartTimeMJD()
Get exposure start time (MJD)
Definition ngcdcsAcqExp.cpp:625
int shmLib
Shared memory interface library.
Definition ngcdcsACQ.hpp:366
int guiding
Guiding flag (sustained connection)
Definition ngcdcsACQ.hpp:411
int Streaming(ssize_t size)
Set streaming buffer size.
Definition ngcdcsAcqStream.cpp:67
void ErrState(const char *msg, int id)
Go to error state.
Definition ngcdcsACQ.cpp:312
int Burst(int num)
Set number of burst-frames.
Definition ngcdcsAcqBurst.cpp:26
int DataServerStatus(int *num, char **clients)
Retrieve data server status.
Definition ngcdcsACQ.cpp:1496
ngcdcsRTD * rtd
RTD connection database.
Definition ngcdcsACQ.hpp:468
int payloadSize
Payload size for RTMS (bytes)
Definition ngcdcsACQ.hpp:462
void SimError(int error)
Trigger an error simulation.
Definition ngcdcsACQ.cpp:1666
int FdCmd()
Returns command server file descriptor.
Definition ngcdcsAcqProc.cpp:1438
char * Host()
Return acquisition process host name.
Definition ngcdcsACQ.cpp:402
unsigned int DmaCnt()
Return current DMA counter.
Definition ngcdcsACQ.cpp:1649
ngcdcs_framedef_t * Frame(const char *name)
Get frame info.
Definition ngcdcsAcqFrames.cpp:271
int UploadFits(int id, const char *path, int noCheck=0)
Upload FITS-file to acq.-process.
Definition ngcdcsACQ.cpp:1154
int Cmd(const char *cmd, char *reply)
Send ASCII command to acq.-process.
Definition ngcdcsACQ.cpp:1053
int DiskMemPath(const char *path)
Set disk-memory extension path.
Definition ngcdcsAcqBurst.cpp:285
ngcdcs_acq_dcf_t detCfg
Detector configuration.
Definition ngcdcsACQ.hpp:387
int BadPixMask(const char *path)
Upload bad-pixel-mask.
Definition ngcdcsACQ.cpp:1433
int shmNumBuf
Number of shared memory buffers.
Definition ngcdcsACQ.hpp:372
int simHighSpeed
Flag to enable/disabel high-speed simulation.
Definition ngcdcsACQ.hpp:435
int appRev
Pre-processor application revision.
Definition ngcdcsACQ.hpp:456
void HandleFdCmdEvt()
Handle input on FdCmd() - i/o error case.
Definition ngcdcsAcqProc.cpp:1448
void QueueAlign()
Align queue-mode frame parameters.
Definition ngcdcsAcqProc.cpp:1281
int Guiding(int flag)
Enable/disable guiding mode.
Definition ngcdcsAcqRecv.cpp:216
int status
Soft state: idle, ready, running ...
Definition ngcdcsACQ.hpp:375
char * StatusString()
Get status string.
Definition ngcdcsACQ.cpp:516
void Free()
Release frame buffer.
Definition ngcdcsAcqExp.cpp:137
int autoWinX
Apply automatic window in X.
Definition ngcdcsACQ.hpp:492
void Release()
Release module.
Definition ngcdcsACQ.cpp:469
void ClearStatistics()
Clear transfer statistics.
Definition ngcdcsACQ.cpp:531
int NewSetup()
Mark new setup.
Definition ngcdcsACQ.cpp:1105
int connect
Enable data connection.
Definition ngcdcsACQ.hpp:399
int cmdPort
Actual command server port.
Definition ngcdcsACQ.hpp:447
const char * Dev(int n=0)
Return acquisition process device name.
Definition ngcdcsACQ.cpp:421
virtual int DataConnect()
Establish data connection.
Definition ngcdcsACQ.cpp:541
ngcdcsSUBFRM * subFrames
Sub-frames.
Definition ngcdcsACQ.hpp:471
char rtdCmd[256]
RTD startup command.
Definition ngcdcsACQ.hpp:465
void Abort()
Abort acq.-process.
Definition ngcdcsAcqProc.cpp:1299
ngcbIMGOP imgop
Image operations.
Definition ngcdcsACQ.hpp:477
int burstSkip
Frames to skip before starting burst.
Definition ngcdcsACQ.hpp:396
int FrameGen(const char *name, int flag)
Switch frame generation on/off.
Definition ngcdcsAcqFrames.cpp:301
int LastTransfer()
Check last-transfer flag.
Definition ngcdcsAcqRecv.cpp:249
int Sim()
Get simulation mode.
Definition ngcdcsACQ.hpp:562
int GetParam(const char *paramName, char *paramValue)
Get parameter.
Definition ngcdcsAcqParam.cpp:187
char darkFrame[256]
Dark-frame (bias)
Definition ngcdcsACQ.hpp:480
int ioError
Flag for io-error.
Definition ngcdcsACQ.hpp:378
int DiskMemDelete()
Delete disk-memory.
Definition ngcdcsAcqBurst.cpp:396
int Queue(int num)
Setup queue mode.
Definition ngcdcsAcqBurst.cpp:228
int StartExposure()
Start exposure.
Definition ngcdcsAcqExp.cpp:201
size_t ppStackSize
Post-processor stack size in bytes (0 = use system default)
Definition ngcdcsACQ.hpp:360
int queueDump
Queue dump mode.
Definition ngcdcsACQ.hpp:417
int ExpSeqNo()
Get exposure sequence number.
Definition ngcdcsAcqExp.cpp:635
int relaunch
relaunch flag - restet at Exec()
Definition ngcdcsACQ.hpp:498
int ShmName(const char *nameSpace)
Set shared memory interface name-space.
Definition ngcdcsAcqShm.cpp:223
ngcbTHREAD_T mainThread
Main thread id.
Definition ngcdcsACQ.hpp:474
int updateFrames
Flags that frame config. has changed.
Definition ngcdcsACQ.hpp:438
ngcdcsACQ()
Constructor.
Definition ngcdcsACQ.cpp:29
char moduleName[64]
Optional module name.
Definition ngcdcsACQ.hpp:441
double Perf()
Current CPU load in percent.
Definition ngcdcsACQ.cpp:1573
int chanSelect
DMA channel selection.
Definition ngcdcsACQ.hpp:444
virtual int Store(char *buffer, ngcdcs_finfo_t finfo, char *where, int store2tmp=0)
Store data to file.
Definition ngcdcsAcqStore.cpp:1336
void SetupId(int id=-1)
Set new setup id (or use auto-increment)
Definition ngcdcsACQ.cpp:1085
void Configure(const ngcdcs_acq_cfg_t &newConf)
Configure system.
Definition ngcdcsACQ.cpp:335
int SyncParam(int timeout=20)
Definition ngcdcsAcqParam.cpp:253
void StopExposure()
Stop exposure.
Definition ngcdcsAcqExp.cpp:551
int Cont()
Continue acquisition.
Definition ngcdcsACQ.cpp:1013
double FrameRate()
Current frame rate.
Definition ngcdcsACQ.cpp:1602
int Start(double absTime=0.0)
Send start-cmd to acq.-process.
Definition ngcdcsACQ.cpp:671
int StartTransferring()
Start data transfer.
Definition ngcdcsAcqRecv.cpp:27
ssize_t allocSize
Frame buffer size preset (in bytes)
Definition ngcdcsACQ.hpp:390
virtual ~ngcdcsACQ()
Destructor.
Definition ngcdcsACQ.cpp:60
void SofwMode(char *s)
Get software operational mode (string)
Definition ngcdcsACQ.cpp:438
int autoWinY
Apply automatic window in Y.
Definition ngcdcsACQ.hpp:495
char diskMemPath[256]
Disk-memory extension path.
Definition ngcdcsACQ.hpp:429
int Pid()
Return actual process id.
Definition ngcdcsACQ.cpp:428
int Pause()
Pause acquisition.
Definition ngcdcsACQ.cpp:973
int DiskMem(int flag)
Enable/disable disk-memory extension.
Definition ngcdcsAcqBurst.cpp:261
int DarkFrame(const char *path)
Upload dark-frame.
Definition ngcdcsACQ.cpp:1369
int Restart(double absTime=0.0)
Restart process.
Definition ngcdcsACQ.cpp:861
int Clear(int id)
Clear uploaded data (invalidate)
Definition ngcdcsACQ.cpp:1354
void AttachServices(ngcdcsACQ_SERVICE *s)
Attach services.
Definition ngcdcsACQ.cpp:294
size_t SizeRecorded()
Return recorded data size (in bytes)
Definition ngcdcsACQ.cpp:1640
char procName[256]
Process name.
Definition ngcdcsACQ.hpp:381
int ApplyParamList(ngcbPARAM_LIST *list, int sync=1)
Apply spec. list.
Definition ngcdcsAcqParam.cpp:278
int FdErr()
Returns error-stack file descriptor.
Definition ngcdcsAcqProc.cpp:1443
int SetParam(const char *paramName, const char *paramValue, int sync=1)
Definition ngcdcsAcqParam.cpp:68
int Alloc()
Apply frame buffer size preset.
Definition ngcdcsAcqExp.cpp:132
int burstNum
Number of bursts.
Definition ngcdcsACQ.hpp:393
int DiskMemCreate(int size)
Create disk-memory.
Definition ngcdcsAcqBurst.cpp:341
int DebuggerRunning()
Check, if debugger is running.
Definition ngcdcsAcqProc.cpp:1643
Definition ngcdcsFINFO.hpp:285
Definition ngcdcsDTT_COM.hpp:125
Definition ngcdcsEXP.hpp:178
Definition ngcdcsRTD.hpp:57
Definition ngcdcsSHM.hpp:40
Definition ngcdcsSUBFRM.hpp:48
Definition ngcdcsACQ.hpp:127
double val
Definition ngcdcsACQ.hpp:129
void Clear()
Clear statistics.
Definition ngcdcsACQ.hpp:138
double max
Definition ngcdcsACQ.hpp:130
void Add(double d)
Add measurement.
Definition ngcdcsACQ.hpp:143
ngcdcs_acq_stat_t()
Constructor.
Definition ngcdcsACQ.hpp:133
Definition ngcdcsACQ.hpp:162
void Add(ngcdcs_acqperf_t &p)
Add measurement.
Definition ngcdcsACQ.hpp:196
ngcdcs_acq_stat_t total
Total transfer overhead in seconds.
Definition ngcdcsACQ.hpp:186
ngcdcs_acq_stat_t proc
Post-processing overhead in seconds.
Definition ngcdcsACQ.hpp:171
ngcdcs_acq_stat_t disk
Disk overhead in seconds.
Definition ngcdcsACQ.hpp:177
ngcdcs_acqperf_t()
Constructor.
Definition ngcdcsACQ.hpp:192
ngcdcs_acq_stat_t net
Network overhead in seconds.
Definition ngcdcsACQ.hpp:168
ngcdcs_acq_stat_t close
File closing overhead in seconds.
Definition ngcdcsACQ.hpp:180
ngcdcs_acq_stat_t exp
Total exposure time in seconds.
Definition ngcdcsACQ.hpp:189
ngcdcs_acq_stat_t file
File creation overhead in seconds.
Definition ngcdcsACQ.hpp:174
void Clear()
Clear all measurments.
Definition ngcdcsACQ.hpp:203
ngcdcs_acq_stat_t size
Reference size for rate in bytes.
Definition ngcdcsACQ.hpp:165
ngcdcs_acq_stat_t fits
FITS-header overhead in seconds.
Definition ngcdcsACQ.hpp:183
pthread_t ngcbTHREAD_T
Definition ngcbTHREAD.hpp:57
off_t ngcb_off_t
Definition ngcb.h:45
#define USE(x)
Definition ngcb.h:28
#define ngcbSUCCESS
Definition ngcb.h:137
#define ngcdcsMAX_FRAME_TYPES
Definition ngcdcsFINFO.hpp:23
#define ngcppMAX_PARAMSIZE
Definition ngcppInt.h:266
char ngcppPARAM_NAMES[ngcppMAX_PARAMSIZE][256]
Definition ngcppInt.h:279
int ngcppPARAM_VALUES[ngcppMAX_PARAMSIZE]
Definition ngcppInt.h:284
Definition ngcdcsACQ_DATA.hpp:24
Definition ngcdcsACQ.hpp:95
int det0
Definition ngcdcsACQ.hpp:99
int splitX
Definition ngcdcsACQ.hpp:104
int haveChipIndex
Definition ngcdcsACQ.hpp:97
ngcdcs_chip_t * chip
Definition ngcdcsACQ.hpp:106
int splitY
Definition ngcdcsACQ.hpp:105
int sx
Definition ngcdcsACQ.hpp:100
int ny
Definition ngcdcsACQ.hpp:103
int sy
Definition ngcdcsACQ.hpp:101
int addIdx
Definition ngcdcsACQ.hpp:98
int nx
Definition ngcdcsACQ.hpp:102
ngcdcs_acq_dcf_t()
Constructor.
Definition ngcdcsACQ.hpp:109
int numDet
Definition ngcdcsACQ.hpp:96
Definition ngcdcsFINFO.hpp:33
Definition ngcdcsEXP.hpp:112
Definition ngcdcsFINFO.hpp:462
Definition ngcdcsACQ_DATA.hpp:120
Definition ngcdcsACQ.hpp:215
ngcbSEM * semStart
Start semaphore.
Definition ngcdcsACQ.hpp:217
int simErr_io
Simulate i/o-error.
Definition ngcdcsACQ.hpp:226
int status
Transfer status.
Definition ngcdcsACQ.hpp:238
int simErr_fatal
Simulate fatal error.
Definition ngcdcsACQ.hpp:232
~ngcdcs_recv_t()
Destructor.
Definition ngcdcsACQ.hpp:296
ngcdcs_acqperf_t statistics
Transfer statistics.
Definition ngcdcsACQ.hpp:244
int simErr_store
Simulate storage error.
Definition ngcdcsACQ.hpp:229
ngcbSEM * semCfg
Configuration access semaphore.
Definition ngcdcsACQ.hpp:220
int simErr_postproc
Simulate post-processing error.
Definition ngcdcsACQ.hpp:235
ngcdcs_recv_t(const ngcdcs_recv_t &other)
Copy constructor.
Definition ngcdcsACQ.hpp:268
int transferring
Transferring...
Definition ngcdcsACQ.hpp:223
ngcdcs_recv_t()
Constructor.
Definition ngcdcsACQ.hpp:282
char erms[256]
Error-message.
Definition ngcdcsACQ.hpp:247
ngcdcs_recv_t & operator=(const ngcdcs_recv_t &other)
Operator =.
Definition ngcdcsACQ.hpp:250
int lastTransfer
Last transfer of exposure.
Definition ngcdcsACQ.hpp:241