104 Commits

Author SHA1 Message Date
Marco Filho
38218b883e Merge branch 'ICSHWI-22046' into 'master'
Overwrite default initial values

See merge request epics-modules/adorca!30
2025-10-15 16:52:00 +02:00
marcofilho
77b5441d23 Overwrite default initial values 2025-10-15 16:48:35 +02:00
marcofilho
7ee6421657 Update example st.cmd
From this version onwards, it is possible to pass all the data to
ndpluginschemas and then to kafka newest versions, intead of passing
straight to kafka.
2025-10-15 13:09:47 +02:00
Marco Filho
def770e2f8 Merge branch 'improve-timestamp' into 'master'
Pass timestamp to epicsTS instead of timeStamp

See merge request epics-modules/adorca!29
2025-10-15 13:03:58 +02:00
marcofilho
cceb18989b Make epicsTS carry the proper EVR timestamp
epicsTS is the one passed to kafka: https://gitlab.esss.lu.se/epics-modules/ADPluginKafka/-/blob/2.0.2/adpluginkafkaApp/src/KafkaPlugin.cpp?ref_type=tags#L40
The documentation is a bit confusing on what is the difference between
epicsTS and timeStamp, but apparently both can be modified with no
problems.

After [this discussion](github.com/areaDetector/ADCore/issues?q=is%3Aissue%20state%3Aclosed)
I decided it was fine to keep the epicsTS in nanoseconds with the EVR
values.
2025-10-15 13:00:16 +02:00
marcofilho
e2d6d48cde Decrease image-timestamp latency.
The timestamp buffer is now filled unconditionally, always after
dcamcap_transferinfo is called. It is only used, however, if trigger
mode is external.

This reduces time between detecting an image and getting the timestamp
from around 1.6 ms to around 200 ns.
2025-10-10 16:48:07 +02:00
Jim Larsson
62065f7f44 Merge branch 'v1.1.2_fix' into 'master'
uncomment line

See merge request epics-modules/adorca!28
2024-12-19 10:49:18 +00:00
Jim Larsson
00cb454e8c uncomment line 2024-12-19 11:24:08 +01:00
Jim Larsson
66cbff0ca4 Merge branch '1.1.2_bugfixes' into 'master'
fix compilation errors and warnings

See merge request epics-modules/adorca!27
2024-12-18 13:17:23 +00:00
Jim Larsson
934ce7afd0 fix compilation errors and warnings 2024-12-18 13:16:44 +00:00
Jim Larsson
47a2b8435f Merge branch 'ICSHWI_19722_orca_acq_modes' into 'master'
Icshwi 19722 orca acq modes

See merge request epics-modules/adorca!26
2024-12-18 13:04:13 +00:00
Jim Larsson
eaebcece9d added placeholder for LEVEL and sync triggers 2024-12-05 16:21:56 +01:00
Jim Larsson
994242e524 seperate timeout from syncreadout 2024-12-03 14:47:06 +01:00
Douglas Araujo
ca22a8166c Fix initial value for SensorCooler 2024-10-29 10:57:26 +01:00
Douglas Araujo
6f0f6357be Fix mbbi item string length 2024-10-29 10:55:30 +01:00
Caissa Roque
325821714a Merge branch 'temperature-control' into 'master'
Temperature control

See merge request epics-modules/adorca!25
2024-10-04 09:03:51 +00:00
Caissa Roque
1abd258517 Fix SensorCooler init value 2024-10-04 09:02:44 +00:00
Caissa Roque
4c0a03fd81 Add sensor cooler 2024-10-04 09:02:44 +00:00
Douglas Araujo
4f29439529 Merge branch 'ICSHWI-1929-fix-evr-properties' into 'master'
ICSHWI-19294: Update EVR property names

Closes ICSHWI-19294

See merge request epics-modules/adorca!24
2024-10-02 10:29:59 +00:00
Douglas Araujo
f7410e5473 Update evr property names 2024-09-30 13:53:34 +02:00
Douglas Araujo
6384a20af1 Merge branch 'ICSHWI-11121-tidy-up' into 'master'
ICSHWI-11121: Tidyup code

See merge request epics-modules/adorca!23
2024-09-24 07:41:57 +00:00
Douglas Araujo
7e496979ce Improve internalframe PV desc according DCAM-API 2024-09-23 15:37:33 +02:00
Douglas Araujo
5a14d155e3 Remove duplicate record 2024-09-23 15:23:53 +02:00
Douglas Araujo
429c991544 Remove empty if statement 2024-09-23 14:54:28 +02:00
Douglas Araujo
2d9bb69fb8 Remove unnecessary line 2024-09-23 14:53:15 +02:00
Douglas Araujo
2c23087d04 Improve descriptions 2024-09-23 14:52:29 +02:00
Douglas Araujo
7aacd3e881 Apply dbformat on template file, and add DESC field 2024-09-16 16:31:27 +02:00
Douglas Araujo
343a17ae9f Replace ao printError calls 2024-09-16 15:28:58 +02:00
Douglas Araujo
49c9eb4c20 Refactor writeFloat64 method 2024-09-16 14:22:38 +02:00
Douglas Araujo
a94ca36d90 Refactor writeInt32 method 2024-09-16 13:16:18 +02:00
Douglas Araujo
587c23cacc Add ERR message formatter 2024-09-16 13:11:54 +02:00
Douglas Araujo
7ac340473d Remove disconnect method once that it was only returning true always 2024-09-13 12:01:49 +02:00
Douglas Araujo
52c274d5b2 Remove unused class parameter and update the devOrcaConfig iocsh function 2024-09-13 11:59:44 +02:00
Douglas Araujo
6652bc2264 Remove FLOWs in the constructor 2024-09-13 11:52:45 +02:00
Douglas Araujo
9225d07a0d Replace printf to asynPrint 2024-09-12 12:59:05 +02:00
Douglas Araujo
481b7722c5 Remove unnecessary prints.
In the virtual asynFunctions the infos are available through  asynPrint using ASYN_TRACEIO_DRIVER
2024-09-12 12:46:42 +02:00
Douglas Araujo
1ec9ec9f50 Add createAsynParams method to tidy up the constructor 2024-09-12 11:59:37 +02:00
Douglas Araujo
aa7a350688 Remove unused methods 2024-09-12 11:36:56 +02:00
Douglas Araujo
3b0e24798f Remove commented code 2024-09-12 11:34:51 +02:00
Douglas Araujo
c587eabd00 Merge branch 'ICSHWI-11121-clang-format' into 'master'
Apply clang-format following google standards

See merge request epics-modules/adorca!22
2024-09-11 15:14:46 +00:00
Douglas Araujo
15fd21a1e0 Apply clang-format following google standards 2024-09-11 17:06:38 +02:00
marcofilho
2c951811fc Merge branch 'remove-alarms'
Remove alarms when acquisition is aborted according to request in https://jira.esss.lu.se/browse/ECDC-4185
2024-09-06 14:18:15 +02:00
marcofilho
db6ce72e1d Remove alarm severity when acq aborted.
As discussed in ECDC-4185
2024-09-06 14:04:27 +02:00
Marco Filho
081d5bfdd5 Merge branch 'ICSHWI-19117-fix-false-warning' into 'master'
Fix false alarm problem

Closes ICSHWI-19117

See merge request epics-modules/adorca!21
2024-08-26 15:03:55 +00:00
marcofilho
634c3b12ba Fix false warning raise.
Fix concurrency problem.

Before this commit, if acquisition was aborted by user before the imagetask had
passed through the conditional
`if ((epicsTimeDiffInSeconds(&currentAcqTime, &prevAcqTime) > maxAcqusitionTime)`, condition would evaluate to true
and raise a warning saying that the acquisition timed out, which is not true.

After this, condition evaluates to false and no alarm is raised.
Tested several acquisitions and this does not seem to compromise the control flow.
It seems to work both with internal and with external triggers.
2024-08-26 16:48:24 +02:00
marcofilho
4bc89278fe Update makefile
Makefile was using old e3 directives. I copied the makefile from the recipe.
2024-08-26 16:46:57 +02:00
Jim Larsson
acff3aedc0 Merge branch '0.1.0_fix' into 'master'
Fix OOPT error

