Compare commits
101 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
def770e2f8 | ||
|
|
cceb18989b | ||
|
|
e2d6d48cde | ||
|
|
62065f7f44 | ||
|
|
00cb454e8c | ||
|
|
66cbff0ca4 | ||
|
|
934ce7afd0 | ||
|
|
47a2b8435f | ||
|
|
eaebcece9d | ||
|
|
994242e524 | ||
|
|
ca22a8166c | ||
|
|
6f0f6357be | ||
|
|
325821714a | ||
|
|
1abd258517 | ||
|
|
4c0a03fd81 | ||
|
|
4f29439529 | ||
|
|
f7410e5473 | ||
|
|
6384a20af1 | ||
|
|
7e496979ce | ||
|
|
5a14d155e3 | ||
|
|
429c991544 | ||
|
|
2d9bb69fb8 | ||
|
|
2c23087d04 | ||
|
|
7aacd3e881 | ||
|
|
343a17ae9f | ||
|
|
49c9eb4c20 | ||
|
|
a94ca36d90 | ||
|
|
587c23cacc | ||
|
|
7ac340473d | ||
|
|
52c274d5b2 | ||
|
|
6652bc2264 | ||
|
|
9225d07a0d | ||
|
|
481b7722c5 | ||
|
|
1ec9ec9f50 | ||
|
|
aa7a350688 | ||
|
|
3b0e24798f | ||
|
|
c587eabd00 | ||
|
|
15fd21a1e0 | ||
|
|
2c951811fc | ||
|
|
db6ce72e1d | ||
|
|
081d5bfdd5 | ||
|
|
634c3b12ba | ||
|
|
4bc89278fe | ||
|
|
acff3aedc0 | ||
|
|
bf9dccedc6 | ||
|
|
e7c34375ee | ||
|
|
4f6a5b4d51 | ||
|
|
2562f3d732 | ||
|
|
ed1845acf2 | ||
|
|
15e0849a58 | ||
|
|
9bf0389752 | ||
|
|
1a3c91838b | ||
|
|
e24c2f68e8 | ||
|
|
81ee3c28a5 | ||
|
|
94c13c6a48 | ||
|
|
10d88aa479 | ||
|
|
d77cb91b15 | ||
|
|
a9b6d1c4be | ||
|
|
16bb800227 | ||
|
|
1d07985371 | ||
|
|
7118ae9186 | ||
|
|
dfb2786e54 | ||
|
|
cc537075ab | ||
|
|
29163e8bae | ||
|
|
b3d88868ee | ||
|
|
8d4e8ee925 | ||
|
|
41d69d3ef1 | ||
|
|
374a84971b | ||
|
|
a66877b354 | ||
|
|
bfd746ac67 | ||
|
|
63fc03a41e | ||
|
|
7b73325de8 | ||
|
|
25e346e970 | ||
|
|
5751c2b703 | ||
|
|
11a7e3fe9e | ||
|
|
882f277114 | ||
|
|
71a97f8170 | ||
|
|
545fb7b0ec | ||
|
|
e2368aa113 | ||
|
|
45e223e40c | ||
|
|
8003d9f75d | ||
|
|
e2ccdb9b7e | ||
|
|
b01e13eb77 | ||
|
|
27dabf4fdc | ||
|
|
ed7881d93c | ||
|
|
b6de30a144 | ||
|
|
e7d48816d2 | ||
|
|
7dc9fd7cb3 | ||
|
|
37607c5f23 | ||
|
|
90d571bb43 | ||
|
|
c3634f8157 | ||
|
|
4f8962f9e1 | ||
|
|
ee066ef720 | ||
|
|
e15fafea4b | ||
|
|
58aefc799d | ||
|
|
a4cbf7e909 | ||
|
|
f62b2102bc | ||
|
|
97fd6f7c46 | ||
|
|
0d44d0bbf2 | ||
|
|
1c1ee4e728 | ||
|
|
922a418e5e |
11
.gitignore
vendored
11
.gitignore
vendored
@@ -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
|
||||
|
||||
|
||||
23
.vscode/c_cpp_properties.json
vendored
23
.vscode/c_cpp_properties.json
vendored
@@ -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
|
||||
}
|
||||
157
ADHama.Makefile
157
ADHama.Makefile
@@ -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
BIN
ADHamaApp/Db/.DS_Store
vendored
Binary file not shown.
File diff suppressed because it is too large
Load Diff
@@ -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
@@ -1 +0,0 @@
|
||||
registrar("hamaRegister")
|
||||
@@ -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
67
ADOrca.Makefile
Normal 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
|
||||
|
||||
|
||||
4
ADOrcaApp/Db/AlarmsOverride.template
Normal file
4
ADOrcaApp/Db/AlarmsOverride.template
Normal file
@@ -0,0 +1,4 @@
|
||||
# Removing undesired alarms from aborted state
|
||||
record(mbbi, "$(P)$(R)DetectorState_RBV") {
|
||||
field(TESV, "NO_ALARM")
|
||||
}
|
||||
1711
ADOrcaApp/Db/orca.template
Normal file
1711
ADOrcaApp/Db/orca.template
Normal file
File diff suppressed because it is too large
Load Diff
22
ADOrcaApp/src/ADOrcaMain.cpp
Normal file
22
ADOrcaApp/src/ADOrcaMain.cpp
Normal 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
1836
ADOrcaApp/src/orca.cpp
Normal file
File diff suppressed because it is too large
Load Diff
1
ADOrcaApp/src/orca.dbd
Normal file
1
ADOrcaApp/src/orca.dbd
Normal file
@@ -0,0 +1 @@
|
||||
registrar("orcaRegister")
|
||||
351
ADOrcaApp/src/orca.h
Normal file
351
ADOrcaApp/src/orca.h
Normal 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
|
||||
@@ -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:
|
||||
|
||||
|
||||
64
cmds/st.cmd
64
cmds/st.cmd
@@ -1,25 +1,27 @@
|
||||
# This should be a test startup script
|
||||
require adhama
|
||||
require adorca
|
||||
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 +34,35 @@ 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.
|
||||
# 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("KFK1", 3, 1, "$(PORT)", 0, -1, "$(KFK_TOPIC)", "hama_kfk1","$(KFK_CONFIG_FILE_PATH)")
|
||||
#dbLoadRecords("$(adpluginkafka_DIR)db/adpluginkafka.db", "P=$(PREFIX), R=Kfk1:, PORT=KFK1, ADDR=0, TIMEOUT=1, NDARRAY_PORT=$(PORT)")
|
||||
|
||||
# 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)
|
||||
|
||||
@@ -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")
|
||||
1
support/dcamsdk4/lib/linux-x86_64/libdcamapi.so
Symbolic link
1
support/dcamsdk4/lib/linux-x86_64/libdcamapi.so
Symbolic link
@@ -0,0 +1 @@
|
||||
libdcamapi.so.4.0.6269
|
||||
1
support/dcamsdk4/lib/linux-x86_64/libdcamapi.so.4
Symbolic link
1
support/dcamsdk4/lib/linux-x86_64/libdcamapi.so.4
Symbolic link
@@ -0,0 +1 @@
|
||||
libdcamapi.so.4.0.6269
|
||||
BIN
support/dcamsdk4/lib/linux-x86_64/libdcamapi.so.4.0.6269
Executable file
BIN
support/dcamsdk4/lib/linux-x86_64/libdcamapi.so.4.0.6269
Executable file
Binary file not shown.
Reference in New Issue
Block a user