Exemple #1
0
  virtual void restore(const Setting& image_setting)
  {
    std::string strimageOpMode;
    if(image_setting.get("imageOpMode",strimageOpMode))
      {
	CtImage::ImageOpMode imageOpMode;
	convert_from_string(strimageOpMode,imageOpMode);
	m_image.setMode(imageOpMode);
      }
    // --- Flip
    Setting flip_setting;
    if(image_setting.getChild("flip",flip_setting))
      {
	Flip flip;
	if(flip_setting.get("x",flip.x) &&
	   flip_setting.get("y",flip.y))
	  m_image.setFlip(flip);
      }
    // --- Bin
    Setting bin_setting;
    if(image_setting.getChild("bin",bin_setting))
      {
	int x,y;
	if(bin_setting.get("x",x) &&
	   bin_setting.get("y",y))
	  {
	    Bin aBin(x,y);
	    m_image.setBin(aBin);
	  }
      }
    // --- Roi
    Setting roi_setting;
    if(image_setting.getChild("roi",roi_setting))
      {
	Point topleft;
	int width,height;
	if(roi_setting.get("x",topleft.x) &&
	   roi_setting.get("y",topleft.y) &&
	   roi_setting.get("width",width) &&
	   roi_setting.get("height",height))
	  {
	    Roi aRoi(topleft.x,topleft.y,width,height);
	    m_image.setRoi(aRoi);
	  }
      }
    // --- Rotation
    std::string strrMode;
    if(image_setting.get("rotation",strrMode))
      {
	RotationMode rMode;
	convert_from_string(strrMode,rMode);
	m_image.setRotation(rMode);
      }
  }
Exemple #2
0
  virtual void restore(const Setting& shutter_setting)
  {
    CtShutter::Parameters pars;
    m_shutter.getParameters(pars);

    std::string strmode;
    if(shutter_setting.get("mode",strmode))
      convert_from_string(strmode,pars.mode);

    shutter_setting.get("close_time",pars.close_time);
    shutter_setting.get("open_time",pars.open_time);
  
    m_shutter.setParameters(pars);
  }
QVariant SettingsObject::get(const QString &id) const
{
	Setting *setting = getSetting(id);
	return (setting ? setting->get() : QVariant());
}