{
ui->setupUi(this);
connect(ui->cbox_axis, SIGNAL(currentIndexChanged(int)), this, SLOT(axisChanged(const int)));
+ axisChanged(ui->cbox_axis->currentIndex());
}
void ConditionEffectSettings::axisChanged(const int idx)
ui->qle_leftCoeffX->setText(QString::number(cdParams->leftCoeff[FFBConditionEffectParameters::Axis::X]));
ui->qle_rightCoeffX->setText(QString::number(cdParams->rightCoeff[FFBConditionEffectParameters::Axis::X]));
ui->qle_leftSatX->setText(QString::number(cdParams->leftSat[FFBConditionEffectParameters::Axis::X]));
- ui->qle_rightSatX->setText(QString::number(cdParams->rightCoeff[FFBConditionEffectParameters::Axis::X]));
+ ui->qle_rightSatX->setText(QString::number(cdParams->rightSat[FFBConditionEffectParameters::Axis::X]));
+
ui->qle_centerY->setText(QString::number(cdParams->center[FFBConditionEffectParameters::Axis::Y]));
ui->qle_deadbandY->setText(QString::number(cdParams->deadband[FFBConditionEffectParameters::Axis::Y]));
ui->qle_leftCoeffY->setText(QString::number(cdParams->leftCoeff[FFBConditionEffectParameters::Axis::Y]));
ui->qle_rightCoeffY->setText(QString::number(cdParams->rightCoeff[FFBConditionEffectParameters::Axis::Y]));
ui->qle_leftSatY->setText(QString::number(cdParams->leftSat[FFBConditionEffectParameters::Axis::Y]));
- ui->qle_rightSatY->setText(QString::number(cdParams->rightCoeff[FFBConditionEffectParameters::Axis::Y]));
+ ui->qle_rightSatY->setText(QString::number(cdParams->rightSat[FFBConditionEffectParameters::Axis::Y]));
return true;
}
</sizepolicy>
</property>
<property name="currentIndex">
- <number>1</number>
+ <number>0</number>
</property>
<widget class="QWidget" name="leftSatX">
<layout class="QVBoxLayout" name="verticalLayout_2">
</sizepolicy>
</property>
<property name="currentIndex">
- <number>1</number>
+ <number>0</number>
</property>
<widget class="QWidget" name="rightSatX">
<layout class="QVBoxLayout" name="verticalLayout_4">
</sizepolicy>
</property>
<property name="currentIndex">
- <number>1</number>
+ <number>0</number>
</property>
<widget class="QWidget" name="leftCoeffX">
<layout class="QVBoxLayout" name="verticalLayout_6">
</sizepolicy>
</property>
<property name="currentIndex">
- <number>1</number>
+ <number>0</number>
</property>
<widget class="QWidget" name="rightCoeffX">
<layout class="QVBoxLayout" name="verticalLayout_8">
</sizepolicy>
</property>
<property name="currentIndex">
- <number>1</number>
+ <number>0</number>
</property>
<widget class="QWidget" name="deadbandX">
<layout class="QVBoxLayout" name="verticalLayout_10">
{
try {
return setParameters(std::dynamic_pointer_cast<FFBConditionEffectParameters>(params));
- //return setParameters(cdParams);
} catch (const std::bad_cast& ex) {
qCritical(ex.what());
return false;
class FFBConditionEffectParameters : public FFBEffectParameters
{
public:
- enum class Axis : quint8 { NONE = 0, X = 1, Y = 2 };
- struct Axis_less {
- bool operator()(Axis a, Axis b) const { return quint8(a) == quint8(b); }
- };
+ enum class Axis : quint8 { NONE, X, Y };
FFBConditionEffectParameters();
bool centerFromString(const QString& center, Axis a);
bool rightSatFromString(const QString& rightSat, Axis a);
inline void subtypeFromIdx(const ConditionSubtypes subtype) { this->subtype = subtype; }
- std::map<Axis, int, Axis_less> center;
- std::map<Axis, int, Axis_less> deadband;
- std::map<Axis, int, Axis_less> leftCoeff;
- std::map<Axis, int, Axis_less> rightCoeff;
- std::map<Axis, int, Axis_less> leftSat;
- std::map<Axis, int, Axis_less> rightSat;
+ std::map<Axis, int> center;
+ std::map<Axis, int> deadband;
+ std::map<Axis, int> leftCoeff;
+ std::map<Axis, int> rightCoeff;
+ std::map<Axis, int> leftSat;
+ std::map<Axis, int> rightSat;
ConditionSubtypes subtype;
private:
- inline bool qstringToInt(int& val, const QString& str) {
- bool ok = false;
- val = str.toInt(&ok);
- return ok;
- }
};
#endif // FFBCONDITIONEFFECTPARAMETERS_H
#define APP_NAME "FFBChecker"
static const int APP_VERSION_MAJOR(0);
static const int APP_VERSION_MINOR(2);
-static const char APP_VERSION_REL('b');
+static const char APP_VERSION_REL('c');
enum class FFBEffectTypes { NONE, CONSTANT, PERIODIC, RAMP, CONDITION, RUMBLE};
enum class PeriodicWaveforms { NONE, SQUARE, TRIANGLE, SINE, SAW_UP, SAW_DOWN };
std::shared_ptr<FFBConditionEffectParameters> iParams = std::shared_ptr<FFBConditionEffectParameters>(new FFBConditionEffectParameters);
if (!readGeneralEffectParameters(iParams))
return false;
+
if (!iParams->centerFromString(m_conditionEffSet->centerX(), FFBConditionEffectParameters::Axis::X)) {
QMessageBox::warning(this, res_inputFormatErrCap, "Invalid data in field \"Center\"");
return false;