#include "BlockParameterWishbone.h"
#include "Parameters.h"
-ReferenceBlock::ReferenceBlock(const QString _xmlFile) : AbstractBlock() {
- xmlFile = _xmlFile;
+ReferenceBlock::ReferenceBlock(const QString _xmlFile) : AbstractBlock(NULL) {
+ xmlFile = _xmlFile;
}
void ReferenceBlock::addCategory(int id) {
categories.append(id);
}
-void ReferenceBlock::setBriefDescription(const QString& str) {
+void ReferenceBlock::setDescription(const QString& str) {
if(str != NULL)
- descriptionBrief = str;
-}
-
-void ReferenceBlock::setDetailedDescription(const QString& str) {
- if(str != NULL)
- descriptionDetail = str;
+ description = str;
}
void ReferenceBlock::addImplementation(BlockImplementation *impl) {
void ReferenceBlock::load(QDomElement &elt) throw(Exception) {
+ cout << "Block : get version" << endl;
+ QString verStr = elt.attribute("version","none");
+ QString specialStr = elt.attribute("special","none");
+ if (verStr != "none") {
+ setVersion(verStr);
+ }
+ else {
+ setVersion("0.0");
+ }
+ setSpecialType(getSpecialTypeFromString(specialStr));
cout << "Block : get informations" << endl;
QDomElement eltInfo = elt.firstChildElement("informations");
// getting description
cout << "Block info : get description" << endl;
QDomElement eltDesc = eltCat.nextSiblingElement("description");
- // getting brief
- QDomElement eltBrief = eltDesc.firstChildElement("brief");
- QDomNode nodeBriefTxt = eltBrief.firstChild();
- if (nodeBriefTxt.isNull()) {
- descriptionBrief = "no brief description";
+ // getting text
+ QDomNode nodeTxt = eltDesc.firstChild();
+ if (nodeTxt.isNull()) {
+ description = "no description";
}
else {
- QDomText txtBrief = nodeBriefTxt.toText();
- descriptionBrief = txtBrief.data().trimmed();
- cout << "block brief desc : " << qPrintable(descriptionBrief) << endl;
- }
- // getting detailed
- QDomElement eltDetail = eltBrief.nextSiblingElement("detailed");
- QDomNode nodeDetailTxt = eltDetail.firstChild();
- if (nodeDetailTxt.isNull()) {
- descriptionDetail = "no detailed description";
- }
- else {
- QDomText txtDetail = nodeDetailTxt.toText();
- descriptionDetail = txtDetail.data().trimmed();
- cout << "block detail desc : " << qPrintable(descriptionDetail) << endl;
- }
+ QDomText txtBrief = nodeTxt.toText();
+ description = txtBrief.data().trimmed();
+ cout << "block desc : " << qPrintable(description) << endl;
+ }
}
void ReferenceBlock::loadParameters(QDomElement &elt) throw(Exception) {
toWrite << b.name;
toWrite << b.xmlFile;
- toWrite << b.descriptionBrief;
- toWrite << b.descriptionDetail;
+ toWrite << b.specialType;
+ toWrite << b.version;
+ toWrite << b.description;
toWrite << b.categories;
toWrite << b.hashMd5;
toWrite << b.params.size();
in >> b.name;
in >> b.xmlFile;
- in >> b.descriptionBrief;
- in >> b.descriptionDetail;
+ in >> b.specialType;
+ in >> b.version;
+ in >> b.description;
in >> b.categories;
in >> b.hashMd5;
b.params.clear();
return list;
}
+