/* * WellLogModule.cpp * * Created on: 2014.7.14 * Author: hudongfang */ #pragma warning( push ,0) #include #include "RunTimeContext.h" // #include "WelllogCurve.h" //#include "BaseObject.h" #include "ObjWelllog.h" // #include "ObjProject.h" #include "ObjWelllogRound.h" // #include "ConsoleOutputWidget.h" #pragma warning( pop ) using namespace std; using namespace pai::datamodel; CRunTimeContext::CRunTimeContext() :m_pParentWellRound(NULL) { // ObjOGResult=new CObjOGResult(); // ObjOGResult->SetName("OgResult"); } CRunTimeContext::~CRunTimeContext() { } CObjWellLog* CRunTimeContext::GetlogCurve(std::string logFilePath, bool bIsInputCurve) { return NULL; // std::map::iterator iter; // iter = m_LogcurveContainer.find(logFilePath);//先从缓存中查找 // if (iter == m_LogcurveContainer.end())//找不到则从树上查找,放入缓存 // { // pai::datamodel::CObjWellLog* pCurve=NULL; // // if(!m_pParentWellRound) // // AppendConsole(pai::log::PAI_ERROR,"井次不正常!"); // if(bIsInputCurve&&m_pParentWellRound) // { // pCurve=m_pParentWellRound->GetWellLogByName(QString::fromStdString(logFilePath)); // } // else { // pCurve=new CObjWellLog(); // if(m_pParentWellRound)pCurve->SetWell(m_pParentWellRound->GetWell()); // } // if (pCurve) // { // m_LogcurveContainer.insert(std::pair(logFilePath,pCurve)); // } // return pCurve; // } // else // { // return iter->second; // } } void CRunTimeContext::SaveLogCurve( std::string outFilePath, pai::datamodel::CObjWellLog*pWelllogCurve ) { if(m_LogcurveContainer.size()<=0) { m_LogcurveContainer.insert( std::pair(outFilePath,pWelllogCurve) ); return; } std::map::iterator iter; iter = m_LogcurveContainer.find(outFilePath); if (iter != m_LogcurveContainer.end() ) m_LogcurveContainer.erase(iter); m_LogcurveContainer.insert( std::pair(outFilePath,pWelllogCurve) ); //TODO 防止解释结论多次上树 // if(ObjOGResult->GetItemCount()>0)//存在解释结论的情况下才上树 // m_LogcurveContainer.insert( std::pair("OgResult",ObjOGResult) ); } CObjWelllogRound * CRunTimeContext::GetCurrentWellRound() { return m_pParentWellRound; } std::map& CRunTimeContext::GetLogCurveContainer() { return m_LogcurveContainer; }