Created new Layout prototype.

This commit is contained in:
2025-12-26 12:04:02 +01:00
parent 0bec8dfeb7
commit 3ff995d547
5 changed files with 191 additions and 94 deletions

View File

@@ -29,8 +29,10 @@ SOURCES += \
bcdatamanager.cpp \
bcdatamodel.cpp \
bcdatavalue.cpp \
bcdevicepanel.cpp \
bcitemdelegate.cpp \
bclegacy.cpp \
bctoolbutton.cpp \
bctransmitter.cpp \
bcvaluetype.cpp \
lib/can_drv_win.c \
@@ -46,12 +48,15 @@ HEADERS += \
bcdatamanager.h \
bcdatamodel.h \
bcdatavalue.h \
bcdevicepanel.h \
bcitemdelegate.h \
bcmainwindow.h \
bctoolbutton.h \
bctransmitter.h \
bcvaluetype.h
FORMS += \
bcdevicepanel.ui \
bcmainwindow.ui
# Default rules for deployment.

View File

@@ -38,10 +38,14 @@ BCMainWindow::BCMainWindow(QWidget *parent)
{
setupUi(this);
_motorlButton->setDefaultAction( _actionMotor);
_motorButton->setDefaultAction( _motorAction);
_consoleButton->setDefaultAction( _consoleAction );
_batteryButton->setDefaultAction( _batteryAction );
_pimpButton->setDefaultAction( _pimpAction);
_valueManager.loadXmlBikeData();
auto model = _valueManager.getModel( BCDevice::ID::Console );
/*
if( model)
{
_valueView->setModel( *model );
@@ -59,6 +63,7 @@ BCMainWindow::BCMainWindow(QWidget *parent)
connect(_delegate, &BCItemDelegate::viewUpdateNeeded, _valueView->viewport(), QOverload<>::of(&QWidget::update));
//_valueView->setItemDelegate(_delegate);
// Highlight mit Fade-Out:
@@ -70,7 +75,7 @@ BCMainWindow::BCMainWindow(QWidget *parent)
connect( &_valueManager, &BCDataManager::valueTouched, _delegate, &BCItemDelegate::onHighlightRow );
connect( _connectButton, &QPushButton::clicked, transmitter, &BCTransmitter::onToggleConnectionState );
connect( _syncButton, &QPushButton::clicked, &_valueManager, &BCDataManager::onSyncFromDevice );
*/
}

View File

