3 Commits
1.0.0 ... 1.0.1

Author SHA1 Message Date
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
2 changed files with 21 additions and 108 deletions

View File

@@ -22,136 +22,46 @@
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
REQUIRED += seq
############################################################################
#
# If you want to exclude any architectures:
#
############################################################################
EXCLUDE_ARCHS += linux-ppc64e6500
############################################################################
#
# Relevant directories to point to files
#
############################################################################
APP := ADOrcaApp
APP := ADOrcaApp
APPDB := $(APP)/Db
APPSRC := $(APP)/src
APPCMDS := $(APP)/cmds
############################################################################
#
# Add any files that should be copied to $(module)/Db
#
############################################################################
SUPPORT:= support/dcamsdk4/lib/linux-x86_64
# TEMPLATES += $(wildcard $(APPDB)/*.db)
TEMPLATES += $(wildcard $(APPDB)/*.db)
TEMPLATES += $(wildcard $(ADCORE_DIR)/*.db)
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)/ADOrcaMain.cpp
SOURCES += $(APPSRC)/orca.cpp
# SOURCES += support/dcamsdk4/misc/common.cpp
############################################################################
#
# Add any .dbd files that should be included (e.g. from user-defined functions, etc.)
#
############################################################################
DBDS += $(APPSRC)/orca.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
#
############################################################################
DBDS += $(APPSRC)/orca.dbd
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_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)
USR_LDFLAGS += -L$(PWD)/support/dcamsdk4/lib/linux-x86_64 -ldcamapi
#USR_LDFLAGS += -L/usr/local/lib -ldcamapi
vlibs: $(VENDOR_LIBS)
db: $(SUBS) $(TMPS)
$(VENDOR_LIBS):
$(QUIET) install -m 755 $@ $(PREFIX)/lib/
$(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)
.PHONY: $(VENDOR_LIBS) vlibs
vlibs:
.PHONY: vlibs

View File

@@ -779,6 +779,7 @@ void Orca::imageTask(){
int evr_counts_since_last_start = 0;
int evr_counts_since_last_start_previous = 0;
int evr_trigger_dropped = 0;
int acqStatus;
uint64_t prevAcquisitionCount = 0;
DCAMCAP_TRANSFERINFO captransferinfo;
epicsTimeStamp prevAcqTime, currentAcqTime;
@@ -929,10 +930,12 @@ void Orca::imageTask(){
getDoubleParam(ADAcquirePeriod, &acqusitionRate);
getIntegerParam(ADStatus, &acqStatus);
maxAcqusitionTime = acqusitionRate * 2;
epicsTimeGetCurrent(&currentAcqTime);
if (epicsTimeDiffInSeconds(&currentAcqTime, &prevAcqTime) > maxAcqusitionTime) {
printf("[DEBUG]::maxAcqusitionTime %f\n", maxAcqusitionTime);
if ((epicsTimeDiffInSeconds(&currentAcqTime, &prevAcqTime) > maxAcqusitionTime) &&
acqStatus != ADStatusAborted) {
printf("[DEBUG]::maxAcqusitionTime %f\n", maxAcqusitionTime);
setShutter(0);
stopAcquire();
setIntegerParam(ADAcquire, 0);