Hide size and height option in individual mode.

--HG--
branch : feature
This commit is contained in:
dismine 2014-03-16 15:17:39 +02:00
parent 61c4d8df0c
commit 5b36420466
6 changed files with 47 additions and 31 deletions

View File

@ -35,7 +35,7 @@ quint32 VContainer::_id = 0;
VContainer::VContainer()
:_size(50), sizeName("Сг"), _height(176), heightName("P"), gObjects(QHash<quint32, VGObject *>()),
standardTable(QHash<QString, VMeasurement>()), incrementTable(QHash<QString, VIncrementTableRow>()),
measurements(QHash<QString, VMeasurement>()), incrementTable(QHash<QString, VIncrementTableRow>()),
lengthLines(QHash<QString, qreal>()), lineAngles(QHash<QString, qreal>()), lengthSplines(QHash<QString, qreal>()),
lengthArcs(QHash<QString, qreal>()), details(QHash<quint32, VDetail>())
{
@ -49,7 +49,7 @@ VContainer &VContainer::operator =(const VContainer &data)
VContainer::VContainer(const VContainer &data)
:_size(50), sizeName("Сг"), _height(176), heightName("P"), gObjects(QHash<quint32, VGObject *>()),
standardTable(QHash<QString, VMeasurement>()), incrementTable(QHash<QString, VIncrementTableRow>()),
measurements(QHash<QString, VMeasurement>()), incrementTable(QHash<QString, VIncrementTableRow>()),
lengthLines(QHash<QString, qreal>()), lineAngles(QHash<QString, qreal>()), lengthSplines(QHash<QString, qreal>()),
lengthArcs(QHash<QString, qreal>()), details(QHash<quint32, VDetail>())
{
@ -103,7 +103,7 @@ void VContainer::setData(const VContainer &data)
qWarning()<<"Don't know how copy this type.";
}
}
standardTable = *data.DataStandardTable();
measurements = *data.DataMeasurements();
incrementTable = *data.DataIncrementTable();
lengthLines = *data.DataLengthLines();
lineAngles = *data.DataLineAngles();
@ -146,7 +146,7 @@ val VContainer::GetVariable(const QHash<key, val> &obj, key id) const
const VMeasurement VContainer::GetMeasurement(const QString &name) const
{
Q_ASSERT(name.isEmpty()==false);
return GetVariable(standardTable, name);
return GetVariable(measurements, name);
}
const VIncrementTableRow VContainer::GetIncrementTableRow(const QString& name) const
@ -250,7 +250,7 @@ void VContainer::AddLineAngle(const QString &name, const qreal &value)
qreal VContainer::GetValueStandardTableRow(const QString& name) const
{
const VMeasurement m = GetMeasurement(name);
const VMeasurement m = GetMeasurement(name);
if (patternType == Pattern::Individual)
{
return m.GetValue();
@ -273,7 +273,7 @@ qreal VContainer::GetValueIncrementTableRow(const QString& name) const
void VContainer::Clear()
{
_id = 0;
standardTable.clear();
measurements.clear();
incrementTable.clear();
lengthLines.clear();
lengthArcs.clear();
@ -321,7 +321,7 @@ qreal VContainer::FindVar(const QString &name, bool *ok)const
*ok = true;
return _height;
}
if (standardTable.contains(name))
if (measurements.contains(name))
{
*ok = true;
return GetValueStandardTableRow(name);

View File

@ -248,9 +248,9 @@ public:
*/
void UpdateIncrementTableRow(const QString& name, VIncrementTableRow row);
/**
* @brief GetValueStandardTableCell return value of standard table row by name
* @param name name of row
* @return value in mm
* @brief GetValueStandardTableRow return value of measurement by name
* @param name name of measurement
* @return value in measurement units
*/
qreal GetValueStandardTableRow(const QString& name) const;
/**
@ -342,10 +342,10 @@ public:
*/
const QHash<quint32, VGObject*> *DataGObjects() const;
/**
* @brief data container with dataStandardTable return container of standard table
* @return pointer on container of standard table
* @brief DataMeasurements container with measurements.
* @return pointer to measurements.
*/
const QHash<QString, VMeasurement> *DataStandardTable() const;
const QHash<QString, VMeasurement> *DataMeasurements() const;
/**
* @brief data container with dataIncrementTable return container of increment table
* @return pointer on container of increment table
@ -395,9 +395,9 @@ private:
*/
QHash<quint32, VGObject*> gObjects;
/**
* @brief standardTable container of standard table rows
* @brief measurements container of measurements.
*/
QHash<QString, VMeasurement> standardTable;
QHash<QString, VMeasurement> measurements;
/**
* @brief incrementTable
*/
@ -460,12 +460,12 @@ private:
inline void VContainer::AddMeasurement(const QString &name, const VMeasurement &m)
{
standardTable[name] = m;
measurements[name] = m;
}
inline void VContainer::UpdateMeasurement(const QString &name, VMeasurement m)
{
standardTable[name] = m;
measurements[name] = m;
}
inline void VContainer::UpdateIncrementTableRow(const QString &name, VIncrementTableRow row)
@ -558,9 +558,9 @@ inline const QHash<quint32, VGObject *> *VContainer::DataGObjects() const
return &gObjects;
}
inline const QHash<QString, VMeasurement> *VContainer::DataStandardTable() const
inline const QHash<QString, VMeasurement> *VContainer::DataMeasurements() const
{
return &standardTable;
return &measurements;
}
inline const QHash<QString, VIncrementTableRow> *VContainer::DataIncrementTable() const

View File

@ -64,7 +64,7 @@ DialogIncrements::DialogIncrements(VContainer *data, VPattern *doc, QWidget *par
void DialogIncrements::FillStandardTable()
{
const QHash<QString, VMeasurement> *standardTable = data->DataStandardTable();
const QHash<QString, VMeasurement> *standardTable = data->DataMeasurements();
qint32 currentRow = -1;
QHashIterator<QString, VMeasurement> i(*standardTable);
ui->tableWidgetStandard->setRowCount ( standardTable->size() );

View File

@ -67,9 +67,17 @@ DialogPointOfContact::DialogPointOfContact(const VContainer *data, QWidget *pare
connect(ui.listWidget, &QListWidget::itemDoubleClicked, this, &DialogPointOfContact::PutVal);
connect(ui.listWidget, &QListWidget::currentRowChanged, this, &DialogPointOfContact::ValChenged);
SizeHeight();
connect(ui.radioButtonSizeGrowth, &QRadioButton::clicked, this, &DialogPointOfContact::SizeHeight);
connect(ui.radioButtonStandardTable, &QRadioButton::clicked, this, &DialogPointOfContact::StandardTable);
if (patternType == Pattern::Standard)
{
SizeHeight();
connect(ui.radioButtonSizeGrowth, &QRadioButton::clicked, this, &DialogTool::SizeHeight);
}
else
{
radioButtonSizeGrowth->setVisible(false);
Measurements();
}
connect(ui.radioButtonStandardTable, &QRadioButton::clicked, this, &DialogPointOfContact::Measurements);
connect(ui.radioButtonIncrements, &QRadioButton::clicked, this, &DialogPointOfContact::Increments);
connect(ui.radioButtonLengthLine, &QRadioButton::clicked, this, &DialogPointOfContact::LengthLines);
connect(ui.radioButtonLengthArc, &QRadioButton::clicked, this, &DialogPointOfContact::LengthArcs);

View File

@ -544,9 +544,9 @@ void DialogTool::SizeHeight()
listWidget->setCurrentRow (0);
}
void DialogTool::StandardTable()
void DialogTool::Measurements()
{
ShowVariable(data->DataStandardTable());
ShowVariable(data->DataMeasurements());
}
void DialogTool::LengthLines()
@ -668,7 +668,7 @@ void DialogTool::UpdateList()
}
if (radioButtonStandardTable->isChecked())
{
ShowVariable(data->DataStandardTable());
ShowVariable(data->DataMeasurements());
}
if (radioButtonIncrements->isChecked())
{

View File

@ -141,9 +141,9 @@ public slots:
*/
void SizeHeight();
/**
* @brief StandardTable show in list standard table variables
* @brief Measurements show in list measurements
*/
void StandardTable();
void Measurements();
/**
* @brief LengthLines show in list lengths of lines variables
*/
@ -428,9 +428,17 @@ protected:
connect(listWidget, &QListWidget::currentRowChanged, this, &DialogTool::ValChenged);
SizeHeight();
connect(radioButtonSizeGrowth, &QRadioButton::clicked, this, &DialogTool::SizeHeight);
connect(radioButtonStandardTable, &QRadioButton::clicked, this, &DialogTool::StandardTable);
if (patternType == Pattern::Standard)
{
SizeHeight();
connect(radioButtonSizeGrowth, &QRadioButton::clicked, this, &DialogTool::SizeHeight);
}
else
{
radioButtonSizeGrowth->setVisible(false);
Measurements();
}
connect(radioButtonStandardTable, &QRadioButton::clicked, this, &DialogTool::Measurements);
connect(radioButtonIncrements, &QRadioButton::clicked, this, &DialogTool::Increments);
connect(radioButtonLengthLine, &QRadioButton::clicked, this, &DialogTool::LengthLines);
connect(radioButtonLengthArc, &QRadioButton::clicked, this, &DialogTool::LengthArcs);