You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
345 lines
12 KiB
C++
345 lines
12 KiB
C++
|
3 weeks ago
|
#include "nmDataPvtParaForPebi.h"
|
||
|
|
#include "nmDataJsonTools.h"
|
||
|
|
|
||
|
|
nmDataPvtParaForPebi::nmDataPvtParaForPebi()
|
||
|
|
{
|
||
|
|
// 初始化成员变量
|
||
|
|
//m_vecPressure.clear();
|
||
|
|
//m_vecRso.clear();
|
||
|
|
//m_vecBo.clear();
|
||
|
|
//m_vecCo.clear();
|
||
|
|
//m_vecMiuo.clear();
|
||
|
|
//m_vecRouo.clear();
|
||
|
|
//m_vecRv.clear();
|
||
|
|
//m_vecBg.clear();
|
||
|
|
//m_vecCg.clear();
|
||
|
|
//m_vecMiug.clear();
|
||
|
|
//m_vecRoug.clear();
|
||
|
|
//m_vecZ.clear();
|
||
|
|
//m_vecRsw.clear();
|
||
|
|
//m_vecBw.clear();
|
||
|
|
//m_vecCw.clear();
|
||
|
|
//m_vecMiuw.clear();
|
||
|
|
//m_vecRouw.clear();
|
||
|
|
//m_vecV.clear();
|
||
|
|
//m_vecKKinitial.clear();
|
||
|
|
//m_vecCfCfinitial.clear();
|
||
|
|
//m_vecSo.clear();
|
||
|
|
//m_vecKro.clear();
|
||
|
|
//m_vecSg.clear();
|
||
|
|
//m_vecKrg.clear();
|
||
|
|
//m_vecSw.clear();
|
||
|
|
//m_vecKrw.clear();
|
||
|
|
}
|
||
|
|
|
||
|
|
// 序列化 nmDataPvtParaForPebi 为 RapidJSON Value
|
||
|
|
rapidjson::Value nmDataPvtParaForPebi::ToJsonValue(rapidjson::Document::AllocatorType& allocator) const
|
||
|
|
{
|
||
|
|
rapidjson::Value pvtObject(rapidjson::kObjectType);
|
||
|
|
// 只序列化每个 QVector 的第一个元素
|
||
|
|
if (!m_vecPressure.isEmpty()) {
|
||
|
|
pvtObject.AddMember("Pressure", m_vecPressure[0], allocator);
|
||
|
|
}
|
||
|
|
pvtObject.AddMember("Pb", m_pb.getValue().toDouble(), allocator);
|
||
|
|
if (!m_vecRso.isEmpty()) {
|
||
|
|
pvtObject.AddMember("Rso", m_vecRso[0], allocator);
|
||
|
|
}
|
||
|
|
if (!m_vecBo.isEmpty()) {
|
||
|
|
pvtObject.AddMember("Bo", m_vecBo[0], allocator);
|
||
|
|
}
|
||
|
|
if (!m_vecCo.isEmpty()) {
|
||
|
|
pvtObject.AddMember("Co", m_vecCo[0], allocator);
|
||
|
|
}
|
||
|
|
if (!m_vecMiuo.isEmpty()) {
|
||
|
|
pvtObject.AddMember("Miuo", m_vecMiuo[0], allocator);
|
||
|
|
}
|
||
|
|
if (!m_vecRouo.isEmpty()) {
|
||
|
|
pvtObject.AddMember("Rouo", m_vecRouo[0], allocator);
|
||
|
|
}
|
||
|
|
if (!m_vecRv.isEmpty()) {
|
||
|
|
pvtObject.AddMember("Rv", m_vecRv[0], allocator);
|
||
|
|
}
|
||
|
|
if (!m_vecBg.isEmpty()) {
|
||
|
|
pvtObject.AddMember("Bg", m_vecBg[0], allocator);
|
||
|
|
}
|
||
|
|
if (!m_vecCg.isEmpty()) {
|
||
|
|
pvtObject.AddMember("Cg", m_vecCg[0], allocator);
|
||
|
|
}
|
||
|
|
if (!m_vecMiug.isEmpty()) {
|
||
|
|
pvtObject.AddMember("Miug", m_vecMiug[0], allocator);
|
||
|
|
}
|
||
|
|
if (!m_vecRoug.isEmpty()) {
|
||
|
|
pvtObject.AddMember("Roug", m_vecRoug[0], allocator);
|
||
|
|
}
|
||
|
|
if (!m_vecZ.isEmpty()) {
|
||
|
|
pvtObject.AddMember("Z", m_vecZ[0], allocator);
|
||
|
|
}
|
||
|
|
if (!m_vecRsw.isEmpty()) {
|
||
|
|
pvtObject.AddMember("Rsw", m_vecRsw[0], allocator);
|
||
|
|
}
|
||
|
|
if (!m_vecBw.isEmpty()) {
|
||
|
|
pvtObject.AddMember("Bw", m_vecBw[0], allocator);
|
||
|
|
}
|
||
|
|
if (!m_vecCw.isEmpty()) {
|
||
|
|
pvtObject.AddMember("Cw", m_vecCw[0], allocator);
|
||
|
|
}
|
||
|
|
if (!m_vecMiuw.isEmpty()) {
|
||
|
|
pvtObject.AddMember("Miuw", m_vecMiuw[0], allocator);
|
||
|
|
}
|
||
|
|
if (!m_vecRouw.isEmpty()) {
|
||
|
|
pvtObject.AddMember("Rouw", m_vecRouw[0], allocator);
|
||
|
|
}
|
||
|
|
if (!m_vecV.isEmpty()) {
|
||
|
|
pvtObject.AddMember("V", m_vecV[0], allocator);
|
||
|
|
}
|
||
|
|
if (!m_vecKKinitial.isEmpty()) {
|
||
|
|
pvtObject.AddMember("KKinitial", m_vecKKinitial[0], allocator);
|
||
|
|
}
|
||
|
|
if (!m_vecCfCfinitial.isEmpty()) {
|
||
|
|
pvtObject.AddMember("CfCfinitial", m_vecCfCfinitial[0], allocator);
|
||
|
|
}
|
||
|
|
if (!m_vecSo.isEmpty()) {
|
||
|
|
pvtObject.AddMember("So", m_vecSo[0], allocator);
|
||
|
|
}
|
||
|
|
if (!m_vecKro.isEmpty()) {
|
||
|
|
pvtObject.AddMember("Kro", m_vecKro[0], allocator);
|
||
|
|
}
|
||
|
|
if (!m_vecSg.isEmpty()) {
|
||
|
|
pvtObject.AddMember("Sg", m_vecSg[0], allocator);
|
||
|
|
}
|
||
|
|
if (!m_vecKrg.isEmpty()) {
|
||
|
|
pvtObject.AddMember("Krg", m_vecKrg[0], allocator);
|
||
|
|
}
|
||
|
|
if (!m_vecSw.isEmpty()) {
|
||
|
|
pvtObject.AddMember("Sw", m_vecSw[0], allocator);
|
||
|
|
}
|
||
|
|
if (!m_vecKrw.isEmpty()) {
|
||
|
|
pvtObject.AddMember("Krw", m_vecKrw[0], allocator);
|
||
|
|
}
|
||
|
|
|
||
|
|
return pvtObject;
|
||
|
|
}
|
||
|
|
|
||
|
|
// 从 RapidJSON Value 反序列化数据到 nmDataPvtParaForPebi
|
||
|
|
void nmDataPvtParaForPebi::FromJsonValue(const rapidjson::Value& jsonValue)
|
||
|
|
{
|
||
|
|
// Pressure
|
||
|
|
if (jsonValue.HasMember("Pressure") && jsonValue["Pressure"].IsNumber()) {
|
||
|
|
double memberValue = jsonValue["Pressure"].GetDouble();
|
||
|
|
m_vecPressure.append(memberValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
// Pb
|
||
|
|
if (jsonValue.HasMember("Pb") && jsonValue["Pb"].IsNumber()) {
|
||
|
|
double memberValue = jsonValue["Pb"].GetDouble();
|
||
|
|
m_pb.setValue(memberValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
// Rso
|
||
|
|
if (jsonValue.HasMember("Rso") && jsonValue["Rso"].IsNumber()) {
|
||
|
|
double memberValue = jsonValue["Rso"].GetDouble();
|
||
|
|
m_vecRso.append(memberValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
// Bo
|
||
|
|
if (jsonValue.HasMember("Bo") && jsonValue["Bo"].IsNumber()) {
|
||
|
|
double memberValue = jsonValue["Bo"].GetDouble();
|
||
|
|
m_vecBo.append(memberValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
// Co
|
||
|
|
if (jsonValue.HasMember("Co") && jsonValue["Co"].IsNumber()) {
|
||
|
|
double memberValue = jsonValue["Co"].GetDouble();
|
||
|
|
m_vecCo.append(memberValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
// Miuo
|
||
|
|
if (jsonValue.HasMember("Miuo") && jsonValue["Miuo"].IsNumber()) {
|
||
|
|
double memberValue = jsonValue["Miuo"].GetDouble();
|
||
|
|
m_vecMiuo.append(memberValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
// Rouo
|
||
|
|
if (jsonValue.HasMember("Rouo") && jsonValue["Rouo"].IsNumber()) {
|
||
|
|
double memberValue = jsonValue["Rouo"].GetDouble();
|
||
|
|
m_vecRouo.append(memberValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
// Rv
|
||
|
|
if (jsonValue.HasMember("Rv") && jsonValue["Rv"].IsNumber()) {
|
||
|
|
double memberValue = jsonValue["Rv"].GetDouble();
|
||
|
|
m_vecRv.append(memberValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
// Bg
|
||
|
|
if (jsonValue.HasMember("Bg") && jsonValue["Bg"].IsNumber()) {
|
||
|
|
double memberValue = jsonValue["Bg"].GetDouble();
|
||
|
|
m_vecBg.append(memberValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
// Cg
|
||
|
|
if (jsonValue.HasMember("Cg") && jsonValue["Cg"].IsNumber()) {
|
||
|
|
double memberValue = jsonValue["Cg"].GetDouble();
|
||
|
|
m_vecCg.append(memberValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
// Miug
|
||
|
|
if (jsonValue.HasMember("Miug") && jsonValue["Miug"].IsNumber()) {
|
||
|
|
double memberValue = jsonValue["Miug"].GetDouble();
|
||
|
|
m_vecMiug.append(memberValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
// Roug
|
||
|
|
if (jsonValue.HasMember("Roug") && jsonValue["Roug"].IsNumber()) {
|
||
|
|
double memberValue = jsonValue["Roug"].GetDouble();
|
||
|
|
m_vecRoug.append(memberValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
// Z
|
||
|
|
if (jsonValue.HasMember("Z") && jsonValue["Z"].IsNumber()) {
|
||
|
|
double memberValue = jsonValue["Z"].GetDouble();
|
||
|
|
m_vecZ.append(memberValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
// Rsw
|
||
|
|
if (jsonValue.HasMember("Rsw") && jsonValue["Rsw"].IsNumber()) {
|
||
|
|
double memberValue = jsonValue["Rsw"].GetDouble();
|
||
|
|
m_vecRsw.append(memberValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
// Bw
|
||
|
|
if (jsonValue.HasMember("Bw") && jsonValue["Bw"].IsNumber()) {
|
||
|
|
double memberValue = jsonValue["Bw"].GetDouble();
|
||
|
|
m_vecBw.append(memberValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
// Cw
|
||
|
|
if (jsonValue.HasMember("Cw") && jsonValue["Cw"].IsNumber()) {
|
||
|
|
double memberValue = jsonValue["Cw"].GetDouble();
|
||
|
|
m_vecCw.append(memberValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
// Miuw
|
||
|
|
if (jsonValue.HasMember("Miuw") && jsonValue["Miuw"].IsNumber()) {
|
||
|
|
double memberValue = jsonValue["Miuw"].GetDouble();
|
||
|
|
m_vecMiuw.append(memberValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
// Rouw
|
||
|
|
if (jsonValue.HasMember("Rouw") && jsonValue["Rouw"].IsNumber()) {
|
||
|
|
double memberValue = jsonValue["Rouw"].GetDouble();
|
||
|
|
m_vecRouw.append(memberValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
// V
|
||
|
|
if (jsonValue.HasMember("V") && jsonValue["V"].IsNumber()) {
|
||
|
|
double memberValue = jsonValue["V"].GetDouble();
|
||
|
|
m_vecV.append(memberValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
// KKinitial
|
||
|
|
if (jsonValue.HasMember("KKinitial") && jsonValue["KKinitial"].IsNumber()) {
|
||
|
|
double memberValue = jsonValue["KKinitial"].GetDouble();
|
||
|
|
m_vecKKinitial.append(memberValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
// CfCfinitial
|
||
|
|
if (jsonValue.HasMember("CfCfinitial") && jsonValue["CfCfinitial"].IsNumber()) {
|
||
|
|
double memberValue = jsonValue["CfCfinitial"].GetDouble();
|
||
|
|
m_vecCfCfinitial.append(memberValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
// So
|
||
|
|
if (jsonValue.HasMember("So") && jsonValue["So"].IsNumber()) {
|
||
|
|
double memberValue = jsonValue["So"].GetDouble();
|
||
|
|
m_vecSo.append(memberValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
// Kro
|
||
|
|
if (jsonValue.HasMember("Kro") && jsonValue["Kro"].IsNumber()) {
|
||
|
|
double memberValue = jsonValue["Kro"].GetDouble();
|
||
|
|
m_vecKro.append(memberValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
// Sg
|
||
|
|
if (jsonValue.HasMember("Sg") && jsonValue["Sg"].IsNumber()) {
|
||
|
|
double memberValue = jsonValue["Sg"].GetDouble();
|
||
|
|
m_vecSg.append(memberValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
// Krg
|
||
|
|
if (jsonValue.HasMember("Krg") && jsonValue["Krg"].IsNumber()) {
|
||
|
|
double memberValue = jsonValue["Krg"].GetDouble();
|
||
|
|
m_vecKrg.append(memberValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
// Sw
|
||
|
|
if (jsonValue.HasMember("Sw") && jsonValue["Sw"].IsNumber()) {
|
||
|
|
double memberValue = jsonValue["Sw"].GetDouble();
|
||
|
|
m_vecSw.append(memberValue);
|
||
|
|
}
|
||
|
|
|
||
|
|
// Krw
|
||
|
|
if (jsonValue.HasMember("Krw") && jsonValue["Krw"].IsNumber()) {
|
||
|
|
double memberValue = jsonValue["Krw"].GetDouble();
|
||
|
|
m_vecKrw.append(memberValue);
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
// Getter 方法实现
|
||
|
|
const QVector<double>& nmDataPvtParaForPebi::getPressure() const { return m_vecPressure; }
|
||
|
|
const nmDataAttribute & nmDataPvtParaForPebi::getPb() const { return m_pb; }
|
||
|
|
const QVector<double>& nmDataPvtParaForPebi::getRso() const { return m_vecRso; }
|
||
|
|
const QVector<double>& nmDataPvtParaForPebi::getBo() const { return m_vecBo; }
|
||
|
|
const QVector<double>& nmDataPvtParaForPebi::getCo() const { return m_vecCo; }
|
||
|
|
const QVector<double>& nmDataPvtParaForPebi::getMiuo() const { return m_vecMiuo; }
|
||
|
|
const QVector<double>& nmDataPvtParaForPebi::getRouo() const { return m_vecRouo; }
|
||
|
|
const QVector<double>& nmDataPvtParaForPebi::getRv() const { return m_vecRv; }
|
||
|
|
const QVector<double>& nmDataPvtParaForPebi::getBg() const { return m_vecBg; }
|
||
|
|
const QVector<double>& nmDataPvtParaForPebi::getCg() const { return m_vecCg; }
|
||
|
|
const QVector<double>& nmDataPvtParaForPebi::getMiug() const { return m_vecMiug; }
|
||
|
|
const QVector<double>& nmDataPvtParaForPebi::getRoug() const { return m_vecRoug; }
|
||
|
|
const QVector<double>& nmDataPvtParaForPebi::getZ() const { return m_vecZ; }
|
||
|
|
const QVector<double>& nmDataPvtParaForPebi::getRsw() const { return m_vecRsw; }
|
||
|
|
const QVector<double>& nmDataPvtParaForPebi::getBw() const { return m_vecBw; }
|
||
|
|
const QVector<double>& nmDataPvtParaForPebi::getCw() const { return m_vecCw; }
|
||
|
|
const QVector<double>& nmDataPvtParaForPebi::getMiuw() const { return m_vecMiuw; }
|
||
|
|
const QVector<double>& nmDataPvtParaForPebi::getRouw() const { return m_vecRouw; }
|
||
|
|
const QVector<double>& nmDataPvtParaForPebi::getV() const { return m_vecV; }
|
||
|
|
const QVector<double>& nmDataPvtParaForPebi::getKKinitial() const { return m_vecKKinitial; }
|
||
|
|
const QVector<double>& nmDataPvtParaForPebi::getCfCfinitial() const { return m_vecCfCfinitial; }
|
||
|
|
const QVector<double>& nmDataPvtParaForPebi::getSo() const { return m_vecSo; }
|
||
|
|
const QVector<double>& nmDataPvtParaForPebi::getKro() const { return m_vecKro; }
|
||
|
|
const QVector<double>& nmDataPvtParaForPebi::getSg() const { return m_vecSg; }
|
||
|
|
const QVector<double>& nmDataPvtParaForPebi::getKrg() const { return m_vecKrg; }
|
||
|
|
const QVector<double>& nmDataPvtParaForPebi::getSw() const { return m_vecSw; }
|
||
|
|
const QVector<double>& nmDataPvtParaForPebi::getKrw() const { return m_vecKrw; }
|
||
|
|
|
||
|
|
// Setter 方法实现
|
||
|
|
void nmDataPvtParaForPebi::setPressure(const QVector<double>& pressure) { m_vecPressure = pressure; }
|
||
|
|
void nmDataPvtParaForPebi::setPb(const nmDataAttribute & pb) { m_pb = pb; }
|
||
|
|
void nmDataPvtParaForPebi::setRso(const QVector<double>& rso) { m_vecRso = rso; }
|
||
|
|
void nmDataPvtParaForPebi::setBo(const QVector<double>& bo) { m_vecBo = bo; }
|
||
|
|
void nmDataPvtParaForPebi::setCo(const QVector<double>& co) { m_vecCo = co; }
|
||
|
|
void nmDataPvtParaForPebi::setMiuo(const QVector<double>& miuo) { m_vecMiuo = miuo; }
|
||
|
|
void nmDataPvtParaForPebi::setRouo(const QVector<double>& rouo) { m_vecRouo = rouo; }
|
||
|
|
void nmDataPvtParaForPebi::setRv(const QVector<double>& rv) { m_vecRv = rv; }
|
||
|
|
void nmDataPvtParaForPebi::setBg(const QVector<double>& bg) { m_vecBg = bg; }
|
||
|
|
void nmDataPvtParaForPebi::setCg(const QVector<double>& cg) { m_vecCg = cg; }
|
||
|
|
void nmDataPvtParaForPebi::setMiug(const QVector<double>& miug) { m_vecMiug = miug; }
|
||
|
|
void nmDataPvtParaForPebi::setRoug(const QVector<double>& roug) { m_vecRoug = roug; }
|
||
|
|
void nmDataPvtParaForPebi::setZ(const QVector<double>& z) { m_vecZ = z; }
|
||
|
|
void nmDataPvtParaForPebi::setRsw(const QVector<double>& rsw) { m_vecRsw = rsw; }
|
||
|
|
void nmDataPvtParaForPebi::setBw(const QVector<double>& bw) { m_vecBw = bw; }
|
||
|
|
void nmDataPvtParaForPebi::setCw(const QVector<double>& cw) { m_vecCw = cw; }
|
||
|
|
void nmDataPvtParaForPebi::setMiuw(const QVector<double>& miuw) { m_vecMiuw = miuw; }
|
||
|
|
void nmDataPvtParaForPebi::setRouw(const QVector<double>& rouw) { m_vecRouw = rouw; }
|
||
|
|
void nmDataPvtParaForPebi::setV(const QVector<double>& v) { m_vecV = v; }
|
||
|
|
void nmDataPvtParaForPebi::setKKinitial(const QVector<double>& kkinitial) { m_vecKKinitial = kkinitial; }
|
||
|
|
void nmDataPvtParaForPebi::setCfCfinitial(const QVector<double>& cfcfinitial) { m_vecCfCfinitial = cfcfinitial; }
|
||
|
|
void nmDataPvtParaForPebi::setSo(const QVector<double>& so) { m_vecSo = so; }
|
||
|
|
void nmDataPvtParaForPebi::setKro(const QVector<double>& kro) { m_vecKro = kro; }
|
||
|
|
void nmDataPvtParaForPebi::setSg(const QVector<double>& sg) { m_vecSg = sg; }
|
||
|
|
void nmDataPvtParaForPebi::setKrg(const QVector<double>& krg) { m_vecKrg = krg; }
|
||
|
|
void nmDataPvtParaForPebi::setSw(const QVector<double>& sw) { m_vecSw = sw; }
|
||
|
|
void nmDataPvtParaForPebi::setKrw(const QVector<double>& krw) { m_vecKrw = krw; }
|