Skip to content

Commit 94e866f

Browse files
authored
Merge pull request #1 from ISISComputingGroup/Ticket6056_Add_IOC_ATTOCUBE
Ticket6056 add ioc attocube
2 parents 24dbba6 + 034ece6 commit 94e866f

File tree

26 files changed

+737
-0
lines changed

26 files changed

+737
-0
lines changed

.gitattributes

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Set the default behavior, in case people don't have core.autocrlf set.
2+
* text=auto
3+
4+
# Explicitly declare text files you want to always be normalized and converted
5+
# to native line endings on checkout.
6+
*.c text
7+
*.cpp text
8+
*.h text
9+
*.hpp text
10+
*.java text
11+
*.sh text eol=lf
12+
*.bat text
13+
*.cmd text
14+
*.db text
15+
*.dbd text
16+
*.template text
17+
*.substitutions text
18+
*.py text
19+
*.rst text
20+
*.uxf text
21+
22+
# Declare files that will always have CRLF line endings on checkout.
23+
*.sln text eol=crlf
24+
25+
# Denote all files that are truly binary and should not be modified.
26+
*.png binary
27+
*.jpg binary
28+
*.class binary
29+
*.vi binary

.github/workflows/linters.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name: Linter
2+
on: [pull_request]
3+
jobs:
4+
call-workflow:
5+
uses: ISISComputingGroup/reusable-workflows/.github/workflows/linters.yml@main
6+
with:
7+
compare-branch: origin/main

.gitignore

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
O.*/
2+
/db
3+
/bin
4+
/dbd
5+
/include
6+
/lib
7+
/templates
8+
test-reports
9+
envPaths
10+
cdCommands
11+
dllPath.bat
12+
runIOC.bat
13+
runIOC.sh
14+
relPaths.sh
15+
*.tag
16+
/data/
17+
/doc/
18+
*_info_positions.req
19+
*_info_settings.req
20+
*.py[cod]
21+
__pycache__/

LICENCE

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2024, Science and Technology Facilities Council
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
* Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
11+
12+
* Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
* Neither the name of the copyright holder nor the names of its
17+
contributors may be used to endorse or promote products derived from
18+
this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30+

Makefile

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Makefile for Asyn attocube support
2+
#
3+
# Created by ooy64575 on Thu May 16 16:34:28 2024
4+
# Based on the Asyn streamSCPI template
5+
6+
TOP = .
7+
include $(TOP)/configure/CONFIG
8+
9+
DIRS += configure
10+
DIRS += $(wildcard *Sup)
11+
DIRS += $(wildcard *App)
12+
DIRS += $(wildcard *Top)
13+
DIRS += $(wildcard iocBoot)
14+
15+
# The build order is controlled by these dependency rules:
16+
17+
# All dirs except configure depend on configure
18+
$(foreach dir, $(filter-out configure, $(DIRS)), \
19+
$(eval $(dir)_DEPEND_DIRS += configure))
20+
21+
# Any *App dirs depend on all *Sup dirs
22+
$(foreach dir, $(filter %App, $(DIRS)), \
23+
$(eval $(dir)_DEPEND_DIRS += $(filter %Sup, $(DIRS))))
24+
25+
# Any *Top dirs depend on all *Sup and *App dirs
26+
$(foreach dir, $(filter %Top, $(DIRS)), \
27+
$(eval $(dir)_DEPEND_DIRS += $(filter %Sup %App, $(DIRS))))
28+
29+
# iocBoot depends on all *App dirs
30+
iocBoot_DEPEND_DIRS += $(filter %App,$(DIRS))
31+
32+
# Add any additional dependency rules here:
33+
34+
include $(TOP)/configure/RULES_TOP
35+
36+
ioctests:
37+
.\system_tests\run_tests.bat

attocubeSup/Makefile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
TOP=..
2+
include $(TOP)/configure/CONFIG
3+
#=======================================
4+
5+
# Install .dbd and .db files
6+
DB += attocube.db
7+
DATA += attocube.proto
8+
9+
#=======================================
10+
include $(TOP)/configure/RULES

