#*************************************************************************
# Copyright (c) 2002 The University of Chicago, as Operator of Argonne
#     National Laboratory.
# Copyright (c) 2002 The Regents of the University of California, as
#     Operator of Los Alamos National Laboratory.
# EPICS BASE Versions 3.13.7
# and higher are distributed subject to a Software License Agreement found
# in file LICENSE that is included with this distribution. 
#*************************************************************************
menu(steppermotorIALG) {
	choice(steppermotorIALG_No_Initialization,"No Initialization")
	choice(steppermotorIALG_Move_to_the_Positive_Limit,"Move to the Positive Limit")
	choice(steppermotorIALG_Move_to_the_Negative_Limit,"Move to the Negative Limit")
	choice(steppermotorIALG_Move_to_Positive_Home,"Move to Positive Home")
	choice(steppermotorIALG_Move_to_Negative_Home,"Move to Negative Home")
}
menu(steppermotorMODE) {
	choice(steppermotorMODE_Velocity,"Velocity")
	choice(steppermotorMODE_Position,"Position")
}
recordtype(steppermotor) {
	include "dbCommon.dbd" 
	field(VAL,DBF_FLOAT) {
		prompt("Desired Value")
		asl(ASL0)
		special(SPC_MOD)
		pp(TRUE)
	}
	field(OUT,DBF_OUTLINK) {
		prompt("Output Specification")
		promptgroup(GUI_OUTPUT)
		interest(1)
	}
	field(RDBL,DBF_INLINK) {
		prompt("Readback Location")
		promptgroup(GUI_OUTPUT)
		interest(1)
	}
	field(DOL,DBF_INLINK) {
		prompt("Desired Output Loc")
		promptgroup(GUI_OUTPUT)
		interest(1)
	}
	field(OMSL,DBF_MENU) {
		prompt("Output Mode Select")
		promptgroup(GUI_OUTPUT)
		interest(1)
		menu(menuOmsl)
	}
	field(ACCL,DBF_FLOAT) {
		prompt("Seconds to Velocity")
		promptgroup(GUI_MOTOR)
		interest(1)
	}
	field(VELO,DBF_FLOAT) {
		prompt("Velocity Rotation/Sec")
		promptgroup(GUI_MOTOR)
		interest(1)
	}
	field(DIST,DBF_FLOAT) {
		prompt("Dist of One Pulse")
		promptgroup(GUI_MOTOR)
		interest(1)
	}
	field(IVAL,DBF_FLOAT) {
		prompt("Value at init")
		promptgroup(GUI_MOTOR)
		interest(1)
	}
	field(MODE,DBF_MENU) {
		prompt("Operating Mode")
		promptgroup(GUI_MOTOR)
		interest(1)
		menu(steppermotorMODE)
	}
	field(CMOD,DBF_MENU) {
		prompt("Current Operating Mode")
		promptgroup(GUI_MOTOR)
		interest(1)
		menu(steppermotorMODE)
	}
	field(IALG,DBF_MENU) {
		prompt("Initialization Alg")
		promptgroup(GUI_MOTOR)
		interest(1)
		menu(steppermotorIALG)
	}
	field(MRES,DBF_USHORT) {
		prompt("Motor Pulses/Revolution")
		promptgroup(GUI_MOTOR)
		interest(1)
	}
	field(ERES,DBF_USHORT) {
		prompt("Encoder Pulses/Rev")
		promptgroup(GUI_MOTOR)
		interest(1)
	}
	field(PREC,DBF_SHORT) {
		prompt("Display Precision")
		promptgroup(GUI_DISPLAY)
		interest(1)
	}
	field(EGU,DBF_STRING) {
		prompt("Engineering Units")
		promptgroup(GUI_DISPLAY)
		interest(1)
		size(16)
	}
	field(DRVH,DBF_FLOAT) {
		prompt("Drive High Limit")
		promptgroup(GUI_OUTPUT)
		pp(TRUE)
		interest(1)
	}
	field(DRVL,DBF_FLOAT) {
		prompt("Drive Low Limit")
		promptgroup(GUI_OUTPUT)
		pp(TRUE)
		interest(1)
	}
	field(HOPR,DBF_FLOAT) {
		prompt("High Operating Range")
		promptgroup(GUI_DISPLAY)
		interest(1)
	}
	field(LOPR,DBF_FLOAT) {
		prompt("Low Operating Range")
		promptgroup(GUI_DISPLAY)
		interest(1)
	}
	field(HIHI,DBF_FLOAT) {
		prompt("Hihi Alarm Limit")
		promptgroup(GUI_ALARMS)
		pp(TRUE)
		interest(1)
	}
	field(LOLO,DBF_FLOAT) {
		prompt("Lolo Alarm Limit")
		promptgroup(GUI_ALARMS)
		pp(TRUE)
		interest(1)
	}
	field(HIGH,DBF_FLOAT) {
		prompt("High Alarm Limit")
		promptgroup(GUI_ALARMS)
		pp(TRUE)
		interest(1)
	}
	field(LOW,DBF_FLOAT) {
		prompt("Low Alarm Limit")
		promptgroup(GUI_ALARMS)
		pp(TRUE)
		interest(1)
	}
	field(HHSV,DBF_MENU) {
		prompt("Hihi Severity")
		promptgroup(GUI_ALARMS)
		pp(TRUE)
		interest(1)
		menu(menuAlarmSevr)
	}
	field(LLSV,DBF_MENU) {
		prompt("Lolo Severity")
		promptgroup(GUI_ALARMS)
		pp(TRUE)
		interest(1)
		menu(menuAlarmSevr)
	}
	field(HSV,DBF_MENU) {
		prompt("High Severity")
		promptgroup(GUI_ALARMS)
		pp(TRUE)
		interest(1)
		menu(menuAlarmSevr)
	}
	field(LSV,DBF_MENU) {
		prompt("Low Severity")
		promptgroup(GUI_ALARMS)
		pp(TRUE)
		interest(1)
		menu(menuAlarmSevr)
	}
	field(HLSV,DBF_MENU) {
		prompt("HW Limit Violation Svr")
		promptgroup(GUI_MOTOR)
		pp(TRUE)
		interest(2)
		menu(menuAlarmSevr)
	}
	field(MDEL,DBF_FLOAT) {
		prompt("Monitor Deadband")
		promptgroup(GUI_DISPLAY)
		interest(1)
	}
	field(ADEL,DBF_FLOAT) {
		prompt("Archive Deadband")
		promptgroup(GUI_DISPLAY)
		interest(1)
	}
	field(RDBD,DBF_FLOAT) {
		prompt("Retry Deadband")
		promptgroup(GUI_MOTOR)
		interest(1)
	}
	field(RTRY,DBF_SHORT) {
		prompt("Number of retries")
		promptgroup(GUI_MOTOR)
		interest(1)
	}
	field(STHM,DBF_SHORT) {
		prompt("Set Home")
		pp(TRUE)
		interest(2)
	}
	field(STOP,DBF_SHORT) {
		prompt("Stop motor")
		pp(TRUE)
		interest(2)
	}
	field(DMOV,DBF_SHORT) {
		prompt("Done moving to value")
		interest(2)
	}
	field(RVAL,DBF_LONG) {
		prompt("Current Raw Value")
		pp(TRUE)
	}
	field(RBV,DBF_FLOAT) {
		prompt("Readback Value")
		interest(1)
	}
	field(RRBV,DBF_LONG) {
		prompt("Raw Readback Value")
		interest(1)
	}
	field(ALST,DBF_FLOAT) {
		prompt("Last Value Archived")
		special(SPC_NOMOD)
		interest(3)
	}
	field(MLST,DBF_FLOAT) {
		prompt("Last Value Monitored")
		special(SPC_NOMOD)
		interest(3)
	}
	field(INIT,DBF_SHORT) {
		prompt("Initialize")
		interest(2)
	}
	field(MCW,DBF_SHORT) {
		prompt("Mtr Clckws Lim")
		pp(TRUE)
		interest(2)
	}
	field(MCCW,DBF_SHORT) {
		prompt("Mtr Cntr Clockwise Lmt")
		pp(TRUE)
		interest(2)
	}
	field(CW,DBF_SHORT) {
		prompt("Clockwise Limit")
		pp(TRUE)
		interest(2)
	}
	field(CCW,DBF_SHORT) {
		prompt("Counter Clockwise Lmt")
		pp(TRUE)
		interest(2)
	}
	field(DIR,DBF_SHORT) {
		prompt("Direction of Travel")
		pp(TRUE)
		interest(2)
	}
	field(MOVN,DBF_SHORT) {
		prompt("Moving Status")
		interest(2)
	}
	field(CVEL,DBF_SHORT) {
		prompt("Constant Velocity")
		interest(2)
	}
	field(RCNT,DBF_SHORT) {
		prompt("Retry count")
		interest(2)
	}
	field(POSM,DBF_SHORT) {
		prompt("Positive motion")
		interest(2)
	}
	field(LVAL,DBF_FLOAT) {
		prompt("Last Value")
		special(SPC_NOMOD)
		interest(3)
	}
	field(EPOS,DBF_FLOAT) {
		prompt("Encoder position rdbck")
		interest(2)
	}
	field(MPOS,DBF_FLOAT) {
		prompt("Motor position rdbck")
		interest(2)
	}
	field(MISS,DBF_FLOAT) {
		prompt("First attemp error")
		interest(2)
	}
	field(LVEL,DBF_FLOAT) {
		prompt("Last Velocity set")
		interest(2)
	}
	field(LACC,DBF_FLOAT) {
		prompt("Last acc set")
		interest(2)
	}
}
