Merge branch 'ICSHWI-11597' into 'dev'
Icshwi 11597 See merge request epics-modules/adhama!7
This commit is contained in:
+3
-1
@@ -7,4 +7,6 @@ O.*
|
||||
*.db.*
|
||||
pv.list
|
||||
core.*
|
||||
.vscode
|
||||
.vscode
|
||||
list.txt
|
||||
.vscode/c_cpp_properties.json
|
||||
Vendored
+5
-5
@@ -6,11 +6,11 @@
|
||||
"${workspaceFolder}/**",
|
||||
"${workspaceFolder}/ADHamaApp/src/**",
|
||||
"${workspaceFolder}/ADHamaApp/src/",
|
||||
"/home/iocuser/.conda/envs/hama/epics/include/**",
|
||||
"/home/iocuser/.conda/envs/hama/epics/include/",
|
||||
"/home/iocuser/.conda/envs/hama/modules/adcore/3.10.0/include/",
|
||||
"/home/iocuser/.conda/envs/hama/modules/**",
|
||||
"/home/iocuser/.conda/envs/hama/epics/include/os/Linux"
|
||||
"/home/iocuser/.conda/envs/hama-dev/epics/include/**",
|
||||
"/home/iocuser/.conda/envs/hama-dev/epics/include/",
|
||||
"/home/iocuser/.conda/envs/hama-dev/modules/adcore/3.10.0/include/",
|
||||
"/home/iocuser/.conda/envs/hama-dev/modules/**",
|
||||
"/home/iocuser/.conda/envs/hama-dev/epics/include/os/Linux"
|
||||
],
|
||||
"defines": [],
|
||||
"compilerPath": "/usr/bin/gcc",
|
||||
|
||||
@@ -611,7 +611,7 @@ record(mbbo, "$(P)$(R)Binning-S") {
|
||||
field(ZRST, "1x1")
|
||||
field(ONVL, "2")
|
||||
field(ONST, "2x2")
|
||||
field(TWVL, "3")
|
||||
field(TWVL, "4")
|
||||
field(TWST, "4x4")
|
||||
# field(DRVL, "1")
|
||||
# field(DRVH, "3")
|
||||
@@ -626,7 +626,7 @@ record(mbbi, "$(P)$(R)Binning-RB") {
|
||||
field(ZRST, "1x1")
|
||||
field(ONVL, "2")
|
||||
field(ONST, "2x2")
|
||||
field(TWVL, "3")
|
||||
field(TWVL, "4")
|
||||
field(TWST, "4x4")
|
||||
field(INP, "@asyn($(PORT),$(ADDR),$(TIMEOUT))H_BINNING")
|
||||
field(SCAN, "I/O Intr")
|
||||
@@ -1541,7 +1541,6 @@ record(ai, "$(P)$(R)TimingInvalidExposurePeriod-RB") {
|
||||
# Internal Frame Rate
|
||||
record(ao, "$(P)$(R)InternalFrameRate-S") {
|
||||
field(DESC, "")
|
||||
field(PINI, "YES")
|
||||
field(DTYP, "asynFloat64")
|
||||
field(OUT, "@asyn($(PORT),$(ADDR),$(TIMEOUT))H_INTERNAL_FRAME_RATE")
|
||||
field(EGU, "Hz")
|
||||
@@ -1559,7 +1558,6 @@ record(ai, "$(P)$(R)InternalFrameRate-RB") {
|
||||
# Internal Frame Interval
|
||||
record(ao, "$(P)$(R)InternalFrameInternal-S") {
|
||||
field(DESC, "")
|
||||
field(PINI, "YES")
|
||||
field(DTYP, "asynFloat64")
|
||||
field(OUT, "@asyn($(PORT),$(ADDR),$(TIMEOUT))H_INTERNAL_FRAME_INTERVAL")
|
||||
field(EGU, "Sec")
|
||||
@@ -1616,8 +1614,8 @@ record(ai, "$(P)$(R)InternalLineInterval-RB") {
|
||||
record(mbbi, "$(P)$(R)ColorType-R") {
|
||||
field(DESC,"")
|
||||
field(DTYP, "asynInt32")
|
||||
field(ZRVL, "0")
|
||||
field(ZRST, "BW")
|
||||
field(ZRVL, "1")
|
||||
field(ZRST, "B & W")
|
||||
field(INP, "@asyn($(PORT),$(ADDR),$(TIMEOUT))H_COLOR_TYPE")
|
||||
field(SCAN, "I/O Intr")
|
||||
}
|
||||
|
||||
+527
-480
File diff suppressed because it is too large
Load Diff
+21
-9
@@ -138,15 +138,20 @@ class epicsShareClass Hama : public ADDriver {
|
||||
|
||||
public:
|
||||
Hama(const char*, int, int, size_t, int, int, int);
|
||||
// ~Hama();
|
||||
// ~Hama();
|
||||
/* override ADDriver methods */
|
||||
virtual asynStatus writeInt32(asynUser *pasynUser, epicsInt32 value);
|
||||
virtual asynStatus writeFloat64(asynUser *pasynUser, epicsFloat64 value);
|
||||
|
||||
// virtual asynStatus getBounds(asynUser *, epicsInt32 *low, epicsInt32 *high);
|
||||
//virtual asynStatus readEnum(asynUser *pasynUser, char *strings[], int values[],
|
||||
// int severities[], size_t nElements, size_t *nIn);
|
||||
virtual void report(FILE *fp, int details);
|
||||
|
||||
/* This function could be implemented as overwrite virtual readInt32, readFloat64 */
|
||||
/* It is however implemented in that way due to sugestion that only */
|
||||
/* writeInt32, writeFloat64, report should be overwrite */
|
||||
/* could be changed in the future */
|
||||
int readParameter(int paramIndex);
|
||||
int readParameterStr(int paramIndex);
|
||||
|
||||
|
||||
void imageTask();
|
||||
void temperatureTask();
|
||||
|
||||
@@ -279,6 +284,7 @@ private:
|
||||
|
||||
epicsEventId startEvent_;
|
||||
|
||||
// Helper functions
|
||||
asynStatus startAcquire(void);
|
||||
asynStatus stopAcquire(void);
|
||||
void getImageInformation(HDCAM hdcam, int32& pixeltype, int32& width, int32& rowbytes, int32& height, int32& framebytes);
|
||||
@@ -289,20 +295,26 @@ private:
|
||||
int allocateBuffers(unsigned int);
|
||||
int freeBuffers();
|
||||
|
||||
// These function will be read only once
|
||||
int connectCamera();
|
||||
int disconnectCamera();
|
||||
int initCamera();
|
||||
asynStatus updateSensorSize();
|
||||
asynStatus getParameter(int paramIndex);
|
||||
|
||||
// These function can be read more than once
|
||||
asynStatus readAttributes();
|
||||
asynStatus readSensor();
|
||||
|
||||
|
||||
|
||||
|
||||
// helper functions for dcamapi
|
||||
void printError(HDCAM hdcam, DCAMERR errid, const char* apiname, const char* fmt=NULL, ...);
|
||||
void printInfo(HDCAM hdcam);
|
||||
int dcamdev_string( DCAMERR& err, HDCAM hdcam, int32 idStr, char* text, int32 textbytes );
|
||||
int setParameter(int paramIndex);
|
||||
int getParameterStr(int paramIndex);
|
||||
|
||||
|
||||
int getProperties();
|
||||
|
||||
asynStatus setFeature(int featureIndex, double value);
|
||||
};
|
||||
|
||||
|
||||
+20
-3
@@ -1,23 +1,28 @@
|
||||
# This should be a test startup script
|
||||
require adhama
|
||||
require adpluginkafka
|
||||
|
||||
|
||||
epicsEnvSet("PREFIX", "Hama:")
|
||||
epicsEnvSet("PORT", "HAMA")
|
||||
epicsEnvSet("CAMERA", "0")
|
||||
epicsEnvSet("QSIZE", "21")
|
||||
epicsEnvSet("XSIZE", "10")
|
||||
epicsEnvSet("YSIZE", "10")
|
||||
epicsEnvSet("XSIZE", "2048")
|
||||
epicsEnvSet("YSIZE", "2048")
|
||||
epicsEnvSet("NCHANS", "2048")
|
||||
# Number of Elements
|
||||
epicsEnvSet("NELEMENTS", "4194304")
|
||||
epicsEnvSet("EPICS_CA_MAX_ARRAY_BYTES", "64000000")
|
||||
|
||||
#EVR settings
|
||||
epicsEnvSet("EVR", "YMIR-TS:Ctrl-EVR-01")
|
||||
epicsEnvSet("EVR_EVENT", "E")
|
||||
|
||||
# iocshLoad("$(adhama_DIR)ADHama.iocsh")
|
||||
|
||||
devHamamatsuConfig("$(PORT)", $(CAMERA), 0, 0, 0, 0, 10)
|
||||
|
||||
dbLoadRecords("$(adhama_DIR)db/hama.db","P=$(PREFIX),R=cam1:,EVR=LabS-Utgard-VIP:TS-EVR-3,E=F,PORT=$(PORT),ADDR=0,TIMEOUT=1")
|
||||
dbLoadRecords("$(adhama_DIR)db/hama.db","P=$(PREFIX),R=cam1:,EVR=$(EVR),E=$(EVR_EVENT),PORT=$(PORT),ADDR=0,TIMEOUT=1")
|
||||
|
||||
#asynSetTraceMask("$(PORT)",-1,0x9)
|
||||
#asynSetTraceIOMask("$(PORT)",-1,0x2)
|
||||
@@ -36,6 +41,15 @@ dbLoadRecords("$(adcore_DIR)/db/NDPva.template", "P=$(PREFIX),R=Pva1:, PORT=PVA
|
||||
NDStdArraysConfigure("Image1", "$(QSIZE)", 0, "$(PORT)", 0, 0)
|
||||
dbLoadRecords("NDStdArrays.template", "P=$(PREFIX),R=image1:,PORT=Image1,ADDR=0,TIMEOUT=1,NDARRAY_PORT=$(PORT),TYPE=Int32,FTVL=LONG,NELEMENTS=$(NELEMENTS)")
|
||||
|
||||
# Create a kafka plugin, set it to get data from hama driver.
|
||||
epicsEnvSet("KFK_SERVER_IP", "10.100.1.19")
|
||||
epicsEnvSet("KFK_SERVER_PORT", "9092")
|
||||
epicsEnvSet("KFK_TOPIC", "ymir_camera")
|
||||
|
||||
KafkaPluginConfigure("KFK1", 3, 1, "$(PORT)", 0, -1, "$(KFK_SERVER_IP):$(KFK_SERVER_PORT)", "$(KFK_TOPIC)", "hama_source")
|
||||
dbLoadRecords("$(adpluginkafka_DIR)db/adpluginkafka.db", "P=$(PREFIX), R=Kfk1:, PORT=KFK1, ADDR=0, TIMEOUT=1, NDARRAY_PORT=$(PORT)")
|
||||
|
||||
|
||||
startPVAServer
|
||||
|
||||
#
|
||||
@@ -49,6 +63,9 @@ iocInit()
|
||||
|
||||
dbpf Hama:cam1:PoolUsedMem.SCAN 0
|
||||
dbpf Hama:image1:EnableCallbacks 1
|
||||
dbpf Hama:Kfk1:EnableCallbacks 1
|
||||
|
||||
#dbpf Hama:cam1:TriggerPolarity-S # 2-positive, 1-negative
|
||||
|
||||
epicsThreadSleep(1.0)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user