See merge request epics-modules/adorca!19
2024-06-20 08:56:06 +00:00
Jim Larsson
bf9dccedc6 Fix OOPT error 2024-06-20 08:54:56 +00:00
Marco Antonio Barra Montevechi Filho
e7c34375ee Merge dev into master
According to this MR:
https://gitlab.esss.lu.se/epics-modules/adorca/-/merge_requests/18 it
seems dev branch has been extensively used in the last few months. The
recipe is using the dev branch:
https://gitlab.esss.lu.se/e3/recipes/adorca-recipe/-/blob/master/recipe/meta.yaml?ref_type=heads
so merging it into master shouldn't break anything. It's just a sync
after some development time.

I initially thought about merging master into dev first to solve the
small conflict in .gitignore but then this would be acessible to the
recipe.

After this maybe we should update the recipe?
2024-06-17 17:44:59 +02:00
Jim Larsson
4f6a5b4d51 Merge branch 'ICSHWI-17419' into 'dev'
(Modify) Logic to #StopAfterCycles for cont. mode

See merge request epics-modules/adorca!17
2024-03-12 13:41:05 +00:00
Jim Larsson
2562f3d732 (Modify) Logic to #StopAfterCycles for cont. mode 2024-02-27 15:44:07 +01:00
Jim Larsson
ed1845acf2 Merge branch 'ICSHWI_17104' into 'dev'
Icshwi 17104

See merge request epics-modules/adhama!16
2024-02-21 09:03:41 +00:00
Jim Larsson
15e0849a58 fix(orca.cpp): timeout msg 2024-02-20 10:47:31 +01:00
Jim Larsson
9bf0389752 ICSHWI-17104: add waiting time until status update -taking too long 2024-02-13 14:32:11 +01:00
Jim Larsson
1a3c91838b add elapsedTotalTime and compare with max acq. 2024-02-13 11:45:02 +01:00
Douglas Araujo
e24c2f68e8 Merge branch 'ICSHWI-15886-Orca-frame-drop' into 'dev'
ICSHWI-15886: Orca frame drop

See merge request epics-modules/adhama!15
2024-01-29 14:27:01 +00:00
Douglas Araujo
81ee3c28a5 Add mechanism to check dropped frames 2024-01-29 08:25:27 +00:00
Douglas Araujo
94c13c6a48 Merge branch 'ICSHWI-15961' into 'dev'
ICSHWI-15961: rename Hama to Orca

See merge request epics-modules/adhama!14
2024-01-29 08:24:31 +00:00
Tomasz Brys
10d88aa479 rename Hama to Orca 2024-01-17 15:14:49 +01:00
Douglas Araujo
d77cb91b15 Merge branch 'ICSHWI-12967' into 'dev'
ICSHWI-12967: Add internal PVs to control when enable and stop EVR sequencer

See merge request epics-modules/adhama!13
2023-09-20 07:02:11 +00:00
Douglas Araujo
a9b6d1c4be Update st.cmd to run with external trigger by EVR 11 and update kafka topic 2023-09-18 11:33:28 +02:00
Douglas Araujo
16bb800227 Add mechanism to check if acquirePeriod is valid 2023-09-18 11:32:01 +02:00
Douglas Araujo
1d07985371 Stop sequencer when Acquire 0 2023-09-18 11:26:30 +02:00
Douglas Araujo
7118ae9186 Add internal PVs to control when enable and stop EVR sequencer instead only to use Acquire 1/0 2023-09-06 14:49:15 +02:00
George Kontogiorgos
dfb2786e54 Merge branch 'ICSHWI-12967' into 'dev'
Set startup script to use Kafka broker's SSL port

See merge request epics-modules/adhama!11
2023-07-03 13:45:59 +00:00
George Nicolas Kontogiorgos
cc537075ab Set startup script to use Kafka broker's SSL port 2023-06-16 16:10:55 +02:00
Douglas Araujo
29163e8bae Merge branch 'ICSHWI-12772_frame_rate' into 'dev'
ICSHWI-12772: Evaluate frame rate

See merge request epics-modules/adhama!10
2023-06-07 06:19:35 +00:00
Douglas Araujo
b3d88868ee Merge branch 'ICSHWI-12773_acquision_refactor' into 'dev'
ICSHWI-12773: Acquision Refactor

See merge request epics-modules/adhama!9
2023-06-07 06:18:23 +00:00
Douglas Araujo
8d4e8ee925 Add logic to prevent always to process the PVs on readParameter function 2023-05-30 09:15:59 +02:00
Douglas Araujo
41d69d3ef1 Refactor sensor size and position definitions 2023-05-30 08:34:47 +02:00
Douglas Araujo
374a84971b Fix trigger_mode value to option start 2023-05-25 15:38:22 +02:00
Douglas Araujo
a66877b354 Update the enable/disable EVR softSequencer logic to work with different kinds of acquisition modes 2023-05-24 17:17:07 +02:00
Douglas Araujo
bfd746ac67 Fix acquireTime blocker logic to external trigger 2023-05-24 17:11:29 +02:00
Douglas Araujo
63fc03a41e Add logic to PV AcquirePeriod controls the EVR pulse period 2023-05-24 15:30:47 +02:00
Douglas Araujo
7b73325de8 Remove dcamwait frame since this is done by acquisition epicsThread 2023-05-23 14:59:29 +02:00
Douglas Araujo
25e346e970 Add logic to start and stop evr sequencer 2023-05-23 11:25:22 +02:00
Douglas Araujo
5751c2b703 Add logic to select the correct timestamp source 2023-05-20 09:27:05 +02:00
Douglas Araujo
11a7e3fe9e Add external (EVR) timestamp 2023-05-17 12:32:19 +02:00
Douglas Araujo
882f277114 Add dcambuf_release() function to release the internal receiving buffer in the DCAM module when stop an acquisition 2023-04-03 10:51:35 +02:00
Douglas Araujo
71a97f8170 Merge branch 'ICSHWI-11597' into 'dev'
Icshwi 11597

See merge request epics-modules/adhama!7
2023-03-31 08:14:12 +00:00
Iocuser
545fb7b0ec Add Tomasz's changes 2023-03-31 10:12:04 +02:00
Iocuser
e2368aa113 just update 2023-03-16 20:29:40 +01:00
Lucas Magalhães
45e223e40c Merge branch 'remove_old_makefile' into 'master'
Removing unused/old Makefiles

See merge request epics-modules/adhama!8
2023-03-15 14:46:13 +00:00
Lucas Magalhães
8003d9f75d Add old makefiles to .gitignore 2023-03-15 14:00:08 +00:00
Lucas Magalhães
e2ccdb9b7e Remove unused ADHama.Makefile 2023-03-15 12:30:33 +00:00
Iocuser
b01e13eb77 small update 2023-02-09 09:20:07 +01:00
Iocuser
27dabf4fdc remove comments and old code 2023-02-08 11:33:44 +01:00
Iocuser
ed7881d93c Merge branch 'ICSHWI-11597' of https://gitlab.esss.lu.se/epics-modules/adhama into ICSHWI-11597 2023-02-06 16:43:55 +01:00
Iocuser
b6de30a144 check and update getParameters 2023-02-06 16:37:54 +01:00
Iocuser
e7d48816d2 Add adpluginkafka 2023-02-06 12:51:02 +00:00
Iocuser
7dc9fd7cb3 add readAtributes, readSensor functions 2023-02-06 12:51:02 +00:00
Iocuser
37607c5f23 Add adpluginkafka 2023-02-06 13:20:07 +01:00
Iocuser
90d571bb43 add readAtributes, readSensor functions 2023-02-02 17:21:27 +01:00
Douglas Araujo
c3634f8157 Merge branch 'ICSHWI-11097_frame_rate' into 'dev'
Add frame rate and control to acquire period PV

