|
@@ -2,6 +2,7 @@
|
|
|
|
|
|
#include "ProjectManager.h"
|
|
|
#include "SchemePlanManager.h"
|
|
|
+#include "CMindView.h"
|
|
|
|
|
|
#include <view/PlotView.h>
|
|
|
|
|
@@ -231,6 +232,48 @@ void ExportReportManager::insertDemandIndex()
|
|
|
}
|
|
|
|
|
|
delete mind;
|
|
|
+
|
|
|
+ CMindView *m = new CMindView();
|
|
|
+ m->setNodeList(nodeList);
|
|
|
+ m->refreshItems();
|
|
|
+
|
|
|
+ int sceneWidth = m->sceneRect().width();
|
|
|
+ int sceneHeight = m->sceneRect().height();
|
|
|
+ QRectF sourceRect = QRectF(0, 0, sceneWidth, sceneHeight);
|
|
|
+ QRectF targetRect = QRectF(10, 10, sceneWidth, sceneHeight);
|
|
|
+
|
|
|
+ QPixmap pixmap(QSize(sceneWidth + 20, sceneHeight + 20));
|
|
|
+ pixmap.fill(QColor(244, 244, 255));
|
|
|
+ QPainter painter(&pixmap);
|
|
|
+ painter.setRenderHints(QPainter::Antialiasing);
|
|
|
+ m->scene()->render(&painter, targetRect, sourceRect);
|
|
|
+ delete m;
|
|
|
+
|
|
|
+ QString imgName = QString("%1_%2_index").arg(m_proj->id).arg(1);
|
|
|
+ QString path = saveImage(imgName, pixmap);
|
|
|
+
|
|
|
+ QImageWriter writer(path);
|
|
|
+ writer.setFormat("PNG");
|
|
|
+ ret = writer.write(pixmap.toImage());
|
|
|
+ if (ret) {
|
|
|
+ QAxObject *bmWeightPic = m_word->getDocument()->querySubObject("Bookmarks(QVariant)", "bmIndexPic");
|
|
|
+ if (bmWeightPic != nullptr) {
|
|
|
+ bmWeightPic->dynamicCall("Select(void)");
|
|
|
+ QAxObject *range = bmWeightPic->querySubObject("Range");
|
|
|
+ QAxObject *inlineShapes = range->querySubObject("InlineShapes");
|
|
|
+ QAxObject *shape = inlineShapes->querySubObject("AddPicture(const QString&)", path);
|
|
|
+ if (shape != nullptr) {
|
|
|
+ int w = pixmap.width();
|
|
|
+ int h = pixmap.height();
|
|
|
+ if (w > 400) {
|
|
|
+ h = h * 400 / w;
|
|
|
+ w = 400;
|
|
|
+ }
|
|
|
+ shape->setProperty("Width", w);
|
|
|
+ shape->setProperty("Height", h);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
void ExportReportManager::insertDemandTechIndex()
|
|
@@ -282,6 +325,48 @@ void ExportReportManager::insertDemandTechIndex()
|
|
|
}
|
|
|
|
|
|
delete mind;
|
|
|
+
|
|
|
+ CMindView *m = new CMindView();
|
|
|
+ m->setNodeList(nodeList);
|
|
|
+ m->refreshItems();
|
|
|
+
|
|
|
+ int sceneWidth = m->sceneRect().width();
|
|
|
+ int sceneHeight = m->sceneRect().height();
|
|
|
+ QRectF sourceRect = QRectF(0, 0, sceneWidth, sceneHeight);
|
|
|
+ QRectF targetRect = QRectF(10, 10, sceneWidth, sceneHeight);
|
|
|
+
|
|
|
+ QPixmap pixmap(QSize(sceneWidth + 20, sceneHeight + 20));
|
|
|
+ pixmap.fill(QColor(244, 244, 255));
|
|
|
+ QPainter painter(&pixmap);
|
|
|
+ painter.setRenderHints(QPainter::Antialiasing);
|
|
|
+ m->scene()->render(&painter, targetRect, sourceRect);
|
|
|
+ delete m;
|
|
|
+
|
|
|
+ QString imgName = QString("%1_%2_index").arg(m_proj->id).arg(2);
|
|
|
+ QString path = saveImage(imgName, pixmap);
|
|
|
+
|
|
|
+ QImageWriter writer(path);
|
|
|
+ writer.setFormat("PNG");
|
|
|
+ ret = writer.write(pixmap.toImage());
|
|
|
+ if (ret) {
|
|
|
+ QAxObject *bmWeightPic = m_word->getDocument()->querySubObject("Bookmarks(QVariant)", "bmTechPic");
|
|
|
+ if (bmWeightPic != nullptr) {
|
|
|
+ bmWeightPic->dynamicCall("Select(void)");
|
|
|
+ QAxObject *range = bmWeightPic->querySubObject("Range");
|
|
|
+ QAxObject *inlineShapes = range->querySubObject("InlineShapes");
|
|
|
+ QAxObject *shape = inlineShapes->querySubObject("AddPicture(const QString&)", path);
|
|
|
+ if (shape != nullptr) {
|
|
|
+ int w = pixmap.width();
|
|
|
+ int h = pixmap.height();
|
|
|
+ if (w > 400) {
|
|
|
+ h = h * 400 / w;
|
|
|
+ w = 400;
|
|
|
+ }
|
|
|
+ shape->setProperty("Width", w);
|
|
|
+ shape->setProperty("Height", h);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
void ExportReportManager::insertDemandWeight()
|
|
@@ -371,7 +456,7 @@ void ExportReportManager::insertDemandWeight()
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- QString imgName = QString("%1_%2_weight").arg(m_proj->id).arg(1);
|
|
|
+ QString imgName = QString("%1_%2_weight_plot").arg(m_proj->id).arg(1);
|
|
|
QString path = saveImage(imgName, pixmap);
|
|
|
|
|
|
QAxObject *bmWeightPic = m_word->getDocument()->querySubObject("Bookmarks(QVariant)", "bmWeightPic");
|
|
@@ -469,7 +554,7 @@ void ExportReportManager::insertDemandEval()
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- QString imgName = QString("%1_%2_tech").arg(m_proj->id).arg(1);
|
|
|
+ QString imgName = QString("%1_%2_priority_plot").arg(m_proj->id).arg(1);
|
|
|
QString path = saveImage(imgName, pixmap);
|
|
|
|
|
|
QAxObject *bmWeightPic = m_word->getDocument()->querySubObject("Bookmarks(QVariant)", "bmEvalPic");
|
|
@@ -601,6 +686,48 @@ void ExportReportManager::insertSchemeIndex()
|
|
|
}
|
|
|
|
|
|
delete mind;
|
|
|
+
|
|
|
+ CMindView *m = new CMindView();
|
|
|
+ m->setNodeList(nodeList);
|
|
|
+ m->refreshItems();
|
|
|
+
|
|
|
+ int sceneWidth = m->sceneRect().width();
|
|
|
+ int sceneHeight = m->sceneRect().height();
|
|
|
+ QRectF sourceRect = QRectF(0, 0, sceneWidth, sceneHeight);
|
|
|
+ QRectF targetRect = QRectF(10, 10, sceneWidth, sceneHeight);
|
|
|
+
|
|
|
+ QPixmap pixmap(QSize(sceneWidth + 20, sceneHeight + 20));
|
|
|
+ pixmap.fill(QColor(244, 244, 255));
|
|
|
+ QPainter painter(&pixmap);
|
|
|
+ painter.setRenderHints(QPainter::Antialiasing);
|
|
|
+ m->scene()->render(&painter, targetRect, sourceRect);
|
|
|
+ delete m;
|
|
|
+
|
|
|
+ QString imgName = QString("%1_%2_index").arg(m_proj->id).arg(4);
|
|
|
+ QString path = saveImage(imgName, pixmap);
|
|
|
+
|
|
|
+ QImageWriter writer(path);
|
|
|
+ writer.setFormat("PNG");
|
|
|
+ ret = writer.write(pixmap.toImage());
|
|
|
+ if (ret) {
|
|
|
+ QAxObject *bmWeightPic = m_word->getDocument()->querySubObject("Bookmarks(QVariant)", "bmIndexPic");
|
|
|
+ if (bmWeightPic != nullptr) {
|
|
|
+ bmWeightPic->dynamicCall("Select(void)");
|
|
|
+ QAxObject *range = bmWeightPic->querySubObject("Range");
|
|
|
+ QAxObject *inlineShapes = range->querySubObject("InlineShapes");
|
|
|
+ QAxObject *shape = inlineShapes->querySubObject("AddPicture(const QString&)", path);
|
|
|
+ if (shape != nullptr) {
|
|
|
+ int w = pixmap.width();
|
|
|
+ int h = pixmap.height();
|
|
|
+ if (w > 400) {
|
|
|
+ h = h * 400 / w;
|
|
|
+ w = 400;
|
|
|
+ }
|
|
|
+ shape->setProperty("Width", w);
|
|
|
+ shape->setProperty("Height", h);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
void ExportReportManager::insertSchemeData()
|
|
@@ -839,7 +966,7 @@ void ExportReportManager::insertSchemeWeightData()
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- QString imgName = QString("%1_%2_weight").arg(m_proj->id).arg(4);
|
|
|
+ QString imgName = QString("%1_%2_weight_plot").arg(m_proj->id).arg(4);
|
|
|
QString path = saveImage(imgName, pixmap);
|
|
|
|
|
|
QAxObject *bmWeightPic = m_word->getDocument()->querySubObject("Bookmarks(QVariant)", "bmWeightPic");
|
|
@@ -910,6 +1037,48 @@ void ExportReportManager::insertEffiIndex()
|
|
|
}
|
|
|
|
|
|
delete mind;
|
|
|
+
|
|
|
+ CMindView *m = new CMindView();
|
|
|
+ m->setNodeList(nodeList);
|
|
|
+ m->refreshItems();
|
|
|
+
|
|
|
+ int sceneWidth = m->sceneRect().width();
|
|
|
+ int sceneHeight = m->sceneRect().height();
|
|
|
+ QRectF sourceRect = QRectF(0, 0, sceneWidth, sceneHeight);
|
|
|
+ QRectF targetRect = QRectF(10, 10, sceneWidth, sceneHeight);
|
|
|
+
|
|
|
+ QPixmap pixmap(QSize(sceneWidth + 20, sceneHeight + 20));
|
|
|
+ pixmap.fill(QColor(244, 244, 255));
|
|
|
+ QPainter painter(&pixmap);
|
|
|
+ painter.setRenderHints(QPainter::Antialiasing);
|
|
|
+ m->scene()->render(&painter, targetRect, sourceRect);
|
|
|
+ delete m;
|
|
|
+
|
|
|
+ QString imgName = QString("%1_%2_index").arg(m_proj->id).arg(8);
|
|
|
+ QString path = saveImage(imgName, pixmap);
|
|
|
+
|
|
|
+ QImageWriter writer(path);
|
|
|
+ writer.setFormat("PNG");
|
|
|
+ ret = writer.write(pixmap.toImage());
|
|
|
+ if (ret) {
|
|
|
+ QAxObject *bmWeightPic = m_word->getDocument()->querySubObject("Bookmarks(QVariant)", "bmIndexPic");
|
|
|
+ if (bmWeightPic != nullptr) {
|
|
|
+ bmWeightPic->dynamicCall("Select(void)");
|
|
|
+ QAxObject *range = bmWeightPic->querySubObject("Range");
|
|
|
+ QAxObject *inlineShapes = range->querySubObject("InlineShapes");
|
|
|
+ QAxObject *shape = inlineShapes->querySubObject("AddPicture(const QString&)", path);
|
|
|
+ if (shape != nullptr) {
|
|
|
+ int w = pixmap.width();
|
|
|
+ int h = pixmap.height();
|
|
|
+ if (w > 400) {
|
|
|
+ h = h * 400 / w;
|
|
|
+ w = 400;
|
|
|
+ }
|
|
|
+ shape->setProperty("Width", w);
|
|
|
+ shape->setProperty("Height", h);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
void ExportReportManager::insertEffiAlgInfo()
|
|
@@ -1210,7 +1379,7 @@ void ExportReportManager::insertEffiWeightData()
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
- QString imgName = QString("%1_%2_weight").arg(m_proj->id).arg(4);
|
|
|
+ QString imgName = QString("%1_%2_weight_plot").arg(m_proj->id).arg(8);
|
|
|
QString path = saveImage(imgName, pixmap);
|
|
|
|
|
|
QAxObject *bmWeightPic = m_word->getDocument()->querySubObject("Bookmarks(QVariant)", "bmWeightPic");
|