2025-12-15 20:57:09 +01:00
|
|
|
/***************************************************************************
|
|
|
|
|
|
2025-12-26 14:07:55 +01:00
|
|
|
BionxControl
|
2026-01-03 23:51:14 +01:00
|
|
|
© 2025 -2026 christoph holzheuer
|
2025-12-26 14:07:55 +01:00
|
|
|
christoph.holzheuer@gmail.com
|
2025-12-15 20:57:09 +01:00
|
|
|
|
2025-12-26 14:07:55 +01:00
|
|
|
Using:
|
2025-12-15 20:57:09 +01:00
|
|
|
|
2025-12-26 14:07:55 +01:00
|
|
|
mhs_can_drv.c
|
|
|
|
|
© 2011 - 2023 by MHS-Elektronik GmbH & Co. KG, Germany
|
|
|
|
|
Klaus Demlehner, klaus@mhs-elektronik.de
|
|
|
|
|
@see www.mhs-elektronik.de
|
2025-12-15 20:57:09 +01:00
|
|
|
|
2025-12-26 14:07:55 +01:00
|
|
|
Based on Bionx data type descriptions from:
|
2025-12-15 20:57:09 +01:00
|
|
|
|
2025-12-26 14:07:55 +01:00
|
|
|
BigXionFlasher USB V 0.2.4 rev. 97
|
|
|
|
|
© 2011-2013 by Thomas Koenig <info@bigxionflasher.org>
|
|
|
|
|
@see www.bigxionflasher.org
|
2025-12-15 20:57:09 +01:00
|
|
|
|
2025-12-26 14:07:55 +01:00
|
|
|
Bionx Bike Info
|
|
|
|
|
© 2018 Thorsten Schmidt (tschmidt@ts-soft.de)
|
|
|
|
|
@see www.ts-soft.de
|
|
|
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify
|
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
|
the Free Software Foundation; either version 3 of the License, or
|
|
|
|
|
(at your option) any later version.
|
|
|
|
|
@see https://github.com/bikemike/bionx-bikeinfo
|
|
|
|
|
|
|
|
|
|
***************************************************************************/
|
2025-12-15 20:57:09 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef BCMAINWINDOW_H
|
|
|
|
|
#define BCMAINWINDOW_H
|
|
|
|
|
|
|
|
|
|
#include <QMainWindow>
|
2026-01-03 02:50:28 +01:00
|
|
|
#include <QThread>
|
2025-12-15 20:57:09 +01:00
|
|
|
|
2025-12-16 22:42:35 +01:00
|
|
|
#include <ui_bcmainwindow.h>
|
2025-12-31 16:30:03 +01:00
|
|
|
#include <bcxmlloader.h>
|
2026-01-03 02:50:28 +01:00
|
|
|
#include <bctransmitter.h>
|
2026-01-10 16:38:52 +01:00
|
|
|
#include <bcdelightpmwidget.h>
|
2025-12-16 22:42:35 +01:00
|
|
|
|
2025-12-29 23:29:56 +01:00
|
|
|
class BCDeviceView;
|
2025-12-15 20:57:09 +01:00
|
|
|
|
2025-12-16 22:42:35 +01:00
|
|
|
class BCMainWindow : public QMainWindow, public Ui_BCMainWindow
|
2025-12-15 20:57:09 +01:00
|
|
|
{
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
BCMainWindow(QWidget *parent = nullptr);
|
2025-12-28 12:30:04 +01:00
|
|
|
virtual ~BCMainWindow();
|
2025-12-15 20:57:09 +01:00
|
|
|
|
2025-12-31 13:38:46 +01:00
|
|
|
void setHeaderLabel( const QString& headerText);
|
|
|
|
|
|
2025-12-16 22:42:35 +01:00
|
|
|
public slots:
|
|
|
|
|
|
2025-12-27 18:43:15 +01:00
|
|
|
//void onValueListReady( BCDevice::ID deviceID );
|
2025-12-26 23:09:53 +01:00
|
|
|
void onShowDevicePanel( BCDevice::ID deviceID );
|
2026-01-02 22:15:50 +01:00
|
|
|
void onDriverStateChanged( BCDriver::DriverState state, const QString& message="" );
|
2025-12-18 16:26:51 +01:00
|
|
|
|
2026-01-05 23:39:45 +01:00
|
|
|
// Slots für Rückmeldungen vom Transmitter
|
2026-01-08 20:47:05 +01:00
|
|
|
void onValueUpdated( BCDevice::ID deviceID, int index, BCValue::Flags newState, uint32_t rawValue );
|
2026-01-08 19:05:07 +01:00
|
|
|
void onEndOfProcessing();
|
2026-01-02 16:25:21 +01:00
|
|
|
void onSyncDeviceView();
|
2025-12-28 12:30:04 +01:00
|
|
|
|
2026-01-23 16:33:05 +01:00
|
|
|
void onShowMessage( const QString& message, int timeOut=4000);
|
2026-01-10 16:38:52 +01:00
|
|
|
void onStartAnimation();
|
2026-01-05 23:39:45 +01:00
|
|
|
|
2025-12-28 12:30:04 +01:00
|
|
|
signals:
|
|
|
|
|
|
|
|
|
|
// Internes Signal, um Daten an den Worker Thread zu senden
|
2026-01-02 16:25:21 +01:00
|
|
|
void requestValueUpdate( BCValuePtrConst value);
|
2026-01-08 19:05:07 +01:00
|
|
|
void endOfTransmission();
|
2025-12-28 12:30:04 +01:00
|
|
|
|
2025-12-16 22:42:35 +01:00
|
|
|
protected:
|
|
|
|
|
|
2026-01-05 23:39:45 +01:00
|
|
|
bool setApplicationStyleSheet( QAnyStringView path );
|
2025-12-28 12:30:04 +01:00
|
|
|
void initMainWindow();
|
2026-01-02 22:15:50 +01:00
|
|
|
void initStatusBar();
|
2025-12-26 14:07:55 +01:00
|
|
|
|
2026-01-05 23:39:45 +01:00
|
|
|
//bool eventFilter(QObject *obj, QEvent *event) override;
|
|
|
|
|
|
2025-12-31 16:30:03 +01:00
|
|
|
BCXmlLoader _dataManager;
|
2025-12-16 22:42:35 +01:00
|
|
|
|
2025-12-26 23:09:53 +01:00
|
|
|
// Wir brauchen eine Verbindung zwischen den Views
|
|
|
|
|
// und dem Device, das sie darstellen.
|
|
|
|
|
|
2025-12-29 23:29:56 +01:00
|
|
|
using BCDeviceViews = QHash<BCDevice::ID, BCDeviceView*>;
|
2026-01-10 16:38:52 +01:00
|
|
|
BCDeviceViews _devicePanels;
|
|
|
|
|
BCDeviceView* _currentPanel{};
|
|
|
|
|
BCDelightPMWidget* _delightWidget{};
|
|
|
|
|
QThread _worker;
|
|
|
|
|
BCTransmitter _transmitter;
|
2025-12-31 13:38:46 +01:00
|
|
|
|
2026-01-06 22:39:41 +01:00
|
|
|
static constexpr const char* cBCKeyHeaderLabel = "BCHeaderLabel";
|
|
|
|
|
static constexpr const char* cDarkModeStyle = ":bc_dark.qss";
|
|
|
|
|
static constexpr const char* cLightModeStyle = ":bc_light.qss";
|
2025-12-31 13:38:46 +01:00
|
|
|
|
2025-12-15 20:57:09 +01:00
|
|
|
};
|
|
|
|
|
|
2026-01-01 03:08:34 +01:00
|
|
|
|
2025-12-15 20:57:09 +01:00
|
|
|
#endif // BCMAINWINDOW_H
|