#! Generated by VisualDCT v2.6
#! DBDSTART
#! DBD("../../dbd/pmac.dbd")
#! DBDEND


# # \file
# # This template allows setting of variables for a 3jack CS with an angled 
# # mirror mount on top. The 3 jacks can be constructed in any geometry, and 
# # should be numbered in a clockwise order looking from the top with J1 having 
# # the smallest Z value of the jacks. It requires PROG10_CS_motion.pmc and an 
# # instantiation of CS_3jack_mirror.pmc with the variables shown in the image 
# # below:
# # \image html 3jack_mirror-help.png "Setup of 3 jack with mirror CS"
# # Build instructions for an example IOC are available 
# # \ref build_instructions_CS3jack_mirror "here", with a pmc file containing 
# # the CS definition available in iocs/CS3jack_mirror/defs.pmc
# % macro, __doc__, Supporting template that allows setting of variables for a 
# 3jack mirror CS 
# % macro, P, Pv Prefix
# % macro, COORD, Co-ordinate system number
# % macro, PREC, Precision to display variables
# % macro, AEGU, EGU for angular variables
# % macro, J1PV, Pv of real Jack1 motor, e.g. $(P):J1
# % macro, J2PV, Pv of real Jack1 motor, e.g. $(P):J2
# % macro, J3PV, Pv of real Jack1 motor, e.g. $(P):J3
# % macro, name, Object name and gui association name
# This associates an edm screen with the template
# % gui, $(name=), edm, 3jack_mirror.edl, 3jack=$(P)

# # This record will zero J1, J2 and J3 when processed
record(fanout, "$(P):ZERO") {
  field(LNK1, "$(P):ZEROJ1")
  field(LNK2, "$(P):ZEROJ2")
  field(LNK3, "$(P):ZEROJ3")
}

record(calcout, "$(P):ZEROJ1") {
  field(CALC, "-A")
  field(INPA, "$(J1PV=$(P):J1).DRBV")
  field(OUT, "$(J1PV=$(P):J1).OFF PP")
}

record(calcout, "$(P):ZEROJ2") {
  field(CALC, "-A")
  field(INPA, "$(J2PV=$(P):J2).DRBV")
  field(OUT, "$(J2PV=$(P):J2).OFF PP")
}

record(calcout, "$(P):ZEROJ3") {
  field(CALC, "-A")
  field(INPA, "$(J3PV=$(P):J3).DRBV")
  field(OUT, "$(J3PV=$(P):J3).OFF PP")
}

substitute "VAR=&$(COORD)Q20,Q=:J1X,EGU=mm,VARIABLE_PREC=$(PREC=3)"
include "pmacVariableWrite.template"

substitute "VAR=&$(COORD)Q21,Q=:J1Z,EGU=mm,VARIABLE_PREC=$(PREC=3)"
include "pmacVariableWrite.template"

substitute "VAR=&$(COORD)Q22,Q=:J2X,EGU=mm,VARIABLE_PREC=$(PREC=3)"
include "pmacVariableWrite.template"

substitute "VAR=&$(COORD)Q23,Q=:J2Z,EGU=mm,VARIABLE_PREC=$(PREC=3)"
include "pmacVariableWrite.template"

substitute "VAR=&$(COORD)Q24,Q=:J3X,EGU=mm,VARIABLE_PREC=$(PREC=3)"
include "pmacVariableWrite.template"

substitute "VAR=&$(COORD)Q25,Q=:J3Z,EGU=mm,VARIABLE_PREC=$(PREC=3)"
include "pmacVariableWrite.template"

substitute "VAR=&$(COORD)Q26,Q=:JTX,EGU=mm,VARIABLE_PREC=$(PREC=3)"
include "pmacVariableWrite.template"

substitute "VAR=&$(COORD)Q27,Q=:JTZ,EGU=mm,VARIABLE_PREC=$(PREC=3)"
include "pmacVariableWrite.template"

substitute "VAR=&$(COORD)Q28,Q=:MP,EGU=$(AEGU=deg),VARIABLE_PREC=$(PREC=3)"
include "pmacVariableWrite.template"

substitute "VAR=&$(COORD)Q29,Q=:MR,EGU=$(AEGU=deg),VARIABLE_PREC=$(PREC=3)"
include "pmacVariableWrite.template"

substitute "VAR=&$(COORD)Q30,Q=:MD,EGU=mm,VARIABLE_PREC=$(PREC=3)"
include "pmacVariableWrite.template"

substitute "VAR=&$(COORD)Q31,Q=:MCX,EGU=mm,VARIABLE_PREC=$(PREC=3)"
include "pmacVariableWrite.template"

substitute "VAR=&$(COORD)Q32,Q=:MCZ,EGU=mm,VARIABLE_PREC=$(PREC=3)"
include "pmacVariableWrite.template"

#! Further lines contain data used by VisualDCT
#! View(175,553,1.0)
#! Record("$(P):ZERO",220,702,0,0,"$(P):ZERO")
#! Field("$(P):ZERO.LNK1",16777215,1,"$(P):ZERO.LNK1")
#! Link("$(P):ZERO.LNK1","$(P):ZEROJ1")
#! Field("$(P):ZERO.LNK2",16777215,1,"$(P):ZERO.LNK2")
#! Link("$(P):ZERO.LNK2","$(P):ZEROJ2")
#! Field("$(P):ZERO.LNK3",16777215,1,"$(P):ZERO.LNK3")
#! Link("$(P):ZERO.LNK3","$(P):ZEROJ3")
#! Record("$(P):ZEROJ1",520,702,0,0,"$(P):ZEROJ1")
#! Field("$(P):ZEROJ1.INPA",16777215,1,"$(P):ZEROJ1.INPA")
#! Field("$(P):ZEROJ1.OUT",16777215,1,"$(P):ZEROJ1.OUT")
#! Record("$(P):ZEROJ2",520,862,0,0,"$(P):ZEROJ2")
#! Field("$(P):ZEROJ2.INPA",16777215,1,"$(P):ZEROJ2.INPA")
#! Field("$(P):ZEROJ2.OUT",16777215,1,"$(P):ZEROJ2.OUT")
#! Record("$(P):ZEROJ3",500,1022,0,0,"$(P):ZEROJ3")
#! Field("$(P):ZEROJ3.INPA",16777215,1,"$(P):ZEROJ3.INPA")
#! Field("$(P):ZEROJ3.OUT",16777215,1,"$(P):ZEROJ3.OUT")

