3027 lines
83 KiB
C++
3027 lines
83 KiB
C++
#include <sstream>
|
||
|
||
#include <cfloat>
|
||
#include <cmath>
|
||
#include "Property.h"
|
||
// #include "error.h"
|
||
// #include "DatasetMetaDataMgmt.h"
|
||
// #include "Geometry.h"
|
||
// #include "Grid.h"
|
||
// #include "VelModelMetaDataMgmt.h"
|
||
// #include "VelSpectrumMetaDataMgmt.h"
|
||
// #include "MetaDataFS.h"
|
||
#include "Utils.h"
|
||
// #include "DBProject.h"
|
||
// #include "ProjectMgmt.h"
|
||
// #include "DBSurvey.h"
|
||
// #include "SurveyMgmt.h"
|
||
// #include "DDPFile.h"
|
||
// #include "Log.h"
|
||
// #include "FirstArrivalInterface.h"
|
||
// #include "TraceEditInterface.h"
|
||
// #include "StaticData.h"
|
||
// #include "MuteDataInterface.h"
|
||
// #include "VelocityAnalysisInterface.h"
|
||
// #include "DBSurveySeisVelo.h"
|
||
// #include "LateralVelocityModelingInterface.h"
|
||
// #include "HorizonInterface.h"
|
||
// #include "GridVelModelingInterface.h"
|
||
#include "Const.h"
|
||
// #include "ShotAmplitudeInterface.h"
|
||
// #include "PathParser.h"
|
||
// #include "MetaDataInfo.h"
|
||
// #include "WorkflowSet.h"
|
||
|
||
using namespace pai::ios::property;
|
||
|
||
PropertyItem::PropertyItem():m_PropertyName(""),m_PropertyValue(""),m_Type(DATE),m_Unit(NOUNIT)
|
||
{
|
||
|
||
}
|
||
PropertyItem::~PropertyItem()
|
||
{
|
||
|
||
}
|
||
std::string PropertyItem::GetPropertyName() const
|
||
{
|
||
return m_PropertyName;
|
||
}
|
||
|
||
std::string PropertyItem::GetPropertyValue() const
|
||
{
|
||
return m_PropertyValue;
|
||
}
|
||
|
||
ItemType PropertyItem::GetType() const
|
||
{
|
||
return m_Type;
|
||
}
|
||
|
||
ItemUnit PropertyItem::GetUnit() const
|
||
{
|
||
return m_Unit;
|
||
}
|
||
|
||
void PropertyItem::SetPropertyName(const std::string & PropertyName)
|
||
{
|
||
this->m_PropertyName = PropertyName;
|
||
}
|
||
|
||
void PropertyItem::SetPropertyValue(const std::string & PropertyValue)
|
||
{
|
||
this->m_PropertyValue = PropertyValue;
|
||
}
|
||
|
||
void PropertyItem::SetType(const ItemType Type)
|
||
{
|
||
this->m_Type = Type;
|
||
}
|
||
|
||
void PropertyItem::SetUnit(const ItemUnit Unit)
|
||
{
|
||
this->m_Unit = Unit;
|
||
}
|
||
|
||
//-------------------------------------------
|
||
void Property::GetProperty(const long long id, const pai::ios::DATA_TYPE type, std::vector<std::vector<PropertyItem> > & itemgroup)
|
||
{
|
||
itemgroup.clear();
|
||
|
||
switch (type)
|
||
{
|
||
case pai::ios::SEIS:
|
||
GetSeisProperty(id, itemgroup);
|
||
break;
|
||
|
||
case pai::ios::GEOMETRY:
|
||
GetGeometryProperty(id, itemgroup);
|
||
break;
|
||
|
||
case pai::ios::GRID:
|
||
GetGridProperty(id, itemgroup);
|
||
break;
|
||
|
||
case pai::ios::VELOCITY_MODEL:
|
||
GetVelModelProperty(id, itemgroup);
|
||
break;
|
||
|
||
case pai::ios::VELOCITY_PAIR:
|
||
GetVelPairProperty(id, itemgroup);
|
||
break;
|
||
|
||
case pai::ios::FIRSTARRIVAL:
|
||
GetFirstArrivalProperty(id, itemgroup);
|
||
break;
|
||
|
||
case pai::ios::MUTE:
|
||
GetMuteProperty(id, itemgroup);
|
||
break;
|
||
|
||
case pai::ios::TRACE_EDIT:
|
||
GetTraceEditProperty(id, itemgroup);
|
||
break;
|
||
|
||
case pai::ios::STATICS_COMPUTE:
|
||
GetStaticsProperty(id, itemgroup);
|
||
break;
|
||
|
||
case pai::ios::HORIZON:
|
||
GetHorizonProperty(id, itemgroup);
|
||
break;
|
||
|
||
case pai::ios::MODELING:
|
||
GetModelingProperty(id, itemgroup);
|
||
break;
|
||
|
||
case pai::ios::SHOTPROPERTY:
|
||
GetShotProperty(id, itemgroup);
|
||
break;
|
||
|
||
case pai::ios::OPER:
|
||
GetOperationProperty(id, itemgroup);
|
||
break;
|
||
|
||
case pai::ios::SPECTRUMDATA:
|
||
GetVelAnalysisProperty(id, itemgroup);
|
||
break;
|
||
|
||
case pai::ios::LATERAL:
|
||
GetLaterProperty(id, itemgroup);
|
||
break;
|
||
|
||
case WORKFLOW:
|
||
GetWorkflowProperty(id, itemgroup);
|
||
break;
|
||
|
||
case JOB:
|
||
GetJobProperty(id, itemgroup);
|
||
break;
|
||
|
||
case JOBLOG:
|
||
GetJobLogProperty(id, itemgroup);
|
||
break;
|
||
|
||
case GRIDPROPERTY:
|
||
GetGridPropertyProperty(id, itemgroup);
|
||
break;
|
||
|
||
//以下为获取文件夹属性
|
||
case pai::ios::PROJECT_FOLDER:
|
||
GetProjectProperty(id, itemgroup);
|
||
break;
|
||
|
||
case pai::ios::SURVEY_FOLDER:
|
||
GetSurveyProperty(id, itemgroup);
|
||
break;
|
||
|
||
case WORKFLOW_FOLDER:
|
||
GetWorkflowFolderProperty(id, itemgroup);
|
||
break;
|
||
|
||
case SEISMICDATA_FOLDER:
|
||
GetSeisFolderProperty(id, itemgroup);
|
||
break;
|
||
|
||
case JOB_FOLDER:
|
||
GetJobFolderProperty(id, itemgroup);
|
||
break;
|
||
|
||
case GRID_FOLDER:
|
||
GetGridFolderProperty(id, itemgroup);
|
||
break;
|
||
|
||
case GEOMETRY_FOLDER:
|
||
GetGeometryFolderProperty(id, itemgroup);
|
||
break;
|
||
|
||
case PARAMETERSET_FOLDER:
|
||
GetParamFolderProperty(id, itemgroup);
|
||
break;
|
||
|
||
case FIRSTARRIVAL_FOLDER:
|
||
GetFirstArrivalFolderProperty(id, itemgroup);
|
||
break;
|
||
|
||
case MUTE_FOLDER:
|
||
GetMuteFolderProperty(id, itemgroup);
|
||
break;
|
||
|
||
case TRACEEDIT_FOLDER:
|
||
GetTraceEditFolderProperty(id, itemgroup);
|
||
break;
|
||
|
||
case STATICS_FOLDER:
|
||
GetStaticsFolderProperty(id, itemgroup);
|
||
break;
|
||
|
||
case HORIZON_FOLDER:
|
||
GetHorizonFolderProperty(id, itemgroup);
|
||
break;
|
||
|
||
case VELOCITY_FOLDER:
|
||
GetVelocityFolderProperty(id, itemgroup);
|
||
break;
|
||
|
||
case VELPAIR_FOLDER:
|
||
GetVelPairFolderProperty(id, itemgroup);
|
||
break;
|
||
|
||
case VELMODEL_FOLDER:
|
||
GetVelModelFolderProperty(id, itemgroup);
|
||
break;
|
||
|
||
case VELANA_FOLDER:
|
||
GetVelAnaFolderProperty(id, itemgroup);
|
||
break;
|
||
|
||
case MODELING_FOLDER:
|
||
GetModelingFolderProperty(id, itemgroup);
|
||
break;
|
||
|
||
case ATTRIBUTE_FOLDER:
|
||
GetAttributeFolderProperty(id, itemgroup);
|
||
break;
|
||
|
||
default:
|
||
std::stringstream errMsg;
|
||
errMsg << "The property type error. type is " << static_cast<int>(type) ;
|
||
// throw pai::error::invalid_argument (errMsg.str());
|
||
break;
|
||
}
|
||
}
|
||
|
||
|
||
void Property::GetProjectProperty (const long long id, std::vector<std::vector<PropertyItem> > & itemgroup)
|
||
{
|
||
// pai::ios::proj::Project pro;
|
||
// pai::ios::proj::ProjectMgmt promgmt;
|
||
// promgmt.GetProjectByID(id,pro);
|
||
|
||
// pai::ios::proj::SurveyMgmt mgmt;
|
||
// std::vector<pai::ios::proj::Survey> surveys;
|
||
// mgmt.GetSurveys(id, surveys);
|
||
|
||
// std::vector<PropertyItem> items;
|
||
// std::vector<PropertyItem> itemdetial;
|
||
|
||
// PropertyItem item;
|
||
|
||
// item.SetPropertyName(TYPE);
|
||
// item.SetPropertyValue(TYPE_PROJECT);
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// std::stringstream temp;
|
||
// item.SetPropertyName(DISK_PATH);
|
||
// temp << "/" << pro.GetDisplayName();
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
// temp.str("");
|
||
|
||
// item.SetPropertyName(SURVEY_COUNT);
|
||
// temp << surveys.size();
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
// temp.str("");
|
||
|
||
// //TODO:目前存在一定的扩展性问题,可能需要进一步修改
|
||
// item.SetPropertyName(SIZE);
|
||
// pai::ios::vfs::DDPFile ddpfile(pro.GetProjectPath() + pro.GetProjectName(),pai::ios::vfs::FSTYPE_LOCALFS);
|
||
// std::string Realsize;
|
||
// pai::ios::property::ItemUnit Unit;
|
||
// ChangeFileSizeUnit(ddpfile.GetDirectorySize(),Realsize,Unit);
|
||
// item.SetUnit(Unit);
|
||
// item.SetPropertyValue(Realsize);
|
||
// item.SetType(FLOAT);
|
||
// items.push_back(item);
|
||
// temp.str("");
|
||
|
||
// item.SetPropertyName(CREATE_TIME);
|
||
// temp << pro.GetCreatedTime() ;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(DATE);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
// temp.str("");
|
||
|
||
// item.SetPropertyName(CREATE_BY);
|
||
// temp << pro.GetCreateBy();
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
// temp.str("");
|
||
|
||
// item.SetPropertyName(MODIFY_TIME);
|
||
// temp << pro.GetModifiedTime() ;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(DATE);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
// temp.str("");
|
||
// //TODO:目前无法取得该属性值
|
||
// item.SetPropertyName(LAST_ACCESS_TIME);
|
||
// temp << pro.GetModifiedTime() ;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(DATE);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
// temp.str("");
|
||
|
||
// itemgroup.push_back(items);
|
||
// // itemgroup.push_back(itemdetial);
|
||
}
|
||
|
||
void Property::GetSurveyProperty (const long long id, std::vector<std::vector<PropertyItem> > & itemgroup)
|
||
{
|
||
// pai::ios::proj::Survey survey;
|
||
// pai::ios::proj::SurveyMgmt surmgmt;
|
||
// surmgmt.GetSurveyByID(id,survey);
|
||
|
||
// std::vector<PropertyItem> items;
|
||
// std::vector<PropertyItem> itemdetial;
|
||
|
||
// PropertyItem item;
|
||
|
||
// item.SetPropertyName(TYPE);
|
||
// std::stringstream temp;
|
||
// item.SetPropertyValue(TYPE_SURVEY);
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
// temp.str("");
|
||
|
||
// item.SetPropertyName(DISK_PATH);
|
||
// pai::ios::proj::Project pro;
|
||
// pai::ios::proj::ProjectMgmt promgmt;
|
||
// promgmt.GetProjectByID(survey.GetProjectID(),pro);
|
||
// temp << "/" << pro.GetDisplayName() << "/" << survey.GetDisplayName();
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
// temp.str("");
|
||
|
||
// item.SetPropertyName(SURVEY_TYPE);
|
||
// temp << GetSurveyTypeString(SurveyType(survey.GetSurveyTypeLand())) << ","
|
||
// << GetSurveyTypeString(SurveyType(survey.GetSurveyTypeDim()));
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
// temp.str("");
|
||
|
||
// item.SetPropertyName(CREATE_TIME);
|
||
// temp << survey.GetCreatedTime();
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(DATE);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
// temp.str("");
|
||
|
||
// item.SetPropertyName(CREATE_BY);
|
||
// temp << survey.GetCreateBy();
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
// temp.str("");
|
||
|
||
// item.SetPropertyName(MODIFY_TIME);
|
||
// temp << survey.GetModifiedTime();
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(DATE);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
// temp.str("");
|
||
// //TODO:目前无法取得该属性值
|
||
// item.SetPropertyName(LAST_ACCESS_TIME);
|
||
// temp << survey.GetModifiedTime();
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(DATE);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
// temp.str("");
|
||
|
||
// itemgroup.push_back(items);
|
||
// // itemgroup.push_back(itemdetial);
|
||
}
|
||
|
||
|
||
void Property::GetSeisProperty (const long long id, std::vector<std::vector<PropertyItem> > & itemgroup)
|
||
{
|
||
// pai::ios::metadata::MetaDataInfo smeta;
|
||
// pai::ios::metadata::DatasetMetaDataMgmt fm;
|
||
|
||
// fm.GetInfoByID(id, smeta);
|
||
|
||
// std::vector<PropertyItem> items;
|
||
// std::vector<PropertyItem> itemdetial;
|
||
|
||
// PropertyItem item;
|
||
|
||
// item.SetPropertyName(TYPE);
|
||
// item.SetPropertyValue(TYPE_SEISMIC);
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// item.SetPropertyName(DATA_NAME);
|
||
// std::stringstream temp;
|
||
// //////////////////////////////////////////////////
|
||
|
||
// item.SetPropertyName(DATA_NAME);
|
||
// std::stringstream fileLogicalPath;
|
||
// fileLogicalPath << pai::ios::PathParser::GetLogicalPath(smeta.m_SurveyID,pai::ios::SEIS)<< smeta.m_LogicalFileName;
|
||
// item.SetPropertyValue(fileLogicalPath.str());
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// item.SetPropertyName(DISK_PATH);
|
||
// std::stringstream diskpath;
|
||
// diskpath << smeta.m_PhysicalPath <<"/"
|
||
// <<smeta.m_LogicalFileName;
|
||
// item.SetPropertyValue(diskpath.str());
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// //TODO:目前存在一定的扩展性问题,可能需要进一步修改
|
||
// temp.str("");
|
||
// item.SetPropertyName(SIZE);
|
||
// std::string Realsize;
|
||
// pai::ios::property::ItemUnit Unit;
|
||
// ChangeFileSizeUnit(smeta.m_LogicalFileSize,Realsize,Unit);
|
||
// item.SetPropertyValue(Realsize);
|
||
// item.SetType(FLOAT);
|
||
// item.SetUnit(Unit);
|
||
// items.push_back(item);
|
||
|
||
// temp.str("");
|
||
// item.SetPropertyName(CREATE_TIME);
|
||
// temp << smeta.m_CreateTime ;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(DATE);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// item.SetPropertyName(CREATE_BY);
|
||
// item.SetPropertyValue(smeta.m_CreateBy);
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// temp.str("");
|
||
// item.SetPropertyName(MODIFY_TIME);
|
||
// temp << smeta.m_ModifiedTime ;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(DATE);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// temp.str("");
|
||
// //TODO:目前无法取得该属性值
|
||
// item.SetPropertyName(LAST_ACCESS_TIME);
|
||
// temp << smeta.m_ModifiedTime ;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(DATE);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// temp.str("");
|
||
// item.SetPropertyName(GATHER_TYPE);
|
||
// temp << smeta.m_GatherType;
|
||
// if(temp.str() != "")
|
||
// {
|
||
// if(temp.str() == pai::ios::metadata::STATIONCMP_SHOTNO_XLINE)
|
||
// {
|
||
// //常速扫描的结果,界面上固定显示const vel-analysis
|
||
// item.SetPropertyValue("const vel-analysis");
|
||
// }else{
|
||
|
||
// item.SetPropertyValue(temp.str());
|
||
// }
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// temp.str("");
|
||
// item.SetPropertyName(INDEX_INFO);
|
||
// temp << "Shot(I),Trace(I)";
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
|
||
// temp.str("");
|
||
// item.SetPropertyName(SEISMIC_DOMAIN);
|
||
// if(smeta.m_Domain == 0)
|
||
// {
|
||
// item.SetPropertyValue("Time");
|
||
// }
|
||
// else
|
||
// {
|
||
// item.SetPropertyValue("Depth");
|
||
// }
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
|
||
// if(smeta.m_GatherCount != 0)
|
||
// {
|
||
// temp.str("");
|
||
// item.SetPropertyName(GATHER_COUNT);
|
||
// temp << smeta.m_GatherCount;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// if(smeta.m_TraceNumOfLogicalFile != 0)
|
||
// {
|
||
// temp.str("");
|
||
// item.SetPropertyName(TRACE_COUNT);
|
||
// temp << smeta.m_TraceNumOfLogicalFile;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// if(smeta.m_MinShotNo != 0)
|
||
// {
|
||
// temp.str("");
|
||
// item.SetPropertyName(Min_SHOTNO);
|
||
// temp << smeta.m_MinShotNo;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// if(smeta.m_MaxShotNo != 0)
|
||
// {
|
||
// temp.str("");
|
||
// item.SetPropertyName(MAX_SHOTNO);
|
||
// temp << smeta.m_MaxShotNo;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// //TODO:目前没有统计这个字段
|
||
// if(smeta.m_ReceiverCount != 0)
|
||
// {
|
||
// temp.str("");
|
||
// item.SetPropertyName(RECEIVER_COUNT);
|
||
// temp << smeta.m_ReceiverCount;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// if(smeta.m_MinReceiver != 0)
|
||
// {
|
||
// temp.str("");
|
||
// //TODO:目前没有统计这个字段
|
||
// item.SetPropertyName(MIN_RECEIVER);
|
||
// temp << smeta.m_MinReceiver;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// //TODO:目前没有统计这个字段
|
||
// if(smeta.m_MaxReceiver != 0)
|
||
// {
|
||
// temp.str("");
|
||
// item.SetPropertyName(MAX_RECEIVER);
|
||
// temp << smeta.m_MaxReceiver;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// if(smeta.m_MinOffset != 0)
|
||
// {
|
||
// temp.str("");
|
||
// //TODO:目前没有统计这个字段
|
||
// item.SetPropertyName(Min_OFFSET);
|
||
// temp << smeta.m_MinOffset;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// if(smeta.m_MaxOffset != 0)
|
||
// {
|
||
// temp.str("");
|
||
// //TODO:目前没有统计这个字段
|
||
// item.SetPropertyName(MAX_OFFSET);
|
||
// temp << smeta.m_MaxOffset;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// if(smeta.m_InlineCount != 0)
|
||
// {
|
||
// temp.str("");
|
||
// item.SetPropertyName(INLINE_COUNT);
|
||
// temp << smeta.m_InlineCount;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// if(smeta.m_MinInline != 0)
|
||
// {
|
||
// temp.str("");
|
||
// item.SetPropertyName(MIN_INLINE);
|
||
// temp << smeta.m_MinInline;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// if(smeta.m_MaxInline != 0)
|
||
// {
|
||
// temp.str("");
|
||
// item.SetPropertyName(MAX_INLINE);
|
||
// temp << smeta.m_MaxInline;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// if(smeta.m_CrosslineCount != 0)
|
||
// {
|
||
// temp.str("");
|
||
// item.SetPropertyName(XLINE_COUNT);
|
||
// temp << smeta.m_CrosslineCount;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// if(smeta.m_MinCrossline != 0)
|
||
// {
|
||
// temp.str("");
|
||
// item.SetPropertyName(MIN_XLINE);
|
||
// temp << smeta.m_MinCrossline;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// if(smeta.m_MaxCrossline != 0)
|
||
// {
|
||
// temp.str("");
|
||
// item.SetPropertyName(MAX_XLINE);
|
||
// temp << smeta.m_MaxCrossline;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// if(smeta.m_CMPCount != 0)
|
||
// {
|
||
// temp.str("");
|
||
// item.SetPropertyName(CMP_COUNT);
|
||
// temp << smeta.m_CMPCount;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// if(smeta.m_MinCMP != 0)
|
||
// {
|
||
// temp.str("");
|
||
// item.SetPropertyName(MIN_CMP);
|
||
// temp << smeta.m_MinCMP;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// if(smeta.m_MaxCMP != 0)
|
||
// {
|
||
// temp.str("");
|
||
// item.SetPropertyName(MAX_CMP);
|
||
// temp << smeta.m_MaxCMP;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// itemgroup.push_back(items);
|
||
// itemgroup.push_back(itemdetial);
|
||
}
|
||
|
||
void Property::GetGeometryProperty (const long long id, std::vector<std::vector<PropertyItem> > & itemgroup)
|
||
{
|
||
// pai::ios::geometry::Geometry geo;
|
||
// GeometryInfo info;
|
||
// geo.GetInfoByID(id, info);
|
||
|
||
// std::vector<PropertyItem> items;
|
||
// std::vector<PropertyItem> itemdetial;
|
||
|
||
// PropertyItem item;
|
||
|
||
// item.SetPropertyName(TYPE);
|
||
// item.SetPropertyValue(TYPE_GEOMETRY);
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// std::stringstream temp;
|
||
// item.SetPropertyName(DATA_NAME);
|
||
// temp << pai::ios::PathParser::GetLogicalPath(info.m_SurveyID,pai::ios::GEOMETRY)<<info.m_GeomName;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
// temp.str("");
|
||
|
||
// item.SetPropertyName(CREATE_TIME);
|
||
// temp << info.m_CreatedTime ;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(DATE);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
// temp.str("");
|
||
|
||
// item.SetPropertyName(CREATE_BY);
|
||
// item.SetPropertyValue(info.m_CreatedBy);
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// item.SetPropertyName(MODIFY_TIME);
|
||
// temp << info.m_ModifiedTime ;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(DATE);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
// temp.str("");
|
||
// //TODO:目前无法取到该属性值
|
||
// item.SetPropertyName(LAST_ACCESS_TIME);
|
||
// temp << info.m_ModifiedTime ;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(DATE);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
// temp.str("");
|
||
|
||
// item.SetPropertyName(SOURCE_LINE_COUNT);
|
||
// temp << info.m_ShotLineNum;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// temp.str("");
|
||
|
||
// item.SetPropertyName(SOURCE_POINT_COUNT);
|
||
// temp << info.m_ShotPointNum;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// temp.str("");
|
||
|
||
// item.SetPropertyName(RECEIVER_LINE_COUNT);
|
||
// temp << info.m_ReceiveLineNum;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// temp.str("");
|
||
|
||
// item.SetPropertyName(RECEIVER_POINT_COUNT);
|
||
// temp << info.m_ReceivePointNum;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// temp.str("");
|
||
|
||
// item.SetPropertyName(FIELD_CHANNEL_COUNT);
|
||
// temp << info.m_TraceNum;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// temp.str("");
|
||
|
||
// itemgroup.push_back(items);
|
||
// itemgroup.push_back(itemdetial);
|
||
|
||
}
|
||
|
||
void Property::GetGridProperty (const long long id, std::vector<std::vector<PropertyItem> > & itemgroup)
|
||
{
|
||
// pai::ios::proj::Grid grid;
|
||
// pai::ios::proj::DBGrid smeta;
|
||
|
||
// grid.GetInfoByID(id, smeta);
|
||
|
||
// std::vector<PropertyItem> items;
|
||
// std::vector<PropertyItem> itemdetial;
|
||
|
||
// PropertyItem item;
|
||
|
||
// item.SetPropertyName(TYPE);
|
||
// item.SetPropertyValue(TYPE_GRID);
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// std::stringstream temp;
|
||
// item.SetPropertyName(DATA_NAME);
|
||
// temp << pai::ios::PathParser::GetLogicalPath(smeta.GetSurveyID(),pai::ios::GRID) << smeta.GetGridName();
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// temp.str("");
|
||
// item.SetPropertyName(CREATE_TIME);
|
||
// temp << smeta.GetCreatedTime() ;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(DATE);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// temp.str("");
|
||
// item.SetPropertyName(CREATE_BY);
|
||
// temp << smeta.GetCreateBy();
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// temp.str("");
|
||
// item.SetPropertyName(MODIFY_TIME);
|
||
// temp << smeta.GetModifiedTime() ;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(DATE);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// temp.str("");
|
||
// item.SetPropertyName(LAST_ACCESS_TIME);
|
||
// temp << smeta.GetModifiedTime() ;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(DATE);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// temp.str("");
|
||
// item.SetPropertyName(GRID_CORNER);
|
||
// std::stringstream corner;
|
||
// corner.precision(8);
|
||
// corner << "P1" << "(" << pai::utils::CUtils::FloatToStr(smeta.GetCorner1Lat(),DIGITS)
|
||
// << ","
|
||
// << pai::utils::CUtils::FloatToStr(smeta.GetCorner1Long(),DIGITS)
|
||
// << ")\n" <<std::endl;
|
||
// corner << "P2" << "(" << pai::utils::CUtils::FloatToStr(smeta.GetCorner2Lat(),DIGITS)
|
||
// << ","
|
||
// << pai::utils::CUtils::FloatToStr(smeta.GetCorner2Long(),DIGITS)
|
||
// << ")\n" <<std::endl;
|
||
// corner << "P3" << "(" << pai::utils::CUtils::FloatToStr(smeta.GetCorner3Lat(),DIGITS)
|
||
// << ","
|
||
// << pai::utils::CUtils::FloatToStr(smeta.GetCorner3Long(),DIGITS)
|
||
// << ")\n" <<std::endl;
|
||
// corner << "P4" << "(" << pai::utils::CUtils::FloatToStr(smeta.GetCorner4Lat(),DIGITS)
|
||
// << ","
|
||
// << pai::utils::CUtils::FloatToStr(smeta.GetCorner4Long(),DIGITS)
|
||
// << ")\n" <<std::endl;
|
||
// item.SetPropertyValue(corner.str());
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
|
||
// if(fabs(smeta.GetInlineUnitSize()-0) > FLT_EPSILON ||fabs(smeta.GetXlineUnitSize()-0) > FLT_EPSILON)
|
||
// {
|
||
// temp.str("");
|
||
// item.SetPropertyName(CELL);
|
||
// std::stringstream cell;
|
||
// cell << smeta.GetInlineUnitSize()
|
||
// << "*"
|
||
// << smeta.GetXlineUnitSize();
|
||
// item.SetPropertyValue(cell.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// if(smeta.GetInlineCount() != 0)
|
||
// {
|
||
// temp.str("");
|
||
// item.SetPropertyName(INLINE_COUNT);
|
||
// temp << smeta.GetInlineCount();
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// if(smeta.GetInlineMinNo() != 0)
|
||
// {
|
||
// temp.str("");
|
||
// item.SetPropertyName(MIN_INLINE);
|
||
// temp << smeta.GetInlineMinNo();
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// if(smeta.GetInlineMaxNo() != 0)
|
||
// {
|
||
// temp.str("");
|
||
// item.SetPropertyName(MAX_INLINE);
|
||
// temp << smeta.GetInlineMaxNo();
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// if(smeta.GetInlineSpacing() != 0)
|
||
// {
|
||
// temp.str("");
|
||
// item.SetPropertyName(INLINE_INCREMENT);
|
||
// temp << smeta.GetInlineSpacing();
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// if(smeta.GetXlineCount() != 0)
|
||
// {
|
||
// temp.str("");
|
||
// item.SetPropertyName(XLINE_COUNT);
|
||
// temp << smeta.GetXlineCount();
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// if(smeta.GetXlineMinNo() != 0)
|
||
// {
|
||
// temp.str("");
|
||
// item.SetPropertyName(MIN_XLINE);
|
||
// temp << smeta.GetXlineMinNo();
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// if(smeta.GetXlineMaxNo() != 0)
|
||
// {
|
||
// temp.str("");
|
||
// item.SetPropertyName(MAX_XLINE);
|
||
// temp << smeta.GetXlineMaxNo();
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// if(smeta.GetXlineSpacing() != 0)
|
||
// {
|
||
// temp.str("");
|
||
// item.SetPropertyName(XLINE_INCREMENT);
|
||
// temp << smeta.GetXlineSpacing();
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// //TODO:目前无法取到属性值
|
||
// if(smeta.GetCMPCount() != 0)
|
||
// {
|
||
// temp.str("");
|
||
// item.SetPropertyName(CMP_COUNT);
|
||
// temp << smeta.GetCMPCount();
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// //TODO:目前无法取到属性值
|
||
// if(smeta.GetMinCMP() != 0)
|
||
// {
|
||
// temp.str("");
|
||
// item.SetPropertyName(MIN_CMP);
|
||
// temp << smeta.GetMinCMP();
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// //TODO:目前无法取到属性值
|
||
// if(smeta.GetMaxCMP() != 0)
|
||
// {
|
||
// temp.str("");
|
||
// item.SetPropertyName(MAX_CMP);
|
||
// temp << smeta.GetMaxCMP();
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// itemgroup.push_back(items);
|
||
// itemgroup.push_back(itemdetial);
|
||
}
|
||
|
||
void Property::GetGridPropertyProperty(const long long id, std::vector<std::vector<PropertyItem> > & itemgroup)
|
||
{
|
||
std::vector<PropertyItem> items;
|
||
PropertyItem item;
|
||
|
||
// std::stringstream temp;
|
||
item.SetPropertyName(TYPE);
|
||
item.SetPropertyValue(TYPE_GRIDPROPERTY);
|
||
item.SetType(STRING);
|
||
item.SetUnit(NOUNIT);
|
||
items.push_back(item);
|
||
// temp.str("");
|
||
|
||
itemgroup.push_back(items);
|
||
}
|
||
|
||
void Property::GetVelModelProperty (const long long id, std::vector<std::vector<PropertyItem> > & itemgroup)
|
||
{
|
||
// pai::ios::proj::VelModelMetaData smeta;
|
||
// pai::ios::proj::VelModelMetaDataMgmt mgmt;
|
||
// mgmt.GetInfoByID(id,smeta);
|
||
// std::stringstream temp;
|
||
// std::vector<PropertyItem> items;
|
||
// std::vector<PropertyItem> itemdetial;
|
||
|
||
// PropertyItem item;
|
||
|
||
// item.SetPropertyName(TYPE);
|
||
// item.SetPropertyValue(TYPE_VELMODEL);
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// //////////////////////////////////////////////////
|
||
// item.SetPropertyName(DATA_NAME);
|
||
// std::stringstream fileLogicalPath;
|
||
// fileLogicalPath << pai::ios::PathParser::GetLogicalPath(smeta.GetSurveyID(),pai::ios::VELOCITY_MODEL)<< smeta.GetFileName();
|
||
// item.SetPropertyValue(fileLogicalPath.str());
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// item.SetPropertyName(DISK_PATH);
|
||
// std::stringstream diskpath;
|
||
// diskpath << smeta.GetPhysicalPath()<<"/"
|
||
// << smeta.GetFileName();
|
||
// item.SetPropertyValue(diskpath.str());
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// //TODO:目前存在一定的扩展性问题,可能需要进一步修改
|
||
// item.SetPropertyName(SIZE);
|
||
// std::string Realsize;
|
||
// pai::ios::property::ItemUnit Unit;
|
||
// ChangeFileSizeUnit(smeta.GetFileSize(),Realsize,Unit);
|
||
// item.SetPropertyValue(Realsize);
|
||
// item.SetType(FLOAT);
|
||
// item.SetUnit(Unit);
|
||
// items.push_back(item);
|
||
// ////////////////////////////////////////////////////////////
|
||
// temp.str("");
|
||
// item.SetPropertyName(CREATE_TIME);
|
||
// temp << smeta.GetCreatedTime() ;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(DATE);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// temp.str("");
|
||
// item.SetPropertyName(CREATE_BY);
|
||
// temp << smeta.GetCreateBy();
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// //TODO:目前无法取到属性信息
|
||
// temp.str("");
|
||
// item.SetPropertyName(MODIFY_TIME);
|
||
// temp << smeta.GetModifiedTime() ;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(DATE);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// temp.str("");
|
||
// item.SetPropertyName(LAST_ACCESS_TIME);
|
||
// temp << smeta.GetLastAccessedTime() ;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(DATE);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// item.SetPropertyName(SEISMIC_DOMAIN);
|
||
// if(smeta.GetDomain() == 0)
|
||
// {
|
||
// item.SetPropertyValue(VALUE_TIME);
|
||
// }
|
||
// else
|
||
// {
|
||
// item.SetPropertyValue(VALUE_DEPTH);
|
||
// }
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
|
||
// if(smeta.GetInlineIncrement() != 0 ||smeta.GetCrosslineIncrement() != 0)
|
||
// {
|
||
// //TODO:目前还没有统计出来
|
||
// item.SetPropertyName(CELL);
|
||
// std::stringstream cell;
|
||
// cell << smeta.GetInlineIncrement()
|
||
// << "*"
|
||
// << smeta.GetCrosslineIncrement();
|
||
// item.SetPropertyValue(cell.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// if(smeta.GetInlineCount() != 0)
|
||
// {
|
||
// temp.str("");
|
||
// item.SetPropertyName(INLINE_COUNT);
|
||
// temp << smeta.GetInlineCount();
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// if(smeta.GetMinInline() != 0)
|
||
// {
|
||
// temp.str("");
|
||
// item.SetPropertyName(MIN_INLINE);
|
||
// temp << smeta.GetMinInline();
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// if(smeta.GetMaxInline() != 0)
|
||
// {
|
||
// temp.str("");
|
||
// item.SetPropertyName(MAX_INLINE);
|
||
// temp << smeta.GetMaxInline();
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// if(smeta.GetInlineIncrement() != 0)
|
||
// {
|
||
// temp.str("");
|
||
// //TODO:目前没有统计数据
|
||
// item.SetPropertyName(INLINE_INCREMENT);
|
||
// temp << smeta.GetInlineIncrement();
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// if(smeta.GetCrosslineCount() != 0)
|
||
// {
|
||
// temp.str("");
|
||
// item.SetPropertyName(XLINE_COUNT);
|
||
// temp << smeta.GetCrosslineCount();
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// if(smeta.GetMinCrossline() != 0)
|
||
// {
|
||
// temp.str("");
|
||
// item.SetPropertyName(MIN_XLINE);
|
||
// temp << smeta.GetMinCrossline();
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// if(smeta.GetMaxCrossline() != 0)
|
||
// {
|
||
// temp.str("");
|
||
// item.SetPropertyName(MAX_XLINE);
|
||
// temp << smeta.GetMaxCrossline();
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// if(smeta.GetCrosslineIncrement() != 0)
|
||
// {
|
||
// temp.str("");
|
||
// //TODO:目前没有统计数据
|
||
// item.SetPropertyName(XLINE_INCREMENT);
|
||
// temp << smeta.GetCrosslineIncrement();
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// itemgroup.push_back(items);
|
||
// itemgroup.push_back(itemdetial);
|
||
}
|
||
//TODO:没有可供使用的接口
|
||
void Property::GetVelPairProperty (const long long id, std::vector<std::vector<PropertyItem> > & itemgroup)
|
||
{
|
||
// pai::ios::proj::SurveySeisVelo info;
|
||
// pai::ios::proj::VelocityAnalysisInterface velDataInterface;
|
||
// velDataInterface.GetInfoByID(id,info);
|
||
|
||
// std::stringstream temp;
|
||
// std::vector<PropertyItem> items;
|
||
// std::vector<PropertyItem> itemdetial;
|
||
|
||
// PropertyItem item;
|
||
|
||
// item.SetPropertyName(TYPE);
|
||
// item.SetPropertyValue(TYPE_VELPAIR);
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// /////////////////////////////////////////////////////
|
||
// std::stringstream fileLogicalPath;
|
||
// fileLogicalPath << pai::ios::PathParser::GetLogicalPath(info.m_SurveyID,pai::ios::VELOCITY_PAIR)<< info.m_FileName;
|
||
// item.SetPropertyName(DATA_NAME);
|
||
// item.SetPropertyValue(fileLogicalPath.str());
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// // item.SetPropertyName(DISK_PATH);
|
||
// // std::stringstream diskpath;
|
||
// // diskpath <<pro.GetProjectPath()
|
||
// // << pro.GetDisplayName()
|
||
// // << survey.GetLocation() << "/"
|
||
// // << survey.GetDisplayName() << "/"
|
||
// // << info.m_FileName;
|
||
// // item.SetPropertyValue(diskpath.str());
|
||
// // item.SetType(STRING);
|
||
// // item.SetUnit(NOUNIT);
|
||
// // items.push_back(item);
|
||
|
||
// item.SetPropertyName(TYPE_VELDATATYPE);
|
||
// if (info.m_Vtype == 0)
|
||
// item.SetPropertyValue(VALUE_STACKTYPE);
|
||
// else
|
||
// item.SetPropertyValue(VALUE_RMS);
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// temp.str("");
|
||
// //TODO:目前没有统计数据
|
||
// item.SetPropertyName(CREATE_TIME);
|
||
// temp << info.m_CreatedTime ;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(DATE);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// //TODO:目前没有统计数据
|
||
// item.SetPropertyName(CREATE_BY);
|
||
// item.SetPropertyValue(info.m_Createdby);
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// temp.str("");
|
||
// //TODO:目前没有统计数据
|
||
// item.SetPropertyName(MODIFY_TIME);
|
||
// temp << info.m_ModifiedTime ;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(DATE);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// temp.str("");
|
||
// item.SetPropertyName(LAST_ACCESS_TIME);
|
||
// temp << info.m_LastAccessedTime ;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(DATE);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// if(info.m_InlineCount != 0)
|
||
// {
|
||
// temp.str("");
|
||
// item.SetPropertyName(INLINE_COUNT);
|
||
// temp << info.m_InlineCount;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// if(info.m_MinInline != 0)
|
||
// {
|
||
// temp.str("");
|
||
// item.SetPropertyName(MIN_INLINE);
|
||
// temp << info.m_MinInline;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// if(info.m_MaxInline != 0)
|
||
// {
|
||
// temp.str("");
|
||
// //TODO:目前没有统计数据
|
||
// item.SetPropertyName(MAX_INLINE);
|
||
// temp << info.m_MaxInline;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// if(info.m_InlineIncrement != 0)
|
||
// {
|
||
// temp.str("");
|
||
// //TODO:目前没有统计数据
|
||
// item.SetPropertyName(INLINE_INCREMENT);
|
||
// temp << info.m_InlineIncrement;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// if(info.m_CrosslineCount != 0)
|
||
// {
|
||
// temp.str("");
|
||
// //TODO:目前没有统计数据
|
||
// item.SetPropertyName(XLINE_COUNT);
|
||
// temp << info.m_CrosslineCount;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// if(info.m_MinCrossline != 0)
|
||
// {
|
||
// temp.str("");
|
||
// //TODO:目前没有统计数据
|
||
// item.SetPropertyName(MIN_XLINE);
|
||
// temp << info.m_MinCrossline;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// if(info.m_MaxCrossline != 0)
|
||
// {
|
||
// temp.str("");
|
||
// //TODO:目前没有统计数据
|
||
// item.SetPropertyName(MAX_XLINE);
|
||
// temp << info.m_MaxCrossline;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// if(info.m_CrosslineIncrement != 0)
|
||
// {
|
||
// temp.str("");
|
||
// //TODO:目前没有统计数据
|
||
// item.SetPropertyName(XLINE_INCREMENT);
|
||
// temp << info.m_CrosslineIncrement;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// if(info.m_CMPCount != 0)
|
||
// {
|
||
// temp.str("");
|
||
// //TODO:目前无法取到属性值
|
||
// item.SetPropertyName(CMP_COUNT);
|
||
// temp << info.m_CMPCount;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// if(info.m_MinCMP != 0)
|
||
// {
|
||
// temp.str("");
|
||
// //TODO:目前无法取到属性值
|
||
// item.SetPropertyName(MIN_CMP);
|
||
// temp << info.m_MinCMP;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// if(info.m_MaxCMP != 0)
|
||
// {
|
||
// temp.str("");
|
||
// //TODO:目前无法取到属性值
|
||
// item.SetPropertyName(MAX_CMP);
|
||
// temp << info.m_MaxCMP;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// itemgroup.push_back(items);
|
||
// itemgroup.push_back(itemdetial);
|
||
}
|
||
void Property::GetFirstArrivalProperty(const long long id, std::vector<std::vector<PropertyItem> > & itemgroup)
|
||
{
|
||
// pai::ios::proj::FirstArrivalInfo info;
|
||
// pai::ios::proj::FirstArrivalInterface firstArrivalInterface;
|
||
// std::stringstream temp;
|
||
// firstArrivalInterface.GetInfoByID(id,info);
|
||
|
||
// std::vector<PropertyItem> items;
|
||
// std::vector<PropertyItem> itemdetial;
|
||
|
||
// PropertyItem item;
|
||
|
||
// item.SetPropertyName(TYPE);
|
||
// item.SetPropertyValue(TYPE_FIRSTARRIVAL);
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// std::stringstream fileLogicalPath;
|
||
// fileLogicalPath << pai::ios::PathParser::GetLogicalPath(info.GetSurveyID(),pai::ios::FIRSTARRIVAL)<< info.GetFileName();
|
||
// item.SetPropertyName(DATA_NAME);
|
||
// item.SetPropertyValue(fileLogicalPath.str());
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// temp.str("");
|
||
// item.SetPropertyName(CREATE_TIME);
|
||
// temp << info.GetCreatedTime() ;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(DATE);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// item.SetPropertyName(CREATE_BY);
|
||
// item.SetPropertyValue(info.GetCreateBy());
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// temp.str("");
|
||
// item.SetPropertyName(MODIFY_TIME);
|
||
// temp << info.GetModifiedTime() ;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(DATE);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// temp.str("");
|
||
// item.SetPropertyName(LAST_ACCESS_TIME);
|
||
// temp << info.GetLastAccessedTime() ;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(DATE);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// int totalGatherNum = 0;
|
||
// if(!info.GetShotLineFirstArrival().empty())
|
||
// {
|
||
// totalGatherNum = info.GetShotLineFirstArrival()[0].GetTotalShotPointNum();
|
||
// }
|
||
// if(totalGatherNum != 0)
|
||
// {
|
||
// temp.str("");
|
||
// item.SetPropertyName(PICK_GATHERS);
|
||
// temp << totalGatherNum;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
|
||
// int TraceMuteDataNum = 0;
|
||
// if(!info.GetShotLineFirstArrival().empty())
|
||
// {
|
||
// for(unsigned int i = 0; i < info.GetShotLineFirstArrival().size(); i++)
|
||
// {
|
||
// for(unsigned int s = 0; s < info.GetShotLineFirstArrival()[i].GetShotPointFirstArrival().size(); s++)
|
||
// {
|
||
// TraceMuteDataNum += static_cast<int>(info.GetShotLineFirstArrival()[i].GetShotPointFirstArrival()[s].GetTraceFirstArrival().size());
|
||
// }
|
||
|
||
// }
|
||
// }
|
||
// if(TraceMuteDataNum != 0)
|
||
// {
|
||
// temp.str("");
|
||
// item.SetPropertyName(PICK_TRACE);
|
||
// temp << TraceMuteDataNum;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// itemgroup.push_back(items);
|
||
// itemgroup.push_back(itemdetial);
|
||
}
|
||
void Property::GetMuteProperty(const long long id, std::vector<std::vector<PropertyItem> > & itemgroup)
|
||
{
|
||
// pai::ios::proj::MuteDataInfo info;
|
||
// pai::ios::proj::MuteDataInterface muteDataInterface;
|
||
// muteDataInterface.GetInfoByID(id,info);
|
||
// std::stringstream temp;
|
||
// std::vector<PropertyItem> items;
|
||
// std::vector<PropertyItem> itemdetial;
|
||
|
||
// PropertyItem item;
|
||
|
||
// item.SetPropertyName(TYPE);
|
||
// item.SetPropertyValue(TYPE_MUTE);
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
|
||
// item.SetPropertyName(DATA_NAME);
|
||
// std::stringstream fileLogicalPath;
|
||
// fileLogicalPath << pai::ios::PathParser::GetLogicalPath(info.GetSurveyID(),pai::ios::MUTE)<< info.GetFileName();
|
||
// item.SetPropertyValue(fileLogicalPath.str());
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// temp.str("");
|
||
// item.SetPropertyName(CREATE_TIME);
|
||
// temp << info.GetCreatedTime() ;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(DATE);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// temp.str("");
|
||
// item.SetPropertyName(CREATE_BY);
|
||
// item.SetPropertyValue(info.GetCreateBy());
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// temp.str("");
|
||
// item.SetPropertyName(MODIFY_TIME);
|
||
// temp << info.GetModifiedTime() ;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(DATE);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// temp.str("");
|
||
// item.SetPropertyName(LAST_ACCESS_TIME);
|
||
// temp << info.GetLastAccessedTime() ;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(DATE);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// int totalGatherNum = 0;
|
||
// if(!info.GetLineMute().empty())
|
||
// {
|
||
// totalGatherNum = info.GetLineMute()[0].GetTotalGatherNum();
|
||
// }
|
||
// if(totalGatherNum != 0)
|
||
// {
|
||
// temp.str("");
|
||
// item.SetPropertyName(PICK_GATHERS);
|
||
// temp << totalGatherNum;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// itemgroup.push_back(items);
|
||
// itemgroup.push_back(itemdetial);
|
||
}
|
||
void Property::GetTraceEditProperty(const long long id, std::vector<std::vector<PropertyItem> > & itemgroup)
|
||
{
|
||
// pai::ios::proj::TraceEditInfo info;
|
||
// pai::ios::proj::TraceEditInterface traceEditInterface;
|
||
// traceEditInterface.GetInfoByID(id,info);
|
||
// std::stringstream temp;
|
||
// std::vector<PropertyItem> items;
|
||
// std::vector<PropertyItem> itemdetial;
|
||
|
||
// PropertyItem item;
|
||
|
||
// item.SetPropertyName(TYPE);
|
||
// item.SetPropertyValue(TYPE_TRACEEDIT);
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
|
||
// item.SetPropertyName(DATA_NAME);
|
||
// std::stringstream fileLogicalPath;
|
||
// fileLogicalPath << pai::ios::PathParser::GetLogicalPath(info.GetSurveyID(),pai::ios::TRACE_EDIT)<< info.GetFileName();
|
||
// item.SetPropertyValue(fileLogicalPath.str());
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// temp.str("");
|
||
// item.SetPropertyName(CREATE_TIME);
|
||
// temp << info.GetCreatedTime() ;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(DATE);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// item.SetPropertyName(CREATE_BY);
|
||
// item.SetPropertyValue(info.GetCreateBy());
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// temp.str("");
|
||
// item.SetPropertyName(MODIFY_TIME);
|
||
// temp << info.GetModifiedTime() ;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(DATE);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// temp.str("");
|
||
// item.SetPropertyName(LAST_ACCESS_TIME);
|
||
// temp << info.GetLastAccessedTime() ;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(DATE);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// int totalGatherNum = 0;
|
||
// if(!info.GetLineTraceEdit().empty())
|
||
// {
|
||
// totalGatherNum = info.GetLineTraceEdit()[0].GetTotalGatherNum();
|
||
// }
|
||
// if(totalGatherNum != 0)
|
||
// {
|
||
// temp.str("");
|
||
// item.SetPropertyName(PICK_GATHERS);
|
||
// temp << totalGatherNum;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// int TraceMuteDataNum = 0;
|
||
// if(!info.GetLineTraceEdit().empty())
|
||
// {
|
||
// for(unsigned int i = 0; i < info.GetLineTraceEdit().size(); i++)
|
||
// {
|
||
// for(unsigned int s = 0; s < info.GetLineTraceEdit()[i].GetGatherTraceEdit().size(); s++)
|
||
// {
|
||
// TraceMuteDataNum += static_cast<int>(info.GetLineTraceEdit()[i].GetGatherTraceEdit()[s].GetTraceTraceEdit().size());
|
||
// }
|
||
|
||
// }
|
||
// }
|
||
// if(TraceMuteDataNum != 0)
|
||
// {
|
||
// temp.str("");
|
||
// item.SetPropertyName(PICK_TRACE);
|
||
// temp << TraceMuteDataNum;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// itemgroup.push_back(items);
|
||
// itemgroup.push_back(itemdetial);
|
||
}
|
||
void Property::GetStaticsProperty(const long long id, std::vector<std::vector<PropertyItem> > & itemgroup)
|
||
{
|
||
// pai::ios::proj::StaticData staticdata;
|
||
// pai::ios::proj::StatInfo info;
|
||
// staticdata.GetInfoByID(id,info);
|
||
|
||
// std::vector<PropertyItem> items;
|
||
// // std::vector<PropertyItem> itemdetial;
|
||
|
||
// PropertyItem item;
|
||
|
||
// item.SetPropertyName(TYPE);
|
||
// item.SetPropertyValue(TYPE_STATICS);
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// std::stringstream temp;
|
||
// item.SetPropertyName(DATA_NAME);
|
||
// std::stringstream fileLogicalPath;
|
||
// fileLogicalPath << pai::ios::PathParser::GetLogicalPath(info.m_surveyID,pai::ios::STATICS_COMPUTE)<< info.m_filename;
|
||
// item.SetPropertyValue(fileLogicalPath.str());
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// temp.str("");
|
||
// item.SetPropertyName(CREATE_TIME);
|
||
// temp << info.m_CreatedTime ;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(DATE);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// item.SetPropertyName(CREATE_BY);
|
||
// item.SetPropertyValue(info.m_CreateBy);
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// temp.str("");
|
||
// item.SetPropertyName(MODIFY_TIME);
|
||
// temp << info.m_ModifiedTime ;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(DATE);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// temp.str("");
|
||
// item.SetPropertyName(LAST_ACCESS_TIME);
|
||
// temp << info.m_LastAccessedTime ;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(DATE);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// itemgroup.push_back(items);
|
||
}
|
||
|
||
void Property::GetHorizonProperty (const long long id, std::vector<std::vector<PropertyItem> > & itemgroup)
|
||
{
|
||
// pai::ios::proj::HorizonInterface horzion;
|
||
// pai::ios::proj::HorizonInfo2D info;
|
||
// horzion.GetInfoByID(id,info);
|
||
|
||
// std::vector<PropertyItem> items;
|
||
// // std::vector<PropertyItem> itemdetial;
|
||
|
||
// PropertyItem item;
|
||
|
||
// item.SetPropertyName(TYPE);
|
||
// item.SetPropertyValue(TYPE_HORIZON);
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// std::stringstream temp;
|
||
// item.SetPropertyName(DATA_NAME);
|
||
// std::stringstream fileLogicalPath;
|
||
// fileLogicalPath << pai::ios::PathParser::GetLogicalPath(info.GetSurveyID(),pai::ios::HORIZON)<< info.GetFilename();
|
||
// item.SetPropertyValue(fileLogicalPath.str());
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// temp.str("");
|
||
// item.SetPropertyName(HORIZON_NUM);
|
||
// long long horzionNum = 0;
|
||
// for(unsigned int i = 0; i < info.GetLineData().size(); i++)
|
||
// {
|
||
// horzionNum += static_cast<long long>(info.GetLineData()[i].GetHorizons().size());
|
||
// }
|
||
// temp << horzionNum;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// temp.str("");
|
||
// item.SetPropertyName(CREATE_TIME);
|
||
// temp << info.GetCreatedTime() ;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(DATE);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// item.SetPropertyName(CREATE_BY);
|
||
// item.SetPropertyValue(info.GetCreateBy());
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// temp.str("");
|
||
// item.SetPropertyName(MODIFY_TIME);
|
||
// temp << info.GetModifiedTime() ;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(DATE);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// temp.str("");
|
||
// item.SetPropertyName(LAST_ACCESS_TIME);
|
||
// temp << info.GetLastAccessedTime() ;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(DATE);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// itemgroup.push_back(items);
|
||
}
|
||
|
||
void Property::GetLaterProperty(const long long id, std::vector<std::vector<PropertyItem> > & itemgroup)
|
||
{
|
||
// pai::ios::proj::LateralVelocityModeling interfaceModel;
|
||
// pai::ios::proj::LateralVelocityModelingInfo info;
|
||
// interfaceModel.GetFromDB(id);
|
||
// info = interfaceModel.GetLateralVelocityModeling();
|
||
|
||
// std::vector<PropertyItem> items;
|
||
// // std::vector<PropertyItem> itemdetial;
|
||
|
||
// PropertyItem item;
|
||
|
||
// item.SetPropertyName(TYPE);
|
||
// item.SetPropertyValue(TYPE_MODELING);
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// std::stringstream temp;
|
||
// item.SetPropertyName(DATA_NAME);
|
||
// std::stringstream fileLogicalPath;
|
||
// fileLogicalPath << pai::ios::PathParser::GetLogicalPath(info.GetSurveyID(),pai::ios::LATERAL)<< info.GetFileName();
|
||
// item.SetPropertyValue(fileLogicalPath.str());
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// temp.str("");
|
||
// item.SetPropertyName(CREATE_TIME);
|
||
// temp << info.GetCreatedTime() ;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(DATE);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// item.SetPropertyName(CREATE_BY);
|
||
// item.SetPropertyValue(info.GetCreateBy());
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// temp.str("");
|
||
// item.SetPropertyName(MODIFY_TIME);
|
||
// temp << info.GetModifiedTime() ;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(DATE);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// temp.str("");
|
||
// item.SetPropertyName(LAST_ACCESS_TIME);
|
||
// temp << info.GetLastAccessedTime() ;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(DATE);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// itemgroup.push_back(items);
|
||
}
|
||
|
||
void Property::GetModelingProperty (const long long id, std::vector<std::vector<PropertyItem> > & itemgroup)
|
||
{
|
||
// pai::ios::proj::GridVelModelingInterface interfaceModel;
|
||
// pai::ios::proj::GridVelocityModelingInfo info;
|
||
// interfaceModel.GetInfoByID(id,info);
|
||
|
||
// std::vector<PropertyItem> items;
|
||
// // std::vector<PropertyItem> itemdetial;
|
||
|
||
// PropertyItem item;
|
||
|
||
// item.SetPropertyName(TYPE);
|
||
// item.SetPropertyValue(TYPE_MODELING);
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// std::stringstream temp;
|
||
// item.SetPropertyName(DATA_NAME);
|
||
// std::stringstream fileLogicalPath;
|
||
// fileLogicalPath << pai::ios::PathParser::GetLogicalPath(info.GetSurveyID(),pai::ios::MODELING) << info.GetVelocityModelName();
|
||
// item.SetPropertyValue(fileLogicalPath.str());
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// temp.str("");
|
||
// item.SetPropertyName(CREATE_TIME);
|
||
// temp << info.GetCreatedTime() ;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(DATE);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// item.SetPropertyName(CREATE_BY);
|
||
// item.SetPropertyValue(info.GetCreateBy());
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// temp.str("");
|
||
// item.SetPropertyName(MODIFY_TIME);
|
||
// temp << info.GetModifiedTime() ;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(DATE);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// temp.str("");
|
||
// item.SetPropertyName(LAST_ACCESS_TIME);
|
||
// temp << info.GetLastAccessedTime() ;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(DATE);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// itemgroup.push_back(items);
|
||
}
|
||
|
||
void Property::GetOperationProperty (const long long id, std::vector<std::vector<PropertyItem> > & itemgroup)
|
||
{
|
||
// pai::ios::history::OperationInfoPersist op;
|
||
// pai::ios::history::OperationInfo info;
|
||
// op.Open(id, info);
|
||
|
||
// std::vector<PropertyItem> items;
|
||
// // std::vector<PropertyItem> itemdetial;
|
||
|
||
// PropertyItem item;
|
||
|
||
// item.SetPropertyName(TYPE);
|
||
// item.SetPropertyValue(TYPE_OPERATION);
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// std::stringstream temp;
|
||
// item.SetPropertyName(OPERATION_NAME);
|
||
// temp << info.GetOperationName();
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
// temp.str("");
|
||
|
||
// item.SetPropertyName(CREATE_BY);
|
||
// item.SetPropertyValue(info.GetCreateBy());
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// item.SetPropertyName(OPERATION_STARTTIME);
|
||
// temp << info.GetStartDate() ;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(DATE);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
// temp.str("");
|
||
|
||
// item.SetPropertyName(OPERATION_ENDTIME);
|
||
// temp << info.GetEndDate() ;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(DATE);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
// temp.str("");
|
||
|
||
// itemgroup.push_back(items);
|
||
}
|
||
|
||
void Property::GetShotProperty(const long long id, std::vector<std::vector<PropertyItem> > & itemgroup)
|
||
{
|
||
// pai::ios::proj::ShotAmplitudeInterface interface;
|
||
// pai::ios::proj::ShotAmplitudeInfo info;
|
||
// interface.GetShotAmplitudeInfoByID(id, info);
|
||
// std::vector<PropertyItem> items;
|
||
|
||
// PropertyItem item;
|
||
|
||
// item.SetPropertyName(TYPE);
|
||
// item.SetPropertyValue(TYPE_ATTRIBUTE);
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// std::stringstream fileLogicalPath;
|
||
// fileLogicalPath << pai::ios::PathParser::GetLogicalPath(info.GetSurveyID(), pai::ios::SHOTPROPERTY) << info.GetFileName();
|
||
// item.SetPropertyName(DATA_NAME);
|
||
// item.SetPropertyValue(fileLogicalPath.str());
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
// std::stringstream temp;
|
||
// temp.str("");
|
||
// item.SetPropertyName(CREATE_TIME);
|
||
// temp << info.GetCreatedTime() ;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(DATE);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// item.SetPropertyName(CREATE_BY);
|
||
// item.SetPropertyValue(info.GetCreateBy());
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// temp.str("");
|
||
// item.SetPropertyName(MODIFY_TIME);
|
||
// temp << info.GetModifiedTime() ;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(DATE);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// temp.str("");
|
||
// item.SetPropertyName(LAST_ACCESS_TIME);
|
||
// temp << info.GetLastAccessedTime() ;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(DATE);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// itemgroup.push_back(items);
|
||
}
|
||
|
||
void Property::GetVelAnalysisProperty (const long long id, std::vector<std::vector<PropertyItem> > & itemgroup)
|
||
{
|
||
// pai::ios::proj::VelSpectrumMetaData smeta;
|
||
// pai::ios::proj::VelSpectrumMetaDataMgmt mgmt;
|
||
// mgmt.GetSpectrumDatasetMetaData(id,smeta);
|
||
// std::stringstream temp;
|
||
// std::vector<PropertyItem> items;
|
||
// std::vector<PropertyItem> itemdetial;
|
||
|
||
// PropertyItem item;
|
||
|
||
// item.SetPropertyName(TYPE);
|
||
// item.SetPropertyValue(TYPE_VELANALYSIS);
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// //////////////////////////////////////////////////
|
||
|
||
// item.SetPropertyName(DATA_NAME);
|
||
// std::stringstream fileLogicalPath;
|
||
// fileLogicalPath << pai::ios::PathParser::GetLogicalPath(smeta.GetSurveyID(),pai::ios::SPECTRUMDATA) << smeta.GetFileName();
|
||
// item.SetPropertyValue(fileLogicalPath.str());
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// item.SetPropertyName(DISK_PATH);
|
||
// std::stringstream diskpath;
|
||
// diskpath<< smeta.GetPhysicalPath() << "/"
|
||
// << smeta.GetFileName();
|
||
// item.SetPropertyValue(diskpath.str());
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// //TODO:目前存在一定的扩展性问题,可能需要进一步修改
|
||
// #if 0
|
||
// item.SetPropertyName(SIZE);
|
||
// std::string Realsize;
|
||
// pai::ios::property::ItemUnit Unit;
|
||
// ChangeFileSizeUnit(smeta.GetFileSize(),Realsize,Unit);
|
||
// item.SetPropertyValue(Realsize);
|
||
// item.SetType(FLOAT);
|
||
// item.SetUnit(Unit);
|
||
// items.push_back(item);
|
||
// #endif
|
||
// ////////////////////////////////////////////////////////////
|
||
// temp.str("");
|
||
// item.SetPropertyName(CREATE_TIME);
|
||
// temp << smeta.GetCreatedTime() ;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(DATE);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// temp.str("");
|
||
// item.SetPropertyName(CREATE_BY);
|
||
// temp << smeta.GetCreateBy();
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// //TODO:目前无法取到属性信息
|
||
// temp.str("");
|
||
// item.SetPropertyName(MODIFY_TIME);
|
||
// temp << smeta.GetModifiedTime() ;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(DATE);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// temp.str("");
|
||
// item.SetPropertyName(LAST_ACCESS_TIME);
|
||
// temp << smeta.GetLastAccessedTime() ;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(DATE);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// item.SetPropertyName(SEISMIC_DOMAIN);
|
||
// if(smeta.GetDomain() == 0)
|
||
// {
|
||
// item.SetPropertyValue(VALUE_TIME);
|
||
// }
|
||
// else
|
||
// {
|
||
// item.SetPropertyValue(VALUE_DEPTH);
|
||
// }
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
|
||
// if(smeta.GetInlineIncrement() != 0 ||smeta.GetCrosslineIncrement() != 0)
|
||
// {
|
||
// //TODO:目前还没有统计出来
|
||
// item.SetPropertyName(CELL);
|
||
// std::stringstream cell;
|
||
// cell << smeta.GetInlineIncrement()
|
||
// << "*"
|
||
// << smeta.GetCrosslineIncrement();
|
||
// item.SetPropertyValue(cell.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// if(smeta.GetInlineCount() != 0)
|
||
// {
|
||
// temp.str("");
|
||
// item.SetPropertyName(INLINE_COUNT);
|
||
// temp << smeta.GetInlineCount();
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// if(smeta.GetMinInline() != 0)
|
||
// {
|
||
// temp.str("");
|
||
// item.SetPropertyName(MIN_INLINE);
|
||
// temp << smeta.GetMinInline();
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// if(smeta.GetMaxInline() != 0)
|
||
// {
|
||
// temp.str("");
|
||
// item.SetPropertyName(MAX_INLINE);
|
||
// temp << smeta.GetMaxInline();
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// if(smeta.GetInlineIncrement() != 0)
|
||
// {
|
||
// temp.str("");
|
||
// //TODO:目前没有统计数据
|
||
// item.SetPropertyName(INLINE_INCREMENT);
|
||
// temp << smeta.GetInlineIncrement();
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// if(smeta.GetCrosslineCount() != 0)
|
||
// {
|
||
// temp.str("");
|
||
// item.SetPropertyName(XLINE_COUNT);
|
||
// temp << smeta.GetCrosslineCount();
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// if(smeta.GetMinCrossline() != 0)
|
||
// {
|
||
// temp.str("");
|
||
// item.SetPropertyName(MIN_XLINE);
|
||
// temp << smeta.GetMinCrossline();
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// if(smeta.GetMaxCrossline() != 0)
|
||
// {
|
||
// temp.str("");
|
||
// item.SetPropertyName(MAX_XLINE);
|
||
// temp << smeta.GetMaxCrossline();
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// if(smeta.GetCrosslineIncrement() != 0)
|
||
// {
|
||
// temp.str("");
|
||
// //TODO:目前没有统计数据
|
||
// item.SetPropertyName(XLINE_INCREMENT);
|
||
// temp << smeta.GetCrosslineIncrement();
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// itemdetial.push_back(item);
|
||
// }
|
||
|
||
// itemgroup.push_back(items);
|
||
// itemgroup.push_back(itemdetial);
|
||
}
|
||
|
||
void Property::GetWorkflowProperty(const long long id, std::vector<std::vector<PropertyItem> > & itemgroup)
|
||
{
|
||
// pai::ios::job::WorkflowPtr wfPtr = pai::ios::job::Workflow::FindById(id);
|
||
|
||
// std::vector<PropertyItem> items;
|
||
// PropertyItem item;
|
||
|
||
// item.SetPropertyName(TYPE);
|
||
// item.SetPropertyValue(TYPE_WORKFLOW);
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// std::stringstream temp;
|
||
// item.SetPropertyName(CREATE_TIME);
|
||
// temp << wfPtr->GetCreationTime() ;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(DATE);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// temp.str("");
|
||
// item.SetPropertyName(MODIFY_TIME);
|
||
// temp << wfPtr->GetLastModifyTime() ;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(DATE);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// temp.str("");
|
||
// temp << pai::ios::PathParser::GetLogicalPath(wfPtr->GetSurveyID(), pai::ios::WORKFLOW) << wfPtr->GetName();
|
||
// item.SetPropertyName(DISK_PATH);
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// item.SetPropertyName(CREATE_BY);
|
||
// item.SetPropertyValue(wfPtr->GetCreatedBy());
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// temp.str("");
|
||
// item.SetPropertyName(LAST_MODIFYED);
|
||
// temp << wfPtr->GetModifyBy() ;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// itemgroup.push_back(items);
|
||
}
|
||
|
||
void Property::GetJobProperty(const long long id, std::vector<std::vector<PropertyItem> > & itemgroup)
|
||
{
|
||
// pai::ios::job::WorkflowSet wfs;
|
||
// pai::ios::job::WorkflowSet ws = wfs.FindByID(id);
|
||
|
||
// std::vector<PropertyItem> items;
|
||
// PropertyItem item;
|
||
|
||
// item.SetPropertyName(TYPE);
|
||
// item.SetPropertyValue(TYPE_JOB);
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// std::stringstream temp;
|
||
// item.SetPropertyName(SUBMITTE_TIME);
|
||
// temp << ws.GetSubmissionTime();
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(DATE);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// temp.str("");
|
||
// item.SetPropertyName(ELAPSED_TIME);
|
||
// try
|
||
// {
|
||
// temp << pai::utils::CUtils::TimeToString(ws.GetElapsedTime()/1000000);
|
||
// }
|
||
// catch(pai::error::invalid_argument& e)
|
||
// {
|
||
// pai::log::Info(std::string("Get elapsed time error!"));
|
||
// }
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// temp.str("");
|
||
// item.SetPropertyName(RUNNING_TIME);
|
||
// try
|
||
// {
|
||
// temp << pai::utils::CUtils::TimeToString(ws.GetRunningTime()/1000000);
|
||
// }
|
||
// catch(pai::error::invalid_argument& e)
|
||
// {
|
||
// pai::log::Info(std::string("Get running time error!"));
|
||
// }
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// temp.str("");
|
||
// item.SetPropertyName(MODIFY_TIME);
|
||
// temp << ws.GetLastModifiedTime();
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(DATE);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// temp.str("");
|
||
// item.SetPropertyName(STATUS);
|
||
// switch(ws.GetStatus())
|
||
// {
|
||
// case pai::ios::job::Running:
|
||
// temp << "Running";
|
||
// break;
|
||
// case pai::ios::job::Completed:
|
||
// temp << "Succeed";
|
||
// break;
|
||
// case pai::ios::job::Failed:
|
||
// case pai::ios::job::SUMIT_TIMEOUT:
|
||
// temp << "Failed";
|
||
// break;
|
||
// case pai::ios::job::Pending:
|
||
// case pai::ios::job::NotSubmitted:
|
||
// temp << "Queue";
|
||
// break;
|
||
// case pai::ios::job::Terminated:
|
||
// temp << "Terminated";
|
||
// break;
|
||
// case pai::ios::job::Suspended:
|
||
// temp << "Suspended";
|
||
// break;
|
||
// default:
|
||
// temp << "--";
|
||
// break;
|
||
// }
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// temp.str("");
|
||
// item.SetPropertyName(PRIORITY);
|
||
// switch(ws.GetPriority())
|
||
// {
|
||
// case pai::ios::job::VeryHigh:
|
||
// temp << "VeryHigh";
|
||
// break;
|
||
// case pai::ios::job::High:
|
||
// temp << "High";
|
||
// break;
|
||
// case pai::ios::job::Normal:
|
||
// temp << "Normal";
|
||
// break;
|
||
// case pai::ios::job::Low:
|
||
// temp << "Low";
|
||
// break;
|
||
// case pai::ios::job::VeryLow:
|
||
// temp << "VeryLow";
|
||
// break;
|
||
// default:
|
||
// temp << "--";
|
||
// break;
|
||
// }
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// temp.str("");
|
||
// item.SetPropertyName(CREATE_BY);
|
||
// temp << ws.GetCreatedBy();
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// itemgroup.push_back(items);
|
||
}
|
||
|
||
void Property::GetJobLogProperty(const long long id, std::vector<std::vector<PropertyItem> > & itemgroup)
|
||
{
|
||
std::vector<PropertyItem> items;
|
||
PropertyItem item;
|
||
|
||
// std::stringstream temp;
|
||
item.SetPropertyName(TYPE);
|
||
item.SetPropertyValue(TYPE_JOBLOG);
|
||
item.SetType(STRING);
|
||
item.SetUnit(NOUNIT);
|
||
items.push_back(item);
|
||
// temp.str("");
|
||
|
||
itemgroup.push_back(items);
|
||
}
|
||
|
||
void Property::GetWorkflowFolderProperty (const long long id, std::vector<std::vector<PropertyItem> > & itemgroup)
|
||
{
|
||
// std::vector<pai::ios::job::WorkflowPtr> vWorkflow = pai::ios::job::Workflow::FindBySurvey(id);
|
||
|
||
// std::vector<PropertyItem> items;
|
||
// PropertyItem item;
|
||
|
||
// std::stringstream temp;
|
||
// item.SetPropertyName(TYPE);
|
||
// item.SetPropertyValue(TYPE_WORKFLOW);
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// item.SetPropertyName(DISK_PATH);
|
||
// std::string logicPath = pai::ios::PathParser::GetLogicalPath(id, pai::ios::WORKFLOW);
|
||
// item.SetPropertyValue(logicPath.substr(0, logicPath.find_last_of("/")));
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// item.SetPropertyName(FILE_COUNT);
|
||
// temp << vWorkflow.size();
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
// temp.str("");
|
||
|
||
// itemgroup.push_back(items);
|
||
}
|
||
|
||
void Property::GetJobFolderProperty (const long long id, std::vector<std::vector<PropertyItem> > & itemgroup)
|
||
{
|
||
// //统计当前工区下的作业信息
|
||
// pai::ios::job::WorkflowSet ws;
|
||
// long jobCount = ws.CountJobsIdBySurveyId(id);
|
||
|
||
// std::vector< pai::ios::job::WorkflowSet > wfPtrs;
|
||
// for(int page = 1; page <= (jobCount / 100 + 1); page++)
|
||
// {
|
||
// std::vector< pai::ios::job::WorkflowSet > tmpPtr = ws.FindBySurvey(id, page, 100);
|
||
// for(size_t j=0; j<tmpPtr.size(); j++)
|
||
// {
|
||
// wfPtrs.push_back(tmpPtr[j]);
|
||
// }
|
||
// }
|
||
|
||
// int running = 0;
|
||
// int pause = 0;
|
||
// int success = 0;
|
||
// int failed = 0;
|
||
// for(size_t i=0; i< wfPtrs.size(); i++)
|
||
// {
|
||
// switch(wfPtrs[i].GetStatus())
|
||
// {
|
||
// case pai::ios::job::Running:
|
||
// running++;
|
||
// break;
|
||
// case pai::ios::job::Completed:
|
||
// success++;
|
||
// break;
|
||
// case pai::ios::job::Failed:
|
||
// failed++;
|
||
// break;
|
||
// case pai::ios::job::Pending:
|
||
// break;
|
||
// case pai::ios::job::Terminated:
|
||
// failed++;
|
||
// break;
|
||
// case pai::ios::job::Suspended:
|
||
// pause++;
|
||
// break;
|
||
// default:
|
||
// break;
|
||
// }
|
||
// }
|
||
|
||
// std::vector<PropertyItem> items;
|
||
// PropertyItem item;
|
||
|
||
// std::stringstream temp;
|
||
// item.SetPropertyName(TYPE);
|
||
// item.SetPropertyValue(TYPE_JOB);
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// item.SetPropertyName(DISK_PATH);
|
||
// std::string logicPath = pai::ios::PathParser::GetLogicalPath(id,pai::ios::JOB);
|
||
// item.SetPropertyValue(logicPath.substr(0, logicPath.find_last_of("/")));
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// item.SetPropertyName(JOB_COUNT);
|
||
// temp << wfPtrs.size();
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
// temp.str("");
|
||
|
||
// item.SetPropertyName(SUCCESS_RATE);
|
||
// double rate = (success + failed > 0) ? (((double) success) / (success + failed)) : 0;
|
||
// int sucRate = static_cast<int>(rate*100);
|
||
// temp << sucRate << "%";
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(FLOAT);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
// temp.str("");
|
||
|
||
// item.SetPropertyName(RUNNING);
|
||
// temp << running;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
// temp.str("");
|
||
|
||
// item.SetPropertyName(PAUSE);
|
||
// temp << pause;
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// itemgroup.push_back(items);
|
||
}
|
||
|
||
void Property::GetSeisFolderProperty (const long long id, std::vector<std::vector<PropertyItem> > & itemgroup)
|
||
{
|
||
// pai::ios::metadata::DatasetMetaDataMgmt dataMetaDataMgmt;
|
||
// std::vector<pai::ios::metadata::MetaDataInfo> datasets;
|
||
// dataMetaDataMgmt.GetDatasetMetaData(id, datasets);
|
||
|
||
// std::vector<PropertyItem> items;
|
||
// PropertyItem item;
|
||
|
||
// std::stringstream temp;
|
||
// item.SetPropertyName(TYPE);
|
||
// item.SetPropertyValue(TYPE_SEISMIC);
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// item.SetPropertyName(DISK_PATH);
|
||
// std::string logicPath = pai::ios::PathParser::GetLogicalPath(id, pai::ios::SEIS);
|
||
// item.SetPropertyValue(logicPath.substr(0, logicPath.find_last_of("/")));
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// item.SetPropertyName(FILE_COUNT);
|
||
// temp << datasets.size();
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
// temp.str("");
|
||
|
||
// item.SetPropertyName(TOTAL_SIZE);
|
||
// long long fileSize;
|
||
// fileSize = dataMetaDataMgmt.GetTotalSize(id);
|
||
// temp << pai::utils::CUtils::DigitSizeToString(fileSize);
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(FLOAT);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// itemgroup.push_back(items);
|
||
}
|
||
|
||
void Property::GetGridFolderProperty (const long long id, std::vector<std::vector<PropertyItem> > & itemgroup)
|
||
{
|
||
std::vector<PropertyItem> items;
|
||
PropertyItem item;
|
||
|
||
// std::stringstream temp;
|
||
item.SetPropertyName(TYPE);
|
||
item.SetPropertyValue(TYPE_GRID);
|
||
item.SetType(STRING);
|
||
item.SetUnit(NOUNIT);
|
||
items.push_back(item);
|
||
// temp.str("");
|
||
|
||
itemgroup.push_back(items);
|
||
}
|
||
|
||
void Property::GetGeometryFolderProperty (const long long id, std::vector<std::vector<PropertyItem> > & itemgroup)
|
||
{
|
||
// std::vector<PropertyItem> items;
|
||
// PropertyItem item;
|
||
|
||
// std::stringstream temp;
|
||
// item.SetPropertyName(TYPE);
|
||
// item.SetPropertyValue(TYPE_GEOMETRY);
|
||
// item.SetType(STRING);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// item.SetPropertyName(GEOMETRY_COUNT);
|
||
// pai::ios::geometry::Geometry geo;
|
||
// std::vector<GeometryInfo> geoInfos;
|
||
// geo.GetGeometry(id, geoInfos);
|
||
// temp << geoInfos.size();
|
||
// item.SetPropertyValue(temp.str());
|
||
// item.SetType(NUMBER);
|
||
// item.SetUnit(NOUNIT);
|
||
// items.push_back(item);
|
||
|
||
// itemgroup.push_back(items);
|
||
}
|
||
|
||
void Property::GetParamFolderProperty (const long long id, std::vector<std::vector<PropertyItem> > & itemgroup)
|
||
{
|
||
std::vector<PropertyItem> items;
|
||
PropertyItem item;
|
||
|
||
// std::stringstream temp;
|
||
item.SetPropertyName(TYPE);
|
||
item.SetPropertyValue(TYPE_PARAMETERSETFOLDER);
|
||
item.SetType(STRING);
|
||
item.SetUnit(NOUNIT);
|
||
items.push_back(item);
|
||
// temp.str("");
|
||
|
||
itemgroup.push_back(items);
|
||
}
|
||
|
||
void Property::GetFirstArrivalFolderProperty (const long long id, std::vector<std::vector<PropertyItem> > & itemgroup)
|
||
{
|
||
std::vector<PropertyItem> items;
|
||
PropertyItem item;
|
||
|
||
// std::stringstream temp;
|
||
item.SetPropertyName(TYPE);
|
||
item.SetPropertyValue(TYPE_FIRSTARRIVAL);
|
||
item.SetType(STRING);
|
||
item.SetUnit(NOUNIT);
|
||
items.push_back(item);
|
||
// temp.str("");
|
||
|
||
itemgroup.push_back(items);
|
||
}
|
||
|
||
void Property::GetMuteFolderProperty (const long long id, std::vector<std::vector<PropertyItem> > & itemgroup)
|
||
{
|
||
std::vector<PropertyItem> items;
|
||
PropertyItem item;
|
||
|
||
// std::stringstream temp;
|
||
item.SetPropertyName(TYPE);
|
||
item.SetPropertyValue(TYPE_MUTE);
|
||
item.SetType(STRING);
|
||
item.SetUnit(NOUNIT);
|
||
items.push_back(item);
|
||
// temp.str("");
|
||
|
||
itemgroup.push_back(items);
|
||
}
|
||
|
||
void Property::GetTraceEditFolderProperty (const long long id, std::vector<std::vector<PropertyItem> > & itemgroup)
|
||
{
|
||
std::vector<PropertyItem> items;
|
||
PropertyItem item;
|
||
|
||
// std::stringstream temp;
|
||
item.SetPropertyName(TYPE);
|
||
item.SetPropertyValue(TYPE_TRACEEDIT);
|
||
item.SetType(STRING);
|
||
item.SetUnit(NOUNIT);
|
||
items.push_back(item);
|
||
// temp.str("");
|
||
|
||
itemgroup.push_back(items);
|
||
}
|
||
|
||
void Property::GetStaticsFolderProperty (const long long id, std::vector<std::vector<PropertyItem> > & itemgroup)
|
||
{
|
||
std::vector<PropertyItem> items;
|
||
PropertyItem item;
|
||
|
||
// std::stringstream temp;
|
||
item.SetPropertyName(TYPE);
|
||
item.SetPropertyValue(TYPE_STATICS);
|
||
item.SetType(STRING);
|
||
item.SetUnit(NOUNIT);
|
||
items.push_back(item);
|
||
// temp.str("");
|
||
|
||
itemgroup.push_back(items);
|
||
}
|
||
|
||
void Property::GetHorizonFolderProperty (const long long id, std::vector<std::vector<PropertyItem> > & itemgroup)
|
||
{
|
||
std::vector<PropertyItem> items;
|
||
PropertyItem item;
|
||
|
||
// std::stringstream temp;
|
||
item.SetPropertyName(TYPE);
|
||
item.SetPropertyValue(TYPE_HORIZON);
|
||
item.SetType(STRING);
|
||
item.SetUnit(NOUNIT);
|
||
items.push_back(item);
|
||
// temp.str("");
|
||
|
||
itemgroup.push_back(items);
|
||
}
|
||
|
||
void Property::GetVelocityFolderProperty (const long long id, std::vector<std::vector<PropertyItem> > & itemgroup)
|
||
{
|
||
std::vector<PropertyItem> items;
|
||
PropertyItem item;
|
||
|
||
// std::stringstream temp;
|
||
item.SetPropertyName(TYPE);
|
||
item.SetPropertyValue(TYPE_VELOCITYFOLDER);
|
||
item.SetType(STRING);
|
||
item.SetUnit(NOUNIT);
|
||
items.push_back(item);
|
||
// temp.str("");
|
||
|
||
itemgroup.push_back(items);
|
||
}
|
||
|
||
void Property::GetVelPairFolderProperty (const long long id, std::vector<std::vector<PropertyItem> > & itemgroup)
|
||
{
|
||
std::vector<PropertyItem> items;
|
||
PropertyItem item;
|
||
|
||
// std::stringstream temp;
|
||
item.SetPropertyName(TYPE);
|
||
item.SetPropertyValue(TYPE_VELPAIRFOLDER);
|
||
item.SetType(STRING);
|
||
item.SetUnit(NOUNIT);
|
||
items.push_back(item);
|
||
// temp.str("");
|
||
|
||
itemgroup.push_back(items);
|
||
}
|
||
|
||
void Property::GetVelModelFolderProperty (const long long id, std::vector<std::vector<PropertyItem> > & itemgroup)
|
||
{
|
||
std::vector<PropertyItem> items;
|
||
PropertyItem item;
|
||
|
||
// std::stringstream temp;
|
||
item.SetPropertyName(TYPE);
|
||
item.SetPropertyValue(TYPE_VELMODEL);
|
||
item.SetType(STRING);
|
||
item.SetUnit(NOUNIT);
|
||
items.push_back(item);
|
||
// temp.str("");
|
||
|
||
itemgroup.push_back(items);
|
||
}
|
||
|
||
void Property::GetVelAnaFolderProperty (const long long id, std::vector<std::vector<PropertyItem> > & itemgroup)
|
||
{
|
||
std::vector<PropertyItem> items;
|
||
PropertyItem item;
|
||
|
||
// std::stringstream temp;
|
||
item.SetPropertyName(TYPE);
|
||
item.SetPropertyValue(TYPE_VELANALYSIS);
|
||
item.SetType(STRING);
|
||
item.SetUnit(NOUNIT);
|
||
items.push_back(item);
|
||
// temp.str("");
|
||
|
||
itemgroup.push_back(items);
|
||
}
|
||
|
||
void Property::GetModelingFolderProperty (const long long id, std::vector<std::vector<PropertyItem> > & itemgroup)
|
||
{
|
||
std::vector<PropertyItem> items;
|
||
PropertyItem item;
|
||
|
||
// std::stringstream temp;
|
||
item.SetPropertyName(TYPE);
|
||
item.SetPropertyValue(TYPE_MODELING);
|
||
item.SetType(STRING);
|
||
item.SetUnit(NOUNIT);
|
||
items.push_back(item);
|
||
// temp.str("");
|
||
|
||
itemgroup.push_back(items);
|
||
}
|
||
|
||
void Property::GetAttributeFolderProperty (const long long id, std::vector<std::vector<PropertyItem> > & itemgroup)
|
||
{
|
||
std::vector<PropertyItem> items;
|
||
PropertyItem item;
|
||
|
||
// std::stringstream temp;
|
||
item.SetPropertyName(TYPE);
|
||
item.SetPropertyValue(TYPE_ATTRIBUTE);
|
||
item.SetType(STRING);
|
||
item.SetUnit(NOUNIT);
|
||
items.push_back(item);
|
||
// temp.str("");
|
||
|
||
itemgroup.push_back(items);
|
||
}
|
||
|
||
std::string Property::GetSurveyTypeString(const SurveyType& type)
|
||
{
|
||
switch(type)
|
||
{
|
||
case DIM2: return std::string("2-D");
|
||
case DIM3: return std::string("3-D");
|
||
case DIM4: return std::string("4-D");
|
||
case DIM5: return std::string("Depth");
|
||
case DIM6: return std::string("Other");
|
||
|
||
case LAND: return std::string("Land");
|
||
case SEA: return std::string("Sea Bed");
|
||
case MARINE: return std::string("Marine");
|
||
case TRANSITION: return std::string("Transition Zone");
|
||
case OTHER: return std::string("Other");
|
||
|
||
default: return std::string("");
|
||
}
|
||
}
|
||
|
||
void Property::ChangeFileSizeUnit(long long size,std::string &realsize,pai::ios::property::ItemUnit & itemUnit,pai::ios::property::ItemUnit defaultUnit)
|
||
{
|
||
double byte = 1;
|
||
double kb = 1024 * byte;
|
||
double mb = 1024 * kb;
|
||
double gb = 1024 * mb;
|
||
double tb = 1024 * gb;
|
||
double pb = 1024 * tb;
|
||
switch(defaultUnit)
|
||
{
|
||
//默认参数类型
|
||
case Byte:
|
||
break;
|
||
case KB:
|
||
size *= static_cast<long long>(kb);
|
||
break;
|
||
case MB:
|
||
size *= static_cast<long long>(mb);
|
||
break;
|
||
case GB:
|
||
size *= static_cast<long long>(gb);
|
||
break;
|
||
case TB:
|
||
size *= static_cast<long long>(tb);
|
||
break;
|
||
case PB:
|
||
size *= static_cast<long long>(pb);
|
||
break;
|
||
default:
|
||
break;
|
||
}
|
||
std::stringstream stream;
|
||
stream.precision(1);
|
||
stream.setf(std::ios::fixed, std::ios::floatfield);
|
||
if(size < kb)
|
||
{
|
||
stream << size;
|
||
itemUnit = Byte;
|
||
}
|
||
else if(size < mb)
|
||
{
|
||
stream << static_cast<double>(size)/kb;
|
||
itemUnit = KB;
|
||
}
|
||
else if(size < gb)
|
||
{
|
||
stream <<static_cast<double>(size)/mb;
|
||
itemUnit = MB;
|
||
}
|
||
else if(size < tb)
|
||
{
|
||
stream << static_cast<double>(size)/gb;
|
||
itemUnit = GB;
|
||
}
|
||
else if(size < pb)
|
||
{
|
||
stream << static_cast<double>(size)/tb;
|
||
itemUnit = TB;
|
||
}
|
||
else
|
||
{
|
||
stream << static_cast<double>(size)/pb;
|
||
itemUnit = PB;
|
||
}
|
||
realsize = stream.str();
|
||
}
|
||
|