<?xml version='1.0' encoding='ISO-8859-1'?>
<!--
   Authors: 
       Marco Buttu, mbuttu@oa-cagliari.inaf.it
       Andrea Orlati, aorlati@ira.inaf.it
-->

<!-- ASACTIVE means the active sufrace is enabled and changing with the elevation,
     otherwise the code without the ASACTIVE suffice is the configuration with
     no active sufrace enabled.
-->
<!-- The order of axises of every minor servo have to be the same as MSCU one.
     Legend:
       * TX means translation in X
       * RX means rotation in X

     Given a setup code , if we have the following values: (C0, C1, C2), the axis value will be:

         C0 + C1*E + C2*E^2 

     Let's suppose the PFP LX  is (2.222, 1.111, 0), we'll have the following value for
     the PFP x axis:
         
         x = 2.222 + 1.111*E + 0*E**2
     
     PS. The rotation unit is sec, not arc sec.
-->
<!-- The action order must be: park; active servos; none -->
<MinorServoBoss
    xmlns="urn:schemas-cosylab-com:MinorServo:1.0" 
    xmlns:baci="urn:schemas-cosylab-com:BACI:1.0"
    xmlns:cdb="urn:schemas-cosylab-com:CDB:1.0"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    actionThreadStackSize="2048"
    monitoringThreadStackSize="4096"
    
    CCB_ASACTIVE="
        @ PFP: park;
        @ GFR: park;
        @ SRP: TX = (-1.5); 
               TY = (29.556666666666498, 0.263472663139432, -0.018206701940039, 0.000072373113855); 
               TZ = (11.5796960573, -0.4234293285, 0.0115320065, -0.0001960492, 0.0000012410);
               RX = (-0.0055555555555569409, 0.00014822163433269445, 0.000027586713698, -0.000000077732053);
               RY = (-0.036111111111111108); 
               RZ = (0);
        @ M3R: RZ = (286.67);
    "
    CCB="
        @ PFP: park;
        @ GFR: park;
        @ SRP: TX(mm) = (-1.5); 
               TY(mm) = (28.256852219272844, -0.002707044952, -0.009870218853, 0.000031617958);
               TZ(mm) = (9.530113849340003, -0.169826241752, 0.000419997047, 0.000003985237);
               RX(degree) = (-0.011392527142374848, -0.0001426193499425, 0.000039508844799, -0.000000131010010); 
               RY(degree) = (-0.03611111111111111); 
               RZ(degree) = (0);
        @ M3R: RZ(mm) = (286.67);
    "

    KKG_ASACTIVE="
        @ PFP: park;
        @ SRP: TX = (-1.5); 
               TY = (29.556666666666498, 0.263472663139432, -0.018206701940039, 0.000072373113855); 
               TZ = (-15.6669651675, 1.9293068324, -0.0628990613, 0.0007771141, -0.0000032940);
               RX = (-0.0055555555555569409, 0.00014822163433269445, 0.000027586713698, -0.000000077732053);
               RY = (-0.036111111111111108); 
               RZ = (0);
        @ GFR: RZ(mm) = (1323.5);
        @ M3R: RZ(mm) = (860);
    "
    KKG="
        @ PFP: park;
        @ SRP: TX(mm) = (-1.5); 
               TY(mm) = (28.256852219272844, -0.002707044952, -0.009870218853, 0.000031617958);
               TZ(mm) = (9.530113849340003, -0.169826241752, 0.000419997047, 0.000003985237);
               RX(degree) = (-0.011392527142374848, -0.0001426193499425, 0.000039508844799, -0.000000131010010); 
               RY(degree) = (-0.03611111111111111); 
               RZ(degree) = (0);
        @ GFR: RZ(mm) = (1323.5);
        @ M3R: RZ(mm) = (860);
    "

    LLP="
        @ SRP: park;
        @ PFP: RY(mm) = (-25.75); TX(mm) = (458); TZ(mm)= (-46.2);
        @ PFP: power_off_encoder;
        @ GFR: RZ(mm) = (-600);
        @ M3R: RZ(mm) = (860);
    "

    PPP="
        @ SRP: park;
        @ PFP: RY(mm) = (-25.75); TX(mm) = (458); TZ(mm) = (-45.9);
        @ PFP: power_off_encoder;
        @ GFR: RZ(mm) = (-600);
        @ M3R: RZ(mm) = (860);
    "

    PLP="
        @ SRP: park;
        @ PFP: RY(mm) = (-25.75); TX(mm) = (458); TZ(mm) = (-45.9);
        @ PFP: power_off_encoder;
        @ GFR: RZ(mm) = (-600);
        @ M3R: RZ(mm) = (860);
    "

    XKP="
        @ SRP: park;
        @ PFP: RY(mm) = (-25.75); TX(mm) = (-841.15); TZ(mm) = (-45.9);
        @ GFR: RZ(mm) = (-600);
        @ M3R: RZ(mm) = (860);
    "


    slaves="GFR, M3R, PFP, SRP"
>
    <!-- MinorServo Status -->
	<status description="The summary status of MinorServoBoss"/>
    <actualSetup description="Mnemonic code that defines a setup" />
    <motionInfo description="Elevation Track, No Elevation Track, Starting, Parking, ..." />
    <ready description="True if the system is ready" />
    <starting description="True if the system is starting" />
    <asConfiguration description="True if the the AS configuration is active" />
    <elevationTrack description="True if the M2 position is tracking the elevation" />
    <scanActive description="True if a scan is active" />
    <scanning description="True if the system is performing a scan" />
    <tracking description="Is the minor servo system in tracking?" />
              
    <!--
   MinorServoBoss Verbose Status (ROpattern)
    <verbose_status
        default_timer_trig="0"
        min_timer_trig="0"
        initialize_devio="0"
        default_value="0"
        description="MinorServoBoss verbose status" 
        format="I don't know"
        units="none"
        resolution="65535"
        alarm_mask="1"
        alarm_trigger="0"
        alarm_timer_trig="0"
        bitDescription="Ok, Tracking, Configuring, Parking, Parked, Warning, Failure"
        whenSet="3,3,3,3,3,3,3"
        whenCleared="0,0,0,0,0,0,0"
        archive_priority="1"
        archive_min_int="1"
        archive_max_int="1"
        archive_delta="1"
	/>
    -->

              
</MinorServoBoss>
