Skip to content
Snippets Groups Projects
Unverified Commit 9f228838 authored by Giuseppe Carboni's avatar Giuseppe Carboni Committed by GitHub
Browse files

Merge pull request #706 from discos/master

Merging master onto stable for new release 1.0.6c
parents 16a0fc3e cde686e9
Branches
Tags discos1.0.6c
No related merge requests found
Showing
with 708 additions and 1008 deletions
......@@ -91,7 +91,7 @@ else
fi
if ! hash vncviewer &>/dev/null; then
echo -e "'vncviewer' is not installed, this script is setting up the connection but won't automatically start vnc.\nA custom client should be manually started."
echo -e "'vncviewer' is not available, this script is setting up the connection but won't automatically start vnc.\nA custom vnc client will have to be manually started after the connection."
vnc_avail="FALSE"
fi
......
......@@ -26,8 +26,21 @@
</xs:sequence>
</xs:complexType>
<xs:complexType name="TTableLimitsHeader">
<xs:sequence>
<xs:element name="MINOR_SERVO_X" type="xs:string" minOccurs="0" maxOccurs="1"/>
<xs:element name="MINOR_SERVO_YP" type="xs:string" minOccurs="0" maxOccurs="1" />
<xs:element name="MINOR_SERVO_Y" type="xs:string" minOccurs="0" maxOccurs="1" />
<xs:element name="MINOR_SERVO_ZP" type="xs:string" minOccurs="0" maxOccurs="1" />
<xs:element name="MINOR_SERVO_Z1" type="xs:string" minOccurs="0" maxOccurs="1" />
<xs:element name="MINOR_SERVO_Z2" type="xs:string" minOccurs="0" maxOccurs="1" />
<xs:element name="MINOR_SERVO_Z3" type="xs:string" minOccurs="0" maxOccurs="1" />
</xs:sequence>
</xs:complexType>
<xs:complexType name="TTableMinorServo">
<xs:sequence>
<xs:element name="MinorServoLimits" type="TTableLimitsHeader" minOccurs="1" maxOccurs="1"/>
<xs:element name="MinorServo" type="TTableHeader" minOccurs="1" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
......
......@@ -13,12 +13,24 @@ struct MedMinorServoAxis_tag
double speed_max;
} MedMinorServoAxis;
const MedMinorServoAxis MINOR_SERVO_X = { "X", -80, 80, 0.0, 0.05, 0.01, 14.0 };
const MedMinorServoAxis MINOR_SERVO_YP = { "YP", -5, 395, 0.0, 0.05, 0.01, 8.0 };
const MedMinorServoAxis MINOR_SERVO_Y = { "Y", -80, 80, 0.0, 0.05, 0.01, 14.0 };
const MedMinorServoAxis MINOR_SERVO_ZP = { "ZP", -5, 345, 0.0, 0.05, 0.01, 8.0 };
const MedMinorServoAxis MINOR_SERVO_Z1 = { "Z1", -125, 125, 0.0, 0.05, 0.01, 14.0 };
const MedMinorServoAxis MINOR_SERVO_Z2 = { "Z2", -125, 125, 0.0, 0.05, 0.01, 14.0 };
const MedMinorServoAxis MINOR_SERVO_Z3 = { "Z3", -125, 125, 0.0, 0.05, 0.01, 14.0 };
using namespace std;
class MedMinorServoConstants {
public:
static MedMinorServoConstants *getInstance();
MedMinorServoAxis MINOR_SERVO_X ;
MedMinorServoAxis MINOR_SERVO_YP ;
MedMinorServoAxis MINOR_SERVO_Y ;
MedMinorServoAxis MINOR_SERVO_ZP ;
MedMinorServoAxis MINOR_SERVO_Z1 ;
MedMinorServoAxis MINOR_SERVO_Z2 ;
MedMinorServoAxis MINOR_SERVO_Z3 ;
private:
MedMinorServoConstants();
static MedMinorServoConstants *instance;
};
#endif
\ No newline at end of file
......@@ -97,6 +97,9 @@ class MedMinorServoPosition
double theta_y;
MedMinorServoMode mode;
ACS::Time time;
private:
MedMinorServoConstants *medMinorServoConstants;
};
/**
......
......@@ -14,6 +14,7 @@
#include "MedMinorServoGeometry.hpp"
#include "MedMinorServoOffset.hpp"
#include "MedMinorServoConstants.hpp"
class VirtualAxis
{
......@@ -24,6 +25,8 @@ class VirtualAxis
double min,
double max);
~VirtualAxis();
double get_min(){ return _min;};
double get_max(){ return _max;};
std::string get_name(){ return _name;};
std::string get_unit(){ return _unit;};
std::vector<double> get_coefficients(){ return _coefficients;};
......@@ -42,6 +45,8 @@ class VirtualAxis
*/
VirtualAxis parseAxisLine(const char* name, const char* line);
std::vector<double> parseLimitsLine(const char* line);
std::vector<std::string> split(const char* line, char delim = ',');
class MedMinorServoParameters
......@@ -69,6 +74,7 @@ class MedMinorServoParameters
std::string get_name(){ return _name;};
bool can_track_elevation(){ return _can_track_elevation;};
bool is_primary_focus(){ return _primary_focus;};
std::vector<VirtualAxis> getAxesVector(){return _axes;};
std::vector<std::string> getAxes(){return _axes_names;};
std::vector<std::string> getUnits(){return _axes_units;};
int getAxisMapping(std::string axis_name);
......@@ -78,6 +84,7 @@ class MedMinorServoParameters
std::vector<VirtualAxis> _axes;
std::vector<std::string> _axes_names;
std::vector<std::string> _axes_units;
};
typedef std::map<std::string, MedMinorServoParameters> MedMinorServoConfiguration;
......
......@@ -8,6 +8,7 @@
#include "MedMinorServoProtocol.hpp"
#include "MedMinorServoTime.hpp"
#include "MedMinorServoGeometry.hpp"
#include "MedMinorServoConstants.hpp"
MedMinorServoPosition get_random_position();
MedMinorServoPosition random_offset_position(MedMinorServoPosition);
......
......@@ -16,7 +16,7 @@ LIBRARIES_L =
#
# <brief description of lllll library>
MedMinorServoControl_OBJECTS = MedMinorServoControl MedMinorServoGeometry \
MedMinorServoControl_OBJECTS = MedMinorServoConstants MedMinorServoControl MedMinorServoGeometry \
MedMinorServoTime MedMinorServoModbus \
PositionQueue
......@@ -24,7 +24,7 @@ MedMinorServoControl_LIBS = baci acsnc IRALibrary ModbusChannel ManagmentDefin
ManagementErrors \
ComponentErrors boost_thread-mt boost_system
MinorServoBossImpl_OBJECTS = MedMinorServoControl MedMinorServoGeometry \
MinorServoBossImpl_OBJECTS = MedMinorServoConstants MedMinorServoControl MedMinorServoGeometry \
MedMinorServoStatus MedMinorServoParameters \
MedMinorServoTime MedMinorServoModbus \
MedMinorServoScan PositionQueue \
......@@ -42,7 +42,7 @@ MinorServoBossImpl_LIBS = MedMinorServoBossStubs MinorServoBossStubs \
baci DiscosVersion
EXECUTABLES_L = real_to_virtual# testclient testgeometry testprimary testsecondary testpassive real_to_virtual
real_to_virtual_OBJECTS = real_to_virtual testutils MedMinorServoGeometry MedMinorServoTime
real_to_virtual_OBJECTS = real_to_virtual testutils MedMinorServoConstants MedMinorServoGeometry MedMinorServoTime
real_to_virtual_LIBS = IRALibrary
#testclient_OBJECTS = testclient testutils MedMinorServoModbus MedMinorServoGeometry MedMinorServoTime MedMinorServoControl PositionQueue
#testclient_LIBS = IRALibrary boost_thread ModbusChannel
......@@ -56,7 +56,7 @@ real_to_virtual_LIBS = IRALibrary
#testgeometry_LIBS = IRALibrary boost_unit_test_framework boost_thread
EXECUTABLES = scudisconnect
scudisconnect_OBJECTS = scudisconnect MedMinorServoModbus MedMinorServoGeometry MedMinorServoTime MedMinorServoControl PositionQueue
scudisconnect_OBJECTS = scudisconnect MedMinorServoModbus MedMinorServoConstants MedMinorServoGeometry MedMinorServoTime MedMinorServoControl PositionQueue
scudisconnect_LIBS = IRALibrary ModbusChannel boost_thread-mt boost_system
#
......
#include "MedMinorServoConstants.hpp"
MedMinorServoConstants* MedMinorServoConstants::instance = 0;
MedMinorServoConstants* MedMinorServoConstants::getInstance() {
if (instance == 0) {
instance = new MedMinorServoConstants();
}
return instance;
}
MedMinorServoConstants::MedMinorServoConstants(){
}
\ No newline at end of file
......@@ -14,6 +14,17 @@ VirtualAxis::VirtualAxis(const char* name,
_coefficients(coefficients)
{}
std::vector<double> parseLimitsLine(const char* line)
{
std::vector<double> limits;
std::vector<std::string> tokens = split(line);
for(int i=0; i<6; ++i)
{
limits.push_back(boost::lexical_cast<double>(tokens[i]));
}
return limits;
}
VirtualAxis
parseAxisLine(const char* name, const char* line)
{
......@@ -174,8 +185,30 @@ MedMinorServoConfiguration
get_configuration_from_CDB(maci::ContainerServices* services)
{
MedMinorServoConfiguration configuration;
MedMinorServoConstants *medMinorServoConstants = MedMinorServoConstants::getInstance();
IRA::CError error;
error.Reset();
IRA::CDBTable minor_servo_limits_table(services,
"MinorServoLimits",
"DataBlock/MinorServoParameters");
if(!minor_servo_limits_table.addField(error, "MINOR_SERVO_X", IRA::CDataField::STRING))
error.setExtra("code MINOR_SERVO_X not found", 0);
if(!minor_servo_limits_table.addField(error, "MINOR_SERVO_YP", IRA::CDataField::STRING))
error.setExtra("code MINOR_SERVO_YP not found", 0);
if(!minor_servo_limits_table.addField(error, "MINOR_SERVO_Y", IRA::CDataField::STRING))
error.setExtra("code MINOR_SERVO_Y not found", 0);
if(!minor_servo_limits_table.addField(error, "MINOR_SERVO_ZP", IRA::CDataField::STRING))
error.setExtra("code MINOR_SERVO_ZP not found", 0);
if(!minor_servo_limits_table.addField(error, "MINOR_SERVO_Z1", IRA::CDataField::STRING))
error.setExtra("code MINOR_SERVO_Z1 not found", 0);
if(!minor_servo_limits_table.addField(error, "MINOR_SERVO_Z2", IRA::CDataField::STRING))
error.setExtra("code MINOR_SERVO_Z2 not found", 0);
if(!minor_servo_limits_table.addField(error, "MINOR_SERVO_Z3", IRA::CDataField::STRING))
error.setExtra("code MINOR_SERVO_Z3 not found", 0);
IRA::CDBTable minor_servo_table(services,
"MinorServo",
"DataBlock/MinorServoParameters");
......@@ -206,6 +239,78 @@ get_configuration_from_CDB(maci::ContainerServices* services)
dummy.setDescription((const char*)error.getDescription());
throw dummy;
}
if(!minor_servo_limits_table.openTable(error)){
_EXCPT_FROM_ERROR(ComponentErrors::CDBAccessExImpl, dummy, error);
throw dummy;
}
minor_servo_limits_table.First();
std::vector<double> limits;
limits=parseLimitsLine ((const char*)minor_servo_limits_table["MINOR_SERVO_YP"]->asString());
medMinorServoConstants->MINOR_SERVO_YP.name= "YP";
medMinorServoConstants->MINOR_SERVO_YP.position_min= limits[0];
medMinorServoConstants->MINOR_SERVO_YP.position_max= limits[1];
medMinorServoConstants->MINOR_SERVO_YP.position_zero= limits[2];
medMinorServoConstants->MINOR_SERVO_YP.position_error= limits[3];
medMinorServoConstants->MINOR_SERVO_YP.speed_min= limits[4];
medMinorServoConstants->MINOR_SERVO_YP.speed_max= limits[5];
limits=parseLimitsLine ((const char*)minor_servo_limits_table["MINOR_SERVO_ZP"]->asString());
medMinorServoConstants->MINOR_SERVO_ZP.name= "ZP";
medMinorServoConstants->MINOR_SERVO_ZP.position_min= limits[0];
medMinorServoConstants->MINOR_SERVO_ZP.position_max= limits[1];
medMinorServoConstants->MINOR_SERVO_ZP.position_zero= limits[2];
medMinorServoConstants->MINOR_SERVO_ZP.position_error= limits[3];
medMinorServoConstants->MINOR_SERVO_ZP.speed_min= limits[4];
medMinorServoConstants->MINOR_SERVO_ZP.speed_max= limits[5];
limits=parseLimitsLine ((const char*)minor_servo_limits_table["MINOR_SERVO_X"]->asString());
medMinorServoConstants->MINOR_SERVO_X.name= "X";
medMinorServoConstants->MINOR_SERVO_X.position_min= limits[0];
medMinorServoConstants->MINOR_SERVO_X.position_max= limits[1];
medMinorServoConstants->MINOR_SERVO_X.position_zero= limits[2];
medMinorServoConstants->MINOR_SERVO_X.position_error= limits[3];
medMinorServoConstants->MINOR_SERVO_X.speed_min= limits[4];
medMinorServoConstants->MINOR_SERVO_X.speed_max= limits[5];
limits=parseLimitsLine ((const char*)minor_servo_limits_table["MINOR_SERVO_Y"]->asString());
medMinorServoConstants->MINOR_SERVO_Y.name= "Y";
medMinorServoConstants->MINOR_SERVO_Y.position_min= limits[0];
medMinorServoConstants->MINOR_SERVO_Y.position_max= limits[1];
medMinorServoConstants->MINOR_SERVO_Y.position_zero= limits[2];
medMinorServoConstants->MINOR_SERVO_Y.position_error= limits[3];
medMinorServoConstants->MINOR_SERVO_Y.speed_min= limits[4];
medMinorServoConstants->MINOR_SERVO_Y.speed_max= limits[5];
limits=parseLimitsLine ((const char*)minor_servo_limits_table["MINOR_SERVO_Z1"]->asString());
medMinorServoConstants->MINOR_SERVO_Z1.name= "Z1";
medMinorServoConstants->MINOR_SERVO_Z1.position_min= limits[0];
medMinorServoConstants->MINOR_SERVO_Z1.position_max= limits[1];
medMinorServoConstants->MINOR_SERVO_Z1.position_zero= limits[2];
medMinorServoConstants->MINOR_SERVO_Z1.position_error= limits[3];
medMinorServoConstants->MINOR_SERVO_Z1.speed_min= limits[4];
medMinorServoConstants->MINOR_SERVO_Z1.speed_max= limits[5];
limits=parseLimitsLine ((const char*)minor_servo_limits_table["MINOR_SERVO_Z2"]->asString());
medMinorServoConstants->MINOR_SERVO_Z2.name= "Z2";
medMinorServoConstants->MINOR_SERVO_Z2.position_min= limits[0];
medMinorServoConstants->MINOR_SERVO_Z2.position_max= limits[1];
medMinorServoConstants->MINOR_SERVO_Z2.position_zero= limits[2];
medMinorServoConstants->MINOR_SERVO_Z2.position_error= limits[3];
medMinorServoConstants->MINOR_SERVO_Z2.speed_min= limits[4];
medMinorServoConstants->MINOR_SERVO_Z2.speed_max= limits[5];
limits=parseLimitsLine ((const char*)minor_servo_limits_table["MINOR_SERVO_Z3"]->asString());
medMinorServoConstants->MINOR_SERVO_Z3.name= "Z3";
medMinorServoConstants->MINOR_SERVO_Z3.position_min= limits[0];
medMinorServoConstants->MINOR_SERVO_Z3.position_max= limits[1];
medMinorServoConstants->MINOR_SERVO_Z3.position_zero= limits[2];
medMinorServoConstants->MINOR_SERVO_Z3.position_error= limits[3];
medMinorServoConstants->MINOR_SERVO_Z3.speed_min= limits[4];
medMinorServoConstants->MINOR_SERVO_Z3.speed_max= limits[5];
if(!minor_servo_table.openTable(error)){
_EXCPT_FROM_ERROR(ComponentErrors::CDBAccessExImpl, dummy, error);
throw dummy;
......@@ -230,12 +335,14 @@ get_configuration_from_CDB(maci::ContainerServices* services)
(const char*)minor_servo_table["YPaxis"]->asString()
)
);
parameters.add_axis(
parseAxisLine(
"ZP",
(const char*)minor_servo_table["ZPaxis"]->asString()
)
);
}else{ //secondary focus
parameters.add_axis(
parseAxisLine(
......@@ -243,12 +350,14 @@ get_configuration_from_CDB(maci::ContainerServices* services)
(const char*)minor_servo_table["Xaxis"]->asString()
)
);
parameters.add_axis(
parseAxisLine(
"Y",
(const char*)minor_servo_table["Yaxis"]->asString()
)
);
parameters.add_axis(
parseAxisLine(
"Z",
......
......@@ -26,6 +26,8 @@ get_random_axis_value(const MedMinorServoAxis& axis)
MEDMINORSERVOSTATUS
get_random_status()
{
MedMinorServoConstants *medMinorServoConstants = MedMinorServoConstants::getInstance();
MEDMINORSERVOSTATUS status;
int mode = std::rand() % 2;
if(mode == 0)
......@@ -33,8 +35,8 @@ get_random_status()
status.mode = 0;
status.time = MedMinorServoTime::ACSToServoNow();
status.system_status = MED_MINOR_SERVO_STATUS_PRIMARY;
status.pos_x_yp = get_random_axis_value(MINOR_SERVO_YP);
status.pos_y_zp = get_random_axis_value(MINOR_SERVO_ZP);
status.pos_x_yp = get_random_axis_value(medMinorServoConstants->MINOR_SERVO_YP);
status.pos_y_zp = get_random_axis_value(medMinorServoConstants->MINOR_SERVO_ZP);
status.pos_z1 = 0.0;
status.pos_z2 = 0.0;
status.pos_z3 = 0.0;
......@@ -42,11 +44,11 @@ get_random_status()
status.mode = 1;
status.time = MedMinorServoTime::ACSToServoNow();
status.system_status = MED_MINOR_SERVO_STATUS_SECONDARY;
status.pos_x_yp = get_random_axis_value(MINOR_SERVO_X);
status.pos_y_zp = get_random_axis_value(MINOR_SERVO_Y);
status.pos_z1 = get_random_axis_value(MINOR_SERVO_Z1);
status.pos_z2 = get_random_axis_value(MINOR_SERVO_Z2);
status.pos_z3 = get_random_axis_value(MINOR_SERVO_Z3);
status.pos_x_yp = get_random_axis_value(medMinorServoConstants->MINOR_SERVO_X);
status.pos_y_zp = get_random_axis_value(medMinorServoConstants->MINOR_SERVO_Y);
status.pos_z1 = get_random_axis_value(medMinorServoConstants->MINOR_SERVO_Z1);
status.pos_z2 = get_random_axis_value(medMinorServoConstants->MINOR_SERVO_Z2);
status.pos_z3 = get_random_axis_value(medMinorServoConstants->MINOR_SERVO_Z3);
}
return status;
}
......@@ -54,12 +56,13 @@ get_random_status()
MedMinorServoPosition
get_random_primary_position()
{
MedMinorServoConstants *medMinorServoConstants = MedMinorServoConstants::getInstance();
MEDMINORSERVOSTATUS status;
status.mode = 0;
status.time = MedMinorServoTime::ACSToServoNow();
status.system_status = MED_MINOR_SERVO_STATUS_PRIMARY;
status.pos_x_yp = get_random_axis_value(MINOR_SERVO_YP);
status.pos_y_zp = get_random_axis_value(MINOR_SERVO_ZP);
status.pos_x_yp = get_random_axis_value(medMinorServoConstants->MINOR_SERVO_YP);
status.pos_y_zp = get_random_axis_value(medMinorServoConstants->MINOR_SERVO_ZP);
status.pos_z1 = 0.0;
status.pos_z2 = 0.0;
status.pos_z3 = 0.0;
......@@ -69,15 +72,16 @@ get_random_primary_position()
MedMinorServoPosition
get_random_secondary_position()
{
MedMinorServoConstants *medMinorServoConstants = MedMinorServoConstants::getInstance();
MEDMINORSERVOSTATUS status;
status.mode = 1;
status.time = MedMinorServoTime::ACSToServoNow();
status.system_status = MED_MINOR_SERVO_STATUS_SECONDARY;
status.pos_x_yp = get_random_axis_value(MINOR_SERVO_X);
status.pos_y_zp = get_random_axis_value(MINOR_SERVO_Y);
status.pos_z1 = get_random_axis_value(MINOR_SERVO_Z1);
status.pos_z2 = get_random_axis_value(MINOR_SERVO_Z2);
status.pos_z3 = get_random_axis_value(MINOR_SERVO_Z3);
status.pos_x_yp = get_random_axis_value(medMinorServoConstants->MINOR_SERVO_X);
status.pos_y_zp = get_random_axis_value(medMinorServoConstants->MINOR_SERVO_Y);
status.pos_z1 = get_random_axis_value(medMinorServoConstants->MINOR_SERVO_Z1);
status.pos_z2 = get_random_axis_value(medMinorServoConstants->MINOR_SERVO_Z2);
status.pos_z3 = get_random_axis_value(medMinorServoConstants->MINOR_SERVO_Z3);
return MedMinorServoGeometry::positionFromAxes(status);
}
......
......@@ -18,7 +18,7 @@
Feeds="1"
IFs="2"
Polarization="L R"
DefaultLO="6956.0 6956.0"
DefaultLO="6936.0 6936.0"
LOMultiplier="1 1"
FixedLO2="0.0 0.0"
LOMin="5000.0 5000.0"
......
......@@ -8,12 +8,26 @@
xmlns:cdb="urn:schemas-cosylab-com:CDB:1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!--
for each axis we specify name and characteristics as:
<NAME>position_min,position_max,position_zero,position_error,speed_min,speed_max</NAME>
-->
<MinorServoLimits>
<MINOR_SERVO_X>-80,80,0.0,0.05,0.01,14</MINOR_SERVO_X>
<MINOR_SERVO_YP>-5,395,0.0,0.05,0.01,8</MINOR_SERVO_YP>
<MINOR_SERVO_Y>-80,80,0.0,0.05,0.01,14</MINOR_SERVO_Y>
<MINOR_SERVO_ZP>-5,345,0.0,0.05,0.01,8</MINOR_SERVO_ZP>
<MINOR_SERVO_Z1>-125,125,0.0,0.05,0.01,14</MINOR_SERVO_Z1>
<MINOR_SERVO_Z2>-125,125,0.0,0.05,0.01,14</MINOR_SERVO_Z2>
<MINOR_SERVO_Z3>-125,125,0.0,0.05,0.01,14</MINOR_SERVO_Z3>
</MinorServoLimits>
<MinorServo>
<code>SEC</code>
<primary>0</primary>
<trackel>1</trackel>
<!--
for each axis we sepcify name an scharacteristics as:
for each axis we specify name and characteristics as:
<NAME>unit,min,max,pol0,pol1,pol2,pol3,pol4</NAME>
......
......@@ -8,12 +8,26 @@
xmlns:cdb="urn:schemas-cosylab-com:CDB:1.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<!--
for each axis we specify name and characteristics as:
<NAME>position_min,position_max,position_zero,position_error,speed_min,speed_max</NAME>
-->
<MinorServoLimits>
<MINOR_SERVO_X>-80,80,0.0,0.05,0.01,14</MINOR_SERVO_X>
<MINOR_SERVO_YP>-5,395,0.0,0.05,0.01,8</MINOR_SERVO_YP>
<MINOR_SERVO_Y>-80,80,0.0,0.05,0.01,14</MINOR_SERVO_Y>
<MINOR_SERVO_ZP>-5,345,0.0,0.05,0.01,8</MINOR_SERVO_ZP>
<MINOR_SERVO_Z1>-125,125,0.0,0.05,0.01,14</MINOR_SERVO_Z1>
<MINOR_SERVO_Z2>-125,125,0.0,0.05,0.01,14</MINOR_SERVO_Z2>
<MINOR_SERVO_Z3>-125,125,0.0,0.05,0.01,14</MINOR_SERVO_Z3>
</MinorServoLimits>
<MinorServo>
<code>SEC</code>
<primary>0</primary>
<trackel>1</trackel>
<!--
for each axis we sepcify name an scharacteristics as:
for each axis we specify name and characteristics as:
<NAME>unit,min,max,pol0,pol1,pol2,pol3,pol4</NAME>
......
"@(#) $Id$"
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
- $Id: ASErrors.xml,v 1.1 2011-03-24 09:01:20 c.migoni Exp $
- Author: Giuseppe Maccaferri
-
- History:
- 18-01-2005 Created
- 14-09-2005 Added error memebers
- 12-05-2008 Added TrackingNotStarted error code
- 16-07-2008 Modified for ACS7.0.1
-->
<Type xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="Alma/ACSError" xsi:noNamespaceSchemaLocation="Alma/ACSError ACSError.xsd"
name="ASErrors" type="2003" _prefix="alma">
<Code name="NoError" shortDescription="No error" description="No error condition found"/>
<ErrorCode name="USDCalibrated" shortDescription=" " description="USD succesful calibrated">
<Member name="CammaLen" type="double" description="Length of camma-on window"/>
<Member name="CammaPos" type="double" description="Distance from top edge of the middle camma-on window"/>
</ErrorCode>
<ErrorCode name="LibrarySocketError" shortDescription="Socket error. Critical" description="Error encountered while creating or accessing socket resource" />
<ErrorCode name="SocketReconn" shortDescription="Socket reconnected. Warning" description="Socket was broken. Reconnected successfully"/>
<ErrorCode name="SocketFail" shortDescription="Unrecoverable socket problems. Critical" description="The socket connection could not be re established"/>
<ErrorCode name="SocketTOut" shortDescription="Time out writing to socket. Critical" description="Time out writing to socket. Critical"/>
<ErrorCode name="SocketNotRdy" shortDescription="Unable to allocate socket resource. Error" description="Unable to allocate socket resource. Error"/>
<ErrorCode name="MemoryAllocation" shortDescription="Buffer can't be allocated. Error" description="Buffer can't be allocated. Error"/>
<ErrorCode name="LANConnectionError" shortDescription="LAN/485 converter is not reachable or disconnected" description="LAN/485 converter is not reachable or disconnected"/>
<ErrorCode name="LAN_Unavailable" shortDescription="The LAN component is unavailable" description="The LAN component is unavailable"/>
<ErrorCode name="sendCmdErr" shortDescription="sendCmd() returned a wrong code. Error" description="sendCmd() returned a wrong code. Error"/>
<ErrorCode name="Incomplete" shortDescription="Incomplete reply from USD. Warning" description="Incomplete reply from USD. Warning"/>
<ErrorCode name="InvalidResponse" shortDescription="USD returned an invalid acknowledge code. Error" description="USD returned an invalid acknowledge code. Error"/>
<ErrorCode name="Nak" shortDescription="USD does not acknowledge last command.Warning" description="USD does not acknowledge last command.Warning"/>
<ErrorCode name="CDBAccessError" shortDescription="Error while accessing the Configuration Database.Error" description="Error while accessing the Configuration Database.Error">
<Member name="FieldName" type="string" description="FiledName"/>
</ErrorCode>
<ErrorCode name="USDConnectionError" shortDescription="USD is not reachable or disconnected.Critical" description="USD is not reachable or disconnected.Critical"/>
<ErrorCode name="USDTimeout" shortDescription=" " description="Timeout on receive data from USD.Critical">
<Member name="which" type="string" description="the usd location"/>
</ErrorCode>
<ErrorCode name="USDUnavailable" shortDescription="USD no more available.Warning" description="USD no more available.Warning"/>
<ErrorCode name="USDError" shortDescription="generic USD error executing an action.Error" description="generic USD error executing an action.Error"/>
<ErrorCode name="DevIOError" shortDescription="USD error reading or writing a property.Error" description="USD error reading or writing a property.Error">
<Member name="property" type="string" description="Name of the property"/>
</ErrorCode>
<ErrorCode name="corbaError" shortDescription="CORBA system exception executing an action.Error" description="CORBA system exception executing an action.Error"/>
<ErrorCode name="USDStillRunning" shortDescription="USD still running while shouldn't be!.Error" description="USD still running while shouldn't be!.Error"/>
<ErrorCode name="USDunCalibrated" shortDescription="USD not calibrated.Warning" description="USD not calibrated.Warning"/>
<ErrorCode name="CannotGetUSD" shortDescription="USD not activated.Warning" description="USD not activated.Warning"/>
</Type>
#*******************************************************************************
# E.S.O. - ACS project
#
# "@(#) $Id: Makefile,v 1.1 2011-03-24 09:01:32 c.migoni Exp $"
#
# Makefile of lan
#
# who when what
# -------- -------- ----------------------------------------------
# almaprog 04/08/04 created
#
#*******************************************************************************
# This Makefile follows VLT Standards (see Makefile(5) for more).
#*******************************************************************************
# REMARKS
# None
#------------------------------------------------------------------------
#
# user definable C-compilation flags
#USER_CFLAGS =
#
# additional include and library search paths
#USER_INC =
#USER_LIB =
USER_LIB = -lACE \
-lTAO \
-lTAO_DsLogAdmin \
-lTAO_CosNaming \
-lTAO_IORTable \
-lTAO_PortableServer \
-lTAO_Svc_Utils \
-lTAO_CosTrading \
-lTAO_CosNotification \
-lTAO_DynamicAny \
-lTAO_IFR_Client \
-lTAO_CosProperty \
-lacsutil \
-lcdb \
-llogging \
-lacscomponent \
-lbaci \
-lmaci \
-lmaciClient \
-lacserr \
-lm \
-lloki \
-lACSErrTypeCommon
#
# MODULE CODE DESCRIPTION:
# ------------------------
# As a general rule: public file are "cleaned" and "installed"
# local (_L) are not "installed".
#
# C programs (public and local)
# -----------------------------
EXECUTABLES =
EXECUTABLES_L =
#
# <brief description of xxxxx program>
xxxxx_LDFLAGS =
#
# special compilation flags for single c sources
#yyyyy_CFLAGS =
#
# Includes (.h) files (public only)
# ---------------------------------lanSocket.h
INCLUDES =
#
# Libraries (public and local)
# ----------------------------
LIBRARIES =
LIBRARIES_L =
#
# <brief description of lllll library>
#lanImpl_OBJECTS = lanImpl lanSocket
#lanImpl_LIBS= lanStubs IRALibrary ASErrors
#
# error file
# ----------------------------
ACSERRDEF= ASErrors
#
# Scripts (public and local)
# ----------------------------
SCRIPTS =
SCRIPTS_L =
#
# TCL scripts (public and local)
# ------------------------------
TCL_SCRIPTS =
TCL_SCRIPTS_L =
#
# Python stuff (public and local)
# ----------------------------
PY_SCRIPTS =
PY_SCRIPTS_L =
PY_MODULES =
PY_MODULES_L =
PY_PACKAGES =
PY_PACKAGES_L =
pppppp_MODULES =
#
# <brief description of tttttt tcl-script>
tttttt_OBJECTS =
tttttt_TCLSH =
tttttt_LIBS =
#
# TCL libraries (public and local)
# ------------------------------
TCL_LIBRARIES =
TCL_LIBRARIES_L =
#
# <brief description of tttlll library>
tttlll_OBJECTS =
#
# Configuration Database Files
# ----------------------------
CDB_SCHEMAS =
#
# IDL Files and flags
#
IDL_FILES =
IDL_TAO_FLAGS =
USER_IDL =
#
# Jarfiles and their directories
#
JARFILES=
jjj_DIRS=
jjj_EXTRAS=
#
# java sources in Jarfile on/off
DEBUG=
#
# ACS XmlIdl generation on/off
#
XML_IDL=
#
# Java Component Helper Classes generation on/off
#
COMPONENT_HELPERS=
#
# Java Entity Classes generation on/off
#
XSDBIND=
#
# Schema Config files for the above
#
XSDBIND_INCLUDE=
# man pages to be done
# --------------------
MANSECTIONS =
MAN1 =
MAN3 =
MAN5 =
MAN7 =
MAN8 =
#
# local man pages
# ---------------
MANl =
#
# ASCII file to be converted into Framemaker-MIF
# --------------------
ASCII_TO_MIF =
#
# other files to be installed
#----------------------------
INSTALL_FILES =
#
# list of all possible C-sources (used to create automatic dependencies)
# ------------------------------
CSOURCENAMES = \
$(foreach exe, $(EXECUTABLES) $(EXECUTABLES_L), $($(exe)_OBJECTS)) \
$(foreach rtos, $(RTAI_MODULES) , $($(rtos)_OBJECTS)) \
$(foreach lib, $(LIBRARIES) $(LIBRARIES_L), $($(lib)_OBJECTS))
#
#>>>>> END OF standard rules
#
# INCLUDE STANDARDS
# -----------------
ifdef ACSROOT
MAKEDIR = $(shell if [ -f $(INTROOT)/include/acsMakefile ]; then \
echo $(INTROOT)/include; \
else \
echo $(ACSROOT)/include; \
fi;)
include $(MAKEDIR)/acsMakefile
else
MAKEDIR = $(shell if [ -f $(INTROOT)/include/vltMakefile ]; then \
echo $(INTROOT)/include; \
else \
echo $(VLTROOT)/include; \
fi;)
include $(MAKEDIR)/vltMakefile
endif
#
# TARGETS
# -------
all: do_all
@echo " . . . 'all' done"
clean : clean_all
@echo " . . . clean done"
clean_dist : clean_all clean_dist_all
@echo " . . . clean_dist done"
man : do_man
@echo " . . . man page(s) done"
install : install_all
@echo " . . . installation done"
db : db_all
@echo " . . . ../DB done"
cln~ :
find ../ -name "*~" -exec rm '{}' \;
#___oOo___
#ifndef _lan_IDL_
#define _lan_IDL_
/**
* $Id: lan.idl,v 1.1 2009-05-21 15:31:12 c.migoni Exp $
*/
#include <baci.idl>
#include <ASErrors.idl>
#pragma prefix "alma"
module ActiveSurface
{
/** @interface lan
* This interface rappresents the module converting comunications from serial to lan.
* A chain of AS actuator device are linked toghether by a serial 485 line.The serial stream is converted to lan packets.
* A chain rappresents a radius of paraboloid.
* the component is istantiated the first time is requested. The a pointer to itself is passed to all the subsequent USD requiring it.
*/
interface lan : ACS::CharacteristicComponent
{
/**
* send a command to adressed USD.
* @param cmd(in) the command.
* @param addr(in) the serial address.
* @param param(in) the optional parameters(max 4 byte).
* @param nBytes(in) the lenght of param.
*
* @return a completion w/o the errors
*/
ACSErr::Completion sendUSDCmd(in long cmd,in long addr, in long param, in long nBytes);
/**
* retrive a parameter from adressed USD.
* @param cmd(in) the command.
* @param addr(in) the serial address.
* @param nBytes(in) the lenght of param.
* @param param(out) the optional parameters(max 4 byte).
*
* @throw ASErrors::ASErrorsEx in case of error.
*/
void recUSDPar(in long cmd,in long addr,in long nBytes,out long param) raises (ASErrors::ASErrorsEx);
readonly attribute ACS::RWdouble delay ;
readonly attribute ACS::ROlong status;
};
};
#endif /* _lan_ */
#ifndef _USD_IDL_
#define _USD_IDL_
/*******************************************************************************
* "@(#) $Id: usd.idl,v 1.2 2010-07-26 12:34:49 c.migoni Exp $"
*
* who when what
* -------- -------- ----------------------------------------------
* GMM sept 2005 creation
* CM jan 2013 ACS 8.0.1 adaptions
* CM jan 2013 All code revised and adapted to be used from SRTActiveSurfaceBoss component
* CM jan 2013 calibrate and calVer routines transformed to oneway
*/
#include <baci.idl>
#include <ASErrors.idl>
#pragma prefix "alma"
module ActiveSurface
{
/** @interface USD
* This interface rappresents a single AS actuator device.
* It provides property rapresenting all the actuators variable and methods
* implementing the most usefull action that an actuator (USD) can do.
*/
interface USD : ACS::CharacteristicComponent
{
/**
* the on-reply delay.
* Usd has a timer for the delay between the last received byte and the transmitter activation. The default is often not enaugh.
*/
readonly attribute ACS::RWlong delay;
/**
* the last commanded absolute position (ustep)
*/
readonly attribute ACS::RWlong cmdPos;
/**
* the starting velocity (Hz, means step/sec)
*/
readonly attribute ACS::RWlong Fmin;
/**
* the duty velocity (Hz, means step/sec)
* the max speed is 10KHZ
*/
readonly attribute ACS::RWlong Fmax;
/**
* the acceleration factor.
* Usd has a minimal internal acceleration ramp of ~100KHz/sec.
* This number relax the base ramp of factor+1 times,
* i.e. 99 means an acceleration of 1KHz/sec
*/
readonly attribute ACS::RWlong acc;
/**
* configure the USD users bits
*/
readonly attribute ACS::RWlong uBits;
/**
* last minute correction
*/
readonly attribute ACS::RWdouble lmCorr;
/**
* the actual absolute position (ustep)
*/
readonly attribute ACS::ROlong actPos;
/**
* the status of USD.
* byte 2: unused.\n
* byte 1: n.u.(MSB),DIO2,DIO1,DIO0,n.u.,fault,driv_on,zero. \n
* byte 0: run(MSB),differ_exec,ready,stnby,auto,RS2,RS1,RS0. \n
*/
readonly attribute ACS::ROpattern status;
/**
* the USD software version (must be 1.3).
* this command is often use to check the USD availability
*/
readonly attribute ACS::ROlong softVer;
/**
* the USD type (must be 0x21 USD60xxx)
*/
readonly attribute ACS::ROlong type;
/**
* gravity correction
*/
readonly attribute ACS::RWdouble gravCorr;
/**
* user offset
*/
readonly attribute ACS::RWdouble userOffset;
/**
* stop immediate with ramp
*/
oneway void stop();
/**
* soft reset of USD.
* The position counter will be resetted and the link will restart at 9600bps
*/
void reset();
/**
* move up(out) and down(in) the actuator untill a stop.
* the command must be sent only when motor is stopped
*/
oneway void up();
oneway void down();
/**
* move relative to actual position of an amount of ustep.
* @param incr the amount to move in ustep. negative number means move down(in).
*/
oneway void move(in long incr);
/**
* makes the scale calibration. USD must be against the upper edge.
* @return
*/
//ACSErr::Completion calibrate() raises (ASErrors::ASErrorsEx);
oneway void calibrate();
/**
* makes the scale verification.
* @return a completion with the result of verification
* @throw ASErrors::USDUnavailableEx or ASErrors::USDunCalibratedEx if the USD is not available or calibrated.
*/
//ACSErr::Completion calVer() raises (ASErrors::ASErrorsEx);
oneway void calVer();
/**
* writes calibration results into CDB
*/
void writeCalibration(out double cammaLenD, out double cammaPosD, out boolean calibrate) raises (ASErrors::ASErrorsEx);
/**
* sets actuators corrections table
*/
void posTable (in ACS::doubleSeq actuatorsCorrections, in long parPositions, in double deltaEL, in long threshold);
/**
* go to reference position.
* @return
*/
oneway void refPos();
/**
* set the profile, 0 shaped, 1 parabolic, 2 parabolic fixed.
*/
void setProfile(in long prof) raises (ASErrors::ASErrorsEx);
/**
* set the last minute corrections.
*/
oneway void correction(in double corr);
/**
* recalculates the gravity and user corrections based on antenna elevation.
*/
oneway void update(in double elev);
/* oneway void update(in long position); */
/**
* stow and setup
*/
oneway void stow();
oneway void setup();
/**
* move to most top or bottom positions. These are reached in subsequent movements of maxRun lenght
*/
oneway void top();
oneway void bottom();
};
};
#endif /* _USD_ */
......@@ -130,13 +130,12 @@ CDB_SCHEMAS =
#
# IDL Files and flags
#
#IDL_FILES = lan usd SRTActiveSurfaceBoss
IDL_FILES = NotoActiveSurfaceBoss
IDL_TAO_FLAGS =
USER_IDL =
NotoActiveSurfaceBossStubs_LIBS = baciStubs ComponentErrorsStubs ASErrorsStubs \
ManagmentDefinitionsStubs ActiveSurfaceBossStubs
ManagmentDefinitionsStubs ActiveSurfaceBossStubs ActiveSurfaceCommonStubs
#
# Jarfiles and their directories
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment