semi fixed missing sections

This commit is contained in:
Christoph Holzheuer
2025-09-16 16:45:21 +02:00
parent 28aa03b31a
commit bf49d8321f
5 changed files with 31 additions and 31 deletions

View File

@@ -36,9 +36,6 @@ XQChildModel::XQChildModel( QObject *parent )
void XQChildModel::addModelData( const XQNodePtr& contentRoot ) void XQChildModel::addModelData( const XQNodePtr& contentRoot )
{ {
setObjectName( contentRoot->to_string() );
//qDebug() << " --- create Model Data: " << contentRoot->to_string();
// Die Datenbasis als shared_ptr sichern // Die Datenbasis als shared_ptr sichern
_contentRoot = contentRoot; _contentRoot = contentRoot;

View File

@@ -117,9 +117,9 @@ void XQMainWindow::initMainWindow()
// #2. load demo data // #2. load demo data
loadDocument( c_DocumentFileName1 ); loadDocument( c_DocumentFileName1 );
//loadDocument( c_DocumentFileName2, true ); loadDocument( c_DocumentFileName2, true );
//loadDocument( c_DocumentFileName2 ); //loadDocument( c_DocumentFileName2 );
loadDocument( c_DocumentFileName3 ); //loadDocument( c_DocumentFileName3 );
qDebug() << " --- all here: " << XQNode::s_Count; qDebug() << " --- all here: " << XQNode::s_Count;
@@ -260,7 +260,7 @@ void XQMainWindow::onTreeViewItemClicked( const XQItem& item )
void XQMainWindow::onTreeViewItemChanged(const XQItem& item ) void XQMainWindow::onTreeViewItemChanged(const XQItem& item )
{ {
qDebug() << " --- TREE VIEW itemChanged:" << item.text() << " : " << item.parent()->text() << " : " << (void*)&_mainModel << " : " << (void*) sender(); qDebug() << " --- TREE VIEW itemChanged: text" << item.text() << " parent: " << item.parent()->text() << " type: " << item.itemType().text() << " : " << (void*)&_mainModel << " : " << (void*) sender();
// hier müssen wir erst das projekt aktivieren // hier müssen wir erst das projekt aktivieren
XQItem* xqItem = static_cast<XQItem*>(item.parent()); XQItem* xqItem = static_cast<XQItem*>(item.parent());
onTreeViewItemClicked( *xqItem ); onTreeViewItemClicked( *xqItem );
@@ -269,7 +269,7 @@ void XQMainWindow::onTreeViewItemChanged(const XQItem& item )
int idx = _tabWidget->currentIndex(); int idx = _tabWidget->currentIndex();
if(_documentStore.contains(idx) ) if(_documentStore.contains(idx) )
{ {
qDebug() << " --- should toggle: " << item.text(); qDebug() << " --- Has Document and might toggle: " << item.text();
XQViewModel& childModel = *_documentStore[idx].viewModel; XQViewModel& childModel = *_documentStore[idx].viewModel;
childModel.onToggleSection(item.text()); childModel.onToggleSection(item.text());
} }
@@ -362,6 +362,7 @@ XQChildModel* XQMainWindow::createChildModel( const XQNodePtr& contentRoot )
// model inhalte laden // model inhalte laden
childModel->addModelData( contentRoot->first_child() ); childModel->addModelData( contentRoot->first_child() );
childModel->setObjectName( contentRoot->friendly_name() );
return childModel; return childModel;
@@ -404,7 +405,7 @@ void XQMainWindow::loadDocument( const QString& fileName, bool useQML )
QWidget* childView{}; QWidget* childView{};
if(useQML) if(useQML)
{ {
XQQuickWidget* quickView= new XQQuickWidget(_tabWidget); XQQuickWidget* quickView = new XQQuickWidget(_tabWidget);
//quickChild->setResizeMode(QQuickWidget::SizeViewToRootObject); //quickChild->setResizeMode(QQuickWidget::SizeViewToRootObject);
quickView->rootContext()->setContextProperty("xtrChildModel", childModel); quickView->rootContext()->setContextProperty("xtrChildModel", childModel);

View File

@@ -117,7 +117,7 @@ const XQModelSection& XQSectionManager::sectionByKey( const QString& sectionKey
if( hasValidSection( sectionKey ) ) if( hasValidSection( sectionKey ) )
return _sections.at(sectionKey); return _sections.at(sectionKey);
throw XQException( "No section for key: ", sectionKey); throw XQException( "No section for key", sectionKey);
} }
@@ -137,7 +137,7 @@ const XQModelSection& XQSectionManager::sectionByRow(int itemRow ) const
return section; return section;
} }
throw XQException( "No section for item row: ", QString::number(itemRow)); throw XQException( "No section for item row", QString::number(itemRow));
} }

View File

@@ -181,8 +181,11 @@ void XQViewModel::addSection(const XQItemList& list, const XQNodePtr& sheetNode
//! SLOT, toggled die section mit dem 'sectionKey' (hier: contentType) //! SLOT, toggled die section mit dem 'sectionKey' (hier: contentType)
void XQViewModel::onToggleSection(const QString& sectionKey ) void XQViewModel::onToggleSection(const QString& sectionKey )
{ {
toggleSection( _sections.sectionByKey(sectionKey) ); qDebug() << " --- Model: " << this->objectName() << " should toggle: " << sectionKey << ": " << _sections.hasValidSection( sectionKey );
_sections.dump();
if(_sections.hasValidSection( sectionKey ) )
toggleSection( _sections.sectionByKey(sectionKey) );
} }

View File

@@ -1,23 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<Components> <Components>
<Panel FriendlyName="@PanelName" Height="2,70" Manufacturer="JA Solar 1 XX" MaxAmpere="11" MaxVolt="67" PanelID="#1 JA 01" PanelName="JA 01 Solar T62B" WattPeak="620" Weight="12" Width="1,10"/> <Panel FriendlyName="@PanelName" Height="2,70" Manufacturer="Jingli Solar" MaxAmpere="11" MaxVolt="67" PanelID="Jingli 01" PanelName="Jingli 01 Solar T62B" WattPeak="620" Weight="12" Width="1,10">
<Panel FriendlyName="@PanelName" Height="1,70" Manufacturer="JA Solar 2" MaxAmpere="11" MaxVolt="42" PanelID="#2 JA 02" PanelName="JA 02 Solar X58C" WattPeak="440" Weight="12" Width="1,10"/> <AdditionalData DataItem="Image" DataValue="image.png"/>
<Panel FriendlyName="@PanelName" Height="2,70" Manufacturer="JA Solar 3" MaxAmpere="11" MaxVolt="67" PanelID="#3 JA 03" PanelName="JA 03 Solar T62B" WattPeak="620" Weight="12" Width="1,10"/> <AdditionalData DataItem="Manual" DataValue="manual.docx"/>
<Panel FriendlyName="@PanelName" Height="1,70" Manufacturer="JA Solar 4" MaxAmpere="11" MaxVolt="42" PanelID="#4 JA 04" PanelName="JA 04 Solar X58C" WattPeak="440" Weight="12" Width="1,10"/> <AdditionalData DataItem="Certificate" DataValue="certificate.pdf"/>
<Panel FriendlyName="@PanelName" Height="1,70" Manufacturer="JA Solar 5" MaxAmpere="11" MaxVolt="42" PanelID="#5 JA 05" PanelName="JA 05 Solar X58C" WattPeak="440" Weight="12" Width="1,10"/> </Panel>
<Panel FriendlyName="@PanelName" Height="1,70" Manufacturer="JA Solar 6" MaxAmpere="11" MaxVolt="42" PanelID="#6 JA 06" PanelName="JA 06 Solar X58C" WattPeak="440" Weight="12" Width="1,10"/> <Panel FriendlyName="@PanelName" Height="1,70" Manufacturer="Jingli Solar" MaxAmpere="11" MaxVolt="42" PanelID="Jingli 02" PanelName="Jingli 02 Solar X58C" WattPeak="440" Weight="12" Width="1,10"/>
<Inverter FriendlyName="@InverterName" InverterID="#1 HM600 01" InverterName="01 HM600 S2 TMax" Manufacturer="HoyMiles" MaxPowerInput="3000,00" MaxPowerInputChoice="2000;4000;6000" MaxPowerOutput="600" NumStrings="2" Weight="28"/> <Panel FriendlyName="@PanelName" Height="2,70" Manufacturer="Jingli Solar" MaxAmpere="11" MaxVolt="67" PanelID="Jingli 03" PanelName="Jingli 03 Solar T62B" WattPeak="620" Weight="12" Width="1,10"/>
<Inverter FriendlyName="@InverterName" InverterID="#2 HM800 02" InverterName="02 HM800 S2 TMax" Manufacturer="HoyMiles" MaxPowerInput="4000" MaxPowerInputChoice="4000;6000;8000" MaxPowerOutput="800" NumStrings="2" Weight="29"/> <Inverter FriendlyName="@InverterName" InverterID="HM600 01" InverterName="01 HM600 S2 TMax" Manufacturer="HoyMiles" MaxPowerInput="4000" MaxPowerInputChoice="2000;4000;6000" MaxPowerOutput="600" NumStrings="2" Weight="28"/>
<Inverter FriendlyName="@InverterName" InverterID="#3 HM1600 03" InverterName="03 HM1600 S4 TMax" Manufacturer="HoyMiles" MaxPowerInput="9000,00" MaxPowerInputChoice="6000;8000;10000" MaxPowerOutput="1600" NumStrings="4" Weight="32"/> <Inverter FriendlyName="@InverterName" InverterID="HM800 02" InverterName="02 HM800 S2 TMax" Manufacturer="HoyMiles" MaxPowerInput="4000" MaxPowerInputChoice="2000;4000;6000" MaxPowerOutput="800" NumStrings="2" Weight="29"/>
<Inverter FriendlyName="@InverterName" InverterID="#4 D12K 04" InverterName="04 HM600 S2 TMax" Manufacturer="Deye" MaxPowerInput="8000" MaxPowerInputChoice="6000;8000;12000" MaxPowerOutput="600" NumStrings="2" Weight="28"/> <Inverter FriendlyName="@InverterName" InverterID="HM1600 03" InverterName="03 HM1600 S4 TMax" Manufacturer="HoyMiles" MaxPowerInput="4000" MaxPowerInputChoice="2000;4000;6000" MaxPowerOutput="1600" NumStrings="4" Weight="32"/>
<Battery BatteryID="#1 BYD 01" BatteryName="01 BYD T01 Stackable" Capacity="4500" FriendlyName="@BatteryName" Manufacturer="BYD" MaxCurrent="120" MaxVolt="48" Yield="90"> <Inverter FriendlyName="@InverterName" InverterID="D12K 04" InverterName="04 HM600 S2 TMax" Manufacturer="Deye" MaxPowerInput="4000" MaxPowerInputChoice="2000;4000;6000" MaxPowerOutput="600" NumStrings="2" Weight="28"/>
<Images FrontView="image.png" InstalledView="installed.png" PackageView="package.png"/> <Battery BatteryID="BYD 01" BatteryName="FIRZ!" Capacity="4500" FriendlyName="@BatteryName" Manufacturer="BYD" MaxCurrent="120" MaxVolt="48" Yield="88">
<Documents Certificate="certificate.pdf" Manual="manual.docx"/> <AdditionalData DataItem="Image" DataValue="image.png"/>
<AdditionalData DataItem="Manual" DataValue="manual.docx"/>
<AdditionalData DataItem="Certificate" DataValue="certificate.pdf"/>
</Battery> </Battery>
<Battery BatteryID="#2 BYD 02" BatteryName="02 BYD T02 Stackable" Capacity="9000" FriendlyName="@BatteryName" Manufacturer="BYD" MaxCurrent="120" MaxVolt="48" Yield="94"/> <Battery BatteryID="BYD 04" BatteryName="04 BYD T02 Stackable" Capacity="9000" FriendlyName="@BatteryName" Manufacturer="BYD" MaxCurrent="120" MaxVolt="48" Yield="32"/>
<Battery BatteryID="#3 BYD 03" BatteryName="03 BYD T01 Stackable" Capacity="4500" FriendlyName="@BatteryName" Manufacturer="BYD" MaxCurrent="120" MaxVolt="48" Yield="86"/> <Battery BatteryID="GroWatt 05 G2K" BatteryName="05 BYD T01 Stackable" Capacity="4500" FriendlyName="@BatteryName" Manufacturer="PylonTech" MaxCurrent="120" MaxVolt="48" Yield="46"/>
<Battery BatteryID="#4 BYD 04" BatteryName="04 BYD T02 Stackable" Capacity="9000" FriendlyName="@BatteryName" Manufacturer="BYD" MaxCurrent="120" MaxVolt="48" Yield="91"/> <Battery BatteryID="GroWatt 06 G4K" BatteryName="06 BYD T02 Stackable" Capacity="9000" FriendlyName="@BatteryName" Manufacturer="PylonTech" MaxCurrent="120" MaxVolt="48" Yield="94"/>
<Battery BatteryID="#5 GroWatt 05 G2K" BatteryName="05 BYD T01 Stackable" Capacity="4500" FriendlyName="@BatteryName" Manufacturer="GroWatt" MaxCurrent="120" MaxVolt="48" Yield="94"/>
<Battery BatteryID="#6 GroWatt 06 G4K" BatteryName="06 BYD T02 Stackable" Capacity="9000" FriendlyName="@BatteryName" Manufacturer="GroWatt" MaxCurrent="120" MaxVolt="48" Yield="49"/>
<Battery BatteryID="#7 Pyne 07 G4K" BatteryName="07 Pyne K7 Stackable" Capacity="9000" FriendlyName="@BatteryName" Manufacturer="PyNe" MaxCurrent="120" MaxVolt="48" Yield="68"/>
</Components> </Components>