00001 #include "SIGEL_Robot/SIG_JointSensor.h" 00002 00003 namespace SIGEL_Robot { 00004 SIG_JointSensor::SIG_JointSensor (SIG_Robot *par, QString n, int nr = -1) 00005 : SIG_Sensor (par, n, nr), 00006 theJoint (0) 00007 { } 00008 00009 SIG_JointSensor::SIG_JointSensor (SIG_Robot *par, QTextStream & tx) 00010 : SIG_Sensor (par, tx) 00011 { 00012 QString b; 00013 tx >> b; 00014 theJoint = par->lookupJoint (b); 00015 } 00016 00017 SIG_JointSensor::~SIG_JointSensor (void) 00018 { } 00019 00020 SIG_Sensor::SensorType SIG_JointSensor::getSensorType (void) const 00021 { 00022 return tJointSensor; 00023 } 00024 00025 void SIG_JointSensor::setJoint (SIG_Joint *j) 00026 { 00027 theJoint = j; 00028 } 00029 00030 SIG_Joint const *SIG_JointSensor::getJoint (void) const 00031 { 00032 return theJoint; 00033 } 00034 00035 void SIG_JointSensor::writeToFileTransfer (QTextStream & tx) 00036 { 00037 tx << "JointSensor "; 00038 SIG_Sensor::writeToFileTransfer (tx); 00039 tx << theJoint->getName () << '\n'; 00040 } 00041 }