From 3cf0eee7abbc366c9341faecf40cc9f271242fe8 Mon Sep 17 00:00:00 2001 From: gangphon Date: Tue, 13 Sep 2022 23:16:36 +0800 Subject: [PATCH] =?UTF-8?q?ledok=E5=A2=9E=E5=8A=A0=E6=92=AD=E6=94=BE?= =?UTF-8?q?=E5=99=A8=E8=83=8C=E6=99=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- LedOK/cfg.h | 1 - LedOK/globaldefine.cpp | 16 +- LedOK/main.cpp | 4 +- LedOK/tools.h | 1 + LedOK/translations/app_en.ts | 564 ++++++++--------- LedOK/translations/app_ja.ts | 564 ++++++++--------- LedOK/translations/app_zh_CN.ts | 578 +++++++++--------- LedOK/translations/app_zh_TW.ts | 578 +++++++++--------- .../controlnetconfigwidget.cpp | 12 - .../wDevicesManager/controlnetconfigwidget.h | 1 - LedOK/wDevicesManager/ctrladvancedpanel.cpp | 227 ++++++- LedOK/wDevicesManager/ctrladvancedpanel.h | 10 +- LedOK/wProgramManager/eaudio.cpp | 4 +- LedOK/wProgramManager/egif.cpp | 4 +- LedOK/wProgramManager/emultiwin.cpp | 12 +- LedOK/wProgramManager/ephoto.cpp | 6 +- LedOK/wProgramManager/etext.cpp | 2 +- LedOK/wProgramManager/evideo.cpp | 4 +- LedOK/wProgramManager/pagelistitem.cpp | 4 +- LedOK/wProgramManager/progeditorwin.cpp | 16 +- ledset/expertwin.cpp | 119 +++- 21 files changed, 1519 insertions(+), 1208 deletions(-) diff --git a/LedOK/cfg.h b/LedOK/cfg.h index 2bc420f..72c5151 100644 --- a/LedOK/cfg.h +++ b/LedOK/cfg.h @@ -7,7 +7,6 @@ #define RECTF_INVALID QRectF(-9999, -9999, 0, 0) extern const QString UpdVerUrl; -extern QString fileHome; QString programsDir(); diff --git a/LedOK/globaldefine.cpp b/LedOK/globaldefine.cpp index c87e4db..4ed6f06 100644 --- a/LedOK/globaldefine.cpp +++ b/LedOK/globaldefine.cpp @@ -5,6 +5,7 @@ #include #include #include + bool gTextAntialiasing = false; bool gShowLoraScreen = false; @@ -25,16 +26,16 @@ QString parseReplyJson(QNetworkReply *reply, QJsonDocument *outJson) { error = QNetworkReply::TimeoutError; errStr = QCoreApplication::translate("Def","Connection Timeout"); } - return QString(QMetaEnum::fromType().valueToKey(error))+" ("+QString::number(error)+")\n"+errStr+"\n"+reply->readAll(); + return QString(QMetaEnum::fromType().valueToKey(error))+" ("+QString::number(error)+") "+errStr+"\n"+QCoreApplication::translate("Def","Device replied")+":\n"+reply->readAll(); } } auto status = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); - if(status != 200) return QString::number(status)+" "+reply->attribute(QNetworkRequest::HttpReasonPhraseAttribute).toString()+"\n"+reply->readAll(); + if(status != 200) return QString::number(status)+" "+reply->attribute(QNetworkRequest::HttpReasonPhraseAttribute).toString()+"\n"+QCoreApplication::translate("Def","Device replied")+":\n"+reply->readAll(); if(outJson) { auto data = reply->readAll(); QJsonParseError jsonErr; *outJson = QJsonDocument::fromJson(data, &jsonErr); - if(jsonErr.error != QJsonParseError::NoError) return "JsonError "+jsonErr.errorString()+"\n"+data; + if(jsonErr.error != QJsonParseError::NoError) return "Json error: "+jsonErr.errorString()+"\n"+QCoreApplication::translate("Def","Device replied")+":\n"+data; } return ""; } @@ -49,18 +50,19 @@ QString checkReplyForJson(QNetworkReply *reply, QJsonDocument *doc) { error = QNetworkReply::TimeoutError; errStr = QCoreApplication::translate("Def","Connection Timeout"); } - return QString(QMetaEnum::fromType().valueToKey(error))+" ("+QString::number(error)+")\n"+errStr+"\n"+data; + return QString(QMetaEnum::fromType().valueToKey(error))+" ("+QString::number(error)+") "+errStr+"\n"+QCoreApplication::translate("Def","Device replied")+":\n"+data; } } auto status = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); - if(status != 200) return QString::number(status)+" - "+reply->attribute(QNetworkRequest::HttpReasonPhraseAttribute).toString()+"\n"+data; + if(status != 200) return QString::number(status)+" - "+reply->attribute(QNetworkRequest::HttpReasonPhraseAttribute).toString()+"\n"+QCoreApplication::translate("Def","Device replied")+":\n"+data; QJsonParseError jsonErr; QJsonDocument json = QJsonDocument::fromJson(data, &jsonErr); - if(jsonErr.error != QJsonParseError::NoError) return "JsonError "+jsonErr.errorString()+"\n"+data; - if(! json["success"].toBool()) return QCoreApplication::translate("Def","Fail")+"\n"+data; + if(jsonErr.error != QJsonParseError::NoError) return "Json error: "+jsonErr.errorString()+"\n"+QCoreApplication::translate("Def","Device replied")+":\n"+data; + if(! json["success"].toBool()) return QCoreApplication::translate("Def","Fail")+". "+QCoreApplication::translate("Def","Device replied")+":\n"+data; if(doc) doc->swap(json); return ""; } + bool isTextValid(const QString &strIP){ if(! strIP.isEmpty()) { QRegExp rx2("\\b(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\b"); diff --git a/LedOK/main.cpp b/LedOK/main.cpp index f72ce99..77ad255 100644 --- a/LedOK/main.cpp +++ b/LedOK/main.cpp @@ -28,7 +28,7 @@ LONG WINAPI handleException(_EXCEPTION_POINTERS *excep) { } #endif -QString fileHome; +QString gFileHome; int main(int argc, char *argv[]) { QApplication::setAttribute(Qt::AA_EnableHighDpiScaling); @@ -38,7 +38,7 @@ int main(int argc, char *argv[]) { QApplication::setOrganizationDomain("www.ledok.cn"); QApplication::setApplicationName("LedOK Express"); QApplication a(argc, argv); - fileHome = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation); + gFileHome = QStandardPaths::writableLocation(QStandardPaths::DocumentsLocation); QFont font; font.setFamilies(QStringList{"Arial","Microsoft YaHei UI"}); font.setPixelSize(14); diff --git a/LedOK/tools.h b/LedOK/tools.h index 2b82f00..9219be6 100644 --- a/LedOK/tools.h +++ b/LedOK/tools.h @@ -21,6 +21,7 @@ extern QWidget *gMainWin; extern DevicePanel *gDevicePanel; extern QList *gSelCards; extern QTextEdit *gFdResInfo; +extern QString gFileHome; extern QString gProgDir; extern int gProgWidth; extern int gProgHeight; diff --git a/LedOK/translations/app_en.ts b/LedOK/translations/app_en.ts index 7b4c9d4..580c2f9 100644 --- a/LedOK/translations/app_en.ts +++ b/LedOK/translations/app_en.ts @@ -753,43 +753,41 @@ - - - + + + - - - - - - - - + + + + + + + Success Success - - - + + + - - - - - - - - + + + + + + + failed failed - - + + Tip Tip @@ -879,285 +877,284 @@ Error - SetSwitchWiFi - Set WiFi on/off + Set WiFi on/off - - - - - - + + + + + + SignalPower Signal strength - - + + ConfigurationWiFi Configuration WiFi - + IsPortableHotSpot Get AP or WiFi - + GetWifiList Scan WiFi list - + ConfigurationHotSpot Configuration AP HotSpot - + GetCurrentAPN Get Current Apn - - + + GetSIMStatus Get SIM Status - + SetAPN Set APN - - + + DeviceItem OnProHttpResponse 解析json文件错误! - + 状态: Status: - + 未知 unknown - + 锁定状态,需要用户的PIN码解锁 Lock status, need user's pin code to unlock - + 锁定状态,需要用户的PUK码解锁 In the locked state, the PUK code of the user is required to be unlocked - + 锁定状态,需要网络的PIN码解锁 In the locked state, the PIN code of the user is required to be unlocked - + 就绪 be ready - + no checked sim card no checked sim card - + 国家码: MCC: - + 号码: number: - + 用户: User name: - + 信号: Signal: - + 信号正常 Signal OK - + 不在服务区 Not in service area - + 仅限紧急呼叫 Emergency call only - + 射频已经关闭 RF off - + 网络: Network type: - + 网络类型未知 unKnown - + GPRS网络 GPRS - + EDGE网络 EDGE - + UMTS网络 UMTS - + CDMA网络,IS95A 或 IS95B. CDM - + EVDO网络, revision 0. EVDO,revision 0. - + EVDO网络, revision A. EVDO,revision A. - + 1xRTT网络 1xRTT - + HSDPA网络 HSDPA - + HSUPA网络 HSUPA - + HSPA网络 HSPA - + 漫游: roam: - + Yes Yes - + No No - + 数据连接状态: Data connection status: - + 断开 OFF - + 正在连接 connecting - + 已连接 Connected - + 暂停 suspend - + 数据活动休眠状态: Data active sleep state: - + 活动,但无数据发送和接收 Active, but no data sent and received - + 活动,正在接收数据 Activity, receiving data - + 活动,正在发送数据 Activity, sending data - + 活动,正在接收和发送数据 Activity, receiving and sending data - + 休眠状态 Sleep state - + 信号强度: Signal strength: - + SetSwitchSimData SetSwitchSimData - + ContrFlightMode Set flight mode - + GetFlightModeState Readback flight mode state @@ -2340,44 +2337,44 @@ CtrlAdvancedPanel - + Advanced parameters Advanced parameters - + Screen Width(pixel) Screen Width(pixel) - + Width Width - - + + Height Height - - - - - - - + + + + + + + Set Set - + Alias Alias - + Web Server Address: Web Server Address: @@ -2412,67 +2409,67 @@ - + Realtimer Server Address: Realtimer Server Address: - + Clear Clear - + Apk upgrade Apk upgrade - + Check Apk Check Apk - + Uninstall Uninstall - + Running check Running check - + FPGA version check FPGA version check - + Sync FPGA version Sync FPGA version - + Restart led controller system Restart led controller system - + Check Log Check Log - + Start LedSet4 Start LedSet4.0 (Apk Display2.0 and higher) - + Open ADB Open ADB debugging function - + Post Custom JSON Post Custom JSON @@ -2483,7 +2480,7 @@ - + Clear Program Clear Program @@ -2493,101 +2490,101 @@ - + M80 configuration M80 configuration - + Refresh Refresh - + Restore to default Restore to default - + Taxi top screen configuration Taxi top screen configuration - + Service:High Out of service:Low Service:High Out of service:Low - + Service:Low Out of service:High Service:Low Out of service:High - + Start LedSet3.0 configure LED module Start LedSet3.0 configure LED module (used by manufacturer's professionals) - + Binding *.ic account indentity voucher Binding *.ic account indentity voucher - + Rotate Rotate - + 0 degrees 0 degrees - + 90 degrees 90 degrees - + 180 degrees 180 degrees - + 270 degrees 270 degrees - + Min brightness Min brightness - + (min:1) (min:1) - - - + + + Readback Readback - - - + + + Send Send - + Max brightness Max brightness - + (max:255) (max:255) @@ -2599,43 +2596,43 @@ - - - - - - - - - - - - - - + + + + + + + - - - - - - - + + + + + + + + + + + + + + Success Success - + Compant ID: Company ID - + FPGA Upgrade FPGA Upgrade - + Compant ID Company ID @@ -2655,27 +2652,27 @@ Are you sure you want to configure the server address and company ID? - - - - - - - - - - - - - + + + + + + - - - - - - - + + + + + + + + + + + + + + failed failed @@ -2686,42 +2683,42 @@ Set Web server address - + ClearRealtimeServer Clear - + InputRealTimeAddressTip Please enter the realtimer address - + SetRealtimeServer Set realtimer address - - - + + + Tip Info Tip Info - - - + + + Can not find LedSet3.0.exe,down you need download and install it Can not find LedSet3.0.exe,down you need download and install it - + RestartAndroid Restart - + FPGA Version FPGA Version @@ -2755,29 +2752,29 @@ Check apk running status - + apk package (*.rpd) - + CheckHardwareVersions Check FPGA version - - - + + + SynchronousHardwareVersion Sync FPGA version - + Check Screen untile fpga update finished Watch the progress of screen upgrade until the upgrade is finished - + OpenAdb Open ADB debugging function @@ -2796,13 +2793,13 @@ Binding certificate - + Json format is error! - - + + AliIotSetting @@ -2827,8 +2824,8 @@ - - + + UpgradeSoftware Upgrade firmware @@ -2884,12 +2881,16 @@ + + Setting Wallpaper - + + + Set Wallpaper @@ -2900,120 +2901,120 @@ - + System Update - + Setting Baud Rate - + Set Baud Rate - + Getting Baud Rate - + Get Baud Rate - + Hidden Settings - + Click right button to hide - + Baud Config - + Model - + Uart - + Baud - + Get - - - - + + + + SetScreenRotation Set screen rotation - + SetMinBrightness Set min brightness value - + SetMaxBrightness Set maximum brightness value - + GetMinBrightness Get min brightness - + GetMaxBrightness Get maximum brightness - + SetSpecialResolution Set Special Resolution - + GetSpecialResolution Get Special Resolution - + CleanDisplayScreenSize Restore to default relolution - + SetHighForBusy Set level for busy - + GetStateForBusy Get level of busy - + install start... Start installation... @@ -3041,7 +3042,7 @@ Clear program timeout! - + Uploadding Uploading @@ -3073,13 +3074,15 @@ - - - - - - - + + + + + + + + + Tip Tip @@ -3096,8 +3099,10 @@ - - + + + + NoSelectedController Please select screen first @@ -3112,14 +3117,14 @@ Please enter the correct height pixel value - + Password is error Password is error - - - + + + DeviceItem OnProHttpResponse 解析json文件错误! DeviceItem OnProHttpResponse json error! @@ -3415,12 +3420,23 @@ Def - - + + Connection Timeout + + + + + + + + + Device replied + + @@ -3440,7 +3456,7 @@ Tip Info - + Fail Fail @@ -5321,83 +5337,83 @@ MainWindow - + Language Language - + Help Help - - + + Check for updates Check for updates - - + + firmware manager Firmware management - - + + Software Configuration Software Configuration - - + + Info - - + + About About - - + + Setting Setting - + Device Termianls - + Program Solutions - + Control Terminal Control - + GuangYinPin Lora screen - + Check card Detect - + Tip Info Tip Info - + RestoreLedCardIpByUdpTip This operation will fix all the control cards in the LAN that are not in the same network segment as the computer IP. Please be careful! @@ -5609,17 +5625,17 @@ PlayWin - + Move to Top Left Move to Top Left - + Set Position - + Close Close diff --git a/LedOK/translations/app_ja.ts b/LedOK/translations/app_ja.ts index 2d723f4..3173fb0 100644 --- a/LedOK/translations/app_ja.ts +++ b/LedOK/translations/app_ja.ts @@ -753,43 +753,41 @@ - - - + + + - - - - - - - - + + + + + + + Success 成功 - - - + + + - - - - - - - - + + + + + + + failed 失敗 - - + + Tip 提示 @@ -879,285 +877,284 @@ エラー - SetSwitchWiFi - WiFiスイッチの設定 + WiFiスイッチの設定 - - - - - - + + + + + + SignalPower 信号強度 - - + + ConfigurationWiFi WiFiの設定 - + IsPortableHotSpot ホットスポットとWiFiモードの取得 - + GetWifiList スキャンWiFi - + ConfigurationHotSpot ホットスポットの設定 - + GetCurrentAPN APN情報の取得 - - + + GetSIMStatus SIM状態を取得 - + SetAPN APNの設定 - - + + DeviceItem OnProHttpResponse 解析json文件错误! - + 状态: 状態: - + 未知 不明 - + 锁定状态,需要用户的PIN码解锁 ロック状態は、ユーザのPINコードのロック解除が必要です - + 锁定状态,需要用户的PUK码解锁 ロック状態は、ユーザのPUKコードのアンロックが必要です - + 锁定状态,需要网络的PIN码解锁 ロック状態は、ユーザのPINコードのアンロックが必要です - + 就绪 準備完了 - + no checked sim card simカードが検出されませんでした - + 国家码: 国号: - + 号码: 番号: - + 用户: ユーザ: - + 信号: 信号: - + 信号正常 信号が正常である - + 不在服务区 サービスエリアにはいません - + 仅限紧急呼叫 緊急呼び出しのみ - + 射频已经关闭 無線周波数はすでに閉鎖されました - + 网络: ネットワークタイプ: - + 网络类型未知 不明 - + GPRS网络 GPRS - + EDGE网络 EDGE - + UMTS网络 UMTS - + CDMA网络,IS95A 或 IS95B. CDM - + EVDO网络, revision 0. EVDO,revision 0. - + EVDO网络, revision A. EVDO,revision A. - + 1xRTT网络 1xRTT - + HSDPA网络 HSDPA - + HSUPA网络 HSUPA - + HSPA网络 HSPA - + 漫游: ローミング: - + Yes - + No いいえ - + 数据连接状态: データ接続状態: - + 断开 切断 - + 正在连接 接続中 - + 已连接 接続済み - + 暂停 一時停止 - + 数据活动休眠状态: データアクティビティの休止状態: - + 活动,但无数据发送和接收 アクティブですが、データ送信と受信はありません - + 活动,正在接收数据 アクティブ、データ受信中 - + 活动,正在发送数据 イベント、データ送信中 - + 活动,正在接收和发送数据 イベント、データ受信と送信中 - + 休眠状态 スリープ状態 - + 信号强度: 信号の強度: - + SetSwitchSimData 4G/5Gスイッチの設定 - + ContrFlightMode 飛行モードの設定 - + GetFlightModeState 飛行モード状態を取得 @@ -2340,44 +2337,44 @@ CtrlAdvancedPanel - + Advanced parameters 上級パラメータ - + Screen Width(pixel) 画面幅(ピクセル) - + Width - - + + Height 高さ - - - - - - - + + + + + + + Set セット - + Alias 別名 - + Web Server Address: Webサーバのアドレス: @@ -2412,67 +2409,67 @@ - + Realtimer Server Address: Realtimerアドレス: - + Clear クリア - + Apk upgrade APKアップグレード - + Check Apk APKを検出 - + Uninstall アンマウント - + Running check 運転状態モニタ - + FPGA version check FPGAバージョンクエリ - + Sync FPGA version 同期FPGAバージョン - + Restart led controller system 再起動 - + Check Log ログを見る - + Start LedSet4 - + Open ADB ADBデバッグ機能を開く - + Post Custom JSON Post Custom JSON @@ -2483,7 +2480,7 @@ - + Clear Program 番組をクリア @@ -2493,101 +2490,101 @@ - + M80 configuration M 80の設定 - + Refresh 更新 - + Restore to default 標準の値を復元 - + Taxi top screen configuration タクシートップ画面の設定 - + Service:High Out of service:Low 客がいます:高 客がいません:低 - + Service:Low Out of service:High 客がいます:低 客がいません:高 - + Start LedSet3.0 configure LED module LedSet 3.0を使ってLEDモジュールを配置する(メーカーの専門家が使用する) - + Binding *.ic account indentity voucher テーピングtaxihubプラットフォームのユーザーID証明書 - + Rotate 回転 - + 0 degrees 0度 - + 90 degrees 90度 - + 180 degrees 180度 - + 270 degrees 270度 - + Min brightness 最低輝度 - + (min:1) (最小:1) - - - + + + Readback 読み戻し - - - + + + Send 送信 - + Max brightness 最高輝度 - + (max:255) (マックス:255) @@ -2599,43 +2596,43 @@ - - - - - - - - - - - - - - + + + + + + + - - - - - - - + + + + + + + + + + + + + + Success 成功 - + Compant ID: 会社ID: - + FPGA Upgrade FPGAアップグレード - + Compant ID 会社ID @@ -2655,27 +2652,27 @@ 設定サーバアドレスと会社IDを確認しますか? - - - - - - - - - - - - - + + + + + + - - - - - - - + + + + + + + + + + + + + + failed 失敗 @@ -2686,42 +2683,42 @@ ウェブサーバのアドレスを設定 - + ClearRealtimeServer クリア - + InputRealTimeAddressTip RealTimerアドレスを入力してください - + SetRealtimeServer RealTimerアドレスを設定 - - - + + + Tip Info ヒント - - - + + + Can not find LedSet3.0.exe,down you need download and install it LEDSET 3.0 . exeを見つけることができません。ダウンロードしてインストールする必要があります - + RestartAndroid 再起動 - + FPGA Version FPGAバージョン @@ -2755,29 +2752,29 @@ APK運転状態監視 - + apk package (*.rpd) - + CheckHardwareVersions お問い合わせFPGAバージョン - - - + + + SynchronousHardwareVersion ハードウェアバージョンの同期 - + Check Screen untile fpga update finished 画面のアップグレードの進捗を確認します - + OpenAdb ADBデバッグ機能を開く @@ -2796,13 +2793,13 @@ 証明書をバインド - + Json format is error! - - + + AliIotSetting @@ -2827,8 +2824,8 @@ バージョン - - + + UpgradeSoftware ファームウェアをアップグレードする @@ -2884,12 +2881,16 @@ + + Setting Wallpaper - + + + Set Wallpaper @@ -2900,120 +2901,120 @@ - + System Update - + Setting Baud Rate - + Set Baud Rate - + Getting Baud Rate - + Get Baud Rate - + Hidden Settings - + Click right button to hide - + Baud Config - + Model - + Uart - + Baud - + Get - - - - + + + + SetScreenRotation 画面の回転を設定する - + SetMinBrightness 最小輝度値を設定します - + SetMaxBrightness 輝度最大値を設定 - + GetMinBrightness 輝度最小値を取得 - + GetMaxBrightness 輝度最大値を取得 - + SetSpecialResolution 解像度を設定 - + GetSpecialResolution 読み込み解像度 - + CleanDisplayScreenSize デフォルトの解像度を復元 - + SetHighForBusy 客レベルの設定 - + GetStateForBusy ゲストレベルを取得 - + install start... インストールを開始します... @@ -3041,7 +3042,7 @@ 番組クリアタイムアウト - + Uploadding アップロード @@ -3073,13 +3074,15 @@ - - - - - - - + + + + + + + + + Tip 提示 @@ -3096,8 +3099,10 @@ - - + + + + NoSelectedController 先に大きいスクリーンを選んでください @@ -3112,14 +3117,14 @@ 正しい高さのピクセル値を入力してください - + Password is error パスワード - - - + + + DeviceItem OnProHttpResponse 解析json文件错误! jsonファイルの解析エラー! @@ -3407,12 +3412,23 @@ Def - - + + Connection Timeout 接続タイムアウト + + + + + + + + + Device replied + + @@ -3432,7 +3448,7 @@ ヒント - + Fail 失敗 @@ -5308,83 +5324,83 @@ MainWindow - + Language 言語 - + Help ヘルプ - - + + Check for updates アップデートをチェック - - + + firmware manager ファームウェア管理 - - + + Software Configuration ソフトウェアの設定 - - + + Info 情報 - - + + About 当ソフトウェアについて - - + + Setting 設置 - + Device 端末管理 - + Program コンテンツ管理 - + Control ターミナルコントロール - + GuangYinPin スクリーン - + Check card ワンタッチ修復 - + Tip Info ヒント - + RestoreLedCardIpByUdpTip この操作はLAN内のすべてのコンピュータIPと同じセグメントにないコントロールカードを固定IPに修正します。慎重に操作してください。 @@ -5596,17 +5612,17 @@ PlayWin - + Move to Top Left 左上隅に移動 - + Set Position 設定位置 - + Close 閉じる diff --git a/LedOK/translations/app_zh_CN.ts b/LedOK/translations/app_zh_CN.ts index 14150c6..eeb35f0 100644 --- a/LedOK/translations/app_zh_CN.ts +++ b/LedOK/translations/app_zh_CN.ts @@ -490,10 +490,6 @@ ControlNetConfigWidget - - Form - Form - Wire Enther(RJ45) Configuration @@ -753,43 +749,41 @@ - - - + + + - - - - - - - - + + + + + + + Success 成功 - - - + + + - - - - - - - - + + + + + + + failed 失败 - - + + Tip 提示 @@ -879,285 +873,280 @@ 错误 - - SetSwitchWiFi - 设置WiFi开关 - - - - - - - - + + + + + + SignalPower 信号强度 - - + + ConfigurationWiFi 配置WiFi - + IsPortableHotSpot 获取热点和WiFi模式 - + GetWifiList 扫描WiFi - + ConfigurationHotSpot 配置热点 - + GetCurrentAPN 获取APN信息 - - + + GetSIMStatus 获取SIM状态 - + SetAPN 设置APN - - + + DeviceItem OnProHttpResponse 解析json文件错误! - + 状态: 状态: - + 未知 未知 - + 锁定状态,需要用户的PIN码解锁 锁定状态,需要用户的PIN码解锁 - + 锁定状态,需要用户的PUK码解锁 锁定状态,需要用户的PUK码解锁 - + 锁定状态,需要网络的PIN码解锁 锁定状态,需要网络的PIN码解锁 - + 就绪 就绪 - + no checked sim card 检测不到sim卡 - + 国家码: 国家码: - + 号码: 号码: - + 用户: 用户: - + 信号: 信号: - + 信号正常 信号正常 - + 不在服务区 不在服务区 - + 仅限紧急呼叫 仅限紧急呼叫 - + 射频已经关闭 射频已经关闭 - + 网络: 网络: - + 网络类型未知 未知 - + GPRS网络 GPRS - + EDGE网络 EDGE - + UMTS网络 UMTS - + CDMA网络,IS95A 或 IS95B. CDM - + EVDO网络, revision 0. EVDO,revision 0. - + EVDO网络, revision A. EVDO,revision A. - + 1xRTT网络 1xRTT - + HSDPA网络 HSDPA - + HSUPA网络 HSUPA - + HSPA网络 HSPA - + 漫游: 漫游: - + Yes - + No - + 数据连接状态: 数据连接状态: - + 断开 断开 - + 正在连接 正在连接 - + 已连接 已连接 - + 暂停 暂停 - + 数据活动休眠状态: 数据活动休眠状态: - + 活动,但无数据发送和接收 活动,但无数据发送和接收 - + 活动,正在接收数据 活动,正在接收数据 - + 活动,正在发送数据 活动,正在发送数据 - + 活动,正在接收和发送数据 活动,正在接收和发送数据 - + 休眠状态 休眠状态 - + 信号强度: - + SetSwitchSimData 设置4G/5G开关 - + ContrFlightMode 配置飞行模式 - + GetFlightModeState 获取飞行模式状态 @@ -2340,44 +2329,44 @@ CtrlAdvancedPanel - + Advanced parameters 高级参数 - + Screen Width(pixel) 屏幕宽(像素) - + Width - - + + Height - - - - - - - + + + + + + + Set 设置 - + Alias 别名 - + Web Server Address: Web服务器地址: @@ -2412,67 +2401,67 @@ - + Realtimer Server Address: Realtimer地址: - + Clear 清除 - + Apk upgrade Apk升级 - + Check Apk 检查Apk - + Uninstall 卸载 - + Running check 运行状态监测 - + FPGA version check FPGA版本查询 - + Sync FPGA version 同步FPGA版本 - + Restart led controller system 重启 - + Check Log 查看日志 - + Start LedSet4 使用 LedSet4.0 配置LED模组(Apk Display2.0以上版本) - + Open ADB 打开ADB调试功能 - + Post Custom JSON Post Custom JSON @@ -2483,7 +2472,7 @@ - + Clear Program 清除节目 @@ -2493,101 +2482,101 @@ - + M80 configuration M80配置 - + Refresh 刷新 - + Restore to default 恢复默认值 - + Taxi top screen configuration 车顶有无客电平配置 - + Service:High Out of service:Low 有客:高电平 无客:低电平 - + Service:Low Out of service:High 有客:低电平 无客:高电平 - + Start LedSet3.0 configure LED module 使用LedSet3.0配置LED模组(厂家专业人员使用) - + Binding *.ic account indentity voucher 绑定taxihub平台用户身份凭证 - + Rotate 旋转 - + 0 degrees 0度 - + 90 degrees 90度 - + 180 degrees 180度 - + 270 degrees 270度 - + Min brightness 最低亮度 - + (min:1) (最小:1) - - - + + + Readback 回读 - - - + + + Send 发送 - + Max brightness 最高亮度 - + (max:255) (最高:255) @@ -2599,43 +2588,43 @@ - - - - - - - - - - - - - - + + + + + + + - - - - - - - + + + + + + + + + + + + + + Success 成功 - + Compant ID: 公司ID: - + FPGA Upgrade FPGA升级 - + Compant ID 公司ID @@ -2655,27 +2644,27 @@ 是否确认配置服务器地址和公司ID? - - - - - - - - - - - - - + + + + + + - - - - - - - + + + + + + + + + + + + + + failed 失败 @@ -2686,42 +2675,42 @@ 设置web服务器地址 - + ClearRealtimeServer 清除 - + InputRealTimeAddressTip 请输入RealTimer地址 - + SetRealtimeServer 设置RealTimer地址 - - - + + + Tip Info 提示 - - - + + + Can not find LedSet3.0.exe,down you need download and install it 找不到LedSet3.0.exe,确认下载并安装 - + RestartAndroid 重启 - + FPGA Version FPGA版本 @@ -2755,29 +2744,29 @@ 监测APK运行状态 - + apk package (*.rpd) - + CheckHardwareVersions 查询FPGA版本 - - - + + + SynchronousHardwareVersion 同步FPGA硬件版本 - + Check Screen untile fpga update finished 观察屏幕升级进度直到升级成功 - + OpenAdb 打开ADB调试功能 @@ -2796,13 +2785,13 @@ 绑定证书 - + Json format is error! - - + + AliIotSetting @@ -2827,8 +2816,8 @@ 版本 - - + + UpgradeSoftware 升级固件 @@ -2884,12 +2873,16 @@ + + Setting Wallpaper 正在设置系统桌面背景 - + + + Set Wallpaper 设置系统桌面背景 @@ -2900,120 +2893,120 @@ - + System Update 系统升级 - + Setting Baud Rate 正在设置波特率 - + Set Baud Rate 设置波特率 - + Getting Baud Rate 正在获取波特率 - + Get Baud Rate 获取波特率 - + Hidden Settings 隐藏的设置 - + Click right button to hide 点击右键隐藏 - + Baud Config 波特率配置 - + Model 设备型号 - + Uart 串口节点 - + Baud 波特率 - + Get 获取 - - - - + + + + SetScreenRotation 设置屏幕旋转 - + SetMinBrightness 设置最小的亮度值 - + SetMaxBrightness 设置亮度最大值 - + GetMinBrightness 获取亮度最小值 - + GetMaxBrightness 获取亮度最大值 - + SetSpecialResolution 设置分辨率 - + GetSpecialResolution 读取分辨率 - + CleanDisplayScreenSize 恢复默认分辨率 - + SetHighForBusy 设置有无客电平 - + GetStateForBusy 获取有无客电平 - + install start... 开始安装... @@ -3029,7 +3022,7 @@ 设置别名 - + Uploadding 上传 @@ -3061,13 +3054,15 @@ - - - - - - - + + + + + + + + + Tip 提示 @@ -3084,8 +3079,10 @@ - - + + + + NoSelectedController 请先选择大屏幕 @@ -3100,14 +3097,14 @@ 请输入正确的高度像素值 - + Password is error 密码错误 - - - + + + DeviceItem OnProHttpResponse 解析json文件错误! 解析json文件错误! @@ -3395,12 +3392,23 @@ Def - - + + Connection Timeout 连接超时 + + + + + + + + + Device replied + 设备回复 + @@ -3420,7 +3428,7 @@ 提示 - + Fail 失败 @@ -3664,14 +3672,6 @@ Status 状态 - - DHCP IP - 动态DHCP IP - - - STATIC IP - 静态IP - Tip Info @@ -5297,83 +5297,83 @@ MainWindow - + Language 语言 - + Help 帮助 - - + + Check for updates 检查更新 - - + + firmware manager 固件管理 - - + + Software Configuration 软件配置 - - + + Info 信息 - - + + About 关于 - - + + Setting 设置 - + Device 设备管理 - + Program 节目管理 - + Control 终端控制 - + GuangYinPin 光影屏 - + Check card 一键找卡 - + Tip Info 提示 - + RestoreLedCardIpByUdpTip 该操作会把局域网内的所有与计算机IP不在同一网段的控制卡修复成固定IP,请谨慎操作! @@ -5585,17 +5585,17 @@ PlayWin - + Move to Top Left 移动到左上角 - + Set Position 设置位置 - + Close 关闭 diff --git a/LedOK/translations/app_zh_TW.ts b/LedOK/translations/app_zh_TW.ts index b04bc2b..9212b47 100644 --- a/LedOK/translations/app_zh_TW.ts +++ b/LedOK/translations/app_zh_TW.ts @@ -490,10 +490,6 @@ ControlNetConfigWidget - - Form - Form - Wire Enther(RJ45) Configuration @@ -753,43 +749,41 @@ - - - + + + - - - - - - - - + + + + + + + Success 成功 - - - + + + - - - - - - - - + + + + + + + failed 失敗 - - + + Tip 提示 @@ -879,285 +873,280 @@ 錯誤 - - SetSwitchWiFi - 設定WiFi開關 - - - - - - - - + + + + + + SignalPower 信號強度 - - + + ConfigurationWiFi 配寘WiFi - + IsPortableHotSpot 獲取熱點和WiFi模式 - + GetWifiList 掃描WiFi - + ConfigurationHotSpot 配寘熱點 - + GetCurrentAPN 獲取APN資訊 - - + + GetSIMStatus 獲取SIM狀態 - + SetAPN 設定APN - - + + DeviceItem OnProHttpResponse 解析json文件错误! DeviceItem OnProHttpResponse 解析json檔案錯誤! - + 状态: 狀態: - + 未知 未知 - + 锁定状态,需要用户的PIN码解锁 鎖定狀態,需要用戶的PIN碼解鎖 - + 锁定状态,需要用户的PUK码解锁 鎖定狀態,需要用戶的PUK碼解鎖 - + 锁定状态,需要网络的PIN码解锁 鎖定狀態,需要網絡的PIN碼解鎖 - + 就绪 就緒 - + no checked sim card 檢測不到sim卡 - + 国家码: 國家碼: - + 号码: 號碼: - + 用户: 用戶: - + 信号: 信号: - + 信号正常 訊號正常 - + 不在服务区 不在服務區 - + 仅限紧急呼叫 僅限緊急呼叫 - + 射频已经关闭 射頻已經關閉 - + 网络: 網絡: - + 网络类型未知 未知 - + GPRS网络 GPRS - + EDGE网络 EDGE - + UMTS网络 UMTS - + CDMA网络,IS95A 或 IS95B. CDM - + EVDO网络, revision 0. EVDO,revision 0. - + EVDO网络, revision A. EVDO,revision A. - + 1xRTT网络 1xRTT - + HSDPA网络 HSDPA - + HSUPA网络 HSUPA - + HSPA网络 HSPA - + 漫游: 漫遊: - + Yes - + No - + 数据连接状态: 數據連接狀態: - + 断开 斷開 - + 正在连接 正在連接 - + 已连接 已連接 - + 暂停 暫停 - + 数据活动休眠状态: 數據活動休眠狀態: - + 活动,但无数据发送和接收 活動,但無數據發送和接收 - + 活动,正在接收数据 活動,正在接收數據 - + 活动,正在发送数据 活動,正在發送數據 - + 活动,正在接收和发送数据 活動,正在接收和發送數據 - + 休眠状态 休眠狀態 - + 信号强度: 信號強度: - + SetSwitchSimData 設定4G/5G開關 - + ContrFlightMode 配寘飛行模式 - + GetFlightModeState 獲取飛行模式狀態 @@ -2345,44 +2334,44 @@ CtrlAdvancedPanel - + Advanced parameters 高級參數 - + Screen Width(pixel) 荧幕寬(點數) - + Width - - + + Height - - - - - - - + + + + + + + Set 設定 - + Alias 別名 - + Web Server Address: Web伺服器地址: @@ -2417,67 +2406,67 @@ - + Realtimer Server Address: Realtimer地址: - + Clear 清除 - + Apk upgrade Apk陞級 - + Check Apk 檢查Apk - + Uninstall 卸載 - + Running check 運行狀態監測 - + FPGA version check FPGA版本査詢 - + Sync FPGA version 同步FPGA版本 - + Restart led controller system 重啓 - + Check Log 查看日誌 - + Start LedSet4 - + Open ADB 打開ADB調試功能 - + Post Custom JSON Post Custom JSON @@ -2488,7 +2477,7 @@ - + Clear Program 清除節目 @@ -2498,101 +2487,101 @@ - + M80 configuration M80配寘 - + Refresh 檢測 - + Restore to default 恢復預設值 - + Taxi top screen configuration 車頂有無客電平配寘 - + Service:High Out of service:Low 有客:高電平無客:低電平 - + Service:Low Out of service:High 有客:低電平 無客:高電平 - + Start LedSet3.0 configure LED module 使用LedSet3.0配寘LED模組(廠家專業人員使用) - + Binding *.ic account indentity voucher 綁定taxihub平臺用戶身份憑證 - + Rotate 旋轉 - + 0 degrees 0度 - + 90 degrees 90度 - + 180 degrees 10度 - + 270 degrees 270度 - + Min brightness 最低亮度 - + (min:1) (最小:1) - - - + + + Readback 回讀 - - - + + + Send 發送 - + Max brightness 最高亮度 - + (max:255) (最高:255) @@ -2604,43 +2593,43 @@ - - - - - - - - - - - - - - + + + + + + + - - - - - - - + + + + + + + + + + + + + + Success 成功 - + Compant ID: 公司ID: - + FPGA Upgrade FPGA陞級 - + Compant ID 公司ID @@ -2657,8 +2646,10 @@ - - + + + + NoSelectedController 請先選擇大螢幕 @@ -2678,27 +2669,27 @@ 是否確認配寘伺服器地址和公司ID? - - - - - - - - - - - - - + + + + + + - - - - - - - + + + + + + + + + + + + + + failed 失敗 @@ -2709,42 +2700,42 @@ 設定web伺服器地址 - + ClearRealtimeServer 清除 - + InputRealTimeAddressTip 請輸入RealTimer地址 - + SetRealtimeServer 設定RealTimer地址 - - - + + + Tip Info 提示 - - - + + + Can not find LedSet3.0.exe,down you need download and install it 找不到LedSet3.0.exe,確認下載並安裝 - + RestartAndroid 重啓 - + FPGA Version FPGA版本 @@ -2778,29 +2769,29 @@ 監測APK運行狀態 - + apk package (*.rpd) - + CheckHardwareVersions 査詢FPGA版本 - - - + + + SynchronousHardwareVersion 同步FPGA硬體版本 - + Check Screen untile fpga update finished 觀察荧幕陞級進度直到陞級成功 - + OpenAdb 打開ADB調試功能 @@ -2819,13 +2810,13 @@ 綁定證書 - + Json format is error! - - + + AliIotSetting @@ -2850,8 +2841,8 @@ 版本 - - + + UpgradeSoftware 陞級固件 @@ -2907,12 +2898,16 @@ + + Setting Wallpaper 正在設定系統桌面背景 - + + + Set Wallpaper 設定系統桌面背景 @@ -2923,127 +2918,127 @@ - + System Update 系統升級 - + Setting Baud Rate 正在設定串列傳輸速率 - + Set Baud Rate 設定串列傳輸速率 - + Getting Baud Rate 正在讀取串列傳輸速率 - + Get Baud Rate 讀取串列傳輸速率 - + Hidden Settings 隱藏的設定 - + Click right button to hide 點擊右鍵隱藏 - + Baud Config 串列傳輸速率配寘 - + Model 設備型號 - + Uart 串口節點 - + Baud 串列傳輸速率 - + Get 讀取 - - - + + + DeviceItem OnProHttpResponse 解析json文件错误! DeviceItem OnProHttpResponse 解析json檔案錯誤! - - - - + + + + SetScreenRotation 設定荧幕旋轉 - + SetMinBrightness 設定最小的亮度值 - + SetMaxBrightness 設定亮度最大值 - + GetMinBrightness 獲取亮度最小值 - + GetMaxBrightness 獲取亮度最大值 - + SetSpecialResolution 設定分辯率 - + GetSpecialResolution 讀取分辯率 - + CleanDisplayScreenSize 恢復默認分辯率 - + SetHighForBusy 設定有無客電平 - + GetStateForBusy 獲取有無客電平 - + install start... 開始安裝… @@ -3059,7 +3054,7 @@ 設定別名 - + Uploadding 上傳 @@ -3091,13 +3086,15 @@ - - - - - - - + + + + + + + + + Tip 提示 @@ -3112,7 +3109,7 @@ 請輸入正確的高度點數值 - + Password is error 密碼錯誤 @@ -3405,12 +3402,23 @@ Def - - + + Connection Timeout 連接超時 + + + + + + + + + Device replied + 設備回復 + @@ -3430,7 +3438,7 @@ 提示 - + Fail 失敗 @@ -3674,14 +3682,6 @@ Status 狀態 - - DHCP IP - 動態DHCP IP - - - STATIC IP - 靜態IP - Tip Info @@ -5305,83 +5305,83 @@ MainWindow - + Language 語言 - + Help 幫助 - - + + Check for updates 檢查更新 - - + + firmware manager 固件管理 - - + + Software Configuration 軟件配寘 - - + + Info 資訊 - - + + About 關於 - - + + Setting 設定 - + Device 設備管理 - + Program 節目管理 - + Control 終端控制 - + GuangYinPin 光影屏 - + Check card 一键找卡 - + Tip Info 提示 - + RestoreLedCardIpByUdpTip 該操作會把局域網內的所有與電腦IP不在同一網段的控制卡修復成固定IP,請謹慎操作! @@ -5593,17 +5593,17 @@ PlayWin - + Move to Top Left 移動到左上角 - + Set Position 設定位置 - + Close 關閉 diff --git a/LedOK/wDevicesManager/controlnetconfigwidget.cpp b/LedOK/wDevicesManager/controlnetconfigwidget.cpp index 5067992..7630987 100644 --- a/LedOK/wDevicesManager/controlnetconfigwidget.cpp +++ b/LedOK/wDevicesManager/controlnetconfigwidget.cpp @@ -896,16 +896,6 @@ void ControlNetConfigWidget::onReadbackAllThisPage() HttpPostByTypeJsonObject(pHpptClientAll,m_strUrl,json6); MACRO_DEFINE_TIPDLG_ALL_FUCN(tr("Readback"),tr("Success"),tr("failed")) } - -void ControlNetConfigWidget::OnWiFiOpenChanged(bool b) -{ - CHECK_CARD_SELECTED - QJsonObject json; - json.insert("_id", getRandomString(10)); - json.insert("_type", "SetSwitchWiFi"); - json.insert("enable", b); - MACRO_DEFINE_TIPDLG_FUCN(tr("SetSwitchWiFi"),tr("Success"),tr("failed")) -} void ControlNetConfigWidget::onSetWiFiModel() { CHECK_CARD_SELECTED @@ -933,8 +923,6 @@ void ControlNetConfigWidget::onSetWiFiModel() json1.insert("_type", "SetSwitchWiFi"); json1.insert("enable", true); HttpPostByTypeJsonObject(pHpptClient,m_strUrl,json1); -// MACRO_DEFINE_TIPDLG_FUCN(tr("SetSwitchWiFi"),tr("Success"),tr("failed")) - QJsonObject json; json.insert("_id", getRandomString(10)); json.insert("_type", "ConfigurationWiFi"); diff --git a/LedOK/wDevicesManager/controlnetconfigwidget.h b/LedOK/wDevicesManager/controlnetconfigwidget.h index d835f2a..f703226 100644 --- a/LedOK/wDevicesManager/controlnetconfigwidget.h +++ b/LedOK/wDevicesManager/controlnetconfigwidget.h @@ -46,7 +46,6 @@ protected slots: void onReadbackWiFiModel(); void onSetAp(); void OnDhcpOrSpecifyIp(int iIndex); - void OnWiFiOpenChanged(bool b); void OnScanWifi(); void onSet4GInfo(); void onReadback4G(); diff --git a/LedOK/wDevicesManager/ctrladvancedpanel.cpp b/LedOK/wDevicesManager/ctrladvancedpanel.cpp index d3c26de..6d657db 100644 --- a/LedOK/wDevicesManager/ctrladvancedpanel.cpp +++ b/LedOK/wDevicesManager/ctrladvancedpanel.cpp @@ -6,6 +6,7 @@ #include "LoUIClass/updateledset3dialog.h" #include "passwordindlg.h" #include "tools.h" +#include "wProgramManager/ephoto.h" #include "upgradeapkdialog.h" #include "base/table.h" #include @@ -23,6 +24,7 @@ #include #include #include +#include "tcpsocket.h" CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent,QList *list) : QWidget(parent), m_pLedlist(list) { m_pLedlist = gSelCards; @@ -398,7 +400,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent,QList *list) : Q timer->setSingleShot(true); connect(timer, &QTimer::timeout, tcp, [tcp] { tcp->close(); - QMessageBox::critical(gMainWin, tr("Tip"), tr("Timeout")); + QMessageBox::critical(gMainWin, tr("Tip"), tr("Clear Program")+" "+tr("Timeout")); }); connect(tcp, &QTcpSocket::disconnected, timer, &QTimer::stop); connect(tcp, &QTcpSocket::disconnected, tcp, &QTcpSocket::deleteLater); @@ -424,7 +426,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent,QList *list) : Q connect(tcp, &QTcpSocket::errorOccurred, tcp, [tcp, waitingDlg](QAbstractSocket::SocketError err) { tcp->close(); waitingDlg->close(); - QMessageBox::critical(gMainWin, tr("Tip"), QString::number(err)+" - "+QMetaEnum::fromType().valueToKey(err)+": "+tcp->errorString()); + QMessageBox::critical(gMainWin, tr("Tip"), QString("1 (2) 3").arg(QMetaEnum::fromType().valueToKey(err)).arg(err).arg(tcp->errorString())); }); tcp->connectToHost(card->m_strCardIp, 3333); timer->start(10000); @@ -455,7 +457,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent,QList *list) : Q }); connect(tcp, &QTcpSocket::errorOccurred, tcp, [tcp, card](QAbstractSocket::SocketError err) { tcp->close(); - gFdResInfo->append(card->m_strCardId+" "+tr("Clear Program")+" "+QString::number(err)+" - "+QMetaEnum::fromType().valueToKey(err)+": "+tcp->errorString()); + gFdResInfo->append(card->m_strCardId+" "+tr("Clear Program")+" "+QMetaEnum::fromType().valueToKey(err)+" ("+QString::number(err)+") "+tcp->errorString()); }); tcp->connectToHost(card->m_strCardIp, 3333); timer->start(10000); @@ -792,6 +794,225 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent,QList *list) : Q }); hBox->addWidget(btnSysUpd); + btnPlayerBackSet = new QPushButton; + btnPlayerBackSet->setProperty("ssType", "progManageTool"); + connect(btnPlayerBackSet, &QPushButton::clicked, this, [this] { + if(gSelCards->isEmpty()) { + QMessageBox::information(gMainWin, tr("Tip"), tr("NoSelectedController")); + return; + } + QString file = QFileDialog::getOpenFileName(gMainWin, tr("Select File"), gFileHome, EPhoto::filters()); + if(file.isEmpty()) return; + QFileInfo info(file); + if(! info.isFile()) return; + auto waitingDlg = new WaitingDlg(this, tr("Clearing player background")+" ..."); + waitingDlg->show(); + auto card = gSelCards->at(0); + auto err = new QString; + auto thread = QThread::create([card, file, err] { + TcpSocket tcp; + tcp.connectToHost(card->m_strCardIp, 3333); + if(! tcp.waitForConnected()) { + err->append(QString::number(tcp.error())+" "+QMetaEnum::fromType().valueToKey(tcp.error())+" when waitForConnected"); + tcp.close(); + return; + } + //4.发送协商列表应答里的文件 + long long sentBytes = 0; + QFileInfo info(file); + auto baseName = info.baseName(); + auto remain = info.size(); + auto req = QJsonObject(); + req.insert("_type", "imgFileStart"); + req.insert("id", baseName); + req.insert("size", remain); + auto resNum = tcp.write(QJsonDocument(req).toJson(QJsonDocument::Compact)); + if(resNum == -1 || ! tcp.waitForBytesWritten()) { + err->append(QString::number(tcp.error())+" "+QMetaEnum::fromType().valueToKey(tcp.error())+" when write 'fileStart'"); + tcp.close(); + return; + } + auto file = new QFile(info.filePath()); + if(! file->open(QFile::ReadOnly)) { + err->append(tr("open file failed")+" "+file->errorString()); + tcp.close(); + return; + } + while(remain > 0) { + auto readed = file->read(qMin(4096LL, remain)); + if(readed.isEmpty()) { + err->append(tr("Read file failed")+" "+file->errorString()); + tcp.close(); + file->close(); + return; + } + resNum = tcp.write(readed); + if(resNum == -1) { + err->append(QString::number(tcp.error())+" "+QMetaEnum::fromType().valueToKey(tcp.error())+" when write file: "+file->fileName()); + tcp.close(); + file->close(); + return; + } + if(! tcp.waitForBytesWritten()) { + err->append(QString::number(tcp.error())+" "+QMetaEnum::fromType().valueToKey(tcp.error())+" when waitForWritten file: "+file->fileName()); + tcp.close(); + file->close(); + return; + } + remain -= resNum; + sentBytes += resNum; + } + file->close(); + req = QJsonObject(); + req.insert("_type", "fileEnd"); + req.insert("id", baseName); + req.insert("zVer", "xixun1"); + resNum = tcp.write(QJsonDocument(req).toJson(QJsonDocument::Compact)); + if(resNum == -1 || ! tcp.waitForBytesWritten()) { + emit emErr(QString::number(tcp.error())+" "+QMetaEnum::fromType().valueToKey(tcp.error())+" when write 'fileEnd'"); + tcp.close(); + return; + } + + //5.发送结束 + req = QJsonObject(); + req.insert("_type", "proEnd"); + req.insert("proName", "program"); + req.insert("zVer","xixun1"); + resNum = tcp.write(QJsonDocument(req).toJson(QJsonDocument::Compact)); + if(resNum == -1 || ! tcp.waitForBytesWritten()) { + emit emErr(QString::number(tcp.error())+" "+QMetaEnum::fromType().valueToKey(tcp.error())+" when write 'proEnd'"); + tcp.close(); + return; + }; + if(! tcp.waitForReadyRead()) { + emit emErr(QString::number(tcp.error())+" "+QMetaEnum::fromType().valueToKey(tcp.error())+" when waitForRead 'proEnd'"); + tcp.close(); + return; + } + auto resp = tcp.readAll(); + if(resp.isEmpty()) { + emit emErr(QString::number(tcp.error())+" "+QMetaEnum::fromType().valueToKey(tcp.error())+" when read 'proEnd'"); + tcp.close(); + return; + } + tcp.close(); + emit emErr("OK"); + }); + connect(thread, &QThread::finished, this, [thread] { + thread->deleteLater(); + + }); + + + QColorDialog colorDlg(this); + colorDlg.setOption(QColorDialog::DontUseNativeDialog); + + if(colorDlg.exec() != QColorDialog::Accepted) return; + QColor color = colorDlg.selectedColor(); + if(! color.isValid()) return; + QJsonObject json; + json.insert("_id", "SetWallpaper"); + json.insert("_type", "SetWallpaper"); + json.insert("rgb", color.name()); + if(gSelCards->count() == 1) { + auto waitingDlg = new WaitingDlg(this, tr("Setting Wallpaper")+" ..."); + Def_CtrlReqPre + connect(reply, &QNetworkReply::finished, this, [reply, waitingDlg] { + Def_CtrlSetReqAfter + }); + } else { + foreach(auto card, *gSelCards) { + Def_CtrlSetMulti(tr("Set Wallpaper")) + } + } + }); + hBox->addWidget(btnPlayerBackSet); + + hBox->addSpacing(20); + + btnPlayerBackClear = new QPushButton; + btnPlayerBackClear->setProperty("ssType", "progManageTool"); + connect(btnPlayerBackClear, &QPushButton::clicked, this, [this] { + if(gSelCards->isEmpty()) { + QMessageBox::information(gMainWin, tr("Tip"), tr("NoSelectedController")); + return; + } + if(gSelCards->count() == 1) { + auto waitingDlg = new WaitingDlg(this, tr("Clearing player background")+" ..."); + waitingDlg->show(); + auto card = gSelCards->at(0); + auto tcp = new QTcpSocket(); + auto timer = new QTimer(tcp); + timer->setSingleShot(true); + connect(timer, &QTimer::timeout, tcp, [tcp] { + tcp->close(); + QMessageBox::critical(gMainWin, tr("Tip"), tr("Clear player background")+" "+tr("Timeout")); + }); + connect(tcp, &QTcpSocket::disconnected, timer, &QTimer::stop); + connect(tcp, &QTcpSocket::disconnected, tcp, &QTcpSocket::deleteLater); + connect(tcp, &QTcpSocket::connected, tcp, [tcp, timer] { + timer->stop(); + tcp->write("{\"_type\":\"DelBackImg\",\"_id\":\"DelBackImg\"}"); + timer->start(10000); + }); + connect(tcp, &QTcpSocket::readyRead, tcp, [tcp, waitingDlg] { + QByteArray resp = tcp->readAll(); + tcp->close(); + QJsonParseError parseErr; + QJsonDocument json = QJsonDocument::fromJson(resp, &parseErr); + if(parseErr.error != QJsonParseError::NoError) { + waitingDlg->close(); + QMessageBox::critical(gMainWin, tr("Tip"), parseErr.errorString()); + } + else if(! json["success"].toBool()) { + waitingDlg->close(); + QMessageBox::critical(gMainWin, tr("Tip"), tr("Clear player background")+" "+tr("Failed")); + } else waitingDlg->success(); + }); + connect(tcp, &QTcpSocket::errorOccurred, tcp, [tcp, waitingDlg](QAbstractSocket::SocketError err) { + tcp->close(); + waitingDlg->close(); + QMessageBox::critical(gMainWin, tr("Tip"), QString("1 (2) 3").arg(QMetaEnum::fromType().valueToKey(err)).arg(err).arg(tcp->errorString())); + }); + tcp->connectToHost(card->m_strCardIp, 3333); + timer->start(10000); + } else { + foreach(auto card, *gSelCards) { + auto tcp = new QTcpSocket(); + auto timer = new QTimer(tcp); + timer->setSingleShot(true); + connect(timer, &QTimer::timeout, tcp, [tcp, card] { + tcp->close(); + gFdResInfo->append(card->m_strCardId+" "+tr("Clear player background")+" "+tr("Timeout")); + }); + connect(tcp, &QTcpSocket::disconnected, timer, &QTimer::stop); + connect(tcp, &QTcpSocket::disconnected, tcp, &QTcpSocket::deleteLater); + connect(tcp, &QTcpSocket::connected, tcp, [tcp, timer] { + timer->stop(); + tcp->write("{\"_type\":\"DelBackImg\",\"_id\":\"DelBackImg\"}"); + timer->start(10000); + }); + connect(tcp, &QTcpSocket::readyRead, tcp, [tcp, card] { + QByteArray resp = tcp->readAll(); + tcp->close(); + QJsonParseError parseErr; + QJsonDocument json = QJsonDocument::fromJson(resp, &parseErr); + if(parseErr.error != QJsonParseError::NoError) gFdResInfo->append(card->m_strCardId+" "+tr("Clear player background")+" "+parseErr.errorString()); + else if(! json["success"].toBool()) gFdResInfo->append(card->m_strCardId+" "+tr("Clear player background")+" "+tr("Failed")); + else gFdResInfo->append(card->m_strCardId+" "+tr("Clear player background")+" "+tr("Success")); + }); + connect(tcp, &QTcpSocket::errorOccurred, tcp, [tcp, card](QAbstractSocket::SocketError err) { + tcp->close(); + gFdResInfo->append(card->m_strCardId+" "+tr("Clear player background")+" "+QMetaEnum::fromType().valueToKey(err)+" ("+QString::number(err)+") "+tcp->errorString()); + }); + tcp->connectToHost(card->m_strCardIp, 3333); + timer->start(10000); + } + } + }); + hBox->addWidget(btnPlayerBackClear); + hBox->addStretch(); vBox->addLayout(hBox); diff --git a/LedOK/wDevicesManager/ctrladvancedpanel.h b/LedOK/wDevicesManager/ctrladvancedpanel.h index f00d178..5a92ea9 100644 --- a/LedOK/wDevicesManager/ctrladvancedpanel.h +++ b/LedOK/wDevicesManager/ctrladvancedpanel.h @@ -12,12 +12,6 @@ #include #include -class cApkInfo{ -public: - QString strApkPageName; - QString strVersion; -}; - class CtrlAdvancedPanel : public QWidget { Q_OBJECT public: @@ -75,7 +69,6 @@ private: LoEmptyDialog * m_PostingDlg=nullptr; QTimer *m_pGetAskTimer=nullptr; bool m_passwordOk=false; - QList m_listApk; QString m_strUpgradeApkFile=""; QString m_strUpgradeFpgaFile=""; QJsonObject mM80Map; @@ -111,7 +104,7 @@ private: QPushButton *pushButtonRestart; QPushButton *btnClearProg; QPushButton *btnGetLog; - QPushButton *btnSetBack; + QPushButton *btnSetBack, *btnPlayerBackSet, *btnPlayerBackClear; QGroupBox *groupM80; QComboBox *fdM80; @@ -143,7 +136,6 @@ private: QLabel *label_5; QPushButton *pushButtonReadbackMaxBrightess; QPushButton *pushButtonSendMaxBrightness; - QFrame *line_2; QGroupBox *grpBoxHiddenSettings; QPushButton *btnSysUpd; diff --git a/LedOK/wProgramManager/eaudio.cpp b/LedOK/wProgramManager/eaudio.cpp index 487ac7d..48e05a3 100644 --- a/LedOK/wProgramManager/eaudio.cpp +++ b/LedOK/wProgramManager/eaudio.cpp @@ -141,7 +141,7 @@ QWidget* EAudio::attrWgt() { mDuration = value; }); connect(bnSelectFile, &QPushButton::clicked, this, [this, fdFileName, fdDuration] { - auto file = QFileDialog::getOpenFileName(gMainWin, tr("Select File"), fileHome, EAudio::filters()); + auto file = QFileDialog::getOpenFileName(gMainWin, tr("Select File"), gFileHome, EAudio::filters()); if(file.isEmpty()) return; int64_t dur; QString err = Tools::audioInfo(file.toUtf8(), &dur); @@ -151,7 +151,7 @@ QWidget* EAudio::attrWgt() { } QFileInfo info(file); mDir = info.absolutePath(); - fileHome = mDir; + gFileHome = mDir; mName = info.fileName(); fdFileName->setText(mName); fdDuration->setValue(dur/1000000); diff --git a/LedOK/wProgramManager/egif.cpp b/LedOK/wProgramManager/egif.cpp index ae3613f..72400e5 100644 --- a/LedOK/wProgramManager/egif.cpp +++ b/LedOK/wProgramManager/egif.cpp @@ -117,7 +117,7 @@ QWidget* EGif::attrWgt() { bnSelectFile->setFixedWidth(30); bnSelectFile->setObjectName("bnSelectFile"); connect(bnSelectFile, &QPushButton::clicked, this, [this, wFile] { - auto file = QFileDialog::getOpenFileName(gMainWin, tr("Select File"), fileHome, EGif::filters()); + auto file = QFileDialog::getOpenFileName(gMainWin, tr("Select File"), gFileHome, EGif::filters()); if(file.isEmpty()) return; auto movie = new QMovie(file); if(! movie->isValid()) { @@ -130,7 +130,7 @@ QWidget* EGif::attrWgt() { mName = fileInfo.fileName(); wFile->setText(mName); mDir = fileInfo.absolutePath(); - fileHome = mDir; + gFileHome = mDir; if(mMovie!=nullptr) delete mMovie; mMovie = movie; }); diff --git a/LedOK/wProgramManager/emultiwin.cpp b/LedOK/wProgramManager/emultiwin.cpp index baafbdc..581d074 100644 --- a/LedOK/wProgramManager/emultiwin.cpp +++ b/LedOK/wProgramManager/emultiwin.cpp @@ -140,7 +140,7 @@ QWidget* EMultiWin::attrWgt() { EBase *ele = nullptr; QListWidgetItem *item = nullptr; if(type==EBase::Photo) { - auto files = QFileDialog::getOpenFileNames(gMainWin, tr("Select File"), fileHome, EPhoto::filters()); + auto files = QFileDialog::getOpenFileNames(gMainWin, tr("Select File"), gFileHome, EPhoto::filters()); for(int i=0; iaddItem(item); if(i==files.count()-1) { listWgt->setCurrentItem(item); - fileHome = ePhoto->mDir; + gFileHome = ePhoto->mDir; } } } else if(type==EBase::Gif) { - auto files = QFileDialog::getOpenFileNames(gMainWin, tr("Select File"), fileHome, EGif::filters()); + auto files = QFileDialog::getOpenFileNames(gMainWin, tr("Select File"), gFileHome, EGif::filters()); for(int i=0; iaddItem(item); if(i == files.count()-1) { listWgt->setCurrentItem(item); - fileHome = eGif->mDir; + gFileHome = eGif->mDir; } } } else if(type==EBase::Video) { - auto file = QFileDialog::getOpenFileName(gMainWin, tr("Select File"), fileHome, EVideo::filters()); + auto file = QFileDialog::getOpenFileName(gMainWin, tr("Select File"), gFileHome, EVideo::filters()); if(! file.isEmpty()) { auto eVideo = EVideo::create(file, mPageItem, this); if(eVideo==nullptr) return; item = new QListWidgetItem(QIcon(":/res/ProgramManager/EditProgram/Movie.png"), tr("Video")+" "+eVideo->mRawName); - fileHome = eVideo->mRawDir; + gFileHome = eVideo->mRawDir; ele = eVideo; } } else if(type==EBase::Text) { diff --git a/LedOK/wProgramManager/ephoto.cpp b/LedOK/wProgramManager/ephoto.cpp index 9b762b8..1790162 100644 --- a/LedOK/wProgramManager/ephoto.cpp +++ b/LedOK/wProgramManager/ephoto.cpp @@ -122,9 +122,9 @@ QWidget* EPhoto::attrWgt() { bnSelectFile->setFixedWidth(30); bnSelectFile->setObjectName("bnSelectFile"); connect(bnSelectFile, &QPushButton::clicked, this, [this, fdFile] { - QString home = mDir.startsWith(gProgDir) ? fileHome : mDir; + QString home = mDir.startsWith(gProgDir) ? gFileHome : mDir; QString file = QFileDialog::getOpenFileName(gMainWin, tr("Select File"), home, EPhoto::filters()); - if(file.isNull()) return; + if(file.isEmpty()) return; QImageReader reader(file); QImage aimg = reader.read(); if(aimg.isNull()) { @@ -134,7 +134,7 @@ QWidget* EPhoto::attrWgt() { img = aimg; QFileInfo info(file); mDir = info.absolutePath(); - fileHome = mDir; + gFileHome = mDir; mName = info.fileName(); scaleImgIfNeed(); fdFile->setText(mName); diff --git a/LedOK/wProgramManager/etext.cpp b/LedOK/wProgramManager/etext.cpp index 77c294b..25b47f7 100644 --- a/LedOK/wProgramManager/etext.cpp +++ b/LedOK/wProgramManager/etext.cpp @@ -370,7 +370,7 @@ QWidget* EText::attrWgt() { auto btnImport = new QPushButton(tr("Import txt File")); btnImport->setProperty("ssType", "progManageTool"); connect(btnImport, &QPushButton::clicked, fdText, [fdText] { - auto filePath = QFileDialog::getOpenFileName(gMainWin, tr("Select File"), fileHome, "Txt(*.txt)"); + auto filePath = QFileDialog::getOpenFileName(gMainWin, tr("Select File"), gFileHome, "Txt(*.txt)"); if(filePath.isEmpty()) return; QFile file(filePath); if(! file.open(QFile::ReadOnly)) { diff --git a/LedOK/wProgramManager/evideo.cpp b/LedOK/wProgramManager/evideo.cpp index 86f6edf..e63ed66 100644 --- a/LedOK/wProgramManager/evideo.cpp +++ b/LedOK/wProgramManager/evideo.cpp @@ -167,7 +167,7 @@ QWidget* EVideo::attrWgt() { playDuration = value; }); connect(bnSelectFile, &QPushButton::clicked, this, [this, fdFileName, fdDuration] { - auto rawFile = QFileDialog::getOpenFileName(gMainWin, tr("Select File"), fileHome, EVideo::filters()); + auto rawFile = QFileDialog::getOpenFileName(gMainWin, tr("Select File"), gFileHome, EVideo::filters()); if(rawFile.isEmpty()) return; QFileInfo rawInfo(rawFile); int64_t dur; @@ -179,7 +179,7 @@ QWidget* EVideo::attrWgt() { }; mRawDir = rawInfo.absolutePath(); mRawName = rawInfo.fileName(); - fileHome = mRawDir; + gFileHome = mRawDir; fdFileName->setText(mRawName); playDuration = dur/1000000; fdDuration->setValue(playDuration); diff --git a/LedOK/wProgramManager/pagelistitem.cpp b/LedOK/wProgramManager/pagelistitem.cpp index e7b1e54..9eb1080 100644 --- a/LedOK/wProgramManager/pagelistitem.cpp +++ b/LedOK/wProgramManager/pagelistitem.cpp @@ -266,7 +266,7 @@ QPushButton[ssName="weeklySelector"]:checked { mAudiosList = new QListWidget(); connect(btnAdd, &QPushButton::clicked, this, [this, fdTtlDur] { - auto files = QFileDialog::getOpenFileNames(gMainWin, tr("Select File"), fileHome, EAudio::filters()); + auto files = QFileDialog::getOpenFileNames(gMainWin, tr("Select File"), gFileHome, EAudio::filters()); int durs = fdTtlDur->text().toInt(); for(int i=0; iaddItem(item); if(i == files.count()-1) { mAudiosList->setCurrentItem(item); - fileHome = fInfo.absolutePath(); + gFileHome = fInfo.absolutePath(); } durs += info.dur; mAudiosList->addItem(item); diff --git a/LedOK/wProgramManager/progeditorwin.cpp b/LedOK/wProgramManager/progeditorwin.cpp index 86b4e4f..bc7c26a 100644 --- a/LedOK/wProgramManager/progeditorwin.cpp +++ b/LedOK/wProgramManager/progeditorwin.cpp @@ -238,7 +238,7 @@ ProgEditorWin::ProgEditorWin(QString &name, int &w, int &h, QString &remarks, co if(mNewEleY+iNewHeight>gProgHeight) mNewEleY=0; auto type = data.toInt(); if(type==EBase::Photo) { - auto files = QFileDialog::getOpenFileNames(this, tr("Select File"), fileHome, EPhoto::filters()); + auto files = QFileDialog::getOpenFileNames(this, tr("Select File"), gFileHome, EPhoto::filters()); for(int i=0; i(list.at(0))->setSelected(false); } ePhoto->setSelected(true); - fileHome = ePhoto->mDir; + gFileHome = ePhoto->mDir; } } } else if(type==EBase::Gif) { - auto files = QFileDialog::getOpenFileNames(this, tr("Select File"), fileHome, EGif::filters()); + auto files = QFileDialog::getOpenFileNames(this, tr("Select File"), gFileHome, EGif::filters()); for(int i=0; i(list.at(0))->setSelected(false); } eGif->setSelected(true); - fileHome = eGif->mDir; + gFileHome = eGif->mDir; } } } else if(type==EBase::Video) { - auto file = QFileDialog::getOpenFileName(this, tr("Select File"), fileHome, EVideo::filters()); + auto file = QFileDialog::getOpenFileName(this, tr("Select File"), gFileHome, EVideo::filters()); if(file.isEmpty()) return; auto eVideo = EVideo::create(file, mPageItem); if(eVideo==nullptr) return; auto rect = Tools::centerRect(eVideo->mCoverImg.width(), eVideo->mCoverImg.height(), gProgWidth, gProgHeight); eVideo->setPos(rect.topLeft()); eVideo->setSize(rect.width(), rect.height()); - fileHome = eVideo->mRawDir; + gFileHome = eVideo->mRawDir; element = eVideo; } else if(type== EBase::Audio) { - auto file = QFileDialog::getOpenFileName(this, tr("Select File"), fileHome, EAudio::filters()); + auto file = QFileDialog::getOpenFileName(this, tr("Select File"), gFileHome, EAudio::filters()); if(file.isEmpty()) return; auto eAudio = EAudio::create(file, mPageItem); if(eAudio==nullptr) return; @@ -297,7 +297,7 @@ ProgEditorWin::ProgEditorWin(QString &name, int &w, int &h, QString &remarks, co for(; iitemAt(i+20, gProgHeight+20, QTransform())) break; eAudio->setPos(i, gProgHeight); eAudio->setSize(50, 50); - fileHome = eAudio->mDir; + gFileHome = eAudio->mDir; element = eAudio; } else if(type==EBase::Text) { diff --git a/ledset/expertwin.cpp b/ledset/expertwin.cpp index 2d0cc59..0cbd29f 100644 --- a/ledset/expertwin.cpp +++ b/ledset/expertwin.cpp @@ -9,7 +9,9 @@ #include #include #include +#include #include +#include QColor colors[] {QColor(0xdd0000), QColor(0xdd6600), QColor(0x008800), QColor(0x008888), QColor(0x0000ff), QColor(0x777777), QColor(0xaaaaaa)}; @@ -131,12 +133,12 @@ QTabBar::tab:selected {margin-top: 0; border-bottom: none; color: #acf; backgrou auto receivePanel = new QWidget; tab->addTab(receivePanel, "接收卡"); { - auto vBox = new QVBoxLayout(receivePanel); + auto vBox = new VBox(receivePanel); auto gBox = new QGroupBox("模组信息"); vBox->addWidget(gBox); - auto hhh = new QHBoxLayout(gBox); - auto vvv = new VBox(hhh); + auto hh = new HBox(gBox); + auto vvv = new VBox(hh); auto lb = new QLabel("驱动芯片: "); vvv->addWidget(lb); @@ -144,7 +146,7 @@ QTabBar::tab:selected {margin-top: 0; border-bottom: none; color: #acf; backgrou lb = new QLabel("译码方式: "); vvv->addWidget(lb); - vvv = new VBox(hhh); + vvv = new VBox(hh); lb = new QLabel("驱动芯片"); vvv->addWidget(lb); @@ -152,8 +154,8 @@ QTabBar::tab:selected {margin-top: 0; border-bottom: none; color: #acf; backgrou lb = new QLabel("译码方式"); vvv->addWidget(lb); - hhh->addSpacing(20); - vvv = new VBox(hhh); + hh->addSpacing(20); + vvv = new VBox(hh); lb = new QLabel("模组宽度: "); vvv->addWidget(lb); @@ -161,7 +163,7 @@ QTabBar::tab:selected {margin-top: 0; border-bottom: none; color: #acf; backgrou lb = new QLabel("模组高度: "); vvv->addWidget(lb); - vvv = new VBox(hhh); + vvv = new VBox(hh); lb = new QLabel("模组宽度"); vvv->addWidget(lb); @@ -169,8 +171,8 @@ QTabBar::tab:selected {margin-top: 0; border-bottom: none; color: #acf; backgrou lb = new QLabel("模组高度"); vvv->addWidget(lb); - hhh->addSpacing(20); - vvv = new VBox(hhh); + hh->addSpacing(20); + vvv = new VBox(hh); lb = new QLabel("扫描数: "); vvv->addWidget(lb); @@ -178,7 +180,7 @@ QTabBar::tab:selected {margin-top: 0; border-bottom: none; color: #acf; backgrou lb = new QLabel("数据数组: "); vvv->addWidget(lb); - vvv = new VBox(hhh); + vvv = new VBox(hh); lb = new QLabel("扫描数"); vvv->addWidget(lb); @@ -186,8 +188,8 @@ QTabBar::tab:selected {margin-top: 0; border-bottom: none; color: #acf; backgrou lb = new QLabel("数据数组"); vvv->addWidget(lb); - hhh->addSpacing(20); - vvv = new VBox(hhh); + hh->addSpacing(20); + vvv = new VBox(hh); lb = new QLabel("数据线颜色: "); vvv->addWidget(lb); @@ -195,13 +197,13 @@ QTabBar::tab:selected {margin-top: 0; border-bottom: none; color: #acf; backgrou lb = new QLabel("模组抽行设置"); vvv->addWidget(lb); - vvv = new VBox(hhh); + vvv = new VBox(hh); lb = new QLabel("数据线颜色"); vvv->addWidget(lb); - hhh->addStretch(); - vvv = new VBox(hhh); + hh->addStretch(); + vvv = new VBox(hh); auto btn = new QPushButton("模组选择"); vvv->addWidget(btn); @@ -217,15 +219,90 @@ QTabBar::tab:selected {margin-top: 0; border-bottom: none; color: #acf; backgrou gBox = new QGroupBox("单卡带载"); vBox->addWidget(gBox); - auto tab = new QTabWidget; - tab->setTabPosition(QTabWidget::West); - vBox->addWidget(tab); + hh = new HBox(gBox); + vvv = new VBox(hh); + + vvv->addWidget(new QRadioButton("常规设计")); + vvv->addWidget(new QRadioButton("高级设计")); + + hh->addSpacing(20); + + auto line = new QFrame; + line->setFrameShadow(QFrame::Sunken); + line->setFrameShape(QFrame::VLine); + hh->addWidget(line); + + auto stack = new QStackedWidget; + auto poli = stack->sizePolicy(); + poli.setVerticalPolicy(QSizePolicy::Maximum); + stack->setSizePolicy(poli); + hh->addWidget(stack); auto normalPanel = new QWidget; - tab->addTab(normalPanel, "常规设计"); + stack->addWidget(normalPanel); + { + auto hh = new HBox(normalPanel); + auto vvv = new VBox(hh); - auto advancedPanel = new QWidget; - tab->addTab(advancedPanel, "高级设计"); + lb = new QLabel("宽度"); + vvv->addWidget(lb); + + lb = new QLabel("高度"); + vvv->addWidget(lb); + + vvv = new VBox(hh); + + auto fdCardWidth = new QSpinBox; + fdCardWidth->setRange(0, 99999); + vvv->addWidget(fdCardWidth); + + auto fdCardHeight = new QSpinBox; + fdCardHeight->setRange(0, 99999); + vvv->addWidget(fdCardHeight); + + vvv = new VBox(hh); + + lb = new QLabel("多开宽度"); + vvv->addWidget(lb); + + lb = new QLabel("级联方向"); + vvv->addWidget(lb); + + vvv = new VBox(hh); + + auto fdMulti = new QComboBox(); + fdMulti->addItem("无"); + fdMulti->addItem("双开"); + fdMulti->addItem("三开"); + fdMulti->addItem("四开"); + vvv->addWidget(fdMulti); + + auto fdDirection = new QComboBox(); + fdDirection->addItem("从左到右"); + fdDirection->addItem("从右到左"); + fdDirection->addItem("从上到下"); + fdDirection->addItem("从下到上"); + vvv->addWidget(fdDirection); + + vvv = new VBox(hh); + + lb = new QLabel("插头顺序"); + vvv->addWidget(lb); + vvv->addStretch(); + + vvv = new VBox(hh); + + auto fdSord = new QComboBox(); + fdSord->addItem("正序"); + fdSord->addItem("逆序"); + vvv->addWidget(fdSord); + + vvv->addStretch(); + + hh->addStretch(); + } + auto advacnedPanel = new QWidget; + stack->addWidget(advacnedPanel); vBox->addStretch(); }