Cleanups II.
This commit is contained in:
@@ -58,7 +58,6 @@ SOURCES += \
|
|||||||
bcvaluedelegate.cpp \
|
bcvaluedelegate.cpp \
|
||||||
bcvaluemodel.cpp \
|
bcvaluemodel.cpp \
|
||||||
bcvalueslider.cpp \
|
bcvalueslider.cpp \
|
||||||
bcvaluesliderstyle.cpp \
|
|
||||||
bcxmlloader.cpp \
|
bcxmlloader.cpp \
|
||||||
libwin/can_drv_win.c \
|
libwin/can_drv_win.c \
|
||||||
libwin/mhs_can_drv.c \
|
libwin/mhs_can_drv.c \
|
||||||
@@ -80,7 +79,6 @@ HEADERS += \
|
|||||||
bcvaluedelegate.h \
|
bcvaluedelegate.h \
|
||||||
bcvaluemodel.h \
|
bcvaluemodel.h \
|
||||||
bcvalueslider.h \
|
bcvalueslider.h \
|
||||||
BCValueSliderStyle.h \
|
|
||||||
bcxmlloader.h
|
bcxmlloader.h
|
||||||
|
|
||||||
FORMS += \
|
FORMS += \
|
||||||
|
|||||||
@@ -138,7 +138,7 @@
|
|||||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||||
<ClCompile>
|
<ClCompile>
|
||||||
<AdditionalIncludeDirectories>GeneratedFiles\$(ConfigurationName);GeneratedFiles;.;libwin;..\..\Qt\6.10.1\msvc2022_64\include;..\..\Qt\6.10.1\msvc2022_64\include\QtSvg;..\..\Qt\6.10.1\msvc2022_64\include\QtWidgets;..\..\Qt\6.10.1\msvc2022_64\include\QtGui;..\..\Qt\6.10.1\msvc2022_64\include\QtCore;debug;/include;..\..\Qt\6.10.1\msvc2022_64\mkspecs\win32-msvc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
<AdditionalIncludeDirectories>GeneratedFiles\$(ConfigurationName);GeneratedFiles;.;libwin;..\..\Qt\6.10.1\msvc2022_64\include;..\..\Qt\6.10.1\msvc2022_64\include\QtSvg;..\..\Qt\6.10.1\msvc2022_64\include\QtWidgets;..\..\Qt\6.10.1\msvc2022_64\include\QtGui;..\..\Qt\6.10.1\msvc2022_64\include\QtCore;debug;/include;..\..\Qt\6.10.1\msvc2022_64\mkspecs\win32-msvc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||||
<AdditionalOptions>-Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -permissive- -Zc:__cplusplus -Zc:externConstexpr -std=c++23 -utf-8 -w34100 -w34189 -w44456 -w44457 -w44458 %(AdditionalOptions)</AdditionalOptions>
|
<AdditionalOptions>-Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -permissive- -Zc:__cplusplus -Zc:externConstexpr -utf-8 -w34100 -w34189 -w44456 -w44457 -w44458 %(AdditionalOptions)</AdditionalOptions>
|
||||||
<AssemblerListingLocation>debug\</AssemblerListingLocation>
|
<AssemblerListingLocation>debug\</AssemblerListingLocation>
|
||||||
<BrowseInformation>false</BrowseInformation>
|
<BrowseInformation>false</BrowseInformation>
|
||||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||||
@@ -239,14 +239,14 @@
|
|||||||
<CustomBuild Include="debug\moc_predefs.h.cbt">
|
<CustomBuild Include="debug\moc_predefs.h.cbt">
|
||||||
<FileType>Document</FileType>
|
<FileType>Document</FileType>
|
||||||
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\Qt\6.10.1\msvc2022_64\mkspecs\features\data\dummy.cpp;%(AdditionalInputs)</AdditionalInputs>
|
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\Qt\6.10.1\msvc2022_64\mkspecs\features\data\dummy.cpp;%(AdditionalInputs)</AdditionalInputs>
|
||||||
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">cl -BxC:\Qt\6.10.1\msvc2022_64\bin\qmake.exe -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -permissive- -Zc:__cplusplus -Zc:externConstexpr -std=c++23 -Zi -MDd -std:c++latest -utf-8 -W3 -w34100 -w34189 -w44456 -w44457 -w44458 -wd4577 -wd4467 -E ..\..\Qt\6.10.1\msvc2022_64\mkspecs\features\data\dummy.cpp 2>NUL >$(IntDir)\moc_predefs.h</Command>
|
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">cl -BxC:\Qt\6.10.1\msvc2022_64\bin\qmake.exe -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -permissive- -Zc:__cplusplus -Zc:externConstexpr -Zi -MDd -std:c++latest -utf-8 -W3 -w34100 -w34189 -w44456 -w44457 -w44458 -wd4577 -wd4467 -E ..\..\Qt\6.10.1\msvc2022_64\mkspecs\features\data\dummy.cpp 2>NUL >$(IntDir)\moc_predefs.h</Command>
|
||||||
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Generate moc_predefs.h</Message>
|
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Generate moc_predefs.h</Message>
|
||||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(IntDir)\moc_predefs.h;%(Outputs)</Outputs>
|
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(IntDir)\moc_predefs.h;%(Outputs)</Outputs>
|
||||||
</CustomBuild>
|
</CustomBuild>
|
||||||
<CustomBuild Include="release\moc_predefs.h.cbt">
|
<CustomBuild Include="release\moc_predefs.h.cbt">
|
||||||
<FileType>Document</FileType>
|
<FileType>Document</FileType>
|
||||||
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\Qt\6.10.1\msvc2022_64\mkspecs\features\data\dummy.cpp;%(AdditionalInputs)</AdditionalInputs>
|
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\Qt\6.10.1\msvc2022_64\mkspecs\features\data\dummy.cpp;%(AdditionalInputs)</AdditionalInputs>
|
||||||
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">cl -BxC:\Qt\6.10.1\msvc2022_64\bin\qmake.exe -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -permissive- -Zc:__cplusplus -Zc:externConstexpr -std=c++23 -O2 -MD -std:c++latest -utf-8 -W3 -w34100 -w34189 -w44456 -w44457 -w44458 -wd4577 -wd4467 -E ..\..\Qt\6.10.1\msvc2022_64\mkspecs\features\data\dummy.cpp 2>NUL >$(IntDir)\moc_predefs.h</Command>
|
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">cl -BxC:\Qt\6.10.1\msvc2022_64\bin\qmake.exe -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -permissive- -Zc:__cplusplus -Zc:externConstexpr -O2 -MD -std:c++latest -utf-8 -W3 -w34100 -w34189 -w44456 -w44457 -w44458 -wd4577 -wd4467 -E ..\..\Qt\6.10.1\msvc2022_64\mkspecs\features\data\dummy.cpp 2>NUL >$(IntDir)\moc_predefs.h</Command>
|
||||||
<Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Generate moc_predefs.h</Message>
|
<Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Generate moc_predefs.h</Message>
|
||||||
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)\moc_predefs.h;%(Outputs)</Outputs>
|
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)\moc_predefs.h;%(Outputs)</Outputs>
|
||||||
</CustomBuild>
|
</CustomBuild>
|
||||||
|
|||||||
138
CMakeLists.txt
Normal file
138
CMakeLists.txt
Normal file
@@ -0,0 +1,138 @@
|
|||||||
|
cmake_minimum_required(VERSION 3.16)
|
||||||
|
|
||||||
|
# Projektname und unterstützte Sprachen (C++ für Qt, C für die Treiber)
|
||||||
|
project(BionxControl LANGUAGES CXX C)
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# 1. C++ Standard & Projekt-Einstellungen
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# Du hast C++23 angefordert. Hinweis: Der Compiler muss sehr aktuell sein (GCC 13+ / MSVC 2022)
|
||||||
|
set(CMAKE_CXX_STANDARD 23)
|
||||||
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
|
||||||
|
# Automatische Erstellung von MOC, UIC und RCC aktivieren
|
||||||
|
set(CMAKE_AUTOMOC ON)
|
||||||
|
set(CMAKE_AUTOUIC ON)
|
||||||
|
set(CMAKE_AUTORCC ON)
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# 2. Qt-Pakete laden
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# Äquivalent zu: QT += core gui widgets svg
|
||||||
|
find_package(Qt6 REQUIRED COMPONENTS Core Gui Widgets Svg)
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# 3. Quellcode definieren
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
set(PROJECT_SOURCES
|
||||||
|
main.cpp
|
||||||
|
bcmainwindow.cpp
|
||||||
|
bc.cpp
|
||||||
|
bcdelightpmwidget.cpp
|
||||||
|
bcdeviceview.cpp
|
||||||
|
bcdriver.cpp
|
||||||
|
bcdriverstatewidget.cpp
|
||||||
|
bcdrivertinycan.cpp
|
||||||
|
bcthemeswitchbutton.cpp
|
||||||
|
bctoggleswitch.cpp
|
||||||
|
bctransmitter.cpp
|
||||||
|
bcvalue.cpp
|
||||||
|
bcvaluedelegate.cpp
|
||||||
|
bcvaluemodel.cpp
|
||||||
|
bcvalueslider.cpp
|
||||||
|
bcvaluesliderstyle.cpp
|
||||||
|
bcxmlloader.cpp
|
||||||
|
# Deine Header (wichtig, damit sie in der IDE sichtbar sind)
|
||||||
|
bcmainwindow.h
|
||||||
|
bc.h
|
||||||
|
bcdelightpmwidget.h
|
||||||
|
bcdeviceview.h
|
||||||
|
bcdriver.h
|
||||||
|
bcdriverstatewidget.h
|
||||||
|
bcdrivertinycan.h
|
||||||
|
bcthemeswitchbutton.h
|
||||||
|
bctoggleswitch.h
|
||||||
|
bctransmitter.h
|
||||||
|
bcvalue.h
|
||||||
|
bcvaluedelegate.h
|
||||||
|
bcvaluemodel.h
|
||||||
|
bcvalueslider.h
|
||||||
|
BCValueSliderStyle.h
|
||||||
|
bcxmlloader.h
|
||||||
|
# UI Forms
|
||||||
|
bcmainwindow.ui
|
||||||
|
bcvalueslider.ui
|
||||||
|
# Resources
|
||||||
|
bionxcontrol.qrc
|
||||||
|
)
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# 4. Plattform-Spezifika (Architektur-Entscheidung)
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
# Windows-Spezifische Quellen und Libs
|
||||||
|
if(WIN32)
|
||||||
|
message(STATUS "Konfiguration für Windows.")
|
||||||
|
list(APPEND PROJECT_SOURCES
|
||||||
|
libwin/can_drv_win.c
|
||||||
|
libwin/mhs_can_drv.c
|
||||||
|
)
|
||||||
|
# Falls du die Libs später aktivieren willst (wie im .pro auskommentiert):
|
||||||
|
# target_link_libraries(BionxControl PRIVATE Advapi32)
|
||||||
|
# target_link_directories(BionxControl PRIVATE "${CMAKE_CURRENT_SOURCE_DIR}/can_api")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Linux / Raspberry Pi (ARM) Logik
|
||||||
|
if(UNIX AND NOT APPLE)
|
||||||
|
# Check ob wir auf ARM kompilieren (für RPi)
|
||||||
|
if(CMAKE_SYSTEM_PROCESSOR MATCHES "arm" OR CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64")
|
||||||
|
message(STATUS "Konfiguration für Raspberry Pi (ARM) erkannt.")
|
||||||
|
# Optimierungs-Flag aus deiner .pro
|
||||||
|
add_compile_options(-O3)
|
||||||
|
|
||||||
|
# Falls du wiringPi oder can Treiber brauchst:
|
||||||
|
# target_link_libraries(BionxControl PRIVATE wiringPi mhstcan)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# Hinweis: Im original .pro waren die .c Files auch unter Linux aktiv.
|
||||||
|
# Falls die C-Treiber auch unter Linux laufen sollen, verschiebe sie
|
||||||
|
# aus dem if(WIN32) Block nach oben in PROJECT_SOURCES.
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# 5. Executable erstellen
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
qt_add_executable(BionxControl
|
||||||
|
MANUAL_FINALIZATION
|
||||||
|
${PROJECT_SOURCES}
|
||||||
|
)
|
||||||
|
|
||||||
|
# Include-Pfade (Äquivalent zu INCLUDEPATH += . libwin)
|
||||||
|
target_include_directories(BionxControl PRIVATE
|
||||||
|
.
|
||||||
|
libwin
|
||||||
|
)
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# 6. Bibliotheken linken
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
target_link_libraries(BionxControl PRIVATE
|
||||||
|
Qt6::Core
|
||||||
|
Qt6::Gui
|
||||||
|
Qt6::Widgets
|
||||||
|
Qt6::Svg
|
||||||
|
)
|
||||||
|
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# 7. Deployment / Installation
|
||||||
|
# ------------------------------------------------------------------------------
|
||||||
|
# Äquivalent zu deinem "target.path" Block
|
||||||
|
install(TARGETS BionxControl
|
||||||
|
BUNDLE DESTINATION .
|
||||||
|
RUNTIME DESTINATION bin
|
||||||
|
)
|
||||||
|
|
||||||
|
# Unter Windows: Konsolenfenster unterdrücken (außer im Debug-Mode wenn gewünscht)
|
||||||
|
if(WIN32)
|
||||||
|
set_target_properties(BionxControl PROPERTIES WIN32_EXECUTABLE ON)
|
||||||
|
endif()
|
||||||
22
CMakePresets.json
Normal file
22
CMakePresets.json
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"version": 3,
|
||||||
|
"configurePresets": [
|
||||||
|
{
|
||||||
|
"hidden": true,
|
||||||
|
"name": "Qt",
|
||||||
|
"cacheVariables": {
|
||||||
|
"CMAKE_PREFIX_PATH": "$env{QTDIR}"
|
||||||
|
},
|
||||||
|
"vendor": {
|
||||||
|
"qt-project.org/Qt": {
|
||||||
|
"checksum": "wVa86FgEkvdCTVp1/nxvrkaemJc="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"vendor": {
|
||||||
|
"qt-project.org/Presets": {
|
||||||
|
"checksum": "67SmY24ZeVbebyKD0fGfIzb/bGI="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
112
CMakeUserPresets.json
Normal file
112
CMakeUserPresets.json
Normal file
@@ -0,0 +1,112 @@
|
|||||||
|
{
|
||||||
|
"version": 3,
|
||||||
|
"configurePresets": [
|
||||||
|
{
|
||||||
|
"name": "Qt-Debug",
|
||||||
|
"inherits": "Qt-Default",
|
||||||
|
"binaryDir": "${sourceDir}/out/build/debug",
|
||||||
|
"cacheVariables": {
|
||||||
|
"CMAKE_BUILD_TYPE": "Debug",
|
||||||
|
"CMAKE_CXX_FLAGS": "-DQT_QML_DEBUG"
|
||||||
|
},
|
||||||
|
"environment": {
|
||||||
|
"QML_DEBUG_ARGS": "-qmljsdebugger=file:{aad3125d-03d3-444f-a577-6e1a42300747},block"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Qt-Release",
|
||||||
|
"inherits": "Qt-Default",
|
||||||
|
"binaryDir": "${sourceDir}/out/build/release",
|
||||||
|
"cacheVariables": {
|
||||||
|
"CMAKE_BUILD_TYPE": "Release"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"hidden": true,
|
||||||
|
"name": "Qt-Default",
|
||||||
|
"inherits": "msvc2022x64Qt6",
|
||||||
|
"vendor": {
|
||||||
|
"qt-project.org/Default": {
|
||||||
|
"checksum": "i66Ru6Xr2iTwQJrInr6OBGYjRK8="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"hidden": true,
|
||||||
|
"name": "5.13.2_msvc2017",
|
||||||
|
"inherits": "Qt",
|
||||||
|
"environment": {
|
||||||
|
"QTDIR": "C:/Qt/Qt5.13.2/5.13.2/msvc2017"
|
||||||
|
},
|
||||||
|
"architecture": {
|
||||||
|
"strategy": "external",
|
||||||
|
"value": "x86"
|
||||||
|
},
|
||||||
|
"generator": "Ninja",
|
||||||
|
"vendor": {
|
||||||
|
"qt-project.org/Version": {
|
||||||
|
"checksum": "buLxQ1kUsADOzoJ+w8yPcUB7uPI="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"hidden": true,
|
||||||
|
"name": "msvc2022x64Qt6",
|
||||||
|
"inherits": "Qt",
|
||||||
|
"environment": {
|
||||||
|
"QTDIR": "C:/Qt/6.10.1/msvc2022_64"
|
||||||
|
},
|
||||||
|
"architecture": {
|
||||||
|
"strategy": "external",
|
||||||
|
"value": "x64"
|
||||||
|
},
|
||||||
|
"generator": "Ninja",
|
||||||
|
"vendor": {
|
||||||
|
"qt-project.org/Version": {
|
||||||
|
"checksum": "4+Yj6B2/47gfzBNUic9pikpc6XY="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"hidden": true,
|
||||||
|
"name": "VS2017x64Default",
|
||||||
|
"inherits": "Qt",
|
||||||
|
"environment": {
|
||||||
|
"QTDIR": "C:/Qt/Qt5.13.2/5.13.2/msvc2017_64"
|
||||||
|
},
|
||||||
|
"architecture": {
|
||||||
|
"strategy": "external",
|
||||||
|
"value": "x64"
|
||||||
|
},
|
||||||
|
"generator": "Ninja",
|
||||||
|
"vendor": {
|
||||||
|
"qt-project.org/Version": {
|
||||||
|
"checksum": "8CScCBxKrPnt9tGlvYctTIj9T7o="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"hidden": true,
|
||||||
|
"name": "VS2017x86Default",
|
||||||
|
"inherits": "Qt",
|
||||||
|
"environment": {
|
||||||
|
"QTDIR": "C:/Qt/Qt5.13.2/5.13.2/msvc2017"
|
||||||
|
},
|
||||||
|
"architecture": {
|
||||||
|
"strategy": "external",
|
||||||
|
"value": "x86"
|
||||||
|
},
|
||||||
|
"generator": "Ninja",
|
||||||
|
"vendor": {
|
||||||
|
"qt-project.org/Version": {
|
||||||
|
"checksum": "0W/xbuyiWWemn9gHwntcl/pzeNw="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"vendor": {
|
||||||
|
"qt-project.org/Presets": {
|
||||||
|
"checksum": "VXVUfuzC5iU0zlFoq9u8LP40dyc="
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -30,7 +30,7 @@
|
|||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
#ifndef B_CDRIVERSTATEWIDGET_H
|
#ifndef BC_DRIVERSTATEWIDGET_H
|
||||||
#define BC_DRIVERSTATEWIDGET_H
|
#define BC_DRIVERSTATEWIDGET_H
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -266,14 +266,14 @@ retry:
|
|||||||
while( timeOuts-- && !::CanReceiveGetCount( 0 ) )
|
while( timeOuts-- && !::CanReceiveGetCount( 0 ) )
|
||||||
bc::delay_millis( cTIMEOUT_MS );
|
bc::delay_millis( cTIMEOUT_MS );
|
||||||
|
|
||||||
if( timeOuts == -1 )
|
if (timeOuts == -1)
|
||||||
return std::unexpected(QString("readRawValue error: (Node)Timeout" ));
|
return std::unexpected(QString("readRawValue error: (Node)Timeout" ));
|
||||||
|
|
||||||
// message empfangen
|
// message empfangen
|
||||||
int err = ::CanReceive( 0, &msg, 1 );
|
int err = ::CanReceive( 0, &msg, 1 );
|
||||||
|
|
||||||
if( err < 0 )
|
if( err < 0 )
|
||||||
return std::unexpected(QString("readRawValue error: Lesefehler" ));
|
return std::unexpected(QString("CAN response errror: Timeout"));
|
||||||
|
|
||||||
if( --retries && ( msg.Id != (uint32_t)BC::ID::ID_Bib || msg.MsgLen != 4 || msg.MsgData[1] != registerID ) )
|
if( --retries && ( msg.Id != (uint32_t)BC::ID::ID_Bib || msg.MsgLen != 4 || msg.MsgData[1] != registerID ) )
|
||||||
goto retry;
|
goto retry;
|
||||||
|
|||||||
@@ -133,9 +133,9 @@ void BCValueDelegate::paint(QPainter *painter, const QStyleOptionViewItem& optio
|
|||||||
{
|
{
|
||||||
// Wir zeichnen boolean Values an toggle switches
|
// Wir zeichnen boolean Values an toggle switches
|
||||||
if( bcValue.valueType() == BCValue::ValueType::Bool )
|
if( bcValue.valueType() == BCValue::ValueType::Bool )
|
||||||
paintToggleSwitch(painter, option, bcValue);
|
paintPlainToggleSwitch(painter, option, bcValue);
|
||||||
else
|
else
|
||||||
paintSlider(painter, option.rect, bcValue.calcMinMaxRatio() );
|
paintPlainSliderIndicator(painter, option.rect, bcValue.calcMinMaxRatio() );
|
||||||
}
|
}
|
||||||
|
|
||||||
if(_rowOpacities.contains(row))
|
if(_rowOpacities.contains(row))
|
||||||
@@ -143,10 +143,11 @@ void BCValueDelegate::paint(QPainter *painter, const QStyleOptionViewItem& optio
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BCValueDelegate::paintSlider(QPainter* painter, const QRect& rect, double ratio )const
|
void BCValueDelegate::paintPlainSliderIndicator(QPainter* painter, const QRect& rect, double ratio )const
|
||||||
{
|
{
|
||||||
QRect sliderRect = BCValueSlider::updateEditorRect( rect );
|
QRect sliderRect = BCValueSlider::updateEditorRect( rect );
|
||||||
BCValueSliderStyle::paintSliderIndicator2(painter, sliderRect, ratio );
|
qDebug() << " --- Paint SLIDER ";
|
||||||
|
BCValueSlider::paintSliderIndicator2(painter, sliderRect, ratio );
|
||||||
}
|
}
|
||||||
|
|
||||||
void BCValueDelegate::paintHighlightRow(QPainter* painter, const QStyleOptionViewItem& option, int row) const
|
void BCValueDelegate::paintHighlightRow(QPainter* painter, const QStyleOptionViewItem& option, int row) const
|
||||||
@@ -185,7 +186,7 @@ void BCValueDelegate::updateEditorGeometry(QWidget *editor, const QStyleOptionVi
|
|||||||
editor->setGeometry(sliderRect); // Slider nur über Progress Bar
|
editor->setGeometry(sliderRect); // Slider nur über Progress Bar
|
||||||
}
|
}
|
||||||
|
|
||||||
void BCValueDelegate::paintToggleSwitch(QPainter* painter, const QStyleOptionViewItem& option, const BCValue& bcValue) const
|
void BCValueDelegate::paintPlainToggleSwitch(QPainter* painter, const QStyleOptionViewItem& option, const BCValue& bcValue) const
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,8 +69,8 @@ protected:
|
|||||||
|
|
||||||
void updateRow(int row);
|
void updateRow(int row);
|
||||||
void paintHighlightRow(QPainter* painter, const QStyleOptionViewItem& option, int row) const;
|
void paintHighlightRow(QPainter* painter, const QStyleOptionViewItem& option, int row) const;
|
||||||
void paintToggleSwitch(QPainter* painter, const QStyleOptionViewItem& option, const BCValue& bcValue) const;
|
void paintPlainToggleSwitch(QPainter* painter, const QStyleOptionViewItem& option, const BCValue& bcValue) const;
|
||||||
void paintSlider(QPainter* painter, const QRect& rect, double ratio ) const;
|
void paintPlainSliderIndicator(QPainter* painter, const QRect& rect, double ratio ) const;
|
||||||
// Das ist ein Quickhack, der Delegate sollte
|
// Das ist ein Quickhack, der Delegate sollte
|
||||||
// nichts über die Originaldaten wissen. Die
|
// nichts über die Originaldaten wissen. Die
|
||||||
// Datenbeschaffung ist alleine Sache des Models.
|
// Datenbeschaffung ist alleine Sache des Models.
|
||||||
|
|||||||
@@ -93,3 +93,207 @@ QRect BCValueSlider::updateEditorRect( const QRect& rect)
|
|||||||
0 // Unten: kein Offset
|
0 // Unten: kein Offset
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief Zeichnet eine passiven Slider, um den möglichen Wertebereich des übergebenen BCValue anzuzeigen.
|
||||||
|
*/
|
||||||
|
|
||||||
|
void BCValueSlider::paintSliderIndicator(QPainter* painter, const QRect& rect, double ratio )
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Kleinen Slider-Indikator zeichnen
|
||||||
|
painter->save();
|
||||||
|
painter->setRenderHint(QPainter::Antialiasing);
|
||||||
|
|
||||||
|
int adjX = rect.width() - 130; //cTextBlockOffset;
|
||||||
|
|
||||||
|
// Mini Progress Bar: der Gesamtbereich
|
||||||
|
QRect barRect = rect.adjusted( adjX, 12, -10-24, -12 );
|
||||||
|
painter->setPen(Qt::NoPen);
|
||||||
|
painter->setBrush(QColor(0xE0E0E0));
|
||||||
|
painter->drawRoundedRect(barRect, 2, 2);
|
||||||
|
|
||||||
|
qDebug() << " --- doPaint: in paintSliderIndicator1: " << rect;
|
||||||
|
qDebug() << " --- doPaint: in paintSliderIndicator2: " << barRect;
|
||||||
|
|
||||||
|
// Mini Progress Bar: der Wertebereich
|
||||||
|
barRect.setWidth( ratio * barRect.width() );
|
||||||
|
painter->setBrush(QColor(0x0078D4));
|
||||||
|
painter->drawRoundedRect(barRect, 2, 2);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
painter->restore();
|
||||||
|
}
|
||||||
|
|
||||||
|
void BCValueSlider::paintSliderIndicator2(QPainter* painter, const QRect& rect, double ratio )
|
||||||
|
{
|
||||||
|
// Kleinen Slider-Indikator zeichnen
|
||||||
|
painter->save();
|
||||||
|
painter->setRenderHint(QPainter::Antialiasing);
|
||||||
|
|
||||||
|
qDebug() << " --- doPaint: in paintSliderIndicator: " <<rect;
|
||||||
|
|
||||||
|
painter->setBrush(Qt::green);
|
||||||
|
QRect barRect = rect.adjusted( 0, 5, 0, -5 );
|
||||||
|
painter->drawRoundedRect(barRect, 2, 2);
|
||||||
|
|
||||||
|
/*
|
||||||
|
// Mini Progress Bar: der Gesamtbereich
|
||||||
|
//QRect barRect = rect.adjusted( 0, 12, -10-24, -12 );
|
||||||
|
QRect barRect = rect;//.adjusted( 0, 12, 0, -12 );
|
||||||
|
|
||||||
|
painter->setPen(Qt::NoPen);
|
||||||
|
painter->setBrush(QColor(0xE0E0E0));
|
||||||
|
painter->drawRoundedRect(barRect, 2, 2);
|
||||||
|
|
||||||
|
// Mini Progress Bar: der Wertebereich
|
||||||
|
barRect.setWidth( ratio * barRect.width() );
|
||||||
|
painter->setBrush(QColor(0x0078D4));
|
||||||
|
painter->drawRoundedRect(barRect, 2, 2);
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
painter->restore();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
BCValueSlider::BCValueSliderStyle::BCValueSliderStyle()
|
||||||
|
: QProxyStyle()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
int BCValueSlider::BCValueSliderStyle::pixelMetric(PixelMetric metric, const QStyleOption* option, const QWidget* widget ) const
|
||||||
|
{
|
||||||
|
switch (metric)
|
||||||
|
{
|
||||||
|
case PM_SliderThickness:
|
||||||
|
return 24; // Höhe für horizontalen Slider
|
||||||
|
case PM_SliderLength:
|
||||||
|
return 16; // Handle-Größe
|
||||||
|
case PM_SliderControlThickness:
|
||||||
|
return 16;
|
||||||
|
case PM_SliderSpaceAvailable:
|
||||||
|
if (option)
|
||||||
|
{
|
||||||
|
if (const QStyleOptionSlider* sliderOpt = qstyleoption_cast<const QStyleOptionSlider*>(option))
|
||||||
|
{
|
||||||
|
return sliderOpt->rect.width() - 20;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return QProxyStyle::pixelMetric(metric, option, widget);
|
||||||
|
|
||||||
|
default:
|
||||||
|
return QProxyStyle::pixelMetric(metric, option, widget);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
QRect BCValueSlider::BCValueSliderStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex* opt,SubControl sc, const QWidget* widget) const
|
||||||
|
{
|
||||||
|
if (cc == CC_Slider) {
|
||||||
|
if (const QStyleOptionSlider* slider = qstyleoption_cast<const QStyleOptionSlider*>(opt))
|
||||||
|
{
|
||||||
|
QRect rect = slider->rect;
|
||||||
|
int handleSize = 16;
|
||||||
|
|
||||||
|
if (sc == SC_SliderHandle)
|
||||||
|
{
|
||||||
|
// Handle Position korrekt berechnen
|
||||||
|
int range = slider->maximum - slider->minimum;
|
||||||
|
int pos = slider->sliderPosition - slider->minimum;
|
||||||
|
int pixelRange = rect.width() - handleSize;
|
||||||
|
int pixelPos = (range != 0) ? (pos * pixelRange) / range : 0;
|
||||||
|
|
||||||
|
return QRect(rect.x() + pixelPos,
|
||||||
|
rect.center().y() - handleSize / 2,
|
||||||
|
handleSize, handleSize);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return QProxyStyle::subControlRect(cc, opt, sc, widget);
|
||||||
|
}
|
||||||
|
|
||||||
|
void BCValueSlider::BCValueSliderStyle::drawComplexControl(ComplexControl control, const QStyleOptionComplex* option, QPainter* painter, const QWidget* widget) const
|
||||||
|
{
|
||||||
|
if (control == CC_Slider)
|
||||||
|
{
|
||||||
|
if (const QStyleOptionSlider* slider = qstyleoption_cast<const QStyleOptionSlider*>(option)) {
|
||||||
|
painter->setRenderHint(QPainter::Antialiasing);
|
||||||
|
|
||||||
|
// Fluent Colors
|
||||||
|
QColor accentColor(0, 120, 212); // #0078D4
|
||||||
|
QColor bgColor(255, 255, 255); // White background
|
||||||
|
drawHorizontalFluentSlider(painter, slider, accentColor, bgColor);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
QProxyStyle::drawComplexControl(control, option, painter, widget);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void BCValueSlider::BCValueSliderStyle::drawHorizontalFluentSlider(QPainter* painter, const QStyleOptionSlider* slider,
|
||||||
|
const QColor& activeColor,
|
||||||
|
const QColor& bgColor) const
|
||||||
|
{
|
||||||
|
QRect groove = slider->rect;
|
||||||
|
|
||||||
|
|
||||||
|
QRect handleRect = subControlRect(CC_Slider, slider, SC_SliderHandle, nullptr);
|
||||||
|
// Das 'subControlRect' für den SC_SliderHandle ist _nicht_ mittig
|
||||||
|
handleRect.setY( handleRect.y() + 2 );
|
||||||
|
|
||||||
|
qDebug() << " --- doPaint: drawHorizontalFluentSlider" << groove << " Handle: " << handleRect;
|
||||||
|
paintSliderIndicator2(painter, groove, 0.5 );
|
||||||
|
|
||||||
|
painter->setBrush(Qt::red);
|
||||||
|
painter->drawRect(handleRect);
|
||||||
|
|
||||||
|
return;
|
||||||
|
|
||||||
|
// Handle (Thumb) - Fluent style is more subtle
|
||||||
|
int handleSize = 14;
|
||||||
|
QRect thumbRect(handleRect.center().x() - handleSize / 2,
|
||||||
|
handleRect.center().y() - handleSize / 2,
|
||||||
|
handleSize, handleSize);
|
||||||
|
|
||||||
|
/*
|
||||||
|
// Hover effect - subtle glow
|
||||||
|
if (slider->state & State_MouseOver)
|
||||||
|
{
|
||||||
|
painter->setBrush(QColor(activeColor.red(), activeColor.green(),
|
||||||
|
activeColor.blue(), 30));
|
||||||
|
int glowSize = 16;
|
||||||
|
QRect glow(handle.center().x() - glowSize / 2,
|
||||||
|
handle.center().y() - glowSize / 2,
|
||||||
|
glowSize, glowSize);
|
||||||
|
painter->drawEllipse(glow);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
// Thumb
|
||||||
|
painter->setBrush(bgColor);
|
||||||
|
painter->setPen(QPen(activeColor, 2));
|
||||||
|
painter->drawEllipse(thumbRect);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
// Inner circle for pressed state
|
||||||
|
if (slider->state & State_Sunken)
|
||||||
|
{
|
||||||
|
int innerSize = 6;
|
||||||
|
QRect inner(handle.center().x() - innerSize / 2,
|
||||||
|
handle.center().y() - innerSize / 2,
|
||||||
|
innerSize, innerSize);
|
||||||
|
painter->setPen(Qt::NoPen);
|
||||||
|
painter->setBrush(activeColor);
|
||||||
|
painter->drawEllipse(inner);
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,10 @@
|
|||||||
|
|
||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
#include <QTableView>
|
||||||
|
#include <QSlider>
|
||||||
|
#include <QPainter>
|
||||||
|
#include <QProxyStyle>
|
||||||
|
|
||||||
#include <bcvalue.h>
|
#include <bcvalue.h>
|
||||||
#include <ui_bcvalueslider.h>
|
#include <ui_bcvalueslider.h>
|
||||||
@@ -25,6 +29,9 @@ public:
|
|||||||
// helper functions
|
// helper functions
|
||||||
static QRect updateEditorRect( const QRect& rect);
|
static QRect updateEditorRect( const QRect& rect);
|
||||||
|
|
||||||
|
static void paintSliderIndicator(QPainter* painter, const QRect& rect, double ratio );
|
||||||
|
static void paintSliderIndicator2(QPainter* painter, const QRect& rect, double ratio );
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
|
|
||||||
void valueChanged(int value);
|
void valueChanged(int value);
|
||||||
@@ -32,6 +39,22 @@ signals:
|
|||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
|
// Fluent Design Slider Style
|
||||||
|
class BCValueSliderStyle : public QProxyStyle
|
||||||
|
{
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
BCValueSliderStyle();
|
||||||
|
|
||||||
|
int pixelMetric(PixelMetric metric, const QStyleOption* option = nullptr, const QWidget* widget = nullptr) const override;
|
||||||
|
|
||||||
|
QRect subControlRect(ComplexControl cc, const QStyleOptionComplex* opt, SubControl sc, const QWidget* widget) const override;
|
||||||
|
void drawComplexControl(ComplexControl control, const QStyleOptionComplex* option, QPainter* painter, const QWidget* widget) const override;
|
||||||
|
void drawHorizontalFluentSlider(QPainter* painter, const QStyleOptionSlider* slider, const QColor& activeColor, const QColor& bgColor) const;
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
static constexpr int cTextBlockOffset = 130;
|
static constexpr int cTextBlockOffset = 130;
|
||||||
static constexpr int cPaddingRight = 8;
|
static constexpr int cPaddingRight = 8;
|
||||||
static constexpr int cSliderWidth = 117;
|
static constexpr int cSliderWidth = 117;
|
||||||
|
|||||||
@@ -22,11 +22,11 @@
|
|||||||
/***************************************************************/
|
/***************************************************************/
|
||||||
#define CAN_FEATURE_LOM 0x0001 // Silent Mode (LOM = Listen only Mode)
|
#define CAN_FEATURE_LOM 0x0001 // Silent Mode (LOM = Listen only Mode)
|
||||||
#define CAN_FEATURE_ARD 0x0002 // Automatic Retransmission disable
|
#define CAN_FEATURE_ARD 0x0002 // Automatic Retransmission disable
|
||||||
#define CAN_FEATURE_TX_ACK 0x0004 // TX ACK (Gesendete Nachrichten best<EFBFBD>tigen)
|
#define CAN_FEATURE_TX_ACK 0x0004 // TX ACK (Gesendete Nachrichten bestätigen)
|
||||||
#define CAN_FEATURE_ERROR_MSGS 0x0008 // Error Messages Support
|
#define CAN_FEATURE_ERROR_MSGS 0x0008 // Error Messages Support
|
||||||
#define CAN_FEATURE_FD_HARDWARE 0x0010 // CAN-FD Hardware
|
#define CAN_FEATURE_FD_HARDWARE 0x0010 // CAN-FD Hardware
|
||||||
#define CAN_FEATURE_FIFO_OV_MODE 0x0020 // FIFO OV Mode (Auto Clear, OV CAN Messages)
|
#define CAN_FEATURE_FIFO_OV_MODE 0x0020 // FIFO OV Mode (Auto Clear, OV CAN Messages)
|
||||||
#define CAN_FEATURE_ECU_FLASH 0x0040 // Hardware beschleunigung f<EFBFBD>r ISO-TP ECU-Flash programmierung
|
#define CAN_FEATURE_ECU_FLASH 0x0040 // Hardware beschleunigung für ISO-TP ECU-Flash programmierung
|
||||||
#define CAN_FEATURE_CAN_TEST 0x4000 // Tiny-CAN Tester Firmware
|
#define CAN_FEATURE_CAN_TEST 0x4000 // Tiny-CAN Tester Firmware
|
||||||
#define CAN_FEATURE_HW_TIMESTAMP 0x8000 // Hardware Time Stamp
|
#define CAN_FEATURE_HW_TIMESTAMP 0x8000 // Hardware Time Stamp
|
||||||
|
|
||||||
@@ -165,32 +165,32 @@
|
|||||||
struct TModulFeatures
|
struct TModulFeatures
|
||||||
{
|
{
|
||||||
uint32_t CanClock; // Clock-Frequenz des CAN-Controllers, muss nicht mit
|
uint32_t CanClock; // Clock-Frequenz des CAN-Controllers, muss nicht mit
|
||||||
// der Clock-Frequenz des Mikrocontrollers <EFBFBD>bereinstimmen
|
// der Clock-Frequenz des Mikrocontrollers übereinstimmen
|
||||||
uint32_t Flags; // Unterst<EFBFBD>tzte Features des Moduls:
|
uint32_t Flags; // Unterstützte Features des Moduls:
|
||||||
// Bit Define-Makro
|
// Bit Define-Makro
|
||||||
// 0x0001 CAN_FEATURE_LOM -> Silent Mode (LOM = Listen only Mode)
|
// 0x0001 CAN_FEATURE_LOM -> Silent Mode (LOM = Listen only Mode)
|
||||||
// 0x0002 CAN_FEATURE_ARD -> Automatic Retransmission disable
|
// 0x0002 CAN_FEATURE_ARD -> Automatic Retransmission disable
|
||||||
// 0x0004 CAN_FEATURE_TX_ACK -> TX ACK (Gesendete Nachrichten best<EFBFBD>tigen)
|
// 0x0004 CAN_FEATURE_TX_ACK -> TX ACK (Gesendete Nachrichten bestätigen)
|
||||||
// 0x0008 CAN_FEATURE_ERROR_MSGS -> Error Messages Support
|
// 0x0008 CAN_FEATURE_ERROR_MSGS -> Error Messages Support
|
||||||
// 0x0010 CAN_FEATURE_FD_HARDWARE -> CAN-FD Hardware
|
// 0x0010 CAN_FEATURE_FD_HARDWARE -> CAN-FD Hardware
|
||||||
// 0x0020 CAN_FEATURE_FIFO_OV_MODE -> FIFO OV Mode (Auto Clear, OV CAN Messages)
|
// 0x0020 CAN_FEATURE_FIFO_OV_MODE -> FIFO OV Mode (Auto Clear, OV CAN Messages)
|
||||||
// 0x0040 CAN_FEATURE_ECU_FLASH -> Hardware beschleunigung f<EFBFBD>r ISO-TP ECU-Flash programmierung
|
// 0x0040 CAN_FEATURE_ECU_FLASH -> Hardware beschleunigung für ISO-TP ECU-Flash programmierung
|
||||||
// 0x4000 CAN_FEATURE_CAN_TEST -> Tiny-CAN Tester Firmware
|
// 0x4000 CAN_FEATURE_CAN_TEST -> Tiny-CAN Tester Firmware
|
||||||
// 0x8000 CAN_FEATURE_HW_TIMESTAMP -> Hardware Time Stamp
|
// 0x8000 CAN_FEATURE_HW_TIMESTAMP -> Hardware Time Stamp
|
||||||
uint32_t CanChannelsCount; // Anzahl der CAN Schnittstellen, reserviert f<EFBFBD>r
|
uint32_t CanChannelsCount; // Anzahl der CAN Schnittstellen, reserviert für
|
||||||
// zuk<EFBFBD>nftige Module mit mehr als einer Schnittstelle
|
// zukünftige Module mit mehr als einer Schnittstelle
|
||||||
uint32_t HwRxFilterCount; // Anzahl der zur Verf<EFBFBD>gung stehenden Receive-Filter
|
uint32_t HwRxFilterCount; // Anzahl der zur Verfügung stehenden Receive-Filter
|
||||||
uint32_t HwTxPufferCount; // Anzahl der zur Verf<EFBFBD>gung stehenden Transmit Puffer mit Timer
|
uint32_t HwTxPufferCount; // Anzahl der zur Verfügung stehenden Transmit Puffer mit Timer
|
||||||
};
|
};
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
||||||
#pragma pack(push, 1)
|
#pragma pack(push, 1)
|
||||||
struct TCanDevicesList
|
struct TCanDevicesList
|
||||||
{
|
{
|
||||||
uint32_t TCanIdx; // Ist das Device ge<EFBFBD>ffnet ist der Wert auf dem Device-Index
|
uint32_t TCanIdx; // Ist das Device geöffnet ist der Wert auf dem Device-Index
|
||||||
// gesetzt, ansonsten ist der Wert auf "INDEX_INVALID" gesetzt.
|
// gesetzt, ansonsten ist der Wert auf "INDEX_INVALID" gesetzt.
|
||||||
uint32_t HwId; // Ein 32 Bit Schl<EFBFBD>ssel der die Hardware eindeutig Identifiziert.
|
uint32_t HwId; // Ein 32 Bit Schlüssel der die Hardware eindeutig Identifiziert.
|
||||||
// Manche Module m<EFBFBD>ssen erst ge<EFBFBD>ffnet werden damit dieser Wert
|
// Manche Module müssen erst geöffnet werden damit dieser Wert
|
||||||
// gesetzt wird
|
// gesetzt wird
|
||||||
char DeviceName[255]; // Nur Linux: entspricht den Device Namen des USB-Devices,
|
char DeviceName[255]; // Nur Linux: entspricht den Device Namen des USB-Devices,
|
||||||
// z.B. /dev/ttyUSB0
|
// z.B. /dev/ttyUSB0
|
||||||
@@ -199,7 +199,7 @@ struct TCanDevicesList
|
|||||||
// muss in den USB-Controller programmiert sein,
|
// muss in den USB-Controller programmiert sein,
|
||||||
// was zur Zeit nur bei den Modulen Tiny-CAN II-XL,
|
// was zur Zeit nur bei den Modulen Tiny-CAN II-XL,
|
||||||
// IV-XL u. M1 der Fall ist.
|
// IV-XL u. M1 der Fall ist.
|
||||||
struct TModulFeatures ModulFeatures; // Unterst<EFBFBD>tzte Features des Moduls, nur g<EFBFBD>ltig
|
struct TModulFeatures ModulFeatures; // Unterstützte Features des Moduls, nur gültig
|
||||||
// wenn HwId > 0
|
// wenn HwId > 0
|
||||||
};
|
};
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
@@ -207,28 +207,28 @@ struct TCanDevicesList
|
|||||||
#pragma pack(push, 1)
|
#pragma pack(push, 1)
|
||||||
struct TCanDeviceInfo
|
struct TCanDeviceInfo
|
||||||
{
|
{
|
||||||
uint32_t HwId; // Ein 32 Bit Schl<EFBFBD>ssel der die Hardware eindeutig Identifiziert.
|
uint32_t HwId; // Ein 32 Bit Schlüssel der die Hardware eindeutig Identifiziert.
|
||||||
uint32_t FirmwareVersion; // Version der Firmware des Tiny-CAN Moduls
|
uint32_t FirmwareVersion; // Version der Firmware des Tiny-CAN Moduls
|
||||||
uint32_t FirmwareInfo; // Informationen zum Stand der Firmware Version
|
uint32_t FirmwareInfo; // Informationen zum Stand der Firmware Version
|
||||||
// 0 = Unbekannt
|
// 0 = Unbekannt
|
||||||
// 1 = Firmware veraltet, Device kann nicht ge<EFBFBD>ffnet werden
|
// 1 = Firmware veraltet, Device kann nicht geöffnet werden
|
||||||
// 2 = Firmware veraltet, Funktionsumfang eingeschr<EFBFBD>nkt
|
// 2 = Firmware veraltet, Funktionsumfang eingeschränkt
|
||||||
// 3 = Firmware veraltet, keine Einschr<EFBFBD>nkungen
|
// 3 = Firmware veraltet, keine Einschränkungen
|
||||||
// 4 = Firmware auf Stand
|
// 4 = Firmware auf Stand
|
||||||
// 5 = Firmware neuer als Erwartet
|
// 5 = Firmware neuer als Erwartet
|
||||||
char SerialNumber[16]; // Seriennummer des Moduls
|
char SerialNumber[16]; // Seriennummer des Moduls
|
||||||
char Description[64]; // Modul Bezeichnung, z.B. "Tiny-CAN IV-XL"
|
char Description[64]; // Modul Bezeichnung, z.B. "Tiny-CAN IV-XL"
|
||||||
struct TModulFeatures ModulFeatures; // Unterst<EFBFBD>tzte Features des Moduls
|
struct TModulFeatures ModulFeatures; // Unterstützte Features des Moduls
|
||||||
};
|
};
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|
||||||
|
|
||||||
#pragma pack(push, 1)
|
#pragma pack(push, 1)
|
||||||
struct TCanInfoVar // <*> ge<EFBFBD>ndert von TInfoVar in TCanInfoVar
|
struct TCanInfoVar // <*> geändert von TInfoVar in TCanInfoVar
|
||||||
{
|
{
|
||||||
uint32_t Key; // Variablen Schl<EFBFBD>ssel
|
uint32_t Key; // Variablen Schlüssel
|
||||||
uint32_t Type; // Variablen Type
|
uint32_t Type; // Variablen Type
|
||||||
uint32_t Size; // (Max)Gr<EFBFBD><EFBFBD>e der Variable in Byte
|
uint32_t Size; // (Max)Größe der Variable in Byte
|
||||||
char Data[255]; // Wert der Variable
|
char Data[255]; // Wert der Variable
|
||||||
};
|
};
|
||||||
#pragma pack(pop)
|
#pragma pack(pop)
|
||||||
|
|||||||
@@ -126,14 +126,14 @@ Byte 0
|
|||||||
|
|
||||||
struct TCanFlagsBits
|
struct TCanFlagsBits
|
||||||
{
|
{
|
||||||
unsigned Len:4; // Len -> Datenl<EFBFBD>nge 0 - 8 Byte
|
unsigned Len:4; // Len -> Datenlänge 0 - 8 Byte
|
||||||
unsigned TxD:1; // TxD -> 1 = Tx CAN Nachricht, 0 = Rx CAN Nachricht
|
unsigned TxD:1; // TxD -> 1 = Tx CAN Nachricht, 0 = Rx CAN Nachricht
|
||||||
// Eine Erfolgreich versendete Nachricht wird als Best<EFBFBD>tigung
|
// Eine Erfolgreich versendete Nachricht wird als Bestätigung
|
||||||
// ins Empfangsfifo zur<EFBFBD>ckgeschrieben
|
// ins Empfangsfifo zurückgeschrieben
|
||||||
// Nicht alle Module unterst<EFBFBD>tzen diese Funktion u. das
|
// Nicht alle Module unterstützen diese Funktion u. das
|
||||||
// Feature muss aktiveirt sein
|
// Feature muss aktiveirt sein
|
||||||
unsigned Error:1; // Error -> 1 = CAN Bus Fehler Nachricht
|
unsigned Error:1; // Error -> 1 = CAN Bus Fehler Nachricht
|
||||||
// Nicht alle Module unterst<EFBFBD>tzen diese Funktion u. das
|
// Nicht alle Module unterstützen diese Funktion u. das
|
||||||
// Feature muss aktiveirt sein
|
// Feature muss aktiveirt sein
|
||||||
unsigned RTR:1; // Remote Transmition Request bit -> Kennzeichnet eine RTR Nachricht
|
unsigned RTR:1; // Remote Transmition Request bit -> Kennzeichnet eine RTR Nachricht
|
||||||
unsigned EFF:1; // Extended Frame Format bit -> 1 = 29 Bit Id's, 0 = 11 Bit Id's
|
unsigned EFF:1; // Extended Frame Format bit -> 1 = 29 Bit Id's, 0 = 11 Bit Id's
|
||||||
@@ -193,15 +193,15 @@ struct TCanMsg
|
|||||||
struct TCanFdFlagsBits
|
struct TCanFdFlagsBits
|
||||||
{
|
{
|
||||||
unsigned Source:8; // Quelle der Nachricht (Device)
|
unsigned Source:8; // Quelle der Nachricht (Device)
|
||||||
unsigned Len:8; // Len -> Datenl<EFBFBD>nge 0 - 64 Byte
|
unsigned Len:8; // Len -> Datenlänge 0 - 64 Byte
|
||||||
|
|
||||||
unsigned TxD:1; // TxD -> 1 = Tx CAN Nachricht, 0 = Rx CAN Nachricht
|
unsigned TxD:1; // TxD -> 1 = Tx CAN Nachricht, 0 = Rx CAN Nachricht
|
||||||
// Eine Erfolgreich versendete Nachricht wird als Best<EFBFBD>tigung
|
// Eine Erfolgreich versendete Nachricht wird als Bestätigung
|
||||||
// ins Empfangsfifo zur<EFBFBD>ckgeschrieben
|
// ins Empfangsfifo zurückgeschrieben
|
||||||
// Nicht alle Module unterst<EFBFBD>tzen diese Funktion u. das
|
// Nicht alle Module unterstützen diese Funktion u. das
|
||||||
// Feature muss aktiveirt sein
|
// Feature muss aktiveirt sein
|
||||||
unsigned Error:1; // Error -> 1 = CAN Bus Fehler Nachricht
|
unsigned Error:1; // Error -> 1 = CAN Bus Fehler Nachricht
|
||||||
// Nicht alle Module unterst<EFBFBD>tzen diese Funktion u. das
|
// Nicht alle Module unterstützen diese Funktion u. das
|
||||||
// Feature muss aktiveirt sein
|
// Feature muss aktiveirt sein
|
||||||
unsigned RTR:1; // Remote Transmition Request bit -> Kennzeichnet eine RTR Nachricht
|
unsigned RTR:1; // Remote Transmition Request bit -> Kennzeichnet eine RTR Nachricht
|
||||||
unsigned EFF:1; // Extended Frame Format bit -> 1 = 29 Bit Id's, 0 = 11 Bit Id's
|
unsigned EFF:1; // Extended Frame Format bit -> 1 = 29 Bit Id's, 0 = 11 Bit Id's
|
||||||
|
|||||||
Reference in New Issue
Block a user