modified addPolarDlg
This commit is contained in:
parent
0fb6395f06
commit
00b9093481
@ -29,6 +29,8 @@ SimuRunMenu::SimuRunMenu(QWidget *parent)
|
|||||||
|
|
||||||
// Initial population
|
// Initial population
|
||||||
RefreshButtons();
|
RefreshButtons();
|
||||||
|
|
||||||
|
setObjectName("SimuRunMenu");
|
||||||
}
|
}
|
||||||
|
|
||||||
SimuRunMenu::~SimuRunMenu() {
|
SimuRunMenu::~SimuRunMenu() {
|
||||||
|
|||||||
@ -310,14 +310,20 @@ int DataPanelManager::FindNextAvailableIndex(FileEntryType fileType) const
|
|||||||
QSet<int> usedIndices;
|
QSet<int> usedIndices;
|
||||||
QString typeStr = FileEntryTypeToString(fileType);
|
QString typeStr = FileEntryTypeToString(fileType);
|
||||||
|
|
||||||
for (auto it = dataPanels_.constBegin(); it != dataPanels_.constEnd(); ++it) {
|
for (auto it = dataPanels_.constBegin(); it != dataPanels_.constEnd(); ++it)
|
||||||
if (it.value()->GetFileType() == fileType) {
|
{
|
||||||
usedIndices.insert(it.value()->GetIndex());
|
FileEntryType type = it.value()->GetFileType();
|
||||||
|
if (type == fileType)
|
||||||
|
{
|
||||||
|
int nIndex = it.value()->GetIndex();
|
||||||
|
usedIndices.insert(nIndex);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (int i = 0; i < GetMaxPanelCount(); ++i) {
|
for (int i = 0; i < GetMaxPanelCount(); ++i)
|
||||||
if (!usedIndices.contains(i)) {
|
{
|
||||||
|
if (!usedIndices.contains(i))
|
||||||
|
{
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -122,9 +122,9 @@ void PolarPanel::OnTimeChanged(double time)
|
|||||||
{
|
{
|
||||||
if (m_data.size() > 0)
|
if (m_data.size() > 0)
|
||||||
{
|
{
|
||||||
for (QMap<int, QLineSeries *>::Iterator itSeries = m_seriesIDMap.begin(); itSeries != m_seriesIDMap.end(); itSeries++)
|
for (QMap<int, QScatterSeries *>::Iterator itSeries = m_seriesIDMap.begin(); itSeries != m_seriesIDMap.end(); itSeries++)
|
||||||
{
|
{
|
||||||
QLineSeries * pSeries = itSeries.value();
|
QScatterSeries * pSeries = itSeries.value();
|
||||||
if (pSeries)
|
if (pSeries)
|
||||||
{
|
{
|
||||||
pSeries->clear();
|
pSeries->clear();
|
||||||
@ -132,21 +132,21 @@ void PolarPanel::OnTimeChanged(double time)
|
|||||||
}
|
}
|
||||||
|
|
||||||
QMap< double, QMap<int, QPointF> >::const_iterator ite = m_data.lowerBound(time);
|
QMap< double, QMap<int, QPointF> >::const_iterator ite = m_data.lowerBound(time);
|
||||||
if (ite != m_data.end())
|
if (ite == m_data.end())
|
||||||
{
|
{
|
||||||
ite++;
|
ite--;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (QMap< double, QMap<int, QPointF> >::Iterator itA = m_data.begin(); itA != ite; itA++)
|
//for (QMap< double, QMap<int, QPointF> >::Iterator itA = m_data.begin(); itA != ite; itA++)
|
||||||
{
|
{
|
||||||
double dTime = itA.key();
|
double dTime = ite.key();
|
||||||
QMap<int, QPointF> mapData = itA.value();
|
QMap<int, QPointF> mapData = ite.value();
|
||||||
for (QMap<int, QPointF>::Iterator it = mapData.begin(); it != mapData.end(); it++)
|
for (QMap<int, QPointF>::Iterator it = mapData.begin(); it != mapData.end(); it++)
|
||||||
{
|
{
|
||||||
int nIndex = it.key();
|
int nIndex = it.key();
|
||||||
QPointF data = it.value();
|
QPointF data = it.value();
|
||||||
|
|
||||||
QLineSeries * pSeries = m_seriesIDMap.value(nIndex);
|
QScatterSeries * pSeries = m_seriesIDMap.value(nIndex);
|
||||||
if (pSeries)
|
if (pSeries)
|
||||||
{
|
{
|
||||||
pSeries->append(data);
|
pSeries->append(data);
|
||||||
@ -244,6 +244,7 @@ void PolarPanel::updateParseFile(const QString& strFile, int nT, FileEntryPolar:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_pChart->removeAllSeries();
|
||||||
m_seriesIDMap.clear();
|
m_seriesIDMap.clear();
|
||||||
|
|
||||||
QFile file(strFile);
|
QFile file(strFile);
|
||||||
@ -324,9 +325,10 @@ void PolarPanel::updateParseFile(const QString& strFile, int nT, FileEntryPolar:
|
|||||||
{
|
{
|
||||||
FileEntryPolar::LineProperty propCurve = listCurve.at(nI);
|
FileEntryPolar::LineProperty propCurve = listCurve.at(nI);
|
||||||
|
|
||||||
QLineSeries *pSeries = new QLineSeries(this);
|
QScatterSeries *pSeries = new QScatterSeries(this);
|
||||||
pSeries->setName(propCurve.name);
|
pSeries->setName(propCurve.name);
|
||||||
pSeries->setColor(propCurve.color);
|
pSeries->setColor(propCurve.color);
|
||||||
|
pSeries->setMarkerSize(7);
|
||||||
pSeries->setUseOpenGL(true);
|
pSeries->setUseOpenGL(true);
|
||||||
m_pChart->addSeries(pSeries);
|
m_pChart->addSeries(pSeries);
|
||||||
m_seriesIDMap.insert(nI, pSeries);
|
m_seriesIDMap.insert(nI, pSeries);
|
||||||
|
|||||||
@ -36,7 +36,7 @@ public:
|
|||||||
* @brief Get file type
|
* @brief Get file type
|
||||||
* @return File type (always Curve for this class)
|
* @return File type (always Curve for this class)
|
||||||
*/
|
*/
|
||||||
FileEntryType GetFileType() const override { return FileEntryType::Table; }
|
FileEntryType GetFileType() const override { return FileEntryType::Polar; }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Refresh panel content
|
* @brief Refresh panel content
|
||||||
@ -80,7 +80,7 @@ private:
|
|||||||
QString m_unitTheta;
|
QString m_unitTheta;
|
||||||
QString m_unitRadius;
|
QString m_unitRadius;
|
||||||
|
|
||||||
QMap<int, QLineSeries *> m_seriesIDMap;
|
QMap<int, QScatterSeries *> m_seriesIDMap;
|
||||||
|
|
||||||
QMap< double, QMap<int, QPointF> > m_data;
|
QMap< double, QMap<int, QPointF> > m_data;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -531,7 +531,7 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="alternatingRowColors">
|
<property name="alternatingRowColors">
|
||||||
<bool>true</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
@ -323,7 +323,7 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="alternatingRowColors">
|
<property name="alternatingRowColors">
|
||||||
<bool>true</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
@ -6,15 +6,15 @@
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>600</width>
|
<width>580</width>
|
||||||
<height>789</height>
|
<height>756</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="windowTitle">
|
<property name="windowTitle">
|
||||||
<string>Add Polar</string>
|
<string>Add Polar</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QGridLayout" name="gridLayout_3">
|
||||||
<item>
|
<item row="0" column="0" colspan="2">
|
||||||
<widget class="QGroupBox" name="fileGroupBox">
|
<widget class="QGroupBox" name="fileGroupBox">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>File Selection</string>
|
<string>File Selection</string>
|
||||||
@ -117,14 +117,14 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="2" column="0">
|
||||||
<widget class="QGroupBox" name="chartGroupBox">
|
<widget class="QGroupBox" name="axisRangeGroupBox">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Chart Properties</string>
|
<string>Angular Axis</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QGridLayout" name="chartGridLayout">
|
<layout class="QGridLayout" name="gridLayout">
|
||||||
<item row="0" column="0">
|
<item row="0" column="0">
|
||||||
<widget class="QLabel" name="chartNameLabel">
|
<widget class="QLabel" name="xTitleLabel_2">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>0</width>
|
<width>0</width>
|
||||||
@ -132,28 +132,25 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Chart Name:</string>
|
<string>Title:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="1">
|
<item row="0" column="1">
|
||||||
<widget class="QLineEdit" name="chartNameEdit">
|
<widget class="QLineEdit" name="TitleEdit_Angular">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>0</width>
|
<width>0</width>
|
||||||
<height>25</height>
|
<height>25</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
|
||||||
<string>Chart 1</string>
|
|
||||||
</property>
|
|
||||||
<property name="placeholderText">
|
<property name="placeholderText">
|
||||||
<string>Enter chart name...</string>
|
<string>Enter axis title...</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="0">
|
<item row="1" column="0">
|
||||||
<widget class="QLabel" name="chartTypeLabel">
|
<widget class="QLabel" name="xMinLabel">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>0</width>
|
<width>0</width>
|
||||||
@ -161,157 +158,12 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Chart Type:</string>
|
<string>Min:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1">
|
<item row="1" column="1">
|
||||||
<widget class="QComboBox" name="chartTypeComboBox">
|
<widget class="QDoubleSpinBox" name="SpinBox_Min_Angular">
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>0</width>
|
|
||||||
<height>25</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0">
|
|
||||||
<widget class="QLabel" name="xTitleLabel">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>0</width>
|
|
||||||
<height>25</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>X Axis Title:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="1">
|
|
||||||
<widget class="QLineEdit" name="xTitleEdit">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>0</width>
|
|
||||||
<height>25</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="placeholderText">
|
|
||||||
<string>Enter X axis title...</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="0">
|
|
||||||
<widget class="QLabel" name="yTitleLabel">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>0</width>
|
|
||||||
<height>25</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Y Axis Title:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="1">
|
|
||||||
<widget class="QLineEdit" name="yTitleEdit">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>0</width>
|
|
||||||
<height>25</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="placeholderText">
|
|
||||||
<string>Enter Y axis title...</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="0">
|
|
||||||
<widget class="QLabel" name="timeParamLabel">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>0</width>
|
|
||||||
<height>25</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Time:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="4" column="1">
|
|
||||||
<widget class="QSpinBox" name="timeParamSpinBox">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>0</width>
|
|
||||||
<height>25</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QGroupBox" name="axisRangeGroupBox">
|
|
||||||
<property name="title">
|
|
||||||
<string>Axis Range Settings</string>
|
|
||||||
</property>
|
|
||||||
<layout class="QGridLayout" name="axisRangeGridLayout">
|
|
||||||
<item row="1" column="3">
|
|
||||||
<widget class="QDoubleSpinBox" name="yMaxSpinBox">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>0</width>
|
|
||||||
<height>25</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="minimum">
|
|
||||||
<double>-999999.000000000000000</double>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<double>999999.000000000000000</double>
|
|
||||||
</property>
|
|
||||||
<property name="value">
|
|
||||||
<double>800.000000000000000</double>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="1">
|
|
||||||
<widget class="QSpinBox" name="xCountSpinBox">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>0</width>
|
|
||||||
<height>25</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="minimum">
|
|
||||||
<number>2</number>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<number>50</number>
|
|
||||||
</property>
|
|
||||||
<property name="value">
|
|
||||||
<number>6</number>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="0">
|
|
||||||
<widget class="QLabel" name="xCountLabel">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>0</width>
|
|
||||||
<height>25</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>X Tick Count:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="1">
|
|
||||||
<widget class="QDoubleSpinBox" name="xMinSpinBox">
|
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>0</width>
|
<width>0</width>
|
||||||
@ -329,33 +181,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="0" column="0">
|
<item row="2" column="0">
|
||||||
<widget class="QLabel" name="xMinLabel">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>0</width>
|
|
||||||
<height>25</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>X Min:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="2">
|
|
||||||
<widget class="QLabel" name="yMaxLabel">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>0</width>
|
|
||||||
<height>25</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="text">
|
|
||||||
<string>Y Max:</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="1" column="0">
|
|
||||||
<widget class="QLabel" name="yMinLabel">
|
<widget class="QLabel" name="yMinLabel">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
@ -364,12 +190,44 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Y Min:</string>
|
<string>Max:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="3">
|
<item row="2" column="1">
|
||||||
<widget class="QSpinBox" name="yCountSpinBox">
|
<widget class="QDoubleSpinBox" name="SpinBox_Max_Angular">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>25</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<double>-999999.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<double>999999.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<double>360.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="0">
|
||||||
|
<widget class="QLabel" name="xCountLabel">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>25</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Count:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="1">
|
||||||
|
<widget class="QSpinBox" name="SpinBox_Count_Angular">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>0</width>
|
<width>0</width>
|
||||||
@ -383,50 +241,12 @@
|
|||||||
<number>50</number>
|
<number>50</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="value">
|
<property name="value">
|
||||||
<number>9</number>
|
<number>13</number>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="1" column="1">
|
<item row="4" column="0">
|
||||||
<widget class="QDoubleSpinBox" name="yMinSpinBox">
|
<widget class="QLabel" name="xTitleLabel_3">
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>0</width>
|
|
||||||
<height>25</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="minimum">
|
|
||||||
<double>-999999.000000000000000</double>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<double>999999.000000000000000</double>
|
|
||||||
</property>
|
|
||||||
<property name="value">
|
|
||||||
<double>-800.000000000000000</double>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="3">
|
|
||||||
<widget class="QDoubleSpinBox" name="xMaxSpinBox">
|
|
||||||
<property name="minimumSize">
|
|
||||||
<size>
|
|
||||||
<width>0</width>
|
|
||||||
<height>25</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
<property name="minimum">
|
|
||||||
<double>-999999.000000000000000</double>
|
|
||||||
</property>
|
|
||||||
<property name="maximum">
|
|
||||||
<double>999999.000000000000000</double>
|
|
||||||
</property>
|
|
||||||
<property name="value">
|
|
||||||
<double>250.000000000000000</double>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="2">
|
|
||||||
<widget class="QLabel" name="xMaxLabel">
|
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>0</width>
|
<width>0</width>
|
||||||
@ -434,11 +254,123 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>X Max:</string>
|
<string>Unit:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="2">
|
<item row="4" column="1">
|
||||||
|
<widget class="QLineEdit" name="TitleEdit_Unit_Angular">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>25</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="placeholderText">
|
||||||
|
<string>Enter axis Unit...</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
|
<widget class="QGroupBox" name="axisRangeGroupBox_2">
|
||||||
|
<property name="title">
|
||||||
|
<string>Radial Axis</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="gridLayout_2">
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="xTitleLabel_4">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>25</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Title:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QLineEdit" name="TitleEdit_Radial">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>25</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="placeholderText">
|
||||||
|
<string>Enter axis title...</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="xMinLabel_2">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>25</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Min:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QDoubleSpinBox" name="SpinBox_Min_Radial">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>25</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<double>-999999.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<double>999999.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<double>0.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="0">
|
||||||
|
<widget class="QLabel" name="yMinLabel_2">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>25</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Max:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="2" column="1">
|
||||||
|
<widget class="QDoubleSpinBox" name="SpinBox_Max_Radial">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>25</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<double>-999999.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<double>999999.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<double>0.000000000000000</double>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="0">
|
||||||
<widget class="QLabel" name="xCountLabel_2">
|
<widget class="QLabel" name="xCountLabel_2">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
@ -447,14 +379,59 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Y Tick Count:</string>
|
<string>Count:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="3" column="1">
|
||||||
|
<widget class="QSpinBox" name="SpinBox_Count_Radial">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>25</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="minimum">
|
||||||
|
<number>2</number>
|
||||||
|
</property>
|
||||||
|
<property name="maximum">
|
||||||
|
<number>50</number>
|
||||||
|
</property>
|
||||||
|
<property name="value">
|
||||||
|
<number>6</number>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="0">
|
||||||
|
<widget class="QLabel" name="xTitleLabel_5">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>25</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Unit:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="4" column="1">
|
||||||
|
<widget class="QLineEdit" name="TitleEdit_Unit_Radial">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>25</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="placeholderText">
|
||||||
|
<string>Enter axis Unit...</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="3" column="0" colspan="2">
|
||||||
<widget class="QGroupBox" name="curveGroupBox">
|
<widget class="QGroupBox" name="curveGroupBox">
|
||||||
<property name="title">
|
<property name="title">
|
||||||
<string>Curve Management</string>
|
<string>Curve Management</string>
|
||||||
@ -497,7 +474,7 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Add Curve</string>
|
<string>Add</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -531,7 +508,7 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="alternatingRowColors">
|
<property name="alternatingRowColors">
|
||||||
<bool>true</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -553,7 +530,7 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Curve Name:</string>
|
<string>Name:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -579,7 +556,7 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Curve Color:</string>
|
<string>Color:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -644,12 +621,12 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Data Start:</string>
|
<string>Angular:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="1">
|
<item row="2" column="1">
|
||||||
<widget class="QSpinBox" name="dataStartSpinBox">
|
<widget class="QSpinBox" name="SpinBox_Angular">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>0</width>
|
<width>0</width>
|
||||||
@ -657,13 +634,13 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="minimum">
|
<property name="minimum">
|
||||||
<number>1</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<number>999999</number>
|
<number>999999</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="value">
|
<property name="value">
|
||||||
<number>1</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -676,12 +653,12 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Data Stop:</string>
|
<string>Radial:</string>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="3" column="1">
|
<item row="3" column="1">
|
||||||
<widget class="QSpinBox" name="dataStopSpinBox">
|
<widget class="QSpinBox" name="SpinBox_Radial">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>0</width>
|
<width>0</width>
|
||||||
@ -689,13 +666,13 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="minimum">
|
<property name="minimum">
|
||||||
<number>1</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="maximum">
|
<property name="maximum">
|
||||||
<number>999999</number>
|
<number>999999</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="value">
|
<property name="value">
|
||||||
<number>241</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
@ -757,7 +734,7 @@
|
|||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item row="4" column="0" colspan="2">
|
||||||
<layout class="QHBoxLayout" name="buttonLayout">
|
<layout class="QHBoxLayout" name="buttonLayout">
|
||||||
<item>
|
<item>
|
||||||
<spacer name="horizontalSpacer">
|
<spacer name="horizontalSpacer">
|
||||||
@ -803,6 +780,67 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item row="1" column="0" colspan="2">
|
||||||
|
<widget class="QGroupBox" name="chartGroupBox">
|
||||||
|
<property name="title">
|
||||||
|
<string>Chart Properties</string>
|
||||||
|
</property>
|
||||||
|
<layout class="QGridLayout" name="chartGridLayout">
|
||||||
|
<item row="1" column="1">
|
||||||
|
<widget class="QSpinBox" name="SpinBox_time">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>25</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="1" column="0">
|
||||||
|
<widget class="QLabel" name="timeParamLabel">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>25</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Time:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="0">
|
||||||
|
<widget class="QLabel" name="chartNameLabel">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>25</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Chart Name:</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item row="0" column="1">
|
||||||
|
<widget class="QLineEdit" name="chartNameEdit">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>25</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Chart 1</string>
|
||||||
|
</property>
|
||||||
|
<property name="placeholderText">
|
||||||
|
<string>Enter chart name...</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<resources/>
|
<resources/>
|
||||||
|
|||||||
@ -20,8 +20,7 @@ AddPolarFileDlg::AddPolarFileDlg(QWidget* parent)
|
|||||||
SetupUI(ui);
|
SetupUI(ui);
|
||||||
SetTitle(getDialogTitle());
|
SetTitle(getDialogTitle());
|
||||||
|
|
||||||
//setupConnections();
|
setupConnections();
|
||||||
//updateCurvePropertiesUI(); // Initialize UI based on default chart type
|
|
||||||
}
|
}
|
||||||
|
|
||||||
AddPolarFileDlg::~AddPolarFileDlg() {
|
AddPolarFileDlg::~AddPolarFileDlg() {
|
||||||
@ -29,177 +28,151 @@ AddPolarFileDlg::~AddPolarFileDlg() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QString AddPolarFileDlg::getFileFilter() const {
|
QString AddPolarFileDlg::getFileFilter() const
|
||||||
|
{
|
||||||
return "Data Files (*.txt *.csv *.dat);;All Files (*.*)";
|
return "Data Files (*.txt *.csv *.dat);;All Files (*.*)";
|
||||||
}
|
}
|
||||||
|
|
||||||
QString AddPolarFileDlg::getDialogTitle() const {
|
QString AddPolarFileDlg::getDialogTitle() const
|
||||||
return "Add Polar Data File";
|
{
|
||||||
|
return "Add Polar";
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AddPolarFileDlg::validateSpecificParams() {
|
bool AddPolarFileDlg::validateSpecificParams()
|
||||||
|
{
|
||||||
// File path validation
|
// File path validation
|
||||||
const QString& selectFilePath = getSelectedFilePath();
|
const QString& selectFilePath = getSelectedFilePath();
|
||||||
if (selectFilePath.isEmpty()) {
|
if (selectFilePath.isEmpty())
|
||||||
|
{
|
||||||
QMessageBox::warning(this, tr("Validation Error"), tr("Please select a data file."));
|
QMessageBox::warning(this, tr("Validation Error"), tr("Please select a data file."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// File existence validation
|
// File existence validation
|
||||||
QFileInfo fileInfo(selectFilePath);
|
QFileInfo fileInfo(selectFilePath);
|
||||||
if (!fileInfo.exists()) {
|
if (!fileInfo.exists())
|
||||||
|
{
|
||||||
QMessageBox::warning(this, tr("Validation Error"), tr("Selected file does not exist."));
|
QMessageBox::warning(this, tr("Validation Error"), tr("Selected file does not exist."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// File readability validation
|
// File readability validation
|
||||||
if (!fileInfo.isReadable()) {
|
if (!fileInfo.isReadable())
|
||||||
|
{
|
||||||
QMessageBox::warning(this, tr("Validation Error"), tr("Selected file is not readable. Please check file permissions."));
|
QMessageBox::warning(this, tr("Validation Error"), tr("Selected file is not readable. Please check file permissions."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// File size validation (avoid memory issues with large files)
|
// File size validation (avoid memory issues with large files)
|
||||||
if (fileInfo.size() > 100 * 1024 * 1024) { // 100MB limit
|
if (fileInfo.size() > 100 * 1024 * 1024)
|
||||||
|
{ // 100MB limit
|
||||||
QMessageBox::warning(this, tr("Validation Error"), tr("File is too large (over 100MB). Please select a smaller file."));
|
QMessageBox::warning(this, tr("Validation Error"), tr("File is too large (over 100MB). Please select a smaller file."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Curve count validation
|
// Curve count validation
|
||||||
if (curves_.isEmpty()) {
|
if (curves_.isEmpty())
|
||||||
|
{
|
||||||
QMessageBox::warning(this, tr("Validation Error"), tr("At least one curve must be defined."));
|
QMessageBox::warning(this, tr("Validation Error"), tr("At least one curve must be defined."));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//// Save current curve properties
|
// Save current curve properties
|
||||||
//if (currentCurveIndex_ >= 0) {
|
if (currentCurveIndex_ >= 0)
|
||||||
// saveCurveProperties();
|
{
|
||||||
//}
|
saveCurveProperties();
|
||||||
|
}
|
||||||
|
|
||||||
//// Curve name uniqueness validation
|
// Curve name uniqueness validation
|
||||||
//QStringList curveNames;
|
QStringList curveNames;
|
||||||
//for (int i = 0; i < curves_.size(); ++i) {
|
for (int i = 0; i < curves_.size(); ++i)
|
||||||
// const FileEntryCurve::CurveProperty& curve = curves_[i];
|
{
|
||||||
|
const FileEntryPolar::LineProperty& curve = curves_[i];
|
||||||
|
|
||||||
// if (curve.name.isEmpty()) {
|
if (curve.name.isEmpty())
|
||||||
// QMessageBox::warning(this, tr("Validation Error"),
|
{
|
||||||
// tr("Curve %1 name cannot be empty.").arg(i + 1));
|
QMessageBox::warning(this, tr("Validation Error"),
|
||||||
// return false;
|
tr("Curve %1 name cannot be empty.").arg(i + 1));
|
||||||
// }
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// if (curveNames.contains(curve.name)) {
|
if (curveNames.contains(curve.name))
|
||||||
// QMessageBox::warning(this, tr("Validation Error"),
|
{
|
||||||
// tr("Curve name '%1' is duplicated. Please use different names.").arg(curve.name));
|
QMessageBox::warning(this, tr("Validation Error"),
|
||||||
// return false;
|
tr("Curve name '%1' is duplicated. Please use different names.").arg(curve.name));
|
||||||
// }
|
return false;
|
||||||
// curveNames.append(curve.name);
|
}
|
||||||
|
curveNames.append(curve.name);
|
||||||
|
|
||||||
// // Curve name length validation
|
// Curve name length validation
|
||||||
// if (curve.name.length() > 50) {
|
if (curve.name.length() > 50)
|
||||||
// QMessageBox::warning(this, tr("Validation Error"),
|
{
|
||||||
// tr("Curve name '%1' is too long. Please limit to 50 characters.").arg(curve.name));
|
QMessageBox::warning(this, tr("Validation Error"),
|
||||||
// return false;
|
tr("Curve name '%1' is too long. Please limit to 50 characters.").arg(curve.name));
|
||||||
// }
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
// // Data range validation based on chart type
|
// Report type validation - ensure x and y values are reasonable
|
||||||
// if (chartProperties_.chartType == ChartType::Wave) {
|
if (curve.Angular < -1000000 || curve.Angular > 1000000)
|
||||||
// if (curve.data.wave.start < 1 || curve.data.wave.stop < 1) {
|
{
|
||||||
// QMessageBox::warning(this, tr("Validation Error"),
|
QMessageBox::warning(this, tr("Validation Error"),
|
||||||
// tr("Curve '%1' start and stop values must be greater than 0.").arg(curve.name));
|
tr("Curve '%1' X value is out of range. Please ensure it is between -1000000 and 1000000.").arg(curve.name));
|
||||||
// return false;
|
return false;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// if (curve.data.wave.start > curve.data.wave.stop) {
|
if (curve.Radial < -1000000 || curve.Radial > 1000000)
|
||||||
// QMessageBox::warning(this, tr("Validation Error"),
|
{
|
||||||
// tr("Curve '%1' start value cannot be greater than stop value.").arg(curve.name));
|
QMessageBox::warning(this, tr("Validation Error"),
|
||||||
// return false;
|
tr("Curve '%1' Y value is out of range. Please ensure it is between -1000000 and 1000000.").arg(curve.name));
|
||||||
// }
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// // Data range reasonableness validation
|
// Chart properties validation
|
||||||
// if (curve.data.wave.stop - curve.data.wave.start < 1) {
|
if (ui->chartNameEdit->text().isEmpty())
|
||||||
// QMessageBox::warning(this, tr("Validation Error"),
|
{
|
||||||
// tr("Curve '%1' data range is too small. At least 2 data points are required.").arg(curve.name));
|
QMessageBox::warning(this, tr("Validation Error"), tr("Chart name cannot be empty."));
|
||||||
// return false;
|
return false;
|
||||||
// }
|
}
|
||||||
|
|
||||||
// if (curve.data.wave.stop > 1000000) {
|
if (ui->chartNameEdit->text().length() > 100)
|
||||||
// QMessageBox::warning(this, tr("Validation Error"),
|
{
|
||||||
// tr("Curve '%1' stop value is too large. Please ensure it does not exceed 1000000.").arg(curve.name));
|
QMessageBox::warning(this, tr("Validation Error"), tr("Chart name is too long. Please limit to 100 characters."));
|
||||||
// return false;
|
return false;
|
||||||
// }
|
}
|
||||||
// }
|
|
||||||
// else {
|
|
||||||
// // Report type validation - ensure x and y values are reasonable
|
|
||||||
// if (curve.data.report.x < -1000000 || curve.data.report.x > 1000000) {
|
|
||||||
// QMessageBox::warning(this, tr("Validation Error"),
|
|
||||||
// tr("Curve '%1' X value is out of range. Please ensure it is between -1000000 and 1000000.").arg(curve.name));
|
|
||||||
// return false;
|
|
||||||
// }
|
|
||||||
|
|
||||||
// if (curve.data.report.y < -1000000 || curve.data.report.y > 1000000) {
|
// Axis range validation
|
||||||
// QMessageBox::warning(this, tr("Validation Error"),
|
double AngularMin = ui->SpinBox_Min_Angular->value();
|
||||||
// tr("Curve '%1' Y value is out of range. Please ensure it is between -1000000 and 1000000.").arg(curve.name));
|
double AngularMax = ui->SpinBox_Max_Angular->value();
|
||||||
// return false;
|
double RadialMin = ui->SpinBox_Min_Radial->value();
|
||||||
// }
|
double RadialMax = ui->SpinBox_Max_Radial->value();
|
||||||
// }
|
|
||||||
//}
|
|
||||||
|
|
||||||
//// Chart properties validation
|
if (AngularMin > AngularMax)
|
||||||
//if (ui->chartNameEdit->text().isEmpty()) {
|
{
|
||||||
// QMessageBox::warning(this, tr("Validation Error"), tr("Chart name cannot be empty."));
|
QMessageBox::warning(this, tr("Validation Error"), tr("Angular axis minimum value must be less than maximum value."));
|
||||||
// return false;
|
return false;
|
||||||
//}
|
}
|
||||||
|
|
||||||
//if (ui->chartNameEdit->text().length() > 100) {
|
if (RadialMin > RadialMax)
|
||||||
// QMessageBox::warning(this, tr("Validation Error"), tr("Chart name is too long. Please limit to 100 characters."));
|
{
|
||||||
// return false;
|
QMessageBox::warning(this, tr("Validation Error"), tr("Radial axis minimum value must be less than maximum value."));
|
||||||
//}
|
return false;
|
||||||
|
}
|
||||||
//// Axis title validation
|
|
||||||
//if (ui->xTitleEdit->text().length() > 50) {
|
|
||||||
// QMessageBox::warning(this, tr("Validation Error"), tr("X axis title is too long. Please limit to 50 characters."));
|
|
||||||
// return false;
|
|
||||||
//}
|
|
||||||
|
|
||||||
//if (ui->yTitleEdit->text().length() > 50) {
|
|
||||||
// QMessageBox::warning(this, tr("Validation Error"), tr("Y axis title is too long. Please limit to 50 characters."));
|
|
||||||
// return false;
|
|
||||||
//}
|
|
||||||
|
|
||||||
//// Axis range validation
|
|
||||||
//double xMin = ui->xMinSpinBox->value();
|
|
||||||
//double xMax = ui->xMaxSpinBox->value();
|
|
||||||
//double yMin = ui->yMinSpinBox->value();
|
|
||||||
//double yMax = ui->yMaxSpinBox->value();
|
|
||||||
|
|
||||||
//if (xMin >= xMax) {
|
|
||||||
// QMessageBox::warning(this, tr("Validation Error"), tr("X axis minimum value must be less than maximum value."));
|
|
||||||
// return false;
|
|
||||||
//}
|
|
||||||
|
|
||||||
//if (yMin >= yMax) {
|
|
||||||
// QMessageBox::warning(this, tr("Validation Error"), tr("Y axis minimum value must be less than maximum value."));
|
|
||||||
// return false;
|
|
||||||
//}
|
|
||||||
|
|
||||||
|
|
||||||
//// Time parameter validation
|
// Time parameter validation
|
||||||
//double timeParam = ui->timeParamSpinBox->value();
|
double timeParam = ui->SpinBox_time->value();
|
||||||
//if (timeParam < 0) {
|
if (timeParam < 0)
|
||||||
// QMessageBox::warning(this, tr("Validation Error"), tr("Time parameter cannot be negative."));
|
{
|
||||||
// return false;
|
QMessageBox::warning(this, tr("Validation Error"), tr("Time parameter cannot be negative."));
|
||||||
//}
|
return false;
|
||||||
|
}
|
||||||
//// X axis tick count validation
|
|
||||||
//int xTickCount = ui->xCountSpinBox->value();
|
|
||||||
//if (xTickCount < 2) {
|
|
||||||
// QMessageBox::warning(this, tr("Validation Error"), tr("X axis tick count must be at least 2."));
|
|
||||||
// return false;
|
|
||||||
//}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void AddPolarFileDlg::updateFileInfo(const QString& filePath) {
|
void AddPolarFileDlg::updateFileInfo(const QString& filePath)
|
||||||
|
{
|
||||||
QFileInfo fileInfo(filePath);
|
QFileInfo fileInfo(filePath);
|
||||||
if (fileInfo.exists()) {
|
if (fileInfo.exists()) {
|
||||||
ui->fileNameValue->setText(fileInfo.fileName());
|
ui->fileNameValue->setText(fileInfo.fileName());
|
||||||
@ -222,4 +195,393 @@ void AddPolarFileDlg::updateFileInfo(const QString& filePath) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ui->filePathEdit->setText(filePath);
|
ui->filePathEdit->setText(filePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AddPolarFileDlg::setupConnections()
|
||||||
|
{
|
||||||
|
// File selection connections
|
||||||
|
connect(ui->selectFileBtn, &QToolButton::clicked, this, &AddPolarFileDlg::OnSelectFile);
|
||||||
|
|
||||||
|
// Curve management connections
|
||||||
|
connect(ui->addCurveBtn, &QPushButton::clicked, this, &AddPolarFileDlg::onAddCurveClicked);
|
||||||
|
connect(ui->removeCurveBtn, &QPushButton::clicked, this, &AddPolarFileDlg::onRemoveCurveClicked);
|
||||||
|
connect(ui->curveListWidget, &QListWidget::currentRowChanged, this, &AddPolarFileDlg::onCurveSelectionChanged);
|
||||||
|
connect(ui->curveListWidget, &QListWidget::itemClicked, this, &AddPolarFileDlg::onCurveListWidgetItemClicked);
|
||||||
|
|
||||||
|
// Curve properties connections
|
||||||
|
connect(ui->colorButton, &QPushButton::clicked, this, &AddPolarFileDlg::onColorButtonClicked);
|
||||||
|
connect(ui->curveNameEdit, &QLineEdit::textChanged, this, &AddPolarFileDlg::onCurveNameChanged);
|
||||||
|
connect(ui->SpinBox_Angular, QOverload<int>::of(&QSpinBox::valueChanged), this, &AddPolarFileDlg::onCurveDataChanged);
|
||||||
|
connect(ui->SpinBox_Radial, QOverload<int>::of(&QSpinBox::valueChanged), this, &AddPolarFileDlg::onCurveDataChanged);
|
||||||
|
|
||||||
|
// Dialog buttons
|
||||||
|
connect(ui->addBtn, &QPushButton::clicked, this, &AddPolarFileDlg::onSure);
|
||||||
|
connect(ui->cancelBtn, &QPushButton::clicked, this, &QDialog::reject);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AddPolarFileDlg::onColorButtonClicked()
|
||||||
|
{
|
||||||
|
if (currentCurveIndex_ >= 0 && currentCurveIndex_ < curves_.size())
|
||||||
|
{
|
||||||
|
QColor color = QColorDialog::getColor(curves_[currentCurveIndex_].color, this, "Select Curve Color");
|
||||||
|
if (color.isValid())
|
||||||
|
{
|
||||||
|
curves_[currentCurveIndex_].color = color;
|
||||||
|
selectedColor_ = color;
|
||||||
|
updateColorPreview(color);
|
||||||
|
|
||||||
|
// Update list item text
|
||||||
|
QListWidgetItem* item = ui->curveListWidget->item(currentCurveIndex_);
|
||||||
|
if (item)
|
||||||
|
{
|
||||||
|
QString itemText = QString("%1 (%2,%3) (%4,%5,%6)")
|
||||||
|
.arg(curves_[currentCurveIndex_].name)
|
||||||
|
.arg(curves_[currentCurveIndex_].Angular)
|
||||||
|
.arg(curves_[currentCurveIndex_].Radial)
|
||||||
|
.arg(color.red())
|
||||||
|
.arg(color.green())
|
||||||
|
.arg(color.blue());
|
||||||
|
|
||||||
|
item->setText(itemText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void AddPolarFileDlg::updateColorPreview(const QColor& color)
|
||||||
|
{
|
||||||
|
QString styleSheet = QString("background-color: rgb(%1, %2, %3); border: 1px solid black;")
|
||||||
|
.arg(color.red())
|
||||||
|
.arg(color.green())
|
||||||
|
.arg(color.blue());
|
||||||
|
ui->colorPreview->setStyleSheet(styleSheet);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AddPolarFileDlg::onAddCurveClicked()
|
||||||
|
{
|
||||||
|
// Save current curve properties if any curve is selected
|
||||||
|
if (currentCurveIndex_ >= 0)
|
||||||
|
{
|
||||||
|
saveCurveProperties();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Create new curve with default properties based on chart type
|
||||||
|
FileEntryPolar::LineProperty newCurve;
|
||||||
|
newCurve.name = generateCurveName();
|
||||||
|
newCurve.color = generateCurveColor();
|
||||||
|
newCurve.Angular = 0.0;
|
||||||
|
newCurve.Radial = 0.0;
|
||||||
|
|
||||||
|
// Add to curves list and UI
|
||||||
|
curves_.append(newCurve);
|
||||||
|
|
||||||
|
// Add to UI list widget with appropriate display format
|
||||||
|
QString displayText = QString("%1 (%2,%3) (%4,%5,%6)")
|
||||||
|
.arg(newCurve.name)
|
||||||
|
.arg(newCurve.Angular)
|
||||||
|
.arg(newCurve.Radial)
|
||||||
|
.arg(newCurve.color.red())
|
||||||
|
.arg(newCurve.color.green())
|
||||||
|
.arg(newCurve.color.blue());
|
||||||
|
|
||||||
|
QListWidgetItem* item = new QListWidgetItem(displayText);
|
||||||
|
ui->curveListWidget->addItem(item);
|
||||||
|
++currentCurveIndex_;
|
||||||
|
|
||||||
|
ui->curveNameEdit->setText(newCurve.name);
|
||||||
|
|
||||||
|
// Select the new curve
|
||||||
|
ui->curveListWidget->setCurrentRow(curves_.size() - 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AddPolarFileDlg::onRemoveCurveClicked()
|
||||||
|
{
|
||||||
|
int currentRow = ui->curveListWidget->currentRow();
|
||||||
|
if (currentRow < 0 || currentRow >= curves_.size())
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Don't allow removing the last curve
|
||||||
|
if (curves_.size() <= 0)
|
||||||
|
{
|
||||||
|
QMessageBox::information(this, "Information", "At least one curve must remain.");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Remove from curves list and UI
|
||||||
|
curves_.removeAt(currentRow);
|
||||||
|
delete ui->curveListWidget->takeItem(currentRow);
|
||||||
|
|
||||||
|
// Update current index
|
||||||
|
if (currentRow >= curves_.size())
|
||||||
|
{
|
||||||
|
currentRow = curves_.size() - 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (currentRow >= 0)
|
||||||
|
{
|
||||||
|
ui->curveListWidget->setCurrentRow(currentRow);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
currentCurveIndex_ = -1;
|
||||||
|
clearCurveProperties();
|
||||||
|
enableCurveProperties(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void AddPolarFileDlg::onCurveListWidgetItemClicked(QListWidgetItem* item)
|
||||||
|
{
|
||||||
|
if (!item)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
int clickedIndex = ui->curveListWidget->row(item);
|
||||||
|
|
||||||
|
if (clickedIndex == currentCurveIndex_)
|
||||||
|
{
|
||||||
|
ui->curveNameEdit->setText(curves_[currentCurveIndex_].name);
|
||||||
|
|
||||||
|
ui->SpinBox_Angular->blockSignals(true);
|
||||||
|
ui->SpinBox_Angular->setValue(curves_[currentCurveIndex_].Angular);
|
||||||
|
ui->SpinBox_Angular->blockSignals(false);
|
||||||
|
|
||||||
|
ui->SpinBox_Radial->blockSignals(true);
|
||||||
|
ui->SpinBox_Radial->setValue(curves_[currentCurveIndex_].Radial);
|
||||||
|
ui->SpinBox_Radial->blockSignals(false);
|
||||||
|
|
||||||
|
updateColorPreview(curves_[currentCurveIndex_].color);
|
||||||
|
enableCurveProperties(true);
|
||||||
|
|
||||||
|
ui->curveNameEdit->setFocus();
|
||||||
|
ui->curveNameEdit->selectAll();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
onCurveSelectionChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void AddPolarFileDlg::onCurveSelectionChanged()
|
||||||
|
{
|
||||||
|
int currentRow = ui->curveListWidget->currentRow();
|
||||||
|
|
||||||
|
// Save previous curve properties
|
||||||
|
if (currentCurveIndex_ >= 0 && currentCurveIndex_ < curves_.size())
|
||||||
|
{
|
||||||
|
saveCurveProperties();
|
||||||
|
}
|
||||||
|
|
||||||
|
currentCurveIndex_ = currentRow;
|
||||||
|
|
||||||
|
if (currentRow >= 0 && currentRow < curves_.size())
|
||||||
|
{
|
||||||
|
// Load selected curve properties
|
||||||
|
updateCurveProperties();
|
||||||
|
enableCurveProperties(true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
clearCurveProperties();
|
||||||
|
enableCurveProperties(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void AddPolarFileDlg::onCurveNameChanged()
|
||||||
|
{
|
||||||
|
if (currentCurveIndex_ >= 0 && currentCurveIndex_ < curves_.size())
|
||||||
|
{
|
||||||
|
QString newName = ui->curveNameEdit->text();
|
||||||
|
curves_[currentCurveIndex_].name = newName;
|
||||||
|
|
||||||
|
// Update list item text with appropriate format
|
||||||
|
QListWidgetItem* item = ui->curveListWidget->item(currentCurveIndex_);
|
||||||
|
if (item)
|
||||||
|
{
|
||||||
|
QString displayText = QString("%1 (%2,%3) (%4,%5,%6)")
|
||||||
|
.arg(newName)
|
||||||
|
.arg(curves_[currentCurveIndex_].Angular)
|
||||||
|
.arg(curves_[currentCurveIndex_].Radial)
|
||||||
|
.arg(curves_[currentCurveIndex_].color.red())
|
||||||
|
.arg(curves_[currentCurveIndex_].color.green())
|
||||||
|
.arg(curves_[currentCurveIndex_].color.blue());
|
||||||
|
|
||||||
|
item->setText(displayText);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void AddPolarFileDlg::saveCurveProperties()
|
||||||
|
{
|
||||||
|
if (currentCurveIndex_ >= 0 && currentCurveIndex_ < curves_.size())
|
||||||
|
{
|
||||||
|
curves_[currentCurveIndex_].name = ui->curveNameEdit->text();
|
||||||
|
|
||||||
|
// Save properties based on chart type
|
||||||
|
curves_[currentCurveIndex_].Angular = ui->SpinBox_Angular->value();
|
||||||
|
curves_[currentCurveIndex_].Radial = ui->SpinBox_Radial->value();
|
||||||
|
|
||||||
|
curves_[currentCurveIndex_].color = selectedColor_;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void AddPolarFileDlg::clearCurveProperties()
|
||||||
|
{
|
||||||
|
ui->curveNameEdit->clear();
|
||||||
|
|
||||||
|
// Clear properties based on chart type
|
||||||
|
ui->SpinBox_Angular->setValue(0.0);
|
||||||
|
ui->SpinBox_Radial->setValue(0.0);
|
||||||
|
|
||||||
|
selectedColor_ = QColor(255, 0, 0);
|
||||||
|
updateColorPreview(selectedColor_);
|
||||||
|
}
|
||||||
|
|
||||||
|
void AddPolarFileDlg::enableCurveProperties(bool enabled)
|
||||||
|
{
|
||||||
|
ui->curvePropertiesGroupBox->setEnabled(enabled);
|
||||||
|
}
|
||||||
|
|
||||||
|
QString AddPolarFileDlg::generateCurveName()
|
||||||
|
{
|
||||||
|
return tr("Curve %1").arg(curves_.size() + 1);
|
||||||
|
}
|
||||||
|
|
||||||
|
QColor AddPolarFileDlg::generateCurveColor() const
|
||||||
|
{
|
||||||
|
// Generate different colors for each curve
|
||||||
|
static const QColor colors[] = {
|
||||||
|
QColor(255, 0, 0), // Red
|
||||||
|
QColor(0, 255, 0), // Green
|
||||||
|
QColor(0, 0, 255), // Blue
|
||||||
|
QColor(255, 255, 0), // Yellow
|
||||||
|
QColor(255, 0, 255), // Magenta
|
||||||
|
QColor(0, 255, 255), // Cyan
|
||||||
|
QColor(255, 128, 0), // Orange
|
||||||
|
QColor(128, 0, 255), // Purple
|
||||||
|
};
|
||||||
|
|
||||||
|
int colorIndex = curves_.size() % (sizeof(colors) / sizeof(colors[0]));
|
||||||
|
return colors[colorIndex];
|
||||||
|
}
|
||||||
|
|
||||||
|
void AddPolarFileDlg::updateCurveProperties()
|
||||||
|
{
|
||||||
|
if (currentCurveIndex_ >= 0 && currentCurveIndex_ < curves_.size())
|
||||||
|
{
|
||||||
|
const FileEntryPolar::LineProperty& curve = curves_[currentCurveIndex_];
|
||||||
|
|
||||||
|
ui->curveNameEdit->setText(curve.name);
|
||||||
|
|
||||||
|
ui->SpinBox_Angular->blockSignals(true);
|
||||||
|
ui->SpinBox_Angular->setValue(curve.Angular);
|
||||||
|
ui->SpinBox_Angular->blockSignals(false);
|
||||||
|
|
||||||
|
ui->SpinBox_Radial->blockSignals(true);
|
||||||
|
ui->SpinBox_Radial->setValue(curve.Radial);
|
||||||
|
ui->SpinBox_Radial->blockSignals(false);
|
||||||
|
|
||||||
|
selectedColor_ = curve.color;
|
||||||
|
updateColorPreview(curve.color);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void AddPolarFileDlg::onSure()
|
||||||
|
{
|
||||||
|
if (validateSpecificParams())
|
||||||
|
{
|
||||||
|
// Create FileEntryCurve object using factory function
|
||||||
|
auto fileEntryPolar = CreateFileEntryPolar(getSelectedFilePath());
|
||||||
|
if (!fileEntryPolar)
|
||||||
|
{
|
||||||
|
QMessageBox::warning(this, tr("Error"), tr("Failed to create file entry"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set curve properties
|
||||||
|
fileEntryPolar->SetName(ui->chartNameEdit->text());
|
||||||
|
|
||||||
|
// Set chart properties
|
||||||
|
FileEntryPolar::ChartProperties chartProps;
|
||||||
|
chartProps.AngularCount = ui->SpinBox_Count_Angular->value();
|
||||||
|
chartProps.RadialCount = ui->SpinBox_Count_Radial->value();
|
||||||
|
chartProps.AngularTitle = ui->TitleEdit_Angular->text();
|
||||||
|
chartProps.RadialTitle = ui->TitleEdit_Radial->text();
|
||||||
|
chartProps.AngularUnit = ui->TitleEdit_Unit_Angular->text();
|
||||||
|
chartProps.RadialUnit = ui->TitleEdit_Unit_Radial->text();
|
||||||
|
chartProps.AngularMin = ui->SpinBox_Min_Angular->value();
|
||||||
|
chartProps.AngularMax = ui->SpinBox_Max_Angular->value();
|
||||||
|
chartProps.RadialMin = ui->SpinBox_Min_Radial->value();
|
||||||
|
chartProps.RadialMax = ui->SpinBox_Max_Radial->value();
|
||||||
|
chartProps.timeParam = ui->SpinBox_time->value();
|
||||||
|
fileEntryPolar->SetChartProperties(chartProps);
|
||||||
|
|
||||||
|
// Add curve properties
|
||||||
|
for (const auto& curve : curves_)
|
||||||
|
{
|
||||||
|
fileEntryPolar->AddLineProperty(curve);
|
||||||
|
}
|
||||||
|
|
||||||
|
// Get current workspace
|
||||||
|
WorkSpace* workspace = WorkSpaceManager::Get().GetCurrent();
|
||||||
|
if (!workspace)
|
||||||
|
{
|
||||||
|
QMessageBox::warning(this, tr("Error"), tr("Unable to get current workspace"));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add FileEntryCurve to workspace using new SetFileEntry method
|
||||||
|
auto result = workspace->SetFileEntry(fileEntryPolar);
|
||||||
|
if (result != WorkSpace::FileEntryResult::Ok)
|
||||||
|
{
|
||||||
|
QString errorMsg;
|
||||||
|
switch (result) {
|
||||||
|
case WorkSpace::FileEntryResult::LimitExceeded:
|
||||||
|
errorMsg = tr("Curve file count has reached the limit (9 files)");
|
||||||
|
break;
|
||||||
|
case WorkSpace::FileEntryResult::Duplicate:
|
||||||
|
errorMsg = tr("File already exists");
|
||||||
|
break;
|
||||||
|
case WorkSpace::FileEntryResult::CopyFailed:
|
||||||
|
errorMsg = tr("File copy failed");
|
||||||
|
break;
|
||||||
|
case WorkSpace::FileEntryResult::InvalidFile:
|
||||||
|
errorMsg = tr("Invalid file");
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
errorMsg = tr("Failed to add file");
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
QMessageBox::warning(this, tr("Error"), errorMsg);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
accept();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void AddPolarFileDlg::onCurveDataChanged()
|
||||||
|
{
|
||||||
|
if (currentCurveIndex_ >= 0 && currentCurveIndex_ < curves_.size())
|
||||||
|
{
|
||||||
|
curves_[currentCurveIndex_].Angular = ui->SpinBox_Angular->value();
|
||||||
|
curves_[currentCurveIndex_].Radial = ui->SpinBox_Radial->value();
|
||||||
|
|
||||||
|
// Update display text in list widget
|
||||||
|
QListWidgetItem* item = ui->curveListWidget->item(currentCurveIndex_);
|
||||||
|
if (item)
|
||||||
|
{
|
||||||
|
QString itemText = QString("%1 (%2,%3) (%4,%5,%6)")
|
||||||
|
.arg(curves_[currentCurveIndex_].name)
|
||||||
|
.arg(curves_[currentCurveIndex_].Angular)
|
||||||
|
.arg(curves_[currentCurveIndex_].Radial)
|
||||||
|
.arg(curves_[currentCurveIndex_].color.red())
|
||||||
|
.arg(curves_[currentCurveIndex_].color.green())
|
||||||
|
.arg(curves_[currentCurveIndex_].color.blue());
|
||||||
|
|
||||||
|
item->setText(itemText);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -31,6 +31,26 @@ protected:
|
|||||||
bool validateSpecificParams() override;
|
bool validateSpecificParams() override;
|
||||||
void updateFileInfo(const QString& filePath) override;
|
void updateFileInfo(const QString& filePath) override;
|
||||||
|
|
||||||
|
private slots:
|
||||||
|
void onColorButtonClicked();
|
||||||
|
void onAddCurveClicked();
|
||||||
|
void onRemoveCurveClicked();
|
||||||
|
void onCurveListWidgetItemClicked(class QListWidgetItem* item);
|
||||||
|
void onCurveSelectionChanged();
|
||||||
|
void onCurveNameChanged();
|
||||||
|
void onCurveDataChanged();
|
||||||
|
void onSure();
|
||||||
|
|
||||||
|
private:
|
||||||
|
void setupConnections();
|
||||||
|
void updateColorPreview(const QColor& color);
|
||||||
|
void updateCurveProperties();
|
||||||
|
void saveCurveProperties();
|
||||||
|
void clearCurveProperties();
|
||||||
|
void enableCurveProperties(bool enabled);
|
||||||
|
QString generateCurveName();
|
||||||
|
QColor generateCurveColor() const;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::AddPolarDlg* ui;
|
Ui::AddPolarDlg* ui;
|
||||||
int currentCurveIndex_;
|
int currentCurveIndex_;
|
||||||
|
|||||||
@ -372,7 +372,7 @@
|
|||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
<property name="alternatingRowColors">
|
<property name="alternatingRowColors">
|
||||||
<bool>true</bool>
|
<bool>false</bool>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user