From d86c75397515f1c1ec34752573c404baa98a3e77 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20Sandstr=C3=B6m?= Date: Tue, 30 Apr 2024 14:36:41 +0200 Subject: [PATCH] WIP --- Db/ecmcPluginMotion.template | 20 +- README.md | 7 + ecmc_plugin_motion.Makefile | 99 -------- opi/.keep | 0 qt/ecmc_plugin_motion_main.ui | 415 ++++++++++++++++++++++++++++++++++ 5 files changed, 440 insertions(+), 101 deletions(-) delete mode 100644 ecmc_plugin_motion.Makefile delete mode 100644 opi/.keep create mode 100644 qt/ecmc_plugin_motion_main.ui diff --git a/Db/ecmcPluginMotion.template b/Db/ecmcPluginMotion.template index 117edef..f63e18c 100644 --- a/Db/ecmcPluginMotion.template +++ b/Db/ecmcPluginMotion.template @@ -231,14 +231,30 @@ record(bo,"$(P)Plg-Mtn${INDEX}-TrgCmd-RB"){ field(HIGH, 0.001) } -record(longout,"$(P)Plg-Mtn${INDEX}-Mde-RB"){ +#record(longout,"$(P)Plg-Mtn${INDEX}-Mde-RB"){ +# info(asyn:READBACK,"1") +# field(DESC, "Mode selection") +# field(PINI, "1") +# field(TSE, "0") +# field(DTYP, "asynInt32") +# field(OUT, "@asyn(PLUGIN.MOTION_${INDEX},$(ADDR=0),$(TIMEOUT=1000))plugin.motion_${INDEX}.mode") +# field(SCAN, "Passive") +#} + +record(mbbo, "$(P)Plg-Mtn${INDEX}-Mde-RB"){ info(asyn:READBACK,"1") field(DESC, "Mode selection") field(PINI, "1") field(TSE, "0") field(DTYP, "asynInt32") field(OUT, "@asyn(PLUGIN.MOTION_${INDEX},$(ADDR=0),$(TIMEOUT=1000))plugin.motion_${INDEX}.mode") - field(SCAN, "Passive") + field(ZRST, "NO_COMMAND") + field(ZRVL, 0) + field(ONST, "CONT") + field(ONVL, 1) + field(TWST, "TRIGG") + field(TWVL, 2) + field(VAL, 1) } record(longout,"$(P)Plg-Mtn${INDEX}-Cmd-RB"){ diff --git a/README.md b/README.md index 0706d0d..e12eacc 100644 --- a/README.md +++ b/README.md @@ -7,4 +7,11 @@ Motion data are sampled, buffered and exposed to epics as waveforms. +# Panel +``` +# Plugin loaded once (MTN_ID defaults to 0) +caqtdm -macro "SYS=c6025a" ecmc_plugin_motion_main.ui +# If loaded more times +caqtdm -macro "SYS=c6025a,MTN_ID=1" ecmc_plugin_motion_main.ui +``` \ No newline at end of file diff --git a/ecmc_plugin_motion.Makefile b/ecmc_plugin_motion.Makefile deleted file mode 100644 index 6dbf8e4..0000000 --- a/ecmc_plugin_motion.Makefile +++ /dev/null @@ -1,99 +0,0 @@ -# -# Copyright (c) 2023 Paul Scherrer Institute -# -# The program is free software: you can redistribute -# it and/or modify it under the terms of the GNU General Public License -# as published by the Free Software Foundation, either version 2 of the -# License, or any newer version. -# -# 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. See the GNU General Public License for -# more details. -# -# You should have received a copy of the GNU General Public License along with -# this program. If not, see https://www.gnu.org/licenses/gpl-2.0.txt -# -# -# Author : anderssandstrom -# email : anders.sandstroem@psi.ch -# Date : 2023 July 10 -# version : 0.0.0 -# - - -## The following lines are mandatory, please don't change them. -where_am_I := $(dir $(abspath $(lastword $(MAKEFILE_LIST)))) -include $(E3_REQUIRE_TOOLS)/driver.makefile -include $(E3_REQUIRE_CONFIG)/DECOUPLE_FLAGS - -ifneq ($(strip $(ASYN_DEP_VERSION)),) -asyn_VERSION=$(ASYN_DEP_VERSION) -endif - -ifneq ($(strip $(ECMC_DEP_VERSION)),) -ecmc_VERSION=$(ECMC_DEP_VERSION) -endif - -ifneq ($(strip $(RUCKIG_DEP_VERSION)),) -ruckig_VERSION=$(RUCKIG_DEP_VERSION) -endif - -ifeq ($(T_A),linux-x86_64) - # Assume that the etherlab user library is done via - # https://github.com/icshwi/etherlabmaster - USR_INCLUDES += -I/opt/etherlab/include - USR_CFLAGS += -fPIC - USR_LDFLAGS += -L /opt/etherlab/lib - USR_LDFLAGS += -lethercat - USR_LDFLAGS += -Wl,-rpath=/opt/etherlab/lib -else - ifeq ($(T_A),linux-arm) - # Assume that the etherlab user library is done via - # https://github.com/icshwi/etherlabmaster - USR_INCLUDES += -I/opt/etherlab/include - USR_CFLAGS += -fPIC - USR_LDFLAGS += -L /opt/etherlab/lib - USR_LDFLAGS += -lethercat - USR_LDFLAGS += -Wl,-rpath=/opt/etherlab/lib - else - # Assume that the etherlab user library is done via - # Yocto ESS Linux bb recipe - USR_INCLUDES += -I$(SDKTARGETSYSROOT)/usr/include/etherlab - USR_CFLAGS += -fPIC - USR_LDFLAGS += -L $(SDKTARGETSYSROOT)/usr/lib/etherlab - USR_LDFLAGS += -lethercat - USR_LDFLAGS += -Wl,-rpath=$(SDKTARGETSYSROOT)/usr/lib/etherlab - USR_LDFLAGS += -lstdc++ - endif -endif - -APP:="." -#APPDB:=$(APP)/Db -#APPSRC:=$(APP)/src -APPSRC:=src -APPDB:=Db - -USR_CFLAGS += -shared -fPIC -Wall -Wextra -USR_LDFLAGS += -lstdc++ -USR_INCLUDES += -I$(where_am_I)$(APPSRC) - -TEMPLATES += $(wildcard $(APPDB)/*.db) -TEMPLATES += $(wildcard $(APPDB)/*.template) -SOURCES += $(APPSRC)/ecmcPluginMotion.c -SOURCES += $(APPSRC)/ecmcMotionPlgWrap.cpp -SOURCES += $(APPSRC)/ecmcMotionPlg.cpp -#SOURCES += $(APPSRC)/ecmcDataBuffer.cpp - -SCRIPTS += startup.cmd -SCRIPTS += addMotionObj.cmd - -db: - -.PHONY: db - -vlibs: - -.PHONY: vlibs - -### diff --git a/opi/.keep b/opi/.keep deleted file mode 100644 index e69de29..0000000 diff --git a/qt/ecmc_plugin_motion_main.ui b/qt/ecmc_plugin_motion_main.ui new file mode 100644 index 0000000..b90e461 --- /dev/null +++ b/qt/ecmc_plugin_motion_main.ui @@ -0,0 +1,415 @@ + + + Dialog + + + + 0 + 0 + 1252 + 893 + + + + ecmc expert axis + + + + + 10 + 30 + 1200 + 500 + + + + + 4 + + + + Analog + + + + + + Position + + + $(SYS):Plg-Mtn$(MTN_ID=0)-PosAct-Arr;$(SYS):Plg-Mtn$(MTN_ID=0)-PosSet-Arr; + + + 30.000000000000000 + + + caStripPlot::High + + + caStripPlot::TimeScale + + + 4 + + + caStripPlot::autoScale + + + 600.000000000000000 + + + 200.000000000000000 + + + caStripPlot::User + + + caStripPlot::User + + + + 255 + 216 + 217 + + + + -100.000000000000000 + + + caStripPlot::User + + + caStripPlot::User + + + + 0 + 255 + 0 + + + + 30.000000000000000 + + + 0.000000000000000 + + + caStripPlot::User + + + caStripPlot::User + + + + 159 + 207 + 255 + + + + + 133 + 190 + 232 + + + + false + + + true + + + 1 + + + + + + 10 + 680 + 1231 + 200 + + + + + 4 + + + + + + + Time + + + State + + + $(SYS):Plg-Mtn$(MTN_ID=0)-Ena-Arr;$(SYS):Plg-Mtn$(MTN_ID=0)-EnaAct-Arr;$(SYS):Plg-Mtn$(MTN_ID=0)-Bsy-Arr;$(SYS):Plg-Mtn$(MTN_ID=0)-Exe-Arr;$(SYS):Plg-Mtn$(MTN_ID=0)-TrjSrc-Arr;$(SYS):Plg-Mtn$(MTN_ID=0)-EncSrc-Arr;$(SYS):Plg-Mtn$(MTN_ID=0)-AtTrg-Arr; + + + 30.000000000000000 + + + caStripPlot::High + + + caStripPlot::TimeScaleFix + + + 4 + + + caStripPlot::fixedScale + + + 1.200000000000000 + + + -0.200000000000000 + + + caStripPlot::User + + + caStripPlot::User + + + + 255 + 216 + 217 + + + + 1.200000000000000 + + + -0.200000000000000 + + + caStripPlot::User + + + caStripPlot::User + + + + 0 + 255 + 0 + + + + 1.200000000000000 + + + -0.200000000000000 + + + caStripPlot::User + + + caStripPlot::User + + + + 159 + 207 + 255 + + + + 1.200000000000000 + + + -0.200000000000000 + + + caStripPlot::User + + + caStripPlot::User + + + 1.200000000000000 + + + -0.200000000000000 + + + caStripPlot::User + + + caStripPlot::User + + + 1.200000000000000 + + + -0.200000000000000 + + + caStripPlot::User + + + caStripPlot::User + + + 1.200000000000000 + + + -0.200000000000000 + + + caStripPlot::User + + + caStripPlot::User + + + + 133 + 190 + 232 + + + + true + + + 1 + + + + + + 10 + 530 + 1200 + 151 + + + + + 4 + + + + + + + + + + Position Error + + + $(SYS):Plg-Mtn$(MTN_ID=0)-PosErr-Arr; + + + 30.000000000000000 + + + caStripPlot::High + + + caStripPlot::TimeScale + + + 4 + + + caStripPlot::autoScale + + + 600.000000000000000 + + + 200.000000000000000 + + + caStripPlot::User + + + caStripPlot::User + + + + 255 + 216 + 217 + + + + -100.000000000000000 + + + caStripPlot::User + + + caStripPlot::User + + + + 0 + 255 + 0 + + + + 30.000000000000000 + + + 0.000000000000000 + + + caStripPlot::User + + + caStripPlot::User + + + + 159 + 207 + 255 + + + + + 133 + 190 + 232 + + + + false + + + true + + + 1 + + + + + + caStripPlot + QwtPlot +
caStripPlot
+
+ + QwtPlot + QFrame +
qwt_plot.h
+
+
+ + +