📄 oalefdefin.cpp
字号:
bits += hexBits[hexToInt(oaString(&hex[i], 1))]; } }}// *****************************************************************************// LefDefIn::setConstraint()//// This function sets the constraint for the given type, on the given layerNum,// with the given value. If the same constraint already exists, it is updated.// Note that soft constraints are preprended to make sure they are before the// hard constraints.// *****************************************************************************voidLefDefIn::setConstraint(oaConstraintGroup *group, oaSimpleConstraintType type, oaValue *value, oaBoolean hard, oaConstraintParamArray *params){ oaSimpleConstraintDef *def = oaSimpleConstraintDef::get(type); oaConstraint *c = oaSimpleConstraint::find(group, def, hard); if (c && c->isHard() == hard) { c->setValue(value); if (params) { c->setParams(*params); } } else { if (params && params->getNumElements()) { c = oaSimpleConstraint::create(def, value, hard, params); } else { c = oaSimpleConstraint::create(def, value, hard); } oaConstraintGroupMem::create(group, c, !hard); }}voidLefDefIn::setConstraint(oaConstraintGroup *group, oaLayerConstraintType type, oaLayerNum layerNum, oaValue *value, oaBoolean hard, oaConstraintParamArray *params){ oaLayerConstraintDef *def = oaLayerConstraintDef::get(type); oaConstraint *c = oaLayerConstraint::find(group, layerNum, def, hard); if (c && c->isHard() == hard) { c->setValue(value); if (params) { c->setParams(*params); } } else { if (params && params->getNumElements()) { c = oaLayerConstraint::create(layerNum, def, value, hard, params); } else { c = oaLayerConstraint::create(layerNum, def, value, hard); } oaConstraintGroupMem::create(group, c, !hard); }}voidLefDefIn::setConstraint(oaConstraintGroup *group, oaLayerPairConstraintType type, oaLayerNum layer1, oaLayerNum layer2, oaValue *value, oaBoolean hard, oaConstraintParamArray *params){ oaLayerPairConstraintDef *def = oaLayerPairConstraintDef::get(type); oaConstraint *c = oaLayerPairConstraint::find(group, layer1, layer2, def, hard); if (c && c->isHard() == hard) { c->setValue(value); if (params) { c->setParams(*params); } } else { if (params && params->getNumElements()) { c = oaLayerPairConstraint::create(layer1, layer2, def, value, hard, params); } else { c = oaLayerPairConstraint::create(layer1, layer2, def, value, hard); } oaConstraintGroupMem::create(group, c, !hard); }} // *****************************************************************************// LefDefIn::setProp()//// This function sets the property for the given object, with the given name,// to the given value.// *****************************************************************************voidLefDefIn::setBooleanProp(oaObject *object, const oaString &name, oaBoolean value){ oaProp *prop = oaProp::find(object, name); if (prop) { if (prop->getType() == oacBooleanPropType && ((oaBooleanProp*) prop)->getValue() == value) { return; } prop->destroy(); } oaBooleanProp::create(object, name, value);}voidLefDefIn::setProp(oaObject *object, const oaString &name, oaInt4 value){ oaProp *prop = oaProp::find(object, name); if (prop) { if (prop->getType() == oacIntPropType && ((oaIntProp*) prop)->getValue() == value) { return; } prop->destroy(); } oaIntProp::create(object, name, value);}voidLefDefIn::setProp(oaObject *object, const oaString &name, oaDouble value){ oaProp *prop = oaProp::find(object, name); if (prop) { if (prop->getType() == oacDoublePropType && ((oaDoubleProp*) prop)->getValue() == value) { return; } prop->destroy(); } oaDoubleProp::create(object, name, value);}voidLefDefIn::setProp(oaObject *object, const oaString &name, oaFloat value){ oaProp *prop = oaProp::find(object, name); if (prop) { if (prop->getType() == oacFloatPropType && ((oaFloatProp*) prop)->getValue() == value) { return; } prop->destroy(); } oaFloatProp::create(object, name, value);}voidLefDefIn::setProp(oaObject *object, const oaString &name, const oaString &value){ oaProp *prop = oaProp::find(object, name); if (prop) { if (prop->getType() == oacStringPropType) { oaString orig; ((oaStringProp*) prop)->getValue(orig); if (value == orig) { return; } } prop->destroy(); } oaStringProp::create(object, name, value);} // *****************************************************************************// LefDefIn::createProp()//// These functions create a database property on the specified object from the// information in the given lefDefProp. The different versions process the// particular type of property.// *****************************************************************************voidLefDefIn::createProp(const LefDefProp *prop, oaObject *obj, const oaString &val){ switch(prop->getType()) { case cLefDefIntPropType: createProp((LefDefIntProp*)prop, obj, val.toInt()); break; case cLefDefIntRangePropType: createProp((LefDefIntRangeProp*)prop, obj, val.toInt()); break; case cLefDefRealPropType: createProp((LefDefRealProp*)prop, obj, val.toDouble()); break; case cLefDefRealRangePropType: createProp((LefDefRealRangeProp*)prop, obj, val.toDouble()); break; case cLefDefStringPropType: createProp((LefDefStringProp*)prop, obj, val); break; }}voidLefDefIn::createProp(const LefDefIntProp *prop, oaObject *obj, oaInt4 val){ setProp(obj, prop->getName(), val);}voidLefDefIn::createProp(const LefDefRealProp *prop, oaObject *obj, oaDouble val){ setProp(obj, prop->getName(), val);}voidLefDefIn::createProp(const LefDefStringProp *prop, oaObject *obj, const oaString &val){ setProp(obj, prop->getName(), val);}voidLefDefIn::createProp(const LefDefIntRangeProp *prop, oaObject *obj, oaInt4 val){ oaProp *dbProp = oaProp::find(obj, prop->getName()); if (dbProp) { if (dbProp->getType() == oacIntRangePropType && ((oaIntRangeProp*) dbProp)->getValue() == val) { return; } dbProp->destroy(); } if (val < prop->getLower() || val > prop->getUpper()) { warn(cPropertyOutOfRange, (const char*) prop->getName()); return; } oaIntRangeProp::create(obj, prop->getName(), prop->getLower(), val, prop->getUpper());}voidLefDefIn::createProp(const LefDefRealRangeProp *prop, oaObject *obj, oaDouble val){ oaProp *dbProp = oaProp::find(obj, prop->getName()); if (dbProp) { if (dbProp->getType() == oacDoubleRangePropType && ((oaDoubleRangeProp*) dbProp)->getValue() == val) { return; } dbProp->destroy(); } if (val < prop->getLower() || val > prop->getUpper()) { warn(cPropertyOutOfRange, (const char*) prop->getName()); return; } oaDoubleRangeProp::create(obj, prop->getName(), prop->getLower(), val, prop->getUpper());}// *****************************************************************************// LefDefIn::setAttachedTechLibName()//// This function attaches the first library to the other library's techDB.// This convention is utilized by DFII applications. Attach the "techLibName"// property onto the first library// *****************************************************************************voidLefDefIn::setAttachedTechLibName(oaLib *lib, oaString &techLibName){ oaDMData *dmData = oaDMData::open(lib, 'a'); setProp(dmData, cTechLibName, techLibName); dmData->save(); dmData->close();}// *****************************************************************************// LefDefIn::init()//// This function clears the member variables for LefDefIn// *****************************************************************************voidLefDefIn::init(){ LefDefBase::init(); clearGenVias();}// *****************************************************************************// LefDefIn::close()//// This function saves the tech database if modified and lets the base// class handle closing of tech and library.// *****************************************************************************voidLefDefIn:: close(){ if (tech()->isModified()) { if (tech()->getMode() == 'r') { tech()->reopen('a'); } tech()->save(); } LefDefBase::close();}END_LEFDEF_NAMESPACE
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -