Commit 64dde958 authored by Marco Bartolini's avatar Marco Bartolini
Browse files

First commit of Medicina Minor Servo into branch

parent 0cd16b68
Loading
Loading
Loading
Loading
+134 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
    Author: 
        Marco Buttu, mbuttu@oa-cagliari.inaf.it

    Created: Mon Oct 12 12:08:05 CEST 2009
    Last Modified: Mon Nov  9 11:20:11 CET 2009
-->
<xs:schema
    targetNamespace="urn:schemas-cosylab-com:MinorServo:1.0"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns="urn:schemas-cosylab-com:MinorServo:1.0"
    xmlns:cdb="urn:schemas-cosylab-com:CDB:1.0"
    xmlns:baci="urn:schemas-cosylab-com:BACI:1.0"
    xmlns:xi="http://www.w3.org/2001/XInclude"
	xmlns:mng="urn:schemas-cosylab-com:Managment:1.0"
    elementFormDefault="qualified"
    attributeFormDefault="unqualified">

    <xs:import namespace="urn:schemas-cosylab-com:CDB:1.0" schemaLocation="CDB.xsd" />
    <xs:import namespace="urn:schemas-cosylab-com:BACI:1.0" schemaLocation="BACI.xsd" />
    <xs:import namespace="urn:schemas-cosylab-com:Managment:1.0" schemaLocation="Managment.xsd"/>

    <xs:complexType name="WPServoType">

        <!-- ********************* WAVE PATH SERVO PROPERTIES ********************* -->

        <xs:sequence>
            <!-- MinorServo actual position (ROdoubleSeq) -->
            <xs:element name="actPos" type="baci:ROdoubleSeq" />
            <!-- MinorServo plain actual position (ROdoubleSeq) -->
            <xs:element name="plainActPos" type="baci:ROdoubleSeq" />
            <!-- MinorServo commanded position (RWdoubleSeq) -->
            <xs:element name="cmdPos" type="baci:RWdoubleSeq" />
            <!-- Difference between commanded and actual position (ROdoubleSeq) -->
            <xs:element name="posDiff" type="baci:ROdoubleSeq" />
            <!-- MinorServo actual elongation (ROdoubleSeq) -->
            <xs:element name="actElongation" type="baci:ROdoubleSeq" />
            <!-- MinorServo virtual actual elongation (ROdoubleSeq) -->
            <xs:element name="virtualActElongation" type="baci:ROdoubleSeq" />
            <!-- Temperature of slave engine (ROdoubleSeq) -->
            <xs:element name="engTemperature" type="baci:ROdoubleSeq" />
            <!-- Counturing Error of slaves (ROdoubleSeq) -->
            <xs:element name="counturingErr" type="baci:ROdoubleSeq" />
            <!-- Torque Percentage of slaves (ROdoubleSeq) -->
            <xs:element name="torquePerc" type="baci:ROdoubleSeq" />
            <!-- Engine Current of slaves (ROdoubleSeq) -->
            <xs:element name="engCurrent" type="baci:ROdoubleSeq" />
            <!-- Driver Temperature of slaves (ROdoubleSeq) -->
            <xs:element name="driTemperature" type="baci:ROdoubleSeq" />
            <!-- Utilization percentage of slaves (ROdoubleSeq) -->
            <!-- Each item is the utilization percentage of minor servo slave. -->
            <!-- That percentage is the ratio between actual power and maximum supplying power -->
            <xs:element name="utilizationPerc" type="baci:ROdoubleSeq" />
            <!-- Drive Cabinet Temperature(ROdoubleSeq) -->
            <xs:element name="dcTemperature" type="baci:ROdoubleSeq" />
            <!-- Engine Voltage (ROdoubleSeq) -->
            <xs:element name="engVoltage" type="baci:ROdoubleSeq" />
            <!-- Driver Status (ROdoubleSeq) -->
            <xs:element name="driverStatus" type="baci:ROdoubleSeq" />
            <!-- Error Code (ROdoubleSeq) -->
            <xs:element name="errorCode" type="baci:ROdoubleSeq" />
            <xs:element name="status">
                 <xs:complexType>
                    <xs:complexContent>
                        <xs:restriction base="baci:ROpattern">
                            <xs:attribute name="resolution" type="xs:unsignedLong" use="optional" default="65535"/>
                            <xs:attribute name="bitDescription" type="xs:string" use="optional" 
                                default="Ready, Warning, Failure, Setup, Park, Tracking"/>
                            <xs:attribute name="whenSet" type="xs:string" use="optional" default=
                                "3, 3, 3, 3, 3, 3"/>
                            <xs:attribute name="whenCleared" type="xs:string" use="optional" default=
                                "0, 0, 0, 0, 0, 0"/>
                        </xs:restriction>
                    </xs:complexContent>
                </xs:complexType>
            </xs:element>
        </xs:sequence>

        <!-- ********************* WAVE PATH SERVO ATTRIBUTES ********************* -->
        <xs:attribute name="actionThreadStackSize" type="xs:unsignedLong" use="optional" default="1024" />
        <xs:attribute name="monitoringThreadStackSize" type="xs:unsignedLong" use="optional" default="2048" />
        <xs:attribute name="number_of_axis" type="xs:unsignedShort" use="required" />
        <xs:attribute name="number_of_slaves" type="xs:unsignedShort" use="required" />
        <xs:attribute name="scale_factor" type="xs:double" use="required" />
        <xs:attribute name="scale_offset" type="xs:double" use="required" />
        <xs:attribute name="server_ip" type="xs:string" use="required" />
        <xs:attribute name="server_port" type="xs:unsignedShort" use="required" />
        <!-- timeout (microseconds) applied when trying to connect to the axis -->
        <xs:attribute name="timeout" type="xs:unsignedLong" use="optional" />
        <!-- minor servo address, because there are several minor servos behind the
             same server address -->
        <xs:attribute name="servo_address" type="xs:unsignedShort" use="optional" />
        <!-- zero reference position -->
        <xs:attribute name="zero" type="xs:double" use="required" />
        <xs:attribute name="park_position" type="xs:string" use="required" />
        <xs:attribute name="max_speed" type="xs:unsignedLong" use="optional" />
        <xs:attribute name="min_speed" type="xs:unsignedLong" use="optional" />
        <!-- Type of drivers -->
        <xs:attribute name="driver_type" type="xs:string" use="optional" />
        <xs:attribute name="virtual_rs" type="xs:boolean" use="optional" default="0" />
        <xs:attribute name="require_calibration" type="xs:boolean" use="optional" default="0" />
        <!-- Expire time of data request in seconds. For instance: 0.001 for 1ms-->
        <xs:attribute name="expire_time" type="xs:double" use="required" />
        <!-- Maximum value allowed for the difference of two corresponding axis coordinates (mm) -->
        <!-- if |cmdPos – actPos| < tracking_delta, then the axis is following the commanded position -->
        <xs:attribute name="tracking_delta" type="xs:double" use="required" />
        <!-- limits = "(neg1, pos1), (neg2, pos2), ..., (negN, posN)" -->
        <xs:attribute name="limits" type="xs:string" use="required" />

    </xs:complexType>

    <xs:complexType name="MinorServoBossType">
        <xs:sequence>
            <xs:element name="status" type="mng:SystemStatusType" />
            <xs:element name="actualSetup" type="baci:ROstring" />
            <xs:element name="ready" type="mng:BooleanType" />
            <xs:element name="starting" type="mng:BooleanType" />
            <xs:element name="asConfiguration" type="mng:BooleanType" />
            <xs:element name="elevationTrack" type="mng:BooleanType" />
            <xs:element name="scanActive" type="mng:BooleanType" />
            <xs:element name="scanning" type="mng:BooleanType" />
        </xs:sequence>

        <xs:attribute name="server_ip" type="xs:string" use="required" />
        <xs:attribute name="AntennaBossInterface" type="xs:string" use="required" />
        <!-- Subsystem attributes -->
        <xs:attribute name="actionThreadStackSize" type="xs:unsignedLong" use="optional" default="1024" />
        <xs:attribute name="monitoringThreadStackSize" type="xs:unsignedLong" use="optional" default="2048" />
    </xs:complexType>

    <xs:element name="MinorServoBoss" type="MinorServoBossType"/>

</xs:schema>
+37 −0
Original line number Diff line number Diff line
<?xml version="1.0" encoding="ISO-8859-1"?>

<xs:schema
	targetNamespace="urn:schemas-cosylab-com:MinorServoParameters:1.0"
	xmlns="urn:schemas-cosylab-com:MinorServoParameters:1.0"
	xmlns:xs="http://www.w3.org/2001/XMLSchema"
	xmlns:cdb="urn:schemas-cosylab-com:CDB:1.0"
	xmlns:baci="urn:schemas-cosylab-com:BACI:1.0"
	elementFormDefault="qualified"
	attributeFormDefault="unqualified">
	<xs:import namespace="urn:schemas-cosylab-com:CDB:1.0" schemaLocation="CDB.xsd"/>
	<xs:import namespace="urn:schemas-cosylab-com:BACI:1.0" schemaLocation="BACI.xsd"/>
	
	<xs:complexType name="TTableHeader">
 		<xs:sequence>
 			<xs:element name="code" type="xs:string" />
            <xs:element name="primary" type="xs:int" default="1" />
            <xs:element name="trackel" type="xs:int" default="1" />
            <xs:element name="Xaxis" type="xs:string" minOccurs="0" maxOccurs="1" />
            <xs:element name="Yaxis" type="xs:string" minOccurs="0" maxOccurs="1" />
            <xs:element name="Zaxis" type="xs:string" minOccurs="0" maxOccurs="1" />
            <xs:element name="THETAXaxis" type="xs:string" minOccurs="0" maxOccurs="1" />
            <xs:element name="THETAYaxis" type="xs:string" minOccurs="0" maxOccurs="1" />
            <xs:element name="YPaxis" type="xs:string" minOccurs="0" maxOccurs="1" />
            <xs:element name="ZPaxis" type="xs:string" minOccurs="0" maxOccurs="1" />
 		</xs:sequence>
 	</xs:complexType>
 	
	<xs:complexType name="TTableMinorServo">
		<xs:sequence>
		 	<xs:element name="MinorServo" type="TTableHeader" minOccurs="1" maxOccurs="unbounded" />
 		</xs:sequence>
 	</xs:complexType>
 		
	<xs:element name="MinorServoParameters" type="TTableMinorServo"/>
	
