Ejemplo n.º 1
0
SignalSettings::SignalSettings(ProjectSettings *projectSettings, SettingsElement *parentSettingsElement, Signal *signal)
    : SettingsElement(projectSettings, parentSettingsElement, signal)
    , ui(new Ui::SignalSettings)
    , signal_(signal)
    , init_(false)
    , valueChanged_(false)
{
    signalManager_ = getProjectSettings()->getProjectWidget()->getMainWindow()->getSignalManager();
	signalEditor_ = dynamic_cast <SignalEditor *> (getProjectSettings()->getProjectWidget()->getProjectEditor());
    ui->setupUi(this);


    // Initial Values //
    //
    updateProperties();

    connect(ui->sSpinBox, SIGNAL(editingFinished()), this, SLOT(on_sSpinBox_editingFinished()));
    connect(ui->sSpinBox, SIGNAL(valueChanged(double)), this, SLOT(onValueChanged()));
    connect(ui->nameBox, SIGNAL(editingFinished()), this, SLOT(onNameBoxEditingFinished()));
    connect(ui->tSpinBox, SIGNAL(editingFinished()), this, SLOT(onEditingFinished()));
    connect(ui->tSpinBox, SIGNAL(valueChanged(double)), this, SLOT(onValueChanged()));
    connect(ui->zOffsetSpinBox, SIGNAL(editingFinished()), this, SLOT(onEditingFinished()));
    connect(ui->zOffsetSpinBox, SIGNAL(valueChanged(double)), this, SLOT(onValueChanged()));
    connect(ui->countryBox, SIGNAL(editingFinished()), this, SLOT(onEditingFinished()));
    connect(ui->countryBox, SIGNAL(textChanged(const QString&)), this, SLOT(onValueChanged()));

    connect(ui->typeSpinBox, SIGNAL(editingFinished()), this, SLOT(onEditingFinished()));
    connect(ui->typeSpinBox, SIGNAL(valueChanged(int)), this, SLOT(onValueChanged()));
    connect(ui->subclassLineEdit, SIGNAL(editingFinished()), this, SLOT(onEditingFinished()));
    connect(ui->subclassLineEdit, SIGNAL(textChanged(const QString&)), this, SLOT(onValueChanged()));
    connect(ui->subtypeSpinBox, SIGNAL(editingFinished()), this, SLOT(onEditingFinished()));
    connect(ui->subtypeSpinBox, SIGNAL(valueChanged(int)), this, SLOT(onValueChanged()));
    connect(ui->valueSpinBox, SIGNAL(editingFinished()), this, SLOT(onEditingFinished()));
    connect(ui->valueSpinBox, SIGNAL(valueChanged(double)), this, SLOT(onValueChanged()));
    connect(ui->hOffsetSpinBox, SIGNAL(editingFinished()), this, SLOT(onEditingFinished()));
    connect(ui->hOffsetSpinBox, SIGNAL(valueChanged(double)), this, SLOT(onValueChanged()));
    connect(ui->pitchSpinBox, SIGNAL(editingFinished()), this, SLOT(onEditingFinished()));
    connect(ui->pitchSpinBox, SIGNAL(valueChanged(double)), this, SLOT(onValueChanged()));
    connect(ui->rollSpinBox, SIGNAL(editingFinished()), this, SLOT(onEditingFinished()));
    connect(ui->rollSpinBox, SIGNAL(valueChanged(double)), this, SLOT(onValueChanged()));
    connect(ui->dynamicCheckBox, SIGNAL(stateChanged(int)), this, SLOT(onEditingFinished(int)));
    connect(ui->orientationComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(onEditingFinished(int)));
    connect(ui->poleCheckBox, SIGNAL(stateChanged(int)), this, SLOT(onEditingFinished(int)));
    connect(ui->sizeComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(onEditingFinished(int)));

    connect(ui->fromLaneSpinBox, SIGNAL(editingFinished()), this, SLOT(onEditingFinished()));
    connect(ui->fromLaneSpinBox, SIGNAL(valueChanged(int)), this, SLOT(onValueChanged()));
    connect(ui->toLaneSpinBox, SIGNAL(editingFinished()), this, SLOT(onEditingFinished()));
    connect(ui->toLaneSpinBox, SIGNAL(valueChanged(int)), this, SLOT(onValueChanged()));

    //Pedestrian Crossing has ancillary data
    //
    if (signal_->getType() == 293)
    {

        enableCrossingParams(true);

        connect(ui->crossingSpinBox, SIGNAL(editingFinished()), this, SLOT(onEditingFinished()));
        connect(ui->crossingSpinBox, SIGNAL(valueChanged(double)), this, SLOT(onValueChanged()));
        connect(ui->resetTimeSpinBox, SIGNAL(editingFinished()), this, SLOT(onEditingFinished()));
        connect(ui->resetTimeSpinBox, SIGNAL(valueChanged(double)), this, SLOT(onValueChanged()));
    }
Ejemplo n.º 2
0
ObjectSettings::ObjectSettings(ProjectSettings *projectSettings, SettingsElement *parentSettingsElement, Object *object)
    : SettingsElement(projectSettings, parentSettingsElement, object)
    , ui(new Ui::ObjectSettings)
    , object_(object)
    , init_(false)
    , valueChanged_(false)
{
    objectManager_ = getProjectSettings()->getProjectWidget()->getMainWindow()->getSignalManager();
    ui->setupUi(this);

	// TreeWidget for repeat parameters //
	//
/*	QList<QTreeWidgetItem *> itemList = ui->repeatTreeWidget->findItems("repeat", Qt::MatchExactly);
	QTreeWidgetItem *repeatItem = itemList.first();
	QTreeWidgetItem *layoutItem = new QTreeWidgetItem(repeatItem);
	ui->repeatTreeWidget->setItemWidget(layoutItem, 0, ui->repeatWidget);*/

    // Initial Values //
    //
    updateProperties();
	activateRepeatWidget(false);

    connect(ui->sSpinBox, SIGNAL(editingFinished()), this, SLOT(on_sSpinBox_editingFinished()));
    connect(ui->sSpinBox, SIGNAL(valueChanged(double)), this, SLOT(onValueChanged()));
    connect(ui->nameBox, SIGNAL(editingFinished()), this, SLOT(onEditingFinished()));
    connect(ui->nameBox, SIGNAL(textChanged(const QString&)), this, SLOT(onValueChanged()));
    connect(ui->tSpinBox, SIGNAL(editingFinished()), this, SLOT(onEditingFinished()));
    connect(ui->tSpinBox, SIGNAL(valueChanged(double)), this, SLOT(onValueChanged()));
    connect(ui->zOffsetSpinBox, SIGNAL(editingFinished()), this, SLOT(onEditingFinished()));
    connect(ui->zOffsetSpinBox, SIGNAL(valueChanged(double)), this, SLOT(onValueChanged()));
    connect(ui->typeBox, SIGNAL(editingFinished()), this, SLOT(onEditingFinished()));
    connect(ui->typeBox, SIGNAL(textChanged(const QString&)), this, SLOT(onValueChanged()));

    connect(ui->validLengthSpinBox, SIGNAL(editingFinished()), this, SLOT(onEditingFinished()));
    connect(ui->validLengthSpinBox, SIGNAL(valueChanged(double)), this, SLOT(onValueChanged()));
    connect(ui->lengthSpinBox, SIGNAL(editingFinished()), this, SLOT(onEditingFinished()));
    connect(ui->lengthSpinBox, SIGNAL(valueChanged(double)), this, SLOT(onValueChanged()));
    connect(ui->widthSpinBox, SIGNAL(editingFinished()), this, SLOT(onEditingFinished()));
    connect(ui->widthSpinBox, SIGNAL(valueChanged(double)), this, SLOT(onValueChanged()));
    connect(ui->heightSpinBox, SIGNAL(editingFinished()), this, SLOT(onEditingFinished()));
    connect(ui->heightSpinBox, SIGNAL(valueChanged(double)), this, SLOT(onValueChanged()));
    connect(ui->radiusSpinBox, SIGNAL(editingFinished()), this, SLOT(onEditingFinished()));
    connect(ui->radiusSpinBox, SIGNAL(valueChanged(double)), this, SLOT(onValueChanged()));
    connect(ui->hdgSpinBox, SIGNAL(editingFinished()), this, SLOT(onEditingFinished()));
    connect(ui->hdgSpinBox, SIGNAL(valueChanged(double)), this, SLOT(onValueChanged()));
    connect(ui->pitchSpinBox, SIGNAL(editingFinished()), this, SLOT(onEditingFinished()));
    connect(ui->pitchSpinBox, SIGNAL(valueChanged(double)), this, SLOT(onValueChanged()));
    connect(ui->rollSpinBox, SIGNAL(editingFinished()), this, SLOT(onEditingFinished()));
    connect(ui->rollSpinBox, SIGNAL(valueChanged(double)), this, SLOT(onValueChanged()));
    connect(ui->poleCheckBox, SIGNAL(stateChanged(int)), this, SLOT(onEditingFinished(int)));
    connect(ui->orientationComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(onEditingFinished(int)));

    connect(ui->repeatSSpinBox, SIGNAL(editingFinished()), this, SLOT(on_repeatSSpinBox_editingFinished()));
    connect(ui->repeatSSpinBox, SIGNAL(valueChanged(double)), this, SLOT(onValueChanged()));
    connect(ui->repeatLengthSpinBox, SIGNAL(editingFinished()), this, SLOT(onEditingFinished()));
    connect(ui->repeatLengthSpinBox, SIGNAL(valueChanged(double)), this, SLOT(onValueChanged()));
    connect(ui->repeatDistanceSpinBox, SIGNAL(editingFinished()), this, SLOT(onEditingFinished()));
    connect(ui->repeatDistanceSpinBox, SIGNAL(valueChanged(double)), this, SLOT(onValueChanged()));

    connect(ui->textureLineEdit, SIGNAL(editingFinished()), this, SLOT(onEditingFinished()));
    connect(ui->textureLineEdit, SIGNAL(textChanged(const QString&)), this, SLOT(onValueChanged()));

	connect(ui->repeatButton, SIGNAL(clicked(bool)), this, SLOT(activateRepeatWidget(bool)));

    init_ = true;
}