void CEC_FracExt::BuildDataDefnEnd(DataDefnBlk & DDB) { if (!DDB.ForFileSnpScn() && RB.sm_ChgVars) { if (RB.sm_ChgVars & SRSC_Mass) { if (DDB.BeginStruct(&Eq, "MsChg", NULL, DDB_NoPage, -1, 0|MarkerClosed)) { for (int i=0; i<Eq.Reactant.GetSize(); i++) { DDB.Double(SDB[Eq.Reactant[i].SpcId].SymOrTag(), "", DC_Qm, "kmol/s", &Eq.Reactant[i].m_dMsXfer, &Eq, isResult|noFileAtAll); } for (int i=0; i<Eq.Product.GetSize(); i++) DDB.Double(SDB[Eq.Product[i].SpcId].SymOrTag(), "", DC_Qm, "kmol/s", &Eq.Product[i].m_dMsXfer, &Eq, isResult|noFileAtAll); } DDB.EndStruct(); } if (RB.sm_ChgVars & SRSC_Molar) { if (DDB.BeginStruct(&Eq, "MlChg", NULL, DDB_NoPage, -1, 0|MarkerClosed)) { for (int i=0; i<Eq.Reactant.GetSize(); i++) { DDB.Double(SDB[Eq.Reactant[i].SpcId].SymOrTag(), "", DC_QKgMl, "kmol/s", &Eq.Reactant[i].m_dMlXfer, &Eq, isResult|noFileAtAll); } for (int i=0; i<Eq.Product.GetSize(); i++) DDB.Double(SDB[Eq.Product[i].SpcId].SymOrTag(), "", DC_QKgMl, "kmol/s", &Eq.Product[i].m_dMlXfer, &Eq, isResult|noFileAtAll); } DDB.EndStruct(); } } };
void CBlockEvaluator::Add_OnOff(DataDefnBlk &DDB, DDBPages PageIs) { BOOL DoIt=true; if (PrjFileVerNo()>=99) DoIt=DDB.BeginObject(m_pNd, "EB", "EB_Slct", 0, DDB_NoPage); if (DoIt) { DDB.String("", "EvalSeq.Feed", DC_, "", &m_sBlkSeqFeed, m_pNd, 0); if (StateSemanticsOn()) DDB.String("", "EvalSeq.Content", DC_, "", &m_sBlkSeqState, m_pNd, 0); if (m_Options&BEO_WithMakeups) DDB.Long("Makeups", "", DC_, "", xidNMakeups, m_pNd, isParmStopped|SetOnChange); if (m_Options&BEO_WithBleeds) DDB.Long("Bleeds", "", DC_, "", xidNBleeds, m_pNd, isParmStopped|SetOnChange); //DDB.Text(""); if (m_Options&BEO_WithMakeups) { for (int a=0; a<m_pMakeups.GetSize(); a++) m_pMakeups[a]->Add_OnOff(DDB, isParmStopped|SetOnChange, 100000+a*1000); } if (m_pRB) m_pRB->Add_OnOff(DDB, isParmStopped|SetOnChange); if (m_pHX) m_pHX->Add_OnOff(DDB, isParmStopped|SetOnChange); if (m_pEHX) m_pEHX->Add_OnOff(DDB, isParmStopped|SetOnChange); if (m_pVLE) m_pVLE->Add_OnOff(DDB, isParmStopped|SetOnChange); if (m_pEvap) m_pEvap->Add_OnOff(DDB, isParmStopped|SetOnChange); if (m_Options&BEO_WithBleeds) { for (int a=0; a<m_pBleeds.GetSize(); a++) m_pBleeds[a]->Add_OnOff(DDB, isParmStopped|SetOnChange, 200000+a*1000); } } if (PrjFileVerNo()>=99) DDB.EndObject(); if (PrjFileVerNo()<99 && (DDB.DoingPutData() && DDB.ForFileSnpScn() || 0)) { static DDBValueLst DDBBS[]={ {0, "RB EHX VLE" }, {1, "EHX RB VLE" }, {0}}; DDB.Byte("BlockActionSeq", "", DC_, "", xidOldBlkSeq, m_pNd, isParmStopped, DDBBS); } DDB.Text(""); };
void CSzSSA::BuildDataDefn(DataDefnBlk & DDB) { // DDB.CheckBox("SetSAM", "", DC_, "", &m_bSetSAM, this, m_bSAMCalcd ? 0 : isParm); if (DDB.BeginStruct(this, "SSA", 0)) { DDB.Byte ("", "Method", DC_, "", &m_iMethod, this, 0/*isParm*/, DDBMeth); DDB.Visibility(NSHM_All ,m_iMethod==SSA_Independent); if (!DDB.ForFileSnpScn()) DDB.CheckBoxBtn("SetData", "", DC_, "", xidSSAAllowSet, this, isParm); DDB.Long ("", "Solids", DC_, "", &m_iSolids, this, (m_bHasPSD || !DataSettable()) ? 0 : isParm, SDB.DDBSolSpListDash()); DDB.Visibility(); DDB.Double ("SeedSurfAreaM", "SAM", DC_SurfAreaM, "m^2/g", xidSSAPartSAM, this, (m_bHasPSD || !DataSettable()) ? 0 : isParm); DDB.Double ("SeedSurfAreaL", "SAL", DC_SurfAreaL, "m^2/L", xidSSAPartSAL, this, noFile); DDB.Double ("#/s", "", DC_, "", xidSSAPartNoperSec, this, noFile|InitHidden); DDB.Double ("#/L", "", DC_, "", xidSSAPartNoperVol, this, noFile|InitHidden); DDB.Double ("PartDiam", "D", DC_L, "um", xidSSAPartDiam, this, ((m_bHasPSD || !DataSettable()) ? 0 : isParm)|noFile); DDB.Double ("SolidsQm", "", DC_Qm, "kg/s", xidSSAPartSolidsQm, this, noFile|InitHidden); } DDB.EndStruct(); }
void CPipeTerm::BuildDataDefn(DataDefnBlk &DDB) { DDB.BeginStruct(this, NULL, NULL, DDB_NoPage); DDB.Text ("Flow Conditions"); DDB.Double ("Mass_Flow", "Qm", DC_Qm, "kg/s", xidQm, this, isResult|noFile|noSnap); DDB.Double ("Vol_Flow", "Qv", DC_Qv, "L/s", xidQv, this, isResult|noFile|noSnap); DDB.Double ("NVol_Flow", "NQv", DC_NQv, "NL/s", xidNQv, this, isResult|noFile|noSnap); DDB.Double ("Temperature", "T", DC_T, "C", xidTemp, this, isResult|noFile|noSnap); DDB.Double ("Density", "Rho", DC_Rho, "kg/m^3", xidRho, this, isResult|noFile|noSnap); DDB.Double ("NDensity", "NRho", DC_Rho, "kg/m^3", xidNRho, this, isResult|noFile|noSnap); DDB.Double ("PressureIn", "PIn", DC_P, "kPag", xidPIn, this, isResult|noFile|noSnap); DDB.Double ("PressureOut", "POut", DC_P, "kPag", xidPOut, this, isResult|noFile|noSnap); DDB.Visibility(NSHM_All); flag ParmOK=true; DDB.Visibility(); DDB.Text (""); DDB.Double("PressureOutRqd","POutRqd", DC_P, "kPag", &m_dPOut, this, isParm); DDB.Double("Head", "", DC_L, "m", &m_dHead, this, isParm); BuildDataDefnElevation(DDB); DDB.Text (""); m_FRB.BuildDataDefn(DDB, this, true); DDB.Visibility(NM_Dynamic|SM_All|HM_All); DDB.Text (""); m_VPB.BuildDataDefn(DDB, this, "Posn", 1); DDB.Visibility(NSHM_All); if (NoFlwIOs()>0 && !DDB.ForFileSnpScn()) IOFB(0,0)->BuildDataDefn(FBDDOpt_WithAll, DDB, this, "CtrlEqn", 2); DDB.Visibility(); DDB.Object(&m_Flows, this, NULL, NULL, DDB_RqdPage); DDB.Text(""); DDB.EndStruct(); }
/*This provides access to the variables of the model and calls the BuildDataDefn for objects used by the model.*/ void BeltCnv::BuildDataDefn(DataDefnBlk & DDB) { DDB.BeginStruct(this); //DDB.Page ("Parms"); DDB.Text (""); DDB.Visibility(NM_Dynamic|SM_All|HM_All); BuildDataDefnElevation(DDB); DDB.Text(""); DDB.Double ("BeltSpeed", "", DC_Ldt, "m/s", xidBeltSpeed, this, isResult); DDB.Visibility(); DDB.Double ("Length", "L", DC_L, "m", xidBeltLength, this, isParm); DDB.Visibility(NM_Dynamic|SM_All|HM_All); DDB.Double ("MaxSpeed", "", DC_Ldt, "m/s", &m_MaxVelocity, this, isParm); DDB.Double ("MaxLoading", "MaxSpillLoad", DC_MpL, "kg/m", &m_MaxSpillLoading, this, isParm); DDB.Double ("MinLoading", "", DC_MpL, "kg/m", &m_MinLoading, this, isParm|InitHidden); DDB.Long ("MaxTurndown", "", DC_, "", &m_MaxTurnDown, this, isParm|InitHidden); DDB.Visibility(NM_Dynamic|SM_All|HM_All); DDB.Double ("", "MaxStallLoad", DC_M, "kg", &m_MaxStallLoading, this, isParm); DDB.CheckBox("", "StartIfStalled", DC_, "", &m_fStartIfStalled, this, isParm); DDB.Byte ("", "WasRunning", DC_, "", &m_fWasRunning, this, isResult|InitHidden); DDB.Double ("TotalMass", "", DC_M, "kg", xidTotalMass, this, isResult); DDB.Double ("AvgLoading", "", DC_MpL, "kg/m", xidAvgLoading, this, isResult); if (OrigPrjFileVerNo()<90 && DDB.ForFileSnpScn()) DDB.String ("SpillArea", "", DC_, "", &m_sAreaTag, this, isParmStopped); DDB.Double ("TotalSpilt", "", DC_M, "kg", xidTotSpilt, this, isParm); DDB.Double ("TotalVented", "", DC_M, "kg", xidTotVented, this, isParm); DDB.Page("BeltDrive", DDB_RqdPage); DDB.Text ("Power Draw"); DDB.Double ("NoLoadPower", "", DC_Pwr, "kW", &m_NLPower, this, isParm); DDB.Double ("FullLoadPower","", DC_Pwr, "kW", &m_FLPower, this, isParm); DDB.Double ("Power", "", DC_Pwr, "kW", &m_Power, this, isResult); DDB.Text(""); m_Pwr.BuildDataDefn(DDB); m_BeltSB.BuildDataDefn(DDB, this, "Speed", 1); DDB.Visibility(); DDB.Text(""); DDB.Long ("NoWtMtrs", "", DC_, "", xidNWtMtrs, this, isParm); static DDBValueLst DDB1[] = { {QPT_None, "None" }, {QPT_FixedPts, "Fixed Points"}, {QPT_AllSections, "All Section Pts"}, {QPT_MinSections, "Min Section Pts"}, {0}}; DDB.CheckBox("ShowProfile", "", DC_, "", xidShowProf, this, isParm|SetOnChange); DDB.Visibility(NM_Dynamic|SM_All|HM_All, m_fShowProfile); DDB.Long ("ProfDispType", "", DC_, "", xidProfDispType, this, isParm, DDB1); //DDB.Visibility(NM_Dynamic|SM_All|HM_All, m_fShowProfile && m_ProfDispType==QPT_FixedPts); //DDB.Long ("ProfilePts", "", DC_, "", xidProfPts, this, isParm); DDB.Visibility(NM_Dynamic|SM_All|HM_All); DDB.Long ("NSections", "", DC_, "", xidNSections, this, isResult); if (DDB.BeginStruct(this, "MinSect", 0, DDB_NoPage)) { DDB.Double ("Length", "", DC_Frac, "%", &m_Q.m_dMinFracSectLen, this, isParm); DDB.Visibility(NM_Dynamic|SM_All|HM_All, m_Q.m_dMinFracSectLen>0); DDB.Double ("LoadTol", "", DC_Frac, "%", &m_Q.m_dLoadTol, this, isParm); DDB.Double ("TempTol", "", DC_Frac, "%", &m_Q.m_dTempTol, this, isParm); DDB.Double ("MFracTol", "", DC_Frac, "%", &m_Q.m_dMFracTol, this, isParm); } DDB.EndStruct(); DDB.Text(""); BuildDataDefnShowIOs(DDB); if (m_WtMtrPos.GetSize()) { DDB.Page("WtMtrs", DDB_RqdPage); if (DDB.BeginArray(this, "WtMtr", "WtMtr", m_WtMtrPos.GetSize(), 0)) { for (int i=0; i<m_WtMtrPos.GetSize(); i++) if (DDB.BeginElement(this, i)) { DDB.Double("Pos", "", DC_L , "m", xidWtrMtrPos0+i, this, isParm); DDB.Double("Loading", "", DC_MpL, "kg/m", xidWtrMtrLd0+i, this, isResult|0); DDB.Double("Rate", "", DC_Qm, "kg/s", xidWtrMtrRate0+i, this, isResult|0); DDB.Text(""); } } DDB.EndArray(); } int FdLst[MaxIOList], PrLst[MaxIOList]; int nFd=0, nPr=0; for (int i=0; i<NoFlwIOs(); i++) if (IOId_Self(i)==idFeed) FdLst[nFd++]=i; else if (IOId_Self(i)==idProd) PrLst[nPr++]=i; int DoOld=((!DDB.ForFiling() && !DDB.ForSnapShot() && !DDB.ForScenario() && !DDB.ForView()) || (DDB.ForFiling() && DDB.DoingPutData())); Strng Nm; DDB.Page("Feeds", DDB_RqdPage); if (DDB.BeginArray(this, "Fd", "BltCnvFd", nFd, 0)) for (i=0; i<nFd; i++) if (DDB.BeginElement(this, Nd_Rmt(FdLst[i])->FullObjTag())) { DDB.Double ("Pos", "", DC_L , "m", xidFeedPos0+i, this, isParm); DDB.Visibility(NM_Dynamic|SM_All|HM_All); DDB.CheckBoxBtn("Limited", "", DC_, "", xidFeedLimited0+i, this, isParm); DDB.Visibility(NM_Dynamic|SM_All|HM_All, m_Q.FeedLimited(i)); DDB.Double ("Capacity", "", DC_Frac, "%", xidFeedCapFrac0+i, this, isParm); DDB.Visibility(); DDB.Double ("Qm", "", DC_Qm , "kg/s", xidFeedQm0+i, this, 0); DDB.Text(""); if (DoOld) { DDB.BeginElement(this, i); DDB.Double("Pos", "", DC_L , "m", xidFeedPos0+i, this, isParm); DDB.Double("Qm", "", DC_Qm , "kg/s", xidFeedQm0+i, this, 0); } } DDB.EndArray(); DDB.Page("Products", DDB_RqdPage); if (DDB.BeginArray(this, "Pr", "BltCnvPr", nPr, 0)) for (i=0; i<nPr; i++) if (DDB.BeginElement(this, Nd_Rmt(PrLst[i])->FullObjTag())) { DDB.Double("Pos", "", DC_L , "m", xidProdPos0+i, this, isParm); DDB.Double("Removal","", DC_Frac , "%", xidProdRemove0+i, this, isParm); DDB.Double("Qm", "", DC_Qm , "kg/s", xidProdQm0+i, this, 0); DDB.Double("Loss", "", DC_Qm , "kg/s", xidProdLoss0+i, this, 0); DDB.Text(""); if (DoOld) { DDB.BeginElement(this, i); //DDB.TagComment(Nd_Rmt(PrLst[i])->FullObjTag()); //DDB.BeginElement(this, Nd_Rmt(PrLst[i])->FullObjTag()); DDB.Double("Pos", "", DC_L , "m", xidProdPos0+i, this, isParm); DDB.Double("Removal","", DC_Frac , "%", xidProdRemove0+i, this, isParm); DDB.Double("Qm", "", DC_Qm , "kg/s", xidProdQm0+i, this, 0); DDB.Double("Loss", "", DC_Qm , "kg/s", xidProdLoss0+i, this, 0); } } DDB.EndArray(); if (m_fShowProfile) DDB.Object(&m_Q.Profile(), this); //BuildDataDefnAreaIOs(DDB); DDB.EndStruct(); };
/*#F:This provides access to the variables of the model.*/ void X_Tie::BuildDataDefn(DataDefnBlk & DDB) { DDB.BeginStruct(this); DDB.Text (""); DDB.Double ("Pressure", "P", DC_P, "kPag", xidPMean, this, isResult|0); DDB.Visibility(NM_Dynamic|SM_All|HM_All); DDB.Double ("PressureEst", "PEst", DC_P, "kPag", xidPEstMean, this, isResult|0); DDB.Text (""); BuildDataDefnElevation(DDB); DDB.Visibility(NM_Probal|SM_All|HM_All); DDB.Text (""); long PBOpts= (m_VLE.Enabled() ? (PC_BasicPB & ~PC_SatP):PC_BasicPB); long DynOpts= (m_VLE.Enabled() ? (PC_BasicDyn & ~PC_SatP):PC_BasicDyn); m_PCtrl0.BuildDataDefn(DDB, this, NetProbalMethod(), PBOpts, DynOpts);//PC_Atmos|PC_Reqd); DDB.Visibility(); if (NetDynamicMethod()) { DDB.Text(""); DDB.CheckBoxBtn("NetworkIsolator", "", DC_, "", xidNetworkIsolator, this, isParmStopped|SetOnChange|AffectsStruct); } if (!m_NetworkIsolator) { m_BlkEval.Add_OnOff(DDB); if (PrjFileVerNo()<97 && (DDB.DoingPutData() && DDB.ForFileSnpScn() || 0)) { DDB.Text(""); m_RB.Add_OnOff(DDB); m_EHX.Add_OnOff(DDB); } DDB.Visibility(SM_Buffered|HM_All); m_Leak.Add_OnOff(DDB,0,100); DDB.Visibility(); GSM.Add_OnOff(DDB); DDB.CheckBox("ShowQFeed", "", DC_, "", &m_bShowQFeed, this, isParm|SetOnChange); DDB.CheckBox("ShowQProd", "", DC_, "", &m_bShowQProd, this, isParm|SetOnChange); } #if XREFTEST DDB.CheckBox("TagIOTest", "", DC_, "", &m_bTestTagIO, this, isParm|SetOnChange); #endif DDB.Text(""); BuildDataDefnShowIOs(DDB); BuildDataDefnIOOpts(DDB); if (m_NetworkIsolator) { DDB.Visibility(); DDB.Object(m_Accumulator, this, NULL, NULL, DDB_RqdPage); if (m_bShowQFeed) DDB.Object(&m_QFeed, this, NULL, NULL, DDB_RqdPage); m_QProd(); // ensure exists if (m_QProd.Exists()) { DDB.Visibility(NSHM_All, m_bShowQProd); DDB.Object(&m_QProd, this, NULL, NULL, DDB_RqdPage); DDB.Visibility(); } } else //if (1)//NetProbalMethod()) { DDB.Text(""); m_BlkEval.BuildDataDefn(DDB); GSM.BuildDataDefn(DDB); m_QFeed(); // ensure exists if (m_QFeed.Exists()) { DDB.Visibility(NSHM_All, m_bShowQFeed); DDB.Object(&m_QFeed, this, NULL, NULL, DDB_RqdPage); DDB.Visibility(); } m_QProd(); // ensure exists if (m_QProd.Exists()) { DDB.Visibility(NSHM_All, m_bShowQProd); DDB.Object(&m_QProd, this, NULL, NULL, DDB_RqdPage); DDB.Visibility(); } } //BuildDataDefnAreaIOs(DDB); DDB.EndStruct(); };