Beispiel #1
0
//+----------------------------------------------------------------------------
//
// method :         SimulatorCCD::write_exposureTime
//
// description :     Write exposureTime attribute values to hardware.
//
//-----------------------------------------------------------------------------
void SimulatorCCD::write_exposureTime(Tango::WAttribute &attr)
{
    DEBUG_STREAM << "SimulatorCCD::write_exposureTime(Tango::WAttribute &attr) entering... "<< endl;
    if(m_ct!=0)
    {
        try
        {
            attr.get_write_value(attr_exposureTime_write);
            m_ct->acquisition()->setAcqExpoTime((double)(attr_exposureTime_write/1000.0));
        }
        catch(Tango::DevFailed& df)
        {
            ERROR_STREAM << df << endl;
            //- rethrow exception
            Tango::Except::re_throw_exception(df,
                        static_cast<const char*> ("TANGO_DEVICE_ERROR"),
                        static_cast<const char*> (string(df.errors[0].desc).c_str()),
                        static_cast<const char*> ("SimulatorCCD::write_exposureTime"));
        }
        catch(Exception& e)
        {
            ERROR_STREAM << e.getErrMsg() << endl;
            //- throw exception
            Tango::Except::throw_exception(
                        static_cast<const char*> ("TANGO_DEVICE_ERROR"),
                        static_cast<const char*> (e.getErrMsg().c_str()),
                        static_cast<const char*> ("SimulatorCCD::write_exposureTime"));
        }
    }
	DEBUG_STREAM << "SimulatorCCD::write_exposureTime() ending... "<< endl;		
}
Beispiel #2
0
  void GrabberAttrT<std::string>::write(Tango::DeviceImpl* dev, Tango::WAttribute &att)
  {
    char* write_value;
    att.get_write_value(write_value);
    std::string write_value_string(write_value);
    yat::Any container(write_value_string);

    try
    {
      this->callbacks_[dev].info.set_cb(container);
      this->memorize_attribute(dev->name(),att.get_name(),write_value);
    }
    catch( yat::Exception& ex )
    {
      yat4tango::YATDevFailed df(ex);
      RETHROW_DEVFAILED(df,
                        "SOFTWARE_FAILURE",
                        "Error while writing a plugin attribute",
                        "PlugInAttr<std::string>::write");
    }
    catch( ... )
    {
      THROW_DEVFAILED("UNKNWON_ERROR",
                      "Unknwon error while writing a plugin attribute",
                      "PlugInAttr<std::string>::write");
    }
  }
  void PlugInAttr<std::string>::write(Tango::DeviceImpl *, Tango::WAttribute &att)
  {
    char* write_value;
    att.get_write_value(write_value);
    std::string write_value_string(write_value);
    yat::Any container(write_value_string);

    try
    {
      this->info_.set_cb(container);
    }
    catch( yat::Exception& ex )
    {
      yat4tango::YATDevFailed df(ex);
      RETHROW_DEVFAILED(df,
                        "SOFTWARE_FAILURE",
                        "Error while writing a plugin attribute",
                        "PlugInAttr<std::string>::write");
    }
    catch( ... )
    {
      THROW_DEVFAILED("UNKNWON_ERROR",
                      "Unknwon error while writing a plugin attribute",
                      "PlugInAttr<std::string>::write");
    }
  }
Beispiel #4
0
//--------------------------------------------------------
void StateScanner::write_VDelta(Tango::WAttribute &attr)
{
	DEBUG_STREAM << "StateScanner::write_VDelta(Tango::Attribute &attr) entering... " << endl;
	
	//	Retrieve write value
	Tango::DevDouble	w_val;
	attr.get_write_value(w_val);
	
	/*----- PROTECTED REGION ID(StateScanner::write_VDelta) ENABLED START -----*/
	pData d = machine_->data();
	d->vdelta = w_val;

	/*----- PROTECTED REGION END -----*/	//	StateScanner::write_VDelta
}
Beispiel #5
0
//--------------------------------------------------------
void StateScanner::write_Sensor(Tango::WAttribute &attr)
{
	DEBUG_STREAM << "StateScanner::write_Sensor(Tango::Attribute &attr) entering... " << endl;
	
	//	Retrieve write value
	Tango::DevString	w_val;
	attr.get_write_value(w_val);
	
	/*----- PROTECTED REGION ID(StateScanner::write_Sensor) ENABLED START -----*/
	pData d = machine_->data();
	d->name_sensor = w_val;
	d->update_proxies();

	/*----- PROTECTED REGION END -----*/	//	StateScanner::write_Sensor
}