See merge request epics-modules/adhama!6
2023-02-01 15:16:27 +00:00
Douglas Araujo
4f8962f9e1 Add conditional to not process time parameters when external trigger is activate 2023-01-02 11:56:11 +01:00
Douglas Araujo
ee066ef720 Add frame rate and control to acquire period PV 2022-12-30 17:22:13 +01:00
Douglas Araujo
e15fafea4b Add shared libraries 2022-12-23 11:39:58 +01:00
Iocuser
58aefc799d small fix in trigger out implementation 2022-12-20 14:24:21 +01:00
Iocuser
a4cbf7e909 fix in trigger output, not ready yet... 2022-12-20 10:27:02 +01:00
Iocuser
f62b2102bc implement trigger out 2022-12-20 09:30:57 +01:00
Iocuser
97fd6f7c46 refactoring 2022-12-16 07:50:26 +01:00
Iocuser
0d44d0bbf2 implement virtual void report(FILE *, int) function 2022-12-15 11:55:21 +01:00
Iocuser
1c1ee4e728 Add linux library to local repo 2022-12-14 14:35:54 +01:00
Iocuser
922a418e5e fix attributes 2022-12-14 13:41:02 +01:00
22 changed files with 4057 additions and 4149 deletions

11
.gitignore vendored
View File

@@ -7,4 +7,13 @@ O.*
*.db.*
pv.list
core.*
.vscode
.vscode
list.txt
kafka.conf
ecdc-kafka-ca.crt
.pre-commit-config.yaml
.clang-format
.iocsh_history
build
build.sh

View File

@@ -1,23 +0,0 @@
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${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"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "c89",
"cppStandard": "c++14",
"intelliSenseMode": "linux-gcc-x64"
}
],
"version": 4
}

View File