attocubeSup/attocube.db

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
record(bo, "$(P)SIM")
2+
{
3+
field(SCAN, "Passive")
4+
field(DTYP, "Soft Channel")
5+
field(ZNAM, "NO")
6+
field(ONAM, "YES")
7+
field(VAL, "$(RECSIM=0)")
8+
field(PINI, "YES")
9+
}
10+
11+
record(bo, "$(P)DISABLE")
12+
{
13+
field(DESC, "Disable comms")
14+
field(PINI, "YES")
15+
field(VAL, "$(DISABLE=0)")
16+
field(OMSL, "supervisory")
17+
field(ZNAM, "COMMS ENABLED")
18+
field(ONAM, "COMMS DISABLED")
19+
}
20+
21+
record(ai, "$(P)ANGLE")
22+
{
23+
field(DESC, "Angle")
24+
field(EGU, "deg")
25+
field(PREC, "2")
26+
field(SCAN, "1 second")
27+
field(DTYP, "stream")
28+
field(INP, "@attocube.proto get_angle $(PORT)")
29+
field(SIML, "$(P)SIM")
30+
field(SIOL, "$(P)SIM:ANGLE")
31+
field(SDIS, "$(P)DISABLE")
32+
info(INTEREST, "HIGH")
33+
info(archive, "VAL")
34+
info(alarm, "ATTOCUBE")
35+
36+
}
37+
38+
record(ao, "$(P)ANGLE:SP")
39+
{
40+
field(DESC, "Angle Set Point")
41+
field(EGU, "deg")
42+
field(PREC, "2")
43+
field(DRVH, "170")
44+
field(DRVL, "-170")
45+
field(DTYP, "stream")
46+
field(OUT, "@attocube.proto set_angle $(PORT)")
47+
field(SIML, "$(P)SIM")
48+
field(SIOL, "$(P)SIM:ANGLE:SP")
49+
field(SDIS, "$(P)DISABLE")
50+
field(UDFS, "NO_ALARM")
51+
info(archive, "VAL")
52+
}
53+
54+
record(ai, "$(P)ARK")
55+
{
56+
field(DESC, "Ark")
57+
field(EGU, "deg")
58+
field(PREC, "2")
59+
field(SCAN, "1 second")
60+
field(DTYP, "stream")
61+
field(INP, "@attocube.proto get_ark $(PORT)")
62+
field(SIML, "$(P)SIM")
63+
field(SIOL, "$(P)SIM:ARK")
64+
field(SDIS, "$(P)DISABLE")
65+
info(INTEREST, "HIGH")
66+
info(archive, "VAL")
67+
info(alarm, "ATTOCUBE")
68+
}
69+
70+
record(ao, "$(P)ARK:SP")
71+
{
72+
field(DESC, "Ark Set Point")
73+
field(EGU, "deg")
74+
field(PREC, "2")
75+
field(DRVH, "19")
76+
field(DRVL, "-19")
77+
field(DTYP, "stream")
78+
field(OUT, "@attocube.proto set_ark $(PORT)")
79+
field(SIML, "$(P)SIM")
80+
field(SIOL, "$(P)SIM:ARK:SP")
81+
field(SDIS, "$(P)DISABLE")
82+
field(UDFS, "NO_ALARM")
83+
info(archive, "VAL")
84+
}
85+
86+
record(bo, "$(P)INIT")
87+
{
88+
field(DESC, "Initialisation commands")
89+
field(PINI, "YES")
90+
field(SCAN, "Passive")
91+
field(DTYP, "stream")
92+
field(OUT, "@attocube.proto initialise $(PORT)")
93+
field(SDIS, "$(P)DISABLE")
94+
}
95+
96+
record(bo, "$(P)STOP")
97+
{
98+
field(DESC, "Stop commands")
99+
field(PINI, "NO")
100+
field(SCAN, "Passive")
101+
field(DTYP, "stream")
102+
field(OUT, "@attocube.proto stop $(PORT)")
103+
field(SDIS, "$(P)DISABLE")
104+
}
105+
106+
record(bi, "$(P)BUSY")
107+
{
108+
field(DESC, "Busy")
109+
field(SCAN, "1 second")
110+
field(DTYP, "stream")
111+
field(INP, "@attocube.proto get_busy $(PORT)")
112+
field(ZNAM, "NOT BUSY")
113+
field(ONAM, "BUSY")
114+
field(SDIS, "$(P)DISABLE")
115+
}
116+
117+
record(ao, "$(P)SIM:ANGLE")
118+
{
119+
field(SCAN, "Passive")
120+
field(DTYP, "Soft Channel")
121+
}
122+
123+
alias("$(P)SIM:ANGLE","$(P)SIM:ANGLE:SP")
124+
125+
record(ao, "$(P)SIM:ARK")
126+
{
127+
field(SCAN, "Passive")
128+
field(DTYP, "Soft Channel")
129+
}
130+
131+
alias("$(P)SIM:ARK","$(P)SIM:ARK:SP")

