void DA::AddAttr(SLnk& param, TFld::Type type, unsigned flg, const string& ex) { TFld * fld; mPrm.p_el.fldAdd(fld = new TFld(param.prmName.c_str(), param.prmDesc.c_str(), type, flg)); param.vlattr = mPrm.vlAt(param.prmName); fld->setReserve(ex); }
//****************************************************** //* B_BVTC * //****************************************************** KA_BVTC::KA_BVTC(TMdPrm& prm, uint16_t id, uint16_t n, bool has_params) : DA(prm), count_n(n), ID(id), with_params(has_params), config(3 | (n << 4) | (3 << 10)) { mTypeFT3 = KA; TFld * fld; mPrm.p_el.fldAdd(fld = new TFld("state", _("State"), TFld::Integer, TFld::NoWrite)); fld->setReserve("0:0"); for(int i = 0; i < count_n; i++) { AddChannel(i); } loadIO(true); }
B_BVI::B_BVI(TMdPrm& prm, uint16_t id, uint16_t n, bool has_params, bool has_ext_period) : DA(prm), ID(id), count_n(n), with_params(has_params), ext_period(has_ext_period) { mTypeFT3 = GRS; blkID = 0x20; TFld * fld; mPrm.p_el.fldAdd(fld = new TFld("state", _("State"), TFld::Integer, TFld::NoWrite)); fld->setReserve("0:0"); for(int i = 0; i < count_n; i++) { AddChannel(i); } loadIO(true); }
KA_GNS::KA_GNS(TMdPrm& prm, uint16_t id, uint16_t n, bool has_params) : DA(prm), ID(id), count_n(n), with_params(has_params), config(0xF | (n << 4) | (3 << 10)) { mTypeFT3 = KA; chan_err.clear(); TFld * fld; mPrm.p_el.fldAdd(fld = new TFld("state", _("State"), TFld::Integer, TFld::NoWrite)); fld->setReserve("0:0"); for(int i = 0; i < count_n; i++) { chan_err.insert(chan_err.end(), SDataRec()); AddNSChannel(i); } loadIO(true); }
TFld::TFld( TFld &ifld, const char *name ) : mLen(0), mDec(0), mType(TFld::Integer), mFlg(0) { mSel = NULL; mVal.s = NULL; mName = name ? string(name) : ifld.name(); mDescr = ifld.descr(); mType = ifld.type(); mFlg = ifld.flg(); mDef = ifld.def(); mRes = ifld.reserve(); mLen = ifld.len(); mDec = ifld.dec(); setValues(ifld.values()); setSelNames(ifld.selNames()); }
//************************************************* //* TCfg * //************************************************* TCfg::TCfg( TFld &fld, TConfig &owner ) : mView(true), mKeyUse(false), mNoTransl(false), mReqKey(false), mExtVal(false), mInCfgCh(false), mOwner(owner) { //Chek for self field for dinamic elements if(fld.flg()&TFld::SelfFld) { mFld = new TFld(); *mFld = fld; } else mFld = &fld; switch(mFld->type()) { case TFld::String: setType(TVariant::String, true, (fld.flg()&TCfg::Key)); TVariant::setS(mFld->def()); break; case TFld::Integer: setType(TVariant::Integer, true); TVariant::setI(s2ll(mFld->def())); break; case TFld::Real: setType(TVariant::Real, true); TVariant::setR(s2r(mFld->def())); break; case TFld::Boolean: setType(TVariant::Boolean, true); TVariant::setB((bool)s2i(mFld->def()));break; default: break; } if(fld.flg()&TCfg::Hide) mView = false; }