Added output pipe for Windows cmd. Fixed some colors

This commit is contained in:
Yury Shuvakin
2024-02-15 12:52:48 +09:00
parent 661a1b6ba2
commit 6942d286f3
5 changed files with 21 additions and 5 deletions

View File

@@ -46,6 +46,7 @@ Controls.GroupBox {
visible: control.subTitle.length > 0 visible: control.subTitle.length > 0
font.pixelSize: 23 font.pixelSize: 23
font.weight: Font.Normal font.weight: Font.Normal
backgroundColor: Palette.readyBackgroundColor
backgroundRadius: 16 backgroundRadius: 16
readOnly: true readOnly: true
} }

View File

@@ -10,6 +10,7 @@ QtObject {
property color backgroundColor: "#EEE" property color backgroundColor: "#EEE"
property color controlBackgroundColor: "#FCFCFC" property color controlBackgroundColor: "#FCFCFC"
property color indicatorBackgroundColor: "#F0F4FF" property color indicatorBackgroundColor: "#F0F4FF"
property color readyBackgroundColor: "#C4FFCA"
property color switchBackgroundColor: "#F0F4FF" property color switchBackgroundColor: "#F0F4FF"
property color switchActiveBackgroundColor: "#3069FE" property color switchActiveBackgroundColor: "#3069FE"

View File

@@ -55,7 +55,7 @@ ApplicationWindow {
CustomControls.IndicatorTextField { CustomControls.IndicatorTextField {
visible: DataController.firstStatus === "0x07" && DataController.secondStatus === "0x07" visible: DataController.firstStatus === "0x07" && DataController.secondStatus === "0x07"
text: "Готов к работе" text: "Готов к работе"
backgroundColor: "#C4FFCA" backgroundColor: Palette.readyBackgroundColor
backgroundRadius: 16 backgroundRadius: 16
font.pixelSize: 24 font.pixelSize: 24
font.weight: Font.Normal font.weight: Font.Normal
@@ -141,8 +141,8 @@ ApplicationWindow {
CustomControls.TristateSwitch { CustomControls.TristateSwitch {
id: modeSwitch id: modeSwitch
// enabled: false // uncomment for non clickable // enabled: false // uncomment for non clickable
firstStateDescription: "АИН 1,2,3" firstStateDescription: "АИН1 - АИН3"
secondStateDescription: "АИН 4,5,6" secondStateDescription: "АИН4 - АИН6"
checkState: DataController.ainMode === 2 ? Qt.Unchecked : DataController.ainMode === 1 ? Qt.Checked : Qt.PartiallyChecked checkState: DataController.ainMode === 2 ? Qt.Unchecked : DataController.ainMode === 1 ? Qt.Checked : Qt.PartiallyChecked
Layout.fillHeight: false Layout.fillHeight: false
Layout.fillWidth: true Layout.fillWidth: true

View File

@@ -1,6 +1,6 @@
[General] [General]
name=/dev/ttyS0 name=/dev/ttyS0
;baudRate=9600 ;baudRate=115200
;dataBits=8 ;dataBits=8
;parity=0 ;parity=0
;stopBits=1 ;stopBits=1

View File

@@ -5,15 +5,29 @@
#include <QLocale> #include <QLocale>
#include <QTranslator> #include <QTranslator>
#include <QFontDatabase> #include <QFontDatabase>
#include <QScreen>
#include "DataController.h" #include "DataController.h"
#ifdef _WIN32
#include "Windows.h"
#endif
int main(int argc, char *argv[]) int main(int argc, char *argv[])
{ {
//#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) //#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
// QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling); // QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
//#endif //#endif
// qputenv("QT_SCALE_FACTOR", "0.5");
#ifdef _WIN32
if (AttachConsole(ATTACH_PARENT_PROCESS)) {
freopen("CONOUT$", "w", stdout);
freopen("CONOUT$", "w", stderr);
}
#endif
QGuiApplication app(argc, argv); QGuiApplication app(argc, argv);
QCoreApplication::setOrganizationName("Tksi"); QCoreApplication::setOrganizationName("Tksi");