Example #1
0
 virtual void store(Setting& shutter_setting)
 {
   CtShutter::Parameters pars;
   m_shutter.getParameters(pars);
   
   shutter_setting.set("mode",convert_2_string(pars.mode));
   shutter_setting.set("close_time",pars.close_time);
   shutter_setting.set("open_time",pars.open_time);
 }
Example #2
0
  virtual void store(Setting& image_setting)
  {
    CtImage::ImageOpMode imageOpMode;
    m_image.getMode(imageOpMode);
    image_setting.set("imageOpMode",convert_2_string(imageOpMode));

    // --- Roi
    Roi roi;
    m_image.getRoi(roi);
    Setting roi_setting = image_setting.addChild("roi");

    const Point& topleft = roi.getTopLeft();
    roi_setting.set("x",topleft.x);
    roi_setting.set("y",topleft.y);

    const Size& roiSize = roi.getSize();
    roi_setting.set("width",roiSize.getWidth());
    roi_setting.set("height",roiSize.getHeight());
  
    // --- Bin
    Bin bin;
    m_image.getBin(bin);
    Setting bin_setting = image_setting.addChild("bin");

    bin_setting.set("x",bin.getX());
    bin_setting.set("y",bin.getY());

    // --- Flip
    Flip flip;
    m_image.getFlip(flip);
    Setting flip_setting = image_setting.addChild("flip");

    flip_setting.set("x",flip.x);
    flip_setting.set("y",flip.y);

    // --- Rotation
    RotationMode rMode;
    m_image.getRotation(rMode);
    image_setting.set("rotation",convert_2_string(rMode));
  }
Example #3
0
bool SettingsObject::set(const QString &id, QVariant value)
{
	Setting *setting = getSetting(id);
	if (!setting)
	{
		qDebug(QString("Error changing setting %1. Setting doesn't exist.").
			   arg(id).toUtf8());
		return false;
	}
	else
	{
		setting->set(value);
		return true;
	}
}