84 lines
3.3 KiB
C++
84 lines
3.3 KiB
C++
XQItem* createTreeEntry( XQNodePtr contentNode );
|
|
|
|
|
|
|
|
//! erzeugt einen eintrag in der baum-übersicht.
|
|
|
|
XQItem* XQMainModel::createTreeEntry( XQNodePtr contentNode )
|
|
{
|
|
|
|
/*
|
|
for(const auto& section : _sections )
|
|
{
|
|
qDebug() << " --- wtf1: " << contentNode->to_string();
|
|
qDebug() << " --- wtf2: " << section.sheetRootNode->to_string();
|
|
|
|
if( contentNode->attribute("State") == section.sheetRootNode->attribute("State") )
|
|
{
|
|
//XQItem* newTreeentry = _itemFactory.makeTreeChildItem( contentNode, section.sheetRootNode );
|
|
|
|
makeTreeChildItem:
|
|
// den itemtype des neuen items rausfinden
|
|
QString typeKey = sheetEntry->attribute("ItemType");
|
|
XQItemType* itemType = findItemTypeTemplate(typeKey); // throws
|
|
//XQItemType* itemType = makeItemType(sheetEntry); // throws
|
|
|
|
const QString* contentPtr = contentNode->attribute_ptr( "ProjectName" );
|
|
|
|
XQItem* newItem = new XQItem( itemType, contentPtr );
|
|
|
|
return newItem;
|
|
|
|
section.headerItem().appendRow( newTreeentry );
|
|
_treeTable->expand( section.modelIndex );
|
|
// ??
|
|
_treeTable->setCurrentIndex( section.modelIndex );
|
|
newTreeentry->setContentNode(contentNode);
|
|
emit xqItemCreated( newTreeentry );
|
|
return newTreeentry;
|
|
}
|
|
}
|
|
*/
|
|
throw XQException( "createTreeEntry: main model should not be empty!" );
|
|
}
|
|
<Section ContentType="Inverter">
|
|
<Header Marker="Inverter">
|
|
<InverterID Caption="Inverter" ItemType="HeaderType" />
|
|
<InverterName Caption="Name" ItemType="HeaderType" />
|
|
<Manufacturer Caption="Manufacturer" ItemType="HeaderType" />
|
|
<MaxPowerInput Caption="max. Input" ItemType="HeaderType" />
|
|
<MaxPowerOutput Caption="max Output" ItemType="HeaderType" />
|
|
<NumStrings Caption="Strings" ItemType="HeaderType" />
|
|
<Weight Caption="Weight" ItemType="HeaderType" />
|
|
</Header>
|
|
<Data>
|
|
<InverterID Caption="Inverter" ItemType="ValueType" />
|
|
<InverterName Caption="Name" ItemType="ValueType" />
|
|
<Manufacturer Caption="Manufacturer" ItemType="ValueType" />
|
|
<MaxPowerInput Caption="max. Input" ItemType="ValueType" ItemType="ChoiceType" ChoiceDataSource="MaxPowerInputChoice" UnitType="W"/>
|
|
<MaxPowerOutput Caption="max Output" ItemType="ValueType" UnitType="W"/>
|
|
<NumStrings Caption="Strings" ItemType="ValueType" />
|
|
<Weight Caption="Weight" ItemType="ValueType" UnitType="kg"/>
|
|
</Data>
|
|
</Section>
|
|
|
|
<Section ContentType="Battery">
|
|
<Header Marker="Battery">
|
|
<BatteryID Caption="Name" ItemType="HeaderType" />
|
|
<BatteryName Caption="Battery" ItemType="HeaderType" />
|
|
<Manufacturer Caption="Manufacturer" ItemType="HeaderType" />
|
|
<Capacity Caption="Capacity" ItemType="HeaderType"/>
|
|
<Yield Caption="Yield" ItemType="HeaderType" />
|
|
<MaxCurrent Caption="max. Current" ItemType="HeaderType" />
|
|
<MaxVolt Caption="max. Volt" ItemType="HeaderType" />
|
|
</Header>
|
|
<Data>
|
|
<BatteryID Caption="Battery" ItemType="ValueType" />
|
|
<BatteryName Caption="Name" ItemType="ValueType" />
|
|
<Manufacturer Caption="Manufacturer" ItemType="ValueType" />
|
|
<Capacity Caption="Capacity" ItemType="ValueType" UnitType="Wh"/>
|
|
<Yield Caption="Yield" ItemType="ValueType" ItemType="PercentageType" UnitType="%"/>
|
|
<MaxCurrent Caption="max. Current" ItemType="ValueType" UnitType="A"/>
|
|
<MaxVolt Caption="max. Volt" ItemType="ValueType" UnitType="V"/>
|
|
</Data>
|
|
</Section> |