modified listwgt
This commit is contained in:
parent
bbb9323e09
commit
71444e3a41
@ -327,8 +327,8 @@ QString CurvePanel::GetTypeDisplayName() const
|
||||
|
||||
void CurvePanel::initQChartView() {
|
||||
curveChartView = new FitCurveChartView(this);
|
||||
curveChartView->setMaximumWidth(1730);
|
||||
curveChartView->setMinimumHeight(480);
|
||||
//curveChartView->setMaximumWidth(1730);
|
||||
//curveChartView->setMinimumHeight(480);
|
||||
|
||||
curveChart = new QChart();
|
||||
curveChart->setTheme(QChart::ChartThemeBlueIcy);
|
||||
|
||||
@ -19,8 +19,18 @@ struct CurveColorData : public BaseCurveData {
|
||||
};
|
||||
|
||||
struct CurveData : public CurveColorData {
|
||||
double start;
|
||||
double stop;
|
||||
int start;
|
||||
int stop;
|
||||
int x;
|
||||
int y;
|
||||
|
||||
CurveData()
|
||||
{
|
||||
start = 0;
|
||||
stop = 0;
|
||||
x = 0;
|
||||
y = 0;
|
||||
}
|
||||
};
|
||||
|
||||
struct TableCurveData : public CurveColorData {
|
||||
@ -59,6 +69,7 @@ public:
|
||||
double yMin;
|
||||
double yMax;
|
||||
int xCount;
|
||||
int yCount;
|
||||
QList<CurveData> curves;
|
||||
|
||||
FileEntryType getType() const override { return FileEntryType::Curve; }
|
||||
|
||||
@ -133,34 +133,37 @@ bool WorkSpaceXMLParse::ParseFiles(const tinyxml2::XMLElement* element) {
|
||||
|
||||
// Parse curve-specific attributes
|
||||
if (const char* chartName = chartElement->Attribute("name")) {
|
||||
curveChart->name = QString::fromLocal8Bit(chartName);
|
||||
curveChart->name = QString(chartName);
|
||||
}
|
||||
if (const char* path = chartElement->Attribute("path")) {
|
||||
curveChart->path = QString::fromLocal8Bit(path);
|
||||
curveChart->path = QString(path);
|
||||
}
|
||||
if (const char* xTitle = chartElement->Attribute("xTitle")) {
|
||||
curveChart->xTitle = QString::fromLocal8Bit(xTitle);
|
||||
curveChart->xTitle = QString(xTitle);
|
||||
}
|
||||
if (const char* yTitle = chartElement->Attribute("yTitle")) {
|
||||
curveChart->yTitle = QString::fromLocal8Bit(yTitle);
|
||||
curveChart->yTitle = QString(yTitle);
|
||||
}
|
||||
if (const char* xMin = chartElement->Attribute("xMin")) {
|
||||
curveChart->xMin = QString::fromLocal8Bit(xMin).toDouble();
|
||||
curveChart->xMin = QString(xMin).toDouble();
|
||||
}
|
||||
if (const char* xMax = chartElement->Attribute("xMax")) {
|
||||
curveChart->xMax = QString::fromLocal8Bit(xMax).toDouble();
|
||||
curveChart->xMax = QString(xMax).toDouble();
|
||||
}
|
||||
if (const char* yMin = chartElement->Attribute("yMin")) {
|
||||
curveChart->yMin = QString::fromLocal8Bit(yMin).toDouble();
|
||||
curveChart->yMin = QString(yMin).toDouble();
|
||||
}
|
||||
if (const char* yMax = chartElement->Attribute("yMax")) {
|
||||
curveChart->yMax = QString::fromLocal8Bit(yMax).toDouble();
|
||||
curveChart->yMax = QString(yMax).toDouble();
|
||||
}
|
||||
if (const char* xCount = chartElement->Attribute("xCount")) {
|
||||
curveChart->xCount = QString::fromLocal8Bit(xCount).toInt();
|
||||
curveChart->xCount = QString(xCount).toInt();
|
||||
}
|
||||
if (const char* yCount = chartElement->Attribute("yCount")) {
|
||||
curveChart->yCount = QString(yCount).toInt();
|
||||
}
|
||||
if (const char* t = chartElement->Attribute("t")) {
|
||||
curveChart->t = QString::fromLocal8Bit(t);
|
||||
curveChart->t = QString(t);
|
||||
}
|
||||
|
||||
// Parse curve elements
|
||||
@ -169,16 +172,22 @@ bool WorkSpaceXMLParse::ParseFiles(const tinyxml2::XMLElement* element) {
|
||||
CurveData curveData;
|
||||
|
||||
if (const char* curveName = curveElement->Attribute("name")) {
|
||||
curveData.name = QString::fromLocal8Bit(curveName);
|
||||
curveData.name = QString(curveName);
|
||||
}
|
||||
if (const char* color = curveElement->Attribute("color")) {
|
||||
curveData.color = QString::fromLocal8Bit(color);
|
||||
curveData.color = QString(color);
|
||||
}
|
||||
if (const char* start = curveElement->Attribute("start")) {
|
||||
curveData.start = QString::fromLocal8Bit(start).toDouble();
|
||||
curveData.start = QString(start).toInt();
|
||||
}
|
||||
if (const char* stop = curveElement->Attribute("stop")) {
|
||||
curveData.stop = QString::fromLocal8Bit(stop).toDouble();
|
||||
curveData.stop = QString(stop).toInt();
|
||||
}
|
||||
if (const char* stop = curveElement->Attribute("x")) {
|
||||
curveData.x = QString(stop).toInt();
|
||||
}
|
||||
if (const char* stop = curveElement->Attribute("y")) {
|
||||
curveData.y = QString(stop).toInt();
|
||||
}
|
||||
|
||||
curveChart->curves.append(curveData);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user