Commit c8c9ab86 authored by Abdelali Elaazzouzi's avatar Abdelali Elaazzouzi

before merge

parent 761c099b
......@@ -34,7 +34,7 @@ const string ExternalChopperFreq::TYPE = "external_freq";
/*
* Constructor
*/
ExternalChopperFreq::ExternalChopperFreq(const string& name) : acquisition::LinkerMpdaChopper(name) {
ExternalChopperFreq::ExternalChopperFreq(const string& name) : acquisition::LinkerMpdaChopper(name),controller::Stoppable(this){
setFamily(family::ACQUISITION);
......@@ -54,6 +54,18 @@ ExternalChopperFreq::ExternalChopperFreq(const string& name) : acquisition::Link
*/
ExternalChopperFreq::~ExternalChopperFreq() {
}
/*
* start
*/
void ExternalChopperFreq::start() {
// Execute the read command on Driver
speedChopperForMpda.setpoint=externalFreq() * 60;
speedChopperForMpda=externalFreq() * 60;
}
void ExternalChopperFreq::stop() {
// Execute the read command on Driver
}
/*
......
......@@ -35,7 +35,7 @@ namespace acquisition {
* \brief Contains information about the sample(s) of the current selected proposal
*
*/
class ExternalChopperFreq: public acquisition::LinkerMpdaChopper {
class ExternalChopperFreq: public acquisition::LinkerMpdaChopper, public controller::Stoppable{
public:
......@@ -59,6 +59,11 @@ public:
*/
Property<float64> externalFreq;
/*
* read
*/
virtual void start();
virtual void stop();
......
......@@ -3,6 +3,6 @@
<image key="TITLE"/>
<settings view="external_freqView.xml"/>
<command view="external_freqCommandView.xml" sequential_fixed="true"/>
<command view="external_freqCommandView.xml" />
</controller_plugin_config>
......@@ -65,10 +65,14 @@ void ShuttleAxisController::refreshWantedPositionProperty(float64 value) throw (
secondPosition = axisDriver2->actualPosition();
}
if (fabs(secondPosition - (m_PositionSetPoint - position.offset())) > nocollision_dist()) {
cout << "ShuttleAxisController::refreshWantedPositionProperty "<< (fabs(secondPosition - (value - position.offset())) )<< endl;
if (fabs(secondPosition - (value - position.offset())) > nocollision_dist()) {
AxisController::refreshWantedPositionProperty(value);
} else {
throw CannotSetValue();
sendErrorEvent(BELOW_LOW_LIMIT_ERROR, "Collision risk");
throw CannotSetValue(LIMIT_STR);
throw CannotSetValue();
}
}
/*
......@@ -90,7 +94,7 @@ void ShuttleAxisController::start() {
commandProgression = 100;
return;
}
sleep(12);
commandProgression = 100;
}
......
......@@ -2,24 +2,19 @@
<controller type="pickupnto1" role="pickupnto11"/>
<number_of_lines nb_lines="1"/>
<property_switcher role="pickupnto11" property="mode" switcher_key="pickupnto1.modeSwitcher"/>
<combo role="pickupnto11" property="mode" prefix="pickupnto1.modePrefix" valuesAndLabels="pickupnto1.modesingle,pickupnto1.modemulti" />
<switchable_composite switcher_key="pickupnto1.modeSwitcher" switch_values="single">
<switchable_composite switcher_key="pickupnto.modeSwitcher" switch_values="single">
<property_combo role="pickupnto11" property="master_pickup" prefix="pickupnto1.masterSinglePrefix"/>
</switchable_composite>
<switchable_composite switcher_key="pickupnto1.modeSwitcher" switch_values="multi">
<property_combo role="pickupnto11" property="master_pickup" prefix="pickupnto1.masterPrefix"/>
<property_combo role="pickupnto11" property="slave_pickup" prefix="pickupnto1.slavePrefix"/>
<switchable_composite switcher_key="pickupnto.modeSwitcher" switch_values="multi">
<property_combo role="pickupnto11" property="master_pickup" prefix="pickupnto1.slavePrefix"/>
<property_combo role="pickupnto11" property="slave_pickup" prefix="pickupnto1.masterPrefix"/>
</switchable_composite>
<text role="pickupnto11" property="delay" prefix="pickupnto1.delayPrefix"/>
</plugin>
......@@ -12,8 +12,8 @@
</switchable_composite>
<switchable_composite switcher_key="pickupnto1.modeSwitcher" switch_values="multi">
<property_combo role="pickupnto11" property="master_pickup" prefix="pickupnto1.masterPrefix"/>
<property_combo role="pickupnto11" property="slave_pickup" prefix="pickupnto1.slavePrefix"/>
<property_combo role="pickupnto11" property="master_pickup" prefix="pickupnto1.slavePrefix"/>
<property_combo role="pickupnto11" property="slave_pickup" prefix="pickupnto1.masterPrefix"/>
</switchable_composite>
<newLine/>
......
......@@ -112,20 +112,20 @@ void D33ChopperCommand::start() {
ControllerPtr<d33::D33ChopperController> chopper_tab[4]={m_CH1,m_CH2,m_CH3,m_CH4};
// int32 chopper_Dir[4]={1,-1,1,-1};
if (selectorDriver->speed() > 0) {
// wantedSelTime = 5;
int32 aspeed = 0;
selectorDriver->speed.setpoint= aspeed;
selectorDriver->startCommand(true);
} else {
// wantedSelTime = 0;
axisselector->state.setpoint="0";
axisselector->startCommand(true);
// cout << "axisselector" << endl;
}
//
// if (selectorDriver->speed() > 0) {
// // wantedSelTime = 5;
// int32 aspeed = 0;
//
// selectorDriver->speed.setpoint= aspeed;
// selectorDriver->startCommand(true);
// } else {
// // wantedSelTime = 0;
// axisselector->state.setpoint="0";
// axisselector->startCommand(true);
//
// // cout << "axisselector" << endl;
// }
sendProgressEvent(0);
// m_Status = 0;
// updateValue(STATUS_PROPERTY, m_Status);
......
......@@ -19,7 +19,7 @@
#ifndef D33CHOPPERSETTING_H
#define D33CHOPPERSETTING_H
#include <Controller.h>
#include "controllers/common/acquisition/gg/LinkerMpdaChopper.h"
#include "D33ChopperController.h"
#include "D33ChopperCommand.h"
#include "PickUpController.h"
......@@ -28,6 +28,8 @@
#include "controllers/common/state/stateaxis/StateAxisController.h"
#include "controllers/common/state/stateaxis/StateAxisSwitchesController.h"
#include "controllers/common/acquisition/mode/TofAcquisitionController.h"
#include "controllers/common/chopper/PickUpNto1Controller.h"
/*! File D33ChopperSetting.cpp
*\brief Configure the resoltioon of the instrument (Chopper drive)
*\version 1.0
......@@ -47,7 +49,7 @@
namespace d33 {
class D33ChopperSetting : public ExperimentController, public controller::Stoppable {
class D33ChopperSetting : public acquisition::LinkerMpdaChopper , public controller::Stoppable {
public:
static const std::string TYPE;
......@@ -201,6 +203,7 @@ private:
virtual void updateSelectorPosition();
virtual void updateWlfPosition();
void writeMpda(float64 speed);
......@@ -262,7 +265,9 @@ private:
ControllerPtr<d33::D33ChopperController> chopper4Driver; //!< link to chopper 4
ControllerPtr<stateaxis::StateAxisController> wlfDriver; //
ControllerPtr<d33::PickUpController> pickupDriver; //
//ControllerPtr<d33::PickUpController> pickupDriver; //
ControllerPtr<chopper::PickUpNto1Controller > pickUpNto1Controller ;
ControllerPtr<axis::ShuttleAxisController> detecteur1;
ControllerPtr<axis::ShuttleAxisController> detecteur2;
......@@ -270,7 +275,12 @@ private:
ControllerPtr<selector::SelectorController> selectorDriver;
ControllerPtr<d33::D33ChopperCommand> chopperCommand;//
ControllerPtr<acquisition::TofAcquisitionController> tofParam;//
ControllerPtr<acquisition::TofAcquisitionController> tofParam2;//
ControllerPtr<stateaxis::StateAxisController> m_Att;
//ControllerPtr<acquisition::MpdaController> m_Mpda3; //! Link
DriverPtr<acquisition::MpdaCommon> m_Mpda1;
DriverPtr<acquisition::MpdaCommon> m_Mpda2;
/**
......
......@@ -37,11 +37,11 @@ D33TofVariableAcquisitionController::D33TofVariableAcquisitionController(const s
tof_distance.init(this, SAVE, "tof_distance");
nDrivers.init(this, SAVE, "nDrivers");
tofFractionalWidths.init(this, SAVE, "tof_times");
tofFractionalWidths.init(this, SAVE, "tof_frac_times");
m_TofTimes = NULL;
m_TofMin = 0;
m_TofMax = 0;
m_ChannelsTable = NULL;
//m_ChannelsTable = NULL;
m_ChannelsTableSize = 0;
/*
......@@ -52,7 +52,7 @@ D33TofVariableAcquisitionController::D33TofVariableAcquisitionController(const s
// registerRefresher(wantedMaxTime, &D33TofVariableAcquisitionController::refreshWantedMaxTimeProperty, this);
// registerRefresher(wantedNChannels, &D33TofVariableAcquisitionController::refreshWantedNChannelsProperty, this);
refreshWantedNChannelsProperty(2);
//refreshWantedNChannelsProperty(2);
m_ChopperSetting.init(this, "chopperSetting");
m_nRegisteredDrivers = nDrivers();
tof_distance = 30.6125;
......@@ -63,8 +63,8 @@ D33TofVariableAcquisitionController::D33TofVariableAcquisitionController(const s
*/
D33TofVariableAcquisitionController::~D33TofVariableAcquisitionController() {
delete[] m_TofTimes;
if (m_ChannelsTable)
delete[] m_ChannelsTable;
// if (m_ChannelsTable)
// delete[] m_ChannelsTable;
}
......@@ -85,7 +85,7 @@ void D33TofVariableAcquisitionController::postConfiguration() {
registerRefresher(delay.setpoint, &D33TofVariableAcquisitionController::refreshWantedDelayProperty, this);
registerUpdater(m_ChopperSetting->tof_distance, &D33TofVariableAcquisitionController::updateTofDistanceProperty, this);
registerUpdater(m_ChopperSetting->lambda_max, &D33TofVariableAcquisitionController::updateLambdaMaxProperty, this);
// registerUpdater(m_ChopperSetting->lambda_max, &D33TofVariableAcquisitionController::updateLambdaMaxProperty, this);
if (useMasterAcq() == true) {
registerUpdater(m_MasterAcqDriver->nbPickup, &D33TofVariableAcquisitionController::updateActualNbPickup, this);
......@@ -124,8 +124,12 @@ void D33TofVariableAcquisitionController::refreshNDriversProperty(int32 value) t
* refreshWantedNChannelsProperty
*/
void D33TofVariableAcquisitionController::refreshWantedNChannelsProperty(int32 value) throw (CannotSetValue) {
// cout << "???????? D33TofVariableAcquisitionController::refreshWantedNChannelsProperty "<< value << endl;
// Create a new table of flight times
delete[] m_TofTimes;
if (m_TofTimes){
delete[] m_TofTimes;
}
m_TofTimes = new float64[value + 1];
tofFractionalWidths.update(m_TofTimes);
tofFractionalWidths.setSize(value + 1);
......@@ -221,13 +225,13 @@ void D33TofVariableAcquisitionController::calculateTofTable() {
int32 NbConstChannels;
int32 NBFractionalChannels;
cout << "MinLambda " << minLambda.setpoint() << " MaxLambda " << maxLambda.setpoint() << endl;
cout << "MaxTime " << maxTime.setpoint() << " wantedFraction " << fraction.setpoint() << endl;
cout << "tof_distance() " << tof_distance() << endl;
// cout << "MinLambda " << minLambda.setpoint() << " MaxLambda " << maxLambda.setpoint() << endl;
// cout << "MaxTime " << maxTime.setpoint() << " wantedFraction " << fraction.setpoint() << endl;
// cout << "tof_distance() " << tof_distance() << endl;
m_TofMin = minLambda.setpoint() * tof_distance() / 3956;
m_TofMax = maxLambda.setpoint() * tof_distance() / 3956;
cout << "m_TofMin = " << m_TofMin << " m_TofMax = " << m_TofMax << endl;
// cout << "m_TofMin = " << m_TofMin << " m_TofMax = " << m_TofMax << endl;
// Calculate flight times
dt0 = fraction.setpoint() * m_TofMin;
......@@ -237,14 +241,16 @@ void D33TofVariableAcquisitionController::calculateTofTable() {
//NBFractionalChannels=floor(log10(wantedMaxTime.setpoint())- log10(m_TofMin)) / log10(1+wantedFraction.setpoint());
NBFractionalChannels = (int) floor(log10(m_TofMax / m_TofMin) / log10(1 + fraction.setpoint())) + 1;
cout << "NBFractionalChannels " << NBFractionalChannels << endl;
// cout << "NBFractionalChannels " << NBFractionalChannels << endl;
nChannels.setpoint = NbConstChannels + NBFractionalChannels;
delete[] m_TofTimes;
if (m_TofTimes){
delete[] m_TofTimes;
}
m_TofTimes = new float64[nChannels.setpoint()];
tofTimes.update(m_TofTimes);
tofTimes.setSize(nChannels.setpoint());
tofFractionalWidths.update(m_TofTimes);
tofFractionalWidths.setSize(nChannels.setpoint());
m_ChannelsTableSize = nChannels.setpoint();
if (m_ChannelsTableSum)
......@@ -255,28 +261,24 @@ void D33TofVariableAcquisitionController::calculateTofTable() {
delete[] m_DiffChannelsTableSum;
m_DiffChannelsTableSum = new float64[m_ChannelsTableSize];
if (m_ChannelsTable)
delete[] m_ChannelsTable;
m_ChannelsTable = new float64[m_ChannelsTableSize];
cout << "wantedNChannels.setpoint() " << nChannels.setpoint() << endl;
// cout << "wantedNChannels.setpoint() " << nChannels.setpoint() << endl;
m_TofTimes[0] = m_TofMin;
cout << "channel[0]= " << m_TofTimes[0] << endl;
// cout << "channel[0]= " << m_TofTimes[0] << endl;
for (int32 i = 0; i < NbConstChannels; ++i) {
m_TofTimes[i] = dt0 * 1000000.;
// cout << "channel["<<i<<"] = "<<m_TofTimes[i]<<endl;
// // cout << "channel["<<i<<"] = "<<m_TofTimes[i]<<endl;
}
cout << "NbConstChannels " << NbConstChannels << endl;
// cout << "NbConstChannels " << NbConstChannels << endl;
float32 sumchannel = 0.0;
for (int32 i = 1; i < NBFractionalChannels + 1; ++i) {
m_TofTimes[i + NbConstChannels - 1] = m_TofMin * fraction.setpoint() * pow((1 + fraction.setpoint()), (i - 1))
* 1000000.;
// cout << "channel["<<i+ NbConstChannels-1<<"] = "<<m_TofTimes[i+ NbConstChannels-1]<<endl;
// // cout << "channel["<<i+ NbConstChannels-1<<"] = "<<m_TofTimes[i+ NbConstChannels-1]<<endl;
sumchannel = sumchannel + m_TofTimes[i + NbConstChannels - 1];
}
cout << "sumchannel==" << sumchannel << endl;
// cout << "sumchannel==" << sumchannel << endl;
tofTimes.update(m_TofTimes);
tofTimes.setSize(m_ChannelsTableSize);
......@@ -288,53 +290,48 @@ void D33TofVariableAcquisitionController::calculateTofTable() {
m_DiffChannelsTableSum[ki] = m_TofTimes[ki] - m_TofTimes[ki - 1];
}
// Debug
// // Debug
// int32 d1 = 0;
cout << "Channel Table (millSec) " << endl;
for (int32 ki = 0; ki < nChannels.setpoint(); ki++) {
cout << " cha[" << ki << "] = " << m_TofTimes[ki] << " Sum " << m_ChannelsTableSum[ki] << " Diff "
<< m_DiffChannelsTableSum[ki] << endl;
;
// if (d1==3){
// d1 = 0;
// cout << endl;
// }else { d1++; }
}
// cout << "Channel Table (millSec) " << endl;
// for (int32 ki = 0; ki < nChannels.setpoint(); ki++) {
// cout << " cha[" << ki << "] = " << m_TofTimes[ki] << " Sum " << m_ChannelsTableSum[ki] << " Diff "
// << m_DiffChannelsTableSum[ki] << endl;
// }
int32 local_pickupTimePeriod;
float64 local_pickupTimePeriod;
MpdaCommon* test = dynamic_cast<MpdaCommon*>(m_TimeGateDriver.get());
if (test != NULL) {
local_pickupTimePeriod = (int) (test->pickupTimePeriod()) * 100.;
cout << "============= local_pickupTimePeriod " << local_pickupTimePeriod << endl;
local_pickupTimePeriod = (int) (test->pickupTimePeriod()) ;
// cout << "============= local_pickupTimePeriod " << local_pickupTimePeriod << endl;
} else {
local_pickupTimePeriod = 100000;
cout << "============= local_pickupTimePeriod default " << local_pickupTimePeriod << endl;
// cout << "============= local_pickupTimePeriod default " << local_pickupTimePeriod << endl;
}
// COU max time -> link chopper period ToDo
for (int32 ki = 0; ki < nChannels.setpoint(); ki++) {
//cout << m_ChannelsTableSum[ki] << " " << ki+1 << endl; ;
if (m_ChannelsTableSum[ki] > local_pickupTimePeriod) {
//// cout << m_ChannelsTableSum[ki] << " " << ki+1 << endl; ;
if (m_ChannelsTableSum[ki]/1000. > local_pickupTimePeriod) {
nChannels.setpoint = ki - 1;
cout << " Time Max LUT reached resize number channel to " << nChannels.setpoint() << endl;
}
}
cout << "sumchannel==" << sumchannel << endl;
// cout << "sumchannel==" << sumchannel << endl;
tofTimes.update(m_TofTimes);
tofTimes.setSize(m_ChannelsTableSize);
// writeParams();
calculateLUT(m_ChannelsTableSum, local_pickupTimePeriod);
// // Debug
cout << "Channel Table (millSec) " <<endl;
for (int32 ki =0 ; ki < nChannels.setpoint() ; ki++) {
cout << " cha["<< ki <<"] = "<<m_TofTimes[ki] << " Sum "<<m_ChannelsTableSum[ki] << " Diff " << m_DiffChannelsTableSum[ki] << endl; ;
}
//// // Debug
// // cout << "Channel Table (millSec) " <<endl;
// for (int32 ki =0 ; ki < nChannels.setpoint() ; ki++) {
// cout << " cha["<< ki <<"] = "<<m_TofTimes[ki] << " Sum "<<m_ChannelsTableSum[ki] << " Diff " << m_DiffChannelsTableSum[ki] << endl; ;
// }
// writeParams();
// to test quickly writeParams();
}
/*
......
......@@ -137,13 +137,12 @@ private :
void updateActualNbPickup();
float64* m_TofTimes;
//float64* m_TofTimes;
float64 m_TofMin;
float64 m_TofMax;
int32 m_ChannelsTableSize;
float64* m_ChannelsTable;
//int32 m_ChannelsTableSize;
//float64* m_ChannelsTable;
int32* m_ChannelsTableSum;
float64* m_DiffChannelsTableSum;
ControllerPtr<d33::D33ChopperSetting> chopperSetting;//
......
......@@ -47,6 +47,8 @@ LSSCollimationSetting::LSSCollimationSetting(const std::string & contName) :
diaphValues.init(this, NOSAVE, "diaph_values");
diaphLabels.init(this, NOSAVE, "diaph_labels");
ap_size.init(this, SAVE, "ap_size");
sourceDistance.init(this, NOSAVE, "sourceDistance"); // according to collimation value, the source distance will be set to nearest <= diaphragm position
sourceAperture.init(this, NOSAVE, "sourceAperture");
m_Collimation.init(this, "col");
m_Diaphragm.init(this, "dia");
......
......@@ -46,6 +46,8 @@ public:
DynamicProperty<int32> multipleDiaphValue;
Property<int32> numberOfPosition;
Property<float64> sourceDistance;
Property<std::string> sourceAperture;
LSSCollimationSetting(const std::string & contName);
......
......@@ -9,8 +9,8 @@
<combo role="pickup1" property="wanted_chopper" valuesAndLabels="pickup.ch1,pickup.ch2,pickup.ch3,pickup.ch4" prefix="pickup1.chopper" />
</switchable_composite>
<switchable_composite switcher_key="pickup.wanted_modeSwitcher" switch_values="1">
<combo role="pickup1" property="wanted_master_pickup" valuesAndLabels="pickup.ch1,pickup.ch2,pickup.ch3,pickup.ch4" prefix="pickup1.master" />
<combo role="pickup1" property="wanted_slave_pickup" valuesAndLabels="pickup.ch1,pickup.ch2,pickup.ch3,pickup.ch4" prefix="pickup1.slave" />
<combo role="pickup1" property="wanted_master_pickup" valuesAndLabels="pickup.ch1,pickup.ch2,pickup.ch3,pickup.ch4" prefix="pickup1.slave" />
<combo role="pickup1" property="wanted_slave_pickup" valuesAndLabels="pickup.ch1,pickup.ch2,pickup.ch3,pickup.ch4" prefix="pickup1.master" />
</switchable_composite>
</plugin>
......
......@@ -7,7 +7,7 @@
<combo role="pickup1" property="wanted_chopper" valuesAndLabels="pickup.ch1,pickup.ch2,pickup.ch3,pickup.ch4" prefix="pickup1.chopper" spaceBefore="false"/>
</switchable_composite>
<switchable_composite switcher_key="pickup.wanted_modeSwitcher" switch_values="1">
<combo role="pickup1" property="wanted_master_pickup" valuesAndLabels="pickup.ch1,pickup.ch2,pickup.ch3,pickup.ch4" prefix="pickup1.master" spaceBefore="false"/>
<combo role="pickup1" property="wanted_slave_pickup" valuesAndLabels="pickup.ch1,pickup.ch2,pickup.ch3,pickup.ch4" prefix="pickup1.slave"/>
<combo role="pickup1" property="wanted_master_pickup" valuesAndLabels="pickup.ch1,pickup.ch2,pickup.ch3,pickup.ch4" prefix="pickup1.slave" spaceBefore="false"/>
<combo role="pickup1" property="wanted_slave_pickup" valuesAndLabels="pickup.ch1,pickup.ch2,pickup.ch3,pickup.ch4" prefix="pickup1.master"/>
</switchable_composite>
</plugin>
/*
* Nomad Instrument Control Software
*
* Copyright 2011 Institut Laue-Langevin
*
* Licensed under the EUPL, Version 1.1 only (the "License");
* You may not use this work except in compliance with the Licence.
* You may obtain a copy of the Licence at:
*
* http://joinup.ec.europa.eu/software/page/eupl
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the Licence is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Licence for the specific language governing permissions and
* limitations under the Licence.
*/
/*!
* \brief Main class for the FugHCP device driver
* \author J. Locatelli
* \date 15-04-2011
*/
#include "GPIBFugHCPDriver.h"
namespace fughcp {
const std::string GPIBFugHCPDriver::TYPE = "GPIBFugHCP";
/*
* Constructor
*/
GPIBFugHCPDriver::GPIBFugHCPDriver(const std::string& name) : FugHCPDriver(name) {
driver::Gpib::init(name);
}
/*
* Destructor
*/
GPIBFugHCPDriver::~GPIBFugHCPDriver() {
}
/*
* writeFug
*/
void GPIBFugHCPDriver::writeFug(const std::string& aData, bool doClear) {
write(aData, false);
}
/*
* readFug
*/
void GPIBFugHCPDriver::readFug(std::string& aData, const std::string aEnd) {
read(aData, aEnd);
}
}
/*
* Nomad Instrument Control Software
*
* Copyright 2011 Institut Laue-Langevin
*
* Licensed under the EUPL, Version 1.1 only (the "License");
* You may not use this work except in compliance with the Licence.
* You may obtain a copy of the Licence at:
*
* http://joinup.ec.europa.eu/software/page/eupl
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the Licence is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Licence for the specific language governing permissions and
* limitations under the Licence.
*/
/*!
* \brief Main class for the FugHCP device driver
* \author J. Locatelli
* \date 15-04-2011
*/
#ifndef GPIBFUGHCPDRIVER_H
#define GPIBFUGHCPDRIVER_H
#include "FugHCPDriver.h"
#include "drivers/global/Gpib.h"
namespace fughcp {
/*!
* \class FugHCPDriver
* \brief Main class for the FugHCP device driver
*
* \par
* Class for FugHCP driver. Implements DeviceDriver methods.
* \par
* The FugHCP device is a windows computer which running the Fug software made with LabView.
* It is connected to the nomad server using GPIB protocol.
*/
class GPIBFugHCPDriver: public FugHCPDriver, public driver::Gpib {
public:
static const std::string TYPE;
/*!
* \brief Constructor
* \param[in] name the name of the device driver
*/
GPIBFugHCPDriver(const std::string& name);
/**
* \brief Destructor.
*/
virtual ~GPIBFugHCPDriver();
virtual void writeFug(const std::string& aData, bool doClear = false);
virtual void readFug(std::string& aData, const std::string aEnd);
};
}
#endif //FUGHCPDRIVER_H
/*
* Nomad Instrument Control Software
*
* Copyright 2011 Institut Laue-Langevin
*
* Licensed under the EUPL, Version 1.1 only (the "License");
* You may not use this work except in compliance with the Licence.
* You may obtain a copy of the Licence at:
*
* http://joinup.ec.europa.eu/software/page/eupl
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the Licence is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Licence for the specific language governing permissions and
* limitations under the Licence.
*/
/*!
* \brief Main class for the FugHCP device driver
* \author J. Locatelli
* \date 15-04-2011
*/
#include "RS232FugHCPDriver.h"
namespace fughcp {
const std::string RS232FugHCPDriver::TYPE = "FugHCP";
/*
* Constructor
*/
RS232FugHCPDriver::RS232FugHCPDriver(const std::string& name) : FugHCPDriver(name) {
driver::RS232::init(name);
}
/*
* Destructor
*/
RS232FugHCPDriver::~RS232FugHCPDriver() {
}
/*
* writeFug
*/
void RS232FugHCPDriver::writeFug(const std::string& aData, bool doClear) {
write(aData, doClear);
}
/*
* readFug
*/
void RS232FugHCPDriver::readFug(std::string& aData, const std::string aEnd) {
read(aData, aEnd);
}
}
/*
* Nomad Instrument Control Software
*
* Copyright 2011 Institut Laue-Langevin
*
* Licensed under the EUPL, Version 1.1 only (the "License");
* You may not use this work except in compliance with the Licence.
* You may obtain a copy of the Licence at:
*
* http://joinup.ec.europa.eu/software/page/eupl
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the Licence is distributed on an "AS IS" basis,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the Licence for the specific language governing permissions and
* limitations under the Licence.
*/
/*!
* \brief Main class for the FugHCP device driver
* \author J. Locatelli
* \date 15-04-2011
*/
#ifndef RS232FUGHCPDRIVER_H
#define RS232FUGHCPDRIVER_H
#include "FugHCPDriver.h"
#include "drivers/global/RS232.h"
namespace fughcp {
/*!
* \class FugHCPDriver
* \brief Main class for the FugHCP device driver
*
* \par
* Class for FugHCP driver. Implements DeviceDriver methods.
* \par