</xs:schema>
+40 −0
Original line number Diff line number Diff line
<?xml version='1.0' encoding='ISO-8859-1'?>
<!--
    MEDICINA MINOR SERVO PARAMETERS
-->
<MinorServoParameters 
    xmlns="urn:schemas-cosylab-com:MinorServoParameters: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">

    <MinorServo>
        <code>KKC</code>
        <primary>0</primary>
        <trackel>1</trackel>
        <Xaxis>mm,-70.0,70.0,15,0,0,0,0</Xaxis>
        <Yaxis>mm,-70.0,70.0,-38.365,0,0,0,0</Yaxis>
        <Zaxis>mm,-70.0,70.0,0,0,0,0,0</Zaxis>
        <THETAXaxis>deg,-5,5.0,0,0,0,0,0</THETAXaxis>
        <THETAYaxis>deg,-5,5.0,0,0,0,0,0</THETAYaxis>
    </MinorServo>
    <MinorServo>
        <code>CCC</code>
        <primary>0</primary>
        <trackel>1</trackel>
        <Xaxis>mm,-70.0,70.0,-20,0,0,0,0</Xaxis>
        <Yaxis>mm,-70.0,70.0,+40,0,0,0,0</Yaxis>
        <Zaxis>mm,-70.0,70.0,0,0,0,0,0</Zaxis>
        <THETAXaxis>deg,-5,5.0,0,0,0,0,0</THETAXaxis>
        <THETAYaxis>deg,-5,5.0,0,0,0,0,0</THETAYaxis>
    </MinorServo>
    <!--
    <MinorServo>
        <code>XXP</code>
        <primary>1</primary>
        <trackel>0</trackel>
        <YPaxis>mm,-340,-320,-331.09,0,0,0,0</YPaxis>
        <ZPaxis>mm,-320,-300,-306.92,0,0,0,0</YPaxis>
    </MinorServo>
    -->
</MinorServoParameters>
+27 −0
Original line number Diff line number Diff line

/***************************************************************\
 *  Authors: 
 *      Marco Bartolini <bartolini@ira.inaf.it>
 *
 *  Created: Fri Gen 09 10:45:07 CEST 2015
\***************************************************************/
#ifndef __MEDMINORSERVOBOSS_IDL__
#define __MEDMINORSERVOBOSS_IDL__

#include <baci.idl>
#include <ComponentErrors.idl>
#include <ManagmentDefinitions.idl>
#include <MinorServoBoss.idl>
#include <MinorServoErrors.idl>

#pragma prefix "alma"

module MinorServo{
    interface MedMinorServoBoss: MinorServoBoss {
        void connect() raises (MinorServoErrors::CommunicationErrorEx);
        void disconnect() raises (MinorServoErrors::CommunicationErrorEx);
        void reset() raises (MinorServoErrors::CommunicationErrorEx);
    };
};

#endif
+54 −0
Original line number Diff line number Diff line
#ifndef DEVIOASCONFIGURATION_H_
#define DEVIOASCONFIGURATION_H_


#include <baciDevIO.h>

#include "MedMinorServoStatus.hpp"

using namespace baci;

class DevIOASConfiguration: public virtual DevIO<Management::TBoolean>
{
public:
	
	DevIOASConfiguration(MedMinorServoStatus *status): m_status(status) {
		AUTO_TRACE("DevIOASConfiguration::DevIOASConfiguration()");
	}
	
	~DevIOASConfiguration() {
		AUTO_TRACE("DevIOASConfiguration::~DevIOASConfiguration()");
	}
	
	bool initializeValue() {
		return false;
	}
	
	Management::TBoolean read(ACS::Time& timestamp) throw (ACSErr::ACSbaseExImpl) {
		AUTO_TRACE("DevIOASConfiguration::read()");
		timestamp=getTimeStamp();
		if (m_status->as_configuration) {
			m_val=Management::MNG_TRUE;
		}
		else {
			m_val=Management::MNG_FALSE;
		}
		return m_val;
    }
	
    void write(const ACE_CString &value, ACS::Time& timestamp) throw (ACSErr::ACSbaseExImpl) {
    	AUTO_TRACE("DevIOASConfiguration::write()");
	}
    
private:
	MedMinorServoStatus *m_status;
	Management::TBoolean m_val;
};







#endif /*DEVIOTRACKING_H_*/
Loading