示例#1
0
struct progdlg *ProgressFrame::showProgress(bool animate, bool terminate_is_stop, gboolean *stop_flag, int value)
{
    setMaximumValue(100);
    ui->progressBar->setValue(value);
    progress_dialog_.elapsed_timer->invalidate();
    emit showRequested(animate, terminate_is_stop, stop_flag);
    return &progress_dialog_;
}
示例#2
0
SGMUndulatorControl::SGMUndulatorControl(QObject *parent) :
    AMPseudoMotorControl("Undulator", "mm", parent, "SGM Undulator Gap")
{

	encoderControl_ = new AMPVwStatusControl("Undulator Position",
	                                         "UND1411-01:gap:mm:fbk",
	                                         "UND1411-01:gap:mm",
	                                         "UND1411-01:moveStatus",
	                                         "UND1411-01:stop",
	                                         this,
						 0.5);

	stepControl_ = new AMPVwStatusControl("Undulator Step",
	                                      "SMTR1411-01:step:sp",
	                                      "SMTR1411-01:step",
	                                      "SMTR1411-01:status",
	                                      "SMTR1411-01:stop",
	                                      this,
	                                      10,
	                                      20,
	                                      new CLSMAXvControlStatusChecker());

	stepVelocityControl_ = new AMPVControl("Undulator Velocity",
	                                       "SMTR1411-01:velo:sp",
	                                       "SMTR1411-01:velo",
	                                       QString(),
	                                       this,
	                                       1);

	stepAccelerationControl_ = new AMPVControl("Undulator Acceleration",
	                                           "SMTR1411-01:accel:sp",
	                                           "SMTR1411-01:accel",
	                                           QString(),
	                                           this,
	                                           1);

	addChildControl(encoderControl_);
	addChildControl(stepControl_);

	AMControlSet* allControls = new AMControlSet(this);

	allControls->addControl(encoderControl_);
	allControls->addControl(stepControl_);
	allControls->addControl(stepVelocityControl_);
	allControls->addControl(stepAccelerationControl_);
	connect(allControls, SIGNAL(connected(bool)),
	        this, SLOT(onControlSetConnectionChanged(bool)));

	setAttemptMoveWhenWithinTolerance(true);
        setTolerance(encoderControl_->tolerance());
	setMinimumValue(encoderControl_->minimumValue());
	setMaximumValue(encoderControl_->maximumValue());

}
示例#3
0
void HelloWorld::testSlider()
{
	auto slider=ControlSlider::create("xuetiao1.png", "xuetiao2.png", "xuetiao3.png");
    slider->setAnchorPoint(Point(0.5, 0.5));
    slider->setMinimumValue(0);
    slider->setMaximumValue(100);
	//slider->setMaximumAllowedValue();
    slider->setPosition(Point(240, 160));
    slider->setTag(1);
    slider->addTargetWithActionForControlEvents(this,cccontrol_selector(HelloWorld::sliderValueChanged),Control::EventType::VALUE_CHANGED);
    slider->setScale(2);
    this->addChild(slider);
}
BioXASSideM1MirrorBendControl::BioXASSideM1MirrorBendControl(const QString &name, const QString &units, QObject *parent, const QString &description) :
	BioXASMirrorBendControl(name, units, parent, description)
{
	// Initialize inherited variables.

	setMinimumValue( calculateBendRadius(12, 12) );
	setMaximumValue( calculateBendRadius(0.0001, 0.0001) );
	setTolerance(50);

	// Current settings.

	updateStates();
}
示例#5
0
void KCValidity::loadOdfValidationValue(const QStringList &listVal, const KCValueParser *parser)
{
    bool ok = false;
    kDebug(36003) << " listVal[0] :" << listVal[0] << " listVal[1] :" << listVal[1];

    if (restriction() == KCValidity::Date) {
        setMinimumValue(parser->tryParseDate(listVal[0]));
        setMaximumValue(parser->tryParseDate(listVal[1]));
    } else if (restriction() == KCValidity::Time) {
        setMinimumValue(parser->tryParseTime(listVal[0]));
        setMaximumValue(parser->tryParseTime(listVal[1]));
    } else {
        setMinimumValue(KCValue(listVal[0].toDouble(&ok)));
        if (!ok) {
            setMinimumValue(KCValue(listVal[0].toInt(&ok)));
            if (!ok)
                kDebug(36003) << " Try to parse this value :" << listVal[0];

#if 0
            if (!ok)
                setMinimumValue(listVal[0]);
#endif
        }
        ok = false;
        setMaximumValue(KCValue(listVal[1].toDouble(&ok)));
        if (!ok) {
            setMaximumValue(KCValue(listVal[1].toInt(&ok)));
            if (!ok)
                kDebug(36003) << " Try to parse this value :" << listVal[1];

#if 0
            if (!ok)
                setMaximumValue(listVal[1]);
#endif
        }
    }
}
示例#6
0
void LabeledDoubleSpinBox::init(double value)
{
	sbValue = new QDoubleSpinBox();
	sbValue->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
	sbValue->setAlignment(Qt::AlignRight);
	sbValue->setRange(-50, 50);
	sbValue->setAccelerated(true);

	QGridLayout *gl = (QGridLayout *)layout();
	gl->addWidget(sbValue, 1, 1);

	setMinimumValue(-999999999);
	setMaximumValue(999999999);
	setDecimals(3);
	setValue(value);

	connect(sbValue, SIGNAL(valueChanged(double)), SLOT(onValueChanged(double)));
}
BioXASZebraTimeSeconds::BioXASZebraTimeSeconds(const QString &name, QObject *parent) :
	AMPseudoMotorControl(name, "s", parent)
{
	// Initialize inherited variables.

	setTolerance(0.001);
	setContextKnownDescription("ZebraTime");

	// Initialize class variables.

	timeValue_ = 0;
	timeUnits_ = 0;

	// Current settings.

	setMinimumValue(BIOXASZEBRATIMESECONDS_VALUE_MIN);
	setMaximumValue(BIOXASZEBRATIMESECONDS_VALUE_MAX);

	updateStates();
}
void AM3DCoordinatedSystemControl::updateMaximumAndMinimumValues()
{
	setMinimumValue(-100);
	setMaximumValue(100);
}
示例#9
0
progdlg *ProgressFrame::showBusy(bool animate, bool terminate_is_stop, gboolean *stop_flag)
{
    setMaximumValue(0);
    emit showRequested(animate, terminate_is_stop, stop_flag);
    return &progress_dialog_;
}
SGMGratingAngleControl::SGMGratingAngleControl(QObject *parent) :
    AMPseudoMotorControl("Grating Angle Encoder", "Count", parent, "SGM Monochromator Grating Angle")
{
	encoderControl_ = new AMPVwStatusControl("Grating Angle Encoder",
	                                         "SMTR16114I1002:enc:fbk",
	                                         "SMTR16114I1002:encTarget",
	                                         "SMTR16114I1002:status",
	                                         "SMTR16114I1002:stop",
	                                         this,
	                                         5,
	                                         2.0,
	                                         new CLSMAXvControlStatusChecker(),
	                                         1);

	stepMotorControl_ = new AMPVwStatusControl("Grating Angle Step",
	                                           "SMTR16114I1002:step:sp",
	                                           "SMTR16114I1002:step",
	                                           "SMTR16114I1002:status",
	                                           "SMTR16114I1002:stop",
	                                           this,
	                                           5,
	                                           2.0,
	                                           new CLSMAXvControlStatusChecker());

	stepVelocityControl_ = new AMPVControl("Grating Angle Step Velocity",
	                                       "SMTR16114I1002:velo:sp",
	                                       "SMTR16114I1002:velo",
	                                       QString(),
	                                       this,
	                                       1);

	stepAccelerationControl_ = new AMPVControl("Grating Angle Step Acceleration",
	                                           "SMTR16114I1002:accel:sp",
	                                           "SMTR16114I1002:accel",
	                                           QString(),
	                                           this,
	                                           0.1);

	stepsPerEncoderCountControl_ = new AMSinglePVControl("Grating Angle Steps Per Encoder Pulse",
	                                                     "SMTR16114I1002:softRatio",
	                                                     this,
	                                                     0.1);

	movementTypeControl_ = new AMSinglePVControl("Grating Angle Move Type",
	                                             "SMTR16114I1002:encMoveType",
	                                             this,
	                                             0.5);

	AMControlSet* allControls = new AMControlSet(this);
	allControls->addControl(encoderControl_);
	allControls->addControl(stepMotorControl_);
	allControls->addControl(stepVelocityControl_);
	allControls->addControl(stepAccelerationControl_);
	allControls->addControl(stepsPerEncoderCountControl_);
	allControls->addControl(movementTypeControl_);
	connect(allControls, SIGNAL(connected(bool)), this, SLOT(onControlSetConnectionChanged(bool)));

	addChildControl(encoderControl_);
	addChildControl(stepMotorControl_);
	setMinimumValue(encoderControl_->minimumValue());
	setMaximumValue(encoderControl_->maximumValue());
	setTolerance(encoderControl_->tolerance());
	setAttemptMoveWhenWithinTolerance(true);

	updateStates();
}