attocubeSup/attocube.proto

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
ReadTimeout = 100;
2+
OutTerminator = "\r\n";
3+
InTerminator = "\r\n:";
4+
5+
get_angle {
6+
out "ATANGLE=";
7+
in "%f";
8+
}
9+
10+
set_angle {
11+
out "ATTO=%f";
12+
out "ATGO=1";
13+
}
14+
15+
get_ark {
16+
out "Y=";
17+
in "%f";
18+
}
19+
20+
set_ark {
21+
out "ARK=%f";
22+
out "ARGO=1";
23+
}
24+
25+
initialise {
26+
out "VERBOSE=0";
27+
out "AB0";
28+
out "MO";
29+
out "XQ #SXD";
30+
out "MG \"stop 1\" {P2}";
31+
}
32+
33+
stop {
34+
out "AB0";
35+
out "MO";
36+
out "XQ #SXD";
37+
out "MG \"stop 1\" {P2}";
38+
}
39+
40+
get_busy {
41+
ExtraInput = Ignore;
42+
out "BUSY=";
43+
in "%1i";
44+
}
45+

configure/CONFIG

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# CONFIG - Load build configuration data
2+
#
3+
# Do not make changes to this file!
4+
5+
# Allow user to override where the build rules come from
6+
RULES = $(EPICS_BASE)
7+
8+
# RELEASE files point to other application tops
9+
include $(TOP)/configure/RELEASE
10+
-include $(TOP)/configure/RELEASE.$(EPICS_HOST_ARCH).Common
11+
ifdef T_A
12+
-include $(TOP)/configure/RELEASE.Common.$(T_A)
13+
-include $(TOP)/configure/RELEASE.$(EPICS_HOST_ARCH).$(T_A)
14+
endif
15+
16+
CONFIG = $(RULES)/configure
17+
include $(CONFIG)/CONFIG
18+
19+
# Override the Base definition:
20+
INSTALL_LOCATION = $(TOP)
21+
22+
# CONFIG_SITE files contain other build configuration settings
23+
include $(TOP)/configure/CONFIG_SITE
24+
-include $(TOP)/configure/CONFIG_SITE.$(EPICS_HOST_ARCH).Common
25+
ifdef T_A
26+
-include $(TOP)/configure/CONFIG_SITE.Common.$(T_A)
27+
-include $(TOP)/configure/CONFIG_SITE.$(EPICS_HOST_ARCH).$(T_A)
28+
endif
29+

configure/CONFIG_SITE

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# CONFIG_SITE
2+
3+
# Make any application-specific changes to the EPICS build
4+
# configuration variables in this file.
5+
#
6+
# Host/target specific settings can be specified in files named
7+
# CONFIG_SITE.$(EPICS_HOST_ARCH).Common
8+
# CONFIG_SITE.Common.$(T_A)
9+
# CONFIG_SITE.$(EPICS_HOST_ARCH).$(T_A)
10+
11+
# CHECK_RELEASE controls the consistency checking of the support
12+
# applications pointed to by the RELEASE* files.
13+
# Normally CHECK_RELEASE should be set to YES.
14+
# Set CHECK_RELEASE to NO to disable checking completely.
15+
# Set CHECK_RELEASE to WARN to perform consistency checking but
16+
# continue building even if conflicts are found.
17+
CHECK_RELEASE = YES
18+
19+
# Set this when you only want to compile this application
20+
# for a subset of the cross-compiled target architectures
21+
# that Base is built for.
22+
#CROSS_COMPILER_TARGET_ARCHS = vxWorks-ppc32
23+
24+
# To install files into a location other than $(TOP) define
25+
# INSTALL_LOCATION here.
26+
#INSTALL_LOCATION=</absolute/path/to/install/top>
27+
28+
# Set this when the IOC and build host use different paths
29+
# to the install location. This may be needed to boot from
30+
# a Microsoft FTP server say, or on some NFS configurations.
31+
#IOCS_APPL_TOP = </IOC's/absolute/path/to/install/top>
32+
33+
# For application debugging purposes, override the HOST_OPT and/
34+
# or CROSS_OPT settings from base/configure/CONFIG_SITE
35+
#HOST_OPT = NO
36+
#CROSS_OPT = NO
37+
38+
# These allow developers to override the CONFIG_SITE variable
39+
# settings without having to modify the configure/CONFIG_SITE
40+
# file itself.
41+
-include $(TOP)/../CONFIG_SITE.local
42+
-include $(TOP)/configure/CONFIG_SITE.local
43+

0 commit comments

Comments
 (0)