|
|
#include "nmDataPerforation.h"
|
|
|
|
|
|
// 流动段实现
|
|
|
FlowSegmentData::FlowSegmentData()
|
|
|
: isSelected(false)
|
|
|
{
|
|
|
startTime = nmDataAttribute("StartTime", 0.0, "hr");
|
|
|
skinValue = nmDataAttribute("SkinValue", 0.0, "");
|
|
|
segmentStart = nmDataAttribute("SegmentStart", 0.0, "hr");
|
|
|
segmentEnd = nmDataAttribute("SegmentEnd", 3000.0, "hr");
|
|
|
dSdQ = nmDataAttribute("dSdQ", 0.0, "1/B/D");
|
|
|
}
|
|
|
|
|
|
FlowSegmentData::FlowSegmentData(const nmDataAttribute& start,
|
|
|
const nmDataAttribute& skin,
|
|
|
const nmDataAttribute& segStart,
|
|
|
const nmDataAttribute& segEnd,
|
|
|
const nmDataAttribute& dSdq,
|
|
|
bool selected)
|
|
|
: startTime(start), skinValue(skin), segmentStart(segStart),
|
|
|
segmentEnd(segEnd), dSdQ(dSdq), isSelected(selected)
|
|
|
{
|
|
|
}
|
|
|
|
|
|
FlowSegmentData::FlowSegmentData(const nmDataAttribute& start,
|
|
|
const nmDataAttribute& skin,
|
|
|
const nmDataAttribute& segStart,
|
|
|
const nmDataAttribute& segEnd,
|
|
|
bool selected)
|
|
|
: startTime(start), skinValue(skin), segmentStart(segStart),
|
|
|
segmentEnd(segEnd), isSelected(selected)
|
|
|
{
|
|
|
dSdQ = nmDataAttribute("dSdQ", 0.0, "1/B/D");
|
|
|
}
|
|
|
|
|
|
nmDataPerforation::nmDataPerforation()
|
|
|
{
|
|
|
// 基本射孔信息
|
|
|
m_name = nmDataAttribute("Name", "Perforation#1", "");
|
|
|
m_mdStart = nmDataAttribute("MD Start", 6000.0, "m", UNIT_TYPE_LENGTH, QStringList(),
|
|
|
QStringList() << "m" << "cm" << "mm" << "in" << "0.1 in" << "ft" << "mile" << "km");
|
|
|
m_mdEnd = nmDataAttribute("MD End", 6030.0, "m", UNIT_TYPE_LENGTH, QStringList(),
|
|
|
QStringList() << "m" << "cm" << "mm" << "in" << "0.1 in" << "ft" << "mile" << "km");
|
|
|
m_skin = nmDataAttribute("Skin", 0.0, "");
|
|
|
|
|
|
// 表皮系数与流量关系初始化
|
|
|
m_skin0 = nmDataAttribute("Skin0", "0.0", "");
|
|
|
m_dSkindq = nmDataAttribute("dSkin/dq", "0.0", "");
|
|
|
m_linePoint1X = nmDataAttribute("LinePoint1X", "", "");
|
|
|
m_linePoint1Y = nmDataAttribute("LinePoint1Y", "", "");
|
|
|
m_linePoint2X = nmDataAttribute("LinePoint2X", "", "");
|
|
|
m_linePoint2Y = nmDataAttribute("LinePoint2Y", "", "");
|
|
|
|
|
|
// 流动段初始化
|
|
|
m_selectedSegmentIndex = 0;
|
|
|
m_isRateDependentEnabled = false;
|
|
|
m_isSnapToRateChanges = true;
|
|
|
m_showDatesEnabled = false;
|
|
|
m_startDateTime = QDateTime::currentDateTime();
|
|
|
|
|
|
// 创建默认流动段
|
|
|
FlowSegmentData defaultSegment;
|
|
|
defaultSegment.isSelected = true;
|
|
|
m_flowSegments.append(defaultSegment);
|
|
|
|
|
|
// 射孔封堵初始化
|
|
|
m_baseTime = QDateTime::currentDateTime();
|
|
|
}
|
|
|
|
|
|
nmDataPerforation::nmDataPerforation(const nmDataPerforation& other)
|
|
|
{
|
|
|
*this = other; // 调用赋值运算符实现深拷贝
|
|
|
}
|
|
|
|
|
|
nmDataPerforation& nmDataPerforation::operator=(const nmDataPerforation& other)
|
|
|
{
|
|
|
if (this != &other) {
|
|
|
// 基本射孔信息
|
|
|
m_name = other.m_name;
|
|
|
m_mdStart = other.m_mdStart;
|
|
|
m_mdEnd = other.m_mdEnd;
|
|
|
m_skin = other.m_skin;
|
|
|
|
|
|
// 表皮系数与流量关系
|
|
|
m_skin0 = other.m_skin0;
|
|
|
m_dSkindq = other.m_dSkindq;
|
|
|
m_linePoint1X = other.m_linePoint1X;
|
|
|
m_linePoint1Y = other.m_linePoint1Y;
|
|
|
m_linePoint2X = other.m_linePoint2X;
|
|
|
m_linePoint2Y = other.m_linePoint2Y;
|
|
|
|
|
|
// 流动段数据
|
|
|
m_flowSegments = other.m_flowSegments;
|
|
|
m_selectedSegmentIndex = other.m_selectedSegmentIndex;
|
|
|
m_isSnapToRateChanges = other.m_isSnapToRateChanges;
|
|
|
m_isRateDependentEnabled = other.m_isRateDependentEnabled;
|
|
|
m_showDatesEnabled = other.m_showDatesEnabled;
|
|
|
m_startDateTime = other.m_startDateTime;
|
|
|
|
|
|
// 射孔封堵数据
|
|
|
m_timeValues = other.m_timeValues;
|
|
|
m_timeStates = other.m_timeStates;
|
|
|
m_baseTime = other.m_baseTime;
|
|
|
}
|
|
|
return *this;
|
|
|
}
|
|
|
|
|
|
nmDataPerforation::~nmDataPerforation()
|
|
|
{
|
|
|
}
|
|
|
|
|
|
// 序列化 nmDataPerforation 为 RapidJSON Value
|
|
|
rapidjson::Value nmDataPerforation::ToJsonValue(rapidjson::Document::AllocatorType& allocator) const
|
|
|
{
|
|
|
rapidjson::Value perforationObject(rapidjson::kObjectType);
|
|
|
|
|
|
// 序列化基本射孔信息
|
|
|
perforationObject.AddMember("Name", m_name.ToJsonValue(allocator), allocator);
|
|
|
perforationObject.AddMember("MDStart", m_mdStart.ToJsonValue(allocator), allocator);
|
|
|
perforationObject.AddMember("MDEnd", m_mdEnd.ToJsonValue(allocator), allocator);
|
|
|
perforationObject.AddMember("Skin", m_skin.ToJsonValue(allocator), allocator);
|
|
|
|
|
|
// 序列化表皮系数与流量关系数据
|
|
|
perforationObject.AddMember("Skin0", m_skin0.ToJsonValue(allocator), allocator);
|
|
|
perforationObject.AddMember("dSkindq", m_dSkindq.ToJsonValue(allocator), allocator);
|
|
|
perforationObject.AddMember("LinePoint1X", m_linePoint1X.ToJsonValue(allocator), allocator);
|
|
|
perforationObject.AddMember("LinePoint1Y", m_linePoint1Y.ToJsonValue(allocator), allocator);
|
|
|
perforationObject.AddMember("LinePoint2X", m_linePoint2X.ToJsonValue(allocator), allocator);
|
|
|
perforationObject.AddMember("LinePoint2Y", m_linePoint2Y.ToJsonValue(allocator), allocator);
|
|
|
|
|
|
// 序列化流动段数据
|
|
|
rapidjson::Value segmentsArray(rapidjson::kArrayType);
|
|
|
for (int i = 0; i < m_flowSegments.size(); ++i) {
|
|
|
const FlowSegmentData& segment = m_flowSegments[i];
|
|
|
rapidjson::Value segmentObject(rapidjson::kObjectType);
|
|
|
|
|
|
segmentObject.AddMember("StartTime", segment.startTime.ToJsonValue(allocator), allocator);
|
|
|
segmentObject.AddMember("SkinValue", segment.skinValue.ToJsonValue(allocator), allocator);
|
|
|
segmentObject.AddMember("SegmentStart", segment.segmentStart.ToJsonValue(allocator), allocator);
|
|
|
segmentObject.AddMember("SegmentEnd", segment.segmentEnd.ToJsonValue(allocator), allocator);
|
|
|
segmentObject.AddMember("DSdQ", segment.dSdQ.ToJsonValue(allocator), allocator);
|
|
|
segmentObject.AddMember("IsSelected", segment.isSelected, allocator);
|
|
|
|
|
|
segmentsArray.PushBack(segmentObject, allocator);
|
|
|
}
|
|
|
|
|
|
perforationObject.AddMember("FlowSegments", segmentsArray, allocator);
|
|
|
perforationObject.AddMember("SelectedSegmentIndex", m_selectedSegmentIndex, allocator);
|
|
|
perforationObject.AddMember("IsSnapToRateChanges", m_isSnapToRateChanges, allocator);
|
|
|
perforationObject.AddMember("IsRateDependentEnabled", m_isRateDependentEnabled, allocator);
|
|
|
perforationObject.AddMember("ShowDatesEnabled", m_showDatesEnabled, allocator);
|
|
|
|
|
|
if (m_startDateTime.isValid()) {
|
|
|
QString timeString = m_startDateTime.toString(Qt::ISODate);
|
|
|
rapidjson::Value timeValue(timeString.toStdString().c_str(), allocator);
|
|
|
perforationObject.AddMember("StartDateTime", timeValue, allocator);
|
|
|
}
|
|
|
|
|
|
// 序列化射孔封堵数据
|
|
|
rapidjson::Value timeValuesArray(rapidjson::kArrayType);
|
|
|
for (int i = 0; i < m_timeValues.size(); ++i) {
|
|
|
timeValuesArray.PushBack(m_timeValues[i], allocator);
|
|
|
}
|
|
|
perforationObject.AddMember("timeValues", timeValuesArray, allocator);
|
|
|
|
|
|
rapidjson::Value statesArray(rapidjson::kArrayType);
|
|
|
for (int i = 0; i < m_timeStates.size(); ++i) {
|
|
|
rapidjson::Value stateValue(m_timeStates[i].toStdString().c_str(), allocator);
|
|
|
statesArray.PushBack(stateValue, allocator);
|
|
|
}
|
|
|
perforationObject.AddMember("timeStates", statesArray, allocator);
|
|
|
|
|
|
if (m_baseTime.isValid()) {
|
|
|
QString timeString = m_baseTime.toString(Qt::ISODate);
|
|
|
rapidjson::Value timeValue(timeString.toStdString().c_str(), allocator);
|
|
|
perforationObject.AddMember("baseTime", timeValue, allocator);
|
|
|
}
|
|
|
|
|
|
return perforationObject;
|
|
|
}
|
|
|
|
|
|
// 从 RapidJSON Value 反序列化数据到 nmDataPerforation
|
|
|
void nmDataPerforation::FromJsonValue(const rapidjson::Value& jsonValue)
|
|
|
{
|
|
|
// 反序列化基本射孔信息
|
|
|
if (jsonValue.HasMember("Name") && jsonValue["Name"].IsObject()) {
|
|
|
m_name.FromJsonValue(jsonValue["Name"]);
|
|
|
}
|
|
|
if (jsonValue.HasMember("MDStart") && jsonValue["MDStart"].IsObject()) {
|
|
|
m_mdStart.FromJsonValue(jsonValue["MDStart"]);
|
|
|
}
|
|
|
if (jsonValue.HasMember("MDEnd") && jsonValue["MDEnd"].IsObject()) {
|
|
|
m_mdEnd.FromJsonValue(jsonValue["MDEnd"]);
|
|
|
}
|
|
|
if (jsonValue.HasMember("Skin") && jsonValue["Skin"].IsObject()) {
|
|
|
m_skin.FromJsonValue(jsonValue["Skin"]);
|
|
|
}
|
|
|
|
|
|
// 反序列化表皮系数与流量关系数据
|
|
|
if (jsonValue.HasMember("Skin0") && jsonValue["Skin0"].IsObject()) {
|
|
|
m_skin0.FromJsonValue(jsonValue["Skin0"]);
|
|
|
}
|
|
|
if (jsonValue.HasMember("dSkindq") && jsonValue["dSkindq"].IsObject()) {
|
|
|
m_dSkindq.FromJsonValue(jsonValue["dSkindq"]);
|
|
|
}
|
|
|
if (jsonValue.HasMember("LinePoint1X") && jsonValue["LinePoint1X"].IsObject()) {
|
|
|
m_linePoint1X.FromJsonValue(jsonValue["LinePoint1X"]);
|
|
|
}
|
|
|
if (jsonValue.HasMember("LinePoint1Y") && jsonValue["LinePoint1Y"].IsObject()) {
|
|
|
m_linePoint1Y.FromJsonValue(jsonValue["LinePoint1Y"]);
|
|
|
}
|
|
|
if (jsonValue.HasMember("LinePoint2X") && jsonValue["LinePoint2X"].IsObject()) {
|
|
|
m_linePoint2X.FromJsonValue(jsonValue["LinePoint2X"]);
|
|
|
}
|
|
|
if (jsonValue.HasMember("LinePoint2Y") && jsonValue["LinePoint2Y"].IsObject()) {
|
|
|
m_linePoint2Y.FromJsonValue(jsonValue["LinePoint2Y"]);
|
|
|
}
|
|
|
|
|
|
// 反序列化流动段数据
|
|
|
if (jsonValue.HasMember("SnapToRateChanges") && jsonValue["SnapToRateChanges"].IsBool()) {
|
|
|
m_isSnapToRateChanges = jsonValue["SnapToRateChanges"].GetBool();
|
|
|
}
|
|
|
if (jsonValue.HasMember("IsRateDependentEnabled") && jsonValue["IsRateDependentEnabled"].IsBool()) {
|
|
|
m_isRateDependentEnabled = jsonValue["IsRateDependentEnabled"].GetBool();
|
|
|
}
|
|
|
|
|
|
if (jsonValue.HasMember("ShowDatesEnabled") && jsonValue["ShowDatesEnabled"].IsBool()) {
|
|
|
m_showDatesEnabled = jsonValue["ShowDatesEnabled"].GetBool();
|
|
|
}
|
|
|
|
|
|
if (jsonValue.HasMember("StartDateTime") && jsonValue["StartDateTime"].IsString()) {
|
|
|
QString timeString = QString::fromUtf8(jsonValue["StartDateTime"].GetString());
|
|
|
m_startDateTime = QDateTime::fromString(timeString, Qt::ISODate);
|
|
|
}
|
|
|
|
|
|
if (jsonValue.HasMember("FlowSegments") && jsonValue["FlowSegments"].IsArray()) {
|
|
|
m_flowSegments.clear();
|
|
|
const rapidjson::Value& segmentsArray = jsonValue["FlowSegments"];
|
|
|
|
|
|
for (rapidjson::SizeType i = 0; i < segmentsArray.Size(); ++i) {
|
|
|
const rapidjson::Value& segmentObject = segmentsArray[i];
|
|
|
FlowSegmentData segment;
|
|
|
|
|
|
if (segmentObject.HasMember("StartTime")) {
|
|
|
segment.startTime.FromJsonValue(segmentObject["StartTime"]);
|
|
|
}
|
|
|
if (segmentObject.HasMember("SkinValue")) {
|
|
|
segment.skinValue.FromJsonValue(segmentObject["SkinValue"]);
|
|
|
}
|
|
|
if (segmentObject.HasMember("SegmentStart")) {
|
|
|
segment.segmentStart.FromJsonValue(segmentObject["SegmentStart"]);
|
|
|
}
|
|
|
if (segmentObject.HasMember("SegmentEnd")) {
|
|
|
segment.segmentEnd.FromJsonValue(segmentObject["SegmentEnd"]);
|
|
|
}
|
|
|
if (segmentObject.HasMember("DSdQ")) {
|
|
|
segment.dSdQ.FromJsonValue(segmentObject["DSdQ"]);
|
|
|
}
|
|
|
if (segmentObject.HasMember("IsSelected")) {
|
|
|
segment.isSelected = segmentObject["IsSelected"].GetBool();
|
|
|
}
|
|
|
|
|
|
m_flowSegments.append(segment);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (jsonValue.HasMember("SelectedSegmentIndex") && jsonValue["SelectedSegmentIndex"].IsInt()) {
|
|
|
m_selectedSegmentIndex = jsonValue["SelectedSegmentIndex"].GetInt();
|
|
|
}
|
|
|
|
|
|
// 反序列化射孔封堵数据
|
|
|
if (jsonValue.HasMember("timeValues") && jsonValue["timeValues"].IsArray()) {
|
|
|
m_timeValues.clear();
|
|
|
const rapidjson::Value& timeValuesArray = jsonValue["timeValues"];
|
|
|
for (rapidjson::SizeType i = 0; i < timeValuesArray.Size(); ++i) {
|
|
|
if (timeValuesArray[i].IsNumber()) {
|
|
|
m_timeValues.append(timeValuesArray[i].GetDouble());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (jsonValue.HasMember("timeStates") && jsonValue["timeStates"].IsArray()) {
|
|
|
m_timeStates.clear();
|
|
|
const rapidjson::Value& statesArray = jsonValue["timeStates"];
|
|
|
for (rapidjson::SizeType i = 0; i < statesArray.Size(); ++i) {
|
|
|
if (statesArray[i].IsString()) {
|
|
|
m_timeStates.append(QString::fromUtf8(statesArray[i].GetString()));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
if (jsonValue.HasMember("baseTime") && jsonValue["baseTime"].IsString()) {
|
|
|
QString timeString = QString::fromUtf8(jsonValue["baseTime"].GetString());
|
|
|
m_baseTime = QDateTime::fromString(timeString, Qt::ISODate);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
// Getter and Setter for m_name
|
|
|
nmDataAttribute& nmDataPerforation::getName()
|
|
|
{
|
|
|
return m_name;
|
|
|
}
|
|
|
|
|
|
void nmDataPerforation::setName(const nmDataAttribute& name)
|
|
|
{
|
|
|
m_name = name;
|
|
|
}
|
|
|
|
|
|
// Getter and Setter for m_mdStart
|
|
|
nmDataAttribute& nmDataPerforation::getMdStart()
|
|
|
{
|
|
|
return m_mdStart;
|
|
|
}
|
|
|
|
|
|
void nmDataPerforation::setMdStart(const nmDataAttribute& mdStart)
|
|
|
{
|
|
|
m_mdStart = mdStart;
|
|
|
}
|
|
|
|
|
|
// Getter and Setter for m_mdEnd
|
|
|
nmDataAttribute& nmDataPerforation::getMdEnd()
|
|
|
{
|
|
|
return m_mdEnd;
|
|
|
}
|
|
|
|
|
|
void nmDataPerforation::setMdEnd(const nmDataAttribute& mdEnd)
|
|
|
{
|
|
|
m_mdEnd = mdEnd;
|
|
|
}
|
|
|
|
|
|
// Getter and Setter for m_skin
|
|
|
nmDataAttribute& nmDataPerforation::getSkin()
|
|
|
{
|
|
|
return m_skin;
|
|
|
}
|
|
|
|
|
|
void nmDataPerforation::setSkin(const nmDataAttribute& skin)
|
|
|
{
|
|
|
m_skin = skin;
|
|
|
}
|
|
|
|
|
|
// 表皮系数与流量关系方法实现
|
|
|
nmDataAttribute& nmDataPerforation::getSkin0()
|
|
|
{
|
|
|
return m_skin0;
|
|
|
}
|
|
|
|
|
|
void nmDataPerforation::setSkin0(const nmDataAttribute& skin0)
|
|
|
{
|
|
|
m_skin0 = skin0;
|
|
|
}
|
|
|
|
|
|
nmDataAttribute& nmDataPerforation::getdSkindq()
|
|
|
{
|
|
|
return m_dSkindq;
|
|
|
}
|
|
|
|
|
|
void nmDataPerforation::setdSkindq(const nmDataAttribute& dSkindq)
|
|
|
{
|
|
|
m_dSkindq = dSkindq;
|
|
|
}
|
|
|
|
|
|
nmDataAttribute& nmDataPerforation::getLinePoint1X()
|
|
|
{
|
|
|
return m_linePoint1X;
|
|
|
}
|
|
|
|
|
|
nmDataAttribute& nmDataPerforation::getLinePoint1Y()
|
|
|
{
|
|
|
return m_linePoint1Y;
|
|
|
}
|
|
|
|
|
|
nmDataAttribute& nmDataPerforation::getLinePoint2X()
|
|
|
{
|
|
|
return m_linePoint2X;
|
|
|
}
|
|
|
|
|
|
nmDataAttribute& nmDataPerforation::getLinePoint2Y()
|
|
|
{
|
|
|
return m_linePoint2Y;
|
|
|
}
|
|
|
|
|
|
void nmDataPerforation::setLinePoint1X(const nmDataAttribute& value)
|
|
|
{
|
|
|
m_linePoint1X = value;
|
|
|
}
|
|
|
|
|
|
void nmDataPerforation::setLinePoint1Y(const nmDataAttribute& value)
|
|
|
{
|
|
|
m_linePoint1Y = value;
|
|
|
}
|
|
|
|
|
|
void nmDataPerforation::setLinePoint2X(const nmDataAttribute& value)
|
|
|
{
|
|
|
m_linePoint2X = value;
|
|
|
}
|
|
|
|
|
|
void nmDataPerforation::setLinePoint2Y(const nmDataAttribute& value)
|
|
|
{
|
|
|
m_linePoint2Y = value;
|
|
|
}
|
|
|
|
|
|
void nmDataPerforation::setLinePositions(double x1, double y1, double x2, double y2)
|
|
|
{
|
|
|
m_linePoint1X.setValue(QString::number(x1, 'f', 5));
|
|
|
m_linePoint1Y.setValue(QString::number(y1, 'f', 5));
|
|
|
m_linePoint2X.setValue(QString::number(x2, 'f', 5));
|
|
|
m_linePoint2Y.setValue(QString::number(y2, 'f', 5));
|
|
|
}
|
|
|
|
|
|
void nmDataPerforation::getLinePositions(double& x1, double& y1, double& x2, double& y2) const
|
|
|
{
|
|
|
bool ok;
|
|
|
QString x1Str = m_linePoint1X.getValue().toString();
|
|
|
QString y1Str = m_linePoint1Y.getValue().toString();
|
|
|
QString x2Str = m_linePoint2X.getValue().toString();
|
|
|
QString y2Str = m_linePoint2Y.getValue().toString();
|
|
|
|
|
|
if (x1Str.isEmpty() || y1Str.isEmpty() || x2Str.isEmpty() || y2Str.isEmpty()) {
|
|
|
x1 = y1 = x2 = y2 = -999.0; // 特殊值表示未设置
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
x1 = x1Str.toDouble(&ok); if (!ok) x1 = -999.0;
|
|
|
y1 = y1Str.toDouble(&ok); if (!ok) y1 = -999.0;
|
|
|
x2 = x2Str.toDouble(&ok); if (!ok) x2 = -999.0;
|
|
|
y2 = y2Str.toDouble(&ok); if (!ok) y2 = -999.0;
|
|
|
}
|
|
|
|
|
|
// 流动段管理方法实现
|
|
|
const QVector<FlowSegmentData>& nmDataPerforation::getFlowSegments() const
|
|
|
{
|
|
|
return m_flowSegments;
|
|
|
}
|
|
|
|
|
|
void nmDataPerforation::setFlowSegments(const QVector<FlowSegmentData>& segments)
|
|
|
{
|
|
|
m_flowSegments = segments;
|
|
|
}
|
|
|
|
|
|
int nmDataPerforation::getSelectedSegmentIndex() const
|
|
|
{
|
|
|
return m_selectedSegmentIndex;
|
|
|
}
|
|
|
|
|
|
void nmDataPerforation::setSelectedSegmentIndex(int index)
|
|
|
{
|
|
|
if (index >= 0 && index < m_flowSegments.size()) {
|
|
|
m_selectedSegmentIndex = index;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
bool nmDataPerforation::isSnapToRateChangesEnabled() const
|
|
|
{
|
|
|
return m_isSnapToRateChanges;
|
|
|
}
|
|
|
|
|
|
void nmDataPerforation::setSnapToRateChangesEnabled(bool enabled)
|
|
|
{
|
|
|
m_isSnapToRateChanges = enabled;
|
|
|
}
|
|
|
|
|
|
bool nmDataPerforation::isRateDependentEnabled() const
|
|
|
{
|
|
|
return m_isRateDependentEnabled;
|
|
|
}
|
|
|
|
|
|
void nmDataPerforation::setRateDependentEnabled(bool enabled)
|
|
|
{
|
|
|
m_isRateDependentEnabled = enabled;
|
|
|
if (!enabled) {
|
|
|
// 如果禁用,重置所有dSdQ值
|
|
|
for (int i = 0; i < m_flowSegments.size(); ++i) {
|
|
|
m_flowSegments[i].dSdQ = nmDataAttribute("dSdQ", 0.0, "1/B/D");
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
|
|
|
bool nmDataPerforation::isShowDatesEnabled() const
|
|
|
{
|
|
|
return m_showDatesEnabled;
|
|
|
}
|
|
|
|
|
|
void nmDataPerforation::setShowDatesEnabled(bool enabled)
|
|
|
{
|
|
|
m_showDatesEnabled = enabled;
|
|
|
}
|
|
|
|
|
|
QDateTime nmDataPerforation::getStartDateTime() const
|
|
|
{
|
|
|
return m_startDateTime;
|
|
|
}
|
|
|
|
|
|
void nmDataPerforation::setStartDateTime(const QDateTime& dateTime)
|
|
|
{
|
|
|
m_startDateTime = dateTime;
|
|
|
}
|
|
|
|
|
|
// 射孔封堵管理方法实现
|
|
|
QList<double> nmDataPerforation::getTimeValues() const
|
|
|
{
|
|
|
return m_timeValues;
|
|
|
}
|
|
|
|
|
|
void nmDataPerforation::setTimeValues(const QList<double>& timeValues)
|
|
|
{
|
|
|
m_timeValues = timeValues;
|
|
|
}
|
|
|
|
|
|
QStringList nmDataPerforation::getTimeStates() const
|
|
|
{
|
|
|
return m_timeStates;
|
|
|
}
|
|
|
|
|
|
void nmDataPerforation::setTimeStates(const QStringList& timeStates)
|
|
|
{
|
|
|
m_timeStates = timeStates;
|
|
|
}
|
|
|
|
|
|
QDateTime nmDataPerforation::getBaseTime() const
|
|
|
{
|
|
|
return m_baseTime;
|
|
|
}
|
|
|
|
|
|
void nmDataPerforation::setBaseTime(const QDateTime& baseTime)
|
|
|
{
|
|
|
m_baseTime = baseTime;
|
|
|
}
|
|
|
|
|
|
// 射孔段级别的流动段查询方法
|
|
|
int nmDataPerforation::findFlowSegmentByTime(double timePoint) const
|
|
|
{
|
|
|
for (int i = 0; i < m_flowSegments.size(); ++i) {
|
|
|
double startTime = m_flowSegments[i].segmentStart.getValue().toDouble();
|
|
|
double endTime = m_flowSegments[i].segmentEnd.getValue().toDouble();
|
|
|
|
|
|
if (timePoint >= startTime && timePoint < endTime) {
|
|
|
return i;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return -1;
|
|
|
} |