Files
BionxControl/bcmainwindow.h

105 lines
2.7 KiB
C
Raw Normal View History

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>
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);
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 );
void onConnectButtonToggled(bool active );
2026-01-02 22:15:50 +01:00
void onDriverStateChanged( BCDriver::DriverState state, const QString& message="" );
2026-01-05 23:39:45 +01:00
// Slots für Rückmeldungen vom Transmitter
2026-01-07 17:13:35 +01:00
void onValueUpdated( BCDevice::ID deviceID, int index, BCValue::Flag state, uint32_t rawValue );
2026-01-08 19:05:07 +01:00
void onEndOfProcessing();
2026-01-02 16:25:21 +01:00
void onSyncDeviceView();
2026-01-05 23:39:45 +01:00
void onShowMessage( const QString& message, int timeOut=3000);
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-16 22:42:35 +01:00
protected:
2026-01-05 23:39:45 +01:00
bool setApplicationStyleSheet( QAnyStringView path );
void initMainWindow();
2026-01-02 22:15:50 +01:00
void initStatusBar();
void autoConnect();
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*>;
BCDeviceViews _devicePanels;
BCDeviceView* _currentPanel{};
2025-12-15 20:57:09 +01:00
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