@@ -14,61 +14,27 @@
<string>BCMainWindow</string>
</property>
<widget class="QWidget" name="_centralwidget">
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QFrame" name="_controlFrame">
<widget class="QWidget" name="_buttonWidget" native="true">
<property name="styleSheet">
<string notr="true">background-color: grey;</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QWidget" name="widget" native="true">
<property name="styleSheet">
<string notr="true">background-color: #aaaaaa;</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="BCToolButton" name="_pimpButton">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
<width>64</width>
<height>64</height>
</size>
</property>
<property name="frameShape">
<enum>QFrame::Shape::StyledPanel</enum>
</property>
<property name="frameShadow">
<enum>QFrame::Shadow::Raised</enum>
</property>
<widget class="QPushButton" name="_syncButton">
<property name="geometry">
<rect>
<x>30</x>
<y>50</y>
<width>171</width>
<height>51</height>
</rect>
</property>
<property name="text">
<string>Sync</string>
</property>
</widget>
<widget class="QPushButton" name="_connectButton">
<property name="geometry">
<rect>
<x>10</x>
<y>180</y>
<width>171</width>
<height>51</height>
</rect>
</property>
<property name="text">
<string>Connect</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
<widget class="QToolButton" name="_motorlButton">
<property name="geometry">
<rect>
<x>70</x>
<y>240</y>
<width>71</width>
<height>71</height>
</rect>
</property>
<property name="text">
<string>...</string>
</property>
@@ -78,40 +44,122 @@
<height>64</height>
</size>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</widget>
</item>
<item>
<widget class="QTableView" name="_valueView">
<property name="frameShape">
<enum>QFrame::Shape::NoFrame</enum>
<widget class="BCToolButton" name="_batteryButton">
<property name="minimumSize">
<size>
<width>64</width>
<height>64</height>
</size>
</property>
<property name="frameShadow">
<enum>QFrame::Shadow::Plain</enum>
<property name="text">
<string>...</string>
</property>
<property name="alternatingRowColors">
<bool>false</bool>
<property name="iconSize">
<size>
<width>64</width>
<height>64</height>
</size>
</property>
<property name="showGrid">
<bool>false</bool>
</widget>
</item>
<item>
<widget class="BCToolButton" name="_motorButton">
<property name="minimumSize">
<size>
<width>64</width>
<height>64</height>
</size>
</property>
<property name="gridStyle">
<enum>Qt::PenStyle::NoPen</enum>
<property name="text">
<string>...</string>
</property>
<property name="iconSize">
<size>
<width>64</width>
<height>64</height>
</size>
</property>
</widget>
</item>
<item>
<widget class="BCToolButton" name="_consoleButton">
<property name="minimumSize">
<size>
<width>64</width>
<height>64</height>
</size>
</property>
<property name="text">
<string>...</string>
</property>
<property name="iconSize">
<size>
<width>64</width>
<height>64</height>
</size>
</property>
<attribute name="horizontalHeaderStretchLastSection">
<bool>true</bool>
</attribute>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Orientation::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>227</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="_connectButton">
<property name="text">
<string>Connect</string>
</property>
<property name="checkable">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="_syncButton">
<property name="text">
<string>Sync</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QStackedWidget" name="_controlWidget">
<property name="minimumSize">
<size>
<width>200</width>
<height>0</height>
</size>
</property>
<property name="currentIndex">
<number>3</number>
</property>
<widget class="BCDevicePanel" name="_consolePanel"/>
<widget class="BCDevicePanel" name="_motorPanel"/>
<widget class="BCDevicePanel" name="_batteryPanel"/>
<widget class="BCDevicePanel" name="_pimpPanel"/>
</widget>
</item>
</layout>
</widget>
<widget class="QStatusBar" name="_statusbar"/>
<action name="_actionPimp">
<action name="_pimpAction">
<property name="icon">
<iconset>
<normaloff>:restart.png</normaloff>:restart.png</iconset>
@@ -123,7 +171,7 @@
<string>Pimp my Ride</string>
</property>
</action>
<action name="_actionMotor">
<action name="_motorAction">
<property name="icon">
<iconset>
<normaloff>:bionx_motor.png</normaloff>:bionx_motor.png</iconset>
@@ -135,7 +183,7 @@
<string>Show motor settings</string>
</property>
</action>
<action name="_actionBattery">
<action name="_batteryAction">
<property name="icon">
<iconset>
<normaloff>:bionx_akku.png</normaloff>:bionx_akku.png</iconset>
@@ -147,7 +195,7 @@
<string>Show battery settings</string>
</property>
</action>
<action name="_actionConsole">
<action name="_consoleAction">
<property name="icon">
<iconset>
<normaloff>:bionx_console.png</normaloff>:bionx_console.png</iconset>
@@ -159,7 +207,7 @@
<string>Show console settings</string>
</property>
</action>
<action name="_actionExit">
<action name="_exitAction">
<property name="icon">
<iconset>
<normaloff>:exit.png</normaloff>:exit.png</iconset>
@@ -171,7 +219,7 @@
<string>Exit</string>
</property>
</action>
<action name="_actionConnect">
<action name="_connectAction">
<property name="icon">
<iconset resource="bionxcontrol.qrc">
<normaloff>:/connected.png</normaloff>:/connected.png</iconset>
@@ -187,6 +235,19 @@
</property>
</action>
</widget>
<customwidgets>
<customwidget>
<class>BCDevicePanel</class>
<extends>QWidget</extends>
<header location="global">bcdevicepanel.h</header>
<container>1</container>
</customwidget>
<customwidget>
<class>BCToolButton</class>
<extends>QToolButton</extends>
<header location="global">bctoolbutton.h</header>
</customwidget>
</customwidgets>
<resources>
<include location="bionxcontrol.qrc"/>
</resources>

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 18.0.1, 2025-12-22T19:04:55. -->
<!-- Written by QtCreator 18.0.1, 2025-12-26T11:01:19. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
@@ -62,6 +62,30 @@
<data>
<variable>ProjectExplorer.Project.PluginSettings</variable>
<valuemap type="QVariantMap">
<valuemap type="QVariantMap" key="AutoTest.ActiveFrameworks">
<value type="bool" key="AutoTest.Framework.Boost">true</value>
<value type="bool" key="AutoTest.Framework.CTest">false</value>
<value type="bool" key="AutoTest.Framework.Catch">true</value>
<value type="bool" key="AutoTest.Framework.GTest">true</value>
<value type="bool" key="AutoTest.Framework.QtQuickTest">true</value>
<value type="bool" key="AutoTest.Framework.QtTest">true</value>
</valuemap>
<value type="bool" key="AutoTest.ApplyFilter">false</value>
<valuemap type="QVariantMap" key="AutoTest.CheckStates"/>
<valuelist type="QVariantList" key="AutoTest.PathFilters"/>
<value type="int" key="AutoTest.RunAfterBuild">0</value>
<value type="bool" key="AutoTest.UseGlobal">true</value>
<valuemap type="QVariantMap" key="ClangTools">
<value type="bool" key="ClangTools.AnalyzeOpenFiles">true</value>
<value type="bool" key="ClangTools.BuildBeforeAnalysis">true</value>
<value type="QString" key="ClangTools.DiagnosticConfig">Builtin.DefaultTidyAndClazy</value>
<value type="int" key="ClangTools.ParallelJobs">16</value>
<value type="bool" key="ClangTools.PreferConfigFile">true</value>
<valuelist type="QVariantList" key="ClangTools.SelectedDirs"/>
<valuelist type="QVariantList" key="ClangTools.SelectedFiles"/>
<valuelist type="QVariantList" key="ClangTools.SuppressedDiagnostics"/>
<value type="bool" key="ClangTools.UseGlobalSettings">true</value>
</valuemap>
<value type="int" key="RcSync">0</value>
</valuemap>
</data>
@@ -84,7 +108,7 @@
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">QtProjectManager.QMakeBuildStep</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">false</value>
<value type="bool" key="QtProjectManager.QMakeBuildStep.QMakeForced">true</value>
<valuelist type="QVariantList" key="QtProjectManager.QMakeBuildStep.SelectedAbis"/>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.1">
@@ -140,11 +164,12 @@
<value type="bool" key="PE.EnvironmentAspect.PrintOnRun">false</value>
<value type="QString" key="PerfRecordArgsId">-e cpu-cycles --call-graph &quot;dwarf,4096&quot; -F 250</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:</value>
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">C:/syncMePlease/projects.now/BionxControl/doc/material_dummy/material_dummy.pro</value>
<value type="bool" key="ProjectExplorer.RunConfiguration.Customized">false</value>
<value type="QString" key="ProjectExplorer.RunConfiguration.UniqueId"></value>
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
<value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
<value type="QString" key="RunConfiguration.WorkingDirectory.default">%{RunConfig:Executable:Path}</value>
</valuemap>
@@ -176,11 +201,12 @@
<value type="bool" key="PE.EnvironmentAspect.PrintOnRun">false</value>
<value type="QString" key="PerfRecordArgsId">-e cpu-cycles --call-graph &quot;dwarf,4096&quot; -F 250</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.CustomExecutableRunConfiguration</value>
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:</value>
<value type="QString" key="ProjectExplorer.RunConfiguration.BuildKey">C:/syncMePlease/projects.now/BionxControl/doc/material_dummy/material_dummy.pro</value>
<value type="bool" key="ProjectExplorer.RunConfiguration.Customized">false</value>
<value type="QString" key="ProjectExplorer.RunConfiguration.UniqueId"></value>
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
<value type="bool" key="RunConfiguration.UseLibrarySearchPath">true</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
<value type="QString" key="RunConfiguration.WorkingDirectory.default">%{RunConfig:Executable:Path}</value>
</valuemap>

View File

@@ -145,7 +145,7 @@ struct mookoo2 : public mookoo
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
setApplicationStyleSheet( ":/bionxcontrol.qss"_L1 );
//setApplicationStyleSheet( ":/bionxcontrol.qss"_L1 );
mookoo myMookoo{"",1,1.0};
mookoo myMooko2{"",1};