解释结论道的操作,保存slf文件。
This commit is contained in:
parent
cd829e4692
commit
7e5f4874da
|
|
@ -87,6 +87,7 @@ QString TransparentGroupResult::getIconName(const QMap<QString, QString>& zoneOr
|
|||
|
||||
}
|
||||
}
|
||||
|
||||
if (iconshotname != "") {
|
||||
result = ::GetOilSymbolDir() + iconshotname + ".svg";
|
||||
QDir fexit;
|
||||
|
|
@ -101,6 +102,7 @@ void TransparentGroupResult::addAllResultToPlot(LAYER_DATA* pResult)
|
|||
QMap<QString, QString> zoneOrder = GetZoneOrder();//初始化ZoneOrder 层序号根据层位名来,配置文件在conf\\RESULT.txt
|
||||
|
||||
m_Remark = GBKToUTF8(pResult->Description10);
|
||||
m_nResult = pResult->Result;
|
||||
//
|
||||
QDir fexit;
|
||||
QString result_str = QString::number(pResult->Result);
|
||||
|
|
@ -183,6 +185,11 @@ QString TransparentGroupResult::getRemark()
|
|||
return m_Remark;
|
||||
}
|
||||
|
||||
int TransparentGroupResult::getNResult()
|
||||
{
|
||||
return m_nResult;
|
||||
}
|
||||
|
||||
//设置解释结论
|
||||
void TransparentGroupResult::setResult(QString filePath)
|
||||
{
|
||||
|
|
@ -922,6 +929,7 @@ void TransparentGroupResult::onMouseRelease(QMouseEvent *event)
|
|||
}
|
||||
}
|
||||
mPlot->replot();
|
||||
mPlot->SaveToSLF_Result();
|
||||
}
|
||||
|
||||
onMouseRelease_in(event);
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ public:
|
|||
void setRemark(QString remark);
|
||||
QString getRemark();
|
||||
|
||||
int getNResult();
|
||||
//设置解释结论
|
||||
void setResult(QString filePath);
|
||||
|
||||
|
|
@ -129,7 +130,7 @@ private:
|
|||
|
||||
QString m_Result;
|
||||
QString m_Remark="";
|
||||
|
||||
int m_nResult;
|
||||
bool m_bSelect = false;
|
||||
|
||||
DragMode mDragMode = DragNone;
|
||||
|
|
|
|||
|
|
@ -6901,6 +6901,7 @@ void QMyCustomPlot::DeleteItemGroup()
|
|||
continue;
|
||||
pGroup->removeAllResult();
|
||||
}
|
||||
SaveToSLF_Result();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -6928,6 +6929,284 @@ void QMyCustomPlot::updateGroupZone()
|
|||
nZid++;
|
||||
}
|
||||
this->replot();
|
||||
|
||||
SaveToSLF_Result();
|
||||
}
|
||||
|
||||
bool QMyCustomPlot::SaveToSLF_Result()
|
||||
{
|
||||
static int isrun = false;
|
||||
if (isrun) return false;
|
||||
QString ss = m_strSlfName;
|
||||
if (ss == "") return false;
|
||||
isrun = true;
|
||||
|
||||
CMemRdWt *logio = new CMemRdWt();
|
||||
if (ss == "" || !logio->Open(ss.toStdString().c_str(), CSlfIO::modeReadWrite))
|
||||
{
|
||||
delete logio;
|
||||
QMessageBox::information(NULL, "提示", "SLF文件打开失败,请检查!!", QMessageBox::Yes);
|
||||
isrun = false;
|
||||
return false;
|
||||
}
|
||||
int resultGroupSize = m_mapDragGroup.size();
|
||||
bool isfirst = false;
|
||||
int iIndex = logio->OpenTable(m_strLineName.toStdString().c_str());
|
||||
if (iIndex < 0)
|
||||
{
|
||||
if (!resultGroupSize) {
|
||||
delete logio;
|
||||
isrun = false;
|
||||
return false;
|
||||
}
|
||||
iIndex = logio->Open_Set_Table(m_strLineName.toStdString().c_str(), 0, 35,
|
||||
"NO,SDEP,EDEP,ZONE,RESULTNO,THICK,TT,MDEPTH1,MDEPTH2,MDEPTH3,MDEPTH4,MDEPTH5,MDEPTH6,MDEPTH7,MDEPTH8,MDEPTH9,MDEPTH10,OIL,POOROIL,OILWATER,WATEROIL,GAS,POORGAS,GASWATER,WATERGAS,DEST1,DEST2,DEST3,DEST4,DEST5,DEST6,DEST7,DEST8,DEST9,DEST10,SDEP1,EDEP1,SDEP2,EDEP2,SDEP3,EDEP3,SDEP4,EDEP4,SDEP5,EDEP5,SDEP6,EDEP6,SDEP7,EDEP7,SDEP8,EDEP8,SDEP9,EDEP9,SDEP10,EDEP10",
|
||||
"4,4,4,8,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,48,48,48,48,48,48,48,48,48,48,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4",//字段长度
|
||||
"1,4,4,6,1,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,6,6,6,6,6,6,6,6,6,6,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4,4",//字段类型
|
||||
"0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0");//字段备注
|
||||
isfirst = true;
|
||||
}
|
||||
logio->SetTableRecordCount(iIndex, resultGroupSize);//-nn);
|
||||
if (!resultGroupSize) {
|
||||
delete logio;
|
||||
//if (isfirst)AddTableToWellRound();
|
||||
isrun = false;
|
||||
return false;
|
||||
}
|
||||
QMap<QString, QString> zoneOrder = GetZoneOrder();
|
||||
|
||||
LAYER_DATA m_Result;
|
||||
QMap<double, TransparentGroupResult*> mapSortGroup;
|
||||
QMap<QString, QObject*>::iterator it = m_mapDragGroup.begin();
|
||||
for (; it != m_mapDragGroup.end(); ++it)
|
||||
{
|
||||
TransparentGroupResult *pGroup = qobject_cast<TransparentGroupResult *>(it.value());
|
||||
if (pGroup == nullptr)
|
||||
continue;
|
||||
|
||||
mapSortGroup.insert(pGroup->getRange().upper, pGroup);
|
||||
}
|
||||
|
||||
QList<TransparentGroupResult*> listGroup = mapSortGroup.values();
|
||||
for (int i = 0; i < listGroup.size(); i++)
|
||||
{
|
||||
TransparentGroupResult* pGroup = listGroup.at(i);
|
||||
if (pGroup == NULL)
|
||||
continue;
|
||||
|
||||
memset(&m_Result, 0, sizeof(LAYER_DATA));
|
||||
m_Result.StartDepth = -pGroup->getRange().upper;
|
||||
m_Result.EndDepth = -pGroup->getRange().lower;
|
||||
|
||||
m_Result.Result = pGroup->getNResult();
|
||||
|
||||
const QVector<QString>& vec = pGroup->getVecResult();
|
||||
const QMap<QString, QObject*>& mapResult = pGroup->getMapDraggable_Result();
|
||||
QVector<double> vecDepth;
|
||||
QVector<int> vecResult;
|
||||
//vecDepth << 0.0;
|
||||
//vecResult << 0;
|
||||
//QString strRet = "";
|
||||
for (int k = 0; k < vec.size(); k++)
|
||||
{
|
||||
TransparentDraggableResult* pret = qobject_cast<TransparentDraggableResult*>(mapResult.value(vec.at(k)));
|
||||
if (pret == NULL)
|
||||
continue;
|
||||
QCPRange rg = pret->getRange();
|
||||
vecDepth << -rg.upper;
|
||||
QFileInfo finfo(pret->getResult());
|
||||
QString s = zoneOrder.value(finfo.baseName());
|
||||
//QString str = QString("%1").arg(s.toInt(), 2, 10, QChar('0'));
|
||||
//strRet += str;
|
||||
vecResult << s.toInt();
|
||||
}
|
||||
QByteArray btzone = UTF8ToGBK(pGroup->getTitle());
|
||||
strcpy(m_Result.Zone, btzone.data());
|
||||
QByteArray btrmk = UTF8ToGBK(pGroup->getRemark());
|
||||
strcpy(m_Result.Description10, btrmk.data());
|
||||
//strcpy(m_Result.szResult, strRet.toStdString().c_str());
|
||||
m_Result.Result = 0;
|
||||
int n = vecDepth.size();
|
||||
if (n > 0)
|
||||
{
|
||||
m_Result.Result = 10 * m_Result.Result + vecResult.at(0);
|
||||
}
|
||||
if (n > 1)
|
||||
{
|
||||
m_Result.MDepth1 = vecDepth.at(1);
|
||||
m_Result.Result = 10 * m_Result.Result + vecResult.at(1);
|
||||
}
|
||||
if (n > 2)
|
||||
{
|
||||
m_Result.MDepth2 = vecDepth.at(2);
|
||||
m_Result.Result = 10 * m_Result.Result + vecResult.at(2);
|
||||
}
|
||||
if (n > 3)
|
||||
{
|
||||
m_Result.MDepth3 = vecDepth.at(3);
|
||||
m_Result.Result = 10 * m_Result.Result + vecResult.at(3);
|
||||
}
|
||||
if (n > 4)
|
||||
{
|
||||
m_Result.MDepth4 = vecDepth.at(4);
|
||||
m_Result.Result = 10 * m_Result.Result + vecResult.at(4);
|
||||
}
|
||||
if (n > 5)
|
||||
{
|
||||
m_Result.MDepth5 = vecDepth.at(5);
|
||||
m_Result.Result = 10 * m_Result.Result + vecResult.at(5);
|
||||
}
|
||||
if (n > 6)
|
||||
{
|
||||
m_Result.MDepth6 = vecDepth.at(6);
|
||||
m_Result.Result = 10 * m_Result.Result + vecResult.at(6);
|
||||
}
|
||||
if (n > 7)
|
||||
{
|
||||
m_Result.MDepth7 = vecDepth.at(7);
|
||||
m_Result.Result = 10 * m_Result.Result + vecResult.at(7);
|
||||
}
|
||||
if (n > 8)
|
||||
{
|
||||
m_Result.MDepth8 = vecDepth.at(8);
|
||||
m_Result.Result = 10 * m_Result.Result + vecResult.at(8);
|
||||
}
|
||||
if (n > 9)
|
||||
{
|
||||
m_Result.MDepth9 = vecDepth.at(9);
|
||||
m_Result.Result = 10 * m_Result.Result + vecResult.at(9);
|
||||
}
|
||||
if (n > 10)
|
||||
{
|
||||
m_Result.MDepth10 = vecDepth.at(10);
|
||||
m_Result.Result = 10 * m_Result.Result + vecResult.at(10);
|
||||
}
|
||||
logio->WriteTable(iIndex, i + 1, &m_Result);
|
||||
}
|
||||
/*
|
||||
foreach(WelllogItem*iter, items)
|
||||
{
|
||||
if (!iter) continue;
|
||||
memset(&m_Result, 0, sizeof(LAYER_DATA));
|
||||
m_Result.StartDepth = iter->GetTopDepth();
|
||||
m_Result.EndDepth = iter->GetBottomDepth();
|
||||
if (m_Result.EndDepth - m_Result.StartDepth <= 0) {
|
||||
continue;
|
||||
}
|
||||
OGResultItem* pResult = dynamic_cast<OGResultItem*>(iter);
|
||||
m_Result.Order = j;
|
||||
m_Result.Result = 0;
|
||||
m_Result.MDepth1 = pResult->m_MDepth1;
|
||||
m_Result.MDepth2 = pResult->m_MDepth2;
|
||||
m_Result.MDepth3 = pResult->m_MDepth3;
|
||||
m_Result.MDepth4 = pResult->m_MDepth4;
|
||||
m_Result.MDepth5 = pResult->m_MDepth5;
|
||||
m_Result.MDepth6 = pResult->m_MDepth6;
|
||||
m_Result.MDepth7 = pResult->m_MDepth7;
|
||||
m_Result.MDepth8 = pResult->m_MDepth8;
|
||||
m_Result.MDepth9 = pResult->m_MDepth9;
|
||||
m_Result.MDepth10 = pResult->m_MDepth10;
|
||||
|
||||
QString innerresult = pResult->GetIntResult();
|
||||
if (innerresult != "") m_Result.Result = innerresult.toInt();
|
||||
if (m_Result.Result < 0) m_Result.Result = 0;
|
||||
innerresult = pResult->GetIntResult1();
|
||||
if (innerresult != ""&&m_Result.MDepth1)
|
||||
{
|
||||
m_Result.Result = 10 * m_Result.Result + innerresult.toInt();
|
||||
}
|
||||
innerresult = pResult->GetIntResult2();
|
||||
if (innerresult != ""&&m_Result.MDepth2)
|
||||
{
|
||||
m_Result.Result = 10 * m_Result.Result + innerresult.toInt();
|
||||
}
|
||||
innerresult = pResult->GetIntResult3();
|
||||
if (innerresult != ""&&m_Result.MDepth3) {
|
||||
m_Result.Result = m_Result.Result * 10 + innerresult.toInt();
|
||||
}
|
||||
innerresult = pResult->GetIntResult4();
|
||||
if (innerresult != ""&&m_Result.MDepth4) {
|
||||
m_Result.Result = m_Result.Result * 10 + innerresult.toInt();
|
||||
}
|
||||
innerresult = pResult->GetIntResult5();
|
||||
if (innerresult != ""&&m_Result.MDepth5) {
|
||||
m_Result.Result = m_Result.Result * 10 + innerresult.toInt();
|
||||
}
|
||||
innerresult = pResult->GetIntResult6();
|
||||
if (innerresult != ""&&m_Result.MDepth6) {
|
||||
m_Result.Result = m_Result.Result * 10 + innerresult.toInt();
|
||||
}
|
||||
innerresult = pResult->GetIntResult7();
|
||||
if (innerresult != ""&&m_Result.MDepth7) {
|
||||
m_Result.Result = m_Result.Result * 10 + innerresult.toInt();
|
||||
}
|
||||
innerresult = pResult->GetIntResult8();
|
||||
if (innerresult != ""&&m_Result.MDepth8) {
|
||||
m_Result.Result = m_Result.Result * 10 + innerresult.toInt();
|
||||
}
|
||||
innerresult = pResult->GetIntResult9();
|
||||
if (innerresult != ""&&m_Result.MDepth9) {
|
||||
m_Result.Result = m_Result.Result * 10 + innerresult.toInt();
|
||||
}
|
||||
innerresult = pResult->GetIntResult10();
|
||||
if (innerresult != ""&&m_Result.MDepth10) {
|
||||
m_Result.Result = m_Result.Result * 10 + innerresult.toInt();
|
||||
}
|
||||
strcpy(m_Result.Zone, pResult->Zone.toStdString().c_str());
|
||||
ComputeTT(m_Result,
|
||||
pResult->result,
|
||||
pResult->result1,
|
||||
pResult->result2,
|
||||
pResult->result3,
|
||||
pResult->result4,
|
||||
pResult->result5,
|
||||
pResult->result6,
|
||||
pResult->result7,
|
||||
pResult->result8,
|
||||
pResult->result9,
|
||||
pResult->result10
|
||||
);
|
||||
strcpy(m_Result.Description1, pResult->Description1.toStdString().c_str());
|
||||
strcpy(m_Result.Description2, pResult->Description2.toStdString().c_str());
|
||||
strcpy(m_Result.Description3, pResult->Description3.toStdString().c_str());
|
||||
strcpy(m_Result.Description4, pResult->Description4.toStdString().c_str());
|
||||
strcpy(m_Result.Description5, pResult->Description5.toStdString().c_str());
|
||||
strcpy(m_Result.Description6, pResult->Description6.toStdString().c_str());
|
||||
strcpy(m_Result.Description7, pResult->Description7.toStdString().c_str());
|
||||
strcpy(m_Result.Description8, pResult->Description8.toStdString().c_str());
|
||||
strcpy(m_Result.Description9, pResult->Description9.toStdString().c_str());
|
||||
strcpy(m_Result.Description10, pResult->Description10.toStdString().c_str());
|
||||
|
||||
m_Result.Sdep1 = pResult->m_SDEP1;
|
||||
m_Result.Edep1 = pResult->m_EDEP1;
|
||||
m_Result.Sdep2 = pResult->m_SDEP2;
|
||||
m_Result.Edep2 = pResult->m_EDEP2;
|
||||
m_Result.Sdep3 = pResult->m_SDEP3;
|
||||
m_Result.Edep3 = pResult->m_EDEP3;
|
||||
m_Result.Sdep4 = pResult->m_SDEP4;
|
||||
m_Result.Edep4 = pResult->m_EDEP4;
|
||||
m_Result.Sdep5 = pResult->m_SDEP5;
|
||||
m_Result.Edep5 = pResult->m_EDEP5;
|
||||
m_Result.Sdep6 = pResult->m_SDEP6;
|
||||
m_Result.Edep6 = pResult->m_EDEP6;
|
||||
m_Result.Sdep7 = pResult->m_SDEP7;
|
||||
m_Result.Edep7 = pResult->m_EDEP7;
|
||||
m_Result.Sdep8 = pResult->m_SDEP8;
|
||||
m_Result.Edep8 = pResult->m_EDEP8;
|
||||
m_Result.Sdep9 = pResult->m_SDEP9;
|
||||
m_Result.Edep9 = pResult->m_EDEP9;
|
||||
m_Result.Sdep10 = pResult->m_SDEP10;
|
||||
m_Result.Edep10 = pResult->m_EDEP10;
|
||||
|
||||
logio->WriteTable(iIndex, j + 1, &m_Result);
|
||||
j++;
|
||||
}
|
||||
*/
|
||||
logio->CloseTable(iIndex);
|
||||
delete logio;
|
||||
isrun = false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
TransparentGroupResult* QMyCustomPlot::getCurGroupResult(double x_val)
|
||||
|
|
@ -6976,6 +7255,8 @@ void QMyCustomPlot::segmentationInnerLayer()
|
|||
return;
|
||||
pClickGroup->segmentationInnerLayer(x_val);
|
||||
|
||||
SaveToSLF_Result();
|
||||
|
||||
}
|
||||
|
||||
void QMyCustomPlot::segmentationIndependentLayer()
|
||||
|
|
@ -7067,7 +7348,7 @@ void QMyCustomPlot::segmentationIndependentLayer()
|
|||
}
|
||||
pClickGroup->removeAllResult();
|
||||
this->replot();
|
||||
|
||||
SaveToSLF_Result();
|
||||
}
|
||||
|
||||
void QMyCustomPlot::splitIndependentLayer()
|
||||
|
|
@ -7086,6 +7367,7 @@ void QMyCustomPlot::splitIndependentLayer()
|
|||
// 删除原来的复合层
|
||||
pClickGroup->removeAllResult();
|
||||
this->replot();
|
||||
SaveToSLF_Result();
|
||||
}
|
||||
|
||||
void QMyCustomPlot::megResultLayer()
|
||||
|
|
@ -7146,6 +7428,7 @@ void QMyCustomPlot::megResultLayer()
|
|||
pNewG->addResultToPlot(r.first.lower, r.first.upper, r.second, strUuid);
|
||||
}
|
||||
this->replot();
|
||||
SaveToSLF_Result();
|
||||
}
|
||||
|
||||
bool QMyCustomPlot::getIsEditor()
|
||||
|
|
|
|||
|
|
@ -406,6 +406,8 @@ public slots:
|
|||
void DeleteItemGroup();
|
||||
void updateGroupZone(); //更新层号
|
||||
|
||||
bool SaveToSLF_Result();
|
||||
|
||||
TransparentGroupResult* getCurGroupResult(double x_val);
|
||||
// 筛选出选中的Group, 并且排序
|
||||
QMap<double, TransparentGroupResult*> getSelectGroupResult();
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user