@@ -1,157 +0,0 @@
#
# Copyright (c) 2019 - 2022, European Spallation Source ERIC
#
# The program is free software: you can redistribute it and/or modify it
# under the terms of the BSD 3-Clause license.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.
#
# Author : Tomasz Brys
# email : tomasz.brys@ess.eu
# Date : 2022-03-16
# version : 0.0.0
#
# This template file is based on one generated by e3TemplateGenerator.bash.
# Please look at many other module_name.Makefile in the https://gitlab.esss.lu.se/epics-modules/
# repositories.
#
## The following lines are mandatory, please don't change them.
where_am_I := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
include $(E3_REQUIRE_TOOLS)/driver.makefile
ifneq ($(strip $(ADCORE_DEP_VERSION)),)
adcore_VERSION=$(ADCORE_DEP_VERSION)
endif
ifneq ($(strip $(BUSY_DEP_VERSION)),)
busy_VERSION=$(BUSY_DEP_VERSION)
endif
############################################################################
#
# Add any required modules here that come from startup scripts, etc.
#
############################################################################
REQUIRED += adcore
REQUIRED += busy
############################################################################
#
# If you want to exclude any architectures:
#
############################################################################
EXCLUDE_ARCHS += linux-ppc64e6500
############################################################################
#
# Relevant directories to point to files
#
############################################################################
APP := ADHamaApp
APPDB := $(APP)/Db
APPSRC := $(APP)/src
APPCMDS := $(APP)/cmds
############################################################################
#
# Add any files that should be copied to $(module)/Db
#
############################################################################
TEMPLATES += $(wildcard $(APPDB)/*.db)
TEMPLATES += $(wildcard $(ADCORE_DIR)/*.db)
# TEMPLATES += $(wildcard $(APPDB)/*.proto)
TEMPLATES += $(wildcard $(APPDB)/*.template)
# USR_INCLUDES += -I$(where_am_I)$(APPSRC)
# USR_INCLUDES += -I $(E3_ADCORE_LOCATION)/ADCore/ADApp/ADSrc
# USR_INCLUDES += -I $(E3_ASYN_LOCATION)/asyn/interfaces
# USR_INCLUDES += -I $(E3_ASYN_LOCATION)/asyn/asynDriver
# USR_INCLUDES += -I $(E3_ASYN_LOCATION)/asyn/asynPortDriver
# USR_INCLUDES += -DLINUX -I/home/iocuser/dcamsdk4/inc/
USR_INCLUDES += -DLINUX -I ../support/dcamsdk4/inc/
# USR_INCLUDES += -I ../support/dcamsdk4/misc/
############################################################################
#
# Add any files that need to be compiled (e.g. .c, .cpp, .st, .stt)
#
############################################################################
# SOURCES += $(APPSRC)/ADHamaMain.cpp
SOURCES += $(APPSRC)/hama.cpp
# SOURCES += support/dcamsdk4/misc/common.cpp
############################################################################
#
# Add any .dbd files that should be included (e.g. from user-defined functions, etc.)
#
############################################################################
DBDS += $(APPSRC)/hama.dbd
############################################################################
#
# Add any header files that should be included in the install (e.g.
# StreamDevice or asyn header files that are used by other modules)
#
############################################################################
# HEADERS += /home/iocuser/dcamsdk4/inc
############################################################################
#
# Add any startup scripts that should be installed in the base directory
#
############################################################################
SCRIPTS += $(wildcard iocsh/*.iocsh)
############################################################################
#
# If you have any .substitution files, and template files, add them here.
#
############################################################################
# SUBS=$(wildcard $(APPDB)/*.substitutions)
TMPS=$(wildcard $(APPDB)/*.template)
USR_DBFLAGS += -I . -I ..
USR_DBFLAGS += -I $(E3_ADCORE_LOCATION)/db
USR_DBFLAGS += -I $(EPICS_BASE)/db
USR_DBFLAGS += -I $(APPDB)
USR_LDFLAGS += -L/usr/local/lib -ldcamapi
db: $(SUBS) $(TMPS)
$(SUBS):
@printf "Inflating database ... %44s >>> %40s \n" "$@" "$(basename $(@)).db"
@rm -f $(basename $(@)).db.d $(basename $(@)).db
@$(MSI) -D $(USR_DBFLAGS) -o $(basename $(@)).db -S $@ > $(basename $(@)).db.d
@$(MSI) $(USR_DBFLAGS) -o $(basename $(@)).db -S $@
$(TMPS):
@printf "Inflating database ... %44s >>> %40s \n" "$@" "$(basename $(@)).db"
@rm -f $(basename $(@)).db.d $(basename $(@)).db
@$(MSI) -D $(USR_DBFLAGS) -o $(basename $(@)).db $@ > $(basename $(@)).db.d
@$(MSI) $(USR_DBFLAGS) -o $(basename $(@)).db $@
.PHONY: db $(SUBS) $(TMPS)
vlibs:
.PHONY: vlibs

BIN
ADHamaApp/Db/.DS_Store vendored

Binary file not shown.

File diff suppressed because it is too large Load Diff

View File

@@ -1,24 +0,0 @@
/* ADHamaMain.cpp */
/* Author: Tomasz Brys */
/* Date: 2022-03-16 */
#include <stddef.h>
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
#include <stdio.h>
#include "epicsExit.h"
#include "epicsThread.h"
#include "iocsh.h"
int main(int argc,char *argv[])
{
if(argc>=2) {
iocsh(argv[1]);
epicsThreadSleep(.2);
}
iocsh(NULL);
epicsExit(0);
return(0);
}

File diff suppressed because it is too large Load Diff

View File

@@ -1 +0,0 @@
registrar("hamaRegister")

View File

@@ -1,313 +0,0 @@
#ifndef DRV_HAMA_H
#define DRV_HAMA_H
#include "ADDriver.h"
#include "dcamapi4.h"
#define MAX_FEATURE_NAME_LEN 64
#define hFrameRateString "H_FRAME_RATE" /* asynOctet ro */
#define hHamaNameString "H_HAMA_NAME" /* asynOctet ro */
#define hVendorString "H_VENDOR" /* asynOctet ro */
#define hModelString "H_MODEL" /* asynOctet ro */
#define hCameraIDString "H_CAMERAID" /* asynOctet ro */
#define hBusString "H_BUS" /* asynOctet ro */
#define hCameraVersionString "H_CAMERA_VERSION" /* asynOctet ro */
#define hDriverVersionString "H_DRIVER_VERSION" /* asynOctet ro */
#define hModuleVersionString "H_MODULE_VERSION" /* asynOctet ro */
#define hDcamApiVersionString "H_DCAM_API_VERSION" /* asynOctet ro */
// Sensor mode and speed
#define hSensorModeString "H_SENSOR_MODE" /* asynint32 rw */
#define hReadoutSpeedString "H_READOUT_SPEED" /* asynInt32 rw */
#define hReadoutDirectionString "H_READOUT_DIRECTION" /* asynIekt32 rw */
// Trigger
#define hTriggerSourceString "H_TRIGGER_SOURCE" /* asynInt32 rw */
#define hTriggerModeString "H_TRIGGER_MODE" /* asynInt32 rw */
#define hTriggerActiveString "H_TRIGGER_ACTIVE" /* asynInt32 rw */
#define hTriggerGlobalExposureString "H_TRIGGER_GLOBAL_EXPOSURE" /* asynInt32 rw */
#define hTriggerPolarityString "H_TRIGGER_POLARITY" /* asynInt32 rw */
#define hTriggerConnectorString "H_TRIGGER_CONNECTOR" /* asynInt32 rw */
#define hTriggerTimesString "H_TRIGGER_TIMES" /* asynInt32 rw */
#define hTriggerDelayString "H_TRIGGER_DELAY" /* asynFloat64 rw */
#define hInternalTriggerHandlingString "H_INTERNAL_TRIGGER_HANDLING" /* asynInt32 rw */
// Sensor cooler
#define hSensorTemperatureString "H_SENSOR_TEMPERATURE" /* asynFloat64 ro */
#define hSensorCoolerString "H_SENSOR_COOLER" /* asynInt32 rw */
#define hSensorCoolerStatusString "H_SENSOR_COOLER_STATUS" /* asynInt32 ro */
// Binning and ROI
#define hBinningString "H_BINNING" /* asynInt32 rw */
#define hSubarrayHPosString "H_SUBARRAY_HPOST" /* asynInt32 rw */
#define hSubarrayHSizeString "H_SUBARRAY_HSIZE" /* asynInt32 rw */
#define hSubarrayVPosString "H_SUBARRAY_VPOS" /* asynInt32 rw */
#define hSubarrayVSizeString "H_SUBARRAY_VSIZE" /* asynInt32 rw */
#define hSubarrayModeString "H_SUBARRAY_MODE" /* asynInt32 rw */
// #define hFrameBundleMode (usb3 only not implemented)
// #define hFrameBundleNumber (usb3 only not implemented)
// Feature
#define hExposureTimeString "H_EXPOSURE_TIME" /* asynFloat64 rw */
// ALU
#define hDefectCorrectModeString "H_DEFECTCORRECT_MODE" /* asynInt32 rw */
#define hHotPixelCorrectLevelString "H_HOT_PIXEL_CORRECT_LEVEL" /* asynInt32 rw */
#define hIntensityLutModeString "H_INTENSITY_LUT_MODE" /* asynInt32 rw */
#define hIntensityLutPageString "H_INTENSITY_LUT_PAGE" /* asynInt32 ro */
#define hExtractionModeString "H_EXTRACTION_MODE" /* asynInt32 ro */
// output trigger
#define hNumberOfOutputTriggerConnectorString "H_NUMBEROF_OUTPUTTRIGGERCONNECTOR" /* asynInt32 ro */
#define hOutputTriggerSource0String "H_OUTPUT_TRIGGER_SOURCE0" /* asynInt32 rw */
#define hOutputTriggerSource1String "H_OUTPUT_TRIGGER_SOURCE1" /* asynInt32 rw */
#define hOutputTriggerSource2String "H_OUTPUT_TRIGGER_SOURCE2" /* asynInt32 rw */
#define hOutputTriggerPolarity0String "H_OUTPUT_TRIGGER_POLARITY0" /* asynInt32 rw */
#define hOutputTriggerPolarity1String "H_OUTPUT_TRIGGER_POLARITY1" /* asynInt32 rw */
#define hOutputTriggerPolarity2String "H_OUTPUT_TRIGGER_POLARITY2" /* asynInt32 rw */
#define hOutputTriggerActive0String "H_OUTPUT_TRIGGER_ACTIVE0" /* asynInt32 ro */
#define hOutputTriggerActive1String "H_OUTPUT_TRIGGER_ACTIVE1" /* asynInt32 ro */
#define hOutputTriggerActive2String "H_OUTPUT_TRIGGER_ACTIVE2" /* asynInt32 ro */
#define hOutputTriggerDelay0String "H_OUTPUT_TRIGGER_DELAY0" /* asynFloat64 rw */
#define hOutputTriggerDelay1String "H_OUTPUT_TRIGGER_DELAY1" /* asynFloat64 rw */
#define hOutputTriggerDelay2String "H_OUTPUT_TRIGGER_DELAY2" /* asynFloat64 rw */
#define hOutputTriggerPeriod0String "H_OUTPUT_TRIGGER_PERIOD0" /* asynFloat64 rw */
#define hOutputTriggerPeriod1String "H_OUTPUT_TRIGGER_PERIOD1" /* asynFloat64 rw */
#define hOutputTriggerPeriod2String "H_OUTPUT_TRIGGER_PERIOD2" /* asynFloat64 rw */
#define hOutputTriggerKind0String "H_OUTPUT_TRIGGER_KIND0" /* asynInt32 rw */
#define hOutputTriggerKind1String "H_OUTPUT_TRIGGER_KIND1" /* asynInt32 rw */
#define hOutputTriggerKind2String "H_OUTPUT_TRIGGER_KIND2" /* asynInt32 rw */
#define hOutputTriggerBaseSensor0String "H_OUTPUT_TRIGGER_BASE_SENSOR0" /* asynInt32 rw */
#define hOutputTriggerBaseSensor1String "H_OUTPUT_TRIGGER_BASE_SENSOR1" /* asynInt32 rw */
#define hOutputTriggerBaseSensor2String "H_OUTPUT_TRIGGER_BASE_SENSOR2" /* asynInt32 rw */
#define hOutputTriggerPreHsyncCount0String "H_OUTPUT_TRIGGER_PRE_HSYNC_COUNT0" /* asynInt32 rw */
#define hOutputTriggerPreHsyncCount1String "H_OUTPUT_TRIGGER_PRE_HSYNC_COUNT1" /* asynInt32 rw */
#define hOutputTriggerPreHsyncCount2String "H_OUTPUT_TRIGGER_PRE_HSYNC_COUNT2" /* asynInt32 rw */
// Master Puls
#define hMasterPulseModeString "H_MASTERPULSE_MODE" /* asynInt32 rw */
#define hMasterPulseTriggerSourceString "H_MASTERPULSE_TRIGGER_SOURCE" /* asynInt32 rw */
#define hMasterPulseIntervalString "H_MASTERPULSE_INTERVAL" /* asynFloat64 rw */
#define hMasterPulseBurstTimesString "H_MASTERPULSE_BURST_TIMES" /* asynInt32 rw */
// Synchronious Timing
#define hTimingReadoutTimeString "H_TIMING_READOUT_TIME" /* asynFloat64 ro */
#define hTimingCyclicTriggerPeriodString "H_TIMING_CYCLICTRIGGERPERIOD" /* asynFloat64 ro */
#define hTimingMinTriggerBlankingString "H_TIMING_MIN_TRIGGER_BLANKING" /* asynFloat64 ro */
#define hTimingMinTriggerIntervalString "H_TIMING_MIN_TRIGGER_INTERVAL" /* asynFloat64 ro */
#define hTimingGlobalExposureDelayString "H_TIMING_GLOBAL_EXPOSURE_DELAY" /* asynFloat64 ro */
#define hTimingExposureString "H_TIMING_EXPOSURE" /* asynInt32 ro */
#define hTimingInvalidExposurePeriodString "H_TIMING_INVALID_EXPOSURE_PERIOD" /* asynFloat64 ro */
#define hInternalFrameRateString "H_INTERNAL_FRAME_RATE" /* asynFloat64 rw */
#define hInternalFrameIntervalString "H_INTERNAL_FRAME_INTERVAL" /* asynFloat64 rw */
#define hInternalLineSpeedString "H_INTERNAL_LINE_SPEED" /* asynFloat64 rw */
#define hInternalLineIntervalString "H_INTERNAL_LINE_INTERVAL" /* asynFloat64 rw */
// System information
#define hColorTypeString "H_COLOR_TYPE" /* asynInt32 ro */
#define hBitPerChannelString "H_BIT_PER_CHANNEL" /* asynInt32 rw */
//#define hImageWidthString "H_IMAGE_WIDTH" /* asynInt32 ro */
//#define hImageHeightString "H_IMAGE_HEIGHT" /* asynInt32 ro */
#define hImageRowBytesString "H_IMAGE_ROWBYTES" /* asynInt32 ro */
#define hImageFrameBytesString "H_IMAGE_FRAMEBYTES" /* asynInt32 ro */
#define hImageTopOffsetBytesString "H_IMAGE_TOP_OFFSETBYTES" /* asynInt32 ro */
#define hImagePixelTypeString "H_IMAGE_PIXEL_TYPE" /* asynInt32 rw */
#define hBufferRowbytesString "H_BUFFER_ROWBYTES" /* asynInt32 ro */
#define hBufferFramebytesString "H_BUFFER_FRAMEBYTES" /* asynInt32 ro */
#define hBufferTopOffsetBytesString "H_BUFFER_TOP_OFFSETBYTES" /* asynInt32 ro */
#define hBufferPixelTypeString "H_BUFFER_PIXEL_TYPE" /* asynInt32 ro */
#define hRecordFixedBytesPerFileString "H_RECORD_FIXED_BYTES_PER_FILE" /* asynInt32 ro */
#define hRecordFixedBytesPerSessionString "H_RECORD_FIXED_BYTES_PER_SESION" /* asynInt32 ro */
#define hRecordFixedBytesPerFrameString "H_RECORD_FIXED_BYTES_PER_FRAME" /* asynInt32 ro */
#define hSystemAliveString "H_SYSTEM_ALIVE" /* asynInt32 ro */
#define hConversionFactorCoeffString "H_CONVERSIONFACTOR_COEFF" /* asynFloat64 ro */
#define hConversionFactorOffsetString "H_CONVERSIONFACTOR_OFFSET" /* asynFloat64 ro */
#define hNumberOfViewString "H_NUMBER_OF_VIEW" /* asynInt32 ro */
#define hImageDetectorPixelWidthString "H_IMAGE_DETECTOR_PIXEL_WIDTH" /* asynFloat64 ro */
#define hImageDetectorPixelHeightString "H_IMAGE_DETECTOR_PIXEL_HEIGHT" /* asynFloat64 ro */
#define hImageDetectorPixelNumHorzString "H_IMAGE_DETECTOR_PIXEL_NUM_HORZ" /* asynInt32 ro */
#define hImageDetectorPixelNumVertString "H_IMAGE_DETECTOR_PIXEL_NUM_VERT" /* asynInt32 ro */
#define hTimeStampProducerString "H_TIMESTAMP_PRODUCER" /* asynInt32 ro */
#define hFrameStampProducerString "H_FRAMESTAMP_PRODUCER" /* asynInt32 ro */
#define hTimeStampString "H_TIMESTAMP" /* asynFloat64 ro */
// For some reason these two addresses are not defined in the dcamapi4 neither in dcamprop.h
#define DETECTOR_PIXEL_NUM_HORZ 0x00420830
#define DETECTOR_PIXEL_NUM_VERT 0x00420840
class epicsShareClass Hama : public ADDriver {
public:
Hama(const char*, int, int, size_t, int, int, int);
// ~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);
void imageTask();
void temperatureTask();
protected:
int hFrameRate;
#define FIRST_HAMA_PARAM hFrameRate
int hHamaName;
int hVendor;
int hModel;
int hCameraID;
int hBus;
int hCameraVersion;
int hDriverVersion;
int hModuleVersion;
int hDcamApiVersion;
// - sensor mode and speed
int hSensorMode;
int hReadoutSpeed;
int hReadoutDirection;
// - trigger
int hTriggerSource;
int hTriggerMode;
int hTriggerActive;
int hTriggerGlobalExposure;
int hTriggerPolarity;
int hTriggerConnector;
int hTriggerTimes;
int hTriggerDelay;
int hInternalTriggerHandling;
// - sensor cooler
int hSensorTemperature;
int hSensorCooler;
int hSensorCoolerStatus;
// - binning and roi
int hBinning;
int hSubarrayHPos;
int hSubarrayHSize;
int hSubarrayVPos;
int hSubarrayVSize;
int hSubarrayMode;
// - feature
int hExposureTime;
// - alu
int hDefectCorrectMode;
int hHotPixelCorrectLevel;
int hIntensityLutMode;
int hIntensityLutPage;
int hExtractionMode;
// - output trigger
int hNumberOfOutputTriggerConnector;
int hOutputTriggerSource0;
int hOutputTriggerSource1;
int hOutputTriggerSource2;
int hOutputTriggerPolarity0;
int hOutputTriggerPolarity1;
int hOutputTriggerPolarity2;
int hOutputTriggerActive0;
int hOutputTriggerActive1;
int hOutputTriggerActive2;
int hOutputTriggerDelay0;
int hOutputTriggerDelay1;
int hOutputTriggerDelay2;
int hOutputTriggerPeriod0;
int hOutputTriggerPeriod1;
int hOutputTriggerPeriod2;
int hOutputTriggerKind0;
int hOutputTriggerKind1;
int hOutputTriggerKind2;
int hOutputTriggerBaseSensor0;
int hOutputTriggerBaseSensor1;
int hOutputTriggerBaseSensor2;
int hOutputTriggerPreHsyncCount0;
int hOutputTriggerPreHsyncCount1;
int hOutputTriggerPreHsyncCount2;
// - master pulse
int hMasterPulseMode;
int hMasterPulseTriggerSource;
int hMasterPulseInterval;
int hMasterPulseBurstTimes;
// - symchronous timing
int hTimingReadoutTime;
int hTimingCyclicTriggerPeriod;
int hTimingMinTriggerBlanking;
int hTimingMinTriggerInterval;
int hTimingGlobalExposureDelay;
int hTimingExposure;
int hTimingInvalidExposurePeriod;
int hInternalFrameRate;
int hInternalFrameInterval;
int hInternalLineSpeed;
int hInternalLineInterval;
// - system information
int hColorType;
int hBitPerChannel;
int hImageRowbytes;
int hImageFramebytes;
int hImageTopOffsetBytes;
int hImagePixelType;
int hBufferRowbytes;
int hBufferFramebytes;
int hBufferTopOffsetBytes;
int hBufferPixelType;
int hRecordFixedBytesPerFile;
int hRecordFixedBytesPerSession;
int hRecordFixedBytesPerFrame;
int hSystemAlive;
int hConversionFactorCoeff;
int hConversionFactorOffset;
int hNumberOfView;
int hImageDetectorPixelWidth;
int hImageDetectorPixelHeight;
int hImageDetectorPixelNumHorz;
int hImageDetectorPixelNumVert;
int hTimeStampProducer;
int hFrameStampProducer;
//----
int hTimeStamp;
//#define LAST_HAMA_PARAM hTimeStamp
private:
HDCAM m_hdcam;
DCAMAPI_INIT m_apiInit;
DCAMDEV_OPEN m_devOpen;
DCAMERR m_err;
// handle used to wait for events sent from the device
HDCAMWAIT hwait;
int m_id;
int stopThread;
epicsEventId startEvent_;
asynStatus startAcquire(void);
asynStatus stopAcquire(void);
void getImageInformation(HDCAM hdcam, int32& pixeltype, int32& width, int32& rowbytes, int32& height, int32& framebytes);
asynStatus accessCapturedImage(HDCAM hdcam, int32 iFrame, void* buf, int32 rowbytes, int32 cx, int32 cy, int32& ts_sec, int32& ts_microsec);
asynStatus imageTransferStatus(HDCAM hdcam, DCAMCAP_TRANSFERINFO &captransferinfo);
// wrapper functions for dcamapi
int allocateBuffers(unsigned int);
int freeBuffers();
int connectCamera();
int disconnectCamera();
int initCamera();
asynStatus updateSensorSize();
asynStatus getParameter(int paramIndex);
// 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();
int setFeature(int featureIndex, double value);
};
#endif

67
ADOrca.Makefile Normal file
View File

@@ -0,0 +1,67 @@
#
# Copyright (c) 2019 - 2022, European Spallation Source ERIC
#
# The program is free software: you can redistribute it and/or modify it
# under the terms of the BSD 3-Clause license.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.
#
# Author : Tomasz Brys
# email : tomasz.brys@ess.eu
# Date : 2022-03-16
# version : 0.0.0
#
# This template file is based on one generated by e3TemplateGenerator.bash.
# Please look at many other module_name.Makefile in the https://gitlab.esss.lu.se/epics-modules/
# repositories.
#
## The following lines are mandatory, please don't change them.
where_am_I := $(dir $(abspath $(lastword $(MAKEFILE_LIST))))
include $(E3_REQUIRE_TOOLS)/driver.makefile
REQUIRED += adcore
REQUIRED += busy
EXCLUDE_ARCHS += linux-ppc64e6500
APP := ADOrcaApp
APPDB := $(APP)/Db
APPSRC := $(APP)/src
APPCMDS := $(APP)/cmds
SUPPORT:= support/dcamsdk4/lib/linux-x86_64
TEMPLATES += $(wildcard $(APPDB)/*.db)
TEMPLATES += $(wildcard $(ADCORE_DIR)/*.db)
TEMPLATES += $(wildcard $(APPDB)/*.template)
USR_INCLUDES += -DLINUX -I ../support/dcamsdk4/inc/
SOURCES += $(APPSRC)/orca.cpp
DBDS += $(APPSRC)/orca.dbd
SCRIPTS += $(wildcard iocsh/*.iocsh)
TMPS=$(wildcard $(APPDB)/*.template)
USR_LDFLAGS += -L$(PREFIX)/lib/ -ldcamapi
LIB_SYS_LIBS += dcamapi
VENDOR_LIBS += $(SUPPORT)/libdcamapi.so.4
VENDOR_LIBS += $(SUPPORT)/libdcamapi.so.4.0.6269
VENDOR_LIBS += $(SUPPORT)/libdcamapi.so
USR_DBFLAGS += -I . -I ..
USR_DBFLAGS += -I $(E3_ADCORE_LOCATION)/db
USR_DBFLAGS += -I $(EPICS_BASE)/db
USR_DBFLAGS += -I $(APPDB)
vlibs: $(VENDOR_LIBS)
$(VENDOR_LIBS):
$(QUIET) install -m 755 $@ $(PREFIX)/lib/
.PHONY: $(VENDOR_LIBS) vlibs

View File

@@ -0,0 +1,4 @@
# Removing undesired alarms from aborted state
record(mbbi, "$(P)$(R)DetectorState_RBV") {
field(TESV, "NO_ALARM")
}

1719
ADOrcaApp/Db/orca.template Normal file

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,22 @@
/* ADOrcaMain.cpp */
/* Author: Tomasz Brys */
/* Date: 2022-03-16 */
#include <stddef.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "epicsExit.h"
#include "epicsThread.h"
#include "iocsh.h"
int main(int argc, char *argv[]) {
if (argc >= 2) {
iocsh(argv[1]);
epicsThreadSleep(.2);
}
iocsh(NULL);
epicsExit(0);
return (0);
}

1836
ADOrcaApp/src/orca.cpp Normal file

File diff suppressed because it is too large Load Diff

1
ADOrcaApp/src/orca.dbd Normal file
View File

@@ -0,0 +1 @@
registrar("orcaRegister")

351
ADOrcaApp/src/orca.h Normal file
View File

@@ -0,0 +1,351 @@
#ifndef DRV_HAMA_H
#define DRV_HAMA_H
// EPICS includes
#include <epicsExport.h>
#include <iocsh.h>
#include "ADDriver.h"
#include "dcamapi4.h"
#define MAX_FEATURE_NAME_LEN 64
#define MAX_H_SENSOR_SIZE 2048
#define MAX_V_SENSOR_SIZE 2048
#define hFrameRateString "H_FRAMERATE"
#define hOrcaNameString "H_HAMA_NAME" /* asynOctet ro */
#define hVendorString "H_VENDOR" /* asynOctet ro */
#define hModelString "H_MODEL" /* asynOctet ro */
#define hCameraIDString "H_CAMERAID" /* asynOctet ro */
#define hBusString "H_BUS" /* asynOctet ro */
#define hCameraVersionString "H_CAMERA_VERSION" /* asynOctet ro */
#define hDriverVersionString "H_DRIVER_VERSION" /* asynOctet ro */
#define hModuleVersionString "H_MODULE_VERSION" /* asynOctet ro */
#define hDcamApiVersionString "H_DCAM_API_VERSION" /* asynOctet ro */
// Sensor mode and speed
#define hSensorModeString "H_SENSOR_MODE" /* asynint32 rw */
#define hReadoutSpeedString "H_READOUT_SPEED" /* asynInt32 rw */
#define hReadoutDirectionString "H_READOUT_DIRECTION" /* asynIekt32 rw */
// Trigger
#define hTriggerSourceString "H_TRIGGER_SOURCE" /* asynInt32 rw */
#define hTriggerModeString "H_TRIGGER_MODE" /* asynInt32 rw */
#define hTriggerActiveString "H_TRIGGER_ACTIVE" /* asynInt32 rw */
#define hTriggerGlobalExposureString \
"H_TRIGGER_GLOBAL_EXPOSURE" /* asynInt32 rw */
#define hTriggerPolarityString "H_TRIGGER_POLARITY" /* asynInt32 rw */
#define hTriggerConnectorString "H_TRIGGER_CONNECTOR" /* asynInt32 rw */
#define hTriggerTimesString "H_TRIGGER_TIMES" /* asynInt32 rw */
#define hTriggerDelayString "H_TRIGGER_DELAY" /* asynFloat64 rw */
#define hInternalTriggerHandlingString \
"H_INTERNAL_TRIGGER_HANDLING" /* asynInt32 rw */
// Sensor cooler
#define hSensorTemperatureString "H_SENSOR_TEMPERATURE" /* asynFloat64 ro */
#define hSensorCoolerString "H_SENSOR_COOLER" /* asynInt32 rw */
#define hSensorCoolerStatusString "H_SENSOR_COOLER_STATUS" /* asynInt32 ro */
// Binning and ROI
#define hBinningString "H_BINNING" /* asynInt32 rw */
#define hSubarrayHPosString "H_SUBARRAY_HPOST" /* asynInt32 rw */
#define hSubarrayHSizeString "H_SUBARRAY_HSIZE" /* asynInt32 rw */
#define hSubarrayVPosString "H_SUBARRAY_VPOS" /* asynInt32 rw */
#define hSubarrayVSizeString "H_SUBARRAY_VSIZE" /* asynInt32 rw */
#define hSubarrayModeString "H_SUBARRAY_MODE" /* asynInt32 rw */
// ALU
#define hDefectCorrectModeString "H_DEFECTCORRECT_MODE" /* asynInt32 rw */
#define hHotPixelCorrectLevelString \
"H_HOT_PIXEL_CORRECT_LEVEL" /* asynInt32 rw */
#define hIntensityLutModeString "H_INTENSITY_LUT_MODE" /* asynInt32 rw */
#define hIntensityLutPageString "H_INTENSITY_LUT_PAGE" /* asynInt32 ro */
#define hExtractionModeString "H_EXTRACTION_MODE" /* asynInt32 ro */
// output trigger
#define hNumberOfOutputTriggerConnectorString \
"H_NUMBEROF_OUTPUTTRIGGERCONNECTOR" /* asynInt32 ro */
#define hOutputTriggerSource0String \
"H_OUTPUT_TRIGGER_SOURCE0" /* asynInt32 rw */
#define hOutputTriggerSource1String \
"H_OUTPUT_TRIGGER_SOURCE1" /* asynInt32 rw */
#define hOutputTriggerSource2String \
"H_OUTPUT_TRIGGER_SOURCE2" /* asynInt32 rw */
#define hOutputTriggerPolarity0String \
"H_OUTPUT_TRIGGER_POLARITY0" /* asynInt32 rw */
#define hOutputTriggerPolarity1String \
"H_OUTPUT_TRIGGER_POLARITY1" /* asynInt32 rw */
#define hOutputTriggerPolarity2String \
"H_OUTPUT_TRIGGER_POLARITY2" /* asynInt32 rw */
#define hOutputTriggerActive0String \
"H_OUTPUT_TRIGGER_ACTIVE0" /* asynInt32 ro */
#define hOutputTriggerActive1String \
"H_OUTPUT_TRIGGER_ACTIVE1" /* asynInt32 ro */
#define hOutputTriggerActive2String \
"H_OUTPUT_TRIGGER_ACTIVE2" /* asynInt32 ro */
#define hOutputTriggerDelay0String \
"H_OUTPUT_TRIGGER_DELAY0" /* asynFloat64 rw */
#define hOutputTriggerDelay1String \
"H_OUTPUT_TRIGGER_DELAY1" /* asynFloat64 rw */
#define hOutputTriggerDelay2String \
"H_OUTPUT_TRIGGER_DELAY2" /* asynFloat64 rw */
#define hOutputTriggerPeriod0String \
"H_OUTPUT_TRIGGER_PERIOD0" /* asynFloat64 rw */
#define hOutputTriggerPeriod1String \
"H_OUTPUT_TRIGGER_PERIOD1" /* asynFloat64 rw */
#define hOutputTriggerPeriod2String \
"H_OUTPUT_TRIGGER_PERIOD2" /* asynFloat64 rw */
#define hOutputTriggerKind0String "H_OUTPUT_TRIGGER_KIND0" /* asynInt32 rw */
#define hOutputTriggerKind1String "H_OUTPUT_TRIGGER_KIND1" /* asynInt32 rw */
#define hOutputTriggerKind2String "H_OUTPUT_TRIGGER_KIND2" /* asynInt32 rw */
#define hOutputTriggerBaseSensor0String \
"H_OUTPUT_TRIGGER_BASE_SENSOR0" /* asynInt32 rw */
#define hOutputTriggerBaseSensor1String \
"H_OUTPUT_TRIGGER_BASE_SENSOR1" /* asynInt32 rw */
#define hOutputTriggerBaseSensor2String \
"H_OUTPUT_TRIGGER_BASE_SENSOR2" /* asynInt32 rw */
#define hOutputTriggerPreHsyncCountString \
"H_OUTPUT_TRIGGER_PRE_HSYNC_COUNT" /* asynInt32 rw */
// Master Puls
#define hMasterPulseModeString "H_MASTERPULSE_MODE" /* asynInt32 rw */
#define hMasterPulseTriggerSourceString \
"H_MASTERPULSE_TRIGGER_SOURCE" /* asynInt32 rw */
#define hMasterPulseIntervalString \
"H_MASTERPULSE_INTERVAL" /* asynFloat64 rw */
#define hMasterPulseBurstTimesString \
"H_MASTERPULSE_BURST_TIMES" /* asynInt32 rw */
// Synchronious Timing
#define hTimingReadoutTimeString "H_TIMING_READOUT_TIME" /* asynFloat64 ro */
#define hTimingCyclicTriggerPeriodString \
"H_TIMING_CYCLICTRIGGERPERIOD" /* asynFloat64 ro */
#define hTimingMinTriggerBlankingString \
"H_TIMING_MIN_TRIGGER_BLANKING" /* asynFloat64 ro */
#define hTimingMinTriggerIntervalString \
"H_TIMING_MIN_TRIGGER_INTERVAL" /* asynFloat64 ro */
#define hTimingGlobalExposureDelayString \
"H_TIMING_GLOBAL_EXPOSURE_DELAY" /* asynFloat64 ro */
#define hTimingExposureString "H_TIMING_EXPOSURE" /* asynInt32 ro */
#define hTimingInvalidExposurePeriodString \
"H_TIMING_INVALID_EXPOSURE_PERIOD" /* asynFloat64 ro */
#define hInternalFrameRateString "H_INTERNAL_FRAME_RATE" /* asynFloat64 rw */
#define hInternalFrameIntervalString \
"H_INTERNAL_FRAME_INTERVAL" /* asynFloat64 rw */
#define hInternalLineSpeedString "H_INTERNAL_LINE_SPEED" /* asynFloat64 rw */
#define hInternalLineIntervalString \
"H_INTERNAL_LINE_INTERVAL" /* asynFloat64 rw */
// System information
#define hColorTypeString "H_COLOR_TYPE" /* asynInt32 ro */
#define hBitPerChannelString "H_BIT_PER_CHANNEL" /* asynInt32 rw */
#define hImageRowBytesString "H_IMAGE_ROWBYTES" /* asynInt32 ro */
#define hImageFrameBytesString "H_IMAGE_FRAMEBYTES" /* asynInt32 ro */
#define hImageTopOffsetBytesString \
"H_IMAGE_TOP_OFFSETBYTES" /* asynInt32 ro \
*/
#define hImagePixelTypeString "H_IMAGE_PIXEL_TYPE" /* asynInt32 rw */
#define hBufferRowbytesString "H_BUFFER_ROWBYTES" /* asynInt32 ro */
#define hBufferFramebytesString "H_BUFFER_FRAMEBYTES" /* asynInt32 ro */
#define hBufferTopOffsetBytesString \
"H_BUFFER_TOP_OFFSETBYTES" /* asynInt32 ro */
#define hBufferPixelTypeString "H_BUFFER_PIXEL_TYPE" /* asynInt32 ro */
#define hRecordFixedBytesPerFileString \
"H_RECORD_FIXED_BYTES_PER_FILE" /* asynInt32 ro */
#define hRecordFixedBytesPerSessionString \
"H_RECORD_FIXED_BYTES_PER_SESION" /* asynInt32 ro */
#define hRecordFixedBytesPerFrameString \
"H_RECORD_FIXED_BYTES_PER_FRAME" /* asynInt32 ro */
#define hSystemAliveString "H_SYSTEM_ALIVE" /* asynInt32 ro */
#define hConversionFactorCoeffString \
"H_CONVERSIONFACTOR_COEFF" /* asynFloat64 ro */
#define hConversionFactorOffsetString \
"H_CONVERSIONFACTOR_OFFSET" /* asynFloat64 ro */
#define hNumberOfViewString "H_NUMBER_OF_VIEW" /* asynInt32 ro */
#define hTimeStampProducerString "H_TIMESTAMP_PRODUCER" /* asynInt32 ro */
#define hFrameStampProducerString "H_FRAMESTAMP_PRODUCER" /* asynInt32 ro */
#define evrTimeStampString "EVR_TIMESTAMP"
#define evrCountString "EVR_COUNTS"
#define evrCountSinceAcqStartString "EVR_TRIGGERS_SINCE_ACQ_START"
#define evrTriggerDroppedString "EVR_TRIGGER_DROPPED"
#define hAcqControlString "H_ACQ_CONTROL"
// For some reason these two addresses are not defined in the dcamapi4 neither
// in dcamprop.h
#define DETECTOR_PIXEL_NUM_HORZ 0x00420830
#define DETECTOR_PIXEL_NUM_VERT 0x00420840
class epicsShareClass Orca : public ADDriver {
public:
Orca(const char*, int, size_t, int, int, int);
// ~Orca();
/* override ADDriver methods */
virtual asynStatus writeInt32(asynUser* pasynUser, epicsInt32 value);
virtual asynStatus writeFloat64(asynUser* pasynUser, epicsFloat64 value);
virtual void report(FILE* fp, int details);
void createAsynParams();
int readParameter(int propertyID, bool processPV = true);
int readParameterStr(int paramIndex);
void imageTask();
void temperatureTask();
protected:
int hFrameRate;
#define FIRST_HAMA_PARAM hFrameRate
int hOrcaName;
int hVendor;
int hModel;
int hCameraID;
int hBus;
int hCameraVersion;
int hDriverVersion;
int hModuleVersion;
int hDcamApiVersion;
// - sensor mode and speed
int hSensorMode;
int hReadoutSpeed;
int hReadoutDirection;
// - trigger
int hTriggerSource;
int hTriggerMode;
int hTriggerActive;
int hTriggerGlobalExposure;
int hTriggerPolarity;
int hTriggerConnector;
int hTriggerTimes;
int hTriggerDelay;
int hInternalTriggerHandling;
// - sensor cooler
int hSensorTemperature;
int hSensorCooler;
int hSensorCoolerStatus;
// - binning and roi
int hBinning;
int hSubarrayHPos;
int hSubarrayHSize;
int hSubarrayVPos;
int hSubarrayVSize;
int hSubarrayMode;
// - feature
int hExposureTime;
// - alu
int hDefectCorrectMode;
int hHotPixelCorrectLevel;
int hIntensityLutMode;
int hIntensityLutPage;
int hExtractionMode;
// - output trigger
int hNumberOfOutputTriggerConnector;
int hOutputTriggerSource0;
int hOutputTriggerSource1;
int hOutputTriggerSource2;
int hOutputTriggerPolarity0;
int hOutputTriggerPolarity1;
int hOutputTriggerPolarity2;
int hOutputTriggerActive0;
int hOutputTriggerActive1;
int hOutputTriggerActive2;
int hOutputTriggerDelay0;
int hOutputTriggerDelay1;
int hOutputTriggerDelay2;
int hOutputTriggerPeriod0;
int hOutputTriggerPeriod1;
int hOutputTriggerPeriod2;
int hOutputTriggerKind0;
int hOutputTriggerKind1;
int hOutputTriggerKind2;
int hOutputTriggerBaseSensor0;
int hOutputTriggerBaseSensor1;
int hOutputTriggerBaseSensor2;
int hOutputTriggerPreHsyncCount;
// - master pulse
int hMasterPulseMode;
int hMasterPulseTriggerSource;
int hMasterPulseInterval;
int hMasterPulseBurstTimes;
// - symchronous timing
int hTimingReadoutTime;
int hTimingCyclicTriggerPeriod;
int hTimingMinTriggerBlanking;
int hTimingMinTriggerInterval;
int hTimingGlobalExposureDelay;
int hTimingExposure;
int hTimingInvalidExposurePeriod;
int hInternalFrameRate;
int hInternalFrameInterval;
int hInternalLineSpeed;
int hInternalLineInterval;
// - system information
int hColorType;
int hBitPerChannel;
int hImageRowbytes;
int hImageFramebytes;
int hImageTopOffsetBytes;
int hImagePixelType;
int hBufferRowbytes;
int hBufferFramebytes;
int hBufferTopOffsetBytes;
int hBufferPixelType;
int hRecordFixedBytesPerFile;
int hRecordFixedBytesPerSession;
int hRecordFixedBytesPerFrame;
int hSystemAlive;
int hConversionFactorCoeff;
int hConversionFactorOffset;
int hNumberOfView;
int hImageDetectorPixelWidth;
int hImageDetectorPixelHeight;
int hImageDetectorPixelNumHorz;
int hImageDetectorPixelNumVert;
int hTimeStampProducer;
int hFrameStampProducer;
int evrCounts;
int evrCountsSinceAcqStart;
int evrTriggerDropped;
int hAcqControl;
int evrTimeStamp;
//----
//#define LAST_HAMA_PARAM evrTimeStamp
private:
HDCAM m_hdcam;
DCAMAPI_INIT m_apiInit;
DCAMDEV_OPEN m_devOpen;
DCAMERR m_err;
HDCAMWAIT hwait;
int stopThread;
epicsEventId startEvent_;
// Helper functions
asynStatus startAcquire(void);
asynStatus stopAcquire(void);
void getImageInformation(HDCAM hdcam, int32& pixeltype, int32& width,
int32& rowbytes, int32& height, int32& framebytes);
asynStatus accessCapturedImage(HDCAM hdcam, int32 iFrame, void* buf,
int32 rowbytes, int32 cx, int32 cy,
epicsUInt32& ts_sec, epicsUInt32& ts_microsec);
asynStatus imageTransferStatus(HDCAM hdcam,
DCAMCAP_TRANSFERINFO& captransferinfo, char *buf);
// wrapper functions for dcamapi
int allocateBuffers(unsigned int);
int freeBuffers();
// These function will be read only once
int connectCamera();
int initCamera();
bool checkAndLogError(DCAMERR err, const char* msg, int idx, double val,
const char* functionName);
int roundToNearestMultipleOfFour(int value);
asynStatus setFeature(int featureIndex, double value);
};
#endif

View File

@@ -15,15 +15,15 @@ conda create -n hama epics-base require tclx make compilers adcore busy
To activate env:
conda activate hama
conda activate orca
git clone ...
cd git/ADHama
cd git/ADOrca
compilation:
make -f ADHama.Makefile LIBVERSION=0.1 clean uninstall build db install
make -f ADOrca.Makefile LIBVERSION=0.1 clean uninstall build db install
execution:

View File

@@ -1,25 +1,28 @@
# This should be a test startup script
require adhama
require adorca
require ndpluginschemas
require adpluginkafka
epicsEnvSet("PREFIX", "Hama:")
epicsEnvSet("PORT", "HAMA")
epicsEnvSet("CAMERA", "0")
epicsEnvSet("PREFIX", "YMIR-Det1:")
epicsEnvSet("PORT", "ORCA")
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")
# iocshLoad("$(adhama_DIR)ADHama.iocsh")
#EVR settings
epicsEnvSet("EVR", "YMIR-TS:Ctrl-EVR-03")
epicsEnvSet("EVR_EVENT", "B")
devHamamatsuConfig("$(PORT)", $(CAMERA), 0, 0, 0, 0, 10)
# iocshLoad("$(adorca_DIR)ADOrca.iocsh")
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")
devOrcaConfig("$(PORT)", 0, 0, 0, 0, 10)
#asynSetTraceMask("$(PORT)",-1,0x9)
dbLoadRecords("$(adorca_DIR)db/orca.db","P=$(PREFIX),R=cam1:,EVR=$(EVR),E=$(EVR_EVENT),PORT=$(PORT),ADDR=0,TIMEOUT=1")
#asynSetTraceMask("$(PORT)",-1,0x10)
#asynSetTraceIOMask("$(PORT)",-1,0x2)
@@ -32,27 +35,38 @@ NDPvaConfigure("PVA1", $(QSIZE), 0, "$(PORT)", 0, "$(PREFIX)Pva1:Image", 0, 0, 0
dbLoadRecords("$(adcore_DIR)/db/NDPva.template", "P=$(PREFIX),R=Pva1:, PORT=PVA1,ADDR=0,TIMEOUT=1,NDARRAY_PORT=$(PORT)")
#
# Create a standard arrays plugin, set it to get data from hama driver.
NDSchemasConfigure("Schemas1", "$(QSIZE)", 0, "$(PORT)", 0, 0, 0, "test-orca-lab", 0)
dbLoadRecords("$(ndpluginschemas_DB)/NDPluginSchemas.template", "P=$(PREFIX), R=schemas:, PORT=Schemas1, ADDR=0, TIMEOUT=1, NDARRAY_PORT=$(PORT)")
# Create a standard arrays plugin, set it to get data from orca driver.
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)")
startPVAServer
# Create a kafka plugin, set it to get data from orca driver.
epicsEnvSet("KFK_TOPIC", "ymir_camera")
#
#
# Start iocInit function===================================================================================
#
# Kafka plugin
#epicsEnvSet("KFK_CONFIG_FILE_PATH", "/etc/kafka/kafka.conf")
KafkaPluginConfigure("Kafka1", 3, 1, "Schemas1", 0, -1, "$(KFK_TOPIC)","$(KFK_CONFIG_FILE_PATH)")
dbLoadRecords("$(adpluginkafka_DB)/adpluginkafka.db", "P=$(PREFIX), R=Kfk1:, PORT=Kafka1, ADDR=0, TIMEOUT=1, NDARRAY_PORT=Schemas1")
# startPVAServer
iocInit()
#
# End iocInit function ====================================================================================
#
dbpf Hama:cam1:PoolUsedMem.SCAN 0
dbpf Hama:image1:EnableCallbacks 1
dbpf $(PREFIX)cam1:PoolUsedMem.SCAN 0
dbpf $(PREFIX)image1:EnableCallbacks 1
dbpf $(PREFIX)cam1:AcquireTime .05
dbpf $(PREFIX)cam1:AcquirePeriod .1
dbpf $(PREFIX)cam1:NumImages 10
dbpf $(PREFIX)cam1:ImageMode 1
#dbpf Orca:cam1:TriggerPolarity-S # 2-positive, 1-negative
epicsThreadSleep(1.0)
dbl > pv.list
#
# END of st.cmd
#
dbpf $(PREFIX)cam1:PoolUsedMem.SCAN 0
dbpf $(PREFIX)image1:EnableCallbacks 1
epicsThreadSleep(1.0)

View File

@@ -1,3 +1,3 @@
# This should be the included snippet to configure and run the deployed IOC. It should be loaded with
#
# iocshLoad("$(ADHama_DIR)/ADHama.iocsh")
# iocshLoad("$(ADOrca_DIR)/ADOrca.iocsh")

View File

@@ -0,0 +1 @@
libdcamapi.so.4.0.6269

View File

@@ -0,0 +1 @@
libdcamapi.so.4.0.6269

Binary file not shown.