

LOAD                                    = [NAME=derotatorsim, LIB=BasdaMoccaMpiaNDeviceDummy]                 # define the device name and the corresponding library
                                                                                                              # The Basdard application will search for name specified in SVN.NAME
                                                                                                              # in the DEV subtree in order to load the required device library.
                                                                                                              # Therefore this device name need to be set at the property entry SVC.DEVICE
                                                                                                              # in the service configuration file.
MOD.X.CFG.CONNECTION.ADDRESS            = tcp://192.168.61.50:4000                                            # connection address: tcp://HOST:PORT or tty:/dev/ttyS0:9600:8:no
MOD.X.CFG.CONNECTION.CARD               = 1                                                                   # the used MoCon card
MOD.X.CFG.CONNECTION.MODULE             = 5                                                                   # the used MoCon module
MOD.X.CFG.CONNECTION.TIMEOUT:Time       = 00:00:03.000000      +UNIT=hour                                     # its the time how long the service should wait for a normal command response like ACK (this timeout is blocking the service but the MoCon sends the ACK immediately)
MOD.X.CFG.CONNECTION.EVENT_TIMEOUT:Time = 00:00:00.500000    +UNIT=hour                                       # its the time how long the service should wait for a event message (Pay attention: this timeout blocks the service while it is waiting for an event which might not send immediately)
MOD.X.CFG.CONNECTION.UPLOAD_TIME:Time   = 00:00:00.008541000   +UNIT=hour                                     # this time needs to be measured in advance to calculate the correct timing for the net profile block upload
MOD.X.CFG.DATASHEET.CONFIG              = track_ctrl/track_ctrl.drot.derotator.datasheet.cfg

MOD.X.CFG.DATASHEET.TRAVELRANGE:Point   = [14885000, 36297500]  +UNIT=steps  +LABEL=["MIN", "MAX"]            # travel range determined to turn the bearing by 360 degrees
# MOD.X.CFG.FULLTURN:Int                  = 40960000 +UNIT=steps  +LABEL="FULLTURN"                           # = 625*65536

MOD.X.CFG.MICROSTEPS:Int                = 256
MOD.X.CFG.ABSENCLEAD:Int                = 1

CFG.POSITION.AUTOUPDATE:Int             = 0 # 4                                                               # device configuration parameter to define which position value should be periodically updated
                                                                                                              # default: 0 MoCon internal software Encoder
                                                                                                              #          1 incremental Encoder
                                                                                                              #          2 absolute Encoder
                                                                                                              #          3 MoCon internal software Encoder + incremental Encoder
                                                                                                              #          4 MoCon internal software Encoder + absolute Encoder
                                                                                                              #          5 incremental Encoder + absolute Encoder
                                                                                                              #          6 MoCon internal software Encoder + incremental Encoder + absolute Encoder

CFG.POSITION.REPORT:Int                 = 2                                                                   # device configuration parameter to define which position value should be returned by getPosition or displayed in the GUI
                                                                                                              # default: 0 MoCon internal software Encoder
                                                                                                              #          1 incremental Encoder
                                                                                                              #          2 absolute Encoder

CFG.POSITION.UNIT                       = STEPS                                                               # device configuration parameter to define in which unit the position value should be returned. The value is the index of the CFG.TRANS

# WCS Reference angle of the K-mirror rotation on the camera.
# see LN-MPIA-MAN-ICS-010, RJM 2017-01-17
# CFG.WCSREFANG:Double               = 24.8        +UNIT=degree +PREC=2

CFG.NAMED_POS.ABS.0:Double              = 14866250      +LABEL=["NP"] +NAME="Bottom"
CFG.NAMED_POS.ABS.1:Double              = 23796250      +LABEL=["NP"] +NAME="Horizontal"
CFG.NAMED_POS.ABS.2:Double              = 34036250      +LABEL=["NP"] +NAME="Vertical"
CFG.NAMED_POS.ABS.3:Double              = 36294375      +LABEL=["NP"] +NAME="Top"
CFG.NAMED_POS.REL.0:Double              = 625           +LABEL=["NP"] +NAME="Rel. 0"
CFG.NAMED_POS.REL.1:Double              = 1250          +LABEL=["NP"] +NAME="Rel. 1"
CFG.NAMED_POS.REL.2:Double              = 2500          +LABEL=["NP"] +NAME="Rel. 2"


CFG.TRANS.STEPS:Point                   = [1, 0]         +LABEL=["Scale", "Offset"] +PREC=0

# Beam center (fixed point) of the K-mirror rotation on the camera (FITS pixel units)
# see LN-MPIA-MAN-ICS-010, RJM 2017-01-17
# CFG.TRANS.BCNTR:Point               = [473.0, 442.0]         +LABEL=["x-pix", "y-pix"] +PREC=1

# m11, dx - scale X, offset x: Scale 360/(41.6 * 512*4 *90) [Gear ratio, encoder, rotation stage]
# The factor of beam rotation over physical rotation is not yet incorporated, because rotation
# of the mirror axis by 1 degrees rotates the beam on the sky by 2 degres. .RJM 2016-11-10

CFG.TRANS.DEGREE:Point                  = [8.7890625e-06, -132.6219] +LABEL=["Scale", "Offset"] +PREC=3


# CFG.ABSTOINC_INIT:String                = "ABSENC"

# the correct value for CFG.TRANS.ABSENC is calculated considering that MoCon
# drives the device using microsteps but calling them steps, which are not to be intended as the steps
# in the vendor datasheet, indeed 256 muSteps(MoCon steps) = 1 step

# the offset is used to refer readings inside a range from which transformation to steps does not exits travelrange

# ABSENC = STEPS*(-0.0016) + 65536;     STEPS = (ABSENC - 65536)/(-0.0016)
CFG.TRANS.ABSENC:Point                  = [-1.599999999999999860e-03, 65536]  +LABEL=["Scale", "Offset"] +PREC=2
