diff --git a/LedOK/LedOK.pro b/LedOK/LedOK.pro index edbf6d4..4a5337a 100644 --- a/LedOK/LedOK.pro +++ b/LedOK/LedOK.pro @@ -57,11 +57,6 @@ SOURCES += \ base/loemptydialog.cpp \ base/softconfigdialog.cpp \ base/switchcontrol.cpp \ - base/taesclass.cpp \ - base/x_checkboxdelegate.cpp \ - base/x_spinboxdelegate.cpp \ - base/x_timeeditdelegate.cpp \ - base/x_uimsgboxok.cpp \ base/extendedgroupbox.cpp \ base/ffutil.cpp \ base/locolorselector.cpp \ @@ -72,11 +67,12 @@ SOURCES += \ basedlg.cpp \ basewin.cpp \ cfg.cpp \ - communication/hpptclient.cpp \ - communication/taserialthread.cpp \ device/ctrlhdmipanel.cpp \ device/ctrlnetworkpanel.cpp \ + device/ctrlpowerpanel.cpp \ device/ctrlpwdpanel.cpp \ + device/ctrltestpanel.cpp \ + device/ctrlvolumepanel.cpp \ devicectrlpanel.cpp \ deviceitem.cpp \ devicepanel.cpp \ @@ -103,15 +99,9 @@ SOURCES += \ progpanel.cpp \ synctimer.cpp \ tools.cpp \ - device/controlpowerschedule.cpp \ - device/controlpowerwidget.cpp \ - device/controltestwidget.cpp \ - device/controlvolumeschedule.cpp \ - device/controlvolumewidget.cpp \ device/ctrladvancedpanel.cpp \ device/ctrlbrightpanel.cpp \ device/ctrlverifyclockpanel.cpp \ - device/ledcard.cpp \ device/upgradeapkdialog.cpp \ device/wupgradeapkitem.cpp \ program/copydirthread.cpp \ @@ -145,11 +135,6 @@ HEADERS += \ base/loemptydialog.h \ base/softconfigdialog.h \ base/switchcontrol.h \ - base/taesclass.h \ - base/x_checkboxdelegate.h \ - base/x_spinboxdelegate.h \ - base/x_timeeditdelegate.h \ - base/x_uimsgboxok.h \ base/extendedgroupbox.h \ base/locolorselector.h \ base/lodateselector.h \ @@ -159,11 +144,12 @@ HEADERS += \ basedlg.h \ basewin.h \ cfg.h \ - communication/hpptclient.h \ - communication/taserialthread.h \ device/ctrlhdmipanel.h \ device/ctrlnetworkpanel.h \ + device/ctrlpowerpanel.h \ device/ctrlpwdpanel.h \ + device/ctrltestpanel.h \ + device/ctrlvolumepanel.h \ devicectrlpanel.h \ deviceitem.h \ devicepanel.h \ @@ -189,15 +175,9 @@ HEADERS += \ progpanel.h \ synctimer.h \ tools.h \ - device/controlpowerschedule.h \ - device/controlpowerwidget.h \ - device/controltestwidget.h \ - device/controlvolumeschedule.h \ - device/controlvolumewidget.h \ device/ctrladvancedpanel.h \ device/ctrlbrightpanel.h \ device/ctrlverifyclockpanel.h \ - device/ledcard.h \ device/upgradeapkdialog.h \ device/wupgradeapkitem.h \ program/copydirthread.h \ @@ -226,11 +206,6 @@ HEADERS += \ program/wprogrampublishitem.h \ FORMS += \ - base/x_uimsgboxok.ui \ - mguangyingpinwidget.ui \ - device/controlpowerschedule.ui \ - device/controltestwidget.ui \ - device/controlvolumeschedule.ui \ TRANSLATIONS += \ translations/app_zh_CN.ts \ diff --git a/LedOK/base/changepasswordform.cpp b/LedOK/base/changepasswordform.cpp index 0771f11..8ca83ad 100644 --- a/LedOK/base/changepasswordform.cpp +++ b/LedOK/base/changepasswordform.cpp @@ -5,9 +5,13 @@ #include #include #include +#include -ChangePasswordForm::ChangePasswordForm(QWidget *parent) : BaseDlg(parent) { +ChangePasswordForm::ChangePasswordForm(QWidget *parent) : QDialog(parent) { resize(240, 160); +#ifdef Q_OS_WIN + setWindowFlag(Qt::WindowContextHelpButtonHint, 0); +#endif auto vBox = new QVBoxLayout(this); auto hBox = new QHBoxLayout(); auto label = new QLabel(tr("Old password")); @@ -39,11 +43,9 @@ ChangePasswordForm::ChangePasswordForm(QWidget *parent) : BaseDlg(parent) { hBox->addWidget(fdAgn); vBox->addLayout(hBox); - hBox = new QHBoxLayout(); - auto pushButton_2 = new QPushButton(tr("OK")); - pushButton_2->setProperty("ssType", "progManageTool"); - hBox->addWidget(pushButton_2); - connect(pushButton_2, &QPushButton::clicked, this, [this]() { + auto btnBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); + connect(btnBox, &QDialogButtonBox::rejected, this, &QDialog::reject); + connect(btnBox, &QDialogButtonBox::accepted, this, [=] { QString pwdOld = fdOld->text(); if(pwdOld.isEmpty()) { QMessageBox::warning(this, tr("Tip"), tr("Please input old password")); @@ -74,10 +76,5 @@ ChangePasswordForm::ChangePasswordForm(QWidget *parent) : BaseDlg(parent) { QMessageBox::information(this, tr("Tip"), tr("Password changed successfully")); accept(); }); - - auto pushButton = new QPushButton(tr("Cancel")); - pushButton->setProperty("ssType", "progManageTool"); - hBox->addWidget(pushButton); - connect(pushButton, &QPushButton::clicked, this, &ChangePasswordForm::reject); - vBox->addLayout(hBox); + vBox->addWidget(btnBox); } diff --git a/LedOK/base/changepasswordform.h b/LedOK/base/changepasswordform.h index f1301f9..16f1d9a 100644 --- a/LedOK/base/changepasswordform.h +++ b/LedOK/base/changepasswordform.h @@ -1,10 +1,10 @@ #ifndef CHANGEPASSWORDFORM_H #define CHANGEPASSWORDFORM_H -#include "basedlg.h" +#include "QDialog.h" #include -class ChangePasswordForm : public BaseDlg { +class ChangePasswordForm : public QDialog { Q_OBJECT public: diff --git a/LedOK/base/loqtreewidget.cpp b/LedOK/base/loqtreewidget.cpp index 611d63e..3132eb1 100644 --- a/LedOK/base/loqtreewidget.cpp +++ b/LedOK/base/loqtreewidget.cpp @@ -25,6 +25,7 @@ LoQTreeWidget::LoQTreeWidget(QWidget *parent) : QTreeWidget(parent), m_checkStat setProperty("ssType", "topList"); connect(fdIsSelAll, SIGNAL(toggled(bool)), this, SLOT(onCheckAll(bool))); connect(this, &LoQTreeWidget::itemClicked, this, [this](QTreeWidgetItem *item, int column) { + if(selectionMode()==QAbstractItemView::NoSelection) return; if(column > 0) item->setCheckState(0, item->checkState(0) == Qt::Unchecked ? Qt::Checked : Qt::Unchecked); adjustCheckState(); }); diff --git a/LedOK/base/switchcontrol.cpp b/LedOK/base/switchcontrol.cpp index 78cffd2..25e3bfc 100644 --- a/LedOK/base/switchcontrol.cpp +++ b/LedOK/base/switchcontrol.cpp @@ -3,10 +3,8 @@ #include #include "qevent.h" #include "qtimer.h" -#include "qdebug.h" -SwitchControl::SwitchControl(QWidget *parent): QWidget(parent) -{ +SwitchControl::SwitchControl(QWidget *parent): QWidget(parent) { checked = false; buttonStyle = ButtonStyle_Rect; diff --git a/LedOK/base/taesclass.cpp b/LedOK/base/taesclass.cpp deleted file mode 100644 index 74e385e..0000000 --- a/LedOK/base/taesclass.cpp +++ /dev/null @@ -1,472 +0,0 @@ -#include "taesclass.h" - -Aes::~Aes() -{ - -} -Aes::Aes() -{ - -} -//////////////////////////////////////////////////////////////////////////////////////////////// -//构造函数 -Aes::Aes(int keysize,unsigned char* keyBytes) -{ - SetNbNkNr(keysize); //设置密钥块数,轮数 - memcpy(key,keyBytes,keysize); //字符串拷贝函数,把keyBytes的keysize个字符复制到key中 - KeyExpansion(); //密钥扩展,必须提前做的初始化 -} -//////////////////////////////////////////////////////////////////////////////////////////////// -void Aes::SetNbNkNr(int keySize) -{ - Nb=4; - if(keySize==Bits128) - { - Nk=4; //4*4字节,128位密钥,10轮加密 - Nr=10; - } - else if(keySize==Bits192) - { - Nk=6; //6*4字节,192位密钥,12轮加密 - Nr=12; - } - else if(keySize==Bits256) - { - Nk=8; //8*4字节,256位密钥,14轮加密 - Nr=14; - } -} -//////////////////////////////////////////////////////////////////////////////////////////////// -void Aes::KeyExpansion() -{ - - memset(w,0,16*15); - for(int row=0;row 6 && (row % Nk == 4) ) //这个还没有搞清楚 - { - temp = SubWord(temp); - } - - // w[row] = w[row-Nk] xor temp - w[4*row+0] = (byte) ( (int) w[4*(row-Nk)+0] ^ (int)temp[0] ); - w[4*row+1] = (byte) ( (int) w[4*(row-Nk)+1] ^ (int)temp[1] ); - w[4*row+2] = (byte) ( (int) w[4*(row-Nk)+2] ^ (int)temp[2] ); - w[4*row+3] = (byte) ( (int) w[4*(row-Nk)+3] ^ (int)temp[3] ); - } // for loop - -} -//////////////////////////////////////////////////////////////////////////////////////////////// -//密钥移位函数 -unsigned char* Aes::RotWord(unsigned char* word) -{ - byte* temp = new byte[4]; - temp[0] = word[1]; - temp[1] = word[2]; - temp[2] = word[3]; - temp[3] = word[0]; - return temp; -} -//////////////////////////////////////////////////////////////////////////////////////////////// -//密钥字代换函数 -unsigned char* Aes::SubWord(unsigned char* word) -{ - byte* temp = new byte[4]; - for(int j=0;j<4;j++) - { - temp[j] = AesSbox[16*(word[j] >> 4)+(word[j] & 0x0f)]; //实际上也可以写成AesSbox[[j]];因为两者相等 - } - return temp; - -} -//////////////////////////////////////////////////////////////////////////////////////////////// -//Aes加密函数 -void Aes::Cipher(unsigned char* input, unsigned char* output) -{ - memset(&State[0][0],0,16); - for(int i=0;i<4*Nb;i++) //这里是先写列后写行的,即输入是一列一列的进来的 - { - State[i%4][i/4]=input[i]; //换成先写行后写列也是可以的,只要在输出时也是这样就可以了 - } - AddRoundKey(0); //轮密钥加 - - for (int round = 1; round <= (Nr - 1); round++) // main round loop - { - SubBytes(); //字节代换 - ShiftRows(); //行移位 - MixColumns(); //列混淆 - AddRoundKey(round); //轮密钥加 - } // main round loop - - SubBytes(); //字节代换 - ShiftRows(); //行移位 - AddRoundKey(Nr); //轮密钥加 - - // output = state - for (int i = 0; i < (4 * Nb); i++) - { - output[i] = State[i % 4][ i / 4]; - } - -} -//////////////////////////////////////////////////////////////////////////////////////////////// -//Aes解密函数 -void Aes::InvCipher(unsigned char* input,unsigned char* output) -{ - memset(&State[0][0],0,16); - for (int i = 0; i < (4 * Nb); i++) - { - State[i % 4][ i / 4] = input[i]; - } - - AddRoundKey(Nr); - - for (int round = Nr-1; round >= 1; round--) // main round loop - { - InvShiftRows(); - InvSubBytes(); - AddRoundKey(round); - InvMixColumns(); - } // end main round loop for InvCipher - - InvShiftRows(); - InvSubBytes(); - AddRoundKey(0); - - // output = state - for (int i = 0; i < (4 * Nb); i++) - { - output[i] = State[i % 4][ i / 4]; - } -} -//////////////////////////////////////////////////////////////////////////////////////////////// -//轮密钥加 -void Aes::AddRoundKey(int round) -{ - int i,j; //i行 j列 //因为密钥w是一列一列排列的,即 k0 k4 k8 k12 - for(j=0;j<4;j++) // k1 k5 k9 k13 - { // k2 k6 k10k14 - for(i=0;i<4;i++) // k3 k7 k11k15 - { // 所以i行j列的下标是4*((round*4)+j)+i即16*round+4*j+i - State[i][j]=(unsigned char)((int)State[i][j]^(int)w[4*((round*4)+j)+i]); - } - } -} -//////////////////////////////////////////////////////////////////////////////////////////////// -//字节代换函数 -void Aes::SubBytes() //Page 103 -{ - int i,j; - for(j=0;j<4;j++) - { - for(i=0;i<4;i++) - { - State[i][j]=AesSbox[State[i][j]]; - //因为 16*(State[i][j]>>4)+State[i][j]&0x0f=State[i][j] - - - } - } -} - -void Aes::InvSubBytes() -{ - int i,j; - for(j=0;j<4;j++) - { - for(i=0;i<4;i++) - { - State[i][j]=AesiSbox[State[i][j]]; //因为 16*(State[i][j]>>4)+State[i][j]&0x0f=State[i][j] - } - } - -} -//////////////////////////////////////////////////////////////////////////////////////////////// -void Aes::ShiftRows() -{ - unsigned char temp[4*4]; //Page105 - int i,j; - for(j=0;j<4;j++) - { - for(i=0;i<4;i++) - { - temp[4*i+j]=State[i][j]; - } - } - for(i=1;i<4;i++) - { - for(j=0;j<4;j++) - { - if(i==1)State[i][j]=temp[4*i+(j+1)%4]; //第一行左移1位 - else if(i==2)State[i][j]=temp[4*i+(j+2)%4]; //第二行左移2位 - else if(i==3)State[i][j]=temp[4*i+(j+3)%4]; //第三行左移3位 - } - } - -} -void Aes::InvShiftRows() -{ - unsigned char temp[4*4]; - int i,j; - for(j=0;j<4;j++) - { - for(i=0;i<4;i++) - { - temp[4*i+j]=State[i][j]; - } - } - for(i=1;i<4;i++) - { - for(j=0;j<4;j++) - { - //if(i==1)State[i][j]=temp[4*i+(j-1)%4]; 在此犯了一个错误 -1%4=-1 而不是3,所以采用了下面再加一个4的做法 - if(i==1)State[i][j]=temp[4*i+(j+3)%4]; //第一行右移1位 j-1+4=j+3 - else if(i==2)State[i][j]=temp[4*i+(j+2)%4]; //第二行右移2位 j-2+4=j+2 - else if(i==3)State[i][j]=temp[4*i+(j+1)%4]; //第三行右移3位 j-3+4=j+2 - } - } - -} -//////////////////////////////////////////////////////////////////////////////////////////////// -void Aes::MixColumns() -{ - unsigned char temp[4*4]; - int i,j; - for(j=0;j<4;j++) //2 3 1 1 列混淆矩阵 Page107 - { //1 2 3 1 - for(i=0;i<4;i++) //1 1 2 3 - { //3 1 1 2 - temp[4*i+j]=State[i][j]; - } - } - for(j=0;j<4;j++) - { - State[0][j] = (unsigned char) ( (int)gfmultby02(temp[0+j]) ^ (int)gfmultby03(temp[4*1+j]) ^ - (int)gfmultby01(temp[4*2+j]) ^ (int)gfmultby01(temp[4*3+j]) ); - State[1][j] = (unsigned char) ( (int)gfmultby01(temp[0+j]) ^ (int)gfmultby02(temp[4*1+j]) ^ - (int)gfmultby03(temp[4*2+j]) ^ (int)gfmultby01(temp[4*3+j]) ); - State[2][j] = (unsigned char) ( (int)gfmultby01(temp[0+j]) ^ (int)gfmultby01(temp[4*1+j]) ^ - (int)gfmultby02(temp[4*2+j]) ^ (int)gfmultby03(temp[4*3+j]) ); - State[3][j] = (unsigned char) ( (int)gfmultby03(temp[0+j]) ^ (int)gfmultby01(temp[4*1+j]) ^ - (int)gfmultby01(temp[4*2+j]) ^ (int)gfmultby02(temp[4*3+j]) ); - } - -} -void Aes::InvMixColumns() -{ - unsigned char temp[4*4]; - int i,j; - for (i = 0; i < 4; i++) // copy State into temp[] - { - for (j = 0; j < 4; j++) //0e 0b 0d 09 逆变换矩阵 Page108 - { //09 0e 0b 0d - temp[4*i+j] = State[i][j]; //0d 09 0e 0b - } //0b 0d 09 0e - } - - for (j = 0; j < 4; j++) - { - State[0][j] = (unsigned char) ( (int)gfmultby0e(temp[j]) ^ (int)gfmultby0b(temp[4+j]) ^ - (int)gfmultby0d(temp[4*2+j]) ^ (int)gfmultby09(temp[4*3+j]) ); - State[1][j] = (unsigned char) ( (int)gfmultby09(temp[j]) ^ (int)gfmultby0e(temp[4+j]) ^ - (int)gfmultby0b(temp[4*2+j]) ^ (int)gfmultby0d(temp[4*3+j]) ); - State[2][j] = (unsigned char) ( (int)gfmultby0d(temp[j]) ^ (int)gfmultby09(temp[4+j]) ^ - (int)gfmultby0e(temp[4*2+j]) ^ (int)gfmultby0b(temp[4*3+j]) ); - State[3][j] = (unsigned char) ( (int)gfmultby0b(temp[j]) ^ (int)gfmultby0d(temp[4+j]) ^ - (int)gfmultby09(temp[4*2+j]) ^ (int)gfmultby0e(temp[4*3+j]) ); - } -} -//////////////////////////////////////////////////////////////////////////////////////////////// -unsigned char Aes::gfmultby01(unsigned char b) -{ - return b; -} -unsigned char Aes::gfmultby02(unsigned char b) -{ - if (b < 0x80) - return (unsigned char)(int)(b <<1); - else - return (unsigned char)( (int)(b << 1) ^ (int)(0x1b) ); -} - -unsigned char Aes::gfmultby03(unsigned char b) -{ - return (unsigned char) ( (int)gfmultby02(b) ^ (int)b ); -} - -unsigned char Aes::gfmultby09(unsigned char b) -{ - return (unsigned char)( (int)gfmultby02(gfmultby02(gfmultby02(b))) ^ (int)b ); -} - -unsigned char Aes::gfmultby0b(unsigned char b) -{ - return (unsigned char)( (int)gfmultby02(gfmultby02(gfmultby02(b))) ^ - (int)gfmultby02(b) ^ (int)b ); -} - -unsigned char Aes::gfmultby0d(unsigned char b) -{ - return (unsigned char)( (int)gfmultby02(gfmultby02(gfmultby02(b))) ^ - (int)gfmultby02(gfmultby02(b)) ^ (int)(b) ); -} - -unsigned char Aes::gfmultby0e(unsigned char b) -{ - return (unsigned char)( (int)gfmultby02(gfmultby02(gfmultby02(b))) ^ - (int)gfmultby02(gfmultby02(b)) ^(int)gfmultby02(b) ); -} - -TAesClass::TAesClass() -{ - m_lpAes=NULL; - InitializePrivateKey(16,(unsigned char*)"\x79\x76\x68\x6B\x77\x66\x6E\x68\x72\x65\x73\x63\x6C\x6B\x70\x6E"); -} - -TAesClass::~TAesClass() -{ - if (m_lpAes!=NULL) - { - delete m_lpAes; - } -} -//------------------------------------------------------------------------------------------------------------ -// 编写人员:wfnhddd -// -// 函数名称:InitializeAes -// -// 函数描述:初始化AES 密钥,密钥用于加密解密 -// -// 调用参数:详细说明参考 MSDN 中的相关描述或相关的开发文档 -// -// 返回数值:无 -// -// 最近修改:2009 年 08 月 07 日 -//------------------------------------------------------------------------------------------------------------ - - -VOID TAesClass::InitializePrivateKey(DWORD KeySize,UCHAR *KeyBytes) -{ - if (m_lpAes) - { - delete m_lpAes; - m_lpAes=NULL; - } - m_lpAes=new Aes(KeySize,KeyBytes); - -} - -//------------------------------------------------------------------------------------------------------------ -// 编写人员:wfnhddd -// -// 函数名称:OnAesEncrypt -// -// 函数描述:用AES加密算法加密数据 -// -// 调用参数:详细说明参考 MSDN 中的相关描述或相关的开发文档 -// -// 返回数值:加密后的数据大小 ,错误返回值 0 -// -// 最近修改:2009 年 08 月 07 日 -//------------------------------------------------------------------------------------------------------------ - -DWORD TAesClass::OnAesEncrypt(LPVOID InBuffer,DWORD InLength,LPVOID OutBuffer) -{ - DWORD OutLength=0; - if (m_lpAes==NULL||OutBuffer==NULL) - { - return 0; - } - - UCHAR *lpCurInBuff=(UCHAR *)InBuffer; - UCHAR *lpCurOutBuff=(UCHAR *)OutBuffer; - long blocknum=InLength/16; - long leftnum=InLength%16; - for(long i=0;iCipher(lpCurInBuff,lpCurOutBuff); - lpCurInBuff+=16; - lpCurOutBuff+=16; - OutLength+=16; - } - if(leftnum) //多余出leftnum 字节 则加密时 多出16-leftnum 个字节 - { - UCHAR inbuff[16]; - memset(inbuff,0,16); - memcpy(inbuff,lpCurInBuff,leftnum); - m_lpAes->Cipher(inbuff,lpCurOutBuff); - lpCurOutBuff+=16; - OutLength+=16; - } - //新增16个字节,用以确定增加的字节数 - UCHAR extrabuff[16]; - memset(extrabuff,0,16); - *((LPDWORD)extrabuff)=16+(16-leftnum)%16; //多出16+(16-leftnum)%16个字节 - m_lpAes->Cipher(extrabuff,lpCurOutBuff); - OutLength+=16; - return OutLength; - -} - - -//------------------------------------------------------------------------------------------------------------ -// 编写人员:wfnhddd -// -// 函数名称:OnAesUncrypt -// -// 函数描述:用AES加密算法解密数据 -// -// 调用参数:详细说明参考 MSDN 中的相关描述或相关的开发文档 -// -// 返回数值:解密后的数据大小 ,错误返回值 0 -// -// 最近修改:2009 年 08 月 07 日 -//------------------------------------------------------------------------------------------------------------ -DWORD TAesClass::OnAesUncrypt(LPVOID InBuffer,DWORD InLength,LPVOID OutBuffer) -{ - DWORD OutLength=0; - if (m_lpAes==NULL||OutBuffer==NULL) - { - return 0; - } - UCHAR *lpCurInBuff=(UCHAR *)InBuffer; - UCHAR *lpCurOutBuff=(UCHAR *)OutBuffer; - long blocknum=InLength/16; - long leftnum=InLength%16; - if(leftnum) - { - return 0; - } - for(long i=0;iInvCipher(lpCurInBuff,lpCurOutBuff); - lpCurInBuff+=16; - lpCurOutBuff+=16; - OutLength+=16; - } - - UCHAR *lpExtraInBuff=lpCurOutBuff-16; - DWORD dwExtraBytes=*((LPDWORD)lpExtraInBuff); - return (OutLength-dwExtraBytes); - -} diff --git a/LedOK/base/taesclass.h b/LedOK/base/taesclass.h deleted file mode 100644 index 0fdaeec..0000000 --- a/LedOK/base/taesclass.h +++ /dev/null @@ -1,133 +0,0 @@ -#ifndef TAESCLASS_H -#define TAESCLASS_H -#include -#include -#include -#include - -typedef unsigned long DWORD; -typedef unsigned char UCHAR,*PUCHAR; -typedef void *PVOID,*LPVOID; -typedef unsigned char byte; -typedef DWORD *PDWORD,*LPDWORD; - -#ifndef VOID -#define VOID void -#endif - -//#pragma once - -//enum KeySize { Bits128, Bits192, Bits256 }; // key size, in bits, for construtor -#define Bits128 16 -#define Bits192 24 -#define Bits256 32 - -unsigned char AesSbox[16*16]= -{// populate the Sbox matrix - /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */ - /*0*/ 0x63, 0x7c, 0x77, 0x7b, 0xf2, 0x6b, 0x6f, 0xc5, 0x30, 0x01, 0x67, 0x2b, 0xfe, 0xd7, 0xab, 0x76, - /*1*/ 0xca, 0x82, 0xc9, 0x7d, 0xfa, 0x59, 0x47, 0xf0, 0xad, 0xd4, 0xa2, 0xaf, 0x9c, 0xa4, 0x72, 0xc0, - /*2*/ 0xb7, 0xfd, 0x93, 0x26, 0x36, 0x3f, 0xf7, 0xcc, 0x34, 0xa5, 0xe5, 0xf1, 0x71, 0xd8, 0x31, 0x15, - /*3*/ 0x04, 0xc7, 0x23, 0xc3, 0x18, 0x96, 0x05, 0x9a, 0x07, 0x12, 0x80, 0xe2, 0xeb, 0x27, 0xb2, 0x75, - /*4*/ 0x09, 0x83, 0x2c, 0x1a, 0x1b, 0x6e, 0x5a, 0xa0, 0x52, 0x3b, 0xd6, 0xb3, 0x29, 0xe3, 0x2f, 0x84, - /*5*/ 0x53, 0xd1, 0x00, 0xed, 0x20, 0xfc, 0xb1, 0x5b, 0x6a, 0xcb, 0xbe, 0x39, 0x4a, 0x4c, 0x58, 0xcf, - /*6*/ 0xd0, 0xef, 0xaa, 0xfb, 0x43, 0x4d, 0x33, 0x85, 0x45, 0xf9, 0x02, 0x7f, 0x50, 0x3c, 0x9f, 0xa8, - /*7*/ 0x51, 0xa3, 0x40, 0x8f, 0x92, 0x9d, 0x38, 0xf5, 0xbc, 0xb6, 0xda, 0x21, 0x10, 0xff, 0xf3, 0xd2, - /*8*/ 0xcd, 0x0c, 0x13, 0xec, 0x5f, 0x97, 0x44, 0x17, 0xc4, 0xa7, 0x7e, 0x3d, 0x64, 0x5d, 0x19, 0x73, - /*9*/ 0x60, 0x81, 0x4f, 0xdc, 0x22, 0x2a, 0x90, 0x88, 0x46, 0xee, 0xb8, 0x14, 0xde, 0x5e, 0x0b, 0xdb, - /*a*/ 0xe0, 0x32, 0x3a, 0x0a, 0x49, 0x06, 0x24, 0x5c, 0xc2, 0xd3, 0xac, 0x62, 0x91, 0x95, 0xe4, 0x79, - /*b*/ 0xe7, 0xc8, 0x37, 0x6d, 0x8d, 0xd5, 0x4e, 0xa9, 0x6c, 0x56, 0xf4, 0xea, 0x65, 0x7a, 0xae, 0x08, - /*c*/ 0xba, 0x78, 0x25, 0x2e, 0x1c, 0xa6, 0xb4, 0xc6, 0xe8, 0xdd, 0x74, 0x1f, 0x4b, 0xbd, 0x8b, 0x8a, - /*d*/ 0x70, 0x3e, 0xb5, 0x66, 0x48, 0x03, 0xf6, 0x0e, 0x61, 0x35, 0x57, 0xb9, 0x86, 0xc1, 0x1d, 0x9e, - /*e*/ 0xe1, 0xf8, 0x98, 0x11, 0x69, 0xd9, 0x8e, 0x94, 0x9b, 0x1e, 0x87, 0xe9, 0xce, 0x55, 0x28, 0xdf, - /*f*/ 0x8c, 0xa1, 0x89, 0x0d, 0xbf, 0xe6, 0x42, 0x68, 0x41, 0x99, 0x2d, 0x0f, 0xb0, 0x54, 0xbb, 0x16 -}; - -unsigned char AesiSbox[16*16]= -{ - // populate the iSbox matrix - /* 0 1 2 3 4 5 6 7 8 9 a b c d e f */ - /*0*/ 0x52, 0x09, 0x6a, 0xd5, 0x30, 0x36, 0xa5, 0x38, 0xbf, 0x40, 0xa3, 0x9e, 0x81, 0xf3, 0xd7, 0xfb, - /*1*/ 0x7c, 0xe3, 0x39, 0x82, 0x9b, 0x2f, 0xff, 0x87, 0x34, 0x8e, 0x43, 0x44, 0xc4, 0xde, 0xe9, 0xcb, - /*2*/ 0x54, 0x7b, 0x94, 0x32, 0xa6, 0xc2, 0x23, 0x3d, 0xee, 0x4c, 0x95, 0x0b, 0x42, 0xfa, 0xc3, 0x4e, - /*3*/ 0x08, 0x2e, 0xa1, 0x66, 0x28, 0xd9, 0x24, 0xb2, 0x76, 0x5b, 0xa2, 0x49, 0x6d, 0x8b, 0xd1, 0x25, - /*4*/ 0x72, 0xf8, 0xf6, 0x64, 0x86, 0x68, 0x98, 0x16, 0xd4, 0xa4, 0x5c, 0xcc, 0x5d, 0x65, 0xb6, 0x92, - /*5*/ 0x6c, 0x70, 0x48, 0x50, 0xfd, 0xed, 0xb9, 0xda, 0x5e, 0x15, 0x46, 0x57, 0xa7, 0x8d, 0x9d, 0x84, - /*6*/ 0x90, 0xd8, 0xab, 0x00, 0x8c, 0xbc, 0xd3, 0x0a, 0xf7, 0xe4, 0x58, 0x05, 0xb8, 0xb3, 0x45, 0x06, - /*7*/ 0xd0, 0x2c, 0x1e, 0x8f, 0xca, 0x3f, 0x0f, 0x02, 0xc1, 0xaf, 0xbd, 0x03, 0x01, 0x13, 0x8a, 0x6b, - /*8*/ 0x3a, 0x91, 0x11, 0x41, 0x4f, 0x67, 0xdc, 0xea, 0x97, 0xf2, 0xcf, 0xce, 0xf0, 0xb4, 0xe6, 0x73, - /*9*/ 0x96, 0xac, 0x74, 0x22, 0xe7, 0xad, 0x35, 0x85, 0xe2, 0xf9, 0x37, 0xe8, 0x1c, 0x75, 0xdf, 0x6e, - /*a*/ 0x47, 0xf1, 0x1a, 0x71, 0x1d, 0x29, 0xc5, 0x89, 0x6f, 0xb7, 0x62, 0x0e, 0xaa, 0x18, 0xbe, 0x1b, - /*b*/ 0xfc, 0x56, 0x3e, 0x4b, 0xc6, 0xd2, 0x79, 0x20, 0x9a, 0xdb, 0xc0, 0xfe, 0x78, 0xcd, 0x5a, 0xf4, - /*c*/ 0x1f, 0xdd, 0xa8, 0x33, 0x88, 0x07, 0xc7, 0x31, 0xb1, 0x12, 0x10, 0x59, 0x27, 0x80, 0xec, 0x5f, - /*d*/ 0x60, 0x51, 0x7f, 0xa9, 0x19, 0xb5, 0x4a, 0x0d, 0x2d, 0xe5, 0x7a, 0x9f, 0x93, 0xc9, 0x9c, 0xef, - /*e*/ 0xa0, 0xe0, 0x3b, 0x4d, 0xae, 0x2a, 0xf5, 0xb0, 0xc8, 0xeb, 0xbb, 0x3c, 0x83, 0x53, 0x99, 0x61, - /*f*/ 0x17, 0x2b, 0x04, 0x7e, 0xba, 0x77, 0xd6, 0x26, 0xe1, 0x69, 0x14, 0x63, 0x55, 0x21, 0x0c, 0x7d -}; -unsigned char AesRcon[11*4]= -{ - 0x00, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x00, 0x00, - 0x02, 0x00, 0x00, 0x00, - 0x04, 0x00, 0x00, 0x00, - 0x08, 0x00, 0x00, 0x00, - 0x10, 0x00, 0x00, 0x00, - 0x20, 0x00, 0x00, 0x00, - 0x40, 0x00, 0x00, 0x00, - 0x80, 0x00, 0x00, 0x00, - 0x1b, 0x00, 0x00, 0x00, - 0x36, 0x00, 0x00, 0x00 -}; - - -class Aes // Advanced Encryption Standard -{ -public: - ~Aes(); - Aes(); - Aes(int keySize, unsigned char* keyBytes); - unsigned char State[4][4]; - void Cipher(unsigned char* input, unsigned char* output); // encipher 16-bit input - void InvCipher(unsigned char* input, unsigned char* output); // decipher 16-bit input -private: - int Nb; // block size in 32-bit words. Always 4 for AES. (128 bits). - int Nk; // key size in 32-bit words. 4, 6, 8. (128, 192, 256 bits). - int Nr; // number of rounds. 10, 12, 14. - - unsigned char key[32]; - unsigned char w[16*15]; - - void SetNbNkNr(int keySize); - void AddRoundKey(int round); //轮密钥加 - void SubBytes(); //S盒字节代换 - void InvSubBytes(); //逆S盒字节代换 - void ShiftRows(); //行移位 - void InvShiftRows(); - void MixColumns(); //列混淆 - void InvMixColumns(); - unsigned char gfmultby01(unsigned char b); - unsigned char gfmultby02(unsigned char b); - unsigned char gfmultby03(unsigned char b); - unsigned char gfmultby09(unsigned char b); - unsigned char gfmultby0b(unsigned char b); - unsigned char gfmultby0d(unsigned char b); - unsigned char gfmultby0e(unsigned char b); - void KeyExpansion(); //密钥扩展 - unsigned char* SubWord(unsigned char* word); //密钥S盒字代换 - unsigned char* RotWord(unsigned char* word); //密钥移位 - -}; - -class TAesClass -{ -public: - TAesClass(); - ~TAesClass(); - void InitializePrivateKey(DWORD KeySize,UCHAR *KeyBytes); //AES 密钥初始化 - DWORD OnAesEncrypt(LPVOID InBuffer,DWORD InLength,LPVOID OutBuffer); //AES 加密数据 - DWORD OnAesUncrypt(LPVOID InBuffer,DWORD InLength,LPVOID OutBuffer); //AES 解密数据 -private: - Aes * m_lpAes; -}; - -#endif diff --git a/LedOK/base/x_checkboxdelegate.cpp b/LedOK/base/x_checkboxdelegate.cpp deleted file mode 100644 index 9ba27d8..0000000 --- a/LedOK/base/x_checkboxdelegate.cpp +++ /dev/null @@ -1,116 +0,0 @@ -/* - delegate.cpp - - A delegate that allows the user to change integer values from the model - using a spin box widget. -*/ - -#include "x_checkboxdelegate.h" - -#include -#include -#include -X_CheckBoxDelegate::X_CheckBoxDelegate(QObject *parent) - : QStyledItemDelegate(parent) -{ - -} - -QWidget *X_CheckBoxDelegate::createEditor(QWidget *parent, - const QStyleOptionViewItem & option , - const QModelIndex & index ) const -{ -// if(index.column()>=3&&index.column()<=9) -// { -// QCheckBox *editor = new QCheckBox(parent); -// // editor->setFrame(false); - -// ///editor->setAlignment(Qt::AlignHCenter); -// // editor->setDisplayFormat("hh:mm"); - -// return editor; - -// } - - if(index.column()>=3&&index.column()<=9) - { - QCheckBox *editor=new QCheckBox(parent); - editor->installEventFilter(const_cast(this)); - return editor; - } - else - return QStyledItemDelegate::createEditor(parent,option,index); - - return nullptr; -} - -//void X_CheckBoxDelegate::setEditorData(QWidget *editor, -// const QModelIndex &index) const -//{ -// if(index.column()>=3&&index.column()<=9) -// { -// bool data = index.model()->data(index, Qt::UserRole).toBool(); -// QCheckBox *checkBox = static_cast(editor); -// checkBox->setChecked(data); - -// } -// else -// QStyledItemDelegate::setEditorData(editor,index); - -//} - -//void X_CheckBoxDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, -// const QModelIndex &index) const -//{ -// QCheckBox *checkBox = static_cast(editor); -// bool value = checkBox->isChecked(); -// model->setData(index, value, Qt::UserRole); -//} -// 绘制复选框 -void X_CheckBoxDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const -{ - QStyleOptionViewItem viewOption(option); - initStyleOption(&viewOption, index); - if (option.state.testFlag(QStyle::State_HasFocus)) - viewOption.state = viewOption.state ^ QStyle::State_HasFocus; - - QStyledItemDelegate::paint(painter, viewOption, index); - - if (index.column()>=3&&index.column()<=9) - { - bool data = index.model()->data(index, Qt::UserRole).toBool(); - - QStyleOptionButton checkBoxStyle; - checkBoxStyle.state = data ? QStyle::State_On : QStyle::State_Off; - checkBoxStyle.state |= QStyle::State_Enabled; - checkBoxStyle.iconSize = QSize(20, 20); - checkBoxStyle.rect = option.rect; - - QCheckBox checkBox; - QApplication::style()->drawPrimitive(QStyle::PE_IndicatorCheckBox, &checkBoxStyle, painter, &checkBox); - } -} - -// 响应鼠标事件,更新数据 -bool X_CheckBoxDelegate::editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index) -{ - QRect decorationRect = option.rect; - - QMouseEvent *mouseEvent = static_cast(event); - if (event->type() == QEvent::MouseButtonPress && decorationRect.contains(mouseEvent->pos())) - { - if (index.column()>=3&&index.column()<=9) - { - bool data = model->data(index, Qt::UserRole).toBool(); - model->setData(index, !data, Qt::UserRole); - } - } - - return QStyledItemDelegate::editorEvent(event, model, option, index); -} -void X_CheckBoxDelegate::updateEditorGeometry(QWidget *editor, - const QStyleOptionViewItem &option, const QModelIndex &/* index */) const -{ - editor->setGeometry(option.rect); -} - diff --git a/LedOK/base/x_checkboxdelegate.h b/LedOK/base/x_checkboxdelegate.h deleted file mode 100644 index b227936..0000000 --- a/LedOK/base/x_checkboxdelegate.h +++ /dev/null @@ -1,73 +0,0 @@ -#ifndef X_CHECKBOXDELEGATE_H -#define X_CHECKBOXDELEGATE_H -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include - -//! [0] -class X_CheckBoxDelegate : public QStyledItemDelegate -{ - Q_OBJECT - -public: - X_CheckBoxDelegate(QObject *parent = nullptr); - QWidget* createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override; -// void setEditorData(QWidget *editor, const QModelIndex &index) const override; -// void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override; - void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const override; - void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override; - bool editorEvent(QEvent *event, QAbstractItemModel *model, const QStyleOptionViewItem &option, const QModelIndex &index) override; - - -}; -//! [0] - -#endif // X_CHECKBOXDELEGATE_H diff --git a/LedOK/base/x_spinboxdelegate.cpp b/LedOK/base/x_spinboxdelegate.cpp deleted file mode 100644 index c20f789..0000000 --- a/LedOK/base/x_spinboxdelegate.cpp +++ /dev/null @@ -1,35 +0,0 @@ -#include "x_spinboxdelegate.h" -/* - A delegate that allows the user to change integer values from the model - using a spin box widget. -*/ -#include - -SpinBoxDelegate::SpinBoxDelegate(QObject *parent, int iFlag) : QStyledItemDelegate(parent) { - m_iFlag=iFlag; -} - -QWidget *SpinBoxDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &, const QModelIndex &index) const { - if(index.column()!=0) return 0; - QSpinBox *editor = new QSpinBox(parent); - editor->setFrame(false); - editor->setMinimum(0); - if(m_iFlag==0) editor->setMaximum(100);//亮度最大值 - else if(m_iFlag==1) editor->setMaximum(15);//音量最大值 - editor->setAlignment(Qt::AlignHCenter); - return editor; -} -void SpinBoxDelegate::setEditorData(QWidget *editor, const QModelIndex &index) const{ - int value = index.model()->data(index, Qt::EditRole).toInt(); - QSpinBox *spinBox = static_cast(editor); - spinBox->setValue(value); -} -void SpinBoxDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const{ - QSpinBox *spinBox = static_cast(editor); - spinBox->interpretText(); - int value = spinBox->value(); - model->setData(index, value, Qt::EditRole); -} -void SpinBoxDelegate::updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &) const { - editor->setGeometry(option.rect); -} diff --git a/LedOK/base/x_spinboxdelegate.h b/LedOK/base/x_spinboxdelegate.h deleted file mode 100644 index 90d67d4..0000000 --- a/LedOK/base/x_spinboxdelegate.h +++ /dev/null @@ -1,67 +0,0 @@ -#ifndef X_SPINBOXDELEGATE_H -#define X_SPINBOXDELEGATE_H -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include -#include -class SpinBoxDelegate : public QStyledItemDelegate { - Q_OBJECT -public: - SpinBoxDelegate(QObject *parent = 0,int iFlag=0); - - QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const override; - void setEditorData(QWidget *editor, const QModelIndex &index) const override; - void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const override; - void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex &index) const override; -public: - int m_iFlag=0; -}; -#endif // X_SPINBOXDELEGATE_H diff --git a/LedOK/base/x_timeeditdelegate.cpp b/LedOK/base/x_timeeditdelegate.cpp deleted file mode 100644 index 7bc424d..0000000 --- a/LedOK/base/x_timeeditdelegate.cpp +++ /dev/null @@ -1,62 +0,0 @@ -#include "X_timeEditDelegate.h" -/* - delegate.cpp - - A delegate that allows the user to change integer values from the model - using a spin box widget. -*/ - -#include "X_timeEditDelegate.h" - -#include - -X_timeEditDelegate::X_timeEditDelegate(QObject *parent) - : QStyledItemDelegate(parent) -{ -} - -QWidget *X_timeEditDelegate::createEditor(QWidget *parent, - const QStyleOptionViewItem &/* option */, - const QModelIndex & index ) const -{ - if(index.column()==1||index.column()==2) - { - QTimeEdit *editor = new QTimeEdit(parent); - editor->setFrame(false); - - editor->setAlignment(Qt::AlignHCenter); - editor->setDisplayFormat("hh:mm"); - - return editor; - - } - return nullptr; -} - -void X_timeEditDelegate::setEditorData(QWidget *editor, - const QModelIndex &index) const -{ - QString value = index.model()->data(index, Qt::EditRole).toString(); - - QTimeEdit *spinBoxTimeEdit = static_cast(editor); - QTime qtime=QTime::fromString(value,"hh:mm"); - spinBoxTimeEdit->setTime(qtime); - -} - -void X_timeEditDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, - const QModelIndex &index) const -{ - QTimeEdit *spinBoxTimeEdit = static_cast(editor); - spinBoxTimeEdit->interpretText(); - QString value = spinBoxTimeEdit->time().toString("hh:mm"); - - model->setData(index, value, Qt::EditRole); -} - -void X_timeEditDelegate::updateEditorGeometry(QWidget *editor, - const QStyleOptionViewItem &option, const QModelIndex &/* index */) const -{ - editor->setGeometry(option.rect); -} - diff --git a/LedOK/base/x_timeeditdelegate.h b/LedOK/base/x_timeeditdelegate.h deleted file mode 100644 index 0595724..0000000 --- a/LedOK/base/x_timeeditdelegate.h +++ /dev/null @@ -1,75 +0,0 @@ -#ifndef X_TIMEEDITDELEGATE_H -#define X_TIMEEDITDELEGATE_H -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of the examples of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:BSD$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** BSD License Usage -** Alternatively, you may use this file under the terms of the BSD license -** as follows: -** -** "Redistribution and use in source and binary forms, with or without -** modification, are permitted provided that the following conditions are -** met: -** * Redistributions of source code must retain the above copyright -** notice, this list of conditions and the following disclaimer. -** * Redistributions in binary form must reproduce the above copyright -** notice, this list of conditions and the following disclaimer in -** the documentation and/or other materials provided with the -** distribution. -** * Neither the name of The Qt Company Ltd nor the names of its -** contributors may be used to endorse or promote products derived -** from this software without specific prior written permission. -** -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT -** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, -** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT -** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, -** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY -** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE." -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include - -//! [0] -class X_timeEditDelegate : public QStyledItemDelegate -{ - Q_OBJECT - -public: - X_timeEditDelegate(QObject *parent = 0); - - QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, - const QModelIndex &index) const override; - - void setEditorData(QWidget *editor, const QModelIndex &index) const override; - void setModelData(QWidget *editor, QAbstractItemModel *model, - const QModelIndex &index) const override; - - void updateEditorGeometry(QWidget *editor, - const QStyleOptionViewItem &option, const QModelIndex &index) const override; -}; -//! [0] - -#endif // X_TIMEEDITDELEGATE_H diff --git a/LedOK/base/x_uimsgboxok.cpp b/LedOK/base/x_uimsgboxok.cpp deleted file mode 100644 index 29a92b5..0000000 --- a/LedOK/base/x_uimsgboxok.cpp +++ /dev/null @@ -1,60 +0,0 @@ -#include "x_uimsgboxok.h" -#include "ui_x_uimsgboxok.h" -#include -#include - -X_UIMsgBoxOk::X_UIMsgBoxOk(QWidget *parent) : - BaseDlg(parent), - ui(new Ui::X_UIMsgBoxOk) -{ - setAttribute(Qt::WA_DeleteOnClose); - ui->setupUi(this); - m_bExitTypeFlag=0; -} - -X_UIMsgBoxOk::~X_UIMsgBoxOk() -{ - delete ui; -} -X_UIMsgBoxOk::X_UIMsgBoxOk(QString strTitle,QString text, QWidget *parent) : - BaseDlg(parent), - ui(new Ui::X_UIMsgBoxOk) -{ - setAttribute(Qt::WA_DeleteOnClose); - ui->setupUi(this); - ui->lInfoTip->adjustSize(); - ui->label_3->setText(strTitle); - //让QLabel能够自动判断并换行显示: -// ui->lInfoTip->setGeometry(QRect(328, 240, 329, 27*4)); //四倍行距 - ui->lInfoTip->setWordWrap(true); - ui->lInfoTip->setAlignment(Qt::AlignTop); - ui->lInfoTip->setText(text); - ui->pushButton_3->setVisible(false); - m_bExitTypeFlag=0; - ui->pushButton->setProperty("ssType", "progManageTool"); - ui->pushButton_2->setProperty("ssType", "progManageTool"); - ui->pushButton_3->setProperty("ssType", "progManageTool"); -} -X_UIMsgBoxOk::X_UIMsgBoxOk(QString strTitle,QString text, QWidget *parent,int iType) : - BaseDlg(parent), - ui(new Ui::X_UIMsgBoxOk) -{ - setAttribute(Qt::WA_DeleteOnClose); - ui->setupUi(this); - m_bExitTypeFlag=0; - ui->lInfoTip->adjustSize(); - ui->label_3->setText(strTitle); - //让QLabel能够自动判断并换行显示: -// ui->lInfoTip->setGeometry(QRect(328, 240, 329, 27*4)); //四倍行距 - ui->lInfoTip->setWordWrap(true); - ui->lInfoTip->setAlignment(Qt::AlignTop); - ui->lInfoTip->setText(text); - ui->pushButton_3->setVisible(false); - if(iType==1) { - ui->lInfoTip->setStyleSheet("background:rgba(206,206,206,1)"); - ui->frame->setStyleSheet("QFrame{background:rgba(206,206,206,1)}"); - setStyleSheet("X_UIMsgBoxOk{background:rgba(206,206,206,1)}"); - ui->pushButton->setProperty("ssType", "progManageTool"); - ui->pushButton_2->setProperty("ssType", "progManageTool"); - } -} diff --git a/LedOK/base/x_uimsgboxok.h b/LedOK/base/x_uimsgboxok.h deleted file mode 100644 index da5cb6c..0000000 --- a/LedOK/base/x_uimsgboxok.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef X_UIMSGBOXOK_H -#define X_UIMSGBOXOK_H - -#include -namespace Ui { -class X_UIMsgBoxOk; -} - -class X_UIMsgBoxOk : public BaseDlg -{ - Q_OBJECT - -public: - explicit X_UIMsgBoxOk(QWidget *parent = nullptr); - X_UIMsgBoxOk(QString strTitle, QString text, QWidget *parent = nullptr); - X_UIMsgBoxOk(QString strTitle, QString text, QWidget *parent = nullptr,int iType=0); - ~X_UIMsgBoxOk(); - int m_bExitTypeFlag=0; - -private: - Ui::X_UIMsgBoxOk *ui; -}; - -#endif // X_UIMSGBOXOK_H diff --git a/LedOK/base/x_uimsgboxok.ui b/LedOK/base/x_uimsgboxok.ui deleted file mode 100644 index 109d6d4..0000000 --- a/LedOK/base/x_uimsgboxok.ui +++ /dev/null @@ -1,243 +0,0 @@ - - - X_UIMsgBoxOk - - - - 0 - 0 - 426 - 200 - - - - - 0 - 0 - - - - - - - true - - - - 0 - 0 - - - - QFrame::Box - - - - - - - - - - - 0 - 0 - - - - QFrame::Sunken - - - 0 - - - TextLabel - - - Qt::AlignCenter - - - - - - - - 31 - 23 - - - - X - - - - - - - - - border-top: 2px solid gray; - - - 1 - - - 0 - - - Qt::Horizontal - - - - - - - - - - - - 0 - 0 - - - - - 32 - 32 - - - - image: url(:/res/tip.png); - - - QFrame::NoFrame - - - QFrame::Plain - - - 0 - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - 0 - 0 - - - - TextLabel - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - OK - - - - - - - Cancel - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - - - - - pushButton - clicked() - X_UIMsgBoxOk - accept() - - - 128 - 119 - - - 127 - 75 - - - - - pushButton_2 - clicked() - X_UIMsgBoxOk - close() - - - 220 - 31 - - - 127 - 75 - - - - - diff --git a/LedOK/communication/hpptclient.cpp b/LedOK/communication/hpptclient.cpp deleted file mode 100644 index 7f93884..0000000 --- a/LedOK/communication/hpptclient.cpp +++ /dev/null @@ -1,188 +0,0 @@ -#include "hpptclient.h" - -//HpptClient* HpptClient::gInstance = nullptr; -HpptClient::HpptClient(QObject *p): QObject(p) { - connect(&mNetAccessManager, &QNetworkAccessManager::finished, this, [this](QNetworkReply *reply) { - if(reply->property("data").isValid()) onHttpPostRspFinished(reply); - else onHttpGetRspFinished(reply); - }); -} -void HpptClient::clearRp(QNetworkReply *rp) { - if(rp) - { - QString url = rp->request().url().toString(); - QString postMD5 = rp->property("postMD5").toString(); - QString postData = rp->property("data").toByteArray(); - - if(postMD5.isEmpty()) - { - //清理对应缓存 - mDownloadDataCache.remove(url); - - //解除正在处理状态 - mProcessingRq.remove(url); - } - else - { - //清理对应缓存 - mDownloadDataCache.remove(postMD5); - - - //解除正在处理状态 - mProcessingRq.remove(postMD5); - } - - mRedirectMap.remove(url); - mRedirectMap.remove(postMD5); - - //qDebug() << "delete cache, url:" << url << " postMOD5:" << postMD5; - rp->deleteLater(); - } -} - -void HpptClient::onHttpGetRspProgress(qint64 bytesReceived, qint64 bytesTotal) -{ - Q_UNUSED(bytesReceived) - if(sender() == NULL) - { - return ; - } - - QNetworkReply* rp = qobject_cast(sender()); - if(rp == NULL) - { - return; - } - - //qDebug() << "http get rsp progress:" << rp->url().toString() << bytesReceived << "/" << bytesTotal; - if(bytesTotal <= 0) - { - return; - } - - QString url = rp->url().toString(); - - mDownloadDataCache[url].append(rp->readAll()); - -} - -void HpptClient::onHttpGetRspFinished(QNetworkReply *reply) { - QByteArray rpData; - QString url = reply->url().toString(); - int statusCode = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); - QString strUrl = reply->attribute(QNetworkRequest::RedirectionTargetAttribute).toString(); - - switch(statusCode) { - case 200: { - rpData = mDownloadDataCache[reply->url().toString()]; - QString redirectUrl = mRedirectMap[url];//重定向的url地址 - if(redirectUrl.isEmpty()) emit httpGetRspReady(url, rpData); - else emit httpGetRspReady(redirectUrl, rpData); - } - break; - case 301: - case 302: { - if(!strUrl.isEmpty()) { - QString turl = mRedirectMap[url]; - if(turl.isEmpty()) mRedirectMap[strUrl] = url; - else mRedirectMap[strUrl] = turl; - httpGet(strUrl); - } - } - break; - default: // error - { - qDebug() << url << "[get error:" << statusCode << "]"; - QString redirectUrl = mRedirectMap[url]; - if(redirectUrl.isEmpty()) emit httpGetRspReady(url, QByteArray()); - else emit httpGetRspReady(redirectUrl, QByteArray()); - } - break; - } - clearRp(reply); -} - -void HpptClient::onHttpPostRspProgress(qint64, qint64 bytesTotal){ - if(sender() == NULL) return; - QNetworkReply* rp = qobject_cast(sender()); - if(rp == NULL) return; - if(bytesTotal <= 0) return; - mDownloadDataCache[rp->property("postMD5").toString()].append(rp->readAll()); -} - -void HpptClient::onHttpPostRspFinished(QNetworkReply *reply) { - QString url = reply->url().toString(); - QString postMD5 = reply->property("postMD5").toString(); - - int statusCode = reply->attribute(QNetworkRequest::HttpStatusCodeAttribute).toInt(); - switch(statusCode) { - case 200: { - auto rpData = mDownloadDataCache[postMD5]; - QString redirectMD5 = mRedirectMap[postMD5]; - QString redirectUrl = mRedirectMap[url]; - if(redirectMD5.isEmpty() || redirectUrl.isEmpty()) emit httpPostRspReady(url, postMD5, rpData); - else emit httpPostRspReady(redirectUrl, redirectMD5, rpData); - } - break; - case 301: - case 302: { - auto redireUrl = reply->attribute(QNetworkRequest::RedirectionTargetAttribute).toString(); - if(!redireUrl.isEmpty()) { - QString turl = mRedirectMap[url];//direct by - if(turl.isEmpty()) mRedirectMap[redireUrl] = url; - else mRedirectMap[redireUrl] = turl; - - QByteArray postData = reply->property("data").toByteArray(); - QByteArray d = redireUrl.toUtf8() + postData; - QString md5 = QCryptographicHash::hash(d, QCryptographicHash::Md5); - QString tPostMD5 = mRedirectMap[md5];//direct by - if(tPostMD5.isEmpty()) mRedirectMap[md5] = postMD5; - else mRedirectMap[md5] = tPostMD5; - httpPost(redireUrl, postData); - } - } - break; - default: - QString redirectMD5 = mRedirectMap[postMD5]; - QString redirectUrl = mRedirectMap[url]; - if(redirectMD5.isEmpty() || redirectUrl.isEmpty()) - { - emit httpPostRspReady(url, postMD5, QByteArray()); - } - else - { - emit httpPostRspReady(redirectUrl, redirectMD5, QByteArray()); - } - break; - } - clearRp(reply); -} - - -void HpptClient::httpGet(const QString &url) { - if(mProcessingRq.value(url, false)) return;//ignore when rq processing - auto values = mRedirectMap.values(); - for(int i = 0; i < values.count(); i++) if(values[i] == url) return;//ignore when redirect processing - mProcessingRq.insert(url, true); - - QNetworkRequest request{url}; - QNetworkReply* rp = mNetAccessManager.get(request); - connect(rp, &QNetworkReply::downloadProgress, this, &HpptClient::onHttpGetRspProgress); -} - -QByteArray HpptClient::httpPost(const QString &url, const QByteArray &data) { - QByteArray md5 = QCryptographicHash::hash(url.toUtf8() + data, QCryptographicHash::Md5); - if(mProcessingRq.value(md5, false)) return md5;//ignore when rq processing - auto values = mRedirectMap.values(); - for(int i=0; i < values.count(); i++) if(values[i] == md5) return md5; //ignore when redirect processing - mProcessingRq.insert(md5, true); - - QNetworkRequest request{url}; - request.setHeader(QNetworkRequest::ContentTypeHeader, "application/json");//add by alahover 20200304 - QNetworkReply* reply = mNetAccessManager.post(request, data); - reply->setProperty("postMD5", md5); - reply->setProperty("url", url); - reply->setProperty("data", data); - connect(reply, &QNetworkReply::downloadProgress, this, &HpptClient::onHttpPostRspProgress); - return md5; -} diff --git a/LedOK/communication/hpptclient.h b/LedOK/communication/hpptclient.h deleted file mode 100644 index 6fdd2d7..0000000 --- a/LedOK/communication/hpptclient.h +++ /dev/null @@ -1,46 +0,0 @@ -#ifndef HPPTCLIENT_H -#define HPPTCLIENT_H - -#include -#include -#include -#include -class HpptClient : public QObject { - Q_OBJECT -public: - HpptClient(QObject *p = nullptr); - - void httpGet(const QString& url); - /// \return 返回url+data的md5 - QByteArray httpPost(const QString& url, const QByteArray &data); - -signals: - /// \brief httpGetRspReady http get 请求得到回复 - /// \param url 请求的地址 - /// \param data 回复的数据(如果isEmpty则表示请求出错了) - void httpGetRspReady(QString url, QByteArray data); - - /// \brief httpPostRspReady http post 请求得到回复 - /// \param url 请求的地址 - /// \param postMD5 是post的时候url+数据的md5 - /// \param data data是回复的数据(如果isEmpty则表示请求出错了) - void httpPostRspReady(QString url, QString postMD5, QByteArray data); - -private slots: - void clearRp(QNetworkReply* rp); - - void onHttpGetRspProgress(qint64 bytesReceived, qint64 bytesTotal); //* http get 回复进度 - void onHttpGetRspFinished(QNetworkReply *reply); //* http get 处理完毕 - - void onHttpPostRspProgress(qint64 bytesReceived, qint64 bytesTotal); //* http post 回复进度 - void onHttpPostRspFinished(QNetworkReply *reply); //* http get 处理完毕 - -private: - QNetworkAccessManager mNetAccessManager; - QString mCacheRoot; //* 缓存目录 - QMap mProcessingRq; //* 当前正在处理的请求url 和是否正在处理 - QMap mDownloadDataCache; //* 数据缓存url -> data | postMD5 -> data - QMap mRedirectMap; //* 重定向关系 -}; - -#endif // HPPTCLIENT_H diff --git a/LedOK/communication/taserialthread.cpp b/LedOK/communication/taserialthread.cpp deleted file mode 100644 index c846678..0000000 --- a/LedOK/communication/taserialthread.cpp +++ /dev/null @@ -1,130 +0,0 @@ -#include "taserialthread.h" -#include -TA_SerialThread::TA_SerialThread() -{ - portCnt = 0; - portNewCnt=0; - m_arrSerial = new QSerialPort[10]; - m_arrNewSerial=new QSerialPortInfo[10]; -} - -TA_SerialThread::~TA_SerialThread() -{ - -} - -void TA_SerialThread::run() -{ - -} - -void TA_SerialThread::SearchPort(void) { - portNewCnt=0; - //查找可用的串口 - foreach(const QSerialPortInfo &info, QSerialPortInfo::availablePorts()) { - if(portNewCnt > 9) break; - m_arrNewSerial[portNewCnt]=info; - portNewCnt++; - } - - for (int i=0;i -#include -#include -#include - -class TA_SerialThread:public QThread -{ -public: - TA_SerialThread(); - ~TA_SerialThread(); - -public: - uint8_t portCnt; - uint8_t portNewCnt; - QSerialPort *m_arrSerial;//ptr point to an array,maxium port num is 5 - QSerialPortInfo *m_arrNewSerial;//ptr point to an array,maxium port num is 5 - -public: - void SearchPort(void); - void InitPortName(uint8_t portIndex,const QString &portName); - void InitPortBaudRate(uint8_t portIndex,qint32 baudRate); - void InitPortDataBits(uint8_t portIndex,QSerialPort::DataBits dataBits); - void InitPortParity(uint8_t portIndex,QSerialPort::Parity parity); - void InitPortStopBits(uint8_t portIndex,QSerialPort::StopBits stopBits); - bool OpenPort(uint8_t portIndex); - void ClosePort(uint8_t portIndex); - void SendDataBuf(uint8_t portIndex,const QByteArray &str); - QByteArray GetDataBuf(uint8_t portIndex); - -private slots: - void run(); -}; -#endif // TASERIALTHREAD_H diff --git a/LedOK/css.css b/LedOK/css.css index 78a4844..e394af0 100644 --- a/LedOK/css.css +++ b/LedOK/css.css @@ -1,4 +1,6 @@ -QLineEdit,QComboBox,QAbstractSpinBox { +Table {selection-background-color: #8ce;} + +QLineEdit,QComboBox,QAbstractSpinBox { border: 1px solid #aaa; border-radius: 3px; padding: 2px; diff --git a/LedOK/device/controlpowerschedule.cpp b/LedOK/device/controlpowerschedule.cpp deleted file mode 100644 index 13524f4..0000000 --- a/LedOK/device/controlpowerschedule.cpp +++ /dev/null @@ -1,554 +0,0 @@ -#include "controlpowerschedule.h" -#include "ui_controlpowerschedule.h" - -#include -#include -#include -#include -#include -#include -#include -#include "cfg.h" -#include "QSettings" -#include "base/x_spinboxdelegate.h" -#include "base/x_timeeditdelegate.h" -#include "base/x_checkboxdelegate.h" -#include "tools.h" - -ControlPowerSchedule::ControlPowerSchedule(QWidget *parent,QList *list) : - QWidget(parent), - ui(new Ui::ControlPowerSchedule) -{ - m_pLedlist=list; - ui->setupUi(this); - ui->labelPowerScheduleTip->setVisible(false); - refreshLable(); -setStyleSheet(css); - ui->pushButtonAdd->setProperty("ssType", "progManageTool"); - ui->pushButtonAdd->setFlat(true); - ui->pushButtonDelete->setProperty("ssType", "progManageTool"); - ui->pushButtonDelete->setFlat(true); - ui->pushButtonClear->setProperty("ssType", "progManageTool"); - ui->pushButtonClear->setFlat(true); - ui->pushButtonApply->setProperty("ssType", "progManageTool"); - ui->pushButtonApply->setFlat(true); - ui->pushButtonImport->setProperty("ssType", "progManageTool"); - ui->pushButtonExport->setProperty("ssType", "progManageTool"); - ui->pushButtonReadback->setProperty("ssType", "progManageTool"); - ui->pushButtonClearSchedule->setProperty("ssType", "progManageTool"); - - m_pModel = new QStandardItemModel(this); - m_pModel->setColumnCount(10); - m_pModel->setHeaderData(0,Qt::Horizontal, tr("Power On State")); - m_pModel->setHeaderData(1,Qt::Horizontal, tr("Start Time")); - m_pModel->setHeaderData(2,Qt::Horizontal, tr("End Time")); - m_pModel->setHeaderData(3,Qt::Horizontal, tr("SUN")); - m_pModel->setHeaderData(4,Qt::Horizontal, tr("MON")); - m_pModel->setHeaderData(5,Qt::Horizontal, tr("TUE")); - m_pModel->setHeaderData(6,Qt::Horizontal, tr("WED")); - m_pModel->setHeaderData(7,Qt::Horizontal, tr("THU")); - m_pModel->setHeaderData(8,Qt::Horizontal, tr("FRI")); - m_pModel->setHeaderData(9,Qt::Horizontal, tr("SAT")); - ui->tableView->setModel(m_pModel); - - X_timeEditDelegate *pStartTimeDelegate=new X_timeEditDelegate(this); - ui->tableView->setItemDelegateForColumn(1,pStartTimeDelegate); - ui->tableView->setItemDelegateForColumn(2,pStartTimeDelegate); - X_CheckBoxDelegate *WeekDelegate=new X_CheckBoxDelegate(this); - ui->tableView->setItemDelegateForColumn(3,WeekDelegate); - ui->tableView->setItemDelegateForColumn(4,WeekDelegate); - ui->tableView->setItemDelegateForColumn(5,WeekDelegate); - ui->tableView->setItemDelegateForColumn(6,WeekDelegate); - ui->tableView->setItemDelegateForColumn(7,WeekDelegate); - ui->tableView->setItemDelegateForColumn(8,WeekDelegate); - ui->tableView->setItemDelegateForColumn(9,WeekDelegate); - - - ReadOnlyDelegate* readOnlyDelegate = new ReadOnlyDelegate(); - ui->tableView->setItemDelegateForColumn(0, readOnlyDelegate); //设置某列只读 - - ui->tableView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); - // ui->tableView->verticalHeader()->hide(); - ui->tableView->setSelectionBehavior(QAbstractItemView::SelectRows); - ui->tableView->setFocusPolicy(Qt::NoFocus); - - - MARCO_DEFINE_CONTROL_FUNC2(parent->parent()->parent(),parent->parent()) - - connect(ui->pushButtonAdd,SIGNAL(clicked()),this,SLOT(OnClickAdd())); - connect(ui->pushButtonImport,SIGNAL(clicked()),this,SLOT(OnClickImport())); - connect(ui->pushButtonExport,SIGNAL(clicked()),this,SLOT(OnClickExport())); - connect(ui->pushButtonDelete,SIGNAL(clicked()),this,SLOT(OnClickDelete())); - connect(ui->pushButtonClear,SIGNAL(clicked()),this,SLOT(OnClickClear())); - connect(ui->pushButtonApply,SIGNAL(clicked()),this,SLOT(OnClickApply())); - connect(ui->pushButtonReadback,SIGNAL(clicked()),this,SLOT(OnClickReadback())); - connect(ui->pushButtonClearSchedule,SIGNAL(clicked()),this,SLOT(OnClickClearSchedule())); - - -} - -ControlPowerSchedule::~ControlPowerSchedule() -{ - delete ui; - if(pHpptClient != nullptr) - { - qDebug() <<"delete pHpptClient in ~NetComm"; - delete pHpptClient; - pHpptClient=nullptr; - } - if(pHpptClientAll != nullptr) - { - qDebug() <<"delete pHpptClientAll in ~NetComm"; - delete pHpptClientAll; - pHpptClientAll=nullptr; - } -} -void ControlPowerSchedule::refreshLable() -{ - ui->pushButtonAdd->setText(tr("Add")); - ui->pushButtonApply->setText(tr("Apply")); - ui->pushButtonClear->setText(tr("Clear")); - ui->pushButtonDelete->setText(tr("Delete")); - ui->pushButtonImport->setText(tr("Import")); - ui->pushButtonExport->setText(tr("Export")); -} - -void ControlPowerSchedule::onSelectedDeviceList(QList *list) -{ - m_pLedlist=list; - if(m_pLedlist==nullptr) - return; - if(m_pLedlist->count()==1) - { - ui->pushButtonReadback->setEnabled(true); - } - else { - ui->pushButtonReadback->setEnabled(false); - } - MACRO_DEFINE_CONTROL_FUNC3 - -} -//获取到httpPost的应答,如果参数变化需要出发修改控件item的内容 -void ControlPowerSchedule::OnProHttpResponse(QString url, QString postMD5, QByteArray data) -{ - Q_UNUSED(postMD5) - //qDebug()<< url + "\r\n"+m_strUrl; - if(url == m_strUrl) - { - QJsonParseError parseJsonErr; - QJsonDocument document = QJsonDocument::fromJson(data,&parseJsonErr); - if(!(parseJsonErr.error == QJsonParseError::NoError)) - { - if(data.size()==0) - qDebug()<<"json is empty"; - else - qDebug()<count()!=1) - return; - QJsonObject json; - json.insert("_id", getRandomString(10)); - json.insert("_type", "GetTimingScreenTask"); - HttpPostByTypeJsonObject(pHpptClientAll,m_strUrl,json); - -} -void ControlPowerSchedule::OnClickAdd() -{ - QList Item; - Item.append(new QStandardItem(tr("On"))); - Item.append(new QStandardItem("00:00")); - Item.append(new QStandardItem("01:00")); -// Item.append(new QStandardItem(true)); -// Item.append(new QStandardItem(true)); -// Item.append(new QStandardItem(true)); -// Item.append(new QStandardItem(true)); -// Item.append(new QStandardItem(true)); -// Item.append(new QStandardItem(true)); -// Item.append(new QStandardItem(true)); - - Item.at(0)->setTextAlignment(Qt::AlignCenter); - Item.at(1)->setTextAlignment(Qt::AlignCenter); - Item.at(2)->setTextAlignment(Qt::AlignCenter); - m_pModel->appendRow(Item); - //m_lineEidt[i]->installEventFilter(this); - //Item.at(0)->setdsetValidator(new QRegExpValidator(rx, this)); - int i=m_pModel->rowCount()-1; - m_pModel->setData(m_pModel->index(i, 3),true,Qt::UserRole); - m_pModel->setData(m_pModel->index(i, 4),true,Qt::UserRole); - m_pModel->setData(m_pModel->index(i, 5),true,Qt::UserRole); - m_pModel->setData(m_pModel->index(i, 6),true,Qt::UserRole); - m_pModel->setData(m_pModel->index(i, 7),true,Qt::UserRole); - m_pModel->setData(m_pModel->index(i, 8),true,Qt::UserRole); - m_pModel->setData(m_pModel->index(i, 9),true,Qt::UserRole); - - if(m_pModel->rowCount()>0) - { - ui->labelPowerScheduleTip->setVisible(true); - - } - else { - ui->labelPowerScheduleTip->setVisible(false); - - } -} -void ControlPowerSchedule::OnClickImport(){ - QSettings settings; - QString strDir="/"; - if(settings.value("lasOpendFileDlgtDir").isValid()) - { - strDir=settings.value("lasOpendFileDlgtDir").toString(); - } - QFileDialog dlg; - QString strBrightScheduleFile = QFileDialog::getOpenFileName(this, "open file dialog", - strDir, - tr("PowerSchedule (*.pjs)")); - if(strBrightScheduleFile.isEmpty()) - return; - QFile fJson(strBrightScheduleFile); - if(fJson.open(QIODevice::ReadOnly)){ - QJsonDocument jBrightSchedule = QJsonDocument::fromJson(fJson.readAll()); - QJsonObject oTaskPower=jBrightSchedule.object(); - JieXiJsonTaskPower(oTaskPower); - fJson.close(); - } -} -bool ControlPowerSchedule::JieXiJsonTaskPower(QJsonObject oTaskPower) -{ - OnClickClear(); - QJsonArray oSchedules; - oSchedules=oTaskPower["schedules"].toArray(); - if(oSchedules.count()>0) - { - ui->labelPowerScheduleTip->setVisible(true); - } - else - { - ui->labelPowerScheduleTip->setVisible(false); - } - //bool bHaveSchedule=false; - for(int i=0;i Item; - Item.append(new QStandardItem(tr("On"))); - Item.append(new QStandardItem(oSchedule["startTime"].toString())); - Item.append(new QStandardItem(oSchedule["endTime"].toString())); - Item.at(0)->setTextAlignment(Qt::AlignCenter); - Item.at(1)->setTextAlignment(Qt::AlignCenter); - Item.at(2)->setTextAlignment(Qt::AlignCenter); - m_pModel->appendRow(Item); - if(oSchedule["filterType"].toString()=="None") - { - m_pModel->setData(m_pModel->index(i, 3),true,Qt::UserRole); - m_pModel->setData(m_pModel->index(i, 4),true,Qt::UserRole); - m_pModel->setData(m_pModel->index(i, 5),true,Qt::UserRole); - m_pModel->setData(m_pModel->index(i, 6),true,Qt::UserRole); - m_pModel->setData(m_pModel->index(i, 7),true,Qt::UserRole); - m_pModel->setData(m_pModel->index(i, 8),true,Qt::UserRole); - m_pModel->setData(m_pModel->index(i, 9),true,Qt::UserRole); - } - else if(oSchedule["filterType"].toString()=="Week") - { - QJsonArray oWeeks; - oWeeks=oSchedule["weekFilter"].toArray(); - for(int m=0;m<7;m++) - { - bool bHave=false; - for (int j=0;jsetData(m_pModel->index(i, m+3),bHave,Qt::UserRole); - } - - - } - - - - - } - if(oSchedules.count()>0) - return true; - else { - return false; - } -} -void ControlPowerSchedule::OnClickExport(){ - QSettings settings; - QString strDir="/"; - if(settings.value("lasOpendFileDlgtDir").isValid()) { - strDir=settings.value("lasOpendFileDlgtDir").toString(); - } - QFileDialog dlg; - QString saveFileName = dlg.getSaveFileName(this, tr("Save File"), strDir, tr("PowerSchedule (*.pjs)")); - - if( saveFileName.isEmpty() ) - return; - settings.setValue("lasOpendFileDlgtDir",saveFileName); - QJsonObject oTaskPower=GetJsonObjectPowerSchedule(); - QJsonDocument tPowerScheduleJsonDoc; - tPowerScheduleJsonDoc.setObject(oTaskPower); - - QFile f(saveFileName); - if(f.open(QIODevice::WriteOnly)) { - f.write(tPowerScheduleJsonDoc.toJson()); - f.close(); - } -} -void ControlPowerSchedule::OnClickDelete() -{ - if(m_pModel->rowCount()>0) - { - QModelIndexList selected = ui->tableView->selectionModel()->selectedRows(0); - if(selected.count()>0) - m_pModel->removeRows(selected.begin()->row(),selected.count()); - } - if(m_pModel->rowCount()>0) - { - ui->labelPowerScheduleTip->setVisible(true); - } - else { - ui->labelPowerScheduleTip->setVisible(false); - } -} -void ControlPowerSchedule:: OnClickClear() -{ - //QModelIndexList selected = ui->tableView->selectionModel()->selectedRows(0); - - if(m_pModel->rowCount()>0) - { - m_pModel->removeRows(0,m_pModel->rowCount()); - - } - if(m_pModel->rowCount()>0) - { - ui->labelPowerScheduleTip->setVisible(true); - - } - else { - ui->labelPowerScheduleTip->setVisible(false); - - } -} -void ControlPowerSchedule::OnClickApply() { - if(m_pLedlist==nullptr) return; - if(m_pLedlist->count()<=1){ - if(m_pLedCard==nullptr||m_pLedlist->count()==0){ - QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); - return; - } - } - if(m_pModel->rowCount()<=0) { - auto btn = QMessageBox::question(this, tr("Tip Info"), tr("Clear schedule task?")); - if(btn == QMessageBox::Yes) { - QJsonObject json; - json.insert("_id", getRandomString(10)); - json.insert("_type", "CleanTimingScreenTask"); - MACRO_DEFINE_TIPDLG_FUCN(tr("CleanTimingScreenTask"),tr("Success"),tr("failed")) - } - } else { - QJsonObject json; - json.insert("_id", getRandomString(10)); - json.insert("_type", "SetTimingScreenTask"); - QJsonObject oTaskPower=GetJsonObjectPowerSchedule(); - json.insert("screenTask", oTaskPower); - MACRO_DEFINE_TIPDLG_FUCN(tr("SetTimingScreenTask"),tr("Success"),tr("failed")) - } - -} -void ControlPowerSchedule::OnClickReadback() { - if(m_pLedlist==nullptr) return; - if(m_pLedlist->count()<=1) { - if(m_pLedCard==nullptr||m_pLedlist->count()==0) { - QMessageBox::information(this, tr("Tip"),tr("NoSelectedController")); - return; - } - } - QJsonObject json; - json.insert("_id", getRandomString(10)); - json.insert("_type", "GetTimingScreenTask"); - MACRO_DEFINE_TIPDLG_FUCN(tr("GetTimingScreenTask"),tr("Success"),tr("failed")) - -} -void ControlPowerSchedule::OnClickClearSchedule() -{ - if(m_pLedlist==nullptr) - return; - if(m_pLedlist->count()<=1) - { - if(m_pLedCard==nullptr||m_pLedlist->count()==0) - { - QMessageBox::information(this, tr("Tip"),tr("NoSelectedController")); - return; - } - } - auto btn = QMessageBox::question(this, tr("Tip Info"), tr("Clear schedule task?")); - if(btn == QMessageBox::Yes) { - QJsonObject json; - json.insert("_id", getRandomString(10)); - json.insert("_type", "CleanTimingScreenTask"); - MACRO_DEFINE_TIPDLG_FUCN(tr("CleanTimingScreenTask"),tr("Success"),tr("failed")) - } -} -QJsonObject ControlPowerSchedule::GetJsonObjectPowerSchedule() -{ - QJsonObject oTaskPower; - QJsonArray oItems; - - oTaskPower["createDate"] = QJsonValue::Null; - oTaskPower["createBy"] = "alahover"; - oTaskPower["name"] = "TimingScreen"; - - QJsonArray oSchedules; - for(int i=0; irowCount(); i++) - { - - QJsonObject oSchedule; - oSchedule["timeType"] = "Range"; - oSchedule["startTime"] = m_pModel->data(m_pModel->index(i, 1)).toString();; - oSchedule["endTime"] = m_pModel->data(m_pModel->index(i, 2)).toString();; - oSchedule["dateType"] = "All"; - oSchedule["startDate"] = QJsonValue::Null; - oSchedule["endDate"] = QJsonValue::Null; - oSchedule["monthFilter"] = QJsonArray(); - - bool bSun=m_pModel->data(m_pModel->index(i, 3),Qt::UserRole).toBool(); - bool bMon=m_pModel->data(m_pModel->index(i, 4),Qt::UserRole).toBool(); - bool bTur=m_pModel->data(m_pModel->index(i, 5),Qt::UserRole).toBool(); - bool bWed=m_pModel->data(m_pModel->index(i, 6),Qt::UserRole).toBool(); - bool bThu=m_pModel->data(m_pModel->index(i, 7),Qt::UserRole).toBool(); - bool bFri=m_pModel->data(m_pModel->index(i, 8),Qt::UserRole).toBool(); - bool bSat=m_pModel->data(m_pModel->index(i, 9),Qt::UserRole).toBool(); - - - if(bMon && bTur && bWed && bThu && bFri && bSat && bSun) - { - oSchedule["filterType"] = "None"; - oSchedule["weekFilter"] = QJsonArray(); - - } - else { - oSchedule["filterType"] = "Week"; - QJsonArray tempArray; - if( bSun) - { - tempArray.append(0); - } - if(bMon) - { - tempArray.append(1); - } - if(bTur) - { - tempArray.append(2); - } - if( bWed) - { - tempArray.append(3); - } - if( bThu) - { - tempArray.append(4); - } - if( bFri) - { - tempArray.append(5); - } - if( bSat) - { - tempArray.append(6); - } - - - oSchedule["weekFilter"] = tempArray; - - } - - - oSchedules.append(oSchedule); - } - - oTaskPower["schedules"] = oSchedules; - return oTaskPower; - -} - -void ControlPowerSchedule::DeletePostingDlg() -{ - if(m_PostingDlg!=nullptr) - { - delete m_PostingDlg; - m_PostingDlg=nullptr; - } -} diff --git a/LedOK/device/controlpowerschedule.h b/LedOK/device/controlpowerschedule.h deleted file mode 100644 index 1222321..0000000 --- a/LedOK/device/controlpowerschedule.h +++ /dev/null @@ -1,77 +0,0 @@ -#ifndef CONTROLPOWERSCHEDULE_H -#define CONTROLPOWERSCHEDULE_H - -#include -#include -#include -#include -#include -#include -namespace Ui { -class ControlPowerSchedule; -} - -class ControlPowerSchedule : public QWidget -{ - Q_OBJECT - -public: - explicit ControlPowerSchedule(QWidget *parent = nullptr,QList *m_pLedlist=nullptr); - ~ControlPowerSchedule(); - void refreshLable(); -private: - Ui::ControlPowerSchedule *ui; -protected slots: - void OnClickAdd(); - void OnClickImport(); - void OnClickExport(); - void OnClickDelete(); - void OnClickClear(); - void OnClickApply(); - void OnClickReadback(); - void OnClickClearSchedule(); - //类似的控制操作信号和槽函数和变量定义 - signals: - void sigSend(QJsonObject &,QString); - void sigHaveSchedule(bool); - - protected slots: - void DeletePostingDlg(); - void OnProHttpResponse(QString url, QString postMD5, QByteArray data); - void OnProHttpResponseAll(QString url, QString postMD5, QByteArray data); - void onSelectedDeviceList(QList *); - void onReadbackAllThisPage(); - void OnControlTypeSwitchIndexChanged(int index); - private: - QList *m_pLedlist=nullptr; - LedCard *m_pLedCard = nullptr; - LedCard *m_oldLedlist = nullptr; - HpptClient *pHpptClient = nullptr; - HpptClient *pHpptClientAll = nullptr; - QString m_strUrl=""; - LoEmptyDialog * m_PostingDlg=nullptr; - QTimer *m_pGetAskTimer=nullptr; - bool m_bSelected=false; - QStandardItemModel * m_pModel; - bool JieXiJsonTaskPower(QJsonObject oTaskPower); - QJsonObject GetJsonObjectPowerSchedule(); - - -}; -class ReadOnlyDelegate: public QStyledItemDelegate -{ - Q_OBJECT -public: - ReadOnlyDelegate(QWidget *parent = nullptr):QStyledItemDelegate(parent) - {} - - QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option, -const QModelIndex &index) const override //final - { - Q_UNUSED(parent) - Q_UNUSED(option) - Q_UNUSED(index) - return nullptr; - } -}; -#endif // CONTROLPOWERSCHEDULE_H diff --git a/LedOK/device/controlpowerschedule.ui b/LedOK/device/controlpowerschedule.ui deleted file mode 100644 index 22d0305..0000000 --- a/LedOK/device/controlpowerschedule.ui +++ /dev/null @@ -1,255 +0,0 @@ - - - ControlPowerSchedule - - - - 0 - 0 - 422 - 300 - - - - Form - - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - - Edit area - - - - - - - - 10 - - - 0 - - - - - - 60 - 30 - - - - Add - - - - - - - - 60 - 30 - - - - Delete - - - - - - - - 60 - 30 - - - - Clear - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 30 - - - - Import - - - - - - - - 0 - 30 - - - - Export - - - - - - - - - It is power off state outside the schedule time period - - - - - - - background-color: #FFFFFF; - - - - - - - - - - - - Send command - - - - - - 0 - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 60 - 30 - - - - Apply - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 30 - - - - Clear Schedule - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 30 - - - - Readback - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - - - - - diff --git a/LedOK/device/controlpowerwidget.cpp b/LedOK/device/controlpowerwidget.cpp deleted file mode 100644 index a689294..0000000 --- a/LedOK/device/controlpowerwidget.cpp +++ /dev/null @@ -1,154 +0,0 @@ -#include "controlpowerwidget.h" -#include "gutil/qgui.h" -#include "globaldefine.h" -#include "base/waitingdlg.h" -#include "tools.h" -#include - -ControlPowerWidget::ControlPowerWidget(QWidget *parent, QList *list) : QWidget(parent) { - auto vBox = new VBox(this); - - lbScreenCfg = new QLabel; - lbScreenCfg->setAlignment(Qt::AlignCenter); - vBox->addWidget(lbScreenCfg); - - auto hBox = new HBox(vBox); - hBox->addStretch(); - - fdManual = new QRadioButton; - hBox->addWidget(fdManual); - hBox->addSpacing(40); - - fdSchedule = new QRadioButton; - hBox->addWidget(fdSchedule); - hBox->addStretch(); - - auto stack = new QStackedLayout(vBox); - { - auto vBox = new VBox(stack); - vBox->addSpacing(20); - - auto hBox = new HBox(vBox); - hBox->addStretch(); - - lbScreen = new QLabel; - hBox->addWidget(lbScreen); - - fdScreen = new SwitchControl; - fdScreen->setMinimumSize(QSize(80, 33)); - fdScreen->setSliderColor(QColor(0, 0, 0), QColor(0, 160, 230)); - fdScreen->setBgColor(QColor(200,200,200), QColor(0x00cc00)); - fdScreen->setTextColor(QColor(100,100,100), QColor(0, 160, 230)); - connect(fdScreen, &SwitchControl::checkedChanged, this, [this](bool checked) { - if(gSelCards->isEmpty()) { - QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); - return; - } - QJsonObject json; - json.insert("_id", "SetScreenOn"); - json.insert("_type", "SetScreenOn"); - json.insert("on", checked); - if(gSelCards->count() == 1) { - auto waitingDlg = new WaitingDlg(this, (checked ? tr("SetScreenOn") : tr("SetScreenOff"))+" ..."); - Def_CtrlReqPre - connect(reply, &QNetworkReply::finished, this, [=] { - Def_CtrlSetReqAfter - }); - } else { - if(checked) foreach(auto card, *gSelCards) { - Def_CtrlSetMulti(tr("SetScreenOn")) - } - else foreach(auto card, *gSelCards) { - Def_CtrlSetMulti(tr("SetScreenOff")) - } - } - }); - hBox->addWidget(fdScreen); - hBox->addStretch(); - - btnScreenGet = new QPushButton; - btnScreenGet->setMinimumSize(QSize(60, 30)); - btnScreenGet->setProperty("ssType", "progManageTool"); - connect(btnScreenGet, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { - QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); - return; - } - QJsonObject json; - json.insert("_id", "IsScreenOn"); - json.insert("_type", "IsScreenOn"); - if(gSelCards->count() == 1) { - auto waitingDlg = new WaitingDlg(this, tr("IsScreenOn")+" ..."); - Def_CtrlReqPre - connect(reply, &QNetworkReply::finished, this, [this, reply, waitingDlg] { - Def_CtrlSingleGetReply - waitingDlg->success(); - fdScreen->setCheckedStatus(json["on"].toBool()); - }); - } else { - foreach(auto card, *gSelCards) { - auto reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); - connect(reply, &QNetworkReply::finished, card, [=] { - QJsonDocument json; - QString err = checkReplyForJson(reply, &json); - if(err.isEmpty()) err = json["on"].toBool() ? tr("On") : tr("Off"); - gFdResInfo->append(card->m_strCardId+" "+tr("IsScreenOn")+" "+err); - }); - } - } - }); - vBox->addWidget(btnScreenGet, 0, Qt::AlignCenter); - vBox->addStretch(); - } - m_pSchedule = new ControlPowerSchedule(this, list); - connect(m_pSchedule, &ControlPowerSchedule::sigHaveSchedule, this, [=](bool b) { - if(b) fdSchedule->setChecked(true); - else fdManual->setChecked(true); - }); - stack->addWidget(m_pSchedule); - - connect(fdSchedule, &QRadioButton::toggled, stack, &QStackedLayout::setCurrentIndex); - fdManual->setChecked(true); - - connect(gDevicePanel, &DevicePanel::sigSelectedDeviceList, this, [this] { - if(isVisible()) init(); - }); - transUi(); -} - -void ControlPowerWidget::showEvent(QShowEvent *event) { - QWidget::showEvent(event); - init(); -} -void ControlPowerWidget::init() { - bool isSingle = gSelCards->count()==1; - if(! isSingle) return; - auto card = gSelCards->at(0); - - QJsonObject json; - json.insert("_id", "IsScreenOn"); - json.insert("_type", "IsScreenOn"); - auto reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); - connect(reply, &QNetworkReply::finished, this, [this, reply] { - QJsonDocument json; - QString err = checkReplyForJson(reply, &json); - if(! err.isEmpty()) return; - fdScreen->setCheckedStatus(json["on"].toBool()); - }); -} - -void ControlPowerWidget::changeEvent(QEvent *event) { - QWidget::changeEvent(event); - if(event->type() == QEvent::LanguageChange) transUi(); -} -void ControlPowerWidget::transUi() { - lbScreenCfg->setText(tr("Power Configuration")); - fdManual->setText(tr("Manual")); - fdSchedule->setText(tr("Schedule")); - - lbScreen->setText(tr("Power")); - fdScreen->setText(tr("Off"), tr("On")); - btnScreenGet->setText(tr("Readback")); - - m_pSchedule->refreshLable(); -} diff --git a/LedOK/device/controlpowerwidget.h b/LedOK/device/controlpowerwidget.h deleted file mode 100644 index 04e507b..0000000 --- a/LedOK/device/controlpowerwidget.h +++ /dev/null @@ -1,29 +0,0 @@ -#ifndef CONTROLPOWERWIDGET_H -#define CONTROLPOWERWIDGET_H - -#include -#include -#include - -class ControlPowerWidget : public QWidget { - Q_OBJECT -public: - explicit ControlPowerWidget(QWidget *parent = nullptr,QList *m_pLedlist=nullptr); -protected: - void showEvent(QShowEvent *event) override; - void init(); - void changeEvent(QEvent *) override; - void transUi(); -private: - ControlPowerSchedule *m_pSchedule=nullptr; - - QLabel *lbScreenCfg; - QRadioButton *fdManual; - QRadioButton *fdSchedule; - - QLabel *lbScreen; - SwitchControl *fdScreen; - QPushButton *btnScreenGet; -}; - -#endif // CONTROLPOWERWIDGET_H diff --git a/LedOK/device/controltestwidget.cpp b/LedOK/device/controltestwidget.cpp deleted file mode 100644 index dfb96b1..0000000 --- a/LedOK/device/controltestwidget.cpp +++ /dev/null @@ -1,545 +0,0 @@ -#include "controltestwidget.h" -#include "ui_controltestwidget.h" -#include "base/x_uimsgboxok.h" -#include "QFileDialog" -#include "QDir" -#include -#include -#include -#include -#include -#include -#include "tools.h" -ControlTestWidget::ControlTestWidget(QWidget *parent,QList *list) : - QWidget(parent), - ui(new Ui::ControlTestWidget) -{ - m_pLedlist=list; - ui->setupUi(this); - refreshLable(); -setStyleSheet(css); - ui->pushButtonStartLine->setProperty("ssType", "progManageTool"); - ui->pushButtonStartGray->setProperty("ssType", "progManageTool"); - ui->pushButtonStartColor->setProperty("ssType", "progManageTool"); - ui->pushButtonStopTest->setProperty("ssType", "progManageTool"); - ui->pushButton->setProperty("ssType", "progManageTool"); - ui->pushButton_2->setProperty("ssType", "progManageTool"); - ui->pushButton_3->setProperty("ssType", "progManageTool"); - ui->pushButton_4->setProperty("ssType", "progManageTool"); - ui->pushButton_5->setProperty("ssType", "progManageTool"); - ui->pushButton_6->setProperty("ssType", "progManageTool"); - ui->pushButton_7->setProperty("ssType", "progManageTool"); - ui->pushButton_8->setProperty("ssType", "progManageTool"); - ui->pushButton_9->setProperty("ssType", "progManageTool"); - ui->pushButton_10->setProperty("ssType", "progManageTool"); - ui->pushButton_11->setProperty("ssType", "progManageTool"); - ui->pushButton_12->setProperty("ssType", "progManageTool"); - ui->pushButton_13->setProperty("ssType", "progManageTool"); - - ui->spinBoxLineSpeed->setValue(10); - ui->spinBoxLineDistance->setValue(15); - ui->spinBoxGraySpeed->setValue(10); - ui->spinBoxGrayValue->setValue(0); - ui->radioButtonWhite->setChecked(true); - ui->radioButton_White->setChecked(true); - ui->checkBoxHorizontal->setChecked(true); - ui->checkBoxVertical->setChecked(true); - ui->checkBoxSlash->setChecked(true); - ui->checkBox_red->setChecked(true); - ui->checkBox_green->setChecked(true); - ui->checkBox_blue->setChecked(true); - ui->checkBox_white->setChecked(true); - - - connect(ui->pushButtonStartLine,SIGNAL(clicked()),this,SLOT(OnStartTestLine())); - connect(ui->pushButtonStartGray,SIGNAL(clicked()),this,SLOT(OnStartTestGray())); - connect(ui->pushButtonStartColor,SIGNAL(clicked()),this,SLOT(OnStartTestColor())); - connect(ui->pushButtonStopTest,SIGNAL(clicked()),this,SLOT(OnStopTest())); - - connect(ui->pushButton,SIGNAL(clicked()),this,SLOT(OnpushButton1())); - connect(ui->pushButton_2,SIGNAL(clicked()),this,SLOT(OnpushButton2())); - connect(ui->pushButton_3,SIGNAL(clicked()),this,SLOT(OnpushButton3())); - connect(ui->pushButton_4,SIGNAL(clicked()),this,SLOT(OnpushButton4())); - connect(ui->pushButton_5,SIGNAL(clicked()),this,SLOT(OnpushButton5())); - connect(ui->pushButton_6,SIGNAL(clicked()),this,SLOT(OnpushButton6())); - connect(ui->pushButton_7,SIGNAL(clicked()),this,SLOT(OnpushButton7())); - connect(ui->pushButton_8,SIGNAL(clicked()),this,SLOT(OnpushButton8())); - connect(ui->pushButton_9,SIGNAL(clicked()),this,SLOT(OnpushButton9())); - connect(ui->pushButton_10,SIGNAL(clicked()),this,SLOT(OnpushButton0())); - connect(ui->pushButton_11,SIGNAL(clicked()),this,SLOT(OnpushButtonClear())); - connect(ui->pushButton_12,SIGNAL(clicked()),this,SLOT(OnpushButtonReset())); - connect(ui->pushButton_13,SIGNAL(clicked()),this,SLOT(OnpushButtonAnycast())); - - ui->pushButton_13->setEnabled(false); - - MARCO_DEFINE_CONTROL_FUNC2(parent->parent(),parent) - - connect(this,SIGNAL(sigTcpSend(int)),parent->parent(),SLOT(OnControlTcpSend(int))); - ui->lineEdit->setValidator(new QIntValidator(0, 100, this)); - - -} - -ControlTestWidget::~ControlTestWidget() -{ - delete ui; - if(pHpptClient != nullptr) - { - qDebug() <<"delete pHpptClient in ~NetComm"; - delete pHpptClient; - pHpptClient=nullptr; - } - if(pHpptClientAll != nullptr) - { - qDebug() <<"delete pHpptClientAll in ~NetComm"; - delete pHpptClientAll; - pHpptClientAll=nullptr; - } -} -void ControlTestWidget::refreshLable() -{ - ui->labelTestScreen->setText(tr("Test Screen")); - ui->groupBox->setTitle(tr("Line test")); - ui->radioButtonRed->setText(tr("Red")); - ui->radioButtonGreen->setText(tr("Green")); - ui->radioButtonBlue->setText(tr("Blue")); - ui->radioButtonWhite->setText(tr("White")); - ui->radioButton_red->setText(tr("Red")); - ui->radioButton_Green->setText(tr("Green")); - ui->radioButton_Blue->setText(tr("Blue")); - ui->radioButton_White->setText(tr("White")); - ui->checkBoxVertical->setText(tr("Vertical")); - ui->checkBoxHorizontal->setText(tr("Horizontal")); - ui->checkBoxSlash->setText(tr("Slash")); - ui->label->setText(tr("Speed")); - ui->label_5->setText(tr("ms(>10)")); - ui->checkBoxHorizontal->setText(tr("Horizontal")); - ui->label_2->setText(tr("Line Distance")); - ui->pushButtonStartLine->setText(tr("Test")); - ui->groupBox_2->setTitle(tr("Gradation test")); - ui->checkBoxShowInfo->setText(tr("Only the gray value is displayed")); - ui->checkBox_red->setText(tr("Red")); - ui->checkBox_green->setText(tr("Green")); - ui->checkBox_blue->setText(tr("Blue")); - ui->checkBox_white->setText(tr("White")); - ui->label_3->setText(tr("Speed")); - ui->label_4->setText(tr("GrayValue")); - ui->pushButtonStartGray->setText(tr("Test")); - ui->groupBox_3->setTitle(tr("Color test")); - ui->checkBoxGradient->setText(tr("Gradient")); - ui->radioButton_red->setText(tr("Red")); - ui->radioButton_Green->setText(tr("Green")); - ui->radioButton_Blue->setText(tr("Blue")); - ui->radioButton_White->setText(tr("White")); - ui->pushButtonStopTest->setText(tr("Stop")); - ui->pushButton_11->setText(tr("Clear")); - ui->pushButton_12->setText(tr("Reset")); - ui->pushButton_13->setText(tr("Anycast")); - -} -void ControlTestWidget::OnStartTestLine() -{ - if(m_pLedlist==nullptr) - return; - if(m_pLedlist->count()<=1) - { - if(m_pLedCard==nullptr||m_pLedlist->count()==0) - { - X_UIMsgBoxOk *pDlg=new X_UIMsgBoxOk(tr("Tip"),tr("NoSelectedController"),this,1); - pDlg->exec(); - return; - } - } - - QJsonObject json; - json.insert("_id", getRandomString(10)); - json.insert("_type", "TestScreen"); - json.insert("mode", 1);// 0:停止; 1:斜线; 2:灰度; 3:颜色;4:渐变 - json.insert("speed", ui->spinBoxLineSpeed->value()); - if(ui->radioButtonRed->isChecked()) - json.insert("color", "#FFFF0000"); - else if(ui->radioButtonGreen->isChecked()) - json.insert("color", "#FF00FF00"); - else if(ui->radioButtonBlue->isChecked()) - json.insert("color", "#FF0000FF"); - else - json.insert("color", "#FFFFFFFF"); - - json.insert("interval", ui->spinBoxLineDistance->value()); - json.insert("horizonalLine", ui->checkBoxHorizontal->isChecked()); - json.insert("verticalLine", ui->checkBoxVertical->isChecked()); - json.insert("slantLine", ui->checkBoxSlash->isChecked()); - json.insert("runLimit", ui->spinBoxGrayValue->value()); - json.insert("showInfo", !ui->checkBoxShowInfo->isChecked()); - json.insert("red", ui->checkBox_red->isChecked()); - json.insert("green", ui->checkBox_green->isChecked()); - json.insert("blue", ui->checkBox_blue->isChecked()); - json.insert("white", ui->checkBox_white->isChecked()); - - MACRO_DEFINE_TIPDLG_FUCN(tr("StartTest"),tr("Success"),tr("failed")) - -} -void ControlTestWidget::OnStartTestGray() -{ - if(m_pLedlist==nullptr) - return; - if(m_pLedlist->count()<=1) - { - if(m_pLedCard==nullptr||m_pLedlist->count()==0) - { - X_UIMsgBoxOk *pDlg=new X_UIMsgBoxOk(tr("Tip"),tr("NoSelectedController"),this,1); - pDlg->exec(); - return; - } - } - - QJsonObject json; - json.insert("_id", getRandomString(10)); - json.insert("_type", "TestScreen"); - json.insert("mode", 2);// 0:停止; 1:斜线; 2:灰度; 3:颜色;4:渐变 - json.insert("speed", ui->spinBoxGraySpeed->value()); - // qDebug()<<"speed="<spinBoxGraySpeed->value(); - if(ui->radioButtonRed->isChecked()) - json.insert("color", "#FFFF0000"); - else if(ui->radioButtonGreen->isChecked()) - json.insert("color", "#FF00FF00"); - else if(ui->radioButtonBlue->isChecked()) - json.insert("color", "#FF0000FF"); - else - json.insert("color", "#FFFFFFFF"); - json.insert("interval", ui->spinBoxLineDistance->value()); - json.insert("horizonalLine", ui->checkBoxHorizontal->isChecked()); - json.insert("verticalLine", ui->checkBoxVertical->isChecked()); - json.insert("slantLine", ui->checkBoxSlash->isChecked()); - json.insert("runLimit", ui->spinBoxGrayValue->value()); - json.insert("showInfo", !ui->checkBoxShowInfo->isChecked()); - json.insert("red", ui->checkBox_red->isChecked()); - json.insert("green", ui->checkBox_green->isChecked()); - json.insert("blue", ui->checkBox_blue->isChecked()); - json.insert("white", ui->checkBox_white->isChecked()); - - MACRO_DEFINE_TIPDLG_FUCN(tr("StartTest"),tr("Success"),tr("failed")) - -} -void ControlTestWidget::OnStartTestColor() -{ - if(m_pLedlist==nullptr) - return; - if(m_pLedlist->count()<=1) - { - if(m_pLedCard==nullptr||m_pLedlist->count()==0) - { - X_UIMsgBoxOk *pDlg=new X_UIMsgBoxOk(tr("Tip"),tr("NoSelectedController"),this,1); - pDlg->exec(); - return; - } - } - - QJsonObject json; - json.insert("_id", getRandomString(10)); - json.insert("_type", "TestScreen"); - if(ui->checkBoxGradient->isChecked()) - json.insert("mode", 4);// 0:停止; 1:斜线; 2:灰度; 3:颜色;4:渐变 - else - json.insert("mode", 3);// 0:停止; 1:斜线; 2:灰度; 3:颜色;4:渐变 - json.insert("speed", ui->spinBoxLineSpeed->value()); - if(ui->radioButton_red->isChecked()) - json.insert("color", "#FFFF0000"); - else if(ui->radioButton_Green->isChecked()) - json.insert("color", "#FF00FF00"); - else if(ui->radioButton_Blue->isChecked()) - json.insert("color", "#FF0000FF"); - else - json.insert("color", "#FFFFFFFF"); - - json.insert("interval", ui->spinBoxLineDistance->value()); - json.insert("horizonalLine", ui->checkBoxHorizontal->isChecked()); - json.insert("verticalLine", ui->checkBoxVertical->isChecked()); - json.insert("slantLine", ui->checkBoxSlash->isChecked()); - json.insert("runLimit", ui->spinBoxGrayValue->value()); - json.insert("showInfo", !ui->checkBoxShowInfo->isChecked()); - json.insert("red", ui->checkBox_red->isChecked()); - json.insert("green", ui->checkBox_green->isChecked()); - json.insert("blue", ui->checkBox_blue->isChecked()); - json.insert("white", ui->checkBox_white->isChecked()); - - MACRO_DEFINE_TIPDLG_FUCN(tr("StartTest"),tr("Success"),tr("failed")) - -} -void ControlTestWidget::OnStopTest() -{ - - QJsonObject json; - json.insert("_id", getRandomString(10)); - json.insert("_type", "TestScreen"); - json.insert("mode", 0); - MACRO_DEFINE_TIPDLG_FUCN(tr("StopTest"),tr("Success"),tr("failed")) -} - -void ControlTestWidget::OnpushButton1() -{ - if(ui->lineEdit->text().contains("-")) - ui->lineEdit->clear(); - ui->lineEdit->setText(ui->lineEdit->text()+"1"); - ui->pushButton_13->setEnabled(true); -} -void ControlTestWidget::OnpushButton2() -{ - if(ui->lineEdit->text().contains("-")) - ui->lineEdit->clear(); - ui->lineEdit->setText(ui->lineEdit->text()+"2"); - ui->pushButton_13->setEnabled(true); -} -void ControlTestWidget::OnpushButton3() -{ - if(ui->lineEdit->text().contains("-")) - ui->lineEdit->clear(); - ui->lineEdit->setText(ui->lineEdit->text()+"3"); - ui->pushButton_13->setEnabled(true); -} -void ControlTestWidget::OnpushButton4() -{ - if(ui->lineEdit->text().contains("-")) - ui->lineEdit->clear(); - ui->lineEdit->setText(ui->lineEdit->text()+"4"); - ui->pushButton_13->setEnabled(true); -} -void ControlTestWidget::OnpushButton5() -{ - if(ui->lineEdit->text().contains("-")) - ui->lineEdit->clear(); - ui->lineEdit->setText(ui->lineEdit->text()+"5"); - ui->pushButton_13->setEnabled(true); -} -void ControlTestWidget::OnpushButton6() -{ - if(ui->lineEdit->text().contains("-")) - ui->lineEdit->clear(); - ui->lineEdit->setText(ui->lineEdit->text()+"6"); - ui->pushButton_13->setEnabled(true); -} -void ControlTestWidget::OnpushButton7() -{ - if(ui->lineEdit->text().contains("-")) - ui->lineEdit->clear(); - ui->lineEdit->setText(ui->lineEdit->text()+"7"); - ui->pushButton_13->setEnabled(true); -} -void ControlTestWidget::OnpushButton8() -{ - if(ui->lineEdit->text().contains("-")) - ui->lineEdit->clear(); - ui->lineEdit->setText(ui->lineEdit->text()+"8"); - ui->pushButton_13->setEnabled(true); -} -void ControlTestWidget::OnpushButton9() -{ - if(ui->lineEdit->text().contains("-")) - ui->lineEdit->clear(); - ui->lineEdit->setText(ui->lineEdit->text()+"9"); - ui->pushButton_13->setEnabled(true); -} -void ControlTestWidget::OnpushButton0() -{ - if(ui->lineEdit->text().contains("-")) - ui->lineEdit->clear(); - ui->lineEdit->setText(ui->lineEdit->text()+"0"); - ui->pushButton_13->setEnabled(true); -} -void ControlTestWidget::OnpushButtonClear() -{ - ui->lineEdit->clear(); - ui->pushButton_13->setEnabled(false); -} - -void ControlTestWidget::OnpushButtonReset() -{ - if(m_pLedlist==nullptr) - return; - if(m_pLedCard==nullptr||m_pLedlist->count()==0) - { - X_UIMsgBoxOk *pDlg=new X_UIMsgBoxOk(tr("Tip"),tr("NoSelectedController"),this,1); - pDlg->exec(); - return; - } - int iIndex= ui->lineEdit->text().toInt(); - if(m_pLedlist->count()==1) - { - - SendAnycastCmd(m_pLedCard->m_strCardIp,0); - } - else { - emit sigTcpSend(iIndex); - - } - ui->lineEdit->setText("-"+tr("loopback mode")+"-"); - ui->pushButton_13->setEnabled(false); -} -void ControlTestWidget::OnpushButtonAnycast() -{ - if(m_pLedlist==nullptr) - return; - if(m_pLedCard==nullptr||m_pLedlist->count()==0) - { - X_UIMsgBoxOk *pDlg=new X_UIMsgBoxOk(tr("Tip"),tr("NoSelectedController"),this,1); - pDlg->exec(); - return; - } - int iIndex= ui->lineEdit->text().toInt(); - if(m_pLedlist->count()==1) - { - - SendAnycastCmd(m_pLedCard->m_strCardIp,iIndex); - } - else { - emit sigTcpSend(iIndex); - - } - - - - - - ui->lineEdit->setText(tr("Anycast")+" - "+ui->lineEdit->text()); - ui->pushButton_13->setEnabled(false); -} -void ControlTestWidget::SendAnycastCmd(QString strIp,int iProgramIndex) -{ - - QTcpSocket *send = new QTcpSocket(); - connect(send, SIGNAL(connected()), this, SLOT(connect_sucessful())); - connect(send, SIGNAL(error(QAbstractSocket::SocketError)),this, SLOT(show_error(QAbstractSocket::SocketError))); - send->connectToHost(QHostAddress(strIp),31299); - - ST_ANSY_PROGRAM_PACKET tempStreadPakcet; - tempStreadPakcet.SyncHead[0]=0x7e; - tempStreadPakcet.SyncHead[1]=0x7e; - tempStreadPakcet.SyncHead[2]=0x55; - tempStreadPakcet.ucCommType=0x97; - tempStreadPakcet.iBaoLiu=0; - tempStreadPakcet.iLength=4; - unsigned char uctemp[4]={0}; - uctemp[0]=iProgramIndex; - - memcpy(tempStreadPakcet.pDataBuffer,uctemp,4); - tempStreadPakcet.pDataBuffer[tempStreadPakcet.iLength]=GetCheckCodeIn8(&tempStreadPakcet.ucCommType,tempStreadPakcet.iLength+sizeof(tempStreadPakcet.iBaoLiu)+sizeof(tempStreadPakcet.ucCommType)+sizeof(tempStreadPakcet.iLength)); - int iLenPacket=3*sizeof(unsigned char)+sizeof(char)+sizeof(int)+sizeof(int)+tempStreadPakcet.iLength+sizeof(char);/////除正文外的协议结构大小; - QByteArray databuf = QByteArray(reinterpret_cast(&tempStreadPakcet), iLenPacket); - if(!send->waitForConnected(10000)) //等待连接返回 - { - qDebug()<exec(); - send->close(); - delete send; - return ; - } - send->write(databuf); - if(send->waitForBytesWritten(3000)) - { - QByteArray readBuf=send->read(send->bytesAvailable()); - qDebug()<<"recv anycast success ack"; - if(iProgramIndex==0) - { - X_UIMsgBoxOk *pDlg=new X_UIMsgBoxOk(tr("Tip"),tr("Reset loop mode")+":"+tr("success"),this,1); - pDlg->exec(); - - } - else { - X_UIMsgBoxOk *pDlg=new X_UIMsgBoxOk(tr("Tip"),tr("Anycast")+":"+tr("success"),this,1); - pDlg->exec(); - - } - //emit sigOutputInfo(m_pLedCard->m_strCardId+":"+tr("receive")+"<-"+tr("Anycast")+":"+tr("success")); - } - send->close(); - delete send; - -} -void ControlTestWidget::onSelectedDeviceList(QList *list) -{ - m_pLedlist=list; - MACRO_DEFINE_CONTROL_FUNC3 -} -void ControlTestWidget::OnControlTypeSwitchIndexChanged(int index) -{ - if(index==Setting_Encrypt) - { - m_bSelected=true; - if(m_pLedCard!=nullptr) - onReadbackAllThisPage(); - } - else { - m_bSelected=false; - } -} -void ControlTestWidget::onReadbackAllThisPage() -{ - if(m_pLedlist==nullptr) - return; - if(m_pLedlist->count()!=1) - return; -} -//获取到httpPost的应答,如果参数变化需要出发修改控件item的内容 -void ControlTestWidget::OnProHttpResponse(QString url, QString postMD5, QByteArray data) -{ - Q_UNUSED(postMD5) - //qDebug()<< url + "\r\n"+m_strUrl; - if(url == m_strUrl) - { - QJsonParseError parseJsonErr; - QJsonDocument document = QJsonDocument::fromJson(data,&parseJsonErr); - if(!(parseJsonErr.error == QJsonParseError::NoError)) - { - if(data.size()==0) - qDebug()<<"json is empty"; - else - qDebug()< -#include -#include -#include -namespace Ui { -class ControlTestWidget; -} - -class ControlTestWidget : public QWidget -{ - Q_OBJECT - -public: - explicit ControlTestWidget(QWidget *parent = nullptr,QList *m_pLedlist=nullptr); - ~ControlTestWidget(); - -private: - Ui::ControlTestWidget *ui; -protected slots: - void OnStartTestLine(); - void OnStartTestGray(); - void OnStartTestColor(); - void OnStopTest(); - - void OnpushButton1(); - void OnpushButton2(); - void OnpushButton3(); - void OnpushButton4(); - void OnpushButton5(); - void OnpushButton6(); - void OnpushButton7(); - void OnpushButton8(); - void OnpushButton9(); - void OnpushButton0(); - void OnpushButtonClear(); - void OnpushButtonReset(); - void OnpushButtonAnycast(); - void refreshLable(); - //类似的控制操作信号和槽函数和变量定义 - signals: - void sigTcpSend(int); - void sigSend(QJsonObject &,QString); - protected slots: - void DeletePostingDlg(); - void OnProHttpResponse(QString url, QString postMD5, QByteArray data); - void OnProHttpResponseAll(QString url, QString postMD5, QByteArray data); - void onSelectedDeviceList(QList *); - void onReadbackAllThisPage(); - void OnControlTypeSwitchIndexChanged(int index); - private: - QList *m_pLedlist=nullptr; - LedCard *m_pLedCard = nullptr; - LedCard *m_oldLedlist = nullptr; - HpptClient *pHpptClient = nullptr; - HpptClient *pHpptClientAll = nullptr; - QString m_strUrl=""; - LoEmptyDialog * m_PostingDlg=nullptr; - QTimer *m_pGetAskTimer=nullptr; - bool m_bSelected=false; - void SendAnycastCmd(QString strIp,int iProgramIndex); - -}; - -#endif // CONTROLTESTWIDGET_H diff --git a/LedOK/device/controltestwidget.ui b/LedOK/device/controltestwidget.ui deleted file mode 100644 index c23ae96..0000000 --- a/LedOK/device/controltestwidget.ui +++ /dev/null @@ -1,1016 +0,0 @@ - - - ControlTestWidget - - - - 0 - 0 - 872 - 609 - - - - - 0 - 0 - - - - Form - - - - - - - Arial - 12 - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - - Test Screen - - - Qt::AlignCenter - - - - - - - Qt::Horizontal - - - - - - - true - - - - - 0 - 0 - 832 - 536 - - - - - - - 0 - - - 10 - - - - - 0 - - - 0 - - - - - Line test - - - - 0 - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Red - - - - - - - Green - - - - - - - Blue - - - - - - - White - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Vertical - - - - - - - Slash - - - - - - - Horizontal - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Speed - - - - - - - 99999 - - - - - - - ms(>10) - - - - - - - Qt::Horizontal - - - QSizePolicy::Fixed - - - - 20 - 20 - - - - - - - - Line Distance - - - - - - - 128 - - - - - - - px - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 60 - 30 - - - - - 80 - 16777215 - - - - Test - - - - - - - - - - Gradation test - - - - 0 - - - - - Only the gray value is displayed - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Red - - - - - - - Green - - - - - - - Blue - - - - - - - White - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Speed - - - - - - - - 60 - 0 - - - - 10 - - - 99999 - - - - - - - (>10) - - - - - - - GrayValue - - - - - - - 255 - - - - - - - (0-255) - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 60 - 30 - - - - - 80 - 16777215 - - - - Test - - - - - - - - - - Color test - - - - 0 - - - - - Gradient - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Red - - - - - - - Green - - - - - - - Blue - - - - - - - White - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - 60 - 30 - - - - - 80 - 16777215 - - - - Test - - - - - - - - - - 0 - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 60 - 30 - - - - Stop - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - Qt::Vertical - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - 0 - - - 0 - - - - - - 0 - 36 - - - - - 194 - 16777215 - - - - false - - - color: rgb(0, 255, 0); -background-color: rgb(0, 0, 0); - - - Qt::AlignCenter - - - - - - - QLayout::SetMaximumSize - - - - - - 60 - 0 - - - - - 60 - 30 - - - - 8 - - - - - - - - 60 - 0 - - - - - 60 - 30 - - - - 2 - - - - - - - - 60 - 0 - - - - - 60 - 30 - - - - 3 - - - - - - - - 60 - 0 - - - - - 60 - 30 - - - - 6 - - - - - - - - 60 - 0 - - - - - 60 - 30 - - - - 4 - - - - - - - - 60 - 0 - - - - - 60 - 30 - - - - 5 - - - - - - - - 30 - 30 - - - - - 60 - 0 - - - - - 60 - 30 - - - - 1 - - - - - - - - 60 - 0 - - - - - 60 - 30 - - - - 9 - - - - - - - - 60 - 0 - - - - - 60 - 30 - - - - 7 - - - - - - - - 60 - 0 - - - - - 60 - 30 - - - - 0 - - - - - - - - 60 - 0 - - - - - 60 - 30 - - - - Clear - - - - - - - - 60 - 0 - - - - - 60 - 30 - - - - Reset - - - - - - - - - - 0 - 30 - - - - - 194 - 30 - - - - Anycast - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - - - - - - - diff --git a/LedOK/device/controlvolumeschedule.cpp b/LedOK/device/controlvolumeschedule.cpp deleted file mode 100644 index 4efcdd4..0000000 --- a/LedOK/device/controlvolumeschedule.cpp +++ /dev/null @@ -1,528 +0,0 @@ -#include "controlvolumeschedule.h" -#include "ui_controlvolumeschedule.h" -#include "base/x_uimsgboxok.h" -#include "QFileDialog" -#include "QDir" -#include -#include -#include -#include -#include -#include -#include "QSettings" -#include "base/x_spinboxdelegate.h" -#include "base/x_timeeditdelegate.h" -#include "base/x_checkboxdelegate.h" -#include "tools.h" -ControlVolumeSchedule::ControlVolumeSchedule(QWidget *parent,QList *list) : - QWidget(parent), - ui(new Ui::ControlVolumeSchedule) -{ - m_pLedlist=list; - ui->setupUi(this); - refreshLable(); -setStyleSheet(css); - ui->pushButtonAdd->setProperty("ssType", "progManageTool"); - ui->pushButtonAdd->setFlat(true); - ui->pushButtonDelete->setProperty("ssType", "progManageTool"); - ui->pushButtonDelete->setFlat(true); - ui->pushButtonClear->setProperty("ssType", "progManageTool"); - ui->pushButtonClear->setFlat(true); - ui->pushButtonApply->setProperty("ssType", "progManageTool"); - ui->pushButtonApply->setFlat(true); - ui->pushButtonImport->setProperty("ssType", "progManageTool"); - ui->pushButtonExport->setProperty("ssType", "progManageTool"); - ui->pushButtonReadback->setProperty("ssType", "progManageTool"); - ui->lineEdit->setText("10"); - m_pModel = new QStandardItemModel(this); - m_pModel->setColumnCount(10); - m_pModel->setHeaderData(0,Qt::Horizontal, tr("Volume value")); - m_pModel->setHeaderData(1,Qt::Horizontal, tr("Start Time")); - m_pModel->setHeaderData(2,Qt::Horizontal, tr("End Time")); - m_pModel->setHeaderData(3,Qt::Horizontal, tr("SUN")); - m_pModel->setHeaderData(4,Qt::Horizontal, tr("MON")); - m_pModel->setHeaderData(5,Qt::Horizontal, tr("TUE")); - m_pModel->setHeaderData(6,Qt::Horizontal, tr("WED")); - m_pModel->setHeaderData(7,Qt::Horizontal, tr("THU")); - m_pModel->setHeaderData(8,Qt::Horizontal, tr("FRI")); - m_pModel->setHeaderData(9,Qt::Horizontal, tr("SAT")); - ui->tableView->setModel(m_pModel); - SpinBoxDelegate *pVolumeDelegate=new SpinBoxDelegate(this,1); - ui->tableView->setItemDelegateForColumn(0,pVolumeDelegate); - - X_timeEditDelegate *pStartTimeDelegate=new X_timeEditDelegate(this); - ui->tableView->setItemDelegateForColumn(1,pStartTimeDelegate); - ui->tableView->setItemDelegateForColumn(2,pStartTimeDelegate); - X_CheckBoxDelegate *WeekDelegate=new X_CheckBoxDelegate(this); - ui->tableView->setItemDelegateForColumn(3,WeekDelegate); - ui->tableView->setItemDelegateForColumn(4,WeekDelegate); - ui->tableView->setItemDelegateForColumn(5,WeekDelegate); - ui->tableView->setItemDelegateForColumn(6,WeekDelegate); - ui->tableView->setItemDelegateForColumn(7,WeekDelegate); - ui->tableView->setItemDelegateForColumn(8,WeekDelegate); - ui->tableView->setItemDelegateForColumn(9,WeekDelegate); - - - ui->tableView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch); - // ui->tableView->verticalHeader()->hide(); - ui->tableView->setSelectionBehavior(QAbstractItemView::SelectRows); - ui->tableView->setFocusPolicy(Qt::NoFocus); - - - MARCO_DEFINE_CONTROL_FUNC2(parent->parent()->parent(),parent->parent()) - - connect(ui->pushButtonAdd,SIGNAL(clicked()),this,SLOT(OnClickAdd())); - connect(ui->pushButtonImport,SIGNAL(clicked()),this,SLOT(OnClickImport())); - connect(ui->pushButtonExport,SIGNAL(clicked()),this,SLOT(OnClickExport())); - connect(ui->pushButtonDelete,SIGNAL(clicked()),this,SLOT(OnClickDelete())); - connect(ui->pushButtonClear,SIGNAL(clicked()),this,SLOT(OnClickClear())); - connect(ui->pushButtonApply,SIGNAL(clicked()),this,SLOT(OnClickApply())); - connect(ui->pushButtonReadback,SIGNAL(clicked()),this,SLOT(OnClickReadback())); -} - -ControlVolumeSchedule::~ControlVolumeSchedule() -{ - delete ui; - if(pHpptClient != nullptr) - { - qDebug() <<"delete pHpptClient in ~NetComm"; - delete pHpptClient; - pHpptClient=nullptr; - } - if(pHpptClientAll != nullptr) - { - qDebug() <<"delete pHpptClientAll in ~NetComm"; - delete pHpptClientAll; - pHpptClientAll=nullptr; - } -} -void ControlVolumeSchedule::refreshLable() -{ - ui->pushButtonAdd->setText(tr("Add")); - ui->pushButtonApply->setText(tr("Apply")); - ui->pushButtonClear->setText(tr("Clear")); - ui->pushButtonDelete->setText(tr("Delete")); - ui->pushButtonImport->setText(tr("Import")); - ui->pushButtonExport->setText(tr("Export")); - - ui->labelVolumeScheduleTip->setText(tr("Default volume tip")); - ui->labelDefalutVolume->setText(tr("Default volume")); - -} - -void ControlVolumeSchedule::onSelectedDeviceList(QList *list) -{ - m_pLedlist=list; - if(m_pLedlist==nullptr) - return; - if(m_pLedlist->count()==1) - { - ui->pushButtonReadback->setEnabled(true); - } - else { - ui->pushButtonReadback->setEnabled(false); - } - MACRO_DEFINE_CONTROL_FUNC3 - -} -//获取到httpPost的应答,如果参数变化需要出发修改控件item的内容 -void ControlVolumeSchedule::OnProHttpResponse(QString url, QString postMD5, QByteArray data) -{ - Q_UNUSED(postMD5) - //qDebug()<< url + "\r\n"+m_strUrl; - if(url == m_strUrl) - { - QJsonParseError parseJsonErr; - QJsonDocument document = QJsonDocument::fromJson(data,&parseJsonErr); - if(!(parseJsonErr.error == QJsonParseError::NoError)) - { - if(data.size()==0) - qDebug()<<"json is empty"; - else - qDebug()<count()!=1) - return; - QJsonObject json; - json.insert("_id", getRandomString(10)); - json.insert("_type", "GetAutoVolumeTask"); - HttpPostByTypeJsonObject(pHpptClientAll,m_strUrl,json); - -} -void ControlVolumeSchedule::OnClickAdd() -{ - QList Item; - Item.append(new QStandardItem(tr("10"))); - Item.append(new QStandardItem("00:00")); - Item.append(new QStandardItem("01:00")); -// Item.append(new QStandardItem(true)); -// Item.append(new QStandardItem(true)); -// Item.append(new QStandardItem(true)); -// Item.append(new QStandardItem(true)); -// Item.append(new QStandardItem(true)); -// Item.append(new QStandardItem(true)); -// Item.append(new QStandardItem(true)); - - Item.at(0)->setTextAlignment(Qt::AlignCenter); - Item.at(1)->setTextAlignment(Qt::AlignCenter); - Item.at(2)->setTextAlignment(Qt::AlignCenter); - m_pModel->appendRow(Item); - //m_lineEidt[i]->installEventFilter(this); - //Item.at(0)->setdsetValidator(new QRegExpValidator(rx, this)); - int i=m_pModel->rowCount()-1; - m_pModel->setData(m_pModel->index(i, 3),true,Qt::UserRole); - m_pModel->setData(m_pModel->index(i, 4),true,Qt::UserRole); - m_pModel->setData(m_pModel->index(i, 5),true,Qt::UserRole); - m_pModel->setData(m_pModel->index(i, 6),true,Qt::UserRole); - m_pModel->setData(m_pModel->index(i, 7),true,Qt::UserRole); - m_pModel->setData(m_pModel->index(i, 8),true,Qt::UserRole); - m_pModel->setData(m_pModel->index(i, 9),true,Qt::UserRole); - - if(m_pModel->rowCount()>0) - { - ui->labelVolumeScheduleTip->setVisible(true); - } - else { - ui->labelVolumeScheduleTip->setVisible(false); - } -} -void ControlVolumeSchedule::OnClickImport() { - QSettings settings; - QString strDir="/"; - if(settings.value("lasOpendFileDlgtDir").isValid()) - { - strDir=settings.value("lasOpendFileDlgtDir").toString(); - } - QFileDialog dlg; - QString strBrightScheduleFile = QFileDialog::getOpenFileName(this, "open file dialog", - strDir, - tr("Volume Schedule (*.vols)")); - if(strBrightScheduleFile.isEmpty()) - return; - QFile fJson(strBrightScheduleFile); - if(fJson.open(QIODevice::ReadOnly)){ - QJsonDocument jBrightSchedule = QJsonDocument::fromJson(fJson.readAll()); - QJsonObject oTaskVolume=jBrightSchedule.object(); - JieXiJsonTaskVolume(oTaskVolume); - fJson.close(); - } -} -bool ControlVolumeSchedule::JieXiJsonTaskVolume(QJsonObject oTaskVolume) -{ - OnClickClear(); - QJsonArray items; - QString strDefaultVolume=QString::number(oTaskVolume["defaultVolume"].toInt()); - if(!strDefaultVolume.isEmpty()) - ui->lineEdit->setText(strDefaultVolume); - items=oTaskVolume["items"].toArray(); - for(int i=0;i Item; - Item.append(new QStandardItem(QString::number(item["volume"].toInt()))); - Item.append(new QStandardItem(oSchedule["startTime"].toString())); - Item.append(new QStandardItem(oSchedule["endTime"].toString())); - - Item.at(0)->setTextAlignment(Qt::AlignCenter); - Item.at(1)->setTextAlignment(Qt::AlignCenter); - Item.at(2)->setTextAlignment(Qt::AlignCenter); - //m_lineEidt[i]->installEventFilter(this); - //Item.at(0)->setdsetValidator(new QRegExpValidator(rx, this)); - m_pModel->appendRow(Item); - if(oSchedule["filterType"].toString()=="None") - { - m_pModel->setData(m_pModel->index(i, 3),true,Qt::UserRole); - m_pModel->setData(m_pModel->index(i, 4),true,Qt::UserRole); - m_pModel->setData(m_pModel->index(i, 5),true,Qt::UserRole); - m_pModel->setData(m_pModel->index(i, 6),true,Qt::UserRole); - m_pModel->setData(m_pModel->index(i, 7),true,Qt::UserRole); - m_pModel->setData(m_pModel->index(i, 8),true,Qt::UserRole); - m_pModel->setData(m_pModel->index(i, 9),true,Qt::UserRole); - } - else if(oSchedule["filterType"].toString()=="Week") - { - QJsonArray oWeeks; - oWeeks=oSchedule["weekFilter"].toArray(); - for(int m=0;m<7;m++) - { - bool bHave=false; - for (int j=0;jsetData(m_pModel->index(i, m+3),bHave,Qt::UserRole); - } - } - } - if(items.count()>0) - return true; - else { - return false; - } -} -void ControlVolumeSchedule::OnClickExport() { - QSettings settings; - QString strDir="/"; - if(settings.value("lasOpendFileDlgtDir").isValid()) { - strDir=settings.value("lasOpendFileDlgtDir").toString(); - } - QFileDialog dlg; - QString saveFileName = dlg.getSaveFileName(this, tr("Save File"), strDir, tr("Volume Schedule (*.vols)")); - - if( saveFileName.isEmpty() ) - return; - settings.setValue("lasOpendFileDlgtDir",saveFileName); - QJsonObject oTaskSync=GetJsonObjectVolumeSchedule(); - QJsonDocument tSyncScheduleJsonDoc; - tSyncScheduleJsonDoc.setObject(oTaskSync); - - QFile f(saveFileName); - if(f.open(QIODevice::WriteOnly)) { - f.write(tSyncScheduleJsonDoc.toJson()); - f.close(); - } -} -void ControlVolumeSchedule::OnClickDelete() -{ - if(m_pModel->rowCount()>0) - { - QModelIndexList selected = ui->tableView->selectionModel()->selectedRows(0); - if(selected.count()>0) - m_pModel->removeRows(selected.begin()->row(),selected.count()); - - } - if(m_pModel->rowCount()>0) - { - ui->labelVolumeScheduleTip->setVisible(true); - } - else { - ui->labelVolumeScheduleTip->setVisible(false); - } -} -void ControlVolumeSchedule:: OnClickClear() -{ - //QModelIndexList selected = ui->tableView->selectionModel()->selectedRows(0); - - if(m_pModel->rowCount()>0) - m_pModel->removeRows(0,m_pModel->rowCount()); - if(m_pModel->rowCount()>0) - { - ui->labelVolumeScheduleTip->setVisible(true); - } - else { - ui->labelVolumeScheduleTip->setVisible(false); - } - } -void ControlVolumeSchedule::OnClickApply() -{ - if(m_pLedlist==nullptr) - return; - - if(m_pLedlist->count()<=1) - { - if(m_pLedCard==nullptr||m_pLedlist->count()==0) - { - X_UIMsgBoxOk *pDlg=new X_UIMsgBoxOk(tr("Tip"),tr("NoSelectedController"),this,1); - pDlg->exec(); - return; - } - } - QJsonObject json; - json.insert("_id", getRandomString(10)); - json.insert("_type", "SetAutoVolumeTask"); - QJsonObject oTaskVolume=GetJsonObjectVolumeSchedule(); - json.insert("taskVolume", oTaskVolume); - MACRO_DEFINE_TIPDLG_FUCN(tr("SetAutoVolumeTask"),tr("Success"),tr("failed")) - -} -void ControlVolumeSchedule::OnClickReadback() -{ - if(m_pLedlist==nullptr) - return; - if(m_pLedlist->count()<=1) - { - if(m_pLedCard==nullptr||m_pLedlist->count()==0) - { - X_UIMsgBoxOk *pDlg=new X_UIMsgBoxOk(tr("Tip"),tr("NoSelectedController"),this,1); - pDlg->exec(); - return; - } - } - QJsonObject json; - json.insert("_id", getRandomString(10)); - json.insert("_type", "GetAutoVolumeTask"); - MACRO_DEFINE_TIPDLG_FUCN(tr("GetAutoVolumeTask"),tr("Success"),tr("failed")) - -} -QJsonObject ControlVolumeSchedule::GetJsonObjectVolumeSchedule() -{ - QJsonObject oTaskVolume; - QJsonArray oItems; - - oTaskVolume["createDate"] = QJsonValue::Null; - oTaskVolume["createBy"] = "alahover"; - oTaskVolume["defaultVolume"] = ui->lineEdit->text().toInt(); - oTaskVolume["volume"] = ui->lineEdit->text().toInt(); - oTaskVolume["name"] = "TimingVolume"; - - - for(int i=0; irowCount(); i++) - { - QJsonObject oItem; - oItem["volume"] = m_pModel->data(m_pModel->index(i, 0)).toInt(); - - QJsonArray oSchedules; - QJsonObject oSchedule; - oSchedule["timeType"] = "Range"; - oSchedule["startTime"] = m_pModel->data(m_pModel->index(i, 1)).toString();; - oSchedule["endTime"] = m_pModel->data(m_pModel->index(i, 2)).toString();; - oSchedule["dateType"] = "All"; - oSchedule["startDate"] = QJsonValue::Null; - oSchedule["endDate"] = QJsonValue::Null; - oSchedule["monthFilter"] = QJsonArray(); - - bool bSun=m_pModel->data(m_pModel->index(i, 3),Qt::UserRole).toBool(); - bool bMon=m_pModel->data(m_pModel->index(i, 4),Qt::UserRole).toBool(); - bool bTur=m_pModel->data(m_pModel->index(i, 5),Qt::UserRole).toBool(); - bool bWed=m_pModel->data(m_pModel->index(i, 6),Qt::UserRole).toBool(); - bool bThu=m_pModel->data(m_pModel->index(i, 7),Qt::UserRole).toBool(); - bool bFri=m_pModel->data(m_pModel->index(i, 8),Qt::UserRole).toBool(); - bool bSat=m_pModel->data(m_pModel->index(i, 9),Qt::UserRole).toBool(); - - - if(bMon && bTur && bWed && bThu && bFri && bSat && bSun) - { - oSchedule["filterType"] = "None"; - oSchedule["weekFilter"] = QJsonArray(); - - } - else { - oSchedule["filterType"] = "Week"; - QJsonArray tempArray; - if( bSun) - { - tempArray.append(0); - } - if(bMon) - { - tempArray.append(1); - } - if(bTur) - { - tempArray.append(2); - } - if( bWed) - { - tempArray.append(3); - } - if( bThu) - { - tempArray.append(4); - } - if( bFri) - { - tempArray.append(5); - } - if( bSat) - { - tempArray.append(6); - } - - - oSchedule["weekFilter"] = tempArray; - - } - - - oSchedules.append(oSchedule); - oItem["schedules"] = oSchedules; - oItems.append(oItem); - } - - oTaskVolume["items"] = oItems; - return oTaskVolume; - -} -void ControlVolumeSchedule::DeletePostingDlg() -{ - if(m_PostingDlg!=nullptr) - { - delete m_PostingDlg; - m_PostingDlg=nullptr; - } -} diff --git a/LedOK/device/controlvolumeschedule.h b/LedOK/device/controlvolumeschedule.h deleted file mode 100644 index 85cf53f..0000000 --- a/LedOK/device/controlvolumeschedule.h +++ /dev/null @@ -1,60 +0,0 @@ -#ifndef CONTROLVOLUMESCHEDULE_H -#define CONTROLVOLUMESCHEDULE_H - -#include -#include -#include -#include -#include -#include - -namespace Ui { -class ControlVolumeSchedule; -} - -class ControlVolumeSchedule : public QWidget -{ - Q_OBJECT - -public: - explicit ControlVolumeSchedule(QWidget *parent = nullptr,QList *m_pLedlist=nullptr); - ~ControlVolumeSchedule(); - void refreshLable(); -protected slots: - void OnClickAdd(); - void OnClickImport(); - void OnClickExport(); - void OnClickDelete(); - void OnClickClear(); - void OnClickApply(); - void OnClickReadback(); -private: - Ui::ControlVolumeSchedule *ui; - //类似的控制操作信号和槽函数和变量定义 - signals: - void sigSend(QJsonObject &,QString); - void sigHaveSchedule(bool); - protected slots: - void DeletePostingDlg(); - void OnProHttpResponse(QString url, QString postMD5, QByteArray data); - void OnProHttpResponseAll(QString url, QString postMD5, QByteArray data); - void onSelectedDeviceList(QList *); - void onReadbackAllThisPage(); - void OnControlTypeSwitchIndexChanged(int index); - private: - QList *m_pLedlist=nullptr; - LedCard *m_pLedCard = nullptr; - LedCard *m_oldLedlist = nullptr; - HpptClient *pHpptClient = nullptr; - HpptClient *pHpptClientAll = nullptr; - QString m_strUrl=""; - LoEmptyDialog * m_PostingDlg=nullptr; - QTimer *m_pGetAskTimer=nullptr; - bool m_bSelected=false; - QStandardItemModel * m_pModel; - bool JieXiJsonTaskVolume(QJsonObject oTaskVolume); - QJsonObject GetJsonObjectVolumeSchedule(); - -}; - -#endif // CONTROLVOLUMESCHEDULE_H diff --git a/LedOK/device/controlvolumeschedule.ui b/LedOK/device/controlvolumeschedule.ui deleted file mode 100644 index 7bfb54f..0000000 --- a/LedOK/device/controlvolumeschedule.ui +++ /dev/null @@ -1,251 +0,0 @@ - - - ControlVolumeSchedule - - - - 0 - 0 - 708 - 447 - - - - - - - QFrame::StyledPanel - - - QFrame::Raised - - - - - - Defalut volume tip - - - true - - - - - - - - - 10 - - - 0 - - - - - - 60 - 30 - - - - Add - - - - - - - - 60 - 30 - - - - Delete - - - - - - - - 60 - 30 - - - - Clear - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Default Volume - - - - - - - - 30 - 16777215 - - - - background-color: #FFFFFF; - - - - - - - (0-15) - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 30 - - - - Import - - - - - - - - 0 - 30 - - - - Export - - - - - - - - - background-color: #FFFFFF; - - - - - - - 0 - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 60 - 30 - - - - Apply - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - 0 - 30 - - - - Readback - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - - - - - - - diff --git a/LedOK/device/controlvolumewidget.cpp b/LedOK/device/controlvolumewidget.cpp deleted file mode 100644 index eb6aeeb..0000000 --- a/LedOK/device/controlvolumewidget.cpp +++ /dev/null @@ -1,154 +0,0 @@ -#include "controlvolumewidget.h" -#include "gutil/qgui.h" -#include "globaldefine.h" -#include "base/waitingdlg.h" -#include "tools.h" -#include - -ControlVolumeWidget::ControlVolumeWidget(QWidget *parent,QList *list) : QWidget(parent) { - auto vBox = new VBox(this); - - lbVolumeControl = new QLabel; - lbVolumeControl->setAlignment(Qt::AlignCenter); - vBox->addWidget(lbVolumeControl); - - auto hBox = new HBox(vBox); - hBox->addStretch(); - - fdManual = new QRadioButton; - hBox->addWidget(fdManual); - hBox->addSpacing(40); - - fdSchedule = new QRadioButton; - hBox->addWidget(fdSchedule); - hBox->addStretch(); - - auto stack = new QStackedLayout(vBox); - { - auto vBox = new VBox(stack); - vBox->addSpacing(20); - - auto hBox = new HBox(vBox); - hBox->addStretch(); - - lbVolume = new QLabel; - hBox->addWidget(lbVolume); - - fdVolume = new QSlider(Qt::Horizontal); - fdVolume->setTickPosition(QSlider::TicksAbove); - fdVolume->setRange(0, 15); - connect(fdVolume, &QSlider::sliderReleased, this, [=] { - if(gSelCards->isEmpty()) { - QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); - return; - } - QJsonObject json; - json.insert("_id", "SetVolume"); - json.insert("_type", "SetVolume"); - json.insert("volume", fdVolume->value()); - if(gSelCards->count() == 1) { - auto waitingDlg = new WaitingDlg(this, tr("SetVolume")+" ..."); - Def_CtrlReqPre - connect(reply, &QNetworkReply::finished, this, [=] { - Def_CtrlSetReqAfter - }); - } else { - foreach(auto card, *gSelCards) { - Def_CtrlSetMulti(tr("SetVolume")) - } - } - }); - hBox->addWidget(fdVolume); - - auto lbCurVol = new QLabel; - lbCurVol->setMinimumWidth(30); - connect(fdVolume, &QSlider::valueChanged, lbCurVol, (void(QLabel::*)(int))&QLabel::setNum); - hBox->addWidget(lbCurVol); - hBox->addStretch(); - - fdVolumeGet = new QPushButton; - fdVolumeGet->setMinimumSize(QSize(60, 30)); - fdVolumeGet->setProperty("ssType", "progManageTool"); - connect(fdVolumeGet, &QPushButton::clicked, this, [=] { - if(gSelCards->isEmpty()) { - QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); - return; - } - QJsonObject json; - json.insert("_id", "GetVolume"); - json.insert("_type", "GetVolume"); - if(gSelCards->count() == 1) { - auto waitingDlg = new WaitingDlg(this, tr("GetVolume")+" ..."); - Def_CtrlReqPre - connect(reply, &QNetworkReply::finished, this, [this, reply, waitingDlg] { - Def_CtrlSingleGetReply - waitingDlg->success(); - fdVolume->setValue(json["volume"].toInt()); - }); - } else { - foreach(auto card, *gSelCards) { - auto reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); - auto cardId = card->m_strCardId; - connect(reply, &QNetworkReply::finished, this, [reply, cardId] { - QJsonDocument json; - QString err = checkReplyForJson(reply, &json); - if(err.isEmpty()) err = QString::number(json["volume"].toInt()); - gFdResInfo->append(cardId+" "+tr("GetVolume")+" "+err); - }); - } - } - }); - vBox->addWidget(fdVolumeGet, 0, Qt::AlignCenter); - vBox->addStretch(); - } - m_pSchedule = new ControlVolumeSchedule(this, list); - connect(m_pSchedule, &ControlVolumeSchedule::sigHaveSchedule, this, [=](bool b) { - if(b) fdSchedule->setChecked(true); - else fdManual->setChecked(true); - }); - stack->addWidget(m_pSchedule); - - connect(fdSchedule, &QRadioButton::toggled, stack, &QStackedLayout::setCurrentIndex); - fdManual->setChecked(true); - - connect(gDevicePanel, &DevicePanel::sigSelectedDeviceList, this, [this] { - if(isVisible()) init(); - }); - transUi(); -} - -void ControlVolumeWidget::showEvent(QShowEvent *event) { - QWidget::showEvent(event); - init(); -} -void ControlVolumeWidget::init() { - bool isSingle = gSelCards->count()==1; - if(! isSingle) return; - auto card = gSelCards->at(0); - - QJsonObject json; - json.insert("_id", "GetVolume"); - json.insert("_type", "GetVolume"); - auto reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); - connect(reply, &QNetworkReply::finished, this, [this, reply] { - QJsonDocument json; - QString err = checkReplyForJson(reply, &json); - if(! err.isEmpty()) return; - fdVolume->setValue(json["volume"].toInt()); - }); -} - -void ControlVolumeWidget::changeEvent(QEvent *event) { - QWidget::changeEvent(event); - if(event->type() == QEvent::LanguageChange) transUi(); -} -void ControlVolumeWidget::transUi() { - lbVolumeControl->setText(tr("Volume Control")); - fdManual->setText(tr("Manual")); - fdSchedule->setText(tr("Schedule")); - - lbVolume->setText(tr("Volume")); - fdVolumeGet->setText(tr("Readback")); - - m_pSchedule->refreshLable(); -} diff --git a/LedOK/device/controlvolumewidget.h b/LedOK/device/controlvolumewidget.h deleted file mode 100644 index d9a14db..0000000 --- a/LedOK/device/controlvolumewidget.h +++ /dev/null @@ -1,31 +0,0 @@ -#ifndef CONTROLVOLUMEWIDGET_H -#define CONTROLVOLUMEWIDGET_H - -#include -#include -#include "QStackedWidget" -#include - -class ControlVolumeWidget : public QWidget { - Q_OBJECT -public: - explicit ControlVolumeWidget(QWidget *parent = nullptr,QList *m_pLedlist=nullptr); -protected: - void showEvent(QShowEvent *event) override; - void init(); - void changeEvent(QEvent *) override; - void transUi(); - -private: - ControlVolumeSchedule *m_pSchedule; - - QLabel *lbVolumeControl; - QRadioButton *fdManual; - QRadioButton *fdSchedule; - - QLabel *lbVolume; - QSlider *fdVolume; - QPushButton *fdVolumeGet; -}; - -#endif // CONTROLVOLUMEWIDGET_H diff --git a/LedOK/device/ctrladvancedpanel.cpp b/LedOK/device/ctrladvancedpanel.cpp index 7fbd078..1e26ad9 100644 --- a/LedOK/device/ctrladvancedpanel.cpp +++ b/LedOK/device/ctrladvancedpanel.cpp @@ -23,6 +23,7 @@ #include #include #include +#include "devicepanel.h" CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { setFocusPolicy(Qt::StrongFocus); @@ -52,7 +53,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { btnScreenSet = new QPushButton; btnScreenSet->setProperty("ssType", "progManageTool"); connect(btnScreenSet, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } @@ -73,14 +74,14 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { json.insert("_type", "SetScreenSize"); json.insert("width", width.toInt()); json.insert("height", height.toInt()); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("SetScreenSize")); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [=] { Def_CtrlSetReqAfter }); } else { - foreach(auto card, *gSelCards) { + foreach(auto card, gSelCards) { Def_CtrlSetMulti(tr("SetScreenSize")) } } @@ -99,7 +100,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { btnAliasSet = new QPushButton; btnAliasSet->setProperty("ssType", "progManageTool"); connect(btnAliasSet, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } @@ -113,14 +114,14 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { json.insert("_id", "SetCardAlias"); json.insert("_type", "SetCardAlias"); json.insert("alias", QString::fromLatin1(alias.toUtf8().toBase64())); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("SetCardAlias")); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [=] { Def_CtrlSetReqAfter }); } else { - foreach(auto card, *gSelCards) { + foreach(auto card, gSelCards) { Def_CtrlSetMulti(tr("SetCardAlias")) } } @@ -155,7 +156,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { btnWebServerSet = new QPushButton; btnWebServerSet->setProperty("ssType", "progManageTool"); connect(btnWebServerSet, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } @@ -179,14 +180,14 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { json.insert("_type", "SetOnlineAddr"); json.insert("server", serverAddr); json.insert("companyID", companyId); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("SetOnlineAddr")); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [=] { Def_CtrlSetReqAfter }); } else { - foreach(auto card, *gSelCards) { + foreach(auto card, gSelCards) { Def_CtrlSetMulti(tr("SetOnlineAddr")) } } @@ -209,7 +210,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { btnRealtimeServerSet = new QPushButton; btnRealtimeServerSet->setProperty("ssType", "progManageTool"); connect(btnRealtimeServerSet, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } @@ -217,14 +218,14 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { json.insert("_id", "SetRealtimeServer"); json.insert("_type", "SetRealtimeServer"); json.insert("server", fdRealtimeServer->currentText()); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("SetRealtimeServer")+" ..."); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [=] { Def_CtrlSetReqAfter }); } else { - foreach(auto card, *gSelCards) { + foreach(auto card, gSelCards) { Def_CtrlSetMulti(tr("SetRealtimeServer")) } } @@ -234,7 +235,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { btnRealtimeClear = new QPushButton; btnRealtimeClear->setProperty("ssType", "progManageTool"); connect(btnRealtimeClear, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } @@ -243,14 +244,14 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { json.insert("_id", "SetRealtimeServer"); json.insert("_type", "SetRealtimeServer"); json.insert("server", ""); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("ClearRealtimeServer")+" ..."); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [=] { Def_CtrlSetReqAfter }); } else { - foreach(auto card, *gSelCards) { + foreach(auto card, gSelCards) { Def_CtrlSetMulti(tr("ClearRealtimeServer")) } } @@ -280,14 +281,14 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { btnApkCheck = new QPushButton; btnApkCheck->setProperty("ssType", "progManageTool"); connect(btnApkCheck, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } QJsonObject json; json.insert("_id", "CheckSoftVersions"); json.insert("_type", "CheckSoftVersions"); - if(gSelCards->count() != 1) return; + if(gSelCards.count() != 1) return; auto waitingDlg = new WaitingDlg(this, tr("Check Apk Version")); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [this, reply, waitingDlg] { @@ -331,7 +332,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { fdUninstall = new QPushButton; fdUninstall->setProperty("ssType", "progManageTool"); connect(fdUninstall, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } @@ -344,14 +345,14 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { json.insert("_id", "UninstallSoftware"); json.insert("_type", "UninstallSoftware"); json.insert("packageName", pkg); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("UninstallSoftware")); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [=] { Def_CtrlSetReqAfter }); } else { - foreach(auto card, *gSelCards) { + foreach(auto card, gSelCards) { Def_CtrlSetMulti(tr("UninstallSoftware")) } } @@ -361,7 +362,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { btnIsRunning = new QPushButton; btnIsRunning->setProperty("ssType", "progManageTool"); connect(btnIsRunning, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } @@ -374,7 +375,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { json.insert("_id", "IsSoftwareRunning"); json.insert("_type", "IsSoftwareRunning"); json.insert("packageName", pkg); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("Check apk running status")); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [=] { @@ -383,9 +384,9 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { QMessageBox::information(this, tr("Tip"), json["running"].toBool() ? tr("running") : tr("no running")); }); } else { - foreach(auto card, *gSelCards) { - auto reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); - auto cardId = card->m_strCardId; + foreach(auto card, gSelCards) { + auto reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json); + auto cardId = card.id; connect(reply, &QNetworkReply::finished, this, [reply, cardId] { QJsonDocument json; QString err = checkReplyForJson(reply, &json); @@ -402,21 +403,21 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { btnRestart = new QPushButton; btnRestart->setProperty("ssType", "progManageTool"); connect(btnRestart, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } QJsonObject json; json.insert("_id", "RestartAndroid"); json.insert("_type", "RestartAndroid"); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("RestartAndroid")+" ..."); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [=] { Def_CtrlSetReqAfter }); } else { - foreach(auto card, *gSelCards) { + foreach(auto card, gSelCards) { Def_CtrlSetMulti(tr("RestartAndroid")) } } @@ -426,14 +427,14 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { btnClearProg = new QPushButton; btnClearProg->setProperty("ssType", "progManageTool"); connect(btnClearProg, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("Clearing Program")+" ..."); waitingDlg->show(); - auto card = gSelCards->at(0); + auto card = gSelCards[0]; auto tcp = new QTcpSocket(); auto timer = new QTimer(tcp); timer->setSingleShot(true); @@ -475,14 +476,14 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { waitingDlg->close(); QMessageBox::critical(this, tr("Tip"), QString(socketErrKey(err))+" ("+QString::number(err)+") "+tcp->errorString()); }); - tcp->connectToHost(card->m_strCardIp, 3333); + tcp->connectToHost(card.ip, 3333); timer->start(10000); } else { - foreach(auto card, *gSelCards) { + foreach(auto card, gSelCards) { auto tcp = new QTcpSocket(); auto timer = new QTimer(tcp); timer->setSingleShot(true); - auto cardId = card->m_strCardId; + auto cardId = card.id; connect(timer, &QTimer::timeout, tcp, [tcp, cardId] { tcp->abort(); tcp->deleteLater(); @@ -510,7 +511,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { tcp->deleteLater(); gFdResInfo->append(cardId+" "+tr("Clear Program")+" "+QMetaEnum::fromType().valueToKey(err)+" ("+QString::number(err)+") "+tcp->errorString()); }); - tcp->connectToHost(card->m_strCardIp, 3333); + tcp->connectToHost(card.ip, 3333); timer->start(10000); } } @@ -521,15 +522,15 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { btnGetLog = new QPushButton; btnGetLog->setProperty("ssType", "progManageTool"); connect(btnGetLog, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("Getting Log")+" ..."); waitingDlg->show(); - auto card = gSelCards->at(0); - auto reply = NetReq("http://"+card->m_strCardIp+":2016/download?file=logs").timeout(120000).get(); + auto card = gSelCards[0]; + auto reply = NetReq("http://"+card.ip+":2016/download?file=logs").timeout(120000).get(); waitingDlg->connAbort(reply); connect(reply, &QNetworkReply::finished, this, [=] { waitingDlg->close(); @@ -563,7 +564,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { btnTimingRebootSet = new QPushButton; btnTimingRebootSet->setProperty("ssType", "progManageTool"); connect(btnTimingRebootSet, &QPushButton::clicked, this, [=] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } @@ -571,14 +572,14 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { json.insert("_id", "SetTimingReboot"); json.insert("_type", "SetTimingReboot"); json.insert("time", fdRebootTime->text()); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("Setting Timing Reboot")+" ..."); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [=] { Def_CtrlSetReqAfter }); } else { - foreach(auto card, *gSelCards) { + foreach(auto card, gSelCards) { Def_CtrlSetMulti(tr("Set Timing Reboot")) } } @@ -588,14 +589,14 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { btnTimingRebootGet = new QPushButton; btnTimingRebootGet->setProperty("ssType", "progManageTool"); connect(btnTimingRebootGet, &QPushButton::clicked, this, [=] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } QJsonObject json; json.insert("_id", "GetTimingReboot"); json.insert("_type", "GetTimingReboot"); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("Getting Timing Reboot")+" ..."); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [=] { @@ -604,9 +605,9 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { fdRebootTime->setText(json["time"].toString()); }); } else { - foreach(auto card, *gSelCards) { - auto reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); - auto cardId = card->m_strCardId; + foreach(auto card, gSelCards) { + auto reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json); + auto cardId = card.id; connect(reply, &QNetworkReply::finished, this, [reply, cardId] { QJsonDocument json; QString err = checkReplyForJson(reply, &json); @@ -630,7 +631,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { btnM80Set = new QPushButton(); btnM80Set->setProperty("ssType", "progManageTool"); connect(btnM80Set, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } @@ -639,14 +640,14 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { json.insert("_type", "SetSpecialResolution"); json.insert("displayResolution", fdM80Resolu->currentText()); //显示分辨率 json.insert("totalResolution", fdM80Resolu->currentData().toString()); //显示分辨率 - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("SetSpecialResolution")); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [=] { Def_CtrlSetReqAfter }); } else { - foreach(auto card, *gSelCards) { + foreach(auto card, gSelCards) { Def_CtrlSetMulti(tr("SetSpecialResolution")) } } @@ -656,14 +657,14 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { btnM80Refresh = new QPushButton(); btnM80Refresh->setProperty("ssType", "progManageTool"); connect(btnM80Refresh, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } QJsonObject json; json.insert("_id", "GetSpecialResolution"); json.insert("_type", "GetSpecialResolution"); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("GetSpecialResolution")); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [this, reply, waitingDlg] { @@ -672,9 +673,9 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { fdM80Resolu->setCurrentText(json["displayResolution"].toString()); }); } else { - foreach(auto card, *gSelCards) { - auto reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); - auto cardId = card->m_strCardId; + foreach(auto card, gSelCards) { + auto reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json); + auto cardId = card.id; connect(reply, &QNetworkReply::finished, this, [reply, cardId] { QJsonDocument json; QString err = checkReplyForJson(reply, &json); @@ -689,21 +690,21 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { btnM80Restore = new QPushButton(); btnM80Restore->setProperty("ssType", "progManageTool"); connect(btnM80Restore, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } QJsonObject json; json.insert("_id", "CleanDisplayScreenSize"); json.insert("_type", "CleanDisplayScreenSize"); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("CleanDisplayScreenSize")); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [=] { Def_CtrlSetReqAfter }); } else { - foreach(auto card, *gSelCards) { + foreach(auto card, gSelCards) { Def_CtrlSetMulti(tr("CleanDisplayScreenSize")) } } @@ -727,7 +728,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { btnY50Set = new QPushButton; btnY50Set->setProperty("ssType", "progManageTool"); connect(btnY50Set, &QPushButton::clicked, this, [=] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } @@ -747,7 +748,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { auto waitingDlg = new WaitingDlg(this, tr("Uploading")+" ..."); waitingDlg->show(); - NetReq req("http://"+gSelCards->at(0)->m_strCardIp+":2016/upload?type=update_display"); + NetReq req("http://"+gSelCards[0].ip+":2016/upload?type=update_display"); auto reply = req.timeout(120000).type("multipart/form-data; boundary="+Boundary).post(data); waitingDlg->connAbort(reply); connect(reply, &QNetworkReply::finished, this, [=] { @@ -781,7 +782,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { btnDisModeSet = new QPushButton; btnDisModeSet->setProperty("ssType", "progManageTool"); connect(btnDisModeSet, &QPushButton::clicked, this, [=] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")+" ..."); return; } @@ -789,14 +790,14 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { json.insert("_id", "SetDisplayModel"); json.insert("_type", "SetDisplayModel"); json.insert("model", fdDisMode->currentData().toInt()); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("Set Display Mode")); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [=] { Def_CtrlSetReqAfter }); } else { - foreach(auto card, *gSelCards) { + foreach(auto card, gSelCards) { Def_CtrlSetMulti(tr("Set Display Mode")) } } @@ -806,14 +807,14 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { btnDisModeGet = new QPushButton; btnDisModeGet->setProperty("ssType", "progManageTool"); connect(btnDisModeGet, &QPushButton::clicked, this, [=] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } QJsonObject json; json.insert("_id", "GetDisplayModel"); json.insert("_type", "GetDisplayModel"); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("Get Display Mode")+" ..."); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [=] { @@ -822,9 +823,9 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { setCurrentData(fdDisMode, json["result"].toInt()); }); } else { - foreach(auto card, *gSelCards) { - auto reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); - auto cardId = card->m_strCardId; + foreach(auto card, gSelCards) { + auto reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json); + auto cardId = card.id; connect(reply, &QNetworkReply::finished, this, [=] { QJsonDocument json; QString err = checkReplyForJson(reply, &json); @@ -859,7 +860,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { btnScreenOffSet = new QPushButton; btnScreenOffSet->setProperty("ssType", "progManageTool"); connect(btnScreenOffSet, &QPushButton::clicked, this, [=] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } @@ -868,14 +869,14 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { json.insert("_type", "ConfigScreen"); json.insert("index", fdScreenPos->value()); json.insert("x", fdScreenOff->value()); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("Set Screen Offset")+" ..."); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [=] { Def_CtrlSetReqAfter }); } else { - foreach(auto card, *gSelCards) { + foreach(auto card, gSelCards) { Def_CtrlSetMulti(tr("Set Screen Offset")) } } @@ -885,14 +886,14 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { btnScreenOffGet = new QPushButton; btnScreenOffGet->setProperty("ssType", "progManageTool"); connect(btnScreenOffGet, &QPushButton::clicked, this, [=] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } QJsonObject json; json.insert("_id", "GetConfigScreen"); json.insert("_type", "GetConfigScreen"); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("Get Screen Offset")+" ..."); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [=] { @@ -902,9 +903,9 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { fdScreenOff->setValue(json["offsetValue"].toInt()); }); } else { - foreach(auto card, *gSelCards) { - auto reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); - auto cardId = card->m_strCardId; + foreach(auto card, gSelCards) { + auto reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json); + auto cardId = card.id; connect(reply, &QNetworkReply::finished, this, [=] { QJsonDocument json; QString err = checkReplyForJson(reply, &json); @@ -992,7 +993,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { btnBindTaxiIc = new QPushButton; btnBindTaxiIc->setProperty("ssType", "progManageTool"); connect(btnBindTaxiIc, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } @@ -1019,10 +1020,10 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { QJsonObject json; json.insert("action", "InvokeTaxiAppFunction"); json.insert("jsonCommand", jsonCommand); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("InvokeTaxiAppFunction")); waitingDlg->show(); - auto reply = NetReq("http://"+gSelCards->at(0)->m_strCardIp+":3000").timeout(120000).post(json); + auto reply = NetReq("http://"+gSelCards[0].ip+":3000").timeout(120000).post(json); waitingDlg->connAbort(reply); connect(reply, &QNetworkReply::finished, this, [=] { QString err = checkReply(reply); @@ -1047,9 +1048,9 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { waitingDlg->success(); }); } else { - foreach(auto card, *gSelCards) { - auto reply = NetReq("http://"+card->m_strCardIp+":3000").timeout(120000).post(json); - auto cardId = card->m_strCardId; + foreach(auto card, gSelCards) { + auto reply = NetReq("http://"+card.ip+":3000").timeout(120000).post(json); + auto cardId = card.id; connect(reply, &QNetworkReply::finished, this, [reply, cardId] { QString err = checkReply(reply); if(! err.isEmpty()) { @@ -1090,7 +1091,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { btnHighForBusySet = new QPushButton; btnHighForBusySet->setProperty("ssType", "progManageTool"); connect(btnHighForBusySet, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } @@ -1098,14 +1099,14 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { json.insert("_id", "SetHighForBusy"); json.insert("_type", "SetHighForBusy"); json.insert("busyState", fdTopLevelLH->isChecked() ? 0 : 1); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("SetHighForBusy")+" ..."); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [=] { Def_CtrlSetReqAfter }); } else { - foreach(auto card, *gSelCards) { + foreach(auto card, gSelCards) { Def_CtrlSetMulti(tr("SetHighForBusy")) } } @@ -1115,14 +1116,14 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { btnGetTopLevel = new QPushButton; btnGetTopLevel->setProperty("ssType", "progManageTool"); connect(btnGetTopLevel, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } QJsonObject json; json.insert("_id", "GetStateForBusy"); json.insert("_type", "GetStateForBusy"); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("GetStateForBusy")+" ..."); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [this, reply, waitingDlg] { @@ -1132,9 +1133,9 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { else fdHighForBusy->setChecked(true); }); } else { - foreach(auto card, *gSelCards) { - auto reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); - auto cardId = card->m_strCardId; + foreach(auto card, gSelCards) { + auto reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json); + auto cardId = card.id; connect(reply, &QNetworkReply::finished, this, [reply, cardId] { QJsonDocument json; QString err = checkReplyForJson(reply, &json); @@ -1166,7 +1167,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { btnMinBrightSet = new QPushButton; btnMinBrightSet->setProperty("ssType", "progManageTool"); connect(btnMinBrightSet, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } @@ -1174,14 +1175,14 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { json.insert("_id", "SetMinBrightness"); json.insert("_type", "SetMinBrightness"); json.insert("minBrightnessPercentage", fdMinBright->text().toInt()); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("SetMinBrightness")); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [=] { Def_CtrlSetReqAfter }); } else { - foreach(auto card, *gSelCards) { + foreach(auto card, gSelCards) { Def_CtrlSetMulti(tr("SetMinBrightness")) } } @@ -1191,17 +1192,17 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { btnMinBrightGet = new QPushButton(); btnMinBrightGet->setProperty("ssType", "progManageTool"); connect(btnMinBrightGet, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } QJsonObject json; json.insert("_id", "GetMinBrightness"); json.insert("_type", "GetMinBrightness"); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("GetMinBrightness")+" ..."); Def_CtrlReqPre - auto brightLevel = card->BrightnessLevel; + auto brightLevel = card.BrightnessLevel; connect(reply, &QNetworkReply::finished, this, [=] { Def_CtrlSingleGetReply waitingDlg->success(); @@ -1210,10 +1211,10 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { fdMinBright->setText(QString::number(value)); }); } else { - foreach(auto card, *gSelCards) { - auto reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); - auto cardId = card->m_strCardId; - auto brightLevel = card->BrightnessLevel; + foreach(auto card, gSelCards) { + auto reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json); + auto cardId = card.id; + auto brightLevel = card.BrightnessLevel; connect(reply, &QNetworkReply::finished, this, [=] { QJsonDocument json; QString err = checkReplyForJson(reply, &json); @@ -1243,7 +1244,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { btnMaxBrightSet = new QPushButton; btnMaxBrightSet->setProperty("ssType", "progManageTool"); connect(btnMaxBrightSet, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } @@ -1251,14 +1252,14 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { json.insert("_id", "SetMaxBrightness"); json.insert("_type", "SetMaxBrightness"); json.insert("maxBrightnessPercentage", fdMaxBright->text().toInt()); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("SetMaxBrightness")); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [=] { Def_CtrlSetReqAfter }); } else { - foreach(auto card, *gSelCards) { + foreach(auto card, gSelCards) { Def_CtrlSetMulti(tr("SetMaxBrightness")) } } @@ -1268,17 +1269,17 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { btnMaxBrightGet = new QPushButton; btnMaxBrightGet->setProperty("ssType", "progManageTool"); connect(btnMaxBrightGet, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } QJsonObject json; json.insert("_id", "GetMaxBrightness"); json.insert("_type", "GetMaxBrightness"); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("GetMaxBrightness")+" ..."); Def_CtrlReqPre - auto brightLevel = card->BrightnessLevel; + auto brightLevel = card.BrightnessLevel; connect(reply, &QNetworkReply::finished, this, [=] { Def_CtrlSingleGetReply waitingDlg->success(); @@ -1287,10 +1288,10 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { fdMaxBright->setText(QString::number(value)); }); } else { - foreach(auto card, *gSelCards) { - auto reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); - auto cardId = card->m_strCardId; - auto brightLevel = card->BrightnessLevel; + foreach(auto card, gSelCards) { + auto reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json); + auto cardId = card.id; + auto brightLevel = card.BrightnessLevel; connect(reply, &QNetworkReply::finished, this, [=] { QJsonDocument json; QString err = checkReplyForJson(reply, &json); @@ -1322,7 +1323,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { btnSetBack = new QPushButton; btnSetBack->setProperty("ssType", "progManageTool"); connect(btnSetBack, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } @@ -1336,14 +1337,14 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { json.insert("_id", "SetWallpaper"); json.insert("_type", "SetWallpaper"); json.insert("rgb", color.name()); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("Setting Wallpaper")+" ..."); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [=] { Def_CtrlSetReqAfter }); } else { - foreach(auto card, *gSelCards) { + foreach(auto card, gSelCards) { Def_CtrlSetMulti(tr("Set Wallpaper")) } } @@ -1353,21 +1354,21 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { btnSysUpd = new QPushButton; btnSysUpd->setProperty("ssType", "progManageTool"); connect(btnSysUpd, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } QJsonObject json; json.insert("_id", "SystemUpdate"); json.insert("_type", "SystemUpdate"); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("System Updating")+" ..."); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [=] { Def_CtrlSetReqAfter }); } else { - foreach(auto card, *gSelCards) { + foreach(auto card, gSelCards) { Def_CtrlSetMulti(tr("System Update")) } } @@ -1379,7 +1380,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { btnMcuUpd = new QPushButton; btnMcuUpd->setProperty("ssType", "progManageTool"); connect(btnMcuUpd, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } @@ -1397,10 +1398,10 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { data.append("--").append(Boundary).append("\r\nContent-Disposition: form-data; name=\"").append(nameBytes).append("\"; filename=\"").append(nameBytes).append("\"\r\n\r\n").append(fileData).append("\r\n"); data.append("--").append(Boundary).append("--\r\n"); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("MCU Uploading")+" ..."); waitingDlg->show(); - NetReq req("http://"+gSelCards->at(0)->m_strCardIp+":2016/upload?type=mcu_update"); + NetReq req("http://"+gSelCards[0].ip+":2016/upload?type=mcu_update"); auto reply = req.timeout(120000).type("multipart/form-data; boundary="+Boundary).post(data); waitingDlg->connAbort(reply); connect(reply, &QNetworkReply::finished, this, [=] { @@ -1413,9 +1414,9 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { waitingDlg->success(); }); } else { - foreach(auto card, *gSelCards) { - auto cardId = card->m_strCardId; - NetReq req("http://"+card->m_strCardIp+":2016/upload?type=mcu_update"); + foreach(auto card, gSelCards) { + auto cardId = card.id; + NetReq req("http://"+card.ip+":2016/upload?type=mcu_update"); auto reply = req.timeout(120000).type("multipart/form-data; boundary="+Boundary).post(data); connect(reply, &QNetworkReply::finished, this, [=] { QString err = checkReply(reply); @@ -1429,14 +1430,14 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { btnMcuGet = new QPushButton; btnMcuGet->setProperty("ssType", "progManageTool"); connect(btnMcuGet, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } QJsonObject json; json.insert("_id", "SelectMCUVersion"); json.insert("_type", "SelectMCUVersion"); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("Getting MCU Version")+" ..."); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [=] { @@ -1445,9 +1446,9 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { QMessageBox::information(this, tr("Tip"), tr("MCU Version")+": "+json["mcuVersion"].toString()); }); } else { - foreach(auto card, *gSelCards) { - auto reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); - auto cardId = card->m_strCardId; + foreach(auto card, gSelCards) { + auto reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json); + auto cardId = card.id; connect(reply, &QNetworkReply::finished, this, [reply, cardId] { QJsonDocument json; QString err = checkReplyForJson(reply, &json); @@ -1464,7 +1465,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { btnPlayerBackSet = new QPushButton; btnPlayerBackSet->setProperty("ssType", "progManageTool"); connect(btnPlayerBackSet, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } @@ -1472,11 +1473,11 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { if(file.isEmpty()) return; QFileInfo info(file); if(! info.isFile()) return; - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("Setting player background")+" ..."); waitingDlg->btnAbort->hide(); waitingDlg->show(); - auto thread = new PlayerBackSendThread(file, gSelCards->at(0)->m_strCardIp); + auto thread = new PlayerBackSendThread(file, gSelCards[0].ip); connect(thread, &PlayerBackSendThread::emErr, this, [=](QString err) { if(err.isEmpty()) waitingDlg->success(); else { @@ -1486,9 +1487,9 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { }); thread->start(); } else { - foreach(auto card, *gSelCards) { - auto thread = new PlayerBackSendThread(file, card->m_strCardIp); - auto cardId = card->m_strCardId; + foreach(auto card, gSelCards) { + auto thread = new PlayerBackSendThread(file, card.ip); + auto cardId = card.id; connect(thread, &PlayerBackSendThread::emErr, this, [cardId](QString err) { gFdResInfo->append(cardId+" "+tr("Set player background")+" "+(err.isEmpty() ? tr("Success") : err)); }); @@ -1501,14 +1502,14 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { btnPlayerBackClear = new QPushButton; btnPlayerBackClear->setProperty("ssType", "progManageTool"); connect(btnPlayerBackClear, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("Clearing player background")+" ..."); waitingDlg->show(); - auto card = gSelCards->at(0); + auto card = gSelCards[0]; auto tcp = new QTcpSocket(); auto timer = new QTimer(tcp); timer->setSingleShot(true); @@ -1550,14 +1551,14 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { waitingDlg->close(); QMessageBox::critical(this, tr("Tip"), QString(socketErrKey(err))+" ("+QString::number(err)+") "+tcp->errorString()); }); - tcp->connectToHost(card->m_strCardIp, 3333); + tcp->connectToHost(card.ip, 3333); timer->start(10000); } else { - foreach(auto card, *gSelCards) { + foreach(auto card, gSelCards) { auto tcp = new QTcpSocket(); auto timer = new QTimer(tcp); timer->setSingleShot(true); - auto cardId = card->m_strCardId; + auto cardId = card.id; connect(timer, &QTimer::timeout, tcp, [tcp, cardId] { tcp->abort(); tcp->deleteLater(); @@ -1585,7 +1586,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { tcp->deleteLater(); gFdResInfo->append(cardId+" "+tr("Clear player background")+" "+QMetaEnum::fromType().valueToKey(err)+" ("+QString::number(err)+") "+tcp->errorString()); }); - tcp->connectToHost(card->m_strCardIp, 3333); + tcp->connectToHost(card.ip, 3333); timer->start(10000); } } @@ -1622,7 +1623,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { btnGrp->addButton(fdDeg270, 3); connect(btnGrp, &QButtonGroup::idToggled, this, [this](int value, bool checked) { if(! checked) return; - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } @@ -1630,14 +1631,14 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { json.insert("_id", "SetScreenRotation"); json.insert("_type", "SetScreenRotation"); json.insert("rotation", value); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("SetScreenRotation")); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [=] { Def_CtrlSetReqAfter }); } else { - foreach(auto card, *gSelCards) { + foreach(auto card, gSelCards) { Def_CtrlSetMulti(tr("SetScreenRotation")) } } @@ -1714,7 +1715,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { btnBaudSet = new QPushButton; btnBaudSet->setProperty("ssType", "progManageTool"); connect(btnBaudSet, &QPushButton::clicked, this, [this, fdUart, fdBaud] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } @@ -1723,14 +1724,14 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { json.insert("_type", "SetBaudRateByCardType"); json.insert("uartName", fdUart->currentText()); json.insert("baud", fdBaud->text().toInt()); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("Setting Baud Rate")+" ..."); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [=] { Def_CtrlSetReqAfter }); } else { - foreach(auto card, *gSelCards) { + foreach(auto card, gSelCards) { Def_CtrlSetMulti(tr("Set Baud Rate")) } } @@ -1740,7 +1741,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { btnBaudGet = new QPushButton; btnBaudGet->setProperty("ssType", "progManageTool"); connect(btnBaudGet, &QPushButton::clicked, this, [this, fdUart, fdBaud] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } @@ -1748,7 +1749,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { json.insert("_id", "GetBaudRateByCardType"); json.insert("_type", "GetBaudRateByCardType"); json.insert("uartName", fdUart->currentText()); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("Getting Baud Rate")+" ..."); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [=] { @@ -1757,9 +1758,9 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { fdBaud->setText(QString::number(json["baud"].toInt())); }); } else { - foreach(auto card, *gSelCards) { - auto reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); - auto cardId = card->m_strCardId; + foreach(auto card, gSelCards) { + auto reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json); + auto cardId = card.id; connect(reply, &QNetworkReply::finished, this, [reply, cardId] { QJsonDocument json; QString err = checkReplyForJson(reply, &json); @@ -1775,7 +1776,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { fdIsOpenADB = new QCheckBox; connect(fdIsOpenADB, &QCheckBox::toggled, this, [this](bool checked) { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } @@ -1783,14 +1784,14 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { json.insert("_id", "OpenAdb"); json.insert("_type", "OpenAdb"); json.insert("open", checked); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("OpenAdb")+" ..."); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [=] { Def_CtrlSetReqAfter }); } else { - foreach(auto card, *gSelCards) { + foreach(auto card, gSelCards) { Def_CtrlSetMulti(tr("OpenAdb")) } } @@ -1807,7 +1808,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { btnSendCustomJson = new QPushButton; btnSendCustomJson->setProperty("ssType", "progManageTool"); connect(btnSendCustomJson, &QPushButton::clicked, this, [=] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } @@ -1826,14 +1827,14 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { QMessageBox::information(this, tr("Tip"), tr("Json isn't an Object")); return; } - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("AliIotSetting")); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [=] { Def_CtrlSetReqAfter }); } else { - foreach(auto card, *gSelCards) { + foreach(auto card, gSelCards) { Def_CtrlSetMulti(tr("AliIotSetting")) } } @@ -1862,7 +1863,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { btnTraficProtSet = new QPushButton; btnTraficProtSet->setProperty("ssType", "progManageTool"); connect(btnTraficProtSet, &QPushButton::clicked, this, [this, fdTraficProtocol] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } @@ -1870,14 +1871,14 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { json.insert("_id", "SetProtocolType"); json.insert("_type", "SetProtocolType"); json.insert("protocolType", fdTraficProtocol->currentData().toInt()); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("Setting protocol ...")); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [=] { Def_CtrlSetReqAfter }); } else { - foreach(auto card, *gSelCards) { + foreach(auto card, gSelCards) { Def_CtrlSetMulti(tr("Set protocol")) } } @@ -1887,14 +1888,14 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { btnTraficProtGet = new QPushButton; btnTraficProtGet->setProperty("ssType", "progManageTool"); connect(btnTraficProtGet, &QPushButton::clicked, this, [this, fdTraficProtocol] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } QJsonObject json; json.insert("_id", "GetProtocolType"); json.insert("_type", "GetProtocolType"); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("Getting protocol ...")); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [=] { @@ -1903,9 +1904,9 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { setCurrentData(fdTraficProtocol, json["protocolType"].toInt()); }); } else { - foreach(auto card, *gSelCards) { - auto reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); - auto cardId = card->m_strCardId; + foreach(auto card, gSelCards) { + auto reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json); + auto cardId = card.id; connect(reply, &QNetworkReply::finished, this, [reply, cardId, fdTraficProtocol] { QJsonDocument json; QString err = checkReplyForJson(reply, &json); @@ -1948,7 +1949,7 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { btnTraficSet = new QPushButton; btnTraficSet->setProperty("ssType", "progManageTool"); connect(btnTraficSet, &QPushButton::clicked, this, [=] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } @@ -1957,14 +1958,14 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { json.insert("_type", "SetCardMode"); json.insert("serverType", fdServerType->currentData().toInt()); json.insert("port", fdPort->value()); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("Setting card work mode ...")); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [=] { Def_CtrlSetReqAfter }); } else { - foreach(auto card, *gSelCards) { + foreach(auto card, gSelCards) { Def_CtrlSetMulti(tr("Set card work mode")) } } @@ -1974,14 +1975,14 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { btnTraficGet = new QPushButton; btnTraficGet->setProperty("ssType", "progManageTool"); connect(btnTraficGet, &QPushButton::clicked, this, [=] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } QJsonObject json; json.insert("_id", "GetCardMode"); json.insert("_type", "GetCardMode"); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("Getting card work mode ...")); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [=] { @@ -1991,9 +1992,9 @@ CtrlAdvancedPanel::CtrlAdvancedPanel(QWidget *parent) : QWidget(parent) { fdPort->setValue(json["port"].toInt()); }); } else { - foreach(auto card, *gSelCards) { - auto reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); - auto cardId = card->m_strCardId; + foreach(auto card, gSelCards) { + auto reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json); + auto cardId = card.id; connect(reply, &QNetworkReply::finished, this, [=] { QJsonDocument json; QString err = checkReplyForJson(reply, &json); @@ -2042,7 +2043,7 @@ void CtrlAdvancedPanel::init() { } else return; } - bool isSingle = gSelCards->count()==1; + bool isSingle = gSelCards.count()==1; btnApkCheck->setEnabled(isSingle); btnRestart->setEnabled(isSingle); btnGetLog->setEnabled(isSingle); @@ -2052,15 +2053,18 @@ void CtrlAdvancedPanel::init() { grpY50->setVisible(true); return; } - auto card = gSelCards->at(0); - - auto isM80 = card->m_strCardId.startsWith("M8", Qt::CaseInsensitive); + auto card = gSelCards[0]; + fdScreenWidth->setText(QString::number(card.mWidth)); + fdScreenHeight->setText(QString::number(card.mHeight)); + fdAlias->setText(card.alias); + + auto isM80 = card.id.startsWith("M8", Qt::CaseInsensitive); grpM80->setVisible(isM80); if(isM80) { QJsonObject json; json.insert("_id", "GetAllScreenSizeM80"); json.insert("_type", "GetAllScreenSizeM80"); - auto reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); + auto reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json); connect(reply, &QNetworkReply::finished, this, [this, reply] { QJsonDocument json; QString err = checkReplyForJson(reply, &json); @@ -2072,40 +2076,17 @@ void CtrlAdvancedPanel::init() { }); } - auto isY50 = card->m_strCardId.startsWith("st5", Qt::CaseInsensitive) - || card->m_strCardId.startsWith("m5s", Qt::CaseInsensitive) - || card->m_strCardId.startsWith("m6s", Qt::CaseInsensitive) - || card->m_strCardId.startsWith("m7s", Qt::CaseInsensitive) - || card->m_strCardId.startsWith("y5", Qt::CaseInsensitive); + auto isY50 = card.id.startsWith("st5", Qt::CaseInsensitive) + || card.id.startsWith("m5s", Qt::CaseInsensitive) + || card.id.startsWith("m6s", Qt::CaseInsensitive) + || card.id.startsWith("m7s", Qt::CaseInsensitive) + || card.id.startsWith("y5", Qt::CaseInsensitive); grpY50->setVisible(isY50); QJsonObject json; - json.insert("_id", "GetScreenSize"); - json.insert("_type", "GetScreenSize"); - auto reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); - connect(reply, &QNetworkReply::finished, this, [this, reply] { - QJsonDocument json; - QString err = checkReplyForJson(reply, &json); - if(! err.isEmpty()) return; - fdScreenWidth->setText(QString::number(json["width"].toInt())); - fdScreenHeight->setText(QString::number(json["height"].toInt())); - }); - - json = QJsonObject(); - json.insert("_id", "GetCardAlias"); - json.insert("_type", "GetCardAlias"); - reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); - connect(reply, &QNetworkReply::finished, this, [this, reply] { - QJsonDocument json; - QString err = checkReplyForJson(reply, &json); - if(! err.isEmpty()) return; - fdAlias->setText(QString::fromUtf8(QByteArray::fromBase64(json["alias"].toString().toLatin1()))); - }); - - json = QJsonObject(); json.insert("_id", "GetOnlineAddr"); json.insert("_type", "GetOnlineAddr"); - reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); + auto reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json); connect(reply, &QNetworkReply::finished, this, [this, reply] { QJsonDocument json; QString err = checkReplyForJson(reply, &json); @@ -2117,7 +2098,7 @@ void CtrlAdvancedPanel::init() { json = QJsonObject(); json.insert("_id", "GetRealtimeServer"); json.insert("_type", "GetRealtimeServer"); - reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); + reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json); connect(reply, &QNetworkReply::finished, this, [this, reply] { QJsonDocument json; QString err = checkReplyForJson(reply, &json); diff --git a/LedOK/device/ctrlbrightpanel.cpp b/LedOK/device/ctrlbrightpanel.cpp index 74e38ab..8ee9fec 100644 --- a/LedOK/device/ctrlbrightpanel.cpp +++ b/LedOK/device/ctrlbrightpanel.cpp @@ -1,7 +1,9 @@ #include "ctrlbrightpanel.h" #include "base/waitingdlg.h" +#include "gutil/qnetwork.h" #include "globaldefine.h" #include "tools.h" +#include "deviceitem.h" #include "xlsxdocument.h" #include "xlsxworkbook.h" #include @@ -11,6 +13,7 @@ #include #include #include +#include "devicepanel.h" CtrlBrightPanel::CtrlBrightPanel(QWidget *parent) : QWidget(parent) { auto vBox = new VBox(this); @@ -84,7 +87,7 @@ CtrlBrightPanel::CtrlBrightPanel(QWidget *parent) : QWidget(parent) { btnSensiSet->setMinimumSize(60, 30); btnSensiSet->setProperty("ssType", "progManageTool"); connect(btnSensiSet, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } @@ -92,14 +95,14 @@ CtrlBrightPanel::CtrlBrightPanel(QWidget *parent) : QWidget(parent) { json.insert("_id", "SetBrightnessSensitivity"); json.insert("_type", "SetBrightnessSensitivity"); json.insert("sensitivity", fdSensi->value()); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("SetBrightnessSensitivity")+" ..."); Def_CtrlReqPre - connect(reply, &QNetworkReply::finished, card, [=] { + connect(reply, &QNetworkReply::finished, this, [=] { Def_CtrlSetReqAfter }); } else { - foreach(auto card, *gSelCards) { + foreach(auto card, gSelCards) { Def_CtrlSetMulti(tr("SetBrightnessSensitivity")) } } @@ -110,14 +113,14 @@ CtrlBrightPanel::CtrlBrightPanel(QWidget *parent) : QWidget(parent) { btnSensiGet->setMinimumSize(60, 30); btnSensiGet->setProperty("ssType", "progManageTool"); connect(btnSensiGet, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } QJsonObject json; json.insert("_id", "GetBrightnessSensitivity"); json.insert("_type", "GetBrightnessSensitivity"); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("GetBrightnessSensitivity")+" ..."); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [=] { @@ -126,9 +129,9 @@ CtrlBrightPanel::CtrlBrightPanel(QWidget *parent) : QWidget(parent) { fdSensi->setValue(json["sensitivity"].toInt()); }); } else { - foreach(auto card, *gSelCards) { - auto reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); - auto cardId = card->m_strCardId; + foreach(auto card, gSelCards) { + auto reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json); + auto cardId = card.id; connect(reply, &QNetworkReply::finished, this, [reply, cardId] { QJsonDocument json; QString err = checkReplyForJson(reply, &json); @@ -167,7 +170,7 @@ CtrlBrightPanel::CtrlBrightPanel(QWidget *parent) : QWidget(parent) { btnMinBrightSet->setMinimumSize(60, 30); btnMinBrightSet->setProperty("ssType", "progManageTool"); connect(btnMinBrightSet, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } @@ -177,16 +180,16 @@ CtrlBrightPanel::CtrlBrightPanel(QWidget *parent) : QWidget(parent) { json.insert("_type", "SetMinBrightness"); auto brightPercent = fdMinBright->value(); if(! isAdaptToOld) json.insert("minBrightnessPercentage", brightPercent); - if(gSelCards->count() == 1) { - if(isAdaptToOld) json.insert("brightness", (brightPercent * gSelCards->at(0)->BrightnessLevel + 50) / 100); + if(gSelCards.count() == 1) { + if(isAdaptToOld) json.insert("brightness", (brightPercent * gSelCards[0].BrightnessLevel + 50) / 100); auto waitingDlg = new WaitingDlg(this, tr("SetMinBrightness")+" ..."); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [=] { Def_CtrlSetReqAfter }); } else { - foreach(auto card, *gSelCards) { - if(isAdaptToOld) json.insert("brightness", (brightPercent * card->BrightnessLevel + 50) / 100); + foreach(auto card, gSelCards) { + if(isAdaptToOld) json.insert("brightness", (brightPercent * card.BrightnessLevel + 50) / 100); Def_CtrlSetMulti(tr("SetMinBrightness")); } } @@ -197,17 +200,17 @@ CtrlBrightPanel::CtrlBrightPanel(QWidget *parent) : QWidget(parent) { btnMinBrightGet->setMinimumSize(60, 30); btnMinBrightGet->setProperty("ssType", "progManageTool"); connect(btnMinBrightGet, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } QJsonObject json; json.insert("_id", "GetMinBrightness"); json.insert("_type", "GetMinBrightness"); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("GetMinBrightness")+" ..."); Def_CtrlReqPre - auto brightLevel = card->BrightnessLevel; + auto brightLevel = card.BrightnessLevel; connect(reply, &QNetworkReply::finished, this, [=] { Def_CtrlSingleGetReply waitingDlg->success(); @@ -216,10 +219,10 @@ CtrlBrightPanel::CtrlBrightPanel(QWidget *parent) : QWidget(parent) { fdMinBright->setValue(value); }); } else { - foreach(auto card, *gSelCards) { - auto reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); - auto cardId = card->m_strCardId; - auto brightLevel = card->BrightnessLevel; + foreach(auto card, gSelCards) { + auto reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json); + auto cardId = card.id; + auto brightLevel = card.BrightnessLevel; connect(reply, &QNetworkReply::finished, this, [=] { QJsonDocument json; QString err = checkReplyForJson(reply, &json); @@ -264,7 +267,7 @@ CtrlBrightPanel::CtrlBrightPanel(QWidget *parent) : QWidget(parent) { btnUpload->setMinimumSize(60, 30); btnUpload->setProperty("ssType", "progManageTool"); connect(btnUpload, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } @@ -314,14 +317,14 @@ CtrlBrightPanel::CtrlBrightPanel(QWidget *parent) : QWidget(parent) { json.insert("_id", "SensorBrightnessTable"); json.insert("_type", "SensorBrightnessTable"); json.insert("values", values); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("SensorBrightnessTable")); Def_CtrlReqPre; connect(reply, &QNetworkReply::finished, this, [=] { Def_CtrlSetReqAfter; }); } else { - foreach(auto card, *gSelCards) { + foreach(auto card, gSelCards) { Def_CtrlSetMulti(tr("SensorBrightnessTable")); } } @@ -332,7 +335,7 @@ CtrlBrightPanel::CtrlBrightPanel(QWidget *parent) : QWidget(parent) { btnTableGet->setMinimumSize(60, 30); btnTableGet->setProperty("ssType", "progManageTool"); connect(btnTableGet, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } @@ -346,7 +349,7 @@ CtrlBrightPanel::CtrlBrightPanel(QWidget *parent) : QWidget(parent) { QJsonObject json; json.insert("_id", "GetSensorBrightnessTable"); json.insert("_type", "GetSensorBrightnessTable"); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("GetSensorBrightnessTable")); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [this, reply, waitingDlg, card, strSensorType] { @@ -364,7 +367,7 @@ CtrlBrightPanel::CtrlBrightPanel(QWidget *parent) : QWidget(parent) { return; } QString selectFilter = "*.xlsx"; - QString savingFile = QFileDialog::getSaveFileName(this, tr("Save file"), card->m_strCardId + "BrightnessTable.xlsx", "brightness(*.xlsx );", &selectFilter, QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); + QString savingFile = QFileDialog::getSaveFileName(this, tr("Save file"), card.id + "BrightnessTable.xlsx", "brightness(*.xlsx );", &selectFilter, QFileDialog::ShowDirsOnly | QFileDialog::DontResolveSymlinks); if(savingFile.isEmpty()) return; tempQFile.copy(savingFile); QXlsx::Document xlsx(savingFile); @@ -393,14 +396,14 @@ CtrlBrightPanel::CtrlBrightPanel(QWidget *parent) : QWidget(parent) { btnCurBrightGet->setMinimumSize(60, 30); btnCurBrightGet->setProperty("ssType", "progManageTool"); connect(btnCurBrightGet, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } QJsonObject json; json.insert("_id", "GetCurrentSensorBrightness"); json.insert("_type", "GetCurrentSensorBrightness"); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("GetCurrentSensorBrightness")); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [this, reply, waitingDlg, card] { @@ -415,16 +418,16 @@ CtrlBrightPanel::CtrlBrightPanel(QWidget *parent) : QWidget(parent) { waitingDlg->success(); if(json["is485"].toBool()) fdR68->setChecked(true); else fdRL2->setChecked(true); - fdCurBright->setText(QString::number(qRound(json["value"].toInt() * 100.0 / card->BrightnessLevel))+"%"); + fdCurBright->setText(QString::number(qRound(json["value"].toInt() * 100.0 / card.BrightnessLevel))+"%"); }); } else { - foreach(auto card, *gSelCards) { - auto reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); + foreach(auto card, gSelCards) { + auto reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json); connect(reply, &QNetworkReply::finished, this, [reply, card] { QJsonDocument json; QString err = checkReplyForJson(reply, &json); - if(err.isEmpty()) err = (json["is485"].toBool() ? "R60 " : "RL1 ") + QString::number(qRound(json["value"].toInt() * 100.0 / card->BrightnessLevel))+"%"; - gFdResInfo->append(card->m_strCardId+" "+tr("GetCurrentSensorBrightness")+" "+err); + if(err.isEmpty()) err = (json["is485"].toBool() ? "R60 " : "RL1 ") + QString::number(qRound(json["value"].toInt() * 100.0 / card.BrightnessLevel))+"%"; + gFdResInfo->append(card.id+" "+tr("GetCurrentSensorBrightness")+" "+err); }); } } @@ -468,7 +471,7 @@ CtrlBrightPanel::CtrlBrightPanel(QWidget *parent) : QWidget(parent) { btnFixedSet->setMinimumSize(60, 30); btnFixedSet->setProperty("ssType", "progManageTool"); connect(btnFixedSet, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } @@ -478,16 +481,16 @@ CtrlBrightPanel::CtrlBrightPanel(QWidget *parent) : QWidget(parent) { json.insert("_type", "SetBrightness"); auto percent = fdFixedBright->value(); if(! isAdaptToOld) json.insert("brightnessPercentage", percent); - if(gSelCards->count() == 1) { - if(isAdaptToOld) json.insert("brightness", (percent * gSelCards->at(0)->BrightnessLevel + 50) / 100); + if(gSelCards.count() == 1) { + if(isAdaptToOld) json.insert("brightness", (percent * gSelCards[0].BrightnessLevel + 50) / 100); auto waitingDlg = new WaitingDlg(this, tr("SetBrightness")); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [=] { Def_CtrlSetReqAfter }); } else { - foreach(auto card, *gSelCards) { - if(isAdaptToOld) json.insert("brightness", (percent * card->BrightnessLevel + 50) / 100); + foreach(auto card, gSelCards) { + if(isAdaptToOld) json.insert("brightness", (percent * card.BrightnessLevel + 50) / 100); Def_CtrlSetMulti(tr("SetBrightness")) } } @@ -498,14 +501,14 @@ CtrlBrightPanel::CtrlBrightPanel(QWidget *parent) : QWidget(parent) { btnFixedGet->setMinimumSize(60, 30); btnFixedGet->setProperty("ssType", "progManageTool"); connect(btnFixedGet, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } QJsonObject json; json.insert("_id", "GetBrightness"); json.insert("_type", "GetBrightness"); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("GetBrightness")); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [this, reply, waitingDlg, card] { @@ -518,22 +521,32 @@ CtrlBrightPanel::CtrlBrightPanel(QWidget *parent) : QWidget(parent) { return; } waitingDlg->success(); - card->bright = json["brightnessPercentage"].toInt(-1); - if(card->bright==-1) card->bright = qRound(json["brightness"].toInt() * 100.0 / card->BrightnessLevel); - fdFixedBright->setValue(card->bright); + auto bright = json["brightnessPercentage"].toInt(-1); + if(bright==-1) bright = qRound(json["brightness"].toInt() * 100.0 / card.BrightnessLevel); + fdFixedBright->setValue(bright); + auto item = findItem(card.id); + if(item) { + item->mCard.bright = bright; + item->setData(DeviceTable_Brightness, 0, QString::number(bright)+"%"); + } }); } else { - foreach(auto card, *gSelCards) { - auto reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); + foreach(auto card, gSelCards) { + auto reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json); connect(reply, &QNetworkReply::finished, this, [reply, card] { QJsonDocument json; QString err = checkReplyForJson(reply, &json); if(err.isEmpty()) { - auto value = json["brightnessPercentage"].toInt(-1); - if(value==-1) value = qRound(json["brightness"].toInt() * 100.0 / card->BrightnessLevel); - err = QString::number(value)+"%"; + auto bright = json["brightnessPercentage"].toInt(-1); + if(bright==-1) bright = qRound(json["brightness"].toInt() * 100.0 / card.BrightnessLevel); + err = QString::number(bright)+"%"; + auto item = findItem(card.id); + if(item) { + item->mCard.bright = bright; + item->setData(DeviceTable_Brightness, 0, err); + } } - gFdResInfo->append(card->m_strCardId+" "+tr("Brightness")+" "+err); + gFdResInfo->append(card.id+" "+tr("Brightness")+" "+err); }); } } @@ -723,7 +736,7 @@ CtrlBrightPanel::CtrlBrightPanel(QWidget *parent) : QWidget(parent) { btnScheSet->setMinimumSize(QSize(60, 30)); btnScheSet->setProperty("ssType", "progManageTool"); connect(btnScheSet, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } @@ -732,16 +745,16 @@ CtrlBrightPanel::CtrlBrightPanel(QWidget *parent) : QWidget(parent) { json.insert("_id", "SetAutoBrightnessTask"); json.insert("_type", "SetAutoBrightnessTask"); if(! isAdaptToOld) getScheduleJson(json, 0); - if(gSelCards->count() == 1) { - if(isAdaptToOld) getScheduleJson(json, gSelCards->at(0)->BrightnessLevel); + if(gSelCards.count() == 1) { + if(isAdaptToOld) getScheduleJson(json, gSelCards[0].BrightnessLevel); auto waitingDlg = new WaitingDlg(this, tr("SetAutoBrightnessTask")); Def_CtrlReqPre; connect(reply, &QNetworkReply::finished, this, [=] { Def_CtrlSetReqAfter }); } else { - foreach(auto card, *gSelCards) { - if(isAdaptToOld) getScheduleJson(json, card->BrightnessLevel); + foreach(auto card, gSelCards) { + if(isAdaptToOld) getScheduleJson(json, card.BrightnessLevel); Def_CtrlSetMulti(tr("SetAutoBrightnessTask")) } } @@ -754,20 +767,20 @@ CtrlBrightPanel::CtrlBrightPanel(QWidget *parent) : QWidget(parent) { btnScheGet->setMinimumSize(QSize(60, 30)); btnScheGet->setProperty("ssType", "progManageTool"); connect(btnScheGet, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } QJsonObject json; json.insert("_id", "GetAutoBrightnessTask"); json.insert("_type", "GetAutoBrightnessTask"); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("GetAutoBrightnessTask")); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [this, reply, waitingDlg, card] { Def_CtrlSingleGetReply waitingDlg->success(); - restoreScheduleJson(json, card->BrightnessLevel); + restoreScheduleJson(json, card.BrightnessLevel); }); } }); @@ -796,11 +809,12 @@ void CtrlBrightPanel::showEvent(QShowEvent *event) { init(); } void CtrlBrightPanel::init() { - bool isSingle = gSelCards->count()==1; + bool isSingle = gSelCards.count()==1; btnTableGet->setEnabled(isSingle); btnScheGet->setEnabled(isSingle); if(! isSingle) return; - auto card = gSelCards->at(0); + auto card = gSelCards[0]; + fdFixedBright->setValue(card.bright); mSensi = -1; mTask = -1; @@ -808,12 +822,12 @@ void CtrlBrightPanel::init() { QJsonObject json; json.insert("_id", "GetAutoBrightnessTask"); json.insert("_type", "GetAutoBrightnessTask"); - auto reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); + auto reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json); connect(reply, &QNetworkReply::finished, this, [this, reply, card] { QJsonDocument json; QString err = checkReplyForJson(reply, &json); if(! err.isEmpty()) return; - mTask = restoreScheduleJson(json, card->BrightnessLevel); + mTask = restoreScheduleJson(json, card.BrightnessLevel); if(mTask) radioSchedule->setChecked(true); else if(mSensi > 0) radioAuto->setChecked(true); else if(mSensi == 0) radioManual->setChecked(true); @@ -822,7 +836,7 @@ void CtrlBrightPanel::init() { json = QJsonObject(); json.insert("_id", "GetBrightnessSensitivity"); json.insert("_type", "GetBrightnessSensitivity"); - reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); + reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json); connect(reply, &QNetworkReply::finished, this, [this, reply] { QJsonDocument json; QString err = checkReplyForJson(reply, &json); @@ -837,28 +851,15 @@ void CtrlBrightPanel::init() { json = QJsonObject(); json.insert("_id", "GetMinBrightness"); json.insert("_type", "GetMinBrightness"); - reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); + reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json); connect(reply, &QNetworkReply::finished, this, [this, reply, card] { QJsonDocument json; QString err = checkReplyForJson(reply, &json); if(! err.isEmpty()) return; auto value = json["minBrightnessPercentage"].toInt(-1); - if(value==-1) value = qRound(json["brightness"].toInt() * 100.0 / card->BrightnessLevel); + if(value==-1) value = qRound(json["brightness"].toInt() * 100.0 / card.BrightnessLevel); fdMinBright->setValue(value); }); - - json = QJsonObject(); - json.insert("_id", "GetBrightness"); - json.insert("_type", "GetBrightness"); - reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); - connect(reply, &QNetworkReply::finished, this, [this, reply, card] { - QJsonDocument json; - QString err = checkReplyForJson(reply, &json); - if(! err.isEmpty()) return; - card->bright = json["brightnessPercentage"].toInt(-1); - if(card->bright==-1) card->bright = qRound(json["brightness"].toInt() * 100.0 / card->BrightnessLevel); - fdFixedBright->setValue(card->bright); - }); } void CtrlBrightPanel::changeEvent(QEvent *event) { diff --git a/LedOK/device/ctrlbrightpanel.h b/LedOK/device/ctrlbrightpanel.h index b2c47ba..c44a94d 100644 --- a/LedOK/device/ctrlbrightpanel.h +++ b/LedOK/device/ctrlbrightpanel.h @@ -6,7 +6,6 @@ #include #include #include -#include class CtrlBrightPanel : public QWidget { Q_OBJECT diff --git a/LedOK/device/ctrlhdmipanel.cpp b/LedOK/device/ctrlhdmipanel.cpp index 87d0529..188d450 100644 --- a/LedOK/device/ctrlhdmipanel.cpp +++ b/LedOK/device/ctrlhdmipanel.cpp @@ -1,5 +1,6 @@ #include "ctrlhdmipanel.h" #include "gutil/qgui.h" +#include "gutil/qnetwork.h" #include "tools.h" #include "globaldefine.h" #include "base/waitingdlg.h" @@ -7,8 +8,10 @@ #include #include #include +#include +#include "devicepanel.h" -CtrlHdmiPanel::CtrlHdmiPanel(QWidget *parent) : QWidget(parent) { +CtrlHdmiPanel::CtrlHdmiPanel() { auto vBox = new QVBoxLayout(this); lbHdmiCfg = new QLabel; lbHdmiCfg->setAlignment(Qt::AlignCenter); @@ -32,8 +35,7 @@ CtrlHdmiPanel::CtrlHdmiPanel(QWidget *parent) : QWidget(parent) { vBox->addLayout(hBox); - auto stacked = new QStackedLayout; - vBox->addLayout(stacked); + auto stacked = new QStackedLayout(vBox); { auto vBox = new VBox(stacked); vBox->addSpacing(20); @@ -64,7 +66,7 @@ CtrlHdmiPanel::CtrlHdmiPanel(QWidget *parent) : QWidget(parent) { btnSyncSet->setMinimumSize(60, 30); btnSyncSet->setProperty("ssType", "progManageTool"); connect(btnSyncSet, &QPushButton::clicked, this, [=] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } @@ -74,14 +76,14 @@ CtrlHdmiPanel::CtrlHdmiPanel(QWidget *parent) : QWidget(parent) { json.insert("_type", "SyncSwitch"); json.insert("switchOn", (bool)id); if(id) json.insert("number", id); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, id ? tr("SyncSwitch") : tr("AnSyncSwitch")); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [=] { Def_CtrlSetReqAfter }); } else { - foreach(auto card, *gSelCards) { + foreach(auto card, gSelCards) { if(id) { Def_CtrlSetMulti(tr("SyncSwitch")) } else { @@ -97,14 +99,14 @@ CtrlHdmiPanel::CtrlHdmiPanel(QWidget *parent) : QWidget(parent) { btnSyncGet->setMinimumSize(60, 30); btnSyncGet->setProperty("ssType", "progManageTool"); connect(btnSyncGet, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } QJsonObject json; json.insert("_id", "IsSync"); json.insert("_type", "IsSync"); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("IsSync")); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [this, reply, waitingDlg] { @@ -117,9 +119,9 @@ CtrlHdmiPanel::CtrlHdmiPanel(QWidget *parent) : QWidget(parent) { else fdHdmi->setChecked(true); }); } else { - foreach(auto card, *gSelCards) { - auto reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); - auto cardId = card->m_strCardId; + foreach(auto card, gSelCards) { + auto reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json); + auto cardId = card.id; connect(reply, &QNetworkReply::finished, this, [reply, cardId] { QJsonDocument json; QString err = checkReplyForJson(reply, &json); @@ -247,14 +249,14 @@ CtrlHdmiPanel::CtrlHdmiPanel(QWidget *parent) : QWidget(parent) { btnScheSet->setProperty("ssType", "progManageTool"); btnScheSet->setMinimumSize(QSize(60, 30)); connect(btnScheSet, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } QJsonObject json; json.insert("_id", "SetTimingHdmiInTask"); json.insert("_type", "SetTimingHdmiInTask"); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { json.insert("HdmiInTask", getScheduleJson()); auto waitingDlg = new WaitingDlg(this, tr("SetTimingHdmiInTask")); Def_CtrlReqPre; @@ -262,7 +264,7 @@ CtrlHdmiPanel::CtrlHdmiPanel(QWidget *parent) : QWidget(parent) { Def_CtrlSetReqAfter }); } else { - foreach(auto card, *gSelCards) { + foreach(auto card, gSelCards) { json.insert("HdmiInTask", getScheduleJson()); Def_CtrlSetMulti(tr("SetTimingHdmiInTask")) } @@ -275,14 +277,14 @@ CtrlHdmiPanel::CtrlHdmiPanel(QWidget *parent) : QWidget(parent) { btnScheGet->setMinimumSize(QSize(0, 30)); btnScheGet->setProperty("ssType", "progManageTool"); connect(btnScheGet, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } QJsonObject json; json.insert("_id", "GetTimingHdmiInTask"); json.insert("_type", "GetTimingHdmiInTask"); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("GetTimingHdmiInTask")); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [this, reply, waitingDlg] { @@ -297,12 +299,8 @@ CtrlHdmiPanel::CtrlHdmiPanel(QWidget *parent) : QWidget(parent) { hBox->addStretch(); } - auto m_buttonGroup = new QButtonGroup; - m_buttonGroup->addButton(fdManual, 0); - m_buttonGroup->addButton(fdSchedule, 1); - connect(m_buttonGroup, &QButtonGroup::idClicked, stacked, &QStackedLayout::setCurrentIndex); + connect(fdSchedule, &QRadioButton::toggled, stacked, &QStackedLayout::setCurrentIndex); fdManual->setChecked(true); - stacked->setCurrentIndex(0); connect(gDevicePanel, &DevicePanel::sigSelectedDeviceList, this, [this] { if(isVisible()) init(); @@ -316,19 +314,19 @@ void CtrlHdmiPanel::showEvent(QShowEvent *event) { } void CtrlHdmiPanel::init() { - bool isSingle = gSelCards->count()==1; + bool isSingle = gSelCards.count()==1; btnScheGet->setEnabled(isSingle); if(! isSingle) { fdHdmi2->setVisible(true); return; } - auto card = gSelCards->at(0); - fdHdmi2->setVisible(card->m_strCardId.startsWith("m8s", Qt::CaseInsensitive)); + auto card = gSelCards[0]; + fdHdmi2->setVisible(card.id.startsWith("m8s", Qt::CaseInsensitive)); QJsonObject json; json.insert("_id", "IsSync"); json.insert("_type", "IsSync"); - auto reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); + auto reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json); connect(reply, &QNetworkReply::finished, this, [this, reply] { QJsonDocument json; QString err = checkReplyForJson(reply, &json); @@ -425,7 +423,7 @@ QJsonObject CtrlHdmiPanel::getScheduleJson() { } return QJsonObject{ {"createBy", "alahover"}, - {"name", "TimingScreen"}, + {"name", "TimingHdmi"}, {"schedules", schedules} }; } diff --git a/LedOK/device/ctrlhdmipanel.h b/LedOK/device/ctrlhdmipanel.h index b49d6f7..ad6bcc0 100644 --- a/LedOK/device/ctrlhdmipanel.h +++ b/LedOK/device/ctrlhdmipanel.h @@ -1,7 +1,6 @@ #ifndef CTRLHDMIPANEL_H #define CTRLHDMIPANEL_H -#include "base/switchcontrol.h" #include "gutil/qgui.h" #include #include @@ -10,7 +9,7 @@ class CtrlHdmiPanel : public QWidget { Q_OBJECT public: - explicit CtrlHdmiPanel(QWidget *parent = nullptr); + CtrlHdmiPanel(); void restoreScheduleJson(QJsonObject oTaskSync); QJsonObject getScheduleJson(); protected: diff --git a/LedOK/device/ctrlnetworkpanel.cpp b/LedOK/device/ctrlnetworkpanel.cpp index 6435a21..02d5064 100644 --- a/LedOK/device/ctrlnetworkpanel.cpp +++ b/LedOK/device/ctrlnetworkpanel.cpp @@ -2,6 +2,7 @@ #include "base/waitingdlg.h" #include "globaldefine.h" #include "tools.h" +#include "devicepanel.h" #include "gutil/qgui.h" #include "gutil/qnetwork.h" #include @@ -101,7 +102,7 @@ CtrlNetworkPanel::CtrlNetworkPanel(QWidget *parent) : QWidget(parent) { btnLanSet->setMinimumSize(QSize(60, 30)); btnLanSet->setProperty("ssType", "progManageTool"); connect(btnLanSet, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } @@ -144,14 +145,14 @@ CtrlNetworkPanel::CtrlNetworkPanel(QWidget *parent) : QWidget(parent) { json.insert("netMask", mask); json.insert("gateWay", gateWay); json.insert("dns", dns); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("SetEthernet")); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [=] { Def_CtrlSetReqAfter }); } else { - foreach(auto card, *gSelCards) { + foreach(auto card, gSelCards) { Def_CtrlSetMulti(tr("SetEthernet")) } } @@ -164,14 +165,14 @@ CtrlNetworkPanel::CtrlNetworkPanel(QWidget *parent) : QWidget(parent) { btnLanGet->setMinimumSize(QSize(60, 30)); btnLanGet->setProperty("ssType", "progManageTool"); connect(btnLanGet, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } QJsonObject json; json.insert("_id", "GetEthernet"); json.insert("_type", "GetEthernet"); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("GetEthernet")); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [this, reply, waitingDlg] { @@ -190,9 +191,9 @@ CtrlNetworkPanel::CtrlNetworkPanel(QWidget *parent) : QWidget(parent) { fdDns->setText(json["dnsAddr"].toString()); }); } else { - foreach(auto card, *gSelCards) { - auto reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); - auto cardId = card->m_strCardId; + foreach(auto card, gSelCards) { + auto reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json); + auto cardId = card.id; connect(reply, &QNetworkReply::finished, this, [reply, cardId] { QJsonDocument json; QString err = checkReplyForJson(reply, &json); @@ -254,14 +255,14 @@ CtrlNetworkPanel::CtrlNetworkPanel(QWidget *parent) : QWidget(parent) { btnScan->setMinimumWidth(60); btnScan->setProperty("ssType", "progManageTool"); connect(btnScan, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } QJsonObject json; json.insert("_id", "GetWifiList"); json.insert("_type", "GetWifiList"); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("GetWifiList")+" ..."); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [this, reply, waitingDlg] { @@ -327,7 +328,7 @@ CtrlNetworkPanel::CtrlNetworkPanel(QWidget *parent) : QWidget(parent) { btnWiFiSet->setMinimumSize(QSize(60, 30)); btnWiFiSet->setProperty("ssType", "progManageTool"); connect(btnWiFiSet, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } @@ -342,35 +343,35 @@ CtrlNetworkPanel::CtrlNetworkPanel(QWidget *parent) : QWidget(parent) { json2.insert("_type", "ConfigurationWiFi"); json2.insert("ssid", fdWifiName->currentText()); json2.insert("password", fdWifiPassword->text()); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("ConfigurationWiFi")+" ..."); Def_CtrlReqPre - connect(reply, &QNetworkReply::finished, card, [=] { + connect(reply, &QNetworkReply::finished, this, [=] { QString err = checkReplyForJson(reply); if(! err.isEmpty()) { waitingDlg->close(); QMessageBox::critical(this, tr("Error"), err); return; } - auto reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json2); + auto reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json2); waitingDlg->connAbort(reply); - connect(reply, &QNetworkReply::finished, card, [=] { + connect(reply, &QNetworkReply::finished, this, [=] { Def_CtrlSetReqAfter }); }); } else { - foreach(auto card, *gSelCards) { - auto reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); - connect(reply, &QNetworkReply::finished, card, [=] { + foreach(auto card, gSelCards) { + auto reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json); + connect(reply, &QNetworkReply::finished, this, [=] { QString err = checkReplyForJson(reply); if(! err.isEmpty()) { - gFdResInfo->append(card->m_strCardId+" "+tr("ConfigurationWiFi")+" "+err); + gFdResInfo->append(card.id+" "+tr("ConfigurationWiFi")+" "+err); return; } - auto reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json2); - connect(reply, &QNetworkReply::finished, card, [=] { + auto reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json2); + connect(reply, &QNetworkReply::finished, this, [=] { QString err = checkReplyForJson(reply); - gFdResInfo->append(card->m_strCardId+" "+tr("ConfigurationWiFi")+" "+(err.isEmpty()?QCoreApplication::translate("Def","Success"):err)); + gFdResInfo->append(card.id+" "+tr("ConfigurationWiFi")+" "+(err.isEmpty()?QCoreApplication::translate("Def","Success"):err)); }); }); } @@ -381,14 +382,14 @@ CtrlNetworkPanel::CtrlNetworkPanel(QWidget *parent) : QWidget(parent) { json.insert("_type", "ConfigurationHotSpot"); json.insert("apName", fdHotspotName->text()); json.insert("password", fdHotspotPassword->text()); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("ConfigurationHotSpot")+" ..."); Def_CtrlReqPre - connect(reply, &QNetworkReply::finished, card, [=] { + connect(reply, &QNetworkReply::finished, this, [=] { Def_CtrlSetReqAfter }); } else { - foreach(auto card, *gSelCards) { + foreach(auto card, gSelCards) { Def_CtrlSetMulti(tr("ConfigurationHotSpot")); } } @@ -401,14 +402,14 @@ CtrlNetworkPanel::CtrlNetworkPanel(QWidget *parent) : QWidget(parent) { btnWiFiGet->setMinimumSize(QSize(60, 30)); btnWiFiGet->setProperty("ssType", "progManageTool"); connect(btnWiFiGet, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } QJsonObject json; json.insert("_id", "IsPortableHotSpot"); json.insert("_type", "IsPortableHotSpot"); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("IsPortableHotSpot")+" ..."); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [this, reply, waitingDlg] { @@ -421,9 +422,9 @@ CtrlNetworkPanel::CtrlNetworkPanel(QWidget *parent) : QWidget(parent) { else fdIsHotspot->setChecked(true); }); } else { - foreach(auto card, *gSelCards) { - auto reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); - auto cardId = card->m_strCardId; + foreach(auto card, gSelCards) { + auto reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json); + auto cardId = card.id; connect(reply, &QNetworkReply::finished, this, [reply, cardId] { QJsonDocument json; QString err = checkReplyForJson(reply, &json); @@ -464,7 +465,7 @@ CtrlNetworkPanel::CtrlNetworkPanel(QWidget *parent) : QWidget(parent) { fdMcc->setEnabled(checked); fdCarrierName->setEnabled(checked); - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } @@ -472,14 +473,14 @@ CtrlNetworkPanel::CtrlNetworkPanel(QWidget *parent) : QWidget(parent) { json.insert("_id", "SetSwitchSimData"); json.insert("_type", "SetSwitchSimData"); json.insert("enable", checked); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("SetSwitchSimData")+" ..."); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [=] { Def_CtrlSetReqAfter }); } else { - foreach(auto card, *gSelCards) { + foreach(auto card, gSelCards) { Def_CtrlSetMulti(tr("SetSwitchSimData")) } } @@ -490,14 +491,14 @@ CtrlNetworkPanel::CtrlNetworkPanel(QWidget *parent) : QWidget(parent) { btnSIMStatusGet->setMinimumHeight(30); btnSIMStatusGet->setProperty("ssType", "progManageTool"); connect(btnSIMStatusGet, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } QJsonObject json; json.insert("_id", "GetSIMStatus"); json.insert("_type", "GetSIMStatus"); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("GetSIMStatus")+" ..."); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [this, reply, waitingDlg] { @@ -678,7 +679,7 @@ CtrlNetworkPanel::CtrlNetworkPanel(QWidget *parent) : QWidget(parent) { btnAPNCusSet->setMinimumSize(QSize(60, 30)); btnAPNCusSet->setProperty("ssType", "progManageTool"); connect(btnAPNCusSet, &QPushButton::clicked, this, [=] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } @@ -697,14 +698,14 @@ CtrlNetworkPanel::CtrlNetworkPanel(QWidget *parent) : QWidget(parent) { json.insert("mmsproxy", fdCus_mmsProxy->text()); json.insert("mmsport", fdCus_mmsPort->text()); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("SetAPN")+" ..."); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [=] { Def_CtrlSetReqAfter }); } else { - foreach(auto card, *gSelCards) { + foreach(auto card, gSelCards) { Def_CtrlSetMulti(tr("SetAPN")) } } @@ -716,14 +717,14 @@ CtrlNetworkPanel::CtrlNetworkPanel(QWidget *parent) : QWidget(parent) { btnAPNCusGet->setMinimumSize(QSize(60, 30)); btnAPNCusGet->setProperty("ssType", "progManageTool"); connect(btnAPNCusGet, &QPushButton::clicked, this, [=] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } QJsonObject json; json.insert("_id", "GetCurrentAPN"); json.insert("_type", "GetCurrentAPN"); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("GetCurrentAPN")+" ..."); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [=] { @@ -742,9 +743,9 @@ CtrlNetworkPanel::CtrlNetworkPanel(QWidget *parent) : QWidget(parent) { fdCus_mmsPort->setText(json["mmsport"].toString()); }); } else { - foreach(auto card, *gSelCards) { - auto reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); - auto cardId = card->m_strCardId; + foreach(auto card, gSelCards) { + auto reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json); + auto cardId = card.id; connect(reply, &QNetworkReply::finished, this, [reply, cardId] { QJsonDocument json; QString err = checkReplyForJson(reply, &json); @@ -780,7 +781,7 @@ CtrlNetworkPanel::CtrlNetworkPanel(QWidget *parent) : QWidget(parent) { fdFightModel->setTextColor(QColor(100,100,100),QColor(0, 160, 230)); fdFightModel->setText(tr("OFF"), tr("ON")); connect(fdFightModel, &SwitchControl::checkedChanged, this, [=](bool checked) { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } @@ -788,14 +789,14 @@ CtrlNetworkPanel::CtrlNetworkPanel(QWidget *parent) : QWidget(parent) { json.insert("_id", "ContrFlightMode"); json.insert("_type", "ContrFlightMode"); json.insert("state", checked); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("ContrFlightMode")+" ..."); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [=] { Def_CtrlSetReqAfter }); } else { - foreach(auto card, *gSelCards) { + foreach(auto card, gSelCards) { Def_CtrlSetMulti(tr("ContrFlightMode")) } } @@ -806,14 +807,14 @@ CtrlNetworkPanel::CtrlNetworkPanel(QWidget *parent) : QWidget(parent) { btnFlightModelGet->setMinimumSize(QSize(0, 30)); btnFlightModelGet->setProperty("ssType", "progManageTool"); connect(btnFlightModelGet, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } QJsonObject json; json.insert("_id", "GetFlightModeState"); json.insert("_type", "GetFlightModeState"); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("GetFlightModeState")+" ..."); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [this, reply, waitingDlg] { @@ -823,9 +824,9 @@ CtrlNetworkPanel::CtrlNetworkPanel(QWidget *parent) : QWidget(parent) { fdFightModel->update(); }); } else { - foreach(auto card, *gSelCards) { - auto reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); - auto cardId = card->m_strCardId; + foreach(auto card, gSelCards) { + auto reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json); + auto cardId = card.id; connect(reply, &QNetworkReply::finished, this, [reply, cardId] { QJsonDocument json; QString err = checkReplyForJson(reply, &json); @@ -851,16 +852,16 @@ void CtrlNetworkPanel::showEvent(QShowEvent *event) { init(); } void CtrlNetworkPanel::init() { - bool isSingle = gSelCards->count()==1; + bool isSingle = gSelCards.count()==1; btnScan->setEnabled(isSingle); if(! isSingle) return; - auto card = gSelCards->at(0); + auto card = gSelCards[0]; QJsonObject json; json.insert("_id", "GetEthernet"); json.insert("_type", "GetEthernet"); - auto reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); + auto reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json); connect(reply, &QNetworkReply::finished, this, [this, reply] { QJsonDocument json; QString err = checkReplyForJson(reply, &json); @@ -882,7 +883,7 @@ void CtrlNetworkPanel::init() { json = QJsonObject(); json.insert("_id", "GetWifiList"); json.insert("_type", "GetWifiList"); - reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); + reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json); connect(reply, &QNetworkReply::finished, this, [=] { QJsonDocument json; QString err = checkReplyForJson(reply, &json); @@ -894,7 +895,7 @@ void CtrlNetworkPanel::init() { QJsonObject json; json.insert("_id", "IsPortableHotSpot"); json.insert("_type", "IsPortableHotSpot"); - auto reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); + auto reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json); connect(reply, &QNetworkReply::finished, this, [this, reply] { QJsonDocument json; QString err = checkReplyForJson(reply, &json); @@ -912,7 +913,7 @@ void CtrlNetworkPanel::init() { json = QJsonObject(); json.insert("_id", "GetSwitchSimData"); json.insert("_type", "GetSwitchSimData"); - reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); + reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json); connect(reply, &QNetworkReply::finished, this, [=] { QJsonDocument json; QString err = checkReplyForJson(reply, &json); @@ -926,7 +927,7 @@ void CtrlNetworkPanel::init() { json = QJsonObject(); json.insert("_id", "GetAPNList"); json.insert("_type", "GetAPNList"); - reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); + reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json); connect(reply, &QNetworkReply::finished, this, [=] { QJsonDocument json; QString err = checkReplyForJson(reply, &json); @@ -948,12 +949,12 @@ void CtrlNetworkPanel::init() { } }); - getCurrentAPN(card->m_strCardIp); + getCurrentAPN(card.ip); json = QJsonObject(); json.insert("_id", "GetFlightModeState"); json.insert("_type", "GetFlightModeState"); - reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); + reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json); connect(reply, &QNetworkReply::finished, this, [=] { QJsonDocument json; QString err = checkReplyForJson(reply, &json); diff --git a/LedOK/device/ctrlnetworkpanel.h b/LedOK/device/ctrlnetworkpanel.h index 4e233f4..cf754ab 100644 --- a/LedOK/device/ctrlnetworkpanel.h +++ b/LedOK/device/ctrlnetworkpanel.h @@ -1,9 +1,6 @@ #ifndef CTRLNETWORKPANEL_H #define CTRLNETWORKPANEL_H -#include -#include -#include #include "base/switchcontrol.h" #include #include @@ -12,6 +9,8 @@ #include #include #include +#include +#include struct ApnInfo { QString apn; diff --git a/LedOK/device/ctrlpowerpanel.cpp b/LedOK/device/ctrlpowerpanel.cpp new file mode 100644 index 0000000..45dfe6d --- /dev/null +++ b/LedOK/device/ctrlpowerpanel.cpp @@ -0,0 +1,429 @@ +#include "ctrlpowerpanel.h" +#include "globaldefine.h" +#include "deviceitem.h" +#include "devicepanel.h" +#include "base/waitingdlg.h" +#include "gutil/qnetwork.h" +#include "tools.h" +#include +#include +#include +#include + +CtrlPowerPanel::CtrlPowerPanel() { + auto vBox = new VBox(this); + + lbScreenCfg = new QLabel; + lbScreenCfg->setAlignment(Qt::AlignCenter); + vBox->addWidget(lbScreenCfg); + + auto hBox = new HBox(vBox); + hBox->addStretch(); + + fdManual = new QRadioButton; + hBox->addWidget(fdManual); + hBox->addSpacing(40); + + fdSchedule = new QRadioButton; + hBox->addWidget(fdSchedule); + hBox->addStretch(); + + auto stack = new QStackedLayout(vBox); + { + auto vBox = new VBox(stack); + vBox->addSpacing(20); + + auto hBox = new HBox(vBox); + hBox->addStretch(); + + lbScreen = new QLabel; + hBox->addWidget(lbScreen); + + fdScreen = new SwitchControl; + fdScreen->setMinimumSize(QSize(80, 33)); + fdScreen->setSliderColor(QColor(0, 0, 0), QColor(0, 160, 230)); + fdScreen->setBgColor(QColor(200,200,200), QColor(0x00cc00)); + fdScreen->setTextColor(QColor(100,100,100), QColor(0, 160, 230)); + connect(fdScreen, &SwitchControl::checkedChanged, this, [this](bool checked) { + if(gSelCards.isEmpty()) { + QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); + return; + } + QJsonObject json; + json.insert("_id", "SetScreenOn"); + json.insert("_type", "SetScreenOn"); + json.insert("on", checked); + if(gSelCards.count() == 1) { + auto waitingDlg = new WaitingDlg(this, (checked ? tr("SetScreenOn") : tr("SetScreenOff"))+" ..."); + Def_CtrlReqPre + connect(reply, &QNetworkReply::finished, this, [=] { + Def_CtrlSetReqAfter + }); + } else { + if(checked) foreach(auto card, gSelCards) { + Def_CtrlSetMulti(tr("SetScreenOn")) + } + else foreach(auto card, gSelCards) { + Def_CtrlSetMulti(tr("SetScreenOff")) + } + } + }); + hBox->addWidget(fdScreen); + hBox->addStretch(); + + btnScreenGet = new QPushButton; + btnScreenGet->setMinimumSize(QSize(60, 30)); + btnScreenGet->setProperty("ssType", "progManageTool"); + connect(btnScreenGet, &QPushButton::clicked, this, [this] { + if(gSelCards.isEmpty()) { + QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); + return; + } + QJsonObject json; + json.insert("_id", "IsScreenOn"); + json.insert("_type", "IsScreenOn"); + if(gSelCards.count() == 1) { + auto waitingDlg = new WaitingDlg(this, tr("IsScreenOn")+" ..."); + Def_CtrlReqPre + connect(reply, &QNetworkReply::finished, this, [=] { + Def_CtrlSingleGetReply + waitingDlg->success(); + fdScreen->setCheckedStatus(json["on"].toBool()); + auto item = findItem(card.id); + if(item) { + item->mCard.isScreenOn = json["on"].toBool(); + item->setForeground(DeviceTable_Power, item->mCard.isScreenOn ? Qt::green : Qt::red); + item->setData(DeviceTable_Power, 0, item->mCard.isScreenOn ? tr("On") : tr("Off")); + } + }); + } else { + foreach(auto card, gSelCards) { + auto reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json); + connect(reply, &QNetworkReply::finished, this, [=] { + QJsonDocument json; + QString err = checkReplyForJson(reply, &json); + if(err.isEmpty()) { + err = json["on"].toBool() ? tr("On") : tr("Off"); + auto item = findItem(card.id); + if(item) { + item->mCard.isScreenOn = json["on"].toBool(); + item->setForeground(DeviceTable_Power, item->mCard.isScreenOn ? Qt::green : Qt::red); + item->setData(DeviceTable_Power, 0, err); + } + } + gFdResInfo->append(card.id+" "+tr("IsScreenOn")+" "+err); + }); + } + } + }); + vBox->addWidget(btnScreenGet, 0, Qt::AlignCenter); + vBox->addStretch(); + } + { + auto vBox = new VBox(stack); + auto hBox = new HBox(vBox); + hBox->setSpacing(10); + + tableSche = new Table({ + {"start", "", 100}, + {"end", "", 100}, + {"0", "", 60}, + {"1", "", 60}, + {"2", "", 60}, + {"3", "", 60}, + {"4", "", 60}, + {"5", "", 60}, + {"6", "", 60} + }); + tableSche->setDefs(); + + pushButtonAdd = new QPushButton; + pushButtonAdd->setMinimumSize(QSize(60, 30)); + pushButtonAdd->setProperty("ssType", "progManageTool"); + connect(pushButtonAdd, &QPushButton::clicked, this, [this] { + int row = tableSche->appendRow(); + auto timeEdit = new QTimeEdit(QTime(0, 0)); + timeEdit->setDisplayFormat("HH:mm"); + timeEdit->setAlignment(Qt::AlignCenter); + tableSche->setCellWidget(row, "start", timeEdit); + + timeEdit = new QTimeEdit(QTime(1, 0)); + timeEdit->setDisplayFormat("HH:mm"); + timeEdit->setAlignment(Qt::AlignCenter); + tableSche->setCellWidget(row, "end", timeEdit); + + for(int i=0; i<7; i++) { + auto fd = new QCheckBox; + fd->setChecked(true); + tableSche->setCellWidget(row, QString::number(i), fd); + } + }); + hBox->addWidget(pushButtonAdd); + + pushButtonDelete = new QPushButton; + pushButtonDelete->setMinimumSize(QSize(60, 30)); + pushButtonDelete->setProperty("ssType", "progManageTool"); + connect(pushButtonDelete, &QPushButton::clicked, this, [this] { + auto selected = tableSche->selectedRanges(); + if(! selected.isEmpty()) tableSche->model()->removeRows(selected[0].topRow(), selected[0].rowCount()); + }); + hBox->addWidget(pushButtonDelete); + + pushButtonClear = new QPushButton; + pushButtonClear->setMinimumSize(QSize(60, 30)); + pushButtonClear->setProperty("ssType", "progManageTool"); + connect(pushButtonClear, &QPushButton::clicked, tableSche, &Table::clearRows); + hBox->addWidget(pushButtonClear); + hBox->addStretch(); + + pushButtonImport = new QPushButton; + pushButtonImport->setMinimumSize(QSize(0, 30)); + pushButtonImport->setProperty("ssType", "progManageTool"); + connect(pushButtonImport, &QPushButton::clicked, this, [this] { + auto dir = QSettings().value("CtrlScheduleDir").toString(); + if(dir.isEmpty()) dir = "/"; + QString scheFile = QFileDialog::getOpenFileName(this, tr("Import File"), dir, tr("PowerSchedule (*.pjs)")); + if(scheFile.isEmpty()) return; + QFile scheQFile(scheFile); + if(! scheQFile.open(QIODevice::ReadOnly)) return; + auto data = scheQFile.readAll(); + scheQFile.close(); + restoreScheduleJson(QJsonDocument::fromJson(data).object()); + }); + hBox->addWidget(pushButtonImport); + + pushButtonExport = new QPushButton; + pushButtonExport->setMinimumSize(QSize(0, 30)); + pushButtonExport->setProperty("ssType", "progManageTool"); + connect(pushButtonExport, &QPushButton::clicked, this, [this] { + QSettings settings; + auto dir = settings.value("CtrlScheduleDir").toString(); + if(dir.isEmpty()) dir = "/"; + QString scheFile = QFileDialog::getSaveFileName(this, tr("Save File"), dir, tr("PowerSchedule (*.pjs)")); + if(scheFile.isEmpty()) return; + settings.setValue("CtrlScheduleDir", QFileInfo(scheFile).absolutePath()); + QFile scheQFile(scheFile); + if(! scheQFile.open(QIODevice::WriteOnly)) return; + scheQFile.write(QJsonDocument(getScheduleJson()).toJson()); + scheQFile.close(); + }); + hBox->addWidget(pushButtonExport); + + labelPowerScheduleTip = new QLabel; + labelPowerScheduleTip->setWordWrap(true); + vBox->addWidget(labelPowerScheduleTip); + + vBox->addWidget(tableSche); + + hBox = new HBox(vBox); + hBox->addStretch(); + + pushButtonApply = new QPushButton; + pushButtonApply->setProperty("ssType", "progManageTool"); + pushButtonApply->setMinimumSize(QSize(60, 30)); + connect(pushButtonApply, &QPushButton::clicked, this, [this] { + if(gSelCards.isEmpty()) { + QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); + return; + } + if(tableSche->rowCount()==0) clearSche(); + else { + QJsonObject json; + json.insert("_id", "SetTimingScreenTask"); + json.insert("_type", "SetTimingScreenTask"); + json.insert("screenTask", getScheduleJson()); + if(gSelCards.count() == 1) { + auto waitingDlg = new WaitingDlg(this, tr("SetTimingScreenTask")); + Def_CtrlReqPre; + connect(reply, &QNetworkReply::finished, this, [=] { + Def_CtrlSetReqAfter + }); + } else { + foreach(auto card, gSelCards) { + Def_CtrlSetMulti(tr("SetTimingScreenTask")) + } + } + } + }); + hBox->addWidget(pushButtonApply); + hBox->addStretch(); + + pushButtonClearSchedule = new QPushButton; + pushButtonClearSchedule->setMinimumSize(QSize(0, 30)); + pushButtonClearSchedule->setProperty("ssType", "progManageTool"); + connect(pushButtonClearSchedule, &QPushButton::clicked, this, [this] { + if(gSelCards.isEmpty()) { + QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); + return; + } + clearSche(); + }); + hBox->addWidget(pushButtonClearSchedule); + hBox->addStretch(); + + pushButtonReadback = new QPushButton; + pushButtonReadback->setMinimumSize(QSize(0, 30)); + pushButtonReadback->setProperty("ssType", "progManageTool"); + connect(pushButtonReadback, &QPushButton::clicked, this, [this] { + if(gSelCards.isEmpty()) { + QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); + return; + } + QJsonObject json; + json.insert("_id", "GetTimingScreenTask"); + json.insert("_type", "GetTimingScreenTask"); + if(gSelCards.count() == 1) { + auto waitingDlg = new WaitingDlg(this, tr("GetTimingScreenTask")); + Def_CtrlReqPre + connect(reply, &QNetworkReply::finished, this, [this, reply, waitingDlg] { + Def_CtrlSingleGetReply + waitingDlg->success(); + restoreScheduleJson(json["screenTask"].toObject()); + }); + } + }); + hBox->addWidget(pushButtonReadback); + + hBox->addStretch(); + } + + connect(fdSchedule, &QRadioButton::toggled, stack, &QStackedLayout::setCurrentIndex); + fdManual->setChecked(true); + + connect(gDevicePanel, &DevicePanel::sigSelectedDeviceList, this, [this] { + if(isVisible()) init(); + }); + transUi(); +} + +void CtrlPowerPanel::showEvent(QShowEvent *event) { + QWidget::showEvent(event); + init(); +} +void CtrlPowerPanel::init() { + bool isSingle = gSelCards.count()==1; + pushButtonReadback->setEnabled(isSingle); + if(! isSingle) return; + auto card = gSelCards[0]; + fdScreen->setCheckedStatus(card.isScreenOn); + + QJsonObject json; + json.insert("_id", "GetTimingScreenTask"); + json.insert("_type", "GetTimingScreenTask"); + auto reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json); + connect(reply, &QNetworkReply::finished, this, [this, reply, card] { + QJsonDocument json; + QString err = checkReplyForJson(reply, &json); + if(! err.isEmpty()) return; + if(restoreScheduleJson(json["screenTask"].toObject())) fdSchedule->setChecked(true); + else fdManual->setChecked(true); + }); +} + +void CtrlPowerPanel::changeEvent(QEvent *event) { + QWidget::changeEvent(event); + if(event->type() == QEvent::LanguageChange) transUi(); +} +void CtrlPowerPanel::transUi() { + lbScreenCfg->setText(tr("Power Configuration")); + fdManual->setText(tr("Manual")); + fdSchedule->setText(tr("Schedule")); + + lbScreen->setText(tr("Power")); + fdScreen->setText(tr("Off"), tr("On")); + btnScreenGet->setText(tr("Readback")); + + tableSche->setHeaderText("start", tr("Start Time")); + tableSche->setHeaderText("end", tr("End Time")); + tableSche->setHeaderText("0", tr("SUN")); + tableSche->setHeaderText("1", tr("MON")); + tableSche->setHeaderText("2", tr("TUE")); + tableSche->setHeaderText("3", tr("WED")); + tableSche->setHeaderText("4", tr("THU")); + tableSche->setHeaderText("5", tr("FRI")); + tableSche->setHeaderText("6", tr("SAT")); + + pushButtonAdd->setText(tr("Add")); + pushButtonApply->setText(tr("Apply")); + pushButtonClear->setText(tr("Clear")); + pushButtonDelete->setText(tr("Delete")); + pushButtonImport->setText(tr("Import")); + pushButtonExport->setText(tr("Export")); + labelPowerScheduleTip->setText(tr("It is power off state outside the schedule time period")); + pushButtonClearSchedule->setText(tr("Clear Schedule")); + pushButtonReadback->setText(tr("Readback")); +} +bool CtrlPowerPanel::restoreScheduleJson(QJsonObject oTaskSync) { + tableSche->setRowCount(0); + auto schedules = oTaskSync["schedules"].toArray(); + foreach(QJsonValue schedule, schedules) { + int row = tableSche->rowCount(); + tableSche->insertRow(row); + + auto timeEdit = new QTimeEdit(QTime::fromString(schedule["startTime"].toString()+":00")); + timeEdit->setDisplayFormat("HH:mm"); + timeEdit->setAlignment(Qt::AlignCenter); + tableSche->setCellWidget(row, "start", timeEdit); + + timeEdit = new QTimeEdit(QTime::fromString(schedule["endTime"].toString()+":00")); + timeEdit->setDisplayFormat("HH:mm"); + timeEdit->setAlignment(Qt::AlignCenter); + tableSche->setCellWidget(row, "end", timeEdit); + + if(schedule["filterType"].toString()=="None") for(int i=0; i<7; i++) { + auto fd = new QCheckBox; + fd->setChecked(true); + tableSche->setCellWidget(row, QString::number(i), fd); + } else if(schedule["filterType"].toString()=="Week") { + auto weekFilter = schedule["weekFilter"].toArray(); + for(int i=0; i<7; i++) { + auto fd = new QCheckBox; + if(weekFilter.contains(i)) fd->setChecked(true); + tableSche->setCellWidget(row, QString::number(i), fd); + } + } + } + return schedules.count() > 0; +} +QJsonObject CtrlPowerPanel::getScheduleJson() { + QJsonArray schedules; + for(int i=0; irowCount(); i++) { + QJsonObject schedule; + schedule["timeType"] = "Range"; + schedule["startTime"] = static_cast(tableSche->cellWidget(i, "start"))->text(); + schedule["endTime"] = static_cast(tableSche->cellWidget(i, "end"))->text(); + schedule["dateType"] = "All"; + schedule["monthFilter"] = QJsonArray(); + QJsonArray weekFilter; + for(int d=0; d<7; d++) if(static_cast(tableSche->cellWidget(i, QString::number(d)))->isChecked()) weekFilter.append(d); + if(weekFilter.size()>=7) { + schedule["filterType"] = "None"; + weekFilter = QJsonArray(); + } else schedule["filterType"] = "Week"; + schedule["weekFilter"] = weekFilter; + schedules.append(schedule); + } + return QJsonObject{ + {"createBy", "alahover"}, + {"name", "TimingScreen"}, + {"schedules", schedules} + }; +} +void CtrlPowerPanel::clearSche() { + auto btn = QMessageBox::question(this, tr("Tip Info"), tr("Clear schedule task?")); + if(btn != QMessageBox::Yes) return; + QJsonObject json; + json.insert("_id", "CleanTimingScreenTask"); + json.insert("_type", "CleanTimingScreenTask"); + if(gSelCards.count() == 1) { + auto waitingDlg = new WaitingDlg(this, tr("CleanTimingScreenTask")); + Def_CtrlReqPre; + connect(reply, &QNetworkReply::finished, this, [=] { + Def_CtrlSetReqAfter + }); + } else { + foreach(auto card, gSelCards) { + Def_CtrlSetMulti(tr("CleanTimingScreenTask")) + } + } +} diff --git a/LedOK/device/ctrlpowerpanel.h b/LedOK/device/ctrlpowerpanel.h new file mode 100644 index 0000000..a3092c8 --- /dev/null +++ b/LedOK/device/ctrlpowerpanel.h @@ -0,0 +1,43 @@ +#ifndef CTRLPOWERPANEL_H +#define CTRLPOWERPANEL_H + +#include "gutil/qgui.h" +#include +#include +#include +#include + +class CtrlPowerPanel : public QWidget { + Q_OBJECT +public: + CtrlPowerPanel(); + bool restoreScheduleJson(QJsonObject oTaskSync); + QJsonObject getScheduleJson(); + void clearSche(); +protected: + void showEvent(QShowEvent *event) override; + void init(); + void changeEvent(QEvent *) override; + void transUi(); +private: + QLabel *lbScreenCfg; + QRadioButton *fdManual; + QRadioButton *fdSchedule; + + QLabel *lbScreen; + SwitchControl *fdScreen; + QPushButton *btnScreenGet; + + QPushButton *pushButtonAdd; + QPushButton *pushButtonDelete; + QPushButton *pushButtonClear; + QPushButton *pushButtonImport; + QPushButton *pushButtonExport; + QLabel *labelPowerScheduleTip; + Table *tableSche; + QPushButton *pushButtonApply; + QPushButton *pushButtonClearSchedule; + QPushButton *pushButtonReadback; +}; + +#endif // CTRLPOWERPANEL_H diff --git a/LedOK/device/ctrlpwdpanel.cpp b/LedOK/device/ctrlpwdpanel.cpp index ced2ba1..570ec0e 100644 --- a/LedOK/device/ctrlpwdpanel.cpp +++ b/LedOK/device/ctrlpwdpanel.cpp @@ -1,11 +1,14 @@ #include "ctrlpwdpanel.h" #include "gutil/qgui.h" +#include "gutil/qnetwork.h" #include "base/waitingdlg.h" #include "QFileDialog" #include #include -#include +#include "globaldefine.h" #include "tools.h" +#include "deviceitem.h" +#include "devicepanel.h" CtrlPwdPanel::CtrlPwdPanel(QWidget *parent) : QWidget(parent) { auto vBox = new VBox(this); @@ -51,7 +54,7 @@ CtrlPwdPanel::CtrlPwdPanel(QWidget *parent) : QWidget(parent) { btnPwdSet->setMinimumSize(60, 30); btnPwdSet->setProperty("ssType", "progManageTool"); connect(btnPwdSet, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } @@ -78,10 +81,10 @@ CtrlPwdPanel::CtrlPwdPanel(QWidget *parent) : QWidget(parent) { json.insert("_type", "SetControllerPassword"); json.insert("pwd", fdOldPwd->text()); json.insert("newPwd", fdNewPwd->text()); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("SetControllerPassword")+" ..."); Def_CtrlReqPre - connect(reply, &QNetworkReply::finished, card, [=] { + connect(reply, &QNetworkReply::finished, this, [=] { QJsonDocument json; QString err = checkReplyForJson(reply, &json); if(! err.isEmpty()) { @@ -99,15 +102,19 @@ CtrlPwdPanel::CtrlPwdPanel(QWidget *parent) : QWidget(parent) { fdOldPwd->show(); btnPwdClear->show(); btnPwdSet->setText(tr("Modify password")); - card->bPassword = true; + auto item = findItem(card.id); + if(item) { + item->mCard.hasPassword = true; + item->init(); + } fdNewPwd->clear(); fdPwdAgain->clear(); fdOldPwd->clear(); }); } else { - foreach(auto card, *gSelCards) { - auto reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); - connect(reply, &QNetworkReply::finished, card, [=] { + foreach(auto card, gSelCards) { + auto reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json); + connect(reply, &QNetworkReply::finished, this, [=] { QJsonDocument json; QString err = checkReplyForJson(reply, &json); if(err.isEmpty()) { @@ -118,10 +125,14 @@ CtrlPwdPanel::CtrlPwdPanel(QWidget *parent) : QWidget(parent) { fdOldPwd->show(); btnPwdClear->show(); btnPwdSet->setText(tr("Modify password")); - card->bPassword = true; + auto item = findItem(card.id); + if(item) { + item->mCard.hasPassword = true; + item->init(); + } } } - gFdResInfo->append(card->m_strCardId+" "+tr("SetControllerPassword")+" "+err); + gFdResInfo->append(card.id+" "+tr("SetControllerPassword")+" "+err); }); } } @@ -132,7 +143,7 @@ CtrlPwdPanel::CtrlPwdPanel(QWidget *parent) : QWidget(parent) { btnPwdClear->setMinimumSize(60, 30); btnPwdClear->setProperty("ssType", "progManageTool"); connect(btnPwdClear, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } @@ -145,10 +156,10 @@ CtrlPwdPanel::CtrlPwdPanel(QWidget *parent) : QWidget(parent) { json.insert("_type", "SetControllerPassword"); json.insert("pwd", fdOldPwd->text()); json.insert("newPwd",""); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("SetControllerPassword")+" ..."); Def_CtrlReqPre - connect(reply, &QNetworkReply::finished, card, [=] { + connect(reply, &QNetworkReply::finished, this, [=] { QJsonDocument json; QString err = checkReplyForJson(reply, &json); if(! err.isEmpty()) { @@ -166,15 +177,19 @@ CtrlPwdPanel::CtrlPwdPanel(QWidget *parent) : QWidget(parent) { fdOldPwd->hide(); btnPwdClear->hide(); btnPwdSet->setText(tr("Set encryption")); - card->bPassword = false; + auto item = findItem(card.id); + if(item) { + item->mCard.hasPassword = false; + item->init(); + } fdNewPwd->clear(); fdPwdAgain->clear(); fdOldPwd->clear(); }); } else { - foreach(auto card, *gSelCards) { - auto reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); - connect(reply, &QNetworkReply::finished, card, [=] { + foreach(auto card, gSelCards) { + auto reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json); + connect(reply, &QNetworkReply::finished, this, [=] { QJsonDocument json; QString err = checkReplyForJson(reply, &json); if(err.isEmpty()) { @@ -185,10 +200,14 @@ CtrlPwdPanel::CtrlPwdPanel(QWidget *parent) : QWidget(parent) { fdOldPwd->hide(); btnPwdClear->hide(); btnPwdSet->setText(tr("Set encryption")); - card->bPassword = false; + auto item = findItem(card.id); + if(item) { + item->mCard.hasPassword = false; + item->init(); + } } } - gFdResInfo->append(card->m_strCardId+" "+tr("SetControllerPassword")+" "+err); + gFdResInfo->append(card.id+" "+tr("SetControllerPassword")+" "+err); }); } } @@ -209,24 +228,13 @@ void CtrlPwdPanel::showEvent(QShowEvent *event) { init(); } void CtrlPwdPanel::init() { - bool isSingle = gSelCards->count()==1; + bool isSingle = gSelCards.count()==1; if(! isSingle) return; - auto card = gSelCards->at(0); - - QJsonObject json; - json.insert("_id", "HasControllerPassword"); - json.insert("_type", "HasControllerPassword"); - auto reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); - connect(reply, &QNetworkReply::finished, card, [=] { - QJsonDocument json; - QString err = checkReplyForJson(reply, &json); - if(! err.isEmpty()) return; - card->bPassword = json["result"].toBool(); - lbOldPwd->setVisible(card->bPassword); - fdOldPwd->setVisible(card->bPassword); - btnPwdClear->setVisible(card->bPassword); - btnPwdSet->setText(card->bPassword ? tr("Modify password") : tr("Set encryption")); - }); + auto card = gSelCards[0]; + lbOldPwd->setVisible(card.hasPassword); + fdOldPwd->setVisible(card.hasPassword); + btnPwdClear->setVisible(card.hasPassword); + btnPwdSet->setText(card.hasPassword ? tr("Modify password") : tr("Set encryption")); } void CtrlPwdPanel::changeEvent(QEvent *event) { QWidget::changeEvent(event); diff --git a/LedOK/device/ctrltestpanel.cpp b/LedOK/device/ctrltestpanel.cpp new file mode 100644 index 0000000..992300f --- /dev/null +++ b/LedOK/device/ctrltestpanel.cpp @@ -0,0 +1,530 @@ +#include "ctrltestpanel.h" +#include "tools.h" +#include "gutil/qgui.h" +#include "gutil/qnetwork.h" +#include "base/waitingdlg.h" +#include +#include +#include +#include +#include "globaldefine.h" +#include +#include +#include + +CtrlTestPanel::CtrlTestPanel(QWidget *parent) : QWidget(parent) { + auto vBox = new VBox(this); + + labelTestScreen = new QLabel; + labelTestScreen->setAlignment(Qt::AlignCenter); + vBox->addWidget(labelTestScreen); + + auto hBox = new HBox(vBox); + auto vv = new VBox(hBox); + + groupBox = new QGroupBox; + auto vvv = new VBox(groupBox); + auto hhh = new HBox(vvv); + hhh->addStretch(); + + radioButtonRed = new QRadioButton; + hhh->addWidget(radioButtonRed); + + radioButtonGreen = new QRadioButton; + hhh->addWidget(radioButtonGreen); + + radioButtonBlue = new QRadioButton; + hhh->addWidget(radioButtonBlue); + + radioButtonWhite = new QRadioButton; + hhh->addWidget(radioButtonWhite); + hhh->addStretch(); + + + hhh = new HBox(vvv); + hhh->addStretch(); + + checkBoxVertical = new QCheckBox; + hhh->addWidget(checkBoxVertical); + + checkBoxSlash = new QCheckBox; + hhh->addWidget(checkBoxSlash); + + checkBoxHorizontal = new QCheckBox; + hhh->addWidget(checkBoxHorizontal); + hhh->addStretch(); + + + hhh = new HBox(vvv); + hhh->addStretch(); + + label = new QLabel; + hhh->addWidget(label); + + spinBoxLineSpeed = new QSpinBox; + spinBoxLineSpeed->setMaximum(99999); + hhh->addWidget(spinBoxLineSpeed); + + label_5 = new QLabel; + hhh->addWidget(label_5); + hhh->addSpacing(20); + + label_2 = new QLabel; + hhh->addWidget(label_2); + + spinBoxLineDistance = new QSpinBox; + spinBoxLineDistance->setMaximum(128); + hhh->addWidget(spinBoxLineDistance); + + label_6 = new QLabel; + hhh->addWidget(label_6); + hhh->addStretch(); + + pushButtonStartLine = new QPushButton; + pushButtonStartLine->setMinimumSize(QSize(60, 30)); + pushButtonStartLine->setMaximumSize(QSize(80, 16777215)); + vvv->addWidget(pushButtonStartLine, 0, Qt::AlignHCenter); + + vv->addWidget(groupBox); + + groupBox_2 = new QGroupBox; + vvv = new VBox(groupBox_2); + checkBoxShowInfo = new QCheckBox; + + vvv->addWidget(checkBoxShowInfo, 0, Qt::AlignLeft); + + hhh = new HBox(vvv); + hhh->addStretch(); + + checkBox_red = new QCheckBox; + hhh->addWidget(checkBox_red); + + checkBox_green = new QCheckBox; + hhh->addWidget(checkBox_green); + + checkBox_blue = new QCheckBox; + hhh->addWidget(checkBox_blue); + + checkBox_white = new QCheckBox; + hhh->addWidget(checkBox_white); + hhh->addStretch(); + + hhh = new HBox(vvv); + hhh->addStretch(); + + label_3 = new QLabel; + hhh->addWidget(label_3); + + spinBoxGraySpeed = new QSpinBox; + spinBoxGraySpeed->setMinimumSize(QSize(60, 0)); + spinBoxGraySpeed->setMinimum(10); + spinBoxGraySpeed->setMaximum(99999); + + hhh->addWidget(spinBoxGraySpeed); + + label_8 = new QLabel; + hhh->addWidget(label_8); + + label_4 = new QLabel; + hhh->addWidget(label_4); + + spinBoxGrayValue = new QSpinBox; + spinBoxGrayValue->setMaximum(255); + hhh->addWidget(spinBoxGrayValue); + + label_7 = new QLabel; + hhh->addWidget(label_7); + hhh->addStretch(); + + + pushButtonStartGray = new QPushButton; + pushButtonStartGray->setMinimumSize(QSize(60, 30)); + pushButtonStartGray->setMaximumSize(QSize(80, 16777215)); + vvv->addWidget(pushButtonStartGray, 0, Qt::AlignHCenter); + + vv->addWidget(groupBox_2); + + groupBox_3 = new QGroupBox; + vvv = new VBox(groupBox_3); + + checkBoxGradient = new QCheckBox; + vvv->addWidget(checkBoxGradient); + + hhh = new HBox(vvv); + hhh->addStretch(); + + radioButton_red = new QRadioButton; + hhh->addWidget(radioButton_red); + + radioButton_Green = new QRadioButton; + hhh->addWidget(radioButton_Green); + + radioButton_Blue = new QRadioButton; + hhh->addWidget(radioButton_Blue); + + radioButton_White = new QRadioButton; + hhh->addWidget(radioButton_White); + hhh->addStretch(); + + pushButtonStartColor = new QPushButton; + pushButtonStartColor->setMinimumSize(QSize(60, 30)); + pushButtonStartColor->setMaximumSize(QSize(80, 16777215)); + + vvv->addWidget(pushButtonStartColor, 0, Qt::AlignHCenter); + + vv->addWidget(groupBox_3); + + hhh = new HBox(vv); + hhh->addStretch(); + + pushButtonStopTest = new QPushButton; + pushButtonStopTest->setMinimumSize(QSize(60, 30)); + hhh->addWidget(pushButtonStopTest); + hhh->addStretch(); + + vv->addStretch(); + + auto line = new QFrame; + line->setFrameShape(QFrame::VLine); + line->setFrameShadow(QFrame::Sunken); + hBox->addWidget(line); + hBox->addStretch(); + + vv = new VBox(hBox); + + lineEdit = new QLineEdit; + lineEdit->setMinimumSize(QSize(0, 36)); + lineEdit->setMaximumSize(QSize(194, 16777215)); + lineEdit->setAutoFillBackground(false); + lineEdit->setStyleSheet(QString::fromUtf8("color: rgb(0, 255, 0);\n" + "background-color: rgb(0, 0, 0);")); + lineEdit->setAlignment(Qt::AlignCenter); + vv->addWidget(lineEdit); + + auto gridLayout = new Grid(vv); + + auto btngrp = new QButtonGroup(this); + for(int i=0; i<10; ++i) { + auto btn = new QPushButton(QString::number(i)); + btn->setFixedSize(60, 30); + btn->setProperty("ssType", "progManageTool"); + btngrp->addButton(btn, i); + } + gridLayout->addWidget(btngrp->button(1), 0, 0); + gridLayout->addWidget(btngrp->button(2), 0, 1); + gridLayout->addWidget(btngrp->button(3), 0, 2); + gridLayout->addWidget(btngrp->button(4), 1, 0); + gridLayout->addWidget(btngrp->button(5), 1, 1); + gridLayout->addWidget(btngrp->button(6), 1, 2); + gridLayout->addWidget(btngrp->button(7), 2, 0); + gridLayout->addWidget(btngrp->button(8), 2, 1); + gridLayout->addWidget(btngrp->button(9), 2, 2); + gridLayout->addWidget(btngrp->button(0), 3, 0); + connect(btngrp, &QButtonGroup::idClicked, this, [=](int id) { + if(lineEdit->text().contains("-")) lineEdit->clear(); + lineEdit->setText(lineEdit->text() + QString::number(id)); + pushButton_13->setEnabled(true); + }); + + pushButton_11 = new QPushButton; + pushButton_11->setFixedSize(QSize(60, 30)); + gridLayout->addWidget(pushButton_11, 3, 1, 1, 1); + + pushButton_12 = new QPushButton; + pushButton_12->setFixedSize(QSize(60, 30)); + gridLayout->addWidget(pushButton_12, 3, 2, 1, 1); + + pushButton_13 = new QPushButton; + vv->addWidget(pushButton_13); + vv->addStretch(); + + hBox->addStretch(); + vBox->addStretch(); + + pushButtonStartLine->setProperty("ssType", "progManageTool"); + pushButtonStartGray->setProperty("ssType", "progManageTool"); + pushButtonStartColor->setProperty("ssType", "progManageTool"); + pushButtonStopTest->setProperty("ssType", "progManageTool"); + pushButton_11->setProperty("ssType", "progManageTool"); + pushButton_12->setProperty("ssType", "progManageTool"); + pushButton_13->setProperty("ssType", "progManageTool"); + + spinBoxLineSpeed->setValue(10); + spinBoxLineDistance->setValue(15); + spinBoxGraySpeed->setValue(10); + spinBoxGrayValue->setValue(0); + radioButtonWhite->setChecked(true); + radioButton_White->setChecked(true); + checkBoxHorizontal->setChecked(true); + checkBoxVertical->setChecked(true); + checkBoxSlash->setChecked(true); + checkBox_red->setChecked(true); + checkBox_green->setChecked(true); + checkBox_blue->setChecked(true); + checkBox_white->setChecked(true); + + connect(pushButtonStartLine, &QPushButton::clicked, this, [this] { + if(gSelCards.isEmpty()) { + QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); + return; + } + QJsonObject json; + json.insert("_id", "TestScreen"); + json.insert("_type", "TestScreen"); + json.insert("mode", 1);// 0:停止; 1:斜线; 2:灰度; 3:颜色;4:渐变 + json.insert("speed", spinBoxLineSpeed->value()); + if(radioButtonRed->isChecked()) + json.insert("color", "#FFFF0000"); + else if(radioButtonGreen->isChecked()) + json.insert("color", "#FF00FF00"); + else if(radioButtonBlue->isChecked()) + json.insert("color", "#FF0000FF"); + else + json.insert("color", "#FFFFFFFF"); + + json.insert("interval", spinBoxLineDistance->value()); + json.insert("horizonalLine", checkBoxHorizontal->isChecked()); + json.insert("verticalLine", checkBoxVertical->isChecked()); + json.insert("slantLine", checkBoxSlash->isChecked()); + json.insert("runLimit", spinBoxGrayValue->value()); + json.insert("showInfo", !checkBoxShowInfo->isChecked()); + json.insert("red", checkBox_red->isChecked()); + json.insert("green", checkBox_green->isChecked()); + json.insert("blue", checkBox_blue->isChecked()); + json.insert("white", checkBox_white->isChecked()); + if(gSelCards.count() == 1) { + auto waitingDlg = new WaitingDlg(this, tr("StartTest")+" ..."); + Def_CtrlReqPre + connect(reply, &QNetworkReply::finished, this, [=] { + Def_CtrlSetReqAfter + }); + } else { + foreach(auto card, gSelCards) { + Def_CtrlSetMulti(tr("StartTest")) + } + } + }); + connect(pushButtonStartGray, &QPushButton::clicked, this, [this] { + if(gSelCards.isEmpty()) { + QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); + return; + } + QJsonObject json; + json.insert("_id", "TestScreen"); + json.insert("_type", "TestScreen"); + json.insert("mode", 2);// 0:停止; 1:斜线; 2:灰度; 3:颜色;4:渐变 + json.insert("speed", spinBoxGraySpeed->value()); + // qDebug()<<"speed="<value(); + if(radioButtonRed->isChecked()) + json.insert("color", "#FFFF0000"); + else if(radioButtonGreen->isChecked()) + json.insert("color", "#FF00FF00"); + else if(radioButtonBlue->isChecked()) + json.insert("color", "#FF0000FF"); + else + json.insert("color", "#FFFFFFFF"); + json.insert("interval", spinBoxLineDistance->value()); + json.insert("horizonalLine", checkBoxHorizontal->isChecked()); + json.insert("verticalLine", checkBoxVertical->isChecked()); + json.insert("slantLine", checkBoxSlash->isChecked()); + json.insert("runLimit", spinBoxGrayValue->value()); + json.insert("showInfo", !checkBoxShowInfo->isChecked()); + json.insert("red", checkBox_red->isChecked()); + json.insert("green", checkBox_green->isChecked()); + json.insert("blue", checkBox_blue->isChecked()); + json.insert("white", checkBox_white->isChecked()); + if(gSelCards.count() == 1) { + auto waitingDlg = new WaitingDlg(this, tr("StartTest")+" ..."); + Def_CtrlReqPre + connect(reply, &QNetworkReply::finished, this, [=] { + Def_CtrlSetReqAfter + }); + } else { + foreach(auto card, gSelCards) { + Def_CtrlSetMulti(tr("StartTest")) + } + } + }); + connect(pushButtonStartColor, &QPushButton::clicked, this, [this] { + if(gSelCards.isEmpty()) { + QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); + return; + } + QJsonObject json; + json.insert("_id", "TestScreen"); + json.insert("_type", "TestScreen"); + if(checkBoxGradient->isChecked()) + json.insert("mode", 4);// 0:停止; 1:斜线; 2:灰度; 3:颜色;4:渐变 + else + json.insert("mode", 3);// 0:停止; 1:斜线; 2:灰度; 3:颜色;4:渐变 + json.insert("speed", spinBoxLineSpeed->value()); + if(radioButton_red->isChecked()) + json.insert("color", "#FFFF0000"); + else if(radioButton_Green->isChecked()) + json.insert("color", "#FF00FF00"); + else if(radioButton_Blue->isChecked()) + json.insert("color", "#FF0000FF"); + else + json.insert("color", "#FFFFFFFF"); + + json.insert("interval", spinBoxLineDistance->value()); + json.insert("horizonalLine", checkBoxHorizontal->isChecked()); + json.insert("verticalLine", checkBoxVertical->isChecked()); + json.insert("slantLine", checkBoxSlash->isChecked()); + json.insert("runLimit", spinBoxGrayValue->value()); + json.insert("showInfo", !checkBoxShowInfo->isChecked()); + json.insert("red", checkBox_red->isChecked()); + json.insert("green", checkBox_green->isChecked()); + json.insert("blue", checkBox_blue->isChecked()); + json.insert("white", checkBox_white->isChecked()); + if(gSelCards.count() == 1) { + auto waitingDlg = new WaitingDlg(this, tr("StartTest")+" ..."); + Def_CtrlReqPre + connect(reply, &QNetworkReply::finished, this, [=] { + Def_CtrlSetReqAfter + }); + } else { + foreach(auto card, gSelCards) { + Def_CtrlSetMulti(tr("StartTest")) + } + } + }); + connect(pushButtonStopTest, &QPushButton::clicked, this, [this] { + if(gSelCards.isEmpty()) { + QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); + return; + } + QJsonObject json; + json.insert("_id", "TestScreen"); + json.insert("_type", "TestScreen"); + json.insert("mode", 0); + if(gSelCards.count() == 1) { + auto waitingDlg = new WaitingDlg(this, tr("StopTest")+" ..."); + Def_CtrlReqPre + connect(reply, &QNetworkReply::finished, this, [=] { + Def_CtrlSetReqAfter + }); + } else { + foreach(auto card, gSelCards) { + Def_CtrlSetMulti(tr("StopTest")) + } + } + }); + connect(pushButton_11, &QPushButton::clicked, this, [=] { + lineEdit->clear(); + pushButton_13->setEnabled(false); + }); + connect(pushButton_12, &QPushButton::clicked, this, [=] { + if(gSelCards.isEmpty()) { + QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); + return; + } + int iIndex = lineEdit->text().toInt(); + if(gSelCards.count()==1) SendAnycastCmd(gSelCards[0], 0, true); + else { + foreach(auto card, gSelCards) SendAnycastCmd(card, iIndex, false); + } + lineEdit->setText("-"+tr("loopback mode")+"-"); + pushButton_13->setEnabled(false); + }); + connect(pushButton_13, &QPushButton::clicked, this, [=] { + if(gSelCards.isEmpty()) { + QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); + return; + } + int iIndex = lineEdit->text().toInt(); + if(gSelCards.count()==1) SendAnycastCmd(gSelCards[0], iIndex, true); + else foreach(auto card, gSelCards) SendAnycastCmd(card, iIndex, false); + lineEdit->setText(tr("Anycast")+" - "+lineEdit->text()); + pushButton_13->setEnabled(false); + }); + + pushButton_13->setEnabled(false); + + lineEdit->setValidator(new QIntValidator(0, 100, this)); + + transUi(); +} + +void CtrlTestPanel::changeEvent(QEvent *event) { + QWidget::changeEvent(event); + if(event->type() == QEvent::LanguageChange) transUi(); +} +void CtrlTestPanel::transUi() { + labelTestScreen->setText(tr("Test Screen")); + groupBox->setTitle(tr("Line test")); + radioButtonRed->setText(tr("Red")); + radioButtonGreen->setText(tr("Green")); + radioButtonBlue->setText(tr("Blue")); + radioButtonWhite->setText(tr("White")); + radioButton_red->setText(tr("Red")); + radioButton_Green->setText(tr("Green")); + radioButton_Blue->setText(tr("Blue")); + radioButton_White->setText(tr("White")); + checkBoxVertical->setText(tr("Vertical")); + checkBoxHorizontal->setText(tr("Horizontal")); + checkBoxSlash->setText(tr("Slash")); + label->setText(tr("Speed")); + label_5->setText(tr("ms(>10)")); + checkBoxHorizontal->setText(tr("Horizontal")); + label_2->setText(tr("Line Distance")); + pushButtonStartLine->setText(tr("Test")); + groupBox_2->setTitle(tr("Gradation test")); + checkBoxShowInfo->setText(tr("Only the gray value is displayed")); + checkBox_red->setText(tr("Red")); + checkBox_green->setText(tr("Green")); + checkBox_blue->setText(tr("Blue")); + checkBox_white->setText(tr("White")); + label_3->setText(tr("Speed")); + label_4->setText(tr("GrayValue")); + pushButtonStartGray->setText(tr("Test")); + pushButtonStartColor->setText(tr("Test")); + groupBox_3->setTitle(tr("Color test")); + checkBoxGradient->setText(tr("Gradient")); + radioButton_red->setText(tr("Red")); + radioButton_Green->setText(tr("Green")); + radioButton_Blue->setText(tr("Blue")); + radioButton_White->setText(tr("White")); + pushButtonStopTest->setText(tr("Stop")); + pushButton_11->setText(tr("Clear")); + pushButton_12->setText(tr("Reset")); + pushButton_13->setText(tr("Anycast")); +} + +void CtrlTestPanel::SendAnycastCmd(LedCard card, int iProgramIndex, bool isSingle) { + QTcpSocket *send = new QTcpSocket(); + connect(send, SIGNAL(connected()), this, SLOT(connect_sucessful())); + connect(send, SIGNAL(error(QAbstractSocket::SocketError)),this, SLOT(show_error(QAbstractSocket::SocketError))); + send->connectToHost(QHostAddress(card.ip),31299); + + ST_ANSY_PROGRAM_PACKET tempStreadPakcet; + tempStreadPakcet.SyncHead[0]=0x7e; + tempStreadPakcet.SyncHead[1]=0x7e; + tempStreadPakcet.SyncHead[2]=0x55; + tempStreadPakcet.ucCommType=0x97; + tempStreadPakcet.iBaoLiu=0; + tempStreadPakcet.iLength=4; + unsigned char uctemp[4]={0}; + uctemp[0]=iProgramIndex; + + memcpy(tempStreadPakcet.pDataBuffer,uctemp,4); + tempStreadPakcet.pDataBuffer[tempStreadPakcet.iLength]=GetCheckCodeIn8(&tempStreadPakcet.ucCommType,tempStreadPakcet.iLength+sizeof(tempStreadPakcet.iBaoLiu)+sizeof(tempStreadPakcet.ucCommType)+sizeof(tempStreadPakcet.iLength)); + int iLenPacket=3*sizeof(unsigned char)+sizeof(char)+sizeof(int)+sizeof(int)+tempStreadPakcet.iLength+sizeof(char);/////除正文外的协议结构大小; + QByteArray databuf = QByteArray(reinterpret_cast(&tempStreadPakcet), iLenPacket); + if(!send->waitForConnected(10000)) //等待连接返回 + { + if(isSingle) QMessageBox::information(this, tr("Tip"), tr("Connect timeout")); + else gFdResInfo->append(card.id+":"+tr("receive")+"<-"+tr("Connect")+":"+tr("timeout")); + send->close(); + delete send; + return; + } + send->write(databuf); + if(send->waitForBytesWritten(3000)) { + send->read(send->bytesAvailable()); + if(isSingle) QMessageBox::information(this, tr("Tip"), (iProgramIndex==0 ? tr("Reset loop mode") : tr("Anycast"))+":"+tr("success")); + else gFdResInfo->append(card.id+":"+tr("receive")+"<-"+tr("Anycast")+":"+tr("success")); + } + send->close(); + delete send; +} diff --git a/LedOK/device/ctrltestpanel.h b/LedOK/device/ctrltestpanel.h new file mode 100644 index 0000000..45ea1ac --- /dev/null +++ b/LedOK/device/ctrltestpanel.h @@ -0,0 +1,68 @@ +#ifndef CTRLTESTPANEL_H +#define CTRLTESTPANEL_H + +#include "globaldefine.h" +#include +#include +#include +#include +#include +#include +#include + +class CtrlTestPanel : public QWidget { + Q_OBJECT +public: + explicit CtrlTestPanel(QWidget *parent = nullptr); +protected: + void changeEvent(QEvent *) override; + void transUi(); +signals: + void sigSend(QJsonObject &,QString); +private: + void SendAnycastCmd(LedCard, int, bool); + + QLabel *labelTestScreen; + QGroupBox *groupBox; + QRadioButton *radioButtonRed; + QRadioButton *radioButtonGreen; + QRadioButton *radioButtonBlue; + QRadioButton *radioButtonWhite; + QCheckBox *checkBoxVertical; + QCheckBox *checkBoxSlash; + QCheckBox *checkBoxHorizontal; + QLabel *label; + QSpinBox *spinBoxLineSpeed; + QLabel *label_5; + QLabel *label_2; + QSpinBox *spinBoxLineDistance; + QLabel *label_6; + QPushButton *pushButtonStartLine; + QGroupBox *groupBox_2; + QCheckBox *checkBoxShowInfo; + QCheckBox *checkBox_red; + QCheckBox *checkBox_green; + QCheckBox *checkBox_blue; + QCheckBox *checkBox_white; + QLabel *label_3; + QSpinBox *spinBoxGraySpeed; + QLabel *label_8; + QLabel *label_4; + QSpinBox *spinBoxGrayValue; + QLabel *label_7; + QPushButton *pushButtonStartGray; + QGroupBox *groupBox_3; + QCheckBox *checkBoxGradient; + QRadioButton *radioButton_red; + QRadioButton *radioButton_Green; + QRadioButton *radioButton_Blue; + QRadioButton *radioButton_White; + QPushButton *pushButtonStartColor; + QPushButton *pushButtonStopTest; + QLineEdit *lineEdit; + QPushButton *pushButton_11; + QPushButton *pushButton_12; + QPushButton *pushButton_13; +}; + +#endif // CTRLTESTPANEL_H diff --git a/LedOK/device/ctrlverifyclockpanel.cpp b/LedOK/device/ctrlverifyclockpanel.cpp index 7bdcafb..eb0ff13 100644 --- a/LedOK/device/ctrlverifyclockpanel.cpp +++ b/LedOK/device/ctrlverifyclockpanel.cpp @@ -1,11 +1,13 @@ #include "ctrlverifyclockpanel.h" #include "base/waitingdlg.h" +#include "gutil/qnetwork.h" #include "globaldefine.h" #include "gutil/qgui.h" #include "tools.h" #include #include #include +#include "devicepanel.h" CtrlVerifyClockPanel::CtrlVerifyClockPanel(QWidget *parent) : QWidget(parent) { auto vBox = new VBox(this); @@ -103,7 +105,7 @@ CtrlVerifyClockPanel::CtrlVerifyClockPanel(QWidget *parent) : QWidget(parent) { fdTimeZoneSet = new QPushButton; connect(fdTimeZoneSet, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } @@ -111,14 +113,14 @@ CtrlVerifyClockPanel::CtrlVerifyClockPanel(QWidget *parent) : QWidget(parent) { json.insert("_id", "SetTimezone"); json.insert("_type", "SetTimezone"); json.insert("timezone", fdTimezone->currentText()); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("SetTimezone")); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [=] { Def_CtrlSetReqAfter }); } else { - foreach(auto card, *gSelCards) { + foreach(auto card, gSelCards) { Def_CtrlSetMulti(tr("SetTimezone")) } } @@ -137,7 +139,7 @@ CtrlVerifyClockPanel::CtrlVerifyClockPanel(QWidget *parent) : QWidget(parent) { btnLangSet = new QPushButton; connect(btnLangSet, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } @@ -145,14 +147,14 @@ CtrlVerifyClockPanel::CtrlVerifyClockPanel(QWidget *parent) : QWidget(parent) { json.insert("_id", "SetLanguage"); json.insert("_type", "SetLanguage"); json.insert("language", fdIsCn->isChecked() ? 1 : 0); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, "设置语言"); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [=] { Def_CtrlSetReqAfter }); } else { - foreach(auto card, *gSelCards) { + foreach(auto card, gSelCards) { Def_CtrlSetMulti("设置语言") } } @@ -161,14 +163,14 @@ CtrlVerifyClockPanel::CtrlVerifyClockPanel(QWidget *parent) : QWidget(parent) { btnLangGet = new QPushButton; connect(btnLangGet, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } QJsonObject json; json.insert("_id", "GetLanguage"); json.insert("_type", "GetLanguage"); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, "获取语言"); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [this, reply, waitingDlg] { @@ -178,9 +180,9 @@ CtrlVerifyClockPanel::CtrlVerifyClockPanel(QWidget *parent) : QWidget(parent) { else fdIsEn->setChecked(true); }); } else { - foreach(auto card, *gSelCards) { - auto reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); - auto cardId = card->m_strCardId; + foreach(auto card, gSelCards) { + auto reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json); + auto cardId = card.id; connect(reply, &QNetworkReply::finished, this, [reply, cardId] { QJsonDocument json; QString err = checkReplyForJson(reply, &json); @@ -209,7 +211,7 @@ CtrlVerifyClockPanel::CtrlVerifyClockPanel(QWidget *parent) : QWidget(parent) { btnSyncTime = new QPushButton(tr("Verify to Computer time")); btnSyncTime->setMinimumSize(QSize(60, 30)); connect(btnSyncTime, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } @@ -217,14 +219,14 @@ CtrlVerifyClockPanel::CtrlVerifyClockPanel(QWidget *parent) : QWidget(parent) { json.insert("_id", "SyncTime"); json.insert("_type", "SyncTime"); json.insert("time", QDateTime::currentDateTime().toMSecsSinceEpoch()); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("SyncTime")); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [=] { Def_CtrlSetReqAfter }); } else { - foreach(auto card, *gSelCards) { + foreach(auto card, gSelCards) { Def_CtrlSetMulti(tr("SyncTime")) } } @@ -240,14 +242,14 @@ CtrlVerifyClockPanel::CtrlVerifyClockPanel(QWidget *parent) : QWidget(parent) { btnDateGet = new QPushButton; btnDateGet->setMinimumSize(QSize(0, 30)); connect(btnDateGet, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } QJsonObject json; json.insert("_id", "GetControllerDate"); json.insert("_type", "GetControllerDate"); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("GetControllerDate")); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [this, reply, waitingDlg] { @@ -256,9 +258,9 @@ CtrlVerifyClockPanel::CtrlVerifyClockPanel(QWidget *parent) : QWidget(parent) { labelCurTime->setText(json["date"].toString()); }); } else { - foreach(auto card, *gSelCards) { - auto reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); - auto cardId = card->m_strCardId; + foreach(auto card, gSelCards) { + auto reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json); + auto cardId = card.id; connect(reply, &QNetworkReply::finished, this, [reply, cardId] { QJsonDocument json; QString err = checkReplyForJson(reply, &json); @@ -362,7 +364,7 @@ CtrlVerifyClockPanel::CtrlVerifyClockPanel(QWidget *parent) : QWidget(parent) { btnSyncSet = new QPushButton(groupBox); btnSyncSet->setMinimumSize(QSize(60, 30)); connect(btnSyncSet, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } @@ -381,14 +383,14 @@ CtrlVerifyClockPanel::CtrlVerifyClockPanel(QWidget *parent) : QWidget(parent) { json.insert("checkNtpTime", lineEdit_3->text().toInt()); } else if(fdIsGPS->isChecked()) json.insert("time", "gps"); else if(fdIsLan->isChecked()) json.insert("time", "Lan"); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("SetingSyncMethod")); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [=] { Def_CtrlSetReqAfter }); } else { - foreach(auto card, *gSelCards) { + foreach(auto card, gSelCards) { Def_CtrlSetMulti(tr("SetingSyncMethod")) } } @@ -398,14 +400,14 @@ CtrlVerifyClockPanel::CtrlVerifyClockPanel(QWidget *parent) : QWidget(parent) { fdSyncGet = new QPushButton; fdSyncGet->setMinimumSize(QSize(60, 30)); connect(fdSyncGet, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } QJsonObject json; json.insert("_id", "GetingSyncMethod"); json.insert("_type", "GetingSyncMethod"); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("GetingSyncMethod")); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [this, reply, waitingDlg] { @@ -414,9 +416,9 @@ CtrlVerifyClockPanel::CtrlVerifyClockPanel(QWidget *parent) : QWidget(parent) { dealGetSync(json); }); } else { - foreach(auto card, *gSelCards) { - auto reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); - auto cardId = card->m_strCardId; + foreach(auto card, gSelCards) { + auto reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json); + auto cardId = card.id; connect(reply, &QNetworkReply::finished, this, [reply, cardId] { QJsonDocument json; QByteArray data; @@ -484,7 +486,7 @@ CtrlVerifyClockPanel::CtrlVerifyClockPanel(QWidget *parent) : QWidget(parent) { btnLoraMasterSet = new QPushButton(groupBox); btnLoraMasterSet->setMinimumSize(QSize(0, 30)); connect(btnLoraMasterSet, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } @@ -493,18 +495,18 @@ CtrlVerifyClockPanel::CtrlVerifyClockPanel(QWidget *parent) : QWidget(parent) { json.insert("_type", "MasterSlaveSwitch"); bool isMaster = buttonGroup_2->checkedId()==0; json.insert("master", isMaster); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, isMaster ? tr("MasterSwitch ") : tr("SlaveSwitch ")); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [=] { Def_CtrlSetReqAfter }); } else { - foreach(auto card, *gSelCards) { - auto reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); + foreach(auto card, gSelCards) { + auto reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json); connect(reply, &QNetworkReply::finished, this, [reply, card, isMaster] { QString err = checkReplyForJson(reply); - gFdResInfo->append(card->m_strCardId+" "+(isMaster ? tr("MasterSwitch ") : tr("SlaveSwitch "))+" "+(err.isEmpty()?QCoreApplication::translate("Def","Success"):err)); + gFdResInfo->append(card.id+" "+(isMaster ? tr("MasterSwitch ") : tr("SlaveSwitch "))+" "+(err.isEmpty()?QCoreApplication::translate("Def","Success"):err)); }); } } @@ -514,14 +516,14 @@ CtrlVerifyClockPanel::CtrlVerifyClockPanel(QWidget *parent) : QWidget(parent) { btnLoraMasterGet = new QPushButton(groupBox); btnLoraMasterGet->setMinimumSize(QSize(0, 30)); connect(btnLoraMasterGet, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } QJsonObject json; json.insert("_id", "IsMasterSlave"); json.insert("_type", "IsMasterSlave"); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("IsMasterSlave")); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [this, reply, waitingDlg] { @@ -532,9 +534,9 @@ CtrlVerifyClockPanel::CtrlVerifyClockPanel(QWidget *parent) : QWidget(parent) { fdSlave->setChecked(! isMaster); }); } else { - foreach(auto card, *gSelCards) { - auto reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); - auto cardId = card->m_strCardId; + foreach(auto card, gSelCards) { + auto reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json); + auto cardId = card.id; connect(reply, &QNetworkReply::finished, this, [reply, cardId] { QJsonDocument json; QString err = checkReplyForJson(reply, &json); @@ -572,7 +574,7 @@ CtrlVerifyClockPanel::CtrlVerifyClockPanel(QWidget *parent) : QWidget(parent) { btnNtpSet = new QPushButton; btnNtpSet->setMinimumSize(QSize(60, 30)); connect(btnNtpSet, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } @@ -580,14 +582,14 @@ CtrlVerifyClockPanel::CtrlVerifyClockPanel(QWidget *parent) : QWidget(parent) { json.insert("_id", "SetNtpServer"); json.insert("_type", "SetNtpServer"); json.insert("ntpServer", fdNtpServer->text()); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("SetNtpServer")); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [=] { Def_CtrlSetReqAfter }); } else { - foreach(auto card, *gSelCards) { + foreach(auto card, gSelCards) { Def_CtrlSetMulti(tr("SetNtpServer")) } } @@ -597,14 +599,14 @@ CtrlVerifyClockPanel::CtrlVerifyClockPanel(QWidget *parent) : QWidget(parent) { btnNtpGet = new QPushButton; btnNtpGet->setMinimumSize(QSize(60, 30)); connect(btnNtpGet, &QPushButton::clicked, this, [this] { - if(gSelCards->isEmpty()) { + if(gSelCards.isEmpty()) { QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); return; } QJsonObject json; json.insert("_id", "GetNtpServer"); json.insert("_type", "GetNtpServer"); - if(gSelCards->count() == 1) { + if(gSelCards.count() == 1) { auto waitingDlg = new WaitingDlg(this, tr("GetNtpServer")); Def_CtrlReqPre connect(reply, &QNetworkReply::finished, this, [this, reply, waitingDlg] { @@ -613,9 +615,9 @@ CtrlVerifyClockPanel::CtrlVerifyClockPanel(QWidget *parent) : QWidget(parent) { fdNtpServer->setText(json["ntpServer"].toString()); }); } else { - foreach(auto card, *gSelCards) { - auto reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); - auto cardId = card->m_strCardId; + foreach(auto card, gSelCards) { + auto reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json); + auto cardId = card.id; connect(reply, &QNetworkReply::finished, this, [reply, cardId] { QJsonDocument json; QString err = checkReplyForJson(reply, &json); @@ -673,14 +675,14 @@ void CtrlVerifyClockPanel::showEvent(QShowEvent *event) { init(); } void CtrlVerifyClockPanel::init() { - bool isSingle = gSelCards->count()==1; + bool isSingle = gSelCards.count()==1; if(! isSingle) return; - auto card = gSelCards->at(0); + auto card = gSelCards[0]; QJsonObject json; json.insert("_id", "GetingSyncMethod"); json.insert("_type", "GetingSyncMethod"); - auto reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); + auto reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json); connect(reply, &QNetworkReply::finished, this, [this, reply] { QJsonDocument json; QString err = checkReplyForJson(reply, &json); @@ -691,7 +693,7 @@ void CtrlVerifyClockPanel::init() { json = QJsonObject(); json.insert("_id", "GetTimezone"); json.insert("_type", "GetTimezone"); - reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); + reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json); connect(reply, &QNetworkReply::finished, this, [this, reply] { QJsonDocument json; QString err = checkReplyForJson(reply, &json); @@ -702,7 +704,7 @@ void CtrlVerifyClockPanel::init() { json = QJsonObject(); json.insert("_id", "GetLanguage"); json.insert("_type", "GetLanguage"); - reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); + reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json); connect(reply, &QNetworkReply::finished, this, [this, reply] { QJsonDocument json; QString err = checkReplyForJson(reply, &json); diff --git a/LedOK/device/ctrlverifyclockpanel.h b/LedOK/device/ctrlverifyclockpanel.h index 135b359..df0c2d7 100644 --- a/LedOK/device/ctrlverifyclockpanel.h +++ b/LedOK/device/ctrlverifyclockpanel.h @@ -1,14 +1,13 @@ #ifndef CTRLVERIFYCLOCKPANEL_H #define CTRLVERIFYCLOCKPANEL_H -#include "ledcard.h" -#include -#include #include #include #include #include #include +#include +#include class CtrlVerifyClockPanel : public QWidget { Q_OBJECT diff --git a/LedOK/device/ctrlvolumepanel.cpp b/LedOK/device/ctrlvolumepanel.cpp new file mode 100644 index 0000000..a5f55e1 --- /dev/null +++ b/LedOK/device/ctrlvolumepanel.cpp @@ -0,0 +1,450 @@ +#include "ctrlvolumepanel.h" +#include "globaldefine.h" +#include "base/waitingdlg.h" +#include "gutil/qnetwork.h" +#include "tools.h" +#include +#include +#include +#include +#include "devicepanel.h" + +CtrlVolumePanel::CtrlVolumePanel() { + auto vBox = new VBox(this); + + lbVolumeControl = new QLabel; + lbVolumeControl->setAlignment(Qt::AlignCenter); + vBox->addWidget(lbVolumeControl); + + auto hBox = new HBox(vBox); + hBox->addStretch(); + + fdManual = new QRadioButton; + hBox->addWidget(fdManual); + hBox->addSpacing(40); + + fdSchedule = new QRadioButton; + hBox->addWidget(fdSchedule); + hBox->addStretch(); + + auto stack = new QStackedLayout(vBox); + { + auto vBox = new VBox(stack); + vBox->addSpacing(20); + + auto hBox = new HBox(vBox); + hBox->addStretch(); + + lbVolume = new QLabel; + hBox->addWidget(lbVolume); + + fdVolume = new QSlider(Qt::Horizontal); + fdVolume->setTickPosition(QSlider::TicksAbove); + fdVolume->setRange(0, 15); + connect(fdVolume, &QSlider::sliderReleased, this, [=] { + if(gSelCards.isEmpty()) { + QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); + return; + } + QJsonObject json; + json.insert("_id", "SetVolume"); + json.insert("_type", "SetVolume"); + json.insert("volume", fdVolume->value()); + if(gSelCards.count() == 1) { + auto waitingDlg = new WaitingDlg(this, tr("SetVolume")+" ..."); + Def_CtrlReqPre + connect(reply, &QNetworkReply::finished, this, [=] { + Def_CtrlSetReqAfter + }); + } else { + foreach(auto card, gSelCards) { + Def_CtrlSetMulti(tr("SetVolume")) + } + } + }); + hBox->addWidget(fdVolume); + + auto lbCurVol = new QLabel; + lbCurVol->setMinimumWidth(30); + connect(fdVolume, &QSlider::valueChanged, lbCurVol, (void(QLabel::*)(int))&QLabel::setNum); + hBox->addWidget(lbCurVol); + hBox->addStretch(); + + fdVolumeGet = new QPushButton; + fdVolumeGet->setMinimumSize(QSize(60, 30)); + fdVolumeGet->setProperty("ssType", "progManageTool"); + connect(fdVolumeGet, &QPushButton::clicked, this, [=] { + if(gSelCards.isEmpty()) { + QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); + return; + } + QJsonObject json; + json.insert("_id", "GetVolume"); + json.insert("_type", "GetVolume"); + if(gSelCards.count() == 1) { + auto waitingDlg = new WaitingDlg(this, tr("GetVolume")+" ..."); + Def_CtrlReqPre + connect(reply, &QNetworkReply::finished, this, [this, reply, waitingDlg] { + Def_CtrlSingleGetReply + waitingDlg->success(); + fdVolume->setValue(json["volume"].toInt()); + }); + } else { + foreach(auto card, gSelCards) { + auto reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json); + auto cardId = card.id; + connect(reply, &QNetworkReply::finished, this, [reply, cardId] { + QJsonDocument json; + QString err = checkReplyForJson(reply, &json); + if(err.isEmpty()) err = QString::number(json["volume"].toInt()); + gFdResInfo->append(cardId+" "+tr("GetVolume")+" "+err); + }); + } + } + }); + vBox->addWidget(fdVolumeGet, 0, Qt::AlignCenter); + vBox->addStretch(); + } + { + auto vBox = new VBox(stack); + hBox = new HBox(vBox); + + fdScheTip = new QLabel; + fdScheTip->setWordWrap(true); + hBox->addWidget(fdScheTip); + + + hBox = new HBox(vBox); + + btnScheAdd = new QPushButton; + btnScheAdd->setMinimumSize(60, 30); + btnScheAdd->setProperty("ssType", "progManageTool"); + connect(btnScheAdd, &QPushButton::clicked, this, [this] { + int row = tableSche->appendRow(); + + auto cellWgt = new QWidget; + auto hBox = new QHBoxLayout(cellWgt); + + auto slider = new QSlider(Qt::Horizontal); + slider->setRange(0, 15); + slider->setValue(10); + hBox->addWidget(slider); + + auto lb = new QLabel(QString::number(slider->value())); + connect(slider, &QSlider::valueChanged, lb, (void(QLabel::*)(int))&QLabel::setNum); + hBox->addWidget(lb); + + tableSche->setCellWidget(row, "vol", cellWgt); + + auto timeEdit = new QTimeEdit(QTime(0, 0)); + timeEdit->setDisplayFormat("HH:mm"); + timeEdit->setAlignment(Qt::AlignCenter); + tableSche->setCellWidget(row, "start", timeEdit); + + timeEdit = new QTimeEdit(QTime(1, 0)); + timeEdit->setDisplayFormat("HH:mm"); + timeEdit->setAlignment(Qt::AlignCenter); + tableSche->setCellWidget(row, "end", timeEdit); + + for(int i=0; i<7; i++) { + auto fd = new QCheckBox; + fd->setChecked(true); + tableSche->setCellWidget(row, QString::number(i), fd); + } + }); + hBox->addWidget(btnScheAdd); + + btnScheDel = new QPushButton; + btnScheDel->setMinimumSize(60, 30); + btnScheDel->setProperty("ssType", "progManageTool"); + connect(btnScheDel, &QPushButton::clicked, this, [this] { + auto selected = tableSche->selectedRanges(); + if(! selected.isEmpty()) tableSche->model()->removeRows(selected[0].topRow(), selected[0].rowCount()); + }); + hBox->addWidget(btnScheDel); + + btnScheClear = new QPushButton; + btnScheClear->setMinimumSize(60, 30); + btnScheClear->setProperty("ssType", "progManageTool"); + connect(btnScheClear, &QPushButton::clicked, this, [this] {tableSche->setRowCount(0);}); + hBox->addWidget(btnScheClear); + + lbDefBright = new QLabel; + hBox->addWidget(lbDefBright); + + fdDefBright = new QSlider(Qt::Horizontal); + fdDefBright->setFixedWidth(120); + fdDefBright->setRange(0, 15); + fdDefBright->setValue(10); + hBox->addWidget(fdDefBright); + + auto lbDefBrightValue = new QLabel; + lbDefBrightValue->setNum(fdDefBright->value()); + lbDefBrightValue->setMinimumWidth(30); + lbDefBrightValue->setAlignment(Qt::AlignRight | Qt::AlignVCenter); + connect(fdDefBright, &QSlider::valueChanged, lbDefBrightValue, (void(QLabel::*)(int))&QLabel::setNum); + hBox->addWidget(lbDefBrightValue); + + hBox->addStretch(); + + btnScheImport = new QPushButton; + btnScheImport->setMinimumSize(QSize(60, 30)); + btnScheImport->setProperty("ssType", "progManageTool"); + connect(btnScheImport, &QPushButton::clicked, this, [this] { + auto dir = QSettings().value("CtrlScheduleDir").toString(); + if(dir.isEmpty()) dir = "/"; + QString scheFile = QFileDialog::getOpenFileName(this, tr("Import File"), dir, tr("Volume Schedule (*.vols)")); + if(scheFile.isEmpty()) return; + QFile scheQFile(scheFile); + if(! scheQFile.open(QIODevice::ReadOnly)) return; + auto data = scheQFile.readAll(); + scheQFile.close(); + restoreScheduleJson(QJsonDocument::fromJson(data).object()); + }); + hBox->addWidget(btnScheImport); + + btnScheExport = new QPushButton; + btnScheExport->setMinimumSize(QSize(60, 30)); + btnScheExport->setProperty("ssType", "progManageTool"); + connect(btnScheExport, &QPushButton::clicked, this, [this] { + QSettings settings; + auto dir = settings.value("CtrlScheduleDir").toString(); + if(dir.isEmpty()) dir = "/"; + QString scheFile = QFileDialog::getSaveFileName(this, tr("Save File"), dir, tr("Volume Schedule (*.vols)")); + if(scheFile.isEmpty()) return; + settings.setValue("CtrlScheduleDir", QFileInfo(scheFile).absolutePath()); + QFile scheQFile(scheFile); + if(! scheQFile.open(QIODevice::WriteOnly)) return; + scheQFile.write(QJsonDocument(getScheduleJson()).toJson()); + scheQFile.close(); + }); + hBox->addWidget(btnScheExport); + + tableSche = new Table({ + {"vol", "", 300}, + {"start", "", 100}, + {"end", "", 100}, + {"0", "", 60}, + {"1", "", 60}, + {"2", "", 60}, + {"3", "", 60}, + {"4", "", 60}, + {"5", "", 60}, + {"6", "", 60} + }); + tableSche->setDefs(); + vBox->addWidget(tableSche); + + hBox = new HBox(vBox); + hBox->addStretch(); + + btnScheSet = new QPushButton; + btnScheSet->setMinimumSize(QSize(60, 30)); + btnScheSet->setProperty("ssType", "progManageTool"); + connect(btnScheSet, &QPushButton::clicked, this, [this] { + if(gSelCards.isEmpty()) { + QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); + return; + } + QJsonObject json; + json.insert("_id", "SetAutoVolumeTask"); + json.insert("_type", "SetAutoVolumeTask"); + json.insert("taskVolume", getScheduleJson()); + if(gSelCards.count() == 1) { + auto waitingDlg = new WaitingDlg(this, tr("SetAutoVolumeTask")); + Def_CtrlReqPre; + connect(reply, &QNetworkReply::finished, this, [=] { + Def_CtrlSetReqAfter + }); + } else { + foreach(auto card, gSelCards) { + Def_CtrlSetMulti(tr("SetAutoVolumeTask")) + } + } + }); + hBox->addWidget(btnScheSet); + + hBox->addStretch(); + + btnScheGet = new QPushButton; + btnScheGet->setMinimumSize(QSize(60, 30)); + btnScheGet->setProperty("ssType", "progManageTool"); + connect(btnScheGet, &QPushButton::clicked, this, [this] { + if(gSelCards.isEmpty()) { + QMessageBox::information(this, tr("Tip"), tr("NoSelectedController")); + return; + } + QJsonObject json; + json.insert("_id", "GetAutoVolumeTask"); + json.insert("_type", "GetAutoVolumeTask"); + if(gSelCards.count() == 1) { + auto waitingDlg = new WaitingDlg(this, tr("GetAutoVolumeTask")); + Def_CtrlReqPre + connect(reply, &QNetworkReply::finished, this, [this, reply, waitingDlg, card] { + Def_CtrlSingleGetReply + waitingDlg->success(); + restoreScheduleJson(json["taskVolume"].toObject()); + }); + } + }); + hBox->addWidget(btnScheGet); + + hBox->addStretch(); + } + + connect(fdSchedule, &QRadioButton::toggled, stack, &QStackedLayout::setCurrentIndex); + fdManual->setChecked(true); + + connect(gDevicePanel, &DevicePanel::sigSelectedDeviceList, this, [this] { + if(isVisible()) init(); + }); + transUi(); +} + +void CtrlVolumePanel::showEvent(QShowEvent *event) { + QWidget::showEvent(event); + init(); +} +void CtrlVolumePanel::init() { + bool isSingle = gSelCards.count()==1; + btnScheGet->setEnabled(isSingle); + if(! isSingle) return; + auto card = gSelCards[0]; + + QJsonObject json; + json.insert("_id", "GetVolume"); + json.insert("_type", "GetVolume"); + auto reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json); + connect(reply, &QNetworkReply::finished, this, [this, reply] { + QJsonDocument json; + QString err = checkReplyForJson(reply, &json); + if(! err.isEmpty()) return; + fdVolume->setValue(json["volume"].toInt()); + }); + + json = QJsonObject(); + json.insert("_id", "GetAutoVolumeTask"); + json.insert("_type", "GetAutoVolumeTask"); + reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json); + connect(reply, &QNetworkReply::finished, this, [this, reply, card] { + QJsonDocument json; + QString err = checkReplyForJson(reply, &json); + if(! err.isEmpty()) return; + if(restoreScheduleJson(json["taskVolume"].toObject())) fdSchedule->setChecked(true); + else fdManual->setChecked(true); + }); +} + +void CtrlVolumePanel::changeEvent(QEvent *event) { + QWidget::changeEvent(event); + if(event->type() == QEvent::LanguageChange) transUi(); +} +void CtrlVolumePanel::transUi() { + lbVolumeControl->setText(tr("Volume Control")); + fdManual->setText(tr("Manual")); + fdSchedule->setText(tr("Schedule")); + + lbVolume->setText(tr("Volume")); + fdVolumeGet->setText(tr("Readback")); + + lbDefBright->setText(tr("Default volume")); + btnScheAdd->setText(tr("Add")); + btnScheClear->setText(tr("Clear")); + btnScheDel->setText(tr("Delete")); + btnScheImport->setText(tr("Import")); + btnScheExport->setText(tr("Export")); + + tableSche->setHeaderText("vol", tr("Volume value")); + tableSche->setHeaderText("start", tr("Start Time")); + tableSche->setHeaderText("end", tr("End Time")); + tableSche->setHeaderText("0", tr("SUN")); + tableSche->setHeaderText("1", tr("MON")); + tableSche->setHeaderText("2", tr("TUE")); + tableSche->setHeaderText("3", tr("WED")); + tableSche->setHeaderText("4", tr("THU")); + tableSche->setHeaderText("5", tr("FRI")); + tableSche->setHeaderText("6", tr("SAT")); + + btnScheSet->setText(tr("Apply")); + btnScheGet->setText(tr("Readback")); + fdScheTip->setText(tr("Default volume tip")); +} + +bool CtrlVolumePanel::restoreScheduleJson(QJsonObject json) { + tableSche->setRowCount(0); + fdDefBright->setValue(json["defaultVolume"].toInt()); + auto items = json["items"].toArray(); + for(int i=0; irowCount(); + tableSche->insertRow(row); + + auto cellWgt = new QWidget; + auto hBox = new QHBoxLayout(cellWgt); + + auto slider = new QSlider(Qt::Horizontal); + slider->setRange(0, 15); + slider->setValue(items.at(i)["volume"].toInt()); + hBox->addWidget(slider); + + auto lb = new QLabel; + lb->setNum(slider->value()); + connect(slider, &QSlider::valueChanged, lb, (void(QLabel::*)(int))&QLabel::setNum); + hBox->addWidget(lb); + tableSche->setCellWidget(row, "vol", cellWgt); + + auto timeEdit = new QTimeEdit(QTime::fromString(schedule["startTime"].toString(), "HH:mm")); + timeEdit->setDisplayFormat("HH:mm"); + timeEdit->setAlignment(Qt::AlignCenter); + tableSche->setCellWidget(row, "start", timeEdit); + + timeEdit = new QTimeEdit(QTime::fromString(schedule["endTime"].toString(), "HH:mm")); + timeEdit->setDisplayFormat("HH:mm"); + timeEdit->setAlignment(Qt::AlignCenter); + tableSche->setCellWidget(row, "end", timeEdit); + + if(schedule["filterType"].toString()=="None") for(int i=0; i<7; i++) { + auto fd = new QCheckBox; + fd->setChecked(true); + tableSche->setCellWidget(row, QString::number(i), fd); + } else if(schedule["filterType"].toString()=="Week") { + auto weekFilter = schedule["weekFilter"].toArray(); + for(int i=0; i<7; i++) { + auto fd = new QCheckBox; + if(weekFilter.contains(i)) fd->setChecked(true); + tableSche->setCellWidget(row, QString::number(i), fd); + } + } + } + return items.count() > 0; +} +QJsonObject CtrlVolumePanel::getScheduleJson() { + QJsonArray items; + for(int i=0; irowCount(); i++) { + QJsonObject item; + item.insert("volume", static_cast(tableSche->cellWidget(i, "vol")->layout()->itemAt(0)->widget())->value()); + QJsonObject schedule; + schedule["timeType"] = "Range"; + schedule["startTime"] = static_cast(tableSche->cellWidget(i, "start"))->text(); + schedule["endTime"] = static_cast(tableSche->cellWidget(i, "end"))->text(); + schedule["dateType"] = "All"; + schedule["monthFilter"] = QJsonArray(); + QJsonArray weekFilter; + for(int d=0; d<7; d++) if(static_cast(tableSche->cellWidget(i, QString::number(d)))->isChecked()) weekFilter.append(d); + if(weekFilter.size()>=7) { + schedule["filterType"] = "None"; + weekFilter = QJsonArray(); + } else schedule["filterType"] = "Week"; + schedule["weekFilter"] = weekFilter; + item.insert("schedules", QJsonArray{schedule}); + items.append(item); + } + auto def = fdDefBright->value(); + return QJsonObject{ + {"createBy", "alahover"}, + {"name", "TimingVolume"}, + {"defaultVolume", def}, + {"volume", def}, + {"items", items} + }; +} diff --git a/LedOK/device/ctrlvolumepanel.h b/LedOK/device/ctrlvolumepanel.h new file mode 100644 index 0000000..c765331 --- /dev/null +++ b/LedOK/device/ctrlvolumepanel.h @@ -0,0 +1,44 @@ +#ifndef CTRLVOLUMEPANEL_H +#define CTRLVOLUMEPANEL_H + +#include "gutil/qgui.h" +#include +#include +#include + +class CtrlVolumePanel : public QWidget { + Q_OBJECT +public: + CtrlVolumePanel(); +protected: + void showEvent(QShowEvent *event) override; + void init(); + void changeEvent(QEvent *) override; + void transUi(); + +private: + bool restoreScheduleJson(QJsonObject); + QJsonObject getScheduleJson(); + + QLabel *lbVolumeControl; + QRadioButton *fdManual; + QRadioButton *fdSchedule; + + QLabel *lbVolume; + QSlider *fdVolume; + QPushButton *fdVolumeGet; + + QLabel *fdScheTip; + QPushButton *btnScheAdd; + QPushButton *btnScheDel; + QPushButton *btnScheClear; + QLabel *lbDefBright; + QSlider *fdDefBright; + QPushButton *btnScheImport; + QPushButton *btnScheExport; + Table *tableSche; + QPushButton *btnScheSet; + QPushButton *btnScheGet; +}; + +#endif // CTRLVOLUMEPANEL_H diff --git a/LedOK/device/ledcard.cpp b/LedOK/device/ledcard.cpp deleted file mode 100644 index f045a4b..0000000 --- a/LedOK/device/ledcard.cpp +++ /dev/null @@ -1,48 +0,0 @@ -#include "ledcard.h" - -LedCard::LedCard(QObject *p) : QObject(p) { - -} - -void LedCard::copyLedCardHTTPGetParam(LedCard *p) -{ - m_strCardId = p->m_strCardId; - m_strCardIp = p->m_strCardIp; - if(p->m_strCardRemarkName!="") - m_strCardRemarkName=p->m_strCardRemarkName; - starterversionName = p->starterversionName ; - starterPort = p->starterPort ; - androidVersion = p->androidVersion ; - iHttpGetId = p->iHttpGetId ; - androidHeight = p->androidHeight ; - androidWidth = p->androidWidth ; - lastActive = p->lastActive ; -} -void LedCard::copyLedCardHTTPPostParam(LedCard *p) -{ - strIMEI =p->strIMEI ; - HardVersion =p->HardVersion ; - BrightnessLevel =p->BrightnessLevel ; - ScreenResolution =p->ScreenResolution ; - FirmwareVersion =p->FirmwareVersion ; -} -bool LedCard::CompareHTTPGetParam(LedCard *p) { - //这里只比较httpGet devicelist打算应答 - if(m_strCardIp!=p->m_strCardIp) return false; - if(m_strCardRemarkName!=p->m_strCardRemarkName) return false; - if(starterversionName!=p->starterversionName) return false; - if(androidVersion!=p->androidVersion) return false; - if(androidWidth!=p->androidWidth) return false; - if(androidHeight!=p->androidHeight) return false; - return true; -} -bool LedCard::CompareHTTPPostParam(LedCard *p) -{ - //这里只比较httpGet devicelist打算应答 - if(strIMEI!=p->strIMEI) return false; - if(HardVersion!=p->HardVersion) return false; - if(BrightnessLevel!=p->BrightnessLevel) return false; - if(ScreenResolution!=p->ScreenResolution) return false; - if(FirmwareVersion!=p->FirmwareVersion) return false; - return true; -} diff --git a/LedOK/device/ledcard.h b/LedOK/device/ledcard.h deleted file mode 100644 index faefbb4..0000000 --- a/LedOK/device/ledcard.h +++ /dev/null @@ -1,60 +0,0 @@ -#ifndef LEDCARD_H -#define LEDCARD_H - -#include -#include -class LedCard : public QObject { - Q_OBJECT - Q_PROPERTY(QString strCardId MEMBER m_strCardId NOTIFY CardIdChanged) - Q_PROPERTY(QString strCardIp MEMBER m_strCardIp NOTIFY CardIpChanged) - Q_PROPERTY(qint32 iCardWidth MEMBER m_iWidth NOTIFY WidthChanged) - Q_PROPERTY(qint32 iCardHeight MEMBER m_iHeight NOTIFY HeightChanged) - Q_PROPERTY(QString strCardRemarkName MEMBER m_strCardRemarkName NOTIFY CardRemarkNameChanged) - -public: - LedCard(QObject *p = nullptr); - ~LedCard(){ - qDebug()<<"~~~~LedCard"; - } -signals: - void CardIdChanged(const QString &); - void CardIpChanged(const QString &); - void WidthChanged(qint32 t); - void HeightChanged(qint32 t); - void CardRemarkNameChanged(const QString &); -public: - //属性 - QString m_strCardId; - QString m_strCardIp; - qint32 m_iWidth = 0; - qint32 m_iHeight = 0; - QString m_strCardRemarkName = ""; - QString starterversionName = ""; - int starterPort = 0; - QString androidVersion = ""; - int iHttpGetId = 0; - int androidHeight = 0; - int bright{100}; - int androidWidth = 0; - int lastActive = 0; - QString strIMEI=""; - QString HardVersion="0000"; - int BrightnessLevel=255; - QString ScreenResolution=""; - QString FirmwareVersion=""; - QString strXixunplayerVersion=""; - int strXixunplayerVersionCode=0; - bool bPassword=false; - void copyLedCardHTTPGetParam(LedCard *p); - void copyLedCardHTTPPostParam(LedCard *p); - bool CompareHTTPGetParam(LedCard *p); - bool CompareHTTPPostParam(LedCard *p); - //状态 - bool m_bLockStatus=true; - bool m_bPowerStatus=true; - bool m_bOnLine=true; - - -}; - -#endif // LEDCARD_H diff --git a/LedOK/device/upgradeapkdialog.cpp b/LedOK/device/upgradeapkdialog.cpp index a5b18a1..9a2a658 100644 --- a/LedOK/device/upgradeapkdialog.cpp +++ b/LedOK/device/upgradeapkdialog.cpp @@ -3,7 +3,8 @@ #include "gutil/qgui.h" #include "gutil/qnetwork.h" #include "base/waitingdlg.h" -#include "tools.h" +#include "devicepanel.h" +#include "deviceitem.h" #include #include #include @@ -143,7 +144,7 @@ UpgradeApkDialog::UpgradeApkDialog(QWidget *parent) : QDialog(parent) { QMessageBox::information(this, tr("Tip"), tr("Is upgrading now. Please wait")); return; } - if(item->mCard->bPassword && item->mCard->m_bLockStatus && item->m_lockFlag) { + if(item->mCard.hasPassword && item->mCard.isLocked && item->m_lockFlag) { item->setResult(tr("This screen is encrypted"), Qt::red); return; } @@ -194,7 +195,7 @@ UpgradeApkDialog::UpgradeApkDialog(QWidget *parent) : QDialog(parent) { item->setResult(tr("Uploading")+" ..."); item->mProgress->setValue(0); item->isUpdating = true; - NetReq req("http://"+item->mCard->m_strCardIp+":2016/upload?type="+(isApk ? "software":"hardware")); + NetReq req("http://"+item->mCard.ip+":2016/upload?type="+(isApk ? "software":"hardware")); auto reply = req.timeout(120000).type("multipart/form-data; boundary="+Boundary).post(data); connect(reply, &QNetworkReply::uploadProgress, item->mProgress, [item](qint64 bytesSent, qint64 bytesTotal) { if(bytesTotal<=0) return; @@ -219,7 +220,7 @@ UpgradeApkDialog::UpgradeApkDialog(QWidget *parent) : QDialog(parent) { json.insert("_id", "SynchronousHardwareVersion"); json.insert("_type", "SynchronousHardwareVersion"); } - auto reply = NetReq("http://"+item->mCard->m_strCardIp+":2016/settings").timeout(120000).post(json); + auto reply = NetReq("http://"+item->mCard.ip+":2016/settings").timeout(120000).post(json); connect(reply, &QNetworkReply::finished, item->mProgress, [=] { item->isUpdating = false; QString err = errStrWithData(reply); @@ -271,7 +272,7 @@ UpgradeApkDialog::UpgradeApkDialog(QWidget *parent) : QDialog(parent) { json.insert("_id", "UninstallSoftware"); json.insert("_type", "UninstallSoftware"); json.insert("packageName", strApkName); - auto reply = NetReq("http://"+item->mCard->m_strCardIp+":2016/settings").timeout(120000).post(json); + auto reply = NetReq("http://"+item->mCard.ip+":2016/settings").timeout(120000).post(json); connect(reply, &QNetworkReply::finished, this, [reply, item, strApkName] { QString err = errStrWithData(reply); if(! err.isEmpty()) { @@ -297,7 +298,7 @@ UpgradeApkDialog::UpgradeApkDialog(QWidget *parent) : QDialog(parent) { json.insert("_id", "IsSoftwareRunning"); json.insert("_type", "IsSoftwareRunning"); json.insert("packageName", strApkName); - auto reply = NetReq("http://"+item->mCard->m_strCardIp+":2016/settings").timeout(120000).post(json); + auto reply = NetReq("http://"+item->mCard.ip+":2016/settings").timeout(120000).post(json); connect(reply, &QNetworkReply::finished, this, [reply, item, strApkName] { QJsonDocument json; QString err = errStrWithData(reply, &json); @@ -325,9 +326,9 @@ UpgradeApkDialog::UpgradeApkDialog(QWidget *parent) : QDialog(parent) { connect(btnRefresh, &QPushButton::clicked, this, [this, label] { table->clear(); table->onCheckAll(false); - int iCount = gDevicePanel->mLedCards.count(); - for(int i=0;imLedCards.at(i)); - label->setText(tr("All")+":"+QString::number(iCount)); + int cnt = gDevicePanel->mDeviceTable->topLevelItemCount(); + for(int i=0; i(gDevicePanel->mDeviceTable->topLevelItem(i))->mCard); + label->setText(tr("All")+":"+QString::number(cnt)); }); hBox->addWidget(btnRefresh); @@ -395,17 +396,17 @@ UpgradeApkDialog::UpgradeApkDialog(QWidget *parent) : QDialog(parent) { table->header()->setSectionResizeMode(Upgrade_CONNECTION_VERSION, QHeaderView::ResizeToContents); table->header()->setSectionResizeMode(Upgrade_UPDATE_VERSION, QHeaderView::ResizeToContents); - int iCount = gDevicePanel->mLedCards.count(); - for(int i=0; imLedCards.at(i)); - label->setText(tr("All")+":"+QString::number(iCount)); + int cnt = gDevicePanel->mDeviceTable->topLevelItemCount(); + for(int i=0; i(gDevicePanel->mDeviceTable->topLevelItem(i))->mCard); + label->setText(tr("All")+":"+QString::number(cnt)); } -void UpgradeApkDialog::onAddLedCard(LedCard *card) { +void UpgradeApkDialog::onAddLedCard(LedCard card) { int iExistFlg=0; int cnt = table->topLevelItemCount(); for(int i=0; i(table->topLevelItem(i))->mCard->m_strCardId; - if(strTempCardId == card->m_strCardId) { + QString strTempCardId=static_cast(table->topLevelItem(i))->mCard.id; + if(strTempCardId == card.id) { iExistFlg=1; static_cast(table->topLevelItem(i))->SetItemParam(card); break; diff --git a/LedOK/device/upgradeapkdialog.h b/LedOK/device/upgradeapkdialog.h index d5363c3..9e1d2c4 100644 --- a/LedOK/device/upgradeapkdialog.h +++ b/LedOK/device/upgradeapkdialog.h @@ -16,7 +16,7 @@ protected slots: void FilterProgram(const QString &strtemp); private: - void onAddLedCard(LedCard *p); + void onAddLedCard(LedCard p); LoQTreeWidget *table; QTreeWidgetItem *m_headerItem=nullptr; diff --git a/LedOK/device/wupgradeapkitem.cpp b/LedOK/device/wupgradeapkitem.cpp index f6d34c5..058f028 100644 --- a/LedOK/device/wupgradeapkitem.cpp +++ b/LedOK/device/wupgradeapkitem.cpp @@ -1,6 +1,8 @@ #include "wupgradeapkitem.h" #include "base/waitingdlg.h" +#include "deviceitem.h" #include "gutil/qgui.h" +#include "gutil/qnetwork.h" #include #include #include @@ -9,7 +11,7 @@ #include #include -wUpgradeApkItem::wUpgradeApkItem(LedCard *pLedCard, LoQTreeWidget *parent) : QTreeWidgetItem(UserType), mCard(pLedCard), m_parent(parent) { +wUpgradeApkItem::wUpgradeApkItem(LedCard pLedCard, LoQTreeWidget *parent) : QTreeWidgetItem(UserType), mCard(pLedCard), m_parent(parent) { setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled); setCheckState(0, Qt::Unchecked); m_parent->addTopLevelItem(this); @@ -30,7 +32,7 @@ wUpgradeApkItem::wUpgradeApkItem(LedCard *pLedCard, LoQTreeWidget *parent) : QTr vBox->addWidget(btnUnlock); m_parent->setItemWidget(this, Upgrade_ENCRYPT, wgt); QObject::connect(btnUnlock, &QPushButton::clicked, mProgress, [this] { - if(! mCard->m_bLockStatus) return; + if(! mCard.isLocked) return; bool ok; auto pwd = QInputDialog::getText(treeWidget(), QObject::tr("Input password"), QObject::tr("Input password"), QLineEdit::Password, QString(), &ok); if(! ok) return; @@ -40,7 +42,7 @@ wUpgradeApkItem::wUpgradeApkItem(LedCard *pLedCard, LoQTreeWidget *parent) : QTr json.insert("pwd", pwd); auto waitingDlg = new WaitingDlg(treeWidget(), QObject::tr("VerifyPassword")+" ..."); waitingDlg->show(); - auto reply = NetReq("http://"+mCard->m_strCardIp+":2016/settings").timeout(120000).post(json); + auto reply = NetReq("http://"+mCard.ip+":2016/settings").timeout(120000).post(json); waitingDlg->connAbort(reply); QObject::connect(reply, &QNetworkReply::finished, mProgress, [=] { QJsonDocument json; @@ -56,8 +58,13 @@ wUpgradeApkItem::wUpgradeApkItem(LedCard *pLedCard, LoQTreeWidget *parent) : QTr return; } waitingDlg->success(); - mCard->m_bLockStatus = false; + mCard.isLocked = false; btnUnlock->setIcon(QIcon(":/res/device/UnLock.png")); + auto item = findItem(mCard.id); + if(item) { + item->mCard.isLocked = false; + item->btnUnlock->setIcon(QIcon(":/res/device/UnLock.png")); + } }); }); @@ -68,7 +75,7 @@ void wUpgradeApkItem::OnCheckFpgaVersions() { QJsonObject json; json.insert("_id", "CheckHardwareVersions"); json.insert("_type", "CheckHardwareVersions"); - auto reply = NetReq("http://"+mCard->m_strCardIp+":2016/settings").timeout(120000).post(json); + auto reply = NetReq("http://"+mCard.ip+":2016/settings").timeout(120000).post(json); QObject::connect(reply, &QNetworkReply::finished, mProgress, [reply, this] { QJsonDocument json; QString err = checkReplyForJson(reply, &json); @@ -88,7 +95,7 @@ void wUpgradeApkItem::OnCheckSoftVersions() { QJsonObject json; json.insert("_id", "CheckSoftVersions"); json.insert("_type", "CheckSoftVersions"); - auto reply = NetReq("http://"+mCard->m_strCardIp+":2016/settings").timeout(120000).post(json); + auto reply = NetReq("http://"+mCard.ip+":2016/settings").timeout(120000).post(json); QObject::connect(reply, &QNetworkReply::finished, mProgress, [reply, this] { QJsonDocument json; QString err = checkReplyForJson(reply, &json); @@ -114,19 +121,19 @@ void wUpgradeApkItem::setResult(QString tip, QColor color) { setToolTip(Upgrade_Remark, tip); setForeground(Upgrade_Remark, color); } -void wUpgradeApkItem::SetItemParam(LedCard *card) { - mCard->m_strCardId = card->m_strCardId; - mCard->m_strCardIp = card->m_strCardIp; - mCard->m_bOnLine = card->m_bOnLine; - setData(Upgrade_SCREEN_ID, 0, card->m_strCardId); - setData(Upgrade_SCREEN_IP, 0, card->m_strCardIp); - setData(Upgrade_REMARK_NAME, 0, card->m_strCardRemarkName); - m_ImageOnline->setPixmap(QPixmap(mCard->m_bOnLine ? ":/res/device/O_Online.png" : ":/res/device/O_Offline.png")); +void wUpgradeApkItem::SetItemParam(LedCard card) { + mCard.id = card.id; + mCard.ip = card.ip; + mCard.isOnline = card.isOnline; + setData(Upgrade_SCREEN_ID, 0, card.id); + setData(Upgrade_SCREEN_IP, 0, card.ip); + setData(Upgrade_REMARK_NAME, 0, card.alias); + m_ImageOnline->setPixmap(QPixmap(mCard.isOnline ? ":/res/device/O_Online.png" : ":/res/device/O_Offline.png")); OnCheckSoftVersions(); OnCheckFpgaVersions(); - if(! card->bPassword) btnUnlock->hide(); + if(! card.hasPassword) btnUnlock->hide(); else { if(! btnUnlock->isVisible()) btnUnlock->show(); - btnUnlock->setIcon(QIcon(card->m_bLockStatus ? ":/res/device/Lock.png" : ":/res/device/UnLock.png")); //如果已经验证通过密码显示绿色图标 没有验证显示蓝色锁图标 + btnUnlock->setIcon(QIcon(card.isLocked ? ":/res/device/Lock.png" : ":/res/device/UnLock.png")); //如果已经验证通过密码显示绿色图标 没有验证显示蓝色锁图标 } } diff --git a/LedOK/device/wupgradeapkitem.h b/LedOK/device/wupgradeapkitem.h index f978487..fe29fd1 100644 --- a/LedOK/device/wupgradeapkitem.h +++ b/LedOK/device/wupgradeapkitem.h @@ -1,26 +1,23 @@ #ifndef WUPGRADEAPKITEM_H #define WUPGRADEAPKITEM_H -#include -#include +#include "globaldefine.h" #include #include #include #include #include #include -#include -#include #include #include class wUpgradeApkItem : public QTreeWidgetItem { public: - explicit wUpgradeApkItem(LedCard *pLedCard, LoQTreeWidget *parent); - void SetItemParam(LedCard *p); + explicit wUpgradeApkItem(LedCard card, LoQTreeWidget *parent); + void SetItemParam(LedCard p); void setResult(QString, QColor cr = Qt::blue); - LedCard *mCard = nullptr; + LedCard mCard; bool isUpdating{false}; bool m_lockFlag=true; QLabel *m_ImageOnline=nullptr; diff --git a/LedOK/devicectrlpanel.cpp b/LedOK/devicectrlpanel.cpp index 413e4b4..d570ca3 100644 --- a/LedOK/devicectrlpanel.cpp +++ b/LedOK/devicectrlpanel.cpp @@ -1,20 +1,15 @@ #include "devicectrlpanel.h" #include "devicepanel.h" #include "tools.h" -#include -#include -#include -#include - -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include "device/ctrlbrightpanel.h" +#include "device/ctrlpowerpanel.h" +#include "device/ctrlnetworkpanel.h" +#include "device/ctrlverifyclockpanel.h" +#include "device/ctrlhdmipanel.h" +#include "device/ctrlvolumepanel.h" +#include "device/ctrlpwdpanel.h" +#include "device/ctrladvancedpanel.h" +#include "device/ctrltestpanel.h" QTextEdit *gFdResInfo; @@ -54,18 +49,17 @@ DeviceCtrlPanel::DeviceCtrlPanel(DevicePanel *parent) : QWidget(parent), mDevWgt curIndex = index; if(wgts[index]==0) { if(index==Setting_Bright) wgts[index] = new CtrlBrightPanel(this); - else if(index==Setting_PowerControl) wgts[index] = new ControlPowerWidget(this, gSelCards); + else if(index==Setting_PowerControl) wgts[index] = new CtrlPowerPanel; else if(index==Setting_NetCfg) wgts[index] = new CtrlNetworkPanel(this); else if(index==Setting_VerifyClock) wgts[index] = new CtrlVerifyClockPanel(this); else if(index==Setting_Encrypt) wgts[index] = new CtrlPwdPanel(this); - else if(index==Setting_HDMI) wgts[index] = new CtrlHdmiPanel(this); - else if(index==Setting_Volume) wgts[index] = new ControlVolumeWidget(this, gSelCards); + else if(index==Setting_HDMI) wgts[index] = new CtrlHdmiPanel; + else if(index==Setting_Volume) wgts[index] = new CtrlVolumePanel; else if(index==Setting_Advanced) wgts[index] = new CtrlAdvancedPanel(this); - else if(index==Setting_Test) wgts[index] = new ControlTestWidget(this, gSelCards); + else if(index==Setting_Test) wgts[index] = new CtrlTestPanel(this); } scrollArea->takeWidget(); scrollArea->setWidget(wgts[index]); - emit sigSwitchIndexChanged(curIndex); }); vBox->addLayout(hBox); @@ -98,14 +92,17 @@ DeviceCtrlPanel::DeviceCtrlPanel(DevicePanel *parent) : QWidget(parent), mDevWgt vBox->addLayout(hBox); - connect(mDevWgt, &DevicePanel::sigSelectedDeviceList, this, [this]() { - if(gSelCards->count() < 2) { - if(gSelCards->count()==1) mDevWgt->fdCardNumInfo->setText(tr("Current Screen")+": "+gSelCards->at(0)->m_strCardId); + fdInfo->hide(); + btnClear->hide(); + + connect(mDevWgt, &DevicePanel::sigSelectedDeviceList, this, [this] { + if(gSelCards.count() < 2) { + if(gSelCards.count()==1) mDevWgt->fdCardNumInfo->setText(tr("Current Screen")+": "+gSelCards[0].id); else mDevWgt->fdCardNumInfo->setText(tr("Current Screen")+": "+tr("none")); fdInfo->hide(); btnClear->hide(); } else { - mDevWgt->fdCardNumInfo->setText(tr("Multi screen operation")+". "+tr("selected num")+": "+QString::number(gSelCards->count())); + mDevWgt->fdCardNumInfo->setText(tr("Multi screen operation")+". "+tr("selected num")+": "+QString::number(gSelCards.count())); fdInfo->clear(); fdInfo->show(); btnClear->show(); @@ -121,6 +118,14 @@ void DeviceCtrlPanel::changeEvent(QEvent *event) { QWidget::changeEvent(event); if(event->type() == QEvent::LanguageChange) transUi(); } +void DeviceCtrlPanel::showEvent(QShowEvent *event) { + QWidget::showEvent(event); + mDevWgt->mDeviceTable->setSelectionMode(QAbstractItemView::SingleSelection); +} +void DeviceCtrlPanel::hideEvent(QHideEvent *event) { + QWidget::hideEvent(event); + mDevWgt->mDeviceTable->setSelectionMode(QAbstractItemView::NoSelection); +} void DeviceCtrlPanel::transUi() { mBtnGrp->button(Setting_Bright)->setText(tr("Brightness Adjustment")); mBtnGrp->button(Setting_PowerControl)->setText(tr("Power Control")); @@ -132,12 +137,8 @@ void DeviceCtrlPanel::transUi() { mBtnGrp->button(Setting_Volume)->setText(tr("Volume Adj.")); mBtnGrp->button(Setting_Test)->setText(tr("Test")); - if(gSelCards->count() < 1) mDevWgt->fdCardNumInfo->setText(tr("Current Screen")+": "+tr("none")); - else if(gSelCards->count()==1) mDevWgt->fdCardNumInfo->setText(tr("Current Screen")+": "+gSelCards->at(0)->m_strCardId); - else mDevWgt->fdCardNumInfo->setText(tr("Multi screen operation")+". "+tr("selected num")+": "+QString::number(gSelCards->count())); + if(gSelCards.count() < 1) mDevWgt->fdCardNumInfo->setText(tr("Current Screen")+": "+tr("none")); + else if(gSelCards.count()==1) mDevWgt->fdCardNumInfo->setText(tr("Current Screen")+": "+gSelCards[0].id); + else mDevWgt->fdCardNumInfo->setText(tr("Multi screen operation")+". "+tr("selected num")+": "+QString::number(gSelCards.count())); btnClear->setText(tr("Clear")); } - -void DeviceCtrlPanel::OnOutputInfo(QString strInfo) { - if(isVisible() && fdInfo->isVisible()) fdInfo->append(strInfo); -} diff --git a/LedOK/devicectrlpanel.h b/LedOK/devicectrlpanel.h index 60b7a57..59e122d 100644 --- a/LedOK/devicectrlpanel.h +++ b/LedOK/devicectrlpanel.h @@ -2,7 +2,6 @@ #define DEVICECTRLPANEL_H #include "globaldefine.h" -#include "device/ledcard.h" #include #include #include @@ -17,13 +16,10 @@ public: QTextEdit *fdInfo; protected: + void showEvent(QShowEvent *event) override; + void hideEvent(QHideEvent *event) override; void changeEvent(QEvent *) override; void transUi(); -signals: - void sigSwitchIndexChanged(int index); -public slots: - void OnOutputInfo(QString strInfo); - private: DevicePanel *mDevWgt; QButtonGroup *mBtnGrp; diff --git a/LedOK/deviceitem.cpp b/LedOK/deviceitem.cpp index 5fbb1f5..5eaebb6 100644 --- a/LedOK/deviceitem.cpp +++ b/LedOK/deviceitem.cpp @@ -1,27 +1,18 @@ #include "deviceitem.h" +#include "globaldefine.h" #include "base/waitingdlg.h" #include "gutil/qgui.h" +#include "gutil/qnetwork.h" #include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include +#include -DeviceItem::DeviceItem(LedCard *pLedCard, LoQTreeWidget *parent) : QObject(parent), QTreeWidgetItem(UserType), m_parent(parent) { - mCard = pLedCard; - pHpptClient = new HpptClient(this); +DeviceItem::DeviceItem(LoQTreeWidget *parent) : QObject(parent), QTreeWidgetItem(UserType), m_parent(parent) { setFlags(Qt::ItemIsUserCheckable | Qt::ItemIsEnabled); setCheckState(0, Qt::Unchecked); m_parent->addTopLevelItem(this); + m_bnCardDetailInfo = new QPushButton(); m_bnCardDetailInfo->setToolTip(tr("GetScreenDetailInfo")); m_bnCardDetailInfo->setCursor(QCursor(Qt::PointingHandCursor)); @@ -32,22 +23,7 @@ QPushButton { } QPushButton:hover{background-color: #ccc;} )rrr"); - connect(m_bnCardDetailInfo, &QPushButton::clicked, this, [this]{ - QString strTip=""; - strTip.append(tr("cur brightness:")).append(QString::number(mCard->bright)).append("\r\n"); - //strTip.append("cardsystem apk version:"+QString::number(m_LedCard.iCardSystemVersion)+"\r\n"); - //strTip.append("device apk:"+m_LedCard.starterversionName+"\r\n"); - strTip.append(tr("android version:")).append(mCard->androidVersion).append("\r\n"); - //strTip.append(tr("android width:")+QString::number(m_LedCard.androidWidth)+"\r\n"); - //strTip.append(tr("android height:")+QString::number(m_LedCard.androidHeight)+"\r\n"); - strTip.append(tr("IMEI:")).append(mCard->strIMEI).append("\r\n"); - strTip.append(tr("HardWard Version:")).append(mCard->HardVersion).append("\r\n"); - strTip.append(tr("MAX Brightness level:")).append(QString::number(mCard->BrightnessLevel)).append("\r\n"); - strTip.append(tr("Android OS Resolution:")).append(mCard->ScreenResolution).append("\r\n"); - strTip.append(tr("Firmware Version:")).append(mCard->FirmwareVersion).append("\r\n"); - strTip.append(tr("Player Version:")).append(mCard->strXixunplayerVersion).append("\r\n"); - QMessageBox::information(treeWidget(), tr("Detail Info"), strTip); - }); + m_parent->setItemWidget(this, DeviceTable_Info, m_bnCardDetailInfo); m_bnReadbackPic = new QPushButton(); m_bnReadbackPic->setToolTip(tr("ReadbackPic")); @@ -65,7 +41,7 @@ QPushButton:hover{background-color: #ccc;} json.insert("_type", "GetScreenshotFull"); auto waitingDlg = new WaitingDlg(treeWidget(), tr("GetScreenshotFull")+" ..."); waitingDlg->show(); - auto reply = NetReq("http://"+mCard->m_strCardIp+":2016/settings").timeout(120000).post(json); + auto reply = NetReq("http://"+mCard.ip+":2016/settings").timeout(120000).post(json); waitingDlg->connAbort(reply); connect(reply, &QNetworkReply::finished, this, [=] { waitingDlg->close(); @@ -79,24 +55,17 @@ QPushButton:hover{background-color: #ccc;} dlg.exec(); }); }); - - m_ImageOnline = new QLabel(); - mCard->m_bOnLine=true; - m_ImageOnline->setPixmap(QPixmap(":/res/device/O_Online.png")); - setData(DeviceTable_ID, 0, mCard->m_strCardId); - setData(DeviceTable_IP, 0, mCard->m_strCardIp); - setData(DeviceTable_ScreenSize, 0, QString("%1 x %2").arg(mCard->m_iWidth).arg(mCard->m_iHeight)); - m_parent->setItemWidget(this, DeviceTable_Info, m_bnCardDetailInfo); m_parent->setItemWidget(this, DeviceTable_Screenshot, m_bnReadbackPic); - m_parent->setItemWidget(this, DeviceTable_Online, m_ImageOnline); + + m_ImageOnline = new QLabel; + m_ImageOnline->setPixmap(QPixmap(":/res/device/O_Online.png")); m_ImageOnline->setAlignment(Qt::AlignCenter); + m_parent->setItemWidget(this, DeviceTable_Online, m_ImageOnline); btnUnlock = new QPushButton; btnUnlock->setMaximumHeight(40); - if(mCard->bPassword) btnUnlock->setIcon(QIcon(mCard->m_bLockStatus ? ":/res/device/Lock.png" : ":/res/device/UnLock.png")); - else btnUnlock->hide(); connect(btnUnlock, &QPushButton::clicked, this, [this] { - if(! mCard->m_bLockStatus) return; + if(! mCard.isLocked) return; bool ok; auto pwd = QInputDialog::getText(treeWidget(), tr("Input password"), tr("Input password"), QLineEdit::Password, QString(), &ok); if(! ok) return; @@ -106,7 +75,7 @@ QPushButton:hover{background-color: #ccc;} json.insert("pwd", pwd); auto waitingDlg = new WaitingDlg(treeWidget(), tr("VerifyPassword")+" ..."); waitingDlg->show(); - auto reply = NetReq("http://"+mCard->m_strCardIp+":2016/settings").timeout(60000).post(json); + auto reply = NetReq("http://"+mCard.ip+":2016/settings").timeout(60000).post(json); waitingDlg->connAbort(reply); connect(reply, &QNetworkReply::finished, this, [=] { QJsonDocument json; @@ -122,7 +91,7 @@ QPushButton:hover{background-color: #ccc;} return; } waitingDlg->success(); - mCard->m_bLockStatus = false; + mCard.isLocked = false; btnUnlock->setIcon(QIcon(":/res/device/UnLock.png")); }); }); @@ -133,297 +102,96 @@ QPushButton:hover{background-color: #ccc;} m_parent->setItemWidget(this, DeviceTable_Password, wgt); for(int i=1; i10) { - //下线 - mCard->m_bOnLine=false; - m_ImageOnline->setPixmap(QPixmap(":/res/device/O_Offline.png")); - } else { - //在线 - mCard->m_bOnLine=true; - m_ImageOnline->setPixmap(QPixmap(":/res/device/O_Online.png")); - } - }); - mHeartbeatTimer.start(60000); - - m_pGetAskTimer=new QTimer(this); - connect(pHpptClient,SIGNAL(httpPostRspReady(QString , QString , QByteArray)),this,SLOT(OnProHttpResponse(QString , QString , QByteArray))); - //连接item的响应信号到信息输出框的显示槽函数 - connect(this,SIGNAL(sigOutputInfo(QString)),parent->parent(),SLOT(OnOutputInfo(QString))); - -} -DeviceItem::~DeviceItem() { - mHeartbeatTimer.stop(); - if(pHpptClient) { - delete pHpptClient; - pHpptClient=nullptr; - } } -void DeviceItem::SetMainTabWidgetIndex(int index){ - m_intIndexFlagOfInfoOrControl=index; - DeviceItemHttpPost(); +void DeviceItem::init() { + setData(DeviceTable_ID, 0, mCard.id); + setData(DeviceTable_IP, 0, mCard.ip); + setData(DeviceTable_ScreenSize, 0, QString("%1 x %2").arg(mCard.mWidth).arg(mCard.mHeight)); + if(mCard.hasPassword) btnUnlock->setIcon(QIcon(mCard.isLocked ? ":/res/device/Lock.png" : ":/res/device/UnLock.png")); + else btnUnlock->hide(); } -//针对这个ITEM通过POST获取控制卡的信息,两种情况下会调用,一,创建该Item初始化后,二、手动刷新 void DeviceItem::DeviceItemHttpPost() { - if(m_intIndexFlagOfInfoOrControl!=MainPage_DeviceManager) return; QJsonObject json; - json.insert("_id", getRandomString(10)); + json.insert("_id", "GetBuildInformation"); + json.insert("_type", "GetBuildInformation"); + auto reply = NetReq("http://"+mCard.ip+":2016/settings").timeout(120000).post(json); + connect(reply, &QNetworkReply::finished, this, [=] { + QJsonDocument json; + QString err = checkReplyForJson(reply, &json); + if(! err.isEmpty()) return; + mCard.BrightnessLevel = json["BrightnessLevel"].toInt(); + mCard.FirmwareVersion = json["FirmwareVersion"].toString(); + mCard.HardVersion = json["HardVersion"].toString(); + mCard.ScreenResolution = json["ScreenResolution"].toString(); + auto androidVersion = json["AndroidVersion"].toString(); + if(! androidVersion.isEmpty()) mCard.androidVersion = androidVersion; + }); + + json = QJsonObject(); + json.insert("_id", "GetScreenSize"); json.insert("_type", "GetScreenSize"); - HttpPostByTypeJsonObject(json); - QJsonObject json1; - json1.insert("_id", getRandomString(10)); - json1.insert("_type", "GetBrightness"); - HttpPostByTypeJsonObject(json1); - QJsonObject json2; - json2.insert("_id", getRandomString(10)); - json2.insert("_type", "IsScreenOn"); - HttpPostByTypeJsonObject(json2); + reply = NetReq("http://"+mCard.ip+":2016/settings").timeout(120000).post(json); + connect(reply, &QNetworkReply::finished, this, [=] { + QJsonDocument json; + QString err = checkReplyForJson(reply, &json); + if(! err.isEmpty()) return; + mCard.mWidth = json["width"].toInt(); + mCard.mHeight = json["height"].toInt(); + setData(DeviceTable_ScreenSize, 0, QString("%1 x %2").arg(mCard.mWidth).arg(mCard.mHeight)); + }); - QJsonObject json4; - json4.insert("_id", getRandomString(10)); - json4.insert("_type", "GetBuildInformation"); - HttpPostByTypeJsonObject(json4); - QJsonObject json5; - json5.insert("_id", getRandomString(10)); - json5.insert("_type", "CheckSoftVersions"); - HttpPostByTypeJsonObject(json5); - QJsonObject json8; - json8.insert("_id", getRandomString(10)); - json8.insert("_type", "GetCardAlias"); - HttpPostByTypeJsonObject(json8); - - { - QJsonObject json; - json.insert("_id", "HasControllerPassword"); - json.insert("_type", "HasControllerPassword"); - auto reply = NetReq("http://"+mCard->m_strCardIp+":2016/settings").timeout(120000).post(json); - connect(reply, &QNetworkReply::finished, mCard, [=] { - QJsonDocument json; - QString err = checkReplyForJson(reply, &json); - if(! err.isEmpty()) return; - mCard->bPassword = json["result"].toBool(); - if(mCard->bPassword) {//加过密 - btnUnlock->show(); - btnUnlock->setIcon(QIcon(mCard->m_bLockStatus ? ":/res/device/Lock.png" : ":/res/device/UnLock.png")); - } else btnUnlock->hide(); - }); - } -} -void DeviceItem::OnControlTcpSend(int iProgramIndex) { - QTcpSocket *send = new QTcpSocket(); - connect(send, SIGNAL(connected()), this, SLOT(connect_sucessful())); - connect(send, SIGNAL(error(QAbstractSocket::SocketError)),this, SLOT(show_error(QAbstractSocket::SocketError))); - send->connectToHost(QHostAddress(mCard->m_strCardIp),31299); - - ST_ANSY_PROGRAM_PACKET tempStreadPakcet; - tempStreadPakcet.SyncHead[0]=0x7e; - tempStreadPakcet.SyncHead[1]=0x7e; - tempStreadPakcet.SyncHead[2]=0x55; - tempStreadPakcet.ucCommType=0x97; - tempStreadPakcet.iBaoLiu=0; - tempStreadPakcet.iLength=4; - unsigned char uctemp[4]={0}; - uctemp[0]=iProgramIndex; - - memcpy(tempStreadPakcet.pDataBuffer,uctemp,4); - tempStreadPakcet.pDataBuffer[tempStreadPakcet.iLength]=GetCheckCodeIn8(&tempStreadPakcet.ucCommType,tempStreadPakcet.iLength+sizeof(tempStreadPakcet.iBaoLiu)+sizeof(tempStreadPakcet.ucCommType)+sizeof(tempStreadPakcet.iLength)); - int iLenPacket=3*sizeof(unsigned char)+sizeof(char)+sizeof(int)+sizeof(int)+tempStreadPakcet.iLength+sizeof(char);/////除正文外的协议结构大小; - QByteArray databuf = QByteArray(reinterpret_cast(&tempStreadPakcet), iLenPacket); - if(!send->waitForConnected(10000)) //等待连接返回 - { - qDebug()<m_strCardIp<<"Connect timeout "; - emit sigOutputInfo(mCard->m_strCardId+":"+tr("receive")+"<-"+tr("Connect")+":"+tr("timeout")); - send->close(); - delete send; - return ; - } - send->write(databuf); - if(send->waitForBytesWritten(3000)) - { - send->read(send->bytesAvailable()); - qDebug()<<"recv anycast success ack"; - emit sigOutputInfo(mCard->m_strCardId+":"+tr("receive")+"<-"+tr("Anycast")+":"+tr("success")); - } - send->close(); - delete send; -} - -void DeviceItem::HttpPostByTypeJsonObject(QJsonObject json) -{ - QJsonDocument doc; - doc.setObject(json); - QByteArray post_loginArray = doc.toJson(QJsonDocument::Compact); - m_strUrl="http://"+mCard->m_strCardIp+":2016/settings"; - if(mCard->m_strCardId.left(2)!="M8" && mCard->m_strCardId.left(2)!="m8") - { - if(json["_type"]!="GetAllScreenSizeM80") pHpptClient->httpPost(m_strUrl,post_loginArray); - } - else pHpptClient->httpPost(m_strUrl,post_loginArray); -} -void DeviceItem::HttpGetLedCardWidthHeight() -{ - QJsonObject json; - json.insert("_id", getRandomString(10)); - json.insert("_type", "GetScreenSize"); - HttpPostByTypeJsonObject(json); -} -void DeviceItem::HttpGetLedCardRemarkName(){ - QJsonObject json; - json.insert("_id", getRandomString(10)); + json = QJsonObject(); + json.insert("_id", "GetBrightness"); + json.insert("_type", "GetBrightness"); + reply = NetReq("http://"+mCard.ip+":2016/settings").timeout(120000).post(json); + connect(reply, &QNetworkReply::finished, this, [=] { + QJsonDocument json; + QString err = checkReplyForJson(reply, &json); + if(! err.isEmpty()) return; + mCard.bright = json["brightnessPercentage"].toInt(-1); + if(mCard.bright==-1) mCard.bright = qRound(json["brightness"].toInt() * 100.0 / mCard.BrightnessLevel); + setData(DeviceTable_Brightness, 0, QString::number(mCard.bright)+"%"); + }); + json = QJsonObject(); + json.insert("_id", "IsScreenOn"); + json.insert("_type", "IsScreenOn"); + reply = NetReq("http://"+mCard.ip+":2016/settings").timeout(120000).post(json); + connect(reply, &QNetworkReply::finished, this, [=] { + QJsonDocument json; + QString err = checkReplyForJson(reply, &json); + if(! err.isEmpty()) return; + mCard.isScreenOn = json["on"].toBool(); + setForeground(DeviceTable_Power, mCard.isScreenOn ? Qt::green : Qt::red); + setData(DeviceTable_Power, 0, mCard.isScreenOn ? tr("On") : tr("Off")); + }); + json = QJsonObject(); + json.insert("_id", "GetCardAlias"); json.insert("_type", "GetCardAlias"); - HttpPostByTypeJsonObject(json); + reply = NetReq("http://"+mCard.ip+":2016/settings").timeout(120000).post(json); + connect(reply, &QNetworkReply::finished, this, [=] { + QJsonDocument json; + QString err = checkReplyForJson(reply, &json); + if(! err.isEmpty()) return; + mCard.alias = QString::fromUtf8(QByteArray::fromBase64(json["alias"].toString().toLatin1())); + setData(DeviceTable_Remark, 0, mCard.alias); + }); + + json = QJsonObject(); + json.insert("_id", "HasControllerPassword"); + json.insert("_type", "HasControllerPassword"); + reply = NetReq("http://"+mCard.ip+":2016/settings").timeout(120000).post(json); + connect(reply, &QNetworkReply::finished, this, [=] { + QJsonDocument json; + QString err = checkReplyForJson(reply, &json); + if(! err.isEmpty()) return; + mCard.hasPassword = json["result"].toBool(); + if(mCard.hasPassword) {//加过密 + btnUnlock->show(); + btnUnlock->setIcon(QIcon(mCard.isLocked ? ":/res/device/Lock.png" : ":/res/device/UnLock.png")); + } else btnUnlock->hide(); + }); } - -void DeviceItem::refreshLable(){ - if(mCard->m_bPowerStatus){ - this->setForeground(DeviceTable_Power, Qt::green); - setData(DeviceTable_Power, 0, tr("on")); - } else { - this->setForeground(DeviceTable_Power, Qt::red); - setData(DeviceTable_Power, 0, tr("off")); - } -} - -//获取到httpPost的应答,如果参数变化需要出发修改控件item的内容 -void DeviceItem::OnProHttpResponse(QString url, QString postMD5, QByteArray data) { - Q_UNUSED(postMD5) - //qDebug()<< url + "\r\n"+m_strUrl; - if(url == m_strUrl) - { - QJsonParseError parseJsonErr; - QJsonDocument document = QJsonDocument::fromJson(data,&parseJsonErr); - if(!(parseJsonErr.error == QJsonParseError::NoError)) - { - if(data.size()==0) - qDebug()<<"json is empty"; - else - qDebug()<<"DeviceItem OnProHttpResponse 解析json文件错误!"; - return; - } - QJsonObject jsonObject = document.object(); - QString strType=jsonObject["_type"].toString(); - if(jsonObject["success"].toBool()==true) - { - if(strType=="GetScreenSize" ) - { - - if(mCard->m_iWidth!=jsonObject["width"].toInt()||mCard->m_iHeight!=jsonObject["height"].toInt()) - { - mCard->m_iWidth=jsonObject["width"].toInt(); - mCard->m_iHeight=jsonObject["height"].toInt(); - } - setData(DeviceTable_ScreenSize, 0, QString("%1 x %2").arg(mCard->m_iWidth).arg(mCard->m_iHeight)); - - } - else if(strType=="GetCardAlias" ) - { - mCard->m_strCardRemarkName = QString::fromUtf8(QByteArray::fromBase64(jsonObject["alias"].toString().toLatin1())); - setData(DeviceTable_Remark,0,mCard->m_strCardRemarkName); - } - else if(strType=="GetCardName") - { - m_HeartbeatCount=0; - mCard->m_bOnLine=true; - m_ImageOnline->setPixmap(QPixmap(":/res/device/O_Online.png")); - } - else if(strType=="GetBuildInformation" ) - { - mCard->strIMEI=jsonObject["IMEI"].toString(); - mCard->HardVersion=jsonObject["HardVersion"].toString(); - mCard->BrightnessLevel=jsonObject["BrightnessLevel"].toInt(); - mCard->ScreenResolution=jsonObject["ScreenResolution"].toString(); - mCard->FirmwareVersion=jsonObject["FirmwareVersion"].toString(); - } - else if(strType=="CheckSoftVersions") - { - foreach(QJsonValue value, jsonObject["apps"].toArray()) { - QJsonObject oApp = value.toObject(); - if(oApp["packageName"].toString().contains("xixunplayer")) - { - mCard->strXixunplayerVersion=oApp["versionName"].toString(); - mCard->strXixunplayerVersionCode=oApp["versionCode"].toInt(); - } - } - } - else if(strType == "AliIotSetting") - { - emit sigOutputInfo(mCard->m_strCardId+":"+tr("receive")+"<-"+tr("AliIotSetting")+":"+tr("success")); - } - else if(strType == "IsScreenOn") - { - { - mCard->m_bPowerStatus=jsonObject["on"].toBool(); - if(mCard->m_bPowerStatus) { - this->setForeground(DeviceTable_Power, Qt::green); - setData(DeviceTable_Power, 0, tr("on")); - emit sigOutputInfo(mCard->m_strCardId+":"+tr("receive")+"<-"+tr("GetScreenStatus")+tr("success")+","+tr("Status")+":"+tr("on")); - } else { - this->setForeground(DeviceTable_Power, Qt::red); - setData(DeviceTable_Power, 0, tr("off")); - emit sigOutputInfo(mCard->m_strCardId+":"+tr("receive")+"<-"+tr("GetScreenStatus")+tr("success")+","+tr("Status")+":"+tr("off")); - } - } - } else if(strType == "GetBrightness") { - mCard->bright = jsonObject["brightnessPercentage"].toInt(-1); - if(mCard->bright==-1) mCard->bright = qRound(jsonObject["brightness"].toInt() * 100.0 / mCard->BrightnessLevel); - QString bright = QString::number(mCard->bright); - setData(DeviceTable_Brightness, 0, QString::number(mCard->bright)+"%"); - emit sigOutputInfo(mCard->m_strCardId+":"+tr("receive")+"<-"+tr("GetBrightness")+tr("success")+","+tr("brightness")+"="+bright+"%"); - } - else if(strType == "SetAutoBrightnessTask") - { - emit sigOutputInfo(mCard->m_strCardId+":"+tr("receive")+"<-"+tr("SetAutoBrightnessTask")+":"+tr("success")); - } - else if(strType == "SetAutoVolumeTask") - { - emit sigOutputInfo(mCard->m_strCardId+":"+tr("receive")+"<-"+tr("SetAutoVolumeTask")+":"+tr("success")); - } - else if(strType == "SetTimingScreenTask") - { - emit sigOutputInfo(mCard->m_strCardId+":"+tr("receive")+"<-"+tr("SetTimingScreenTask")+":"+tr("success")); - } - else if(strType == "TestScreen") - { - emit sigOutputInfo(mCard->m_strCardId+":"+tr("receive")+"<-"+tr("TestScreen")+":"+tr("success")); - } - } - } -} -QPixmap DeviceItem::Base64_To_Image(QByteArray bytearray,QString SavePath) -{ - QByteArray Ret_bytearray; - Ret_bytearray = QByteArray::fromBase64(bytearray); - QBuffer buffer(&Ret_bytearray); - buffer.open(QIODevice::WriteOnly); - QPixmap imageresult; - imageresult.loadFromData(Ret_bytearray); - if(SavePath != "") - { - qDebug() <<"save" ; - imageresult.save(SavePath); - } - return imageresult; -} - -void DeviceItem::DeletePostingDlg() -{ - if(m_PostingDlg!=nullptr) - { - delete m_PostingDlg; - m_PostingDlg=nullptr; - } -} - ImgDlg::ImgDlg(const QByteArray &data, QWidget *parent) : QDialog(parent) { setWindowFlag(Qt::WindowContextHelpButtonHint, 0); setWindowTitle(tr("Screenshot")); diff --git a/LedOK/deviceitem.h b/LedOK/deviceitem.h index dfd8a02..a216cfc 100644 --- a/LedOK/deviceitem.h +++ b/LedOK/deviceitem.h @@ -1,17 +1,11 @@ #ifndef DEVICEITEM_H #define DEVICEITEM_H -#include -#include -#include -#include -#include + #include #include -#include -#include +#include "globaldefine.h" #include -#include -#include +#include enum DeviceTableField { DeviceTable_Check = 0, @@ -32,43 +26,20 @@ class DeviceItem : public QObject, public QTreeWidgetItem { friend class DevicePanel; Q_OBJECT public: - explicit DeviceItem(LedCard *pLedCard, LoQTreeWidget *parent); - ~DeviceItem(); - void HttpPostByTypeJsonObject(QJsonObject json); - void OnControlTcpSend(int iProgramIndex); - - void refreshLable(); - void SetMainTabWidgetIndex(int index); -//http获取控制卡信息的函数 - void HttpGetLedCardWidthHeight(); - void HttpGetLedCardRemarkName(); - QPixmap Base64_To_Image(QByteArray bytearray,QString SavePath); - - LedCard *mCard{0}; - QTimer mHeartbeatTimer; -signals: - void sigOutputInfo(QString); - -public slots: - void DeletePostingDlg(); - void OnProHttpResponse(QString url, QString postMD5, QByteArray data); + explicit DeviceItem(LoQTreeWidget *parent); + void init(); void DeviceItemHttpPost(); + LedCard mCard; + QPushButton *btnUnlock = nullptr; private: - int m_intIndexFlagOfInfoOrControl=0; - QPushButton *m_bnCardDetailInfo = nullptr;// - QPushButton *m_bnReadbackPic = nullptr;// - QPushButton *btnUnlock = nullptr;// + QPushButton *m_bnCardDetailInfo = nullptr; + QPushButton *m_bnReadbackPic = nullptr; QLabel *m_ImageOnline=nullptr; - LoQTreeWidget *m_parent = nullptr; - HpptClient *pHpptClient = nullptr; - QString m_strUrl=""; - int m_HeartbeatCount=0; - LoEmptyDialog * m_PostingDlg=nullptr; - QTimer *m_pGetAskTimer=nullptr; }; class ImgDlg : public QDialog { + Q_OBJECT public: explicit ImgDlg(const QByteArray &, QWidget *parent = 0); QImage mImg; diff --git a/LedOK/devicepanel.cpp b/LedOK/devicepanel.cpp index e04ca16..f8d9e97 100644 --- a/LedOK/devicepanel.cpp +++ b/LedOK/devicepanel.cpp @@ -1,7 +1,9 @@ #include "devicepanel.h" -#include "devicectrlpanel.h" -#include "tools.h" +#include "globaldefine.h" #include "gutil/qgui.h" +#include "gutil/qnetwork.h" +#include "base/waitingdlg.h" +#include "deviceitem.h" #include #include #include @@ -10,13 +12,23 @@ #include #include #include +#include +#include +#include DevicePanel *gDevicePanel; -QList *gSelCards; -//设备管理响应页面 +void setCard(LedCard &card, const QString &addr, const QJsonDocument &json) { + if(! addr.isEmpty()) card.ip = addr; + else { + card.ip = json["newIp"].toString(); + if(card.ip.isEmpty()) card.ip = json["ip"].toString(); + } + card.mWidth = json["width"].toInt(); + card.mHeight = json["height"].toInt(); + card.androidVersion = json["androidVersion"].toString(); +} DevicePanel::DevicePanel(QSettings &settings, QWidget *parent) : QWidget(parent) { gDevicePanel = this; - gSelCards = &mSelCards; setAutoFillBackground(true); QPalette pal; pal.setBrush(QPalette::Window, QColor(0xeeeeee)); @@ -98,7 +110,6 @@ QComboBox QAbstractItemView::item:selected {background-color: #09c;} btnRefresh = new QPushButton(tr("Refresh"), areaFlash); btnRefresh->setGeometry(0, 0, 75, areaFlash->height()); connect(btnRefresh, &QPushButton::clicked, this, [this] { - mLedCards.clear(); mDeviceTable->onCheckAll(false); mDeviceTable->clear(); nDeviceNum->setText("0"); @@ -118,6 +129,7 @@ QPushButton:hover {background-color: #08b;} mHBox = new QHBoxLayout(); mDeviceTable = new LoQTreeWidget(this); + mDeviceTable->setSelectionMode(QAbstractItemView::NoSelection); mDeviceTable->setIndentation(0); mDeviceTable->setSortingEnabled(true); mHBox->addWidget(mDeviceTable); @@ -134,36 +146,79 @@ QPushButton:hover {background-color: #08b;} bool ok = true; if(senderAddress.protocol()==QUdpSocket::IPv6Protocol) senderAddress.setAddress(senderAddress.toIPv4Address(&ok)); auto addr = ok ? senderAddress.toString() : ""; + DeviceItem *item; if(data.startsWith("{\"")) { QJsonParseError error; - QJsonDocument document = QJsonDocument::fromJson(gram.data(), &error); + QJsonDocument json = QJsonDocument::fromJson(gram.data(), &error); if(error.error != QJsonParseError::NoError) { qDebug()<<"DeviceItem OnProHttpResponse 解析json文件错误!"; continue; } - parseInfo(document.object(), addr); + auto cardId = json["cardId"].toString(); + int cnt = mDeviceTable->topLevelItemCount(); + for(int i=0; itopLevelItem(i))->mCard.id==cardId) { + item->mCard.id = cardId; + item->mCard.isOnline = true; + setCard(item->mCard, addr, json); + item->init(); + goto end; + } + item = new DeviceItem(mDeviceTable); + item->mCard.id = cardId; + setCard(item->mCard, addr, json); } else { auto bytes = gram.data(); - auto packet = (Packet *)bytes.data(); - LedCard *pLedCard = new LedCard(this);//alahover 没有释放 - pLedCard->m_strCardId = packet->serialCode; - pLedCard->m_strCardIp = addr; - for(int i=0;im_strCardId==pLedCard->m_strCardId ) {//如果已经存在在列表中 - auto pOldLedCard = mLedCards.at(i);//获取到旧的对象指针 - pOldLedCard->m_bOnLine = true; - if(pOldLedCard->CompareHTTPGetParam(pLedCard)==false) {//如果ip地址变化了 - pOldLedCard->copyLedCardHTTPGetParam(pLedCard); - addLedCard(pOldLedCard);//发送信号到界面 - } else { - //post失败的概率比较小,所以这里是否需要平凡的更新,不需要刻意屏蔽该操作改为在其他点击操作中进行 - clearUdpHeartbeat(pOldLedCard); - } - delete pLedCard; - return; + auto packet = (UDPPacket *)bytes.data(); + int cnt = mDeviceTable->topLevelItemCount(); + for(int i=0; itopLevelItem(i))->mCard.id==packet->serialCode) { + item->mCard.id = packet->serialCode; + item->mCard.isOnline = true; + item->mCard.ip = addr; + item->init(); + goto end; } - mLedCards.append(pLedCard); - addLedCard(pLedCard);//发送信号到界面 + item = new DeviceItem(mDeviceTable); + item->mCard.id = packet->serialCode; + item->mCard.ip = addr; } + connect(item->m_bnCardDetailInfo, &QPushButton::clicked, item, [=] { + QJsonObject json; + json.insert("_id", "CheckSoftVersions"); + json.insert("_type", "CheckSoftVersions"); + auto waitingDlg = new WaitingDlg(this, tr("CheckSoftVersions")+" ..."); + waitingDlg->show(); + auto card = item->mCard; + auto reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json); + waitingDlg->connAbort(reply); + connect(reply, &QNetworkReply::finished, this, [=] { + Def_CtrlSingleGetReply + waitingDlg->close(); + QString strTip; + strTip.append(tr("Current Brightness")).append(": ").append(QString::number(item->mCard.bright)).append("%").append("\n"); + strTip.append(tr("Brightness Level")).append(": ").append(QString::number(item->mCard.BrightnessLevel)).append("\n"); + strTip.append(tr("Android OS Resolution")).append(": ").append(item->mCard.ScreenResolution).append("\n"); + strTip.append(tr("Android Version")).append(": ").append(item->mCard.androidVersion).append("\n"); + strTip.append(tr("FPGA Version")).append(": ").append(item->mCard.HardVersion).append("\n"); + strTip.append(tr("Firmware Version")).append(": ").append(item->mCard.FirmwareVersion).append("\n"); + foreach(QJsonValue value, json["apps"].toArray()) { + QJsonObject app = value.toObject(); + if(app["packageName"].toString().contains("xixunplayer")) strTip.append(tr("Player Version")).append(": ").append(app["versionName"].toString()).append("\n"); + } + QMessageBox::information(this, tr("Detail Info"), strTip); + }); + }); + item->init(); + item->DeviceItemHttpPost(); + nDeviceNum->setText(QString::number(mDeviceTable->topLevelItemCount())); + { + QJsonObject json; + json.insert("_id", "SyncTime"); + json.insert("_type", "SyncTime"); + json.insert("time", QDateTime::currentDateTime().toMSecsSinceEpoch()); + auto reply = NetReq("http://"+item->mCard.ip+":2016/settings").timeout(60000).post(json); + connect(reply, &QNetworkReply::finished, reply, &QNetworkReply::deleteLater); + } + end:; } }); @@ -190,8 +245,12 @@ QPushButton:hover {background-color: #08b;} mDeviceTable->header()->setSectionResizeMode(DeviceTable_Screenshot, QHeaderView::Fixed); mDeviceTable->setColumnWidth(DeviceTable_Screenshot, 72); - connect(mDeviceTable, SIGNAL(sigCheckStateChanged(int)), this, SLOT(onCheckStateChanged(int))); - mDeviceTable->setSelectionMode(QAbstractItemView::SingleSelection); + connect(mDeviceTable, &LoQTreeWidget::sigCheckStateChanged, this, [=] { + gSelCards.clear(); + int cnt = mDeviceTable->topLevelItemCount(); + for(int i=0; itopLevelItem(i)->checkState(0) == Qt::Checked) gSelCards.append(static_cast(mDeviceTable->topLevelItem(i))->mCard); + emit sigSelectedDeviceList(); + }); mDeviceTable->hideColumn(0); mDeviceTable->fdIsSelAll->hide(); @@ -227,7 +286,7 @@ QPushButton:hover {background-color: #08b;} QMessageBox::warning(this, tr("Attention"), tr("Please input IP address!")); return; } - QByteArray data = QJsonDocument({{"action", "getInfo"}}).toJson(QJsonDocument::Compact); + QByteArray data = QJsonDocument(QJsonObject{{"action", "getInfo"}}).toJson(QJsonDocument::Compact); foreach(auto ip, ips) if(mUdpSocket.writeDatagram(data, QHostAddress(ip), 22222) != data.length()) qDebug() << "Specify IP write Failed." << ip; specifyIPDlg->accept(); }); @@ -250,7 +309,7 @@ DevicePanel::~DevicePanel() { } void DevicePanel::sendGetInfo() { - const QByteArray data = QJsonDocument({{"action", "getInfo"}}).toJson(QJsonDocument::Compact); + const QByteArray data = QJsonDocument(QJsonObject{{"action", "getInfo"}}).toJson(QJsonDocument::Compact); uchar ccc[]{0x7E, 0x7E, 0x7E, 0x90, 0x42, 0x72, 0x6F, 0x61, 0x64, 0x63, 0x61, 0x73, 0x74, 0x21, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x1C, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0x9F}; if(mUdpSocket.writeDatagram(data, QHostAddress("255.255.255.255"), 22222) != data.length()) qDebug() << "getInfo write to 255.255.255.255 failed"; @@ -275,32 +334,6 @@ void DevicePanel::sendGetInfo() { } } -void DevicePanel::ShowDevicesInfoOrControlWidget(int index){ - m_intIndexFlagOfInfoOrControl=index; - if(index==MainPage_DeviceManager) { //设备信息列表页面 - mDeviceTable->hideColumn(0); - mDeviceTable->fdIsSelAll->hide(); - if(mDeviceCtrlPanel!=nullptr) { - for(int j=DeviceTable_ScreenSize;jshowColumn(j); - mDeviceTable->setMaximumWidth(0xffffff); - mDeviceCtrlPanel->hide(); - fdCardNumInfo->hide(); - } - } else if(index==MainPage_Setting) { //终端控制页面 - mDeviceTable->showColumn(0); - mDeviceTable->fdIsSelAll->show(); - for(int j=DeviceTable_ScreenSize; jhideColumn(j); - if(mDeviceCtrlPanel==nullptr) mHBox->addWidget(mDeviceCtrlPanel = new DeviceCtrlPanel(this)); - else mDeviceCtrlPanel->show(); - fdCardNumInfo->show(); - mDeviceTable->setMaximumWidth(340); - GetSelectDeviceNum(); - emit sigSelectedDeviceList(&mSelCards); - } - int cnt = mDeviceTable->topLevelItemCount(); - if(cnt>0)//切换到终点管理页面是刷新列表中控制卡的状态参数 - for(int i=0; i(mDeviceTable->topLevelItem(i))->SetMainTabWidgetIndex(m_intIndexFlagOfInfoOrControl); -} void DevicePanel::changeEvent(QEvent *event) { QWidget::changeEvent(event); if(event->type() == QEvent::LanguageChange) transUi(); @@ -322,157 +355,8 @@ void DevicePanel::transUi() { m_headerItem->setText(DeviceTable_Info, tr("More Info")); auto cnt = mDeviceTable->topLevelItemCount(); - for(int i=0; i(mDeviceTable->topLevelItem(i))->refreshLable(); -} - -void DevicePanel::OnControlTcpSend(int iProgramIndex){ - int cnt = mDeviceTable->topLevelItemCount(); - for(int i=0; itopLevelItem(i)->checkState(0) == Qt::Checked) static_cast(mDeviceTable->topLevelItem(i))->OnControlTcpSend(iProgramIndex); -} - -void DevicePanel::OnControlSendJson(QJsonObject &json,QString strFanYi){ - int cnt = mDeviceTable->topLevelItemCount(); - for(int i=0; itopLevelItem(i)->checkState(0) == Qt::Checked) { - DeviceItem *item = static_cast(mDeviceTable->topLevelItem(i)); - item->HttpPostByTypeJsonObject(json); - QString strCardId=item->mCard->m_strCardId; - mDeviceCtrlPanel->OnOutputInfo(strCardId+":"+tr("send")+"->"+strFanYi); - } -} - -int DevicePanel::GetSelectDeviceNum() { - int cnt = mDeviceTable->topLevelItemCount(); - int iSelectCount=0; - mSelCards.clear(); - for(int i=0; itopLevelItem(i)->checkState(0) == Qt::Checked) { - iSelectCount++; - mSelCards.append(static_cast(mDeviceTable->topLevelItem(i))->mCard); - } - return iSelectCount; -} -void DevicePanel::OnOutputInfo(QString strInfo) { - if(m_intIndexFlagOfInfoOrControl==MainPage_Setting && mDeviceCtrlPanel!=nullptr) mDeviceCtrlPanel->OnOutputInfo(strInfo); -} - -void DevicePanel::onCheckStateChanged(int f){ - Q_UNUSED(f); - if(m_intIndexFlagOfInfoOrControl==MainPage_Setting){ - GetSelectDeviceNum(); - emit sigSelectedDeviceList(&mSelCards); - } -} -void DevicePanel::addLedCard(LedCard *card) { - int cnt = mDeviceTable->topLevelItemCount(); for(int i=0; i(mDeviceTable->topLevelItem(i)); - if(item->mCard->m_strCardId != card->m_strCardId) continue; - item->setData(DeviceTable_ID, 0, card->m_strCardId); - item->setData(DeviceTable_IP, 0, card->m_strCardIp); - item->setData(DeviceTable_ScreenSize, 0, QString("%1 x %2").arg(card->m_iWidth).arg(card->m_iHeight)); - return; - } - new DeviceItem(card, mDeviceTable); - nDeviceNum->setText(QString::number(mDeviceTable->topLevelItemCount())); - - QJsonObject json; - json.insert("_id", "SyncTime"); - json.insert("_type", "SyncTime"); - json.insert("time", QDateTime::currentDateTime().toMSecsSinceEpoch()); - auto reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json); - connect(reply, &QNetworkReply::finished, reply, &QNetworkReply::deleteLater); -} -void DevicePanel::clearUdpHeartbeat(LedCard *p) { - int cnt = mDeviceTable->topLevelItemCount(); - for(int i=0; i(mDeviceTable->topLevelItem(i)); - if(item->mCard->m_strCardId != p->m_strCardId) continue; - item->m_HeartbeatCount = 0; - if(item->m_ImageOnline) { - item->mCard->m_bOnLine = true; - item->m_ImageOnline->setPixmap(QPixmap(":/res/device/O_Online.png")); - } - return; - } -} - -void DevicePanel::parseInfo(const QJsonObject &subObj, const QString &strIp) { - LedCard *pLedCard = new LedCard(this);//alahover 没有释放 - pLedCard->m_strCardId=subObj["cardId"].toString(); - if(! strIp.isEmpty()) pLedCard->m_strCardIp = strIp; - else { - pLedCard->m_strCardIp = subObj["newIp"].toString(); - if(pLedCard->m_strCardIp.isEmpty()) pLedCard->m_strCardIp = subObj["ip"].toString(); - } - pLedCard->m_iWidth=subObj["width"].toInt(); - pLedCard->m_iHeight=subObj["height"].toInt(); - pLedCard->starterversionName=subObj["versionName"].toString(); - pLedCard->starterPort=subObj["starterPort"].toInt(); - pLedCard->androidVersion=subObj["androidVersion"].toString(); - pLedCard->iHttpGetId=subObj["id"].toInt(); - pLedCard->androidHeight=subObj["androidHeight"].toInt(); - pLedCard->androidWidth=subObj["androidWidth"].toInt(); - pLedCard->lastActive=subObj["lastActive"].toInt(); - - for(int i=0;im_strCardId==pLedCard->m_strCardId ) { //如果已经存在在列表中 - auto pOldLedCard = mLedCards.at(i);//获取到旧的对象指针 - pOldLedCard->m_bOnLine = true; - if(! pOldLedCard->CompareHTTPGetParam(pLedCard)) {//如果ip地址变化了 - pOldLedCard->copyLedCardHTTPGetParam(pLedCard); - addLedCard(pOldLedCard);//发送信号到界面 - } else { - //post失败的概率比较小,所以这里是否需要平凡的更新,不需要刻意屏蔽该操作改为在其他点击操作中进行 - clearUdpHeartbeat(pOldLedCard); - } - delete pLedCard; - return; - } - mLedCards.append(pLedCard); - addLedCard(pLedCard);//发送信号到界面 -} - -STREAM_PACKET LedOkMakeStreamPacket(int iComType,int iLen,unsigned char *ucBuf,QString str) { - STREAM_PACKET Temp; - memset(&Temp, 0, sizeof(STREAM_PACKET)); - if(iLen>2048) return Temp; - memset(Temp.SyncHead, 0x7e, 3); - memset(Temp.ucSerialCode,0x00,20); - char* ch; - QByteArray ba = str.toLatin1(); // must - ch=ba.data(); - memcpy(Temp.ucSerialCode,ch,ba.size()); - Temp.iLength=iLen; - Temp.ucCommType=iComType; - memcpy(Temp.pDataBuffer,ucBuf,iLen); - Temp.pDataBuffer[Temp.iLength] = GetCheckCodeIn8(&Temp.ucCommType,Temp.iLength+sizeof(Temp.ucCommType)+sizeof(char)*20+sizeof(Temp.iLength)); - return Temp; -} -//UDP多网卡广播 -void DevicePanel::RestoreLedCardIpByUdpCmd() { - QList networkinterfaces = QNetworkInterface::allInterfaces(); - foreach (QNetworkInterface interfaces, networkinterfaces) {//networkinterfaces负责提供主机的IP地址和网络接口的列表 - foreach (QNetworkAddressEntry entry, interfaces.addressEntries()) {//QNetworkAddressEntry存储了一个IP地址,子网掩码和广播地址 - entry.setBroadcast(QHostAddress::Broadcast); - QHostAddress broadcastAddress("255.255.255.255"); - entry.setBroadcast(QHostAddress::Broadcast); - RESTORE_IP stTempIp; - memset(&stTempIp,0x00,sizeof(RESTORE_IP)); - QString strNew=entry.ip().toString(); - int itempOffset = strNew.lastIndexOf("."); - QString sstrNew=strNew.left(itempOffset)+".254"; - if(sstrNew.length()<=20) memcpy(stTempIp.cNewIp,sstrNew.toLatin1().data(),sstrNew.length()); - QString strMask=entry.netmask().toString(); - if(strMask.length()<=20) - memcpy(stTempIp.cMask,strMask.toLatin1().data(),strMask.length()); - QString strGateway=entry.ip().toString(); - if(strGateway.length()<=20) - memcpy(stTempIp.cGateway,strGateway.toLatin1().data(),strGateway.length()); - if(strGateway.length()<=20) - memcpy(stTempIp.cDns,strGateway.toLatin1().data(),strGateway.length()); - STREAM_PACKET tempStreadPacket = LedOkMakeStreamPacket(COMMAND_ONLY_RESET_CARD_IP, 80, (unsigned char *)&stTempIp,"Broadcast!"); - int iLenPacket=tempStreadPacket.iLength+sizeof(int)+3*sizeof(unsigned char)+sizeof(char)+20*sizeof(char)+sizeof(char);/////除正文外的协议结构大小; - QUdpSocket *tempUdpSocket = new QUdpSocket(this); - if(!tempUdpSocket->bind(entry.ip())) break; - tempUdpSocket->writeDatagram((char *)&tempStreadPacket,iLenPacket,broadcastAddress, 31296); - } + auto item = (DeviceItem*) mDeviceTable->topLevelItem(i); + item->setData(DeviceTable_Power, 0, item->mCard.isScreenOn ? tr("On") : tr("Off")); } } diff --git a/LedOK/devicepanel.h b/LedOK/devicepanel.h index b7faf99..2fbcf84 100644 --- a/LedOK/devicepanel.h +++ b/LedOK/devicepanel.h @@ -1,17 +1,16 @@ #ifndef DEVICEPANEL_H #define DEVICEPANEL_H -#include "deviceitem.h" -#include -#include -#include -#include +#include "base/loqtreewidget.h" +#include +#include +#include #include -#include #include #include #include #include +#include class DeviceCtrlPanel; class DevicePanel : public QWidget { @@ -28,34 +27,18 @@ public: QTimer mUdpTimer; QDialog *specifyIPDlg{0}; QTextEdit *fdIP{0}; - void addLedCard(LedCard *); - void clearUdpHeartbeat(LedCard *); - void parseInfo(const QJsonObject &subObj,const QString &strIp); - void RestoreLedCardIpByUdpCmd(); - QList mLedCards; -protected: - void changeEvent(QEvent *) override; - void transUi(); -public slots: - void ShowDevicesInfoOrControlWidget(int index); -protected slots: - void onCheckStateChanged(int f); - void OnControlSendJson(QJsonObject &json,QString strFanYi); - void OnControlTcpSend(int iProgramIndex); - - void OnOutputInfo(QString); -signals: - void sigSelectedDeviceList(QList *); -private: + int mainPanelIdx{0}; + DeviceCtrlPanel *mDeviceCtrlPanel{0}; QLabel *label_3, *nDeviceNum; QComboBox *bnSpecifyIP; QPushButton *btnRefresh; QTreeWidgetItem *m_headerItem; QHBoxLayout *mHBox{0}; - DeviceCtrlPanel *mDeviceCtrlPanel{0}; - int m_intIndexFlagOfInfoOrControl{0}; - int GetSelectDeviceNum(); - QList mSelCards; +protected: + void changeEvent(QEvent *) override; + void transUi(); +signals: + void sigSelectedDeviceList(); }; #endif // DEVICEPANEL_H diff --git a/LedOK/globaldefine.cpp b/LedOK/globaldefine.cpp index 70f4a48..3071763 100644 --- a/LedOK/globaldefine.cpp +++ b/LedOK/globaldefine.cpp @@ -1,16 +1,29 @@ -#include +#include "globaldefine.h" +#include "devicepanel.h" +#include "deviceitem.h" #include #include #include #include #include +QList gSelCards; bool gVideoCompress = true; bool gVideoTranscoding = true; bool gTextAntialiasing = false; bool gShowLoraScreen = false; bool gWidthSplit = false; +DeviceItem *findItem(QString id) { + int cnt = gDevicePanel->mDeviceTable->topLevelItemCount(); + for(int i=0; imDeviceTable->topLevelItem(i); + if(item==0) continue; + if(item->mCard.id==id) return item; + } + return 0; +} + QString replyErr(QNetworkReply *reply) { reply->deleteLater(); auto error = reply->error(); @@ -59,24 +72,6 @@ QString checkReplyForJson(QNetworkReply *reply, QJsonDocument *outJson, QByteArr return ""; } -QString getRandomString(int len) { - static const char table[] = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"; - static const int tableSize = sizeof(table) - 1; - QString str; - str.resize(len); - for(int i=0; ihttpPost(strUrl, QJsonDocument(json).toJson(QJsonDocument::Compact)); -} -bool copyDir(const QString &source, const QString &destination, bool override) -{ +bool copyDir(const QString &source, const QString &destination, bool override) { QDir directory(source); - if (!directory.exists()) - { - return false; - } - - + if(!directory.exists()) return false; QString srcPath = QDir::toNativeSeparators(source); - if (!srcPath.endsWith(QDir::separator())) - srcPath += QDir::separator(); + if(!srcPath.endsWith(QDir::separator())) srcPath += QDir::separator(); QString dstPath = QDir::toNativeSeparators(destination); - if (!dstPath.endsWith(QDir::separator())) - dstPath += QDir::separator(); - + if (!dstPath.endsWith(QDir::separator())) dstPath += QDir::separator(); bool error = false; QStringList fileNames = directory.entryList(QDir::AllEntries | QDir::NoDotAndDotDot | QDir::Hidden); @@ -133,8 +116,6 @@ bool copyDir(const QString &source, const QString &destination, bool override) } } } - - return !error; } unsigned char GetCheckCodeIn8(unsigned char * pBuffer,unsigned int uiSize) { diff --git a/LedOK/globaldefine.h b/LedOK/globaldefine.h index bacccf3..21acf4c 100644 --- a/LedOK/globaldefine.h +++ b/LedOK/globaldefine.h @@ -1,11 +1,27 @@ #ifndef GLOBALDEFINE_H #define GLOBALDEFINE_H -#include "gutil/qnetwork.h" -#include -#include -#include + #include -#include +#include + +class LedCard { +public: + QString id; + QString ip; + int mWidth{0}; + int mHeight{0}; + int bright{100}; + int BrightnessLevel{255}; + QString FirmwareVersion; + QString HardVersion = "0000"; + QString ScreenResolution; + QString androidVersion; + QString alias; + bool hasPassword{false}; + bool isLocked{true}; + bool isScreenOn{true}; + bool isOnline{true}; +}; enum { MainPage_DeviceManager = 0, @@ -21,7 +37,7 @@ struct RESTORE_IP { char cGateway[20]; char cDns[20]; }; -struct Packet { +struct UDPPacket { unsigned char SyncHead[3]; unsigned char ucCommType; char serialCode[20]; @@ -145,7 +161,9 @@ enum _NET_COMMU_TYPE { COMMAND_CONNECT_COLSE_ANSWER }; - +class DevicePanel; +extern DevicePanel *gDevicePanel; +extern QList gSelCards; extern bool gVideoCompress; extern bool gVideoTranscoding; extern bool gTextAntialiasing; @@ -153,9 +171,6 @@ extern bool gShowLoraScreen; extern bool gWidthSplit; extern quint64 dirFileSize(const QString &path); -extern bool isFileExist(QString fullFileName); -extern QString getRandomString(int length); -extern void HttpPostByTypeJsonObject(HpptClient *pHpptClient, QString strUrl,QJsonObject json); extern bool copyDir(const QString &source, const QString &destination, bool override); extern unsigned char GetCheckCodeIn8(unsigned char * pBuffer,unsigned int uiSize); @@ -171,6 +186,8 @@ enum _ENUM_CONTRL_WIDGET { Setting_Test, Setting_End, }; +class DeviceItem; +extern DeviceItem *findItem(QString id); QString replyErr(QNetworkReply *); QString checkReply(QNetworkReply *, QJsonDocument * = 0); @@ -178,8 +195,8 @@ QString checkReplyForJson(QNetworkReply *, QJsonDocument * = 0, QByteArray * = 0 #define Def_CtrlReqPre \ waitingDlg->show();\ - auto card = gSelCards->at(0);\ - auto reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json);\ + auto card = gSelCards[0];\ + auto reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json);\ waitingDlg->connAbort(reply); #define Def_CtrlSetReqAfter \ @@ -201,75 +218,10 @@ QString checkReplyForJson(QNetworkReply *, QJsonDocument * = 0, QByteArray * = 0 } #define Def_CtrlSetMulti(tip) \ - auto reply = NetReq("http://"+card->m_strCardIp+":2016/settings").timeout(120000).post(json);\ - connect(reply, &QNetworkReply::finished, card, [=] {\ + auto reply = NetReq("http://"+card.ip+":2016/settings").timeout(120000).post(json);\ + connect(reply, &QNetworkReply::finished, gFdResInfo, [=] {\ QString err = checkReplyForJson(reply);\ - gFdResInfo->append(card->m_strCardId+" "+tip+" "+(err.isEmpty()?QCoreApplication::translate("Def","Success"):err));\ + gFdResInfo->append(card.id+" "+tip+" "+(err.isEmpty()?QCoreApplication::translate("Def","Success"):err));\ }); -#define CHECK_CARD_SELECTED \ - if(gSelCards->isEmpty()) {\ - QMessageBox::information(this, tr("Tip"), tr("NoSelectedController"));\ - return;\ - } - -#define MACRO_DEFINE_TIPDLG_FUCN(TIP,SUCCESS,FAILED) \ - if(gSelCards->count()==1) {\ - HttpPostByTypeJsonObject(pHpptClient, m_strUrl, json);\ - if(m_PostingDlg==nullptr) {\ - m_PostingDlg = new LoEmptyDialog(this);\ - connect(m_PostingDlg,SIGNAL(sigClose()),this,SLOT(DeletePostingDlg()));\ - connect(m_pGetAskTimer,SIGNAL(timeout()),m_PostingDlg,SLOT(TimerOutUnlock()));\ - m_PostingDlg->lock(TIP,SUCCESS,FAILED);\ - m_pGetAskTimer->start(5000);\ - m_PostingDlg->exec();\ - }\ - } else if(gSelCards->count() > 1) emit sigSend(json,TIP); - - -#define MACRO_DEFINE_TIPDLG_ALL_FUCN(READBACK,SUCCESS,FAILED) \ - if(gSelCards->count()==1) {\ - if(m_PostingDlg==nullptr) {\ - m_PostingDlg = new LoEmptyDialog(this);\ - connect(m_PostingDlg,SIGNAL(sigClose()),this,SLOT(DeletePostingDlg()));\ - connect(m_pGetAskTimer,SIGNAL(timeout()),m_PostingDlg,SLOT(TimerOutUnlock()));\ - m_PostingDlg->lock(READBACK+" "+gSelCards->at(0)->m_strCardId,SUCCESS,FAILED);\ - m_pGetAskTimer->start(5000);\ - m_PostingDlg->exec();\ - }\ - }\ - - -#define MARCO_DEFINE_CONTROL_FUNC2(PARENT,PARENT1) \ - pHpptClient = new HpptClient(this);\ - connect(pHpptClient,SIGNAL(httpPostRspReady(QString , QString , QByteArray )),this,SLOT(OnProHttpResponse(QString , QString , QByteArray)));\ - pHpptClientAll = new HpptClient(this);\ - connect(pHpptClientAll,SIGNAL(httpPostRspReady(QString , QString , QByteArray )),this,SLOT(OnProHttpResponseAll(QString , QString , QByteArray)));\ - m_pGetAskTimer=new QTimer(this);\ - connect(PARENT1,SIGNAL(sigSwitchIndexChanged(int)),this,SLOT(OnControlTypeSwitchIndexChanged(int)));\ - connect(PARENT,SIGNAL(sigSelectedDeviceList(QList *)),this,SLOT(onSelectedDeviceList(QList *)));\ - connect(this,SIGNAL(sigSend(QJsonObject &,QString)),PARENT,SLOT(OnControlSendJson(QJsonObject &,QString)));\ - onSelectedDeviceList(list); - -#define MACRO_ASKTIME_STOP \ -if(m_pGetAskTimer && m_pGetAskTimer->isActive()) m_pGetAskTimer->stop(); - -#define MACRO_POSTING_DLG_UNLOCK \ -if(m_PostingDlg && m_PostingDlg->getLockStatus()) m_PostingDlg->unlock(); - -#define MACRO_DEFINE_CONTROL_FUNC3 \ - if(m_pLedlist!=nullptr)\ - {\ - if(m_pLedlist->count()==1)\ - {\ - m_pLedCard=list->at(0);\ - m_strUrl="http://"+m_pLedCard->m_strCardIp+":2016/settings";\ - if(m_oldLedlist!=m_pLedCard&&m_bSelected==true)\ - {\ - m_oldLedlist=m_pLedCard;\ - onReadbackAllThisPage();\ - }\ - }\ - } - #endif // GLOBALDEFINE_H diff --git a/LedOK/mainwindow.cpp b/LedOK/mainwindow.cpp index 9dae7cf..7a9be24 100644 --- a/LedOK/mainwindow.cpp +++ b/LedOK/mainwindow.cpp @@ -3,6 +3,8 @@ #include "gutil/qgui.h" #include "cfg.h" #include "tools.h" +#include "globaldefine.h" +#include "devicectrlpanel.h" #include "device/upgradeapkdialog.h" #include #include @@ -15,6 +17,8 @@ #include #include #include "QSimpleUpdater.h" +#include "deviceitem.h" +#include "devicepanel.h" extern QPoint gPlayPos; @@ -307,9 +311,9 @@ MainWindow::MainWindow(QWidget *parent) : BaseWin(parent) { auto hBox = new QHBoxLayout(); hBox->setSpacing(2); + hBox->addSpacing(144); mBtnGrp = new QButtonGroup(this); - hBox->addSpacing(144); for(int i=0; isetToolButtonStyle(Qt::ToolButtonTextUnderIcon); @@ -331,30 +335,34 @@ MainWindow::MainWindow(QWidget *parent) : BaseWin(parent) { wgts[MainPage_Setting] = mDevicePanel; wgts[MainPage_LoraScreen] = m_wGuangYingPinWidget; - vBox->addWidget(wgts[curIndex]);//初始化响应页面为终端管理页面 + vBox->addWidget(wgts[mDevicePanel->mainPanelIdx]);//初始化响应页面为终端管理页面 - mBtnGrp->button(curIndex)->setChecked(true); + mBtnGrp->button(mDevicePanel->mainPanelIdx)->setChecked(true); connect(mBtnGrp, &QButtonGroup::idToggled, this, [this, vBox](int id, bool checked) { - if(!checked || id==curIndex) return; - if((id==MainPage_DeviceManager && curIndex==MainPage_Setting) || (id==MainPage_Setting && curIndex==MainPage_DeviceManager)){ - mDevicePanel->ShowDevicesInfoOrControlWidget(id); - curIndex = id; - } else { - vBox->replaceWidget(wgts[curIndex], wgts[id]); - wgts[curIndex]->setParent(0); - curIndex = id; - if(curIndex == MainPage_DeviceManager || curIndex == MainPage_Setting) { - //开启UDP定时器 - mDevicePanel->mUdpTimer.start(60000); - int cnt = mDevicePanel->mDeviceTable->topLevelItemCount(); - for(int i=0; i(mDevicePanel->mDeviceTable->topLevelItem(i)); - item->mHeartbeatTimer.start(60000); - item->DeviceItemHttpPost(); - } - mDevicePanel->ShowDevicesInfoOrControlWidget(id); + if(!checked || id==mDevicePanel->mainPanelIdx) return; + if((id!=MainPage_DeviceManager || mDevicePanel->mainPanelIdx!=MainPage_Setting) && (id!=MainPage_Setting || mDevicePanel->mainPanelIdx!=MainPage_DeviceManager)){ + vBox->replaceWidget(wgts[mDevicePanel->mainPanelIdx], wgts[id]); + wgts[mDevicePanel->mainPanelIdx]->setParent(0); + } + mDevicePanel->mainPanelIdx = id; + if(id==MainPage_DeviceManager) { //设备信息列表页面 + mDevicePanel->mDeviceTable->hideColumn(0); + mDevicePanel->mDeviceTable->fdIsSelAll->hide(); + if(mDevicePanel->mDeviceCtrlPanel) { + for(int j=DeviceTable_ScreenSize;jmDeviceTable->showColumn(j); + mDevicePanel->mDeviceTable->setMaximumWidth(0xffffff); + mDevicePanel->mDeviceCtrlPanel->hide(); + mDevicePanel->fdCardNumInfo->hide(); } + } else if(id==MainPage_Setting) { //终端控制页面 + mDevicePanel->mDeviceTable->showColumn(0); + mDevicePanel->mDeviceTable->fdIsSelAll->show(); + for(int j=DeviceTable_ScreenSize; jmDeviceTable->hideColumn(j); + if(mDevicePanel->mDeviceCtrlPanel==0) mDevicePanel->mHBox->addWidget(mDevicePanel->mDeviceCtrlPanel = new DeviceCtrlPanel(mDevicePanel)); + else mDevicePanel->mDeviceCtrlPanel->show(); + mDevicePanel->fdCardNumInfo->show(); + mDevicePanel->mDeviceTable->setMaximumWidth(340); } }); @@ -364,7 +372,40 @@ MainWindow::MainWindow(QWidget *parent) : BaseWin(parent) { m_pOneKeyCheckCard->setProperty("ssType", "progManageTool"); connect(m_pOneKeyCheckCard, &QPushButton::clicked, this, [this] { auto res = QMessageBox::warning(this, tr("Tip Info"), tr("RestoreLedCardIpByUdpTip"), QMessageBox::Ok, QMessageBox::Cancel); - if(res == QMessageBox::Ok) mDevicePanel->RestoreLedCardIpByUdpCmd(); + if(res != QMessageBox::Ok) return; + QList networkinterfaces = QNetworkInterface::allInterfaces(); + foreach (QNetworkInterface interfaces, networkinterfaces) {//networkinterfaces负责提供主机的IP地址和网络接口的列表 + foreach (QNetworkAddressEntry entry, interfaces.addressEntries()) {//QNetworkAddressEntry存储了一个IP地址,子网掩码和广播地址 + entry.setBroadcast(QHostAddress::Broadcast); + QHostAddress broadcastAddress("255.255.255.255"); + entry.setBroadcast(QHostAddress::Broadcast); + RESTORE_IP stTempIp; + memset(&stTempIp,0x00,sizeof(RESTORE_IP)); + QString strNew=entry.ip().toString(); + int itempOffset = strNew.lastIndexOf("."); + QString sstrNew=strNew.left(itempOffset)+".254"; + if(sstrNew.length()<=20) memcpy(stTempIp.cNewIp,sstrNew.toLatin1().data(),sstrNew.length()); + QString strMask=entry.netmask().toString(); + if(strMask.length()<=20) memcpy(stTempIp.cMask,strMask.toLatin1().data(),strMask.length()); + QString strGateway=entry.ip().toString(); + if(strGateway.length()<=20) memcpy(stTempIp.cGateway,strGateway.toLatin1().data(),strGateway.length()); + if(strGateway.length()<=20) memcpy(stTempIp.cDns,strGateway.toLatin1().data(),strGateway.length()); + STREAM_PACKET packet; + memset(&packet, 0, sizeof(STREAM_PACKET)); + memset(packet.SyncHead, 0x7e, 3); + memset(packet.ucSerialCode, 0x00, 20); + QByteArray ba("Broadcast!"); + memcpy(packet.ucSerialCode, ba.data(), ba.size()); + packet.iLength = 80; + packet.ucCommType = COMMAND_ONLY_RESET_CARD_IP; + memcpy(packet.pDataBuffer, &stTempIp, 80); + packet.pDataBuffer[packet.iLength] = GetCheckCodeIn8(&packet.ucCommType,packet.iLength+sizeof(packet.ucCommType)+sizeof(char)*20+sizeof(packet.iLength)); + int iLenPacket = packet.iLength+sizeof(int)+3*sizeof(unsigned char)+sizeof(char)+20*sizeof(char)+sizeof(char);/////除正文外的协议结构大小; + QUdpSocket *tempUdpSocket = new QUdpSocket(this); + if(!tempUdpSocket->bind(entry.ip())) break; + tempUdpSocket->writeDatagram((char *)&packet,iLenPacket,broadcastAddress, 31296); + } + } }); hBox->addWidget(m_pOneKeyCheckCard); hBox->addStretch(); diff --git a/LedOK/mainwindow.h b/LedOK/mainwindow.h index f132861..753d199 100644 --- a/LedOK/mainwindow.h +++ b/LedOK/mainwindow.h @@ -4,7 +4,7 @@ #include "base/loqtitlebar.h" #include "basewin.h" #include "devicepanel.h" -#include "devicectrlpanel.h" +#include "globaldefine.h" #include "mguangyingpinwidget.h" #include "progpanel.h" #include @@ -33,7 +33,6 @@ private: QButtonGroup *mBtnGrp; QWidget *wgts[MainPage_End]{}; - int curIndex{0}; QPushButton *m_pOneKeyCheckCard; DevicePanel *mDevicePanel; ProgPanel *mProgPanel; diff --git a/LedOK/mguangyingpinwidget.cpp b/LedOK/mguangyingpinwidget.cpp index bd23d90..3adba0e 100644 --- a/LedOK/mguangyingpinwidget.cpp +++ b/LedOK/mguangyingpinwidget.cpp @@ -1,53 +1,795 @@ -#include #include "mguangyingpinwidget.h" -#include "ui_mguangyingpinwidget.h" -#include +#include "gutil/qgui.h" #include "globaldefine.h" -mGuangYingPinWidget::mGuangYingPinWidget(QWidget *parent) : - QWidget(parent), - ui(new Ui::mGuangYingPinWidget) -{ +#include +#include +#include +#include + +mGuangYingPinWidget::mGuangYingPinWidget(QWidget *parent) : QWidget(parent) { setAutoFillBackground(true); QPalette pal; pal.setBrush(QPalette::Window, QColor(0xeeeeee)); setPalette(pal); - ui->setupUi(this); - ui->pushButton1->setProperty("ssType", "progManageTool"); - ui->pushButton2->setProperty("ssType", "progManageTool"); - ui->pushButton3->setProperty("ssType", "progManageTool"); - ui->pushButton4->setProperty("ssType", "progManageTool"); - ui->pushButton5->setProperty("ssType", "progManageTool"); - ui->pushButton6->setProperty("ssType", "progManageTool"); - ui->pushButton7->setProperty("ssType", "progManageTool"); - ui->pushButton8->setProperty("ssType", "progManageTool"); - ui->pushButton9->setProperty("ssType", "progManageTool"); - ui->pushButton10->setProperty("ssType", "progManageTool"); - ui->pushButton11->setProperty("ssType", "progManageTool"); - ui->pushButton12->setProperty("ssType", "progManageTool"); - ui->pushButton13->setProperty("ssType", "progManageTool"); - ui->pushButton14->setProperty("ssType", "progManageTool"); - ui->pushButton15->setProperty("ssType", "progManageTool"); - ui->pushButton16->setProperty("ssType", "progManageTool"); - ui->pushButton17->setProperty("ssType", "progManageTool"); - ui->pushButton18->setProperty("ssType", "progManageTool"); - ui->pushButton19->setProperty("ssType", "progManageTool"); - ui->pushButton20->setProperty("ssType", "progManageTool"); + auto vBox = new VBox(this); + auto hBox = new HBox(vBox); - ui->pushButtonSend->setProperty("ssType", "progManageTool"); - ui->pushButtonPrevious->setProperty("ssType", "progManageTool"); - ui->pushButtonPrevious->setIcon(QIcon(":/res/previous.png")); - ui->pushButtonNext->setProperty("ssType", "progManageTool"); - ui->pushButtonNext->setIcon(QIcon(":/res/next.png")); - ui->pushButtonLoop->setProperty("ssType", "progManageTool"); - ui->pushButtonLoop->setIcon(QIcon(":/res/loop.png")); - ui->pushButtonMainOpen->setProperty("ssType", "progManageTool"); - ui->pushButtonAuxOpen->setProperty("ssType", "progManageTool"); - ui->pushButtonBrightnessSet->setProperty("ssType", "progManageTool"); - ui->pushButtonScreenOn->setProperty("ssType", "progManageTool"); - ui->pushButtonScreenOff->setProperty("ssType", "progManageTool"); - ui->pushButtonRefresh->setProperty("ssType", "progManageTool"); - ui->pushButtonClearLog->setProperty("ssType", "progManageTool"); + auto line = new QFrame; + line->setFrameShape(QFrame::VLine); + line->setFrameShadow(QFrame::Sunken); + hBox->addWidget(line); + + groupBox_com = new QGroupBox(this); + groupBox_com->setFlat(true); + groupBox_com->setCheckable(true); + horizontalLayout_29 = new QHBoxLayout(groupBox_com); + horizontalLayout_29->setObjectName(QString::fromUtf8("horizontalLayout_29")); + verticalLayout_2 = new QVBoxLayout(); + verticalLayout_2->setObjectName(QString::fromUtf8("verticalLayout_2")); + verticalLayout_2->setContentsMargins(-1, 0, -1, -1); + groupBoxMain = new QGroupBox(groupBox_com); + groupBoxMain->setObjectName(QString::fromUtf8("groupBoxMain")); + groupBoxMain->setMaximumSize(QSize(200, 16777215)); + groupBoxMain->setAlignment(Qt::AlignCenter); + groupBoxMain->setFlat(true); + verticalLayout_6 = new QVBoxLayout(groupBoxMain); + verticalLayout_6->setObjectName(QString::fromUtf8("verticalLayout_6")); + horizontalLayout_6 = new QHBoxLayout(); + horizontalLayout_6->setObjectName(QString::fromUtf8("horizontalLayout_6")); + label_PortName = new QLabel(groupBoxMain); + label_PortName->setObjectName(QString::fromUtf8("label_PortName")); + + horizontalLayout_6->addWidget(label_PortName); + + comboBox_SPortName = new QComboBox(groupBoxMain); + comboBox_SPortName->setObjectName(QString::fromUtf8("comboBox_SPortName")); + comboBox_SPortName->setMinimumSize(QSize(80, 0)); + + horizontalLayout_6->addWidget(comboBox_SPortName); + + + verticalLayout_6->addLayout(horizontalLayout_6); + + horizontalLayout_9 = new QHBoxLayout(); + horizontalLayout_9->setObjectName(QString::fromUtf8("horizontalLayout_9")); + horizontalLayout_9->setContentsMargins(-1, 0, -1, -1); + label_BaudRate = new QLabel(groupBoxMain); + label_BaudRate->setObjectName(QString::fromUtf8("label_BaudRate")); + + horizontalLayout_9->addWidget(label_BaudRate); + + comboBox_SPortBaud = new QComboBox(groupBoxMain); + comboBox_SPortBaud->addItem("1200"); + comboBox_SPortBaud->addItem("2400"); + comboBox_SPortBaud->addItem("4800"); + comboBox_SPortBaud->addItem("9600"); + comboBox_SPortBaud->addItem("19200"); + comboBox_SPortBaud->addItem("38400"); + comboBox_SPortBaud->addItem("57600"); + comboBox_SPortBaud->addItem("115200"); + horizontalLayout_9->addWidget(comboBox_SPortBaud); + + verticalLayout_6->addLayout(horizontalLayout_9); + + horizontalLayout_15 = new QHBoxLayout(); + horizontalLayout_15->setObjectName(QString::fromUtf8("horizontalLayout_15")); + horizontalLayout_15->setContentsMargins(-1, 0, -1, -1); + label_DataBit = new QLabel(groupBoxMain); + label_DataBit->setObjectName(QString::fromUtf8("label_DataBit")); + + horizontalLayout_15->addWidget(label_DataBit); + + comboBox_SPortDataBit = new QComboBox(groupBoxMain); + comboBox_SPortDataBit->addItem("5"); + comboBox_SPortDataBit->addItem("6"); + comboBox_SPortDataBit->addItem("7"); + comboBox_SPortDataBit->addItem("8"); + horizontalLayout_15->addWidget(comboBox_SPortDataBit); + + + verticalLayout_6->addLayout(horizontalLayout_15); + + horizontalLayout_17 = new QHBoxLayout(); + horizontalLayout_17->setObjectName(QString::fromUtf8("horizontalLayout_17")); + horizontalLayout_17->setContentsMargins(-1, 0, -1, -1); + label_OEBit = new QLabel(groupBoxMain); + label_OEBit->setObjectName(QString::fromUtf8("label_OEBit")); + + horizontalLayout_17->addWidget(label_OEBit); + + comboBox_SPortOEBit = new QComboBox(groupBoxMain); + comboBox_SPortOEBit->addItem(tr("No")); + comboBox_SPortOEBit->addItem(tr("Even")); + comboBox_SPortOEBit->addItem(tr("Odd")); + comboBox_SPortOEBit->addItem(tr("Space")); + comboBox_SPortOEBit->addItem(tr("Mark")); + horizontalLayout_17->addWidget(comboBox_SPortOEBit); + + verticalLayout_6->addLayout(horizontalLayout_17); + + horizontalLayout_18 = new QHBoxLayout(); + horizontalLayout_18->setObjectName(QString::fromUtf8("horizontalLayout_18")); + horizontalLayout_18->setContentsMargins(-1, 0, -1, -1); + label_StopBit = new QLabel(groupBoxMain); + label_StopBit->setObjectName(QString::fromUtf8("label_StopBit")); + + horizontalLayout_18->addWidget(label_StopBit); + + comboBox_SPortStopBit = new QComboBox(groupBoxMain); + comboBox_SPortStopBit->addItem("1"); + comboBox_SPortStopBit->addItem("2"); + comboBox_SPortStopBit->addItem("1.5"); + horizontalLayout_18->addWidget(comboBox_SPortStopBit); + + verticalLayout_6->addLayout(horizontalLayout_18); + + horizontalLayout_22 = new QHBoxLayout(); + horizontalLayout_22->setObjectName(QString::fromUtf8("horizontalLayout_22")); + horizontalLayout_22->setContentsMargins(-1, 0, -1, -1); + label_ComStatus = new QLabel(groupBoxMain); + label_ComStatus->setObjectName(QString::fromUtf8("label_ComStatus")); + + horizontalLayout_22->addWidget(label_ComStatus); + + graphicsView_ComStatus = new QGraphicsView(groupBoxMain); + graphicsView_ComStatus->setObjectName(QString::fromUtf8("graphicsView_ComStatus")); + graphicsView_ComStatus->setMaximumSize(QSize(30, 30)); + + horizontalLayout_22->addWidget(graphicsView_ComStatus); + + + verticalLayout_6->addLayout(horizontalLayout_22); + + horizontalLayout_4 = new QHBoxLayout(); + horizontalLayout_4->setObjectName(QString::fromUtf8("horizontalLayout_4")); + pushButtonMainOpen = new QPushButton(groupBoxMain); + pushButtonMainOpen->setObjectName(QString::fromUtf8("pushButtonMainOpen")); + pushButtonMainOpen->setMinimumSize(QSize(80, 30)); + + horizontalLayout_4->addWidget(pushButtonMainOpen); + + + verticalLayout_6->addLayout(horizontalLayout_4); + + + verticalLayout_2->addWidget(groupBoxMain); + + + horizontalLayout_29->addLayout(verticalLayout_2); + + line = new QFrame(groupBox_com); + line->setFrameShape(QFrame::VLine); + line->setFrameShadow(QFrame::Sunken); + horizontalLayout_29->addWidget(line); + + verticalLayout_3 = new QVBoxLayout(); + verticalLayout_3->setObjectName(QString::fromUtf8("verticalLayout_3")); + verticalLayout_3->setContentsMargins(0, -1, -1, -1); + groupBoxAux = new QGroupBox(groupBox_com); + groupBoxAux->setObjectName(QString::fromUtf8("groupBoxAux")); + groupBoxAux->setMaximumSize(QSize(200, 16777215)); + groupBoxAux->setAlignment(Qt::AlignCenter); + groupBoxAux->setFlat(true); + groupBoxAux->setCheckable(false); + verticalLayout_8 = new QVBoxLayout(groupBoxAux); + verticalLayout_8->setObjectName(QString::fromUtf8("verticalLayout_8")); + horizontalLayout_7 = new QHBoxLayout(); + horizontalLayout_7->setObjectName(QString::fromUtf8("horizontalLayout_7")); + label_PortNameAux = new QLabel(groupBoxAux); + label_PortNameAux->setObjectName(QString::fromUtf8("label_PortNameAux")); + + horizontalLayout_7->addWidget(label_PortNameAux); + + comboBox_SPortNameAux = new QComboBox(groupBoxAux); + comboBox_SPortNameAux->setObjectName(QString::fromUtf8("comboBox_SPortNameAux")); + comboBox_SPortNameAux->setMinimumSize(QSize(80, 0)); + + horizontalLayout_7->addWidget(comboBox_SPortNameAux); + + + verticalLayout_8->addLayout(horizontalLayout_7); + + horizontalLayout_24 = new QHBoxLayout(); + horizontalLayout_24->setObjectName(QString::fromUtf8("horizontalLayout_24")); + label_BaudRateAux = new QLabel(groupBoxAux); + label_BaudRateAux->setObjectName(QString::fromUtf8("label_BaudRateAux")); + + horizontalLayout_24->addWidget(label_BaudRateAux); + + comboBox_SPortBaudAux = new QComboBox(groupBoxAux); + comboBox_SPortBaudAux->addItem("1200"); + comboBox_SPortBaudAux->addItem("2400"); + comboBox_SPortBaudAux->addItem("4800"); + comboBox_SPortBaudAux->addItem("9600"); + comboBox_SPortBaudAux->addItem("19200"); + comboBox_SPortBaudAux->addItem("38400"); + comboBox_SPortBaudAux->addItem("57600"); + comboBox_SPortBaudAux->addItem("115200"); + horizontalLayout_24->addWidget(comboBox_SPortBaudAux); + + verticalLayout_8->addLayout(horizontalLayout_24); + + horizontalLayout_25 = new QHBoxLayout(); + horizontalLayout_25->setObjectName(QString::fromUtf8("horizontalLayout_25")); + label_DataBitAux = new QLabel(groupBoxAux); + label_DataBitAux->setObjectName(QString::fromUtf8("label_DataBitAux")); + + horizontalLayout_25->addWidget(label_DataBitAux); + + comboBox_SPortDataBitAux = new QComboBox(groupBoxAux); + comboBox_SPortDataBitAux->addItem("5"); + comboBox_SPortDataBitAux->addItem("6"); + comboBox_SPortDataBitAux->addItem("7"); + comboBox_SPortDataBitAux->addItem("8"); + horizontalLayout_25->addWidget(comboBox_SPortDataBitAux); + + verticalLayout_8->addLayout(horizontalLayout_25); + + horizontalLayout_26 = new QHBoxLayout(); + horizontalLayout_26->setObjectName(QString::fromUtf8("horizontalLayout_26")); + label_OEBitAux = new QLabel(groupBoxAux); + label_OEBitAux->setObjectName(QString::fromUtf8("label_OEBitAux")); + + horizontalLayout_26->addWidget(label_OEBitAux); + + comboBox_SPortOEBitAux = new QComboBox(groupBoxAux); + comboBox_SPortOEBitAux->addItem(tr("No")); + comboBox_SPortOEBitAux->addItem(tr("Even")); + comboBox_SPortOEBitAux->addItem(tr("Odd")); + comboBox_SPortOEBitAux->addItem(tr("Space")); + comboBox_SPortOEBitAux->addItem(tr("Mark")); + horizontalLayout_26->addWidget(comboBox_SPortOEBitAux); + + verticalLayout_8->addLayout(horizontalLayout_26); + + horizontalLayout_27 = new QHBoxLayout(); + horizontalLayout_27->setObjectName(QString::fromUtf8("horizontalLayout_27")); + label_StopBitAux = new QLabel(groupBoxAux); + label_StopBitAux->setObjectName(QString::fromUtf8("label_StopBitAux")); + + horizontalLayout_27->addWidget(label_StopBitAux); + + comboBox_SPortStopBitAux = new QComboBox(groupBoxAux); + comboBox_SPortStopBitAux->addItem("1"); + comboBox_SPortStopBitAux->addItem("2"); + comboBox_SPortStopBitAux->addItem("1.5"); + horizontalLayout_27->addWidget(comboBox_SPortStopBitAux); + + + verticalLayout_8->addLayout(horizontalLayout_27); + + horizontalLayout_28 = new QHBoxLayout(); + horizontalLayout_28->setObjectName(QString::fromUtf8("horizontalLayout_28")); + label_ComStatusAux = new QLabel(groupBoxAux); + label_ComStatusAux->setObjectName(QString::fromUtf8("label_ComStatusAux")); + + horizontalLayout_28->addWidget(label_ComStatusAux); + + graphicsView_ComStatusAux = new QGraphicsView(groupBoxAux); + graphicsView_ComStatusAux->setObjectName(QString::fromUtf8("graphicsView_ComStatusAux")); + graphicsView_ComStatusAux->setMaximumSize(QSize(30, 30)); + + horizontalLayout_28->addWidget(graphicsView_ComStatusAux); + + + verticalLayout_8->addLayout(horizontalLayout_28); + + horizontalLayout_5 = new QHBoxLayout(); + horizontalLayout_5->setObjectName(QString::fromUtf8("horizontalLayout_5")); + pushButtonAuxOpen = new QPushButton(groupBoxAux); + pushButtonAuxOpen->setObjectName(QString::fromUtf8("pushButtonAuxOpen")); + pushButtonAuxOpen->setMinimumSize(QSize(80, 30)); + + horizontalLayout_5->addWidget(pushButtonAuxOpen); + + + verticalLayout_8->addLayout(horizontalLayout_5); + + + verticalLayout_3->addWidget(groupBoxAux); + + + horizontalLayout_29->addLayout(verticalLayout_3); + + pushButtonRefresh = new QPushButton(groupBox_com); + pushButtonRefresh->setMinimumSize(QSize(80, 40)); + horizontalLayout_29->addWidget(pushButtonRefresh); + + hBox->addWidget(groupBox_com); + + groupBox_Network = new QGroupBox(this); + groupBox_Network->setObjectName(QString::fromUtf8("groupBox_Network")); + groupBox_Network->setFlat(true); + groupBox_Network->setCheckable(true); + groupBox_Network->setChecked(false); + + hBox->addWidget(groupBox_Network); + + horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + + hBox->addItem(horizontalSpacer); + + line = new QFrame; + line->setFrameShape(QFrame::VLine); + line->setFrameShadow(QFrame::Sunken); + hBox->addWidget(line); + + verticalLayout_9 = new QVBoxLayout(); + verticalLayout_9->setObjectName(QString::fromUtf8("verticalLayout_9")); + verticalLayout_9->setContentsMargins(-1, 0, -1, -1); + groupBoxParam = new QGroupBox; + groupBoxParam->setMaximumSize(QSize(200, 16777215)); + groupBoxParam->setAlignment(Qt::AlignCenter); + groupBoxParam->setFlat(true); + verticalLayout_10 = new QVBoxLayout(groupBoxParam); + verticalLayout_10->setObjectName(QString::fromUtf8("verticalLayout_10")); + horizontalLayout_20 = new QHBoxLayout(); + horizontalLayout_20->setObjectName(QString::fromUtf8("horizontalLayout_20")); + label_ResendTimes = new QLabel(groupBoxParam); + label_ResendTimes->setObjectName(QString::fromUtf8("label_ResendTimes")); + horizontalLayout_20->addWidget(label_ResendTimes); + + lineEdit_ResendTimes = new QLineEdit(groupBoxParam); + lineEdit_ResendTimes->setObjectName(QString::fromUtf8("lineEdit_ResendTimes")); + lineEdit_ResendTimes->setMaximumSize(QSize(80, 16777215)); + + horizontalLayout_20->addWidget(lineEdit_ResendTimes); + + + verticalLayout_10->addLayout(horizontalLayout_20); + + horizontalLayout_23 = new QHBoxLayout(); + + label_DelayMill = new QLabel(groupBoxParam); + horizontalLayout_23->addWidget(label_DelayMill); + + lineEdit_DelayMill = new QLineEdit(groupBoxParam); + lineEdit_DelayMill->setMaximumSize(QSize(80, 16777215)); + horizontalLayout_23->addWidget(lineEdit_DelayMill); + + + verticalLayout_10->addLayout(horizontalLayout_23); + + + verticalLayout_9->addWidget(groupBoxParam); + + verticalSpacer = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding); + + verticalLayout_9->addItem(verticalSpacer); + + + hBox->addLayout(verticalLayout_9); + + horizontalSpacer_2 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + + hBox->addItem(horizontalSpacer_2); + + + line = new QFrame; + line->setFrameShape(QFrame::HLine); + line->setFrameShadow(QFrame::Sunken); + vBox->addWidget(line); + + verticalLayout_4 = new QVBoxLayout(); + verticalLayout_4->setObjectName(QString::fromUtf8("verticalLayout_4")); + horizontalLayout_14 = new QHBoxLayout(); + horizontalLayout_14->setObjectName(QString::fromUtf8("horizontalLayout_14")); + horizontalLayout_14->setContentsMargins(-1, 2, -1, -1); + horizontalLayout_16 = new QHBoxLayout(); + horizontalLayout_16->setObjectName(QString::fromUtf8("horizontalLayout_16")); + horizontalLayout_16->setContentsMargins(-1, 0, -1, -1); + verticalLayout_5 = new QVBoxLayout(); + verticalLayout_5->setObjectName(QString::fromUtf8("verticalLayout_5")); + verticalLayout_5->setContentsMargins(-1, 0, -1, -1); + horizontalLayout_13 = new QHBoxLayout(); + horizontalLayout_13->setObjectName(QString::fromUtf8("horizontalLayout_13")); + pushButton1 = new QPushButton; + pushButton1->setObjectName(QString::fromUtf8("pushButton1")); + pushButton1->setMinimumSize(QSize(40, 40)); + pushButton1->setMaximumSize(QSize(40, 40)); + + horizontalLayout_13->addWidget(pushButton1); + + pushButton2 = new QPushButton; + pushButton2->setObjectName(QString::fromUtf8("pushButton2")); + pushButton2->setMinimumSize(QSize(40, 40)); + pushButton2->setMaximumSize(QSize(40, 40)); + + horizontalLayout_13->addWidget(pushButton2); + + pushButton3 = new QPushButton; + pushButton3->setObjectName(QString::fromUtf8("pushButton3")); + pushButton3->setMinimumSize(QSize(40, 40)); + pushButton3->setMaximumSize(QSize(40, 40)); + + horizontalLayout_13->addWidget(pushButton3); + + pushButton4 = new QPushButton; + pushButton4->setObjectName(QString::fromUtf8("pushButton4")); + pushButton4->setMinimumSize(QSize(40, 40)); + pushButton4->setMaximumSize(QSize(40, 40)); + + horizontalLayout_13->addWidget(pushButton4); + + pushButton5 = new QPushButton; + pushButton5->setObjectName(QString::fromUtf8("pushButton5")); + pushButton5->setMinimumSize(QSize(40, 40)); + pushButton5->setMaximumSize(QSize(40, 40)); + + horizontalLayout_13->addWidget(pushButton5); + + + verticalLayout_5->addLayout(horizontalLayout_13); + + horizontalLayout_12 = new QHBoxLayout(); + pushButton6 = new QPushButton; + pushButton6->setObjectName(QString::fromUtf8("pushButton6")); + pushButton6->setMinimumSize(QSize(40, 40)); + pushButton6->setMaximumSize(QSize(40, 40)); + + horizontalLayout_12->addWidget(pushButton6); + + pushButton7 = new QPushButton; + pushButton7->setObjectName(QString::fromUtf8("pushButton7")); + pushButton7->setMinimumSize(QSize(40, 40)); + pushButton7->setMaximumSize(QSize(40, 40)); + + horizontalLayout_12->addWidget(pushButton7); + + pushButton8 = new QPushButton; + pushButton8->setObjectName(QString::fromUtf8("pushButton8")); + pushButton8->setMinimumSize(QSize(40, 40)); + pushButton8->setMaximumSize(QSize(40, 40)); + + horizontalLayout_12->addWidget(pushButton8); + + pushButton9 = new QPushButton; + pushButton9->setObjectName(QString::fromUtf8("pushButton9")); + pushButton9->setMinimumSize(QSize(40, 40)); + pushButton9->setMaximumSize(QSize(40, 40)); + + horizontalLayout_12->addWidget(pushButton9); + + pushButton10 = new QPushButton; + pushButton10->setObjectName(QString::fromUtf8("pushButton10")); + pushButton10->setMinimumSize(QSize(40, 40)); + pushButton10->setMaximumSize(QSize(40, 40)); + + horizontalLayout_12->addWidget(pushButton10); + + + verticalLayout_5->addLayout(horizontalLayout_12); + + horizontalLayout_11 = new QHBoxLayout(); + horizontalLayout_11->setObjectName(QString::fromUtf8("horizontalLayout_11")); + pushButton11 = new QPushButton; + pushButton11->setObjectName(QString::fromUtf8("pushButton11")); + pushButton11->setMinimumSize(QSize(40, 40)); + pushButton11->setMaximumSize(QSize(40, 40)); + + horizontalLayout_11->addWidget(pushButton11); + + pushButton12 = new QPushButton; + pushButton12->setObjectName(QString::fromUtf8("pushButton12")); + pushButton12->setMinimumSize(QSize(40, 40)); + pushButton12->setMaximumSize(QSize(40, 40)); + + horizontalLayout_11->addWidget(pushButton12); + + pushButton13 = new QPushButton; + pushButton13->setObjectName(QString::fromUtf8("pushButton13")); + pushButton13->setMinimumSize(QSize(40, 40)); + pushButton13->setMaximumSize(QSize(40, 40)); + + horizontalLayout_11->addWidget(pushButton13); + + pushButton14 = new QPushButton; + pushButton14->setObjectName(QString::fromUtf8("pushButton14")); + pushButton14->setMinimumSize(QSize(40, 40)); + pushButton14->setMaximumSize(QSize(40, 40)); + + horizontalLayout_11->addWidget(pushButton14); + + pushButton15 = new QPushButton; + pushButton15->setObjectName(QString::fromUtf8("pushButton15")); + pushButton15->setMinimumSize(QSize(40, 40)); + pushButton15->setMaximumSize(QSize(40, 40)); + + horizontalLayout_11->addWidget(pushButton15); + + + verticalLayout_5->addLayout(horizontalLayout_11); + + horizontalLayout_10 = new QHBoxLayout(); + horizontalLayout_10->setObjectName(QString::fromUtf8("horizontalLayout_10")); + pushButton16 = new QPushButton; + pushButton16->setObjectName(QString::fromUtf8("pushButton16")); + pushButton16->setMinimumSize(QSize(40, 40)); + pushButton16->setMaximumSize(QSize(40, 40)); + + horizontalLayout_10->addWidget(pushButton16); + + pushButton17 = new QPushButton; + pushButton17->setObjectName(QString::fromUtf8("pushButton17")); + pushButton17->setMinimumSize(QSize(40, 40)); + pushButton17->setMaximumSize(QSize(40, 40)); + + horizontalLayout_10->addWidget(pushButton17); + + pushButton18 = new QPushButton; + pushButton18->setObjectName(QString::fromUtf8("pushButton18")); + pushButton18->setMinimumSize(QSize(40, 40)); + pushButton18->setMaximumSize(QSize(40, 40)); + + horizontalLayout_10->addWidget(pushButton18); + + pushButton19 = new QPushButton; + pushButton19->setMinimumSize(QSize(40, 40)); + pushButton19->setMaximumSize(QSize(40, 40)); + horizontalLayout_10->addWidget(pushButton19); + + pushButton20 = new QPushButton; + pushButton20->setMinimumSize(QSize(40, 40)); + pushButton20->setMaximumSize(QSize(40, 40)); + horizontalLayout_10->addWidget(pushButton20); + + verticalLayout_5->addLayout(horizontalLayout_10); + + horizontalLayout_16->addLayout(verticalLayout_5); + + horizontalLayout_14->addLayout(horizontalLayout_16); + + line = new QFrame; + line->setFrameShape(QFrame::VLine); + line->setFrameShadow(QFrame::Sunken); + horizontalLayout_14->addWidget(line); + + verticalLayout_7 = new QVBoxLayout(); + verticalLayout_7->setContentsMargins(0, -1, -1, -1); + horizontalLayout_19 = new QHBoxLayout(); + horizontalLayout_19->setContentsMargins(0, -1, -1, -1); + label_ProgramNum = new QLabel; + label_ProgramNum->setMinimumSize(QSize(88, 0)); + horizontalLayout_19->addWidget(label_ProgramNum); + + spinBox_ProgramIndex = new QSpinBox; + spinBox_ProgramIndex->setMinimumSize(QSize(60, 0)); + spinBox_ProgramIndex->setMaximum(999); + spinBox_ProgramIndex->setValue(21); + horizontalLayout_19->addWidget(spinBox_ProgramIndex); + + pushButtonSend = new QPushButton; + pushButtonSend->setMinimumSize(QSize(80, 40)); + horizontalLayout_19->addWidget(pushButtonSend); + + line = new QFrame; + line->setFrameShape(QFrame::VLine); + line->setFrameShadow(QFrame::Sunken); + horizontalLayout_19->addWidget(line); + + pushButtonPrevious = new QPushButton; + pushButtonPrevious->setMinimumSize(QSize(40, 40)); + pushButtonPrevious->setIconSize(QSize(32, 32)); + pushButtonPrevious->setFlat(true); + horizontalLayout_19->addWidget(pushButtonPrevious); + + pushButtonNext = new QPushButton; + pushButtonNext->setMinimumSize(QSize(40, 40)); + pushButtonNext->setIconSize(QSize(32, 32)); + pushButtonNext->setFlat(true); + horizontalLayout_19->addWidget(pushButtonNext); + + pushButtonLoop = new QPushButton; + pushButtonLoop->setMinimumSize(QSize(40, 40)); + pushButtonLoop->setIconSize(QSize(32, 32)); + pushButtonLoop->setFlat(true); + horizontalLayout_19->addWidget(pushButtonLoop); + + horizontalSpacer_7 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + + horizontalLayout_19->addItem(horizontalSpacer_7); + + + verticalLayout_7->addLayout(horizontalLayout_19); + + line = new QFrame; + line->setFrameShape(QFrame::HLine); + line->setFrameShadow(QFrame::Sunken); + verticalLayout_7->addWidget(line); + + horizontalLayout_21 = new QHBoxLayout(); + label_BrightNess = new QLabel; + label_BrightNess->setMinimumSize(QSize(88, 0)); + horizontalLayout_21->addWidget(label_BrightNess); + + spinBox_BrightnessValue = new QSpinBox; + spinBox_BrightnessValue->setMinimumSize(QSize(60, 0)); + spinBox_BrightnessValue->setMaximum(255); + spinBox_BrightnessValue->setValue(255); + horizontalLayout_21->addWidget(spinBox_BrightnessValue); + + pushButtonBrightnessSet = new QPushButton; + pushButtonBrightnessSet->setMinimumSize(QSize(80, 40)); + horizontalLayout_21->addWidget(pushButtonBrightnessSet); + + line = new QFrame; + line->setFrameShape(QFrame::VLine); + line->setFrameShadow(QFrame::Sunken); + horizontalLayout_21->addWidget(line); + + pushButtonScreenOff = new QPushButton; + pushButtonScreenOff->setMinimumSize(QSize(80, 40)); + horizontalLayout_21->addWidget(pushButtonScreenOff); + + pushButtonScreenOn = new QPushButton; + pushButtonScreenOn->setMinimumSize(QSize(80, 40)); + horizontalLayout_21->addWidget(pushButtonScreenOn); + + horizontalSpacer_18 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + + horizontalLayout_21->addItem(horizontalSpacer_18); + + + verticalLayout_7->addLayout(horizontalLayout_21); + + verticalSpacer_2 = new QSpacerItem(20, 40, QSizePolicy::Minimum, QSizePolicy::Expanding); + + verticalLayout_7->addItem(verticalSpacer_2); + + horizontalLayout_2 = new QHBoxLayout(); + horizontalLayout_2->setContentsMargins(-1, 20, -1, -1); + horizontalSpacer_3 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum); + + horizontalLayout_2->addItem(horizontalSpacer_3); + + pushButtonClearLog = new QPushButton; + horizontalLayout_2->addWidget(pushButtonClearLog); + + checkBoxDebug = new QCheckBox; + checkBoxDebug->setChecked(false); + + horizontalLayout_2->addWidget(checkBoxDebug); + + + verticalLayout_7->addLayout(horizontalLayout_2); + + + horizontalLayout_14->addLayout(verticalLayout_7); + + + verticalLayout_4->addLayout(horizontalLayout_14); + + + vBox->addLayout(verticalLayout_4); + + line = new QFrame; + line->setFrameShape(QFrame::HLine); + line->setFrameShadow(QFrame::Sunken); + vBox->addWidget(line); + + horizontalLayout_3 = new QHBoxLayout(); + horizontalLayout_8 = new QHBoxLayout(); + textEditReadBuf = new QTextEdit; + textEditReadBuf->setSizeAdjustPolicy(QAbstractScrollArea::AdjustIgnored); + textEditReadBuf->setUndoRedoEnabled(false); + textEditReadBuf->setReadOnly(true); + + horizontalLayout_8->addWidget(textEditReadBuf); + + + horizontalLayout_3->addLayout(horizontalLayout_8); + + vBox->addLayout(horizontalLayout_3); + + + groupBox_com->setTitle(tr("Com")); + groupBoxMain->setTitle(tr("Main")); + label_PortName->setText(tr("PortName")); + label_BaudRate->setText(tr("BaudRate")); + + + label_DataBit->setText(tr("DataBit")); + + + label_OEBit->setText(tr("OEBit")); + + + label_StopBit->setText(tr("StopBit")); + + + label_ComStatus->setText(tr("State:Close")); + pushButtonMainOpen->setText(tr("Open")); + groupBoxAux->setTitle(tr("Auxiliary")); + label_PortNameAux->setText(tr("PortName")); + label_BaudRateAux->setText(tr("BaudRate")); + + + label_DataBitAux->setText(tr("DataBit")); + + + label_OEBitAux->setText(tr("OEBit")); + + + label_StopBitAux->setText(tr("StopBit")); + + + label_ComStatusAux->setText(tr("State:Close")); + pushButtonAuxOpen->setText(tr("Open")); + pushButtonRefresh->setText(tr("Refresh")); + groupBox_Network->setTitle(tr("Network")); + groupBoxParam->setTitle(tr("Param configuration")); + label_ResendTimes->setText(tr("Resend times")); + lineEdit_ResendTimes->setText(tr("10")); + label_DelayMill->setText(tr("Delay millsecond")); + lineEdit_DelayMill->setText(tr("10")); + pushButton1->setText(tr("1")); + pushButton2->setText(tr("2")); + pushButton3->setText(tr("3")); + pushButton4->setText(tr("4")); + pushButton5->setText(tr("5")); + pushButton6->setText(tr("6")); + pushButton7->setText(tr("7")); + pushButton8->setText(tr("8")); + pushButton9->setText(tr("9")); + pushButton10->setText(tr("10")); + pushButton11->setText(tr("11")); + pushButton12->setText(tr("12")); + pushButton13->setText(tr("13")); + pushButton14->setText(tr("14")); + pushButton15->setText(tr("15")); + pushButton16->setText(tr("16")); + pushButton17->setText(tr("17")); + pushButton18->setText(tr("18")); + pushButton19->setText(tr("19")); + pushButton20->setText(tr("20")); + label_ProgramNum->setText(tr("Program number")); + pushButtonSend->setText(tr("Send")); + label_BrightNess->setText(tr("Brightness")); + pushButtonBrightnessSet->setText(tr("Set")); + pushButtonScreenOff->setText(tr("Screen Off")); + pushButtonScreenOn->setText(tr("Screen on")); + pushButtonClearLog->setText(tr("Clear")); + checkBoxDebug->setText(tr("Debug")); + + + + + pushButton1->setProperty("ssType", "progManageTool"); + pushButton2->setProperty("ssType", "progManageTool"); + pushButton3->setProperty("ssType", "progManageTool"); + pushButton4->setProperty("ssType", "progManageTool"); + pushButton5->setProperty("ssType", "progManageTool"); + pushButton6->setProperty("ssType", "progManageTool"); + pushButton7->setProperty("ssType", "progManageTool"); + pushButton8->setProperty("ssType", "progManageTool"); + pushButton9->setProperty("ssType", "progManageTool"); + pushButton10->setProperty("ssType", "progManageTool"); + pushButton11->setProperty("ssType", "progManageTool"); + pushButton12->setProperty("ssType", "progManageTool"); + pushButton13->setProperty("ssType", "progManageTool"); + pushButton14->setProperty("ssType", "progManageTool"); + pushButton15->setProperty("ssType", "progManageTool"); + pushButton16->setProperty("ssType", "progManageTool"); + pushButton17->setProperty("ssType", "progManageTool"); + pushButton18->setProperty("ssType", "progManageTool"); + pushButton19->setProperty("ssType", "progManageTool"); + pushButton20->setProperty("ssType", "progManageTool"); + + pushButtonSend->setProperty("ssType", "progManageTool"); + pushButtonPrevious->setProperty("ssType", "progManageTool"); + pushButtonPrevious->setIcon(QIcon(":/res/previous.png")); + pushButtonNext->setProperty("ssType", "progManageTool"); + pushButtonNext->setIcon(QIcon(":/res/next.png")); + pushButtonLoop->setProperty("ssType", "progManageTool"); + pushButtonLoop->setIcon(QIcon(":/res/loop.png")); + pushButtonMainOpen->setProperty("ssType", "progManageTool"); + pushButtonAuxOpen->setProperty("ssType", "progManageTool"); + pushButtonBrightnessSet->setProperty("ssType", "progManageTool"); + pushButtonScreenOn->setProperty("ssType", "progManageTool"); + pushButtonScreenOff->setProperty("ssType", "progManageTool"); + pushButtonRefresh->setProperty("ssType", "progManageTool"); + pushButtonClearLog->setProperty("ssType", "progManageTool"); m_recvNum = 0; m_sendNum = 0; sPortThread = new TA_SerialThread; @@ -55,114 +797,109 @@ mGuangYingPinWidget::mGuangYingPinWidget(QWidget *parent) : for(uint8_t i = 0;i < sPortThread->portCnt;i++) { - ui->comboBox_SPortName->addItem(sPortThread->m_arrSerial[i].portName()); - ui->comboBox_SPortNameAux->addItem(sPortThread->m_arrSerial[i].portName()); + comboBox_SPortName->addItem(sPortThread->m_arrSerial[i].portName()); + comboBox_SPortNameAux->addItem(sPortThread->m_arrSerial[i].portName()); } //0:1200 1:2400 2:4800 3:9600 4:19200 5:38400 6:57600 7:115200 - if(ui->comboBox_SPortName->count()>=1) + if(comboBox_SPortName->count()>=1) { - ui->comboBox_SPortBaud->setCurrentIndex(3); + comboBox_SPortBaud->setCurrentIndex(3); //0:5 1:6 2:7 3:8 - ui->comboBox_SPortDataBit->setCurrentIndex(3); + comboBox_SPortDataBit->setCurrentIndex(3); //0:no p 2:e p 3:o p 4:s p 5:m p - ui->comboBox_SPortOEBit->setCurrentIndex(0); + comboBox_SPortOEBit->setCurrentIndex(0); //0:1 1:2 2:1.5 - ui->comboBox_SPortStopBit->setCurrentIndex(0); + comboBox_SPortStopBit->setCurrentIndex(0); - ui->graphicsView_ComStatus->setStyleSheet("background-color: rgb(255, 0, 0);"); - ui->label_ComStatus->setText(tr("State:Off")); + graphicsView_ComStatus->setStyleSheet("background-color: rgb(255, 0, 0);"); + label_ComStatus->setText(tr("State:Off")); - ui->comboBox_SPortBaudAux->setCurrentIndex(3); - ui->comboBox_SPortDataBitAux->setCurrentIndex(3); - ui->comboBox_SPortOEBitAux->setCurrentIndex(0); - ui->comboBox_SPortStopBitAux->setCurrentIndex(0); - ui->graphicsView_ComStatusAux->setStyleSheet("background-color: rgb(255, 0, 0);"); - ui->label_ComStatusAux->setText(tr("State:Off")); - if(ui->comboBox_SPortName->count()>1) + comboBox_SPortBaudAux->setCurrentIndex(3); + comboBox_SPortDataBitAux->setCurrentIndex(3); + comboBox_SPortOEBitAux->setCurrentIndex(0); + comboBox_SPortStopBitAux->setCurrentIndex(0); + graphicsView_ComStatusAux->setStyleSheet("background-color: rgb(255, 0, 0);"); + label_ComStatusAux->setText(tr("State:Off")); + if(comboBox_SPortName->count()>1) { - ui->comboBox_SPortNameAux->setCurrentIndex(1); + comboBox_SPortNameAux->setCurrentIndex(1); } } - ui->lineEdit_ResendTimes->setValidator(new QIntValidator(1,1000,this)); - ui->lineEdit_DelayMill->setValidator(new QIntValidator(1,1000,this)); + lineEdit_ResendTimes->setValidator(new QIntValidator(1,1000,this)); + lineEdit_DelayMill->setValidator(new QIntValidator(1,1000,this)); - connect(ui->pushButtonMainOpen, SIGNAL(clicked(bool)), this, SLOT(MWOnoffPort())); - connect(ui->pushButtonAuxOpen, SIGNAL(clicked(bool)), this, SLOT(MWOnoffPortAux())); - connect(ui->pushButton1, SIGNAL(clicked()), this, SLOT(OnAnsyProgram1())); - connect(ui->pushButton2, SIGNAL(clicked()), this, SLOT(OnAnsyProgram2())); - connect(ui->pushButton3, SIGNAL(clicked()), this, SLOT(OnAnsyProgram3())); - connect(ui->pushButton4, SIGNAL(clicked()), this, SLOT(OnAnsyProgram4())); - connect(ui->pushButton5, SIGNAL(clicked()), this, SLOT(OnAnsyProgram5())); - connect(ui->pushButton6, SIGNAL(clicked()), this, SLOT(OnAnsyProgram6())); - connect(ui->pushButton7, SIGNAL(clicked()), this, SLOT(OnAnsyProgram7())); - connect(ui->pushButton8, SIGNAL(clicked()), this, SLOT(OnAnsyProgram8())); - connect(ui->pushButton9, SIGNAL(clicked()), this, SLOT(OnAnsyProgram9())); - connect(ui->pushButton10, SIGNAL(clicked()), this, SLOT(OnAnsyProgram10())); - connect(ui->pushButton11, SIGNAL(clicked()), this, SLOT(OnAnsyProgram11())); - connect(ui->pushButton12, SIGNAL(clicked()), this, SLOT(OnAnsyProgram12())); - connect(ui->pushButton13, SIGNAL(clicked()), this, SLOT(OnAnsyProgram13())); - connect(ui->pushButton14, SIGNAL(clicked()), this, SLOT(OnAnsyProgram14())); - connect(ui->pushButton15, SIGNAL(clicked()), this, SLOT(OnAnsyProgram15())); - connect(ui->pushButton16, SIGNAL(clicked()), this, SLOT(OnAnsyProgram16())); - connect(ui->pushButton17, SIGNAL(clicked()), this, SLOT(OnAnsyProgram17())); - connect(ui->pushButton18, SIGNAL(clicked()), this, SLOT(OnAnsyProgram18())); - connect(ui->pushButton19, SIGNAL(clicked()), this, SLOT(OnAnsyProgram19())); - connect(ui->pushButton20, SIGNAL(clicked()), this, SLOT(OnAnsyProgram20())); - connect(ui->pushButtonClearLog, SIGNAL(clicked()), this, SLOT(OnClearLog())); - connect(ui->pushButtonSend, SIGNAL(clicked()), this, SLOT(OnAnsyProgramCustom())); - connect(ui->pushButtonNext, SIGNAL(clicked()), this, SLOT(OnAnsyProgramNext())); - connect(ui->pushButtonPrevious, SIGNAL(clicked()), this, SLOT(OnAnsyProgramPrevious())); - connect(ui->pushButtonLoop, SIGNAL(clicked()), this, SLOT(OnAnsyProgramLoop())); - connect(ui->pushButtonBrightnessSet, SIGNAL(clicked()), this, SLOT(OnBrightnessSet())); - connect(ui->pushButtonScreenOn, SIGNAL(clicked()), this, SLOT(OnScreenOn())); - connect(ui->pushButtonScreenOff, SIGNAL(clicked()), this, SLOT(OnScreenOff())); - connect(ui->spinBox_ProgramIndex, SIGNAL(valueChanged(int)), this, SLOT(OnAnsyProgramCustomByChanged(int))); - connect(ui->spinBox_BrightnessValue, SIGNAL(valueChanged(int)), this, SLOT(OnBrightnessSetByChanged(int))); - connect(ui->pushButtonRefresh, SIGNAL(clicked()), this, SLOT(OnRefresh())); -} - -mGuangYingPinWidget::~mGuangYingPinWidget(){ - delete ui; + connect(pushButtonMainOpen, SIGNAL(clicked(bool)), this, SLOT(MWOnoffPort())); + connect(pushButtonAuxOpen, SIGNAL(clicked(bool)), this, SLOT(MWOnoffPortAux())); + connect(pushButton1, SIGNAL(clicked()), this, SLOT(OnAnsyProgram1())); + connect(pushButton2, SIGNAL(clicked()), this, SLOT(OnAnsyProgram2())); + connect(pushButton3, SIGNAL(clicked()), this, SLOT(OnAnsyProgram3())); + connect(pushButton4, SIGNAL(clicked()), this, SLOT(OnAnsyProgram4())); + connect(pushButton5, SIGNAL(clicked()), this, SLOT(OnAnsyProgram5())); + connect(pushButton6, SIGNAL(clicked()), this, SLOT(OnAnsyProgram6())); + connect(pushButton7, SIGNAL(clicked()), this, SLOT(OnAnsyProgram7())); + connect(pushButton8, SIGNAL(clicked()), this, SLOT(OnAnsyProgram8())); + connect(pushButton9, SIGNAL(clicked()), this, SLOT(OnAnsyProgram9())); + connect(pushButton10, SIGNAL(clicked()), this, SLOT(OnAnsyProgram10())); + connect(pushButton11, SIGNAL(clicked()), this, SLOT(OnAnsyProgram11())); + connect(pushButton12, SIGNAL(clicked()), this, SLOT(OnAnsyProgram12())); + connect(pushButton13, SIGNAL(clicked()), this, SLOT(OnAnsyProgram13())); + connect(pushButton14, SIGNAL(clicked()), this, SLOT(OnAnsyProgram14())); + connect(pushButton15, SIGNAL(clicked()), this, SLOT(OnAnsyProgram15())); + connect(pushButton16, SIGNAL(clicked()), this, SLOT(OnAnsyProgram16())); + connect(pushButton17, SIGNAL(clicked()), this, SLOT(OnAnsyProgram17())); + connect(pushButton18, SIGNAL(clicked()), this, SLOT(OnAnsyProgram18())); + connect(pushButton19, SIGNAL(clicked()), this, SLOT(OnAnsyProgram19())); + connect(pushButton20, SIGNAL(clicked()), this, SLOT(OnAnsyProgram20())); + connect(pushButtonClearLog, SIGNAL(clicked()), this, SLOT(OnClearLog())); + connect(pushButtonSend, SIGNAL(clicked()), this, SLOT(OnAnsyProgramCustom())); + connect(pushButtonNext, SIGNAL(clicked()), this, SLOT(OnAnsyProgramNext())); + connect(pushButtonPrevious, SIGNAL(clicked()), this, SLOT(OnAnsyProgramPrevious())); + connect(pushButtonLoop, SIGNAL(clicked()), this, SLOT(OnAnsyProgramLoop())); + connect(pushButtonBrightnessSet, SIGNAL(clicked()), this, SLOT(OnBrightnessSet())); + connect(pushButtonScreenOn, SIGNAL(clicked()), this, SLOT(OnScreenOn())); + connect(pushButtonScreenOff, SIGNAL(clicked()), this, SLOT(OnScreenOff())); + connect(spinBox_ProgramIndex, SIGNAL(valueChanged(int)), this, SLOT(OnAnsyProgramCustomByChanged(int))); + connect(spinBox_BrightnessValue, SIGNAL(valueChanged(int)), this, SLOT(OnBrightnessSetByChanged(int))); + connect(pushButtonRefresh, SIGNAL(clicked()), this, SLOT(OnRefresh())); } void mGuangYingPinWidget::changeEvent(QEvent *event) { QWidget::changeEvent(event); - if(event->type() == QEvent::LanguageChange) transUi(); -} -void mGuangYingPinWidget::transUi() { - ui->pushButtonSend->setText(tr("Send")); - ui->pushButtonMainOpen->setText(tr("Open")); - ui->pushButtonAuxOpen->setText(tr("Open")); - ui->pushButtonBrightnessSet->setText(tr("Set")); - ui->pushButtonScreenOn->setText(tr("Screen On")); - ui->pushButtonScreenOff->setText(tr("Screen Off")); - ui->pushButtonRefresh->setText(tr("Refresh")); - ui->groupBoxMain->setTitle(tr("Main")); - ui->groupBoxAux->setTitle(tr("Auxiliary")); - ui->groupBoxParam->setTitle(tr("Param configuration")); - ui->label_PortName->setText(tr("PortName")); - ui->label_BaudRate->setText(tr("BaudRate")); - ui->label_DataBit->setText(tr("DataBit")); - ui->label_OEBit->setText(tr("OEBit")); - ui->label_StopBit->setText(tr("StopBit")); - ui->label_PortNameAux->setText(tr("PortName")); - ui->label_BaudRateAux->setText(tr("BaudRate")); - ui->label_DataBitAux->setText(tr("DataBit")); - ui->label_OEBitAux->setText(tr("OEBit")); - ui->label_StopBitAux->setText(tr("StopBit")); + if(event->type() == QEvent::LanguageChange) { + pushButtonSend->setText(tr("Send")); + pushButtonMainOpen->setText(tr("Open")); + pushButtonAuxOpen->setText(tr("Open")); + pushButtonBrightnessSet->setText(tr("Set")); + pushButtonScreenOn->setText(tr("Screen On")); + pushButtonScreenOff->setText(tr("Screen Off")); + pushButtonRefresh->setText(tr("Refresh")); + groupBoxMain->setTitle(tr("Main")); + groupBoxAux->setTitle(tr("Auxiliary")); + groupBoxParam->setTitle(tr("Param configuration")); + label_PortName->setText(tr("PortName")); + label_BaudRate->setText(tr("BaudRate")); + label_DataBit->setText(tr("DataBit")); + label_OEBit->setText(tr("OEBit")); + label_StopBit->setText(tr("StopBit")); + label_PortNameAux->setText(tr("PortName")); + label_BaudRateAux->setText(tr("BaudRate")); + label_DataBitAux->setText(tr("DataBit")); + label_OEBitAux->setText(tr("OEBit")); + label_StopBitAux->setText(tr("StopBit")); - ui->label_ResendTimes->setText(tr("Resend times")); - ui->label_DelayMill->setText(tr("Delay millsecond")); - ui->label_ProgramNum->setText(tr("Program number")); - ui->label_BrightNess->setText(tr("Brightness")); - ui->label_ComStatus->setText(tr("State:Off")); - ui->label_ComStatusAux->setText(tr("State:Off")); - ui->pushButtonClearLog->setText(tr("Clear")); - ui->checkBoxDebug->setText(tr("Debug")); - ui->groupBox_Network->setTitle(tr("Network")); - ui->groupBox_com->setTitle(tr("Com")); + label_ResendTimes->setText(tr("Resend times")); + label_DelayMill->setText(tr("Delay millsecond")); + label_ProgramNum->setText(tr("Program number")); + label_BrightNess->setText(tr("Brightness")); + label_ComStatus->setText(tr("State:Off")); + label_ComStatusAux->setText(tr("State:Off")); + pushButtonClearLog->setText(tr("Clear")); + checkBoxDebug->setText(tr("Debug")); + groupBox_Network->setTitle(tr("Network")); + groupBox_com->setTitle(tr("Com")); + } } void mGuangYingPinWidget::OnAnsyProgram1(void) @@ -231,16 +968,16 @@ void mGuangYingPinWidget::OnAnsyProgram20(void) } void mGuangYingPinWidget::OnClearLog(void) { - ui->textEditReadBuf->clear(); + textEditReadBuf->clear(); } void mGuangYingPinWidget::OnAnsyProgramCustom(void) { - int itemp=ui->spinBox_ProgramIndex->value(); + int itemp=spinBox_ProgramIndex->value(); MACRO_ANSY_PROGRAM(itemp) - if(ui->checkBoxDebug->isChecked()) + if(checkBoxDebug->isChecked()) { - ui->textEditReadBuf->append("OnAnsyProgramCustom"); + textEditReadBuf->append("OnAnsyProgramCustom"); } } void mGuangYingPinWidget::OnAnsyProgramCustomByChanged(int icurIndex) @@ -249,29 +986,29 @@ void mGuangYingPinWidget::OnAnsyProgramCustomByChanged(int icurIndex) } void mGuangYingPinWidget::OnBrightnessSetByChanged(int icurValue) { - if(ui->pushButtonMainOpen->text()==tr("Close")) - Set_Brightness_buf_and_send(ui->comboBox_SPortName->currentIndex(),icurValue); - if(ui->pushButtonAuxOpen->text()==tr("Close")) - Set_Brightness_buf_and_send(ui->comboBox_SPortNameAux->currentIndex(),icurValue); + if(pushButtonMainOpen->text()==tr("Close")) + Set_Brightness_buf_and_send(comboBox_SPortName->currentIndex(),icurValue); + if(pushButtonAuxOpen->text()==tr("Close")) + Set_Brightness_buf_and_send(comboBox_SPortNameAux->currentIndex(),icurValue); } void mGuangYingPinWidget::OnAnsyProgramNext(void) { - ui->spinBox_ProgramIndex->setValue(ui->spinBox_ProgramIndex->value()+1); + spinBox_ProgramIndex->setValue(spinBox_ProgramIndex->value()+1); OnAnsyProgramCustom(); -// int itemp=ui->spinBox_ProgramIndex->value(); +// int itemp=spinBox_ProgramIndex->value(); // MACRO_ANSY_PROGRAM(itemp) -// if(ui->pushButtonMainOpen->text()==tr("Close")) -// NextProgram_buf_and_send(ui->comboBox_SPortName->currentIndex()); -// if(ui->pushButtonAuxOpen->text()==tr("Close")) -// NextProgram_buf_and_send(ui->comboBox_SPortNameAux->currentIndex()); +// if(pushButtonMainOpen->text()==tr("Close")) +// NextProgram_buf_and_send(comboBox_SPortName->currentIndex()); +// if(pushButtonAuxOpen->text()==tr("Close")) +// NextProgram_buf_and_send(comboBox_SPortNameAux->currentIndex()); } void mGuangYingPinWidget::OnAnsyProgramPrevious(void) { - ui->spinBox_ProgramIndex->setValue(ui->spinBox_ProgramIndex->value()-1); + spinBox_ProgramIndex->setValue(spinBox_ProgramIndex->value()-1); OnAnsyProgramCustom(); -// int itemp=ui->spinBox_ProgramIndex->value(); +// int itemp=spinBox_ProgramIndex->value(); // MACRO_ANSY_PROGRAM(itemp) } void mGuangYingPinWidget::OnAnsyProgramLoop(void) @@ -280,43 +1017,43 @@ void mGuangYingPinWidget::OnAnsyProgramLoop(void) } void mGuangYingPinWidget::OnBrightnessSet(void) { - if(ui->groupBox_com->isChecked()) + if(groupBox_com->isChecked()) { - if(ui->pushButtonMainOpen->text()==tr("Close")) - Set_Brightness_buf_and_send(ui->comboBox_SPortName->currentIndex(),ui->spinBox_BrightnessValue->value()); - if(ui->pushButtonAuxOpen->text()==tr("Close")) - Set_Brightness_buf_and_send(ui->comboBox_SPortNameAux->currentIndex(),ui->spinBox_BrightnessValue->value()); + if(pushButtonMainOpen->text()==tr("Close")) + Set_Brightness_buf_and_send(comboBox_SPortName->currentIndex(),spinBox_BrightnessValue->value()); + if(pushButtonAuxOpen->text()==tr("Close")) + Set_Brightness_buf_and_send(comboBox_SPortNameAux->currentIndex(),spinBox_BrightnessValue->value()); } - if(ui->groupBox_Network->isChecked()) + if(groupBox_Network->isChecked()) { - Set_Brightness_buf_and_send_by_udp(ui->spinBox_BrightnessValue->value()); + Set_Brightness_buf_and_send_by_udp(spinBox_BrightnessValue->value()); } } void mGuangYingPinWidget::OnScreenOn(void) { - if(ui->groupBox_com->isChecked()) + if(groupBox_com->isChecked()) { - if(ui->pushButtonMainOpen->text()==tr("Close")) - Screen_OnOff_buf_and_send(ui->comboBox_SPortName->currentIndex(),0x11); - if(ui->pushButtonAuxOpen->text()==tr("Close")) - Screen_OnOff_buf_and_send(ui->comboBox_SPortNameAux->currentIndex(),0x11); + if(pushButtonMainOpen->text()==tr("Close")) + Screen_OnOff_buf_and_send(comboBox_SPortName->currentIndex(),0x11); + if(pushButtonAuxOpen->text()==tr("Close")) + Screen_OnOff_buf_and_send(comboBox_SPortNameAux->currentIndex(),0x11); } - if(ui->groupBox_Network->isChecked()) + if(groupBox_Network->isChecked()) { Screen_OnOff_buf_and_send_by_udp(0x11); } } void mGuangYingPinWidget::OnScreenOff(void) { - if(ui->groupBox_com->isChecked()) + if(groupBox_com->isChecked()) { - if(ui->pushButtonMainOpen->text()==tr("Close")) - Screen_OnOff_buf_and_send(ui->comboBox_SPortName->currentIndex(),0x10); - if(ui->pushButtonAuxOpen->text()==tr("Close")) - Screen_OnOff_buf_and_send(ui->comboBox_SPortNameAux->currentIndex(),0x10); + if(pushButtonMainOpen->text()==tr("Close")) + Screen_OnOff_buf_and_send(comboBox_SPortName->currentIndex(),0x10); + if(pushButtonAuxOpen->text()==tr("Close")) + Screen_OnOff_buf_and_send(comboBox_SPortNameAux->currentIndex(),0x10); } - if(ui->groupBox_Network->isChecked()) + if(groupBox_Network->isChecked()) { Screen_OnOff_buf_and_send_by_udp(0x10); @@ -325,10 +1062,10 @@ void mGuangYingPinWidget::OnScreenOff(void) void mGuangYingPinWidget::OnRefresh() { bool resetAllComboxFlag=true; - if(ui->comboBox_SPortName->count()>0) + if(comboBox_SPortName->count()>0) resetAllComboxFlag=false; -// ui->comboBox_SPortName->clear(); -// ui->comboBox_SPortNameAux->clear(); +// comboBox_SPortName->clear(); +// comboBox_SPortNameAux->clear(); sPortThread->SearchPort(); // for (int m=0;mportCnt;m++) { @@ -339,9 +1076,9 @@ void mGuangYingPinWidget::OnRefresh() for(uint8_t i = 0;i < sPortThread->portCnt;i++) { bool iHaveFlag=false; - for(int j=0;jcomboBox_SPortName->count();j++) + for(int j=0;jcount();j++) { - if(ui->comboBox_SPortName->itemText(j)==sPortThread->m_arrSerial[i].portName()) + if(comboBox_SPortName->itemText(j)==sPortThread->m_arrSerial[i].portName()) { iHaveFlag=true; break; @@ -349,12 +1086,12 @@ void mGuangYingPinWidget::OnRefresh() } if(iHaveFlag==false) { - ui->comboBox_SPortName->addItem(sPortThread->m_arrSerial[i].portName()); + comboBox_SPortName->addItem(sPortThread->m_arrSerial[i].portName()); } bool iHaveAuxFlag=false; - for(int jj=0;jjcomboBox_SPortNameAux->count();jj++) + for(int jj=0;jjcount();jj++) { - if(ui->comboBox_SPortNameAux->itemText(jj)==sPortThread->m_arrSerial[i].portName()) + if(comboBox_SPortNameAux->itemText(jj)==sPortThread->m_arrSerial[i].portName()) { iHaveAuxFlag=true; break; @@ -362,42 +1099,42 @@ void mGuangYingPinWidget::OnRefresh() } if(iHaveAuxFlag==false) { - ui->comboBox_SPortNameAux->addItem(sPortThread->m_arrSerial[i].portName()); - if(ui->comboBox_SPortNameAux->count()>1&&ui->pushButtonAuxOpen->text()==tr("Open")) + comboBox_SPortNameAux->addItem(sPortThread->m_arrSerial[i].portName()); + if(comboBox_SPortNameAux->count()>1&&pushButtonAuxOpen->text()==tr("Open")) { - ui->comboBox_SPortNameAux->setCurrentIndex(i); + comboBox_SPortNameAux->setCurrentIndex(i); } } -// ui->comboBox_SPortName->addItem(sPortThread->m_arrSerial[i].portName()); -// ui->comboBox_SPortNameAux->addItem(sPortThread->m_arrSerial[i].portName()); +// comboBox_SPortName->addItem(sPortThread->m_arrSerial[i].portName()); +// comboBox_SPortNameAux->addItem(sPortThread->m_arrSerial[i].portName()); } if(resetAllComboxFlag) { //0:1200 1:2400 2:4800 3:9600 4:19200 5:38400 6:57600 7:115200 - if(ui->comboBox_SPortName->count()>=1) + if(comboBox_SPortName->count()>=1) { - ui->comboBox_SPortBaud->setCurrentIndex(3); + comboBox_SPortBaud->setCurrentIndex(3); //0:5 1:6 2:7 3:8 - ui->comboBox_SPortDataBit->setCurrentIndex(3); + comboBox_SPortDataBit->setCurrentIndex(3); //0:no p 2:e p 3:o p 4:s p 5:m p - ui->comboBox_SPortOEBit->setCurrentIndex(0); + comboBox_SPortOEBit->setCurrentIndex(0); //0:1 1:2 2:1.5 - ui->comboBox_SPortStopBit->setCurrentIndex(0); + comboBox_SPortStopBit->setCurrentIndex(0); - ui->graphicsView_ComStatus->setStyleSheet("background-color: rgb(255, 0, 0);"); - ui->label_ComStatus->setText(tr("State:Off")); + graphicsView_ComStatus->setStyleSheet("background-color: rgb(255, 0, 0);"); + label_ComStatus->setText(tr("State:Off")); - ui->comboBox_SPortBaudAux->setCurrentIndex(3); - ui->comboBox_SPortDataBitAux->setCurrentIndex(3); - ui->comboBox_SPortOEBitAux->setCurrentIndex(0); - ui->comboBox_SPortStopBitAux->setCurrentIndex(0); - ui->graphicsView_ComStatusAux->setStyleSheet("background-color: rgb(255, 0, 0);"); - ui->label_ComStatusAux->setText(tr("State:Off")); - if(ui->comboBox_SPortName->count()>1) + comboBox_SPortBaudAux->setCurrentIndex(3); + comboBox_SPortDataBitAux->setCurrentIndex(3); + comboBox_SPortOEBitAux->setCurrentIndex(0); + comboBox_SPortStopBitAux->setCurrentIndex(0); + graphicsView_ComStatusAux->setStyleSheet("background-color: rgb(255, 0, 0);"); + label_ComStatusAux->setText(tr("State:Off")); + if(comboBox_SPortName->count()>1) { - ui->comboBox_SPortNameAux->setCurrentIndex(1); + comboBox_SPortNameAux->setCurrentIndex(1); } } @@ -406,15 +1143,15 @@ void mGuangYingPinWidget::OnRefresh() } void mGuangYingPinWidget::MWOnoffPort(void) { - uint8_t comIndex = ui->comboBox_SPortName->currentIndex(); + uint8_t comIndex = comboBox_SPortName->currentIndex(); - if(ui->pushButtonMainOpen->text()==tr("Open")) + if(pushButtonMainOpen->text()==tr("Open")) { - sPortThread->InitPortName(comIndex,ui->comboBox_SPortName->currentText()); - sPortThread->InitPortBaudRate(comIndex,ui->comboBox_SPortBaud->currentText().toInt()); + sPortThread->InitPortName(comIndex,comboBox_SPortName->currentText()); + sPortThread->InitPortBaudRate(comIndex,comboBox_SPortBaud->currentText().toInt()); - //qDebug()<comboBox_SPortDataBit->currentIndex(); - switch(ui->comboBox_SPortDataBit->currentIndex()) + //qDebug()<currentIndex(); + switch(comboBox_SPortDataBit->currentIndex()) { case 0: sPortThread->InitPortDataBits(comIndex,QSerialPort::Data5); break;//0:5 case 1: sPortThread->InitPortDataBits(comIndex,QSerialPort::Data6); break;//1:6 @@ -423,7 +1160,7 @@ void mGuangYingPinWidget::MWOnoffPort(void) default: break; } - switch(ui->comboBox_SPortStopBit->currentIndex()) + switch(comboBox_SPortStopBit->currentIndex()) { case 0:sPortThread->InitPortStopBits(comIndex,QSerialPort::OneStop);break; case 1:sPortThread->InitPortStopBits(comIndex,QSerialPort::TwoStop);break; @@ -431,7 +1168,7 @@ void mGuangYingPinWidget::MWOnoffPort(void) default: break; } - switch(ui->comboBox_SPortOEBit->currentIndex()) + switch(comboBox_SPortOEBit->currentIndex()) { case 0:sPortThread->InitPortParity(comIndex,QSerialPort::NoParity);break; case 1:sPortThread->InitPortParity(comIndex,QSerialPort::EvenParity);break; @@ -445,19 +1182,18 @@ void mGuangYingPinWidget::MWOnoffPort(void) connect(&(sPortThread->m_arrSerial[comIndex]), SIGNAL(readyRead()), this, SLOT(MWReadData())); //参数设置禁止 - ui->comboBox_SPortName->setEnabled(false); - ui->comboBox_SPortBaud->setEnabled(false); - ui->comboBox_SPortDataBit->setEnabled(false); - ui->comboBox_SPortOEBit->setEnabled(false); - ui->comboBox_SPortStopBit->setEnabled(false); - ui->pushButtonMainOpen->setText(tr("Close")); + comboBox_SPortName->setEnabled(false); + comboBox_SPortBaud->setEnabled(false); + comboBox_SPortDataBit->setEnabled(false); + comboBox_SPortOEBit->setEnabled(false); + comboBox_SPortStopBit->setEnabled(false); + pushButtonMainOpen->setText(tr("Close")); //发送设置使能 - ui->graphicsView_ComStatus->setStyleSheet("background-color: rgb(0, 255, 0);"); - ui->label_ComStatus->setText(tr("State:On")); + graphicsView_ComStatus->setStyleSheet("background-color: rgb(0, 255, 0);"); + label_ComStatus->setText(tr("State:On")); } else { - X_UIMsgBoxOk *pDlg=new X_UIMsgBoxOk(tr("Tip"),tr("OpenPort COM failed"),this,1); - pDlg->exec(); + QMessageBox::information(this, tr("Tip"), tr("OpenPort COM failed")); } @@ -466,28 +1202,28 @@ void mGuangYingPinWidget::MWOnoffPort(void) { sPortThread->ClosePort(comIndex); //参数设置使能 - ui->comboBox_SPortName->setEnabled(true); - ui->comboBox_SPortBaud->setEnabled(true); - ui->comboBox_SPortDataBit->setEnabled(true); - ui->comboBox_SPortOEBit->setEnabled(true); - ui->comboBox_SPortStopBit->setEnabled(true); - ui->pushButtonMainOpen->setText(tr("Open")); + comboBox_SPortName->setEnabled(true); + comboBox_SPortBaud->setEnabled(true); + comboBox_SPortDataBit->setEnabled(true); + comboBox_SPortOEBit->setEnabled(true); + comboBox_SPortStopBit->setEnabled(true); + pushButtonMainOpen->setText(tr("Open")); //发送设置禁止 - ui->graphicsView_ComStatus->setStyleSheet("background-color: rgb(255, 0, 0);"); - ui->label_ComStatus->setText(tr("State:Off")); + graphicsView_ComStatus->setStyleSheet("background-color: rgb(255, 0, 0);"); + label_ComStatus->setText(tr("State:Off")); } } void mGuangYingPinWidget::MWOnoffPortAux(void) { - uint8_t comIndex = ui->comboBox_SPortNameAux->currentIndex(); + uint8_t comIndex = comboBox_SPortNameAux->currentIndex(); - if(ui->pushButtonAuxOpen->text()==tr("Open")) + if(pushButtonAuxOpen->text()==tr("Open")) { - sPortThread->InitPortName(comIndex,ui->comboBox_SPortNameAux->currentText()); - sPortThread->InitPortBaudRate(comIndex,ui->comboBox_SPortBaudAux->currentText().toInt()); + sPortThread->InitPortName(comIndex,comboBox_SPortNameAux->currentText()); + sPortThread->InitPortBaudRate(comIndex,comboBox_SPortBaudAux->currentText().toInt()); - //qDebug()<comboBox_SPortDataBit->currentIndex(); - switch(ui->comboBox_SPortDataBitAux->currentIndex()) + //qDebug()<currentIndex(); + switch(comboBox_SPortDataBitAux->currentIndex()) { case 0: sPortThread->InitPortDataBits(comIndex,QSerialPort::Data5); break;//0:5 case 1: sPortThread->InitPortDataBits(comIndex,QSerialPort::Data6); break;//1:6 @@ -496,7 +1232,7 @@ void mGuangYingPinWidget::MWOnoffPortAux(void) default: break; } - switch(ui->comboBox_SPortStopBitAux->currentIndex()) + switch(comboBox_SPortStopBitAux->currentIndex()) { case 0:sPortThread->InitPortStopBits(comIndex,QSerialPort::OneStop);break; case 1:sPortThread->InitPortStopBits(comIndex,QSerialPort::TwoStop);break; @@ -504,7 +1240,7 @@ void mGuangYingPinWidget::MWOnoffPortAux(void) default: break; } - switch(ui->comboBox_SPortOEBitAux->currentIndex()) + switch(comboBox_SPortOEBitAux->currentIndex()) { case 0:sPortThread->InitPortParity(comIndex,QSerialPort::NoParity);break; case 1:sPortThread->InitPortParity(comIndex,QSerialPort::EvenParity);break; @@ -518,21 +1254,19 @@ void mGuangYingPinWidget::MWOnoffPortAux(void) connect(&(sPortThread->m_arrSerial[comIndex]), SIGNAL(readyRead()), this, SLOT(MWReadDataAux())); //参数设置禁止 - ui->comboBox_SPortNameAux->setEnabled(false); - ui->comboBox_SPortBaudAux->setEnabled(false); - ui->comboBox_SPortDataBitAux->setEnabled(false); - ui->comboBox_SPortOEBitAux->setEnabled(false); - ui->comboBox_SPortStopBitAux->setEnabled(false); - ui->pushButtonAuxOpen->setText(tr("Close")); + comboBox_SPortNameAux->setEnabled(false); + comboBox_SPortBaudAux->setEnabled(false); + comboBox_SPortDataBitAux->setEnabled(false); + comboBox_SPortOEBitAux->setEnabled(false); + comboBox_SPortStopBitAux->setEnabled(false); + pushButtonAuxOpen->setText(tr("Close")); //发送设置使能 - ui->graphicsView_ComStatusAux->setStyleSheet("background-color: rgb(0, 255, 0);"); - ui->label_ComStatusAux->setText(tr("State:On")); + graphicsView_ComStatusAux->setStyleSheet("background-color: rgb(0, 255, 0);"); + label_ComStatusAux->setText(tr("State:On")); } else { - X_UIMsgBoxOk *pDlg=new X_UIMsgBoxOk(tr("Tip"),tr("OpenPort COM failed"),this,1); - pDlg->exec(); - + QMessageBox::information(this, tr("Tip"), tr("OpenPort COM failed")); } } @@ -540,23 +1274,23 @@ void mGuangYingPinWidget::MWOnoffPortAux(void) { sPortThread->ClosePort(comIndex); //参数设置使能 - ui->comboBox_SPortNameAux->setEnabled(true); - ui->comboBox_SPortBaudAux->setEnabled(true); - ui->comboBox_SPortDataBitAux->setEnabled(true); - ui->comboBox_SPortOEBitAux->setEnabled(true); - ui->comboBox_SPortStopBitAux->setEnabled(true); - ui->pushButtonAuxOpen->setText(tr("Open")); + comboBox_SPortNameAux->setEnabled(true); + comboBox_SPortBaudAux->setEnabled(true); + comboBox_SPortDataBitAux->setEnabled(true); + comboBox_SPortOEBitAux->setEnabled(true); + comboBox_SPortStopBitAux->setEnabled(true); + pushButtonAuxOpen->setText(tr("Open")); //发送设置禁止 - ui->graphicsView_ComStatusAux->setStyleSheet("background-color: rgb(255, 0, 0);"); - ui->label_ComStatusAux->setText(tr("State:Off")); + graphicsView_ComStatusAux->setStyleSheet("background-color: rgb(255, 0, 0);"); + label_ComStatusAux->setText(tr("State:Off")); } } void mGuangYingPinWidget::Set_program_buf_and_send(int iComIndex,int iProgramIndex) { unsigned char uctemp[3]={0}; uctemp[0]=0x30+iProgramIndex; - int m_uiResendTimes=ui->lineEdit_ResendTimes->text().toInt(); - int m_uimillisecond=ui->lineEdit_DelayMill->text().toInt(); + int m_uiResendTimes=lineEdit_ResendTimes->text().toInt(); + int m_uimillisecond=lineEdit_DelayMill->text().toInt(); unsigned short iDelayTimes=m_uiResendTimes*m_uimillisecond; qint64 dwStart; qint64 dwStop; @@ -582,9 +1316,9 @@ void mGuangYingPinWidget::Set_program_buf_and_send(int iComIndex,int iProgramInd itempDelay=m_uimillisecond; mymidelay(itempDelay); dwStop = QDateTime::currentMSecsSinceEpoch(); - if(ui->checkBoxDebug->isChecked()) + if(checkBoxDebug->isChecked()) { - ui->textEditReadBuf->append("dwStart="+QString::number(dwStart)+",dwStop="+QString::number(dwStop)+",dwStop-dwStart="+QString::number(dwStop-dwStart)+",Delay="+QString::number(itempDelay)+",buf delay value="+QString::number(itemp)+"\r\n"); + textEditReadBuf->append("dwStart="+QString::number(dwStart)+",dwStop="+QString::number(dwStop)+",dwStop-dwStart="+QString::number(dwStop-dwStart)+",Delay="+QString::number(itempDelay)+",buf delay value="+QString::number(itemp)+"\r\n"); } } g_iCountCmd++; @@ -594,8 +1328,8 @@ void mGuangYingPinWidget::Set_program_buf_and_send_by_udp(int iProgramIndex) { unsigned char uctemp[3]={0}; uctemp[0]=0x30+iProgramIndex; - int m_uiResendTimes=ui->lineEdit_ResendTimes->text().toInt(); - int m_uimillisecond=ui->lineEdit_DelayMill->text().toInt(); + int m_uiResendTimes=lineEdit_ResendTimes->text().toInt(); + int m_uimillisecond=lineEdit_DelayMill->text().toInt(); unsigned short iDelayTimes=m_uiResendTimes*m_uimillisecond; qint64 dwStart; qint64 dwStop; @@ -621,9 +1355,9 @@ void mGuangYingPinWidget::Set_program_buf_and_send_by_udp(int iProgramIndex) itempDelay=m_uimillisecond; mymidelay(itempDelay); dwStop = QDateTime::currentMSecsSinceEpoch(); - if(ui->checkBoxDebug->isChecked()) + if(checkBoxDebug->isChecked()) { - ui->textEditReadBuf->append("dwStart="+QString::number(dwStart)+",dwStop="+QString::number(dwStop)+",dwStop-dwStart="+QString::number(dwStop-dwStart)+",Delay="+QString::number(itempDelay)+",buf delay value="+QString::number(itemp)+"\r\n"); + textEditReadBuf->append("dwStart="+QString::number(dwStart)+",dwStop="+QString::number(dwStop)+",dwStop-dwStart="+QString::number(dwStop-dwStart)+",Delay="+QString::number(itempDelay)+",buf delay value="+QString::number(itemp)+"\r\n"); } } g_iCountCmd++; @@ -634,14 +1368,14 @@ void mGuangYingPinWidget::Set_Brightness_buf_and_send(int iComIndex,int iBrightn unsigned char uctemp[2]={0}; uctemp[0]=0xF1; uctemp[1]=iBrightnessValue; - int m_uiResendTimes=ui->lineEdit_ResendTimes->text().toInt(); - int m_uimillisecond=ui->lineEdit_DelayMill->text().toInt(); + int m_uiResendTimes=lineEdit_ResendTimes->text().toInt(); + int m_uimillisecond=lineEdit_DelayMill->text().toInt(); for(int i=0;i<(int)m_uiResendTimes;i++) { MWSendCmd(iComIndex,0x42,uctemp,2,g_iCountCmd); - if(ui->checkBoxDebug->isChecked()) + if(checkBoxDebug->isChecked()) { - ui->textEditReadBuf->append("SetBrightNess="+QString::number(iBrightnessValue)); + textEditReadBuf->append("SetBrightNess="+QString::number(iBrightnessValue)); } mymidelay(m_uimillisecond); } @@ -651,14 +1385,14 @@ void mGuangYingPinWidget::Set_Brightness_buf_and_send_by_udp(int iBrightnessValu unsigned char uctemp[2]={0}; uctemp[0]=0xF1; uctemp[1]=iBrightnessValue; - int m_uiResendTimes=ui->lineEdit_ResendTimes->text().toInt(); - int m_uimillisecond=ui->lineEdit_DelayMill->text().toInt(); + int m_uiResendTimes=lineEdit_ResendTimes->text().toInt(); + int m_uimillisecond=lineEdit_DelayMill->text().toInt(); for(int i=0;i<(int)m_uiResendTimes;i++) { MWSendCmdByUdp(0x42,uctemp,2,g_iCountCmd); - if(ui->checkBoxDebug->isChecked()) + if(checkBoxDebug->isChecked()) { - ui->textEditReadBuf->append("SetBrightNess="+QString::number(iBrightnessValue)); + textEditReadBuf->append("SetBrightNess="+QString::number(iBrightnessValue)); } mymidelay(m_uimillisecond); } @@ -669,17 +1403,17 @@ void mGuangYingPinWidget::Screen_OnOff_buf_and_send(int iComIndex,int iScreenOnO uctemp[0]=iScreenOnOff; uctemp[1]=0; uctemp[2]=0; - int m_uiResendTimes=ui->lineEdit_ResendTimes->text().toInt(); - int m_uimillisecond=ui->lineEdit_DelayMill->text().toInt(); + int m_uiResendTimes=lineEdit_ResendTimes->text().toInt(); + int m_uimillisecond=lineEdit_DelayMill->text().toInt(); for(int i=0;i<(int)m_uiResendTimes;i++) { MWSendCmd(iComIndex,0x42,uctemp,3,g_iCountCmd); - if(ui->checkBoxDebug->isChecked()) + if(checkBoxDebug->isChecked()) { if(iScreenOnOff==0x11) - ui->textEditReadBuf->append("Screen On"); + textEditReadBuf->append("Screen On"); else - ui->textEditReadBuf->append("Screen Off"); + textEditReadBuf->append("Screen Off"); } mymidelay(m_uimillisecond); } @@ -690,17 +1424,17 @@ void mGuangYingPinWidget::Screen_OnOff_buf_and_send_by_udp(int iScreenOnOff) uctemp[0]=iScreenOnOff; uctemp[1]=0; uctemp[2]=0; - int m_uiResendTimes=ui->lineEdit_ResendTimes->text().toInt(); - int m_uimillisecond=ui->lineEdit_DelayMill->text().toInt(); + int m_uiResendTimes=lineEdit_ResendTimes->text().toInt(); + int m_uimillisecond=lineEdit_DelayMill->text().toInt(); for(int i=0;i<(int)m_uiResendTimes;i++) { MWSendCmdByUdp(0x42,uctemp,3,g_iCountCmd); - if(ui->checkBoxDebug->isChecked()) + if(checkBoxDebug->isChecked()) { if(iScreenOnOff==0x11) - ui->textEditReadBuf->append("Screen On"); + textEditReadBuf->append("Screen On"); else - ui->textEditReadBuf->append("Screen Off"); + textEditReadBuf->append("Screen Off"); } mymidelay(m_uimillisecond); } @@ -709,14 +1443,14 @@ void mGuangYingPinWidget::NextProgram_buf_and_send(int iComIndex) { unsigned char uctemp[1]={0}; uctemp[0]=0xF3; - int m_uiResendTimes=ui->lineEdit_ResendTimes->text().toInt(); - int m_uimillisecond=ui->lineEdit_DelayMill->text().toInt(); + int m_uiResendTimes=lineEdit_ResendTimes->text().toInt(); + int m_uimillisecond=lineEdit_DelayMill->text().toInt(); for(int i=0;i<(int)m_uiResendTimes;i++) { MWSendCmd(iComIndex,0x42,uctemp,1,g_iCountCmd); - if(ui->checkBoxDebug->isChecked()) + if(checkBoxDebug->isChecked()) { - ui->textEditReadBuf->append("Next Program"); + textEditReadBuf->append("Next Program"); } mymidelay(m_uimillisecond); } @@ -725,14 +1459,14 @@ void mGuangYingPinWidget::NextProgram_buf_and_send_by_udp() { unsigned char uctemp[1]={0}; uctemp[0]=0xF3; - int m_uiResendTimes=ui->lineEdit_ResendTimes->text().toInt(); - int m_uimillisecond=ui->lineEdit_DelayMill->text().toInt(); + int m_uiResendTimes=lineEdit_ResendTimes->text().toInt(); + int m_uimillisecond=lineEdit_DelayMill->text().toInt(); for(int i=0;i<(int)m_uiResendTimes;i++) { MWSendCmdByUdp(0x42,uctemp,1,g_iCountCmd); - if(ui->checkBoxDebug->isChecked()) + if(checkBoxDebug->isChecked()) { - ui->textEditReadBuf->append("Next Program"); + textEditReadBuf->append("Next Program"); } mymidelay(m_uimillisecond); } @@ -780,8 +1514,8 @@ void mGuangYingPinWidget::MWSendCmdByUdp(unsigned char cmd,unsigned char *pUcVal delete tempUdpSocket; } } - if(ui->checkBoxDebug->isChecked()) { - ui->textEditReadBuf->append("udp:"+tr(databuf.toHex())); + if(checkBoxDebug->isChecked()) { + textEditReadBuf->append("udp:"+tr(databuf.toHex())); } } void mGuangYingPinWidget::MWSendCmd(uint8_t iComIndex,unsigned char cmd,unsigned char *pUcValue,unsigned int iLength,int iCountCmd) @@ -798,26 +1532,26 @@ void mGuangYingPinWidget::MWSendCmd(uint8_t iComIndex,unsigned char cmd,unsigned int iLenPacket=3*sizeof(unsigned char)+sizeof(char)+sizeof(int)+sizeof(int)+tempStreadPakcet.iLength+sizeof(char);/////除正文外的协议结构大小; QByteArray databuf = QByteArray(reinterpret_cast(&tempStreadPakcet), iLenPacket); sPortThread->SendDataBuf(iComIndex,databuf); - if(ui->checkBoxDebug->isChecked()) + if(checkBoxDebug->isChecked()) { - ui->textEditReadBuf->append("com:"+tr(databuf.toHex())); + textEditReadBuf->append("com:"+tr(databuf.toHex())); } -//sPortThread->SendDataBuf(ui->comboBox_SPortName->currentIndex(),ui->textEdit->toPlainText().toLatin1()); -// m_sendNum += (ui->textEdit->toPlainText().toLatin1()).length(); +//sPortThread->SendDataBuf(comboBox_SPortName->currentIndex(),textEdit->toPlainText().toLatin1()); +// m_sendNum += (textEdit->toPlainText().toLatin1()).length(); // MWRSNumDisplay(); } void mGuangYingPinWidget::MWReadData(void) { QByteArray buf; - buf = sPortThread->GetDataBuf(ui->comboBox_SPortName->currentIndex()); + buf = sPortThread->GetDataBuf(comboBox_SPortName->currentIndex()); if(!buf.isEmpty()) { QString str = tr(buf.toHex()); - if(ui->checkBoxDebug->isChecked()) + if(checkBoxDebug->isChecked()) { - ui->textEditReadBuf->moveCursor(QTextCursor::End); - ui->textEditReadBuf->insertPlainText(str); + textEditReadBuf->moveCursor(QTextCursor::End); + textEditReadBuf->insertPlainText(str); } MWRSNumDisplay(); } @@ -826,14 +1560,14 @@ void mGuangYingPinWidget::MWReadData(void) void mGuangYingPinWidget::MWReadDataAux(void) { QByteArray buf; - buf = sPortThread->GetDataBuf(ui->comboBox_SPortNameAux->currentIndex()); + buf = sPortThread->GetDataBuf(comboBox_SPortNameAux->currentIndex()); if(!buf.isEmpty()) { QString str = tr(buf.toHex()); - if(ui->checkBoxDebug->isChecked()) + if(checkBoxDebug->isChecked()) { - ui->textEditReadBuf->moveCursor(QTextCursor::End); - ui->textEditReadBuf->insertPlainText(str); + textEditReadBuf->moveCursor(QTextCursor::End); + textEditReadBuf->insertPlainText(str); } MWRSNumDisplay(); } @@ -854,7 +1588,7 @@ QString mGuangYingPinWidget::ByteArrayToHexString(QByteArray &ba) } void mGuangYingPinWidget::MWClearRecv(void) { -// ui->textBrowser->clear(); +// textBrowser->clear(); // m_recvNum = 0; // m_sendNum = 0; // MWRSNumDisplay(); @@ -862,6 +1596,126 @@ void mGuangYingPinWidget::MWClearRecv(void) void mGuangYingPinWidget::MWRSNumDisplay(void) { -// ui->label_RecvNum->setText(tr("已接收:") + QString::number(m_recvNum,10)); -// ui->label_SendNum->setText(tr("已发送:") + QString::number(m_sendNum,10)); +// label_RecvNum->setText(tr("已接收:") + QString::number(m_recvNum,10)); +// label_SendNum->setText(tr("已发送:") + QString::number(m_sendNum,10)); +} + + + +TA_SerialThread::TA_SerialThread() { + portCnt = 0; + portNewCnt=0; + m_arrSerial = new QSerialPort[10]; + m_arrNewSerial=new QSerialPortInfo[10]; +} + +void TA_SerialThread::SearchPort(void) { + portNewCnt=0; + //查找可用的串口 + foreach(const QSerialPortInfo &info, QSerialPortInfo::availablePorts()) { + if(portNewCnt > 9) break; + m_arrNewSerial[portNewCnt]=info; + portNewCnt++; + } + + for (int i=0;i -#include "communication/taserialthread.h" #include #include -namespace Ui { -class mGuangYingPinWidget; -} +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #define MACRO_ANSY_PROGRAM(PROGRAM_INDEX) \ - if(ui->groupBox_com->isChecked())\ - {\ - if(ui->pushButtonMainOpen->text()==tr("Close"))\ - Set_program_buf_and_send(ui->comboBox_SPortName->currentIndex(),PROGRAM_INDEX);\ - if(ui->pushButtonAuxOpen->text()==tr("Close"))\ - Set_program_buf_and_send(ui->comboBox_SPortNameAux->currentIndex(),PROGRAM_INDEX);\ + if(groupBox_com->isChecked()) {\ + if(pushButtonMainOpen->text()==tr("Close")) Set_program_buf_and_send(comboBox_SPortName->currentIndex(),PROGRAM_INDEX);\ + if(pushButtonAuxOpen->text()==tr("Close")) Set_program_buf_and_send(comboBox_SPortNameAux->currentIndex(),PROGRAM_INDEX);\ }\ - if(ui->groupBox_Network->isChecked())\ - {\ - Set_program_buf_and_send_by_udp(PROGRAM_INDEX);\ - } + if(groupBox_Network->isChecked()) Set_program_buf_and_send_by_udp(PROGRAM_INDEX); + +class TA_SerialThread { +public: + TA_SerialThread(); + uint8_t portCnt; + uint8_t portNewCnt; + QSerialPort *m_arrSerial;//ptr point to an array,maxium port num is 5 + QSerialPortInfo *m_arrNewSerial;//ptr point to an array,maxium port num is 5 + + void SearchPort(void); + void InitPortName(uint8_t portIndex,const QString &portName); + void InitPortBaudRate(uint8_t portIndex,qint32 baudRate); + void InitPortDataBits(uint8_t portIndex,QSerialPort::DataBits dataBits); + void InitPortParity(uint8_t portIndex,QSerialPort::Parity parity); + void InitPortStopBits(uint8_t portIndex,QSerialPort::StopBits stopBits); + bool OpenPort(uint8_t portIndex); + void ClosePort(uint8_t portIndex); + void SendDataBuf(uint8_t portIndex,const QByteArray &str); + QByteArray GetDataBuf(uint8_t portIndex); +}; + class mGuangYingPinWidget : public QWidget { Q_OBJECT public: explicit mGuangYingPinWidget(QWidget *parent = nullptr); - ~mGuangYingPinWidget(); protected: void changeEvent(QEvent *) override; void transUi(); @@ -71,7 +95,6 @@ public slots: void OnBrightnessSetByChanged(int icurValue); void OnRefresh(void); private: - Ui::mGuangYingPinWidget *ui; TA_SerialThread *sPortThread; volatile uint32_t m_recvNum; volatile uint32_t m_sendNum; @@ -90,6 +113,120 @@ private: void mymidelay(int imlsec); QString ByteArrayToHexString(QByteArray &ba); + QGroupBox *groupBox_com; + QHBoxLayout *horizontalLayout_29; + QVBoxLayout *verticalLayout_2; + QGroupBox *groupBoxMain; + QVBoxLayout *verticalLayout_6; + QHBoxLayout *horizontalLayout_6; + QLabel *label_PortName; + QComboBox *comboBox_SPortName; + QHBoxLayout *horizontalLayout_9; + QLabel *label_BaudRate; + QComboBox *comboBox_SPortBaud; + QHBoxLayout *horizontalLayout_15; + QLabel *label_DataBit; + QComboBox *comboBox_SPortDataBit; + QHBoxLayout *horizontalLayout_17; + QLabel *label_OEBit; + QComboBox *comboBox_SPortOEBit; + QHBoxLayout *horizontalLayout_18; + QLabel *label_StopBit; + QComboBox *comboBox_SPortStopBit; + QHBoxLayout *horizontalLayout_22; + QLabel *label_ComStatus; + QGraphicsView *graphicsView_ComStatus; + QHBoxLayout *horizontalLayout_4; + QPushButton *pushButtonMainOpen; + QVBoxLayout *verticalLayout_3; + QGroupBox *groupBoxAux; + QVBoxLayout *verticalLayout_8; + QHBoxLayout *horizontalLayout_7; + QLabel *label_PortNameAux; + QComboBox *comboBox_SPortNameAux; + QHBoxLayout *horizontalLayout_24; + QLabel *label_BaudRateAux; + QComboBox *comboBox_SPortBaudAux; + QHBoxLayout *horizontalLayout_25; + QLabel *label_DataBitAux; + QComboBox *comboBox_SPortDataBitAux; + QHBoxLayout *horizontalLayout_26; + QLabel *label_OEBitAux; + QComboBox *comboBox_SPortOEBitAux; + QHBoxLayout *horizontalLayout_27; + QLabel *label_StopBitAux; + QComboBox *comboBox_SPortStopBitAux; + QHBoxLayout *horizontalLayout_28; + QLabel *label_ComStatusAux; + QGraphicsView *graphicsView_ComStatusAux; + QHBoxLayout *horizontalLayout_5; + QPushButton *pushButtonAuxOpen; + QPushButton *pushButtonRefresh; + QGroupBox *groupBox_Network; + QSpacerItem *horizontalSpacer; + QVBoxLayout *verticalLayout_9; + QGroupBox *groupBoxParam; + QVBoxLayout *verticalLayout_10; + QHBoxLayout *horizontalLayout_20; + QLabel *label_ResendTimes; + QLineEdit *lineEdit_ResendTimes; + QHBoxLayout *horizontalLayout_23; + QLabel *label_DelayMill; + QLineEdit *lineEdit_DelayMill; + QSpacerItem *verticalSpacer; + QSpacerItem *horizontalSpacer_2; + QVBoxLayout *verticalLayout_4; + QHBoxLayout *horizontalLayout_14; + QHBoxLayout *horizontalLayout_16; + QVBoxLayout *verticalLayout_5; + QHBoxLayout *horizontalLayout_13; + QPushButton *pushButton1; + QPushButton *pushButton2; + QPushButton *pushButton3; + QPushButton *pushButton4; + QPushButton *pushButton5; + QHBoxLayout *horizontalLayout_12; + QPushButton *pushButton6; + QPushButton *pushButton7; + QPushButton *pushButton8; + QPushButton *pushButton9; + QPushButton *pushButton10; + QHBoxLayout *horizontalLayout_11; + QPushButton *pushButton11; + QPushButton *pushButton12; + QPushButton *pushButton13; + QPushButton *pushButton14; + QPushButton *pushButton15; + QHBoxLayout *horizontalLayout_10; + QPushButton *pushButton16; + QPushButton *pushButton17; + QPushButton *pushButton18; + QPushButton *pushButton19; + QPushButton *pushButton20; + QVBoxLayout *verticalLayout_7; + QHBoxLayout *horizontalLayout_19; + QLabel *label_ProgramNum; + QSpinBox *spinBox_ProgramIndex; + QPushButton *pushButtonSend; + QPushButton *pushButtonPrevious; + QPushButton *pushButtonNext; + QPushButton *pushButtonLoop; + QSpacerItem *horizontalSpacer_7; + QHBoxLayout *horizontalLayout_21; + QLabel *label_BrightNess; + QSpinBox *spinBox_BrightnessValue; + QPushButton *pushButtonBrightnessSet; + QPushButton *pushButtonScreenOff; + QPushButton *pushButtonScreenOn; + QSpacerItem *horizontalSpacer_18; + QSpacerItem *verticalSpacer_2; + QHBoxLayout *horizontalLayout_2; + QSpacerItem *horizontalSpacer_3; + QPushButton *pushButtonClearLog; + QCheckBox *checkBoxDebug; + QHBoxLayout *horizontalLayout_3; + QHBoxLayout *horizontalLayout_8; + QTextEdit *textEditReadBuf; }; #endif // MGUANGYINGPINWIDGET_H diff --git a/LedOK/mguangyingpinwidget.ui b/LedOK/mguangyingpinwidget.ui deleted file mode 100644 index 9406f2e..0000000 --- a/LedOK/mguangyingpinwidget.ui +++ /dev/null @@ -1,1524 +0,0 @@ - - - mGuangYingPinWidget - - - - 0 - 0 - 866 - 718 - - - - false - - - - - - - - - Qt::Horizontal - - - - - - - - - Qt::Vertical - - - - - - - Com - - - true - - - true - - - - - - 0 - - - - - - 200 - 16777215 - - - - - 12 - - - - Main - - - Qt::AlignCenter - - - true - - - - - - - - PortName - - - - - - - - 80 - 0 - - - - - - - - - - 0 - - - - - BaudRate - - - - - - - - 1200 - - - - - 2400 - - - - - 4800 - - - - - 9600 - - - - - 19200 - - - - - 38400 - - - - - 57600 - - - - - 115200 - - - - - - - - - - 0 - - - - - DataBit - - - - - - - - 5 - - - - - 6 - - - - - 7 - - - - - 8 - - - - - - - - - - 0 - - - - - OEBit - - - - - - - - No - - - - - Even - - - - - Odd - - - - - Space - - - - - Mark - - - - - - - - - - 0 - - - - - StopBit - - - - - - - - 1 - - - - - 2 - - - - - 1.5 - - - - - - - - - - 0 - - - - - State:Close - - - - - - - - 30 - 30 - - - - - - - - - - - - - 80 - 30 - - - - Open - - - - - - - - - - - - - - Qt::Vertical - - - - - - - 0 - - - - - - 200 - 16777215 - - - - - 12 - - - - Auxiliary - - - Qt::AlignCenter - - - true - - - false - - - - - - - - PortName - - - - - - - - 80 - 0 - - - - - - - - - - - - BaudRate - - - - - - - - 1200 - - - - - 2400 - - - - - 4800 - - - - - 9600 - - - - - 19200 - - - - - 38400 - - - - - 57600 - - - - - 115200 - - - - - - - - - - - - DataBit - - - - - - - - 5 - - - - - 6 - - - - - 7 - - - - - 8 - - - - - - - - - - - - OEBit - - - - - - - - No - - - - - Even - - - - - Odd - - - - - Space - - - - - Mark - - - - - - - - - - - - StopBit - - - - - - - - 1 - - - - - 2 - - - - - 1.5 - - - - - - - - - - - - State:Close - - - - - - - - 30 - 30 - - - - - - - - - - - - - 80 - 30 - - - - Open - - - - - - - - - - - - - - - 0 - 0 - - - - - 80 - 40 - - - - - 12 - - - - Refresh - - - - - - - - - - Network - - - true - - - true - - - false - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Qt::Vertical - - - - - - - Qt::Vertical - - - - - - - 0 - - - - - - 200 - 16777215 - - - - - 12 - - - - Param configuration - - - Qt::AlignCenter - - - true - - - - - - - - - 10 - - - - Resend times - - - - - - - - 80 - 16777215 - - - - 10 - - - - - - - - - - - - 10 - - - - Delay millsecond - - - - - - - - 80 - 16777215 - - - - 10 - - - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - Qt::Horizontal - - - - - - - - - 2 - - - - - 0 - - - - - 0 - - - - - - - - 40 - 40 - - - - - 40 - 40 - - - - 1 - - - - - - - - 40 - 40 - - - - - 40 - 40 - - - - 2 - - - - - - - - 40 - 40 - - - - - 40 - 40 - - - - 3 - - - - - - - - 40 - 40 - - - - - 40 - 40 - - - - 4 - - - - - - - - 40 - 40 - - - - - 40 - 40 - - - - 5 - - - - - - - - - - - - 40 - 40 - - - - - 40 - 40 - - - - 6 - - - - - - - - 40 - 40 - - - - - 40 - 40 - - - - 7 - - - - - - - - 40 - 40 - - - - - 40 - 40 - - - - 8 - - - - - - - - 40 - 40 - - - - - 40 - 40 - - - - 9 - - - - - - - - 40 - 40 - - - - - 40 - 40 - - - - 10 - - - - - - - - - - - - 40 - 40 - - - - - 40 - 40 - - - - 11 - - - - - - - - 40 - 40 - - - - - 40 - 40 - - - - 12 - - - - - - - - 40 - 40 - - - - - 40 - 40 - - - - 13 - - - - - - - - 40 - 40 - - - - - 40 - 40 - - - - 14 - - - - - - - - 40 - 40 - - - - - 40 - 40 - - - - 15 - - - - - - - - - - - - 40 - 40 - - - - - 40 - 40 - - - - 16 - - - - - - - - 40 - 40 - - - - - 40 - 40 - - - - 17 - - - - - - - - 40 - 40 - - - - - 40 - 40 - - - - 18 - - - - - - - - 40 - 40 - - - - - 40 - 40 - - - - 19 - - - - - - - - 40 - 40 - - - - - 40 - 40 - - - - 20 - - - - - - - - - - - - - Qt::Vertical - - - - - - - 0 - - - - - 0 - - - - - - 88 - 0 - - - - Program number - - - - - - - - 60 - 0 - - - - 999 - - - 21 - - - - - - - - 80 - 40 - - - - Send - - - - - - - Qt::Vertical - - - - - - - - 40 - 40 - - - - - - - - 32 - 32 - - - - true - - - - - - - - 40 - 40 - - - - - - - - 32 - 32 - - - - true - - - - - - - - 40 - 40 - - - - - - - - 32 - 32 - - - - true - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - Qt::Horizontal - - - - - - - - - - 88 - 0 - - - - Brightness - - - - - - - - 60 - 0 - - - - 255 - - - 255 - - - - - - - - 80 - 40 - - - - Set - - - - - - - Qt::Vertical - - - - - - - - 80 - 40 - - - - Screen Off - - - - - - - - 80 - 40 - - - - Screen on - - - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - - - Qt::Vertical - - - - 20 - 40 - - - - - - - - 20 - - - - - Qt::Horizontal - - - - 40 - 20 - - - - - - - - Clear - - - - - - - Debug - - - false - - - - - - - - - - - - - - - Qt::Horizontal - - - - - - - - - - - QAbstractScrollArea::AdjustIgnored - - - false - - - true - - - - - - - - - - - - diff --git a/LedOK/progpanel.cpp b/LedOK/progpanel.cpp index 29f43ed..4d7ebdd 100644 --- a/LedOK/progpanel.cpp +++ b/LedOK/progpanel.cpp @@ -1,6 +1,5 @@ #include "progpanel.h" #include "globaldefine.h" -#include "tools.h" #include "gutil/qgui.h" #include "cfg.h" #include "player/playwin.h" @@ -12,6 +11,7 @@ #include #include #include +#include ProgPanel::ProgPanel(QSettings &settings, QWidget *parent) : QWidget(parent) { setAttribute(Qt::WA_DeleteOnClose); @@ -420,7 +420,9 @@ void ProgPanel::FilterProgram(const QString &strtemp){ } ProgPortDlg::ProgPortDlg(QWidget *parent, QString title) : QDialog(parent) { +#ifdef Q_OS_WIN setWindowFlag(Qt::WindowContextHelpButtonHint, 0); +#endif resize(600, 400); setWindowTitle(title); @@ -444,6 +446,6 @@ ProgPortDlg::ProgPortDlg(QWidget *parent, QString title) : QDialog(parent) { hBox->addWidget(bnOK); auto bnDone = new QPushButton(tr("Done")); - connect(bnDone, &QPushButton::clicked, this, &BaseDlg::accept); + connect(bnDone, &QPushButton::clicked, this, &QDialog::accept); hBox->addWidget(bnDone); } diff --git a/LedOK/progpanel.h b/LedOK/progpanel.h index f5ec73c..7e71679 100644 --- a/LedOK/progpanel.h +++ b/LedOK/progpanel.h @@ -40,6 +40,7 @@ private: }; class ProgPortDlg : public QDialog { + Q_OBJECT public: ProgPortDlg(QWidget *parent, QString title); diff --git a/LedOK/program/edclock.cpp b/LedOK/program/edclock.cpp index a631c24..eede39f 100644 --- a/LedOK/program/edclock.cpp +++ b/LedOK/program/edclock.cpp @@ -7,6 +7,7 @@ #include #include #include +#include EDClock::EDClock(EBase *multiWin) : EBase(multiWin) { mType = EBase::DClock; diff --git a/LedOK/program/etext.cpp b/LedOK/program/etext.cpp index 159444d..a57d768 100644 --- a/LedOK/program/etext.cpp +++ b/LedOK/program/etext.cpp @@ -14,6 +14,8 @@ #include #include #include +#include +#include static QColor charColors[]{"#fff","#f00","#f00","#f0f","#c0c","#ff0","#f80","#0f0","#0f0","#0a0","#0a0","#7b0","#00f","#00f","#0af","#0ef"}; diff --git a/LedOK/program/evideo.cpp b/LedOK/program/evideo.cpp index 975a079..0277c26 100644 --- a/LedOK/program/evideo.cpp +++ b/LedOK/program/evideo.cpp @@ -10,6 +10,7 @@ #include #include #include +#include EVideo *EVideo::create(const QString &file, PageListItem *pageItem, EBase *multiWin) { int64_t dur; diff --git a/LedOK/program/gentmpthread.cpp b/LedOK/program/gentmpthread.cpp index b6f5a75..2d98ef4 100644 --- a/LedOK/program/gentmpthread.cpp +++ b/LedOK/program/gentmpthread.cpp @@ -9,6 +9,7 @@ #include #include #include +#include GenTmpThread::GenTmpThread(ProgItem *progItem, const QString &prog_name, const QString &zip_file, const QString &password) : mProgItem(progItem), prog_name(prog_name), zip_file(zip_file), password(password) { connect(this, &QThread::finished, this, &QThread::deleteLater); @@ -90,7 +91,7 @@ void GenTmpThread::run() { //如果是usb更新则生成压缩包,网络发送则不需要 if(! zip_file.isEmpty()) { -#ifdef Q_OS_WINDOWS +#ifdef Q_OS_WIN QStringList args{"a", zip_file, dstDir+"/*"}; if(! password.isEmpty()) args << "-p"+password; QProcess::execute("7z.exe", args); diff --git a/LedOK/program/progcreatedlg.cpp b/LedOK/program/progcreatedlg.cpp index c0b31ad..8b68671 100644 --- a/LedOK/program/progcreatedlg.cpp +++ b/LedOK/program/progcreatedlg.cpp @@ -3,9 +3,10 @@ #include "globaldefine.h" #include #include +#include ProgCreateDlg::ProgCreateDlg(QString name, int width, int height, QString remarks, QString widths, QWidget *parent) : QDialog(parent) { -#ifdef Q_OS_WINDOWS +#ifdef Q_OS_WIN setWindowFlag(Qt::WindowContextHelpButtonHint, 0); #endif setWindowTitle(tr("Solution Information")); @@ -77,14 +78,8 @@ ProgCreateDlg::ProgCreateDlg(QString name, int width, int height, QString remark vBox->addSpacing(6); - hBox = new HBox(vBox); - hBox->addStretch(); - - auto bnOK = new QPushButton(tr("OK")); - connect(bnOK, &QPushButton::clicked, this, &QDialog::accept); - hBox->addWidget(bnOK); - - auto bnCancel = new QPushButton(tr("Cancel")); - connect(bnCancel, &QPushButton::clicked, this, &QDialog::reject); - hBox->addWidget(bnCancel); + auto btnBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel); + connect(btnBox, &QDialogButtonBox::rejected, this, &QDialog::reject); + connect(btnBox, &QDialogButtonBox::accepted, this, &QDialog::accept); + vBox->addWidget(btnBox); } diff --git a/LedOK/program/progeditorwin.cpp b/LedOK/program/progeditorwin.cpp index 685d8a4..4cee875 100644 --- a/LedOK/program/progeditorwin.cpp +++ b/LedOK/program/progeditorwin.cpp @@ -544,7 +544,8 @@ void ProgEditorWin::closeEvent(QCloseEvent *event) { #endif } //停止每个页面元素的播放,将节目目录下的每个页面的文件夹另命名 -void ProgEditorWin::save() { +bool ProgEditorWin::save() { + auto rtn = true; //停止每个幻灯片的元素 int cnt = listPage->count(); for(int i=0; i(item)->freeFiles(); } QDir progDir(mProgItem->mProgDir); - if(! progDir.exists() && ! progDir.mkdir(mProgItem->mProgDir)) return; + if(! progDir.exists() && ! progDir.mkdir(mProgItem->mProgDir)) { + QMessageBox::critical(this, tr("Error"), tr("Create Dir failed")+": "+mProgItem->mProgDir); + return 0; + } QStringList pageNames = progDir.entryList(QDir::Dirs | QDir::NoDotAndDotDot | QDir::NoSymLinks); foreach(QString pageName, pageNames) { - if(! progDir.rename(pageName, pageName + PAGEDEL_SUFFIX)) QMessageBox::critical(this, tr("Error"), tr("Rename fail when saving")+" "+pageName); + if(! progDir.rename(pageName, pageName + PAGEDEL_SUFFIX)) { + rtn = 0; + QMessageBox::critical(this, tr("Error"), tr("Rename fail when saving")+" "+pageName); + } } //保存每个页面的元素和页面属性到page.json文档 mPageJsons.clear(); @@ -565,21 +572,24 @@ void ProgEditorWin::save() { } pageNames = progDir.entryList(QStringList("*" PAGEDEL_SUFFIX)); foreach(QString pageName, pageNames) { - if(! QDir(mProgItem->mProgDir + "/" + pageName).removeRecursively()) QMessageBox::critical(this, tr("Error"), tr("Remove Recursively fail when saving")+" "+pageName); + if(! QDir(mProgItem->mProgDir + "/" + pageName).removeRecursively()) { + rtn = 0; + QMessageBox::critical(this, tr("Error"), tr("Remove Recursively fail when saving")+" "+pageName); + } } for(int i=0; i(listPage->item(i))->mScene->items(); foreach(auto item, items) static_cast(item)->loadFiles(); } + return rtn; } void ProgEditorWin::onSave() { auto waitingDlg = new WaitingDlg(this, tr("Saving..."), tr("Success")); waitingDlg->btnAbort->hide(); - //dlg->lock(tr("Saving..."),tr("Success"),tr("Save failed")); waitingDlg->show(); - save(); - waitingDlg->success(); + if(save()) waitingDlg->success(); + else waitingDlg->close(); waitingDlg->exec(); this->mProgItem->m_last = QDateTime::currentDateTime(); this->mProgItem->m_fsize = dirFileSize(this->mProgItem->mProgDir); diff --git a/LedOK/program/progeditorwin.h b/LedOK/program/progeditorwin.h index d825f4b..1691763 100644 --- a/LedOK/program/progeditorwin.h +++ b/LedOK/program/progeditorwin.h @@ -17,7 +17,7 @@ protected: void closeEvent(QCloseEvent *event) override; private: bool isProgChanged(); - void save(); + bool save(); void UdpSendJson(QJsonObject json); QListWidget *listPage; diff --git a/LedOK/program/sendprogramdialog.cpp b/LedOK/program/sendprogramdialog.cpp index 172ca3d..ee6e8a4 100644 --- a/LedOK/program/sendprogramdialog.cpp +++ b/LedOK/program/sendprogramdialog.cpp @@ -1,5 +1,4 @@ #include "sendprogramdialog.h" -#include "tools.h" #include "cfg.h" #include "wProgramPublishItem.h" #include "sendprogthread.h" @@ -8,9 +7,11 @@ #include #include #include +#include "deviceitem.h" +#include "devicepanel.h" SendProgramDialog::SendProgramDialog(QString progName, QWidget *parent) : QDialog(parent), mProgName(progName) { -#ifdef Q_OS_WINDOWS +#ifdef Q_OS_WIN setWindowFlag(Qt::WindowMaximizeButtonHint); #endif setWindowTitle(tr("Publish")+" "+mProgName); @@ -86,7 +87,7 @@ SendProgramDialog::SendProgramDialog(QString progName, QWidget *parent) : QDialo if(item->checkState(0) != Qt::Checked) continue; auto row = static_cast(item); if(row->mIsSending) continue; - if(row->mLedCard->bPassword && row->mLedCard->m_bLockStatus) { + if(row->mLedCard.hasPassword && row->mLedCard.isLocked) { row->setData(ENUM_DEVICE_PUBLISH_HEADE_REMARKS, 0, tr("This screen is encrypted")); row->setForeground(ENUM_DEVICE_PUBLISH_HEADE_REMARKS, Qt::red); continue; @@ -100,7 +101,7 @@ SendProgramDialog::SendProgramDialog(QString progName, QWidget *parent) : QDialo } row->mIsSending = true; row->setData(ENUM_DEVICE_PUBLISH_HEADE_REMARKS, 0, ""); - auto sendProg = new SendProgThread(programsDir()+"/"+mProgName+"_tmp", row->mLedCard->m_strCardIp, 3333); + auto sendProg = new SendProgThread(programsDir()+"/"+mProgName+"_tmp", row->mLedCard.ip, 3333); connect(sendProg, &SendProgThread::emErr, row, [this, row](QString strTip) { row->mIsSending = false; if(strTip=="OK") { @@ -138,13 +139,13 @@ void SendProgramDialog::sendNext() { if(item->checkState(0) != Qt::Checked) continue; auto row = static_cast(item); if(row->mIsSending) continue; - if(row->mLedCard->bPassword && row->mLedCard->m_bLockStatus) continue; + if(row->mLedCard.hasPassword && row->mLedCard.isLocked) continue; if(! row->data(ENUM_DEVICE_PUBLISH_HEADE_REMARKS, 0).toString().startsWith(" ")) continue; row->setData(ENUM_DEVICE_PUBLISH_HEADE_REMARKS, 0, ""); row->fdProgress->setValue(0); row->mIsSending = true; mWaitCnt--; - auto sendProg = new SendProgThread(programsDir()+"/"+mProgName+"_tmp", row->mLedCard->m_strCardIp, 3333); + auto sendProg = new SendProgThread(programsDir()+"/"+mProgName+"_tmp", row->mLedCard.ip, 3333); connect(sendProg, &SendProgThread::emErr, row, [this, row](QString strTip) { row->mIsSending = false; if(strTip=="OK") { @@ -165,16 +166,16 @@ void SendProgramDialog::sendNext() { } void SendProgramDialog::onRefresh() { - int iCount = gDevicePanel->mLedCards.count(); - for(int i=0; imLedCards.at(i)); - label->setText(tr("All")+":"+QString::number(iCount)); + int cnt = gDevicePanel->mDeviceTable->topLevelItemCount(); + for(int i=0; i(gDevicePanel->mDeviceTable->topLevelItem(i))->mCard); + label->setText(tr("All")+":"+QString::number(cnt)); } -void SendProgramDialog::onAddLedCard(LedCard *p) { +void SendProgramDialog::onAddLedCard(LedCard p) { int iExistFlg=0; int cnt = wDevicePublishList->topLevelItemCount(); for(int i=0; i(wDevicePublishList->topLevelItem(i))->mLedCard->m_strCardId; - if(strTempCardId == p->m_strCardId) { + QString strTempCardId=static_cast(wDevicePublishList->topLevelItem(i))->mLedCard.id; + if(strTempCardId == p.id) { iExistFlg=1; static_cast(wDevicePublishList->topLevelItem(i))->SetItemParam(p); break; diff --git a/LedOK/program/sendprogramdialog.h b/LedOK/program/sendprogramdialog.h index df432a3..33ab3c8 100644 --- a/LedOK/program/sendprogramdialog.h +++ b/LedOK/program/sendprogramdialog.h @@ -3,8 +3,8 @@ #include #include -#include "device/ledcard.h" #include "base/loqtreewidget.h" +#include "globaldefine.h" class SendProgramDialog : public QDialog { Q_OBJECT @@ -19,7 +19,7 @@ protected slots: void FilterProgram(const QString &strtemp); private: void sendNext(); - void onAddLedCard(LedCard *p); + void onAddLedCard(LedCard); LoQTreeWidget *wDevicePublishList; int mWaitCnt{0}; diff --git a/LedOK/program/wprogrampublishitem.cpp b/LedOK/program/wprogrampublishitem.cpp index 823b8e2..78f99f7 100644 --- a/LedOK/program/wprogrampublishitem.cpp +++ b/LedOK/program/wprogrampublishitem.cpp @@ -1,6 +1,8 @@ #include "wprogrampublishitem.h" #include "gutil/qgui.h" #include "base/waitingdlg.h" +#include "gutil/qnetwork.h" +#include "deviceitem.h" #include #include #include @@ -9,7 +11,7 @@ #include #include -wProgramPublishItem::wProgramPublishItem(LedCard *pLedCard, LoQTreeWidget *parent, QString strProgramName, QString strProgramPath) : QObject(parent), QTreeWidgetItem(UserType), m_parent(parent) { +wProgramPublishItem::wProgramPublishItem(LedCard pLedCard, LoQTreeWidget *parent, QString strProgramName, QString strProgramPath) : QObject(parent), QTreeWidgetItem(UserType), m_parent(parent) { m_strProgramName = strProgramName; m_strProgramPath = strProgramPath; mLedCard = pLedCard; @@ -34,7 +36,7 @@ wProgramPublishItem::wProgramPublishItem(LedCard *pLedCard, LoQTreeWidget *paren vBox->addWidget(btnUnlock); m_parent->setItemWidget(this, ENUM_DEVICE_PUBLISH_HEADE_ENCRYPT, wgt); connect(btnUnlock, &QPushButton::clicked, this, [this] { - if(! mLedCard->m_bLockStatus) return; + if(! mLedCard.isLocked) return; bool ok; auto pwd = QInputDialog::getText(treeWidget(), tr("Input password"), tr("Input password"), QLineEdit::Password, QString(), &ok); if(! ok) return; @@ -44,7 +46,7 @@ wProgramPublishItem::wProgramPublishItem(LedCard *pLedCard, LoQTreeWidget *paren json.insert("pwd", pwd); auto waitingDlg = new WaitingDlg(treeWidget(), tr("VerifyPassword")+" ..."); waitingDlg->show(); - auto reply = NetReq("http://"+mLedCard->m_strCardIp+":2016/settings").timeout(60000).post(json); + auto reply = NetReq("http://"+mLedCard.ip+":2016/settings").timeout(60000).post(json); waitingDlg->connAbort(reply); connect(reply, &QNetworkReply::finished, this, [=] { QJsonDocument json; @@ -60,23 +62,28 @@ wProgramPublishItem::wProgramPublishItem(LedCard *pLedCard, LoQTreeWidget *paren return; } waitingDlg->success(); - mLedCard->m_bLockStatus = false; + mLedCard.isLocked = false; btnUnlock->setIcon(QIcon(":/res/device/UnLock.png")); + auto item = findItem(mLedCard.id); + if(item) { + item->mCard.isLocked = false; + item->btnUnlock->setIcon(QIcon(":/res/device/UnLock.png")); + } }); }); SetItemParam(mLedCard); } -void wProgramPublishItem::SetItemParam(LedCard *card) { - setData(ENUM_DEVICE_PUBLISH_HEADE_SCREEN_ID, 0, card->m_strCardId); - setData(ENUM_DEVICE_PUBLISH_HEADE_REMARK_NAME, 0, card->m_strCardRemarkName); - setData(ENUM_DEVICE_PUBLISH_HEADE_SCREEN_IP, 0, card->m_strCardIp); - setData(ENUM_DEVICE_PUBLISH_HEADE_SCREEN_SIZE, 0, QString("%1 x %2").arg(card->m_iWidth).arg(card->m_iHeight)); - m_ImageOnline->setPixmap(QPixmap(mLedCard->m_bOnLine ? ":/res/device/O_Online.png" : ":/res/device/O_Offline.png")); - if(! card->bPassword) btnUnlock->hide(); +void wProgramPublishItem::SetItemParam(LedCard card) { + setData(ENUM_DEVICE_PUBLISH_HEADE_SCREEN_ID, 0, card.id); + setData(ENUM_DEVICE_PUBLISH_HEADE_REMARK_NAME, 0, card.alias); + setData(ENUM_DEVICE_PUBLISH_HEADE_SCREEN_IP, 0, card.ip); + setData(ENUM_DEVICE_PUBLISH_HEADE_SCREEN_SIZE, 0, QString("%1 x %2").arg(card.mWidth).arg(card.mHeight)); + m_ImageOnline->setPixmap(QPixmap(mLedCard.isOnline ? ":/res/device/O_Online.png" : ":/res/device/O_Offline.png")); + if(! card.hasPassword) btnUnlock->hide(); else { if(! btnUnlock->isVisible()) btnUnlock->show(); - btnUnlock->setIcon(QIcon(card->m_bLockStatus ? ":/res/device/Lock.png" : ":/res/device/UnLock.png")); //如果已经验证通过密码显示绿色图标 没有验证显示蓝色锁图标 + btnUnlock->setIcon(QIcon(card.isLocked ? ":/res/device/Lock.png" : ":/res/device/UnLock.png")); //如果已经验证通过密码显示绿色图标 没有验证显示蓝色锁图标 } } diff --git a/LedOK/program/wprogrampublishitem.h b/LedOK/program/wprogrampublishitem.h index f67bcdc..8fc873c 100644 --- a/LedOK/program/wprogrampublishitem.h +++ b/LedOK/program/wprogrampublishitem.h @@ -8,19 +8,16 @@ #include #include #include -#include -#include -#include -#include -#include +#include "base/loqtreewidget.h" +#include "globaldefine.h" class wProgramPublishItem : public QObject, public QTreeWidgetItem { Q_OBJECT public: - explicit wProgramPublishItem(LedCard *pLedCard, LoQTreeWidget *parent = nullptr, QString strProgramName="",QString strProgramPath=""); - void SetItemParam(LedCard *p); + explicit wProgramPublishItem(LedCard pLedCard, LoQTreeWidget *parent = nullptr, QString strProgramName="",QString strProgramPath=""); + void SetItemParam(LedCard p); - LedCard *mLedCard{nullptr}; + LedCard mLedCard; QProgressBar *fdProgress{nullptr}; bool mIsSending{false}; diff --git a/LedOK/tools.cpp b/LedOK/tools.cpp index 91aab47..8651e47 100644 --- a/LedOK/tools.cpp +++ b/LedOK/tools.cpp @@ -1,10 +1,7 @@ #include "tools.h" -#include "cfg.h" -#include "globaldefine.h" -#include "program/pagelistitem.h" -#include "base/x_uimsgboxok.h" #include #include +#include void Tools::timerEvent(QTimerEvent *event) { if(timer_id==event->timerId()) emit sTick(); diff --git a/LedOK/tools.h b/LedOK/tools.h index 7a8369c..8ab517b 100644 --- a/LedOK/tools.h +++ b/LedOK/tools.h @@ -1,9 +1,7 @@ #ifndef TOOLS_H #define TOOLS_H -#include "devicepanel.h" #include "program/progitem.h" -#include "device/ledcard.h" #include #include #include @@ -15,8 +13,6 @@ #include const QString str0_9[] = {"0", "1", "2", "3", "4", "5", "6", "7", "8", "9"}; -extern DevicePanel *gDevicePanel; -extern QList *gSelCards; extern QTextEdit *gFdResInfo; extern QString gFileHome; extern ProgItem *gProgItem; diff --git a/LedOK/translations/app_en.qm b/LedOK/translations/app_en.qm new file mode 100644 index 0000000..7b1a785 Binary files /dev/null and b/LedOK/translations/app_en.qm differ diff --git a/LedOK/translations/app_en.ts b/LedOK/translations/app_en.ts index 1c7d48a..0f795fa 100644 --- a/LedOK/translations/app_en.ts +++ b/LedOK/translations/app_en.ts @@ -4,61 +4,59 @@ ChangePasswordForm - + Old password Old password - + New password New password - + Repeat again Repeat again - OK - Ok + Ok - Cancel - Cancel + Cancel - - - - - + + + + + Tip Tip - + Please input old password Please input old password - + Old password is wrong Old password is wrong - + Please enter a password with more than 6 characters Please enter a password with more than 6 characters - + The new password is not consistent in two times - + Password changed successfully Password changed successfully @@ -66,1766 +64,1864 @@ ControlPowerSchedule - Form - Form + Form - Edit area - Edit area + Edit area - - Add - Add + Add - - Delete - Delete + Delete - - Clear - Clear + Clear - - Import - Import + Import - - Export - Export + Export - It is power off state outside the schedule time period - It is power off state outside the schedule time period + It is power off state outside the schedule time period - Send command - Command area + Command area - - Apply - Apply + Apply - Clear Schedule - Cancel Schedule + Cancel Schedule - Readback - Readback + Readback - Power On State - Power On State + Power On State - Start Time - Start Time + Start Time - End Time - End Time + End Time - SUN - SUN + SUN - MON - MON + MON - TUE - TUE + TUE - WED - WED + WED - THU - THU + THU - FRI - FRI + FRI - SAT - SAT + SAT - - - DeviceItem OnProHttpResponse 解析json文件错误! - - - - - On - On + On - - PowerSchedule (*.pjs) - PowerSchedule (*.pjs) + PowerSchedule (*.pjs) - Save File - Save file + Save file - - - Tip - Tip + Tip - - - NoSelectedController - Please select screen first + Please select screen first - - Tip Info - Tip Info + Tip Info - - Clear schedule task? - Clear schedule task? + Clear schedule task? - - CleanTimingScreenTask - Clear schedule task + Clear schedule task - SetTimingScreenTask - Set schedule task of screen power + Set schedule task of screen power - - - - Success - Success + Success - - - - failed - failed + failed - GetTimingScreenTask - Get schedule task of screen power + Get schedule task of screen power - ControlPowerWidget + CtrlPowerPanel - - + + Off - - + + On On - - + + + + + Tip Tip - - + + + + + NoSelectedController Please select screen first - - + + SetScreenOn Set Screen On - - + + SetScreenOff Set Screen Off - - + + IsScreenOn Read power status - + + Import File + + + + + + PowerSchedule (*.pjs) + PowerSchedule (*.pjs) + + + + Save File + Save file + + + + + SetTimingScreenTask + Set schedule task of screen power + + + + GetTimingScreenTask + Get schedule task of screen power + + + Power Configuration Power configuration - + Manual Manual - + Schedule Schedule - + Power Power - + + Readback Readback - - - ControlTestWidget - - Form - Form + + Start Time + Start Time - - - Test Screen - Test Screen + + End Time + End Time - - - Line test - Line test + + SUN + SUN - - - - - - - - Red - Red + + MON + MON - - - - - - - - Green - Green + + TUE + TUE - - - - - - - - Blue - Blue + + WED + WED - - - - - - - - White - White + + THU + THU - - - Vertical - Vertical + + FRI + FRI - - - Slash - Oblique line + + SAT + SAT - - - - Horizontal - Horizontal + + Add + Add - - - - - Speed - Speed + + Apply + Apply - - - ms(>10) - - - - - - Line Distance - Line Distance - - - - px - px - - - - - - - - Test - Test - - - - - Gradation test - Gradation test - - - - - Only the gray value is displayed - Only the gray value is displayed - - - - (>10) - - - - - - GrayValue - Gray value - - - - (0-255) - - - - - - Color test - Color test - - - - - Gradient - Gradient - - - - 8 - 8 - - - - 2 - 2 - - - - 3 - 3 - - - - 6 - 6 - - - - 4 - 4 - - - - 5 - 5 - - - - 1 - 1 - - - - 9 - 9 - - - - 7 - 7 - - - - 0 - 0 - - - - + Clear Clear - - + + Delete + Delete + + + + Import + Import + + + + Export + Export + + + + It is power off state outside the schedule time period + It is power off state outside the schedule time period + + + + Clear Schedule + Cancel Schedule + + + + Tip Info + Tip Info + + + + Clear schedule task? + Clear schedule task? + + + + + CleanTimingScreenTask + Clear schedule task + + + + CtrlTestPanel + + + Test Screen + Test Screen + + + + Line test + Line test + + + + + + + Red + Red + + + + + + + Green + Green + + + + + + + Blue + Blue + + + + + + + White + White + + + + Vertical + Vertical + + + + Slash + Oblique line + + + + + Horizontal + Horizontal + + + + + Speed + Speed + + + + ms(>10) + + + + + Line Distance + Line Distance + + + px + px + + + + + + Test + Test + + + + Gradation test + Gradation test + + + + Only the gray value is displayed + Only the gray value is displayed + + + + GrayValue + Gray value + + + + Color test + Color test + + + + Gradient + Gradient + + + 8 + 8 + + + 2 + 2 + + + 3 + 3 + + + 6 + 6 + + + 4 + 4 + + + 5 + 5 + + + 1 + 1 + + + 9 + 9 + + + 7 + 7 + + + 0 + 0 + + + + Clear + Clear + + + Reset Loop - - - - + + + + Anycast Anycast - - + Stop Stop - - - - - - - - + + + + + + + + Tip Tip - - - - - + + + + + + NoSelectedController Please select screen first - - - + + + + + + StartTest Start test - - - - Success - Success + Success - - - - failed - failed + failed - + + StopTest Stop test - + loopback mode loopback mode - + Connect timeout Connect timeout - + + + receive + Receive + + + + Connect + Connect + + + + timeout + timeout + + + Reset loop mode Reset loop mode - - + + success success - - DeviceItem OnProHttpResponse 解析json文件错误! - DeviceItem OnProHttpResponse json error! + DeviceItem OnProHttpResponse json error! ControlVolumeSchedule - Defalut volume tip - Reminder: the brightness within the fixed time period is displayed according to the timing brightness, and the default brightness value is not set for other time periods + Reminder: the brightness within the fixed time period is displayed according to the timing brightness, and the default brightness value is not set for other time periods - - Add - Add + Add - - Delete - Delete + Delete - - Clear - Clear + Clear - Default Volume - Default Volume + Default Volume - - (0-15) - - - - - Import - Import + Import - - Export - Export + Export - - Apply - Apply + Apply - Readback - Readback + Readback - Volume value - Volume value + Volume value - Start Time - Start Time + Start Time - End Time - End Time + End Time - SUN - SUN + SUN - MON - MON + MON - TUE - TUE + TUE - WED - WED + WED - THU - THU + THU - FRI - FRI + FRI - SAT - SAT + SAT - Default volume tip - Reminder: the display screen is the default brightness outside the fixed time period + Reminder: the display screen is the default brightness outside the fixed time period - Default volume - Default volume + Default volume - - DeviceItem OnProHttpResponse 解析json文件错误! - DeviceItem OnProHttpResponse json error! + DeviceItem OnProHttpResponse json error! - 10 - 10 + 10 - - - Volume Schedule (*.vols) - - - - Save File - Save file + Save file - - Tip - Tip + Tip - - NoSelectedController - Please select screen first + Please select screen first - SetAutoVolumeTask - Set volume schedule + Set volume schedule - - Success - Success + Success - - failed - failed + failed - GetAutoVolumeTask - Get volume schedule + Get volume schedule - ControlVolumeWidget + CtrlVolumePanel - - + + + + Tip Tip - - + + + + NoSelectedController Please select screen first - - + + SetVolume Set Volume - - + + GetVolume Get Volume - + + Import File + + + + + + Volume Schedule (*.vols) + + + + + Save File + Save file + + + + + SetAutoVolumeTask + Set volume schedule + + + + GetAutoVolumeTask + Get volume schedule + + + Volume Control Volume Control - + Manual Manual - + Schedule Schedule - + Volume Volume - + + Readback Readback + + + Default volume + Default volume + + + + Add + Add + + + + Clear + Clear + + + + Delete + Delete + + + + Import + Import + + + + Export + Export + + + + Volume value + Volume value + + + + Start Time + Start Time + + + + End Time + End Time + + + + SUN + SUN + + + + MON + MON + + + + TUE + TUE + + + + WED + WED + + + + THU + THU + + + + FRI + FRI + + + + SAT + SAT + + + + Apply + Apply + + + + Default volume tip + Reminder: the display screen is the default brightness outside the fixed time period + CtrlAdvancedPanel - + Advanced Advanced - + Screen Width(pixel) Screen Width(pixel) - + Width Width - - + + Height Height - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + Set Set - + Alias Alias - + Web Server Address: Web Server Address: - + www.m2mled.net - + www.ledaips.com - + https://www.taxihub.cn:2340 - + https://www.ledaips.com:2340 - + https://www.36taxi.com:2340 - + www.tlzxled.com - + MCU Uploading - + Traffic screen settings - + Setting protocol ... - + Set protocol - + Getting protocol ... - + Get protocol - - + + Port - + Realtimer Server Address: Realtimer Server Address: - + Firmware Management - + update or uninstall - + Clear Clear - + Check Apk Check Apk - + Uninstall Uninstall - + Running check Running check - + Restart Restart - + 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 - - - - - - - - + + + + + + + + Clear Program Clear Program - + www.ledokcloud.com/realtime - + Config Config - + 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 - + Min brightness Min brightness - - - + + + Readback Readback - + Send Send - + Max brightness Max brightness - - + + SetScreenSize Set Screen Size - - - - + + + + Success Success - + Compant ID: Company ID - + Compant ID Company ID - + InputWebServerAddressTip Please enter web server address - + InputCompanyIdTip Please enter company ID - + Do you want to modify webserveraddress and companyId? Are you sure you want to configure the server address and company ID? - - + + SetOnlineAddr Set Web server address - - + + ClearRealtimeServer Clear - - + + SetRealtimeServer Set realtimer address - - - - + + + + Tip Info Tip Info - - - + + + Can not find LedSet3.0.exe - - + + RestartAndroid Restart - - + + running running - - + + no running no running - + Check Apk Version Check Apk Version - - + + UninstallSoftware Uninstall - - + + Check apk running status - - + + OpenAdb Open ADB debugging function - + indentity voucher (*.ic) indentity voucher (*.ic) - - - - - + + + + + InvokeTaxiAppFunction Binding certificate - - + + AliIotSetting - + Software Version Info - + Package - + Version - - + + Package name is null - + Clearing Program - - - - + + + + Timeout Timeout - - - - + + + + Failed - + Getting Log - - - - + + + + + + - - - - - - + + + + Error Error - + Setting Timing Reboot - + Set Timing Reboot - + Getting Timing Reboot - + Get Timing Reboot - + totalResolution FPGA total resoltuion - + strCurDisplayResolution Cur display resolution - + File not exist - + Uploading - - + + Set Display Mode - - + + Get Display Mode - - + + Set Screen Offset - - + + Get Screen Offset - + Open file Failed Open file Failed - + Setting Wallpaper - - + + Set Wallpaper - + System Updating - - + + System Update - + Getting MCU Version - - + + MCU Version - + Select File Select File - + Setting player background - - + + Set player background - + Clearing player background - - - - - - - - + + + + + + + + Clear player background - + Setting Baud Rate - + Set Baud Rate - + Getting Baud Rate - + Get Baud Rate - + Text is empty - + Json Parse Error - + Json isn't an Object - + Setting card work mode ... - + Set card work mode - + Getting card work mode ... - + Get card work mode - + Resolution Config - + Full screen - + Part - + Display Mode - + Screen Position - + Offset - + Hidden Settings - + Click right button to hide - - + + Update MCU - + Get MCU Version - + Baud Config - + Model - + Uart - + Baud - - - - - - + + + + + + Get - + Timing Reboot - + Protocol - + Server - + Client - - + + SetScreenRotation Set screen rotation - - + + SetMinBrightness Set min brightness value - - + + SetMaxBrightness Set maximum brightness value - - + + GetMinBrightness Get min brightness - - + + GetMaxBrightness Get maximum brightness - - + + Card work mode - - + + SetSpecialResolution Set Special Resolution - - + + GetSpecialResolution Get Special Resolution - - + + CleanDisplayScreenSize Restore to default relolution - - + + SetHighForBusy Set level for busy - - + + GetStateForBusy Get level of busy - + InputAliasTip Please input alias - - + + SetCardAlias Set alias - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tip Tip - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + NoSelectedController Please select screen first - + InputWidthTip Please enter the correct width pixel value - + InputHeightTip Please enter the correct height pixel value - + Password is error Password is error @@ -1849,8 +1945,8 @@ - - + + Tip Tip @@ -1864,8 +1960,8 @@ - - + + NoSelectedController Please select screen first @@ -1948,49 +2044,49 @@ Get brightness - + Brightness Screen Brightness - - + + BrightnessSchedule (*.bjs) - + Import File - + Save File Save file - + BrightnessValue Brightness Value - + Start Time Start Time - + End Time End Time - - + + SetAutoBrightnessTask Send brightness schedule table - + GetAutoBrightnessTask Get brightness schedule @@ -2001,127 +2097,127 @@ Error - + Brightness Configuration Brightness configuration - + Auto Auto - + Manual Manual - + Schedule Schedule - + Adapt to Old Devices - + BrightTip1 If the maximum brightness is 64, the minimum brightness can be configured as 1% or appropriate value; if the maximum brightness is 255, the minimum brightness must be configured as 36% or above, otherwise the brightness will be low. - + BrightTip2 When uploading the file, please confirm to select the correct sensor type, otherwise it will be invalid! - + Sensitivity Sensitivity - + Minbrightness Minimum Brightness - - - + + + Set Set - + Upload Upload file - + + - - + Readback Readback - + ReadbackTable Readback - + Refresh Refresh - + Cur Brigntness Cur Brigntness - + Brightness value Brightness value - + Default brightness Default brightness - + Add Add - + Clear Clear - + Delete Delete - + Import Import - + Export Export - + Apply Apply - + Default brightness tip Tip: within the setting time is the setting brightness, and outside the setting time is the default brightness. For example, set the default brightness to 50%, set the brightness to 80%, and the time range to 8:00-17:00, then the brightness in the time range is 80%, and the default brightness in other times is 50% @@ -2129,17 +2225,17 @@ CtrlHdmiPanel - + HDMI Configuration Video source configuration - + Manual Manual - + Schedule Schedule @@ -2205,99 +2301,99 @@ - + Async Async - + Set Set - - + + Readback Readback - + Start Time Start Time - + End Time End Time - + SUN SUN - + MON MON - + TUE TUE - + WED WED - + THU THU - + FRI FRI - + SAT SAT - + Add Add - - + + Apply Apply - + Clear Clear - + Delete Delete - + Import Import - + Export Export - + By default, the asynchronous content is played, and the synchronous signal content is played in the fixed time period By default, asynchronous content is played, and synchronous hdmi-in port input content is played in a fixed time period @@ -2305,561 +2401,561 @@ CtrlNetworkPanel - + Wire Enther(RJ45) Configuration Wire Enther(RJ45) Configuration - + DHCP - + Specify IP Specify IP - + IP Address IP Address - + Gateway Gateway - + DNS Address DNS Address - - - + + + Set Set - - - - + + + + Readback Readback - + WIFI Configuration WiFi Configuration - + WiFi Mode WiFi Mode - + Cellular Config Cellular Config - + Enable Cellular Data Enable Cellular Data - + Get cellular network status information Get cellular network status information - + Through the check status button Through the "check status" button, you can automatically match the country code MCC, and then select "operator" to get the corresponding APN information. - + Country ID(mcc): Country ID(mcc): - + Carrier Name Carrier Name - + APN(Required) APN(Required) - + Flight Mode Flight Mode - + WiFi name WiFi name - - - + + + Password Password - - + + Input password Input password - + Scan Scan - + Ap Mode AP - + OFF OFF - + ON ON - + AP name AP name - + Subnet mask Subnet mask - + Input ap name Input AP name - - - - - - - - - - - - + + + + + + + + + + + + Tip Tip - - - - - - - - - - - + + + + + + + + + + + NoSelectedController Please select screen first - - + + SetEthernet Set wire nether - - - - + + + + Attention Attention - + Please input IP address! Please input IP address! - + Please input Mask address! Please input Mask address! - + Please input Gateway address! Please input Gateway address! - + Please input DNS address! Please input DNS address! - - + + GetEthernet Get wire ethernet - + DHCP IP DHCP IP - + STATIC IP STATIC IP - - + + ConfigurationWiFi Configuration WiFi - - + + IsPortableHotSpot Get AP or WiFi - + GetWifiList Scan WiFi list - - + + ConfigurationHotSpot Configuration AP HotSpot - + success success - + WifiName WifiName - + ApName Ap Name - - + + GetCurrentAPN Get Current Apn - + GetSIMStatus Get SIM Status - - + + SetAPN Set APN - + 状态: Status: - + Error Error - + 未知 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: - + Set APN Info - + User - + Type - + Server - + Port - + Proxy - + MMS Port - + MMS Proxy - - + + SetSwitchSimData SetSwitchSimData - - + + ContrFlightMode Set flight mode - - + + GetFlightModeState Readback flight mode state @@ -2867,131 +2963,131 @@ CtrlPwdPanel - + Set Password Set Password - + Original password Original password - + original password original password - - + + New password New password - + Repeat new password Repeat new password - - - - + + + + Set encryption Set encryption - + Cancel encryption Cancel encryption - + Enter again Enter again - - - - - - - - - + + + + + + + + + Tip Tip - - + + NoSelectedController Please select screen first - - + + InputOriginalPasswordTip Please input original password - + InputNewPasswordTip Please input new password - + InputRepeatPasswordTip Please input repeat password - + InputRepeatPasswordNotSameTip The two passwords are inconsistent - + Tip Info Tip Info - + After setting the password, please remember the password and record it. If you forget the password, the device will be unable to operate. Are you sure you want to continue with this operation? After setting the password, please remember the password and record it. If you forget the password, the device will be unable to operate. Are you sure you want to continue with this operation? - - - - + + + + SetControllerPassword Set password - - + + Error Error - - + + Success Success - - - + + + Modify password Modify password - - - - + + + + OriginalPasswordErrorTip The original password is wrong @@ -2999,283 +3095,283 @@ CtrlVerifyClockPanel - + Verify Clock Configuration Verify clock configuration - - + + Verify to Computer time Verify to Computer time - + Cur time of controller Cur time of controller - - + + LAN LAN - - - - - - - - - - - + + + + + + + + + + + Tip Tip - - - - - - - - - - - + + + + + + + + + + + NoSelectedController Please select screen first - + screenSwitch Switch Screen - + YES On - + NO Close - + volume Volume - + brightness brightnenss - - + + identificationCode Identification Code - - + + delaySync Time offset - - + + msec msec - - - - + + + + OtherSyncItem Other sync items - - - - + + + + lastSynchronousTime Last Synchronous Time - + checkNtpTime Synchronization interval - + Lora identity Lora identity - + (min/time) (min/time) - + identification code identification code - + Time offset(msec) Time offset(msec) - + Brightness Screen Brightness - + Volume Volume - + Screen on/off Screen On/Off - - + + Slave Slave - + NTP Server NTP Server - - + + NTP Server address NTP Server address - + TimeZone Time zone - - - - - + + + + + Set Set - + Language: Language: - + Enable Synchronous playing Enable Synchronous playing - - + + Sync time interval Sync time interval - - - - + + + + Readback Readback - - + + Master Master - + Identification Code Identification Code - - + + SetNtpServer SetNtpServer - - + + MasterSwitch Set as master device - - + + SlaveSwitch Set as slave device - + IsMasterSlave Read back the identity of master and slave - - + + GetControllerDate Get date time - - + + SetingSyncMethod Set sync method - - + + SyncTime SyncTime - - + + GetNtpServer GetNtpServer - - + + GetingSyncMethod Geting Sync Method - - + + SetTimezone Set Timezone @@ -3297,10 +3393,10 @@ - - - - + + + + Success Success @@ -3313,79 +3409,79 @@ DeviceCtrlPanel - - - - + + + + Current Screen Current screen - - + + none none - - + + Clear Clear - - + + Multi screen operation Multi screen operation - - + + selected num Selected number - + Brightness Adjustment Brightness Adj. - + Power Control Power Control - + Net Config Network Config - + Time Sync Time Sync - + Video source Video Source - + Password Password - + Advanced Advanced - + Test Test - + Volume Adj. Volume @@ -3393,352 +3489,345 @@ DeviceItem - + GetScreenDetailInfo Get more detail info - + ReadbackPic Screenshot - + + + Error + Error + + + Input password Input password - + + VerifyPassword + Verify Password + + + GetScreenshotFull readback screenshot - cur brightness: - Current Brightness: + Current Brightness: - - android version: - Android Version: + Android Version + Android Version - - IMEI: - + FPGA Version + FPGA Version: - - HardWard Version: - FPGA Version: + Brightness Level + Brightness Level: - - MAX Brightness level: - Brightness Level: + Android OS Resolution + Android OS Resolution - - Android OS Resolution: - Android OS Resolution: + Firmware Version + Firmware Version - - Firmware Version: - Firmware Version: + Player Version + Player firmware version: - - Player Version: - Player firmware version: - - - Detail Info - Detail Info + Detail Info - - - - - - - - - - - - - - - receive - Receive + Receive - - AliIotSetting - - - - - GetScreenStatus - GetScreenStatus + GetScreenStatus - - Status - Status + Status - + Tip Info Tip Info - + password is wrong password is wrong - GetBrightness - Get brightness + Get brightness - brightness - brightnenss + brightnenss - SetAutoBrightnessTask - Send brightness schedule table + Send brightness schedule table - SetAutoVolumeTask - Set volume schedule + Set volume schedule - SetVolume - Set Volume + Set Volume - GetVolume - Get Volume + Get Volume - SetTimingScreenTask - Set schedule task of screen power + Set schedule task of screen power - TestScreen - Test screen + Test screen - SetOnlineAddr - Set Web server address + Set Web server address - SetRealtimeServer - Set realtimer address + Set realtimer address - GetCurrentSensorBrightness - Get Current Brightness + Get Current Brightness - Cur brightness - Cur brightness + Cur brightness - Connect - Connect + Connect - timeout - timeout + timeout - Anycast - Anycast + Anycast - volume - Volume + Volume - Success - Success + Success - failed - failed + failed - - - - - - - - - - - - - success - success + success - - - - on + + On ON - - - - off + + Off OFF DevicePanel - - + + All ALL ALL - + Online Online Online - - + + Refresh Refresh Refresh - - - + + + Specify IP Specify IP Specify IP - + Current Screen Current screen - + none none - + + CheckSoftVersions + Get Soft Versions + + + + Current Brightness + + + + + Android Version + + + + + FPGA Version + FPGA Version + + + + Brightness Level + Brightness Level + + + + Android OS Resolution + Android OS Resolution + + + + Firmware Version + Firmware Version + + + + Player Version + + + + + Detail Info + Detail Info + + + Specify IP list - + Search Search - - + + Attention Attention - - + + Please input IP address! Please input IP address! - + Cancel Cancel - + Screen ID Screen ID - + Screen IP Screen IP - + Screen Size Screen Size - + Remark Name Alias - + readback pic Screenshot - - send - send + + On + ON - + + Off + OFF + + + send + send + + + More Info More Info - + Cur Brightness Screen Current Brightness - + Power Status Power Status - + Security encryption @@ -3747,7 +3836,7 @@ Downloader - + Updater Updater @@ -3758,8 +3847,8 @@ - - + + Downloading updates Downloading updates @@ -3775,141 +3864,141 @@ - + Stop Stop - - + + Time remaining Time remaining - + unknown unknown - + Error Error - + Cannot find downloaded update! Cannot find downloaded update! - + Close Close - + Download complete! Download complete! - + The installer will open separately The installer will open separately - + In order to install the update In order to install the update - + In order to install the update, you may need to quit the application. This is a mandatory update, exiting now will close the application In order to install the update, you may need to quit the application. This is a mandatory update, exiting now will close the application - + Tip Info Tip Info - + Click the "Open" button to apply the update Click the "Open" button to apply the update - + Are you sure you want to cancel the download? Are you sure you want to cancel the download? - + Are you sure you want to cancel the download? This is a mandatory update, exiting now will close the application Are you sure you want to cancel the download? This is a mandatory update, exiting now will close the application - - + + %1 bytes - - + + %1 KB - - + + %1 MB - + of アップデートのダウンロード - + Downloading Updates Downloading Updates - + Time Remaining Time Remaining - + Unknown Unknown - + about %1 hours about %1 hours - + about one hour about one hour - + %1 minutes %1 minutes - + 1 minute 1 minute - + %1 seconds %1 seconds - + 1 second 1 seconds @@ -3917,116 +4006,116 @@ EAClock - + Basic Properties Basic properties - + Time Zone Time Zone - + Custom Dial Custom Dial - + Select Select - + Select Dail file Select dial file - + Hour Mark Hour Scale - - + + Circular Circle - - + + Rectangle Rectangle - + Number Number - - - + + + T - + Min Mark Minute Scale - + Color - + Length - + Width Width - + Hour Hand - + Min Hand - + Sec Hand - + Show - + Text Text - + Play Properties - + Play Duration Play Duration - + s s @@ -4034,39 +4123,28 @@ EAudio - Basic Properties - Basic properties + Basic properties - File - File + File - - Play Properties - - - - Play Duration - Play Duration + Play Duration - Select File - Select File + Select File - s - s + s - Audio - Audio + Audio @@ -4446,37 +4524,37 @@ EGif - + Basic Properties Basic properties - + File File - + Select File Select File - + Play Properties - + Play Duration Play Duration - + s s - + Play Times Play Times @@ -4484,73 +4562,73 @@ EMultiWin - + Please add media on the right Please add media on the right. You can add multiple different media. The LED display will play in the order of the list - + Media List Media List - - - + + + Text Text - - - + + + Photo Photo - - - + + + Video Video - - - + + + Gif Gif - - - + + + DClock Clock - - - + + + AClock Analog Clock - - - + + + Select File Select File - - + + Environment Environmental Monitoring - - + + Timer Timer @@ -4957,54 +5035,54 @@ EVideo - + Basic Properties Basic properties - + File File - + Play Properties - + Play Duration Play Duration - + Select File Select File - + s s - + Play Times Play Times - + Video Transcoding - - + + Video Transcoding Progress - - + + Error Error @@ -5022,17 +5100,17 @@ EWeb - + Basic Properties Basic properties - + Play Duration Play Duration - + s s @@ -5063,82 +5141,82 @@ GenTmpThread - + Preparing ... Preparing ... - + MON MON - + TUE TUE - + WED WED - + THU THU - + FRI FRI - + SAT SAT - + SUN SUN - + AM AM - + PM PM - + day Days - + hour Hours - + min Mins - + sec Secs - + Create json ... Create json ... - + Scan program ... Scan program ... @@ -5146,7 +5224,7 @@ ImgDlg - + Screenshot @@ -5197,115 +5275,115 @@ MainWindow - + Language Language - + Help Help - - + + Check for updates Check for updates - - + + firmware manager Firmware management - - + + Software Config Software Config - - + + Info - - - + + + About About - - + + Setting Setting - + Software Update Software Update - + CurVersion CurVersion - + Update Update - + LatestVersion: LatestVersion: - - + + Update log: Update log: - + The current version is already the latest version The current version is already the latest version - + Device Terminals - + 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! @@ -5416,12 +5494,12 @@ Align right - + Tip Info Tip Info - + Clear all medias? @@ -5429,84 +5507,84 @@ PageListItem - + times Times - + Page name Program name - + New New - + Play times Play times - + Sources Repeat - + Audios - + Total Dur - - + + s s - + Select File Select File - + Duration - + Vol - + Valid Date Valid date - - + + Warning Warning - + Start Time can't be later than End Time - + End Time can't be earlier than Start Time - + Plan Plan @@ -5519,7 +5597,7 @@ Input password - + Change Password Change Password @@ -5527,17 +5605,17 @@ PlayWin - + Move to Top Left Move to Top Left - + Set Position - + Close Close @@ -5545,12 +5623,12 @@ PlayerBackSendThread - + Open file failed Open file failed - + Read file failed Read file failed @@ -5571,248 +5649,246 @@ ProgCreateDlg - + Resolution Resolution - + Solution Information Solution Information - + Solution Name Solution Name - + Width Width - + Height Height - + Remarks Remarks - + 每段打折宽度 (用空格分隔) Each part width (split with space) - OK - Ok + Ok - Cancel - Cancel + Cancel ProgEditorWin - + Save Save - - Save as - Save as + Save as - + Setting Setting - + Text Text - + Photo Photo - + Video Video - + Gif Gif - + Clock Clock - + Analog Clock Analog Clock - + Environment Environmental Monitoring - + Web Web page - + MuliContentWindow Multi material window - + In this window, a plurality of different program materials can be added and played according to the order of joining the list; In this window, a plurality of different program materials can be added and played according to the order of joining the list - + Timer Timer - + Play - + Stop Stop - + Publish Publish - - - - + + + Select File Select File - + program Program - + Add page Add page - + Copy page Copy page - + Delete page Delete page - - + + Tip Info Tip Info - + Are you sure you want to delete this program page? Are you sure you want to delete this program page? - + Move up Move up - + Move down Move down - + widget properties Widget properties - + Page properties Program properties - + Do you want to save the modifications? Do you want to save the modifications? - - + + Create Dir failed + + + + Saving... Saving... - - + Success Success - Save failed - Save failed + Save failed - + Convertering Convertering - + Generate preview data Generate preview data - - + + + Error Error - + Rename fail when saving - + Remove Recursively fail when saving - + Warning Warning @@ -5820,22 +5896,16 @@ ProgItem - - ExportButtonTip - USB playback + USB playback - - SendButtonTip - Publish + Publish - - Convertering - Convertering + Convertering @@ -5972,17 +6042,17 @@ ProgPortDlg - + Solution Name Solution Name - + Progress Progress - + Done Done @@ -5994,6 +6064,77 @@ Setting up the LedOK Express... Setting up the LedOK Express... + + + + Input password + Input password + + + + VerifyPassword + Verify Password + + + + + Error + Error + + + + Tip Info + Tip Info + + + + password is wrong + password is wrong + + + + + ExportButtonTip + USB playback + + + + Usb upgrade program + Usb upgrade program + + + + Password + Password + + + + + Convertering + Convertering + + + + + Tip + Tip + + + + No checked USB device + No checked USB device + + + + please select usb device in list + please select usb device in list + + + + + SendButtonTip + Publish + SendProgThread @@ -6017,73 +6158,72 @@ SendProgramDialog - - + + Publish Publish - + success info - + Refresh Refresh - Cancel - Cancel + Cancel - + Screen ID Screen ID - + Remark Name Alias - + Online Online - + Screen IP Screen IP - + Screen Size Screen Size - + Security encryption - + Progress Progress - + Remarks Remarks - + This screen is encrypted This screen is encrypted - + All ALL @@ -6134,50 +6274,40 @@ UpdateLedset3Dialog - LedSet3.0 Update - LedSet3.0 Update + LedSet3.0 Update - X - X + X - V1.0.0 - V1.0.0 + V1.0.0 - Update - Update + Update - - CurVersion - CurVersion + CurVersion - Apk is download finished from internet,you can select LED Screen SYNC firmware now! - Apk is download finished from internet,you can select LED Screen SYNC firmware now! + Apk is download finished from internet,you can select LED Screen SYNC firmware now! - LatestVersion: - LatestVersion: + LatestVersion: - Update log: - Update log: + Update log: - The current version is already the latest version,,you can select LED Screen SYNC firmware now! - The current version is already the latest version,,you can select LED Screen SYNC firmware now! + The current version is already the latest version,,you can select LED Screen SYNC firmware now! @@ -6206,268 +6336,273 @@ UpgradeApkDialog - + Update APK Update APK - + Select apk Select apk - + Upgrade Upgrade - + Uninstall Uninstall - + check running state check running state - + Select Fpga Select Fpga - + Installing - + Refresh Refresh - + Cancel Cancel - + Screen ID Screen ID - + Remark Name Alias - + Online Online - + Screen IP Screen IP - + Security encryption - + Progress Progress - + xixunplayer - + cardsystem - + taxiapp - + starter - + connection - + displayer - + FPGA FPGA - + update - + State State - - + + All ALL - + This screen is encrypted This screen is encrypted - - + + Select Online APK - + No Files - + Name Name - + Size - + Create Time - - - + + Please select a file + + + + + + Tip Tip - + Is upgrading now. Please wait - + NoSelectedController Please select screen first + - Downloading Online File - - + + Error Error - + Online file is empty - + Uploading - + Upload error - + Install error - + Install success - + Reminder - + Reminder: Uninstalling this program may cause the device to offline, cannot be found, lost configs and have a black screen. Please uninstall with caution! - + Do you want to continue? - + Uninstalling Uninstalling - + Uninstall error - + Uninstall success - + Check apk running status - + Check error - + Running Running - + Not running - + The encrypted control card can be upgraded directly The encrypted control card can be upgraded directly @@ -6475,45 +6610,36 @@ UsbDetectDialog - Usb upgrade program - Usb upgrade program + Usb upgrade program - Password - Password + Password - OK - Ok + Ok - Input password - Input password + Input password - - Tip - Tip + Tip - No checked USB device - No checked USB device + No checked USB device - please select usb device in list - please select usb device in list + please select usb device in list - Cancel - Cancel + Cancel @@ -6527,427 +6653,384 @@ X_UIMsgBoxOk - - - TextLabel - - - - - X - - - - OK - Ok + Ok - Cancel - Cancel + Cancel mGuangYingPinWidget - - + + Com Com - - + + Main Main Device - - - - + + + + PortName Port Name - - - - + + + + BaudRate BaudRate - - 1200 - 1200 + 1200 - - 2400 - 2400 + 2400 - - 4800 - 4800 + 4800 - - 9600 - 9600 + 9600 - - 19200 - 19200 + 19200 - - 38400 - 38400 + 38400 - - 57600 - 57600 + 57600 - - 115200 - 115200 + 115200 - - - - + + + + DataBit DataBit - - - + 5 5 - - - + 6 6 - - - + 7 7 - - - + 8 8 - - - - + + + + OEBit OEBit - - + + No No - - + + Even - - + + Odd - - + + Space - - + + Mark - - - - + + + + StopBit StopBit - - - + 1 1 - - - + 2 2 - - 1.5 - 1.5 + 1.5 - - + + State:Close State:Close - - - - - - - - - + + + + + + + + + Open Open - - + + Auxiliary Auxiliary - - + + Refresh Refresh - - + + Param configuration Param configuration - - + + Resend times Resend times - - + + Delay millsecond Delay millsecond - + 3 3 - + 4 4 - + 9 9 - - + + Clear Clear - - + + Debug Debug - - - + + + 10 10 - - + + Network Network - + 11 11 - + 12 12 - + 13 13 - + 14 14 - + 15 15 - + 16 16 - + 17 17 - + 18 18 - + 19 19 - + 20 20 - - + + Program number Program number - - + + Send Send - - + + Brightness Screen Brightness - - + + Set Set - - + + Screen Off Screen Off - + Screen on Screen On - - - - - - - - + + + + + + + + State:Off State:Off - + Screen On Screen On - - - - - - - - - - + + + + + + + + + + Close Close - - + + State:On State:On - - + + Tip Tip - - + + OpenPort COM failed OpenPort COM failed @@ -6993,30 +7076,30 @@ wProgramPublishItem - + Input password Input password - - - - Error - Error + + VerifyPassword + Verify Password - - + Error + Error + + + Tip Info Tip Info - Fail - Fail + Fail - + password is wrong password is wrong @@ -7024,24 +7107,20 @@ wUpgradeApkItem - Input password - Input password + Input password - Error - Error + Error - Tip Info - Tip Info + Tip Info - password is wrong - password is wrong + password is wrong diff --git a/LedOK/translations/app_ja.qm b/LedOK/translations/app_ja.qm new file mode 100644 index 0000000..f214706 Binary files /dev/null and b/LedOK/translations/app_ja.qm differ diff --git a/LedOK/translations/app_ja.ts b/LedOK/translations/app_ja.ts index 3d197b7..52022a7 100644 --- a/LedOK/translations/app_ja.ts +++ b/LedOK/translations/app_ja.ts @@ -4,61 +4,59 @@ ChangePasswordForm - + Old password 古いパスワード - + New password 新しいパスワード - + Repeat again 再び繰り返す - OK - 確定 + 確定 - Cancel - キャンセル + キャンセル - - - - - + + + + + Tip 提示 - + Please input old password 古いパスワードを入力してください - + Old password is wrong 古いパスワードが間違っている - + Please enter a password with more than 6 characters 6文字以上のパスワードを入力してください - + The new password is not consistent in two times 新しいパスワードは2回で一貫していません - + Password changed successfully パスワードが正常に変更 @@ -66,1766 +64,1427 @@ ControlPowerSchedule - Form - リフレッシュ + リフレッシュ - Edit area - 編集エリア + 編集エリア - - Add - 追加 + 追加 - - Delete - 削除 + 削除 - - Clear - クリア + クリア - - Import - インポート + インポート - - Export - 出力 + 出力 - It is power off state outside the schedule time period - 定時の時間帯にはモニターがオンになり、他の時間はオフになります + 定時の時間帯にはモニターがオンになり、他の時間はオフになります - Send command - 指令エリア + 指令エリア - - Apply - 適用 + 適用 - Clear Schedule - タイミング指令をクリア + タイミング指令をクリア - Readback - 読み戻し + 読み戻し - Power On State - スクリーンスイッチ状態 + スクリーンスイッチ状態 - Start Time - 開始時間 + 開始時間 - End Time - 終了時間 + 終了時間 - SUN - 日曜日 + 日曜日 - MON - 月曜日 + 月曜日 - TUE - 火曜日 + 火曜日 - WED - 水曜日 + 水曜日 - THU - 木曜日 + 木曜日 - FRI - 金曜日 + 金曜日 - SAT - 土曜日 + 土曜日 - - - DeviceItem OnProHttpResponse 解析json文件错误! - - - - - On - 開く + 開く - - PowerSchedule (*.pjs) - スイッチパネルタイミング(*.pjs) + スイッチパネルタイミング(*.pjs) - Save File - 保存 + 保存 - - - Tip - 提示 + 提示 - - - NoSelectedController - 先に大きいスクリーンを選んでください + 先に大きいスクリーンを選んでください - - Tip Info - ヒント + ヒント - - Clear schedule task? - スケジュールのタスクをキャンセル? + スケジュールのタスクをキャンセル? - - CleanTimingScreenTask - スケジュールのタスクをキャンセル + スケジュールのタスクをキャンセル - SetTimingScreenTask - 画面タイミングスイッチタスクの設定 + 画面タイミングスイッチタスクの設定 - - - - Success - 成功 + 成功 - - - - failed - 失敗 + 失敗 - GetTimingScreenTask - 画面タイミングスイッチタスクの取得 + 画面タイミングスイッチタスクの取得 - ControlPowerWidget + CtrlPowerPanel - - + + Off 閉じる - - + + On 開く - - - Tip - ヒント - - - - - NoSelectedController - 先に大きいスクリーンを選んでください - - - - - SetScreenOn - 画面の電源を入れる - - - - - SetScreenOff - 画面の電源を切る - - - - - IsScreenOn - スイッチ状態を読み出します - - - - Power Configuration - スイッチパネル制御 - - - - Manual - 手動 - - - - Schedule - スケジュール - - - - Power - 電源 - - - - Readback - 読み戻し - - - - ControlTestWidget - - - Form - リフレッシュ - - - - - Test Screen - テスト画面 - - - - - Line test - 線テスト - - - - - - - - - - Red - - - - - - - - - - - Green - - - - - - - - - - - Blue - - - - - - - - - - - White - - - - - - Vertical - 縦線 - - - - - Slash - 斜線 - - - - - - Horizontal - 水平線 - - - - - - - Speed - スピード - - - - - ms(>10) - ミリ秒(>10) - - - - - Line Distance - 線の間隔 - - - - px - px - - - - - - - - Test - テスト - - - - - Gradation test - グレースケールテスト - - - - - Only the gray value is displayed - 色の値のみを表示 - - - - (>10) - - - - - - GrayValue - グレースケール値 - - - - (0-255) - - - - - - Color test - カラーテスト - - - - - Gradient - グラデーション - - - - 8 - 8 - - - - 2 - 2 - - - - 3 - 3 - - - - 6 - 6 - - - - 4 - 4 - - - - 5 - 5 - - - - 1 - 1 - - - - 9 - 9 - - - - 7 - 7 - - - - 0 - 0 - - - - - Clear - クリア - - - - - Reset - ループ - - - - - - - Anycast - リクエスト - - - - - Stop - 停止 - - - - - - - - - - + + + + + Tip 提示 - - - - - + + + + + NoSelectedController 先に大きいスクリーンを選んでください - - - - StartTest - テストを開始します + + + SetScreenOn + 画面の電源を入れる - - - - - Success - 成功 + + + SetScreenOff + 画面の電源を切る - - - - - failed - 失敗 + + + IsScreenOn + スイッチ状態を読み出します - - StopTest - テストを中止します + + Import File + インポートファイル - - loopback mode - サイクルモード + + + PowerSchedule (*.pjs) + スイッチパネルタイミング(*.pjs) - - Connect timeout - 接続タイムアウト + + Save File + 保存 - - Reset loop mode - ループを設定 + + + SetTimingScreenTask + 画面タイミングスイッチタスクの設定 - - - success - 成功 + + GetTimingScreenTask + 画面タイミングスイッチタスクの取得 - - - DeviceItem OnProHttpResponse 解析json文件错误! - jsonファイルの解析エラー! + + Power Configuration + スイッチパネル制御 + + + + Manual + 手動 + + + + Schedule + スケジュール + + + + Power + 電源 + + + + + Readback + 読み戻し + + + + Start Time + 開始時間 + + + + End Time + 終了時間 + + + + SUN + 日曜日 + + + + MON + 月曜日 + + + + TUE + 火曜日 + + + + WED + 水曜日 + + + + THU + 木曜日 + + + + FRI + 金曜日 + + + + SAT + 土曜日 + + + + Add + 追加 + + + + Apply + 適用 + + + + Clear + クリア + + + + Delete + 削除 + + + + Import + インポート + + + + Export + 出力 + + + + It is power off state outside the schedule time period + 定時の時間帯にはモニターがオンになり、他の時間はオフになります + + + + Clear Schedule + タイミング指令をクリア + + + + Tip Info + ヒント + + + + Clear schedule task? + スケジュールのタスクをキャンセル? + + + + + CleanTimingScreenTask + スケジュールのタスクをキャンセル ControlVolumeSchedule - Defalut volume tip - 注意:時間帯の明るさは、定時輝度で表示されます。他の設定されていない時間帯は、デフォルトの輝度値です + 注意:時間帯の明るさは、定時輝度で表示されます。他の設定されていない時間帯は、デフォルトの輝度値です - - Add - 追加 + 追加 - - Delete - 削除 + 削除 - - Clear - クリア + クリア - Default Volume - デフォルトの音量 + デフォルトの音量 - - (0-15) - - - - - Import - インポート + インポート - - Export - 出力 + 出力 - - Apply - 適用 + 適用 - Readback - 読み戻し + 読み戻し - Volume value - 音量値 + 音量値 - Start Time - 開始時間 + 開始時間 - End Time - 終了時間 + 終了時間 - SUN - 日曜日 + 日曜日 - MON - 月曜日 + 月曜日 - TUE - 火曜日 + 火曜日 - WED - 水曜日 + 水曜日 - THU - 木曜日 + 木曜日 - FRI - 金曜日 + 金曜日 - SAT - 土曜日 + 土曜日 - Default volume tip - 注意:時間帯以外の時間表示はデフォルトの明るさです + 注意:時間帯以外の時間表示はデフォルトの明るさです - Default volume - デフォルトの音量値 + デフォルトの音量値 - - DeviceItem OnProHttpResponse 解析json文件错误! - jsonファイルの解析エラー! + jsonファイルの解析エラー! - 10 - 10 + 10 - - - Volume Schedule (*.vols) - - - - Save File - 保存 + 保存 - - Tip - 提示 + 提示 - - NoSelectedController - 先に大きいスクリーンを選んでください + 先に大きいスクリーンを選んでください - SetAutoVolumeTask - 設定タイミング音量表 + 設定タイミング音量表 - - Success - 成功 + 成功 - - failed - 失敗 + 失敗 - GetAutoVolumeTask - タイミング音量表の取得 - - - - ControlVolumeWidget - - - - Tip - ヒント - - - - - NoSelectedController - 先に大きいスクリーンを選んでください - - - - - SetVolume - 音量調節 - - - - - GetVolume - 現在の音量を取得 - - - - Volume Control - 音量調節 - - - - Manual - 手動 - - - - Schedule - スケジュール - - - - Volume - 音量 - - - - Readback - 読み戻し + タイミング音量表の取得 CtrlAdvancedPanel - + Advanced 上級パラメータ - + Screen Width(pixel) 画面幅(ピクセル) - + Width - - + + Height 高さ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + Set セット - + Alias 別名 - + Web Server Address: Webサーバのアドレス: - + www.m2mled.net - + www.ledaips.com - + https://www.taxihub.cn:2340 - + https://www.ledaips.com:2340 - + https://www.36taxi.com:2340 - + www.tlzxled.com - + MCU Uploading - + Traffic screen settings - + Setting protocol ... - + Set protocol - + Getting protocol ... - + Get protocol - - + + Port ポート - + Realtimer Server Address: Realtimerアドレス: - + Firmware Management ファームウェア管理 - + update or uninstall 更新またはアンインストール - + Clear クリア - + Check Apk APKを検出 - + Uninstall アンマウント - + Running check 運転状態モニタ - + Restart 再起動 - + Check Log ログを見る - + Start LedSet4 - + Open ADB ADBデバッグ機能を開く - + Post Custom JSON Post Custom JSON - - - - - - - - + + + + + + + + Clear Program 番組をクリア - + www.ledokcloud.com/realtime - + Config の設定 - + 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 回転 - + Min brightness 最低輝度 - - - + + + Readback 読み戻し - + Send 送信 - + Max brightness 最高輝度 - - + + SetScreenSize スクリーンのピクセルサイズを設定 - - - - + + + + Success 成功 - + Compant ID: 会社ID: - + Compant ID 会社ID - + InputWebServerAddressTip Webサーバのアドレスを入力してください - + InputCompanyIdTip 会社IDを入力してください - + Do you want to modify webserveraddress and companyId? 設定サーバアドレスと会社IDを確認しますか? - - + + SetOnlineAddr ウェブサーバのアドレスを設定 - - + + ClearRealtimeServer クリア - - + + SetRealtimeServer RealTimerアドレスを設定 - - - - + + + + Tip Info ヒント - - - + + + Can not find LedSet3.0.exe LedSet3.0.exe を見つけることができません - - + + RestartAndroid 再起動 - - + + running 実行中 - - + + no running 実行されていません - + Check Apk Version チェック APK バージョン - - + + UninstallSoftware アンマウント - - + + Check apk running status APK運転状態監視 - - + + OpenAdb ADBデバッグ機能を開く - + indentity voucher (*.ic) 身分証明書(*.ic) - - - - - + + + + + InvokeTaxiAppFunction 証明書をバインド - - + + AliIotSetting - + Software Version Info - + Package - + Version バージョン - - + + Package name is null パッケージ名は空です - + Clearing Program プログラムクリア - - - - + + + + Timeout タイムアウト - - - - + + + + Failed 失敗 - + Getting Log ログを取得中 - - - - + + + + + + - - - - - - + + + + Error エラー - + Setting Timing Reboot スケジュール再起動を設定中 - + Set Timing Reboot スケジュール再起動の設定 - + Getting Timing Reboot スケジュール再起動を取得中 - + Get Timing Reboot スケジュール再起動の取得 - + totalResolution トータル解像度 - + strCurDisplayResolution 表示解像度 - + File not exist ファイルが存在しません - + Uploading アップロード中 - - + + Set Display Mode - - + + Get Display Mode - - + + Set Screen Offset - - + + Get Screen Offset - + Open file Failed ファイルのオープンに失敗しました - + Setting Wallpaper - - + + Set Wallpaper - + System Updating - - + + System Update - + Getting MCU Version - - + + MCU Version - + Select File ファイルを選択 - + Setting player background - - + + Set player background - + Clearing player background - - - - - - - - + + + + + + + + Clear player background - + Setting Baud Rate - + Set Baud Rate - + Getting Baud Rate - + Get Baud Rate - + Text is empty - + Json Parse Error - + Json isn't an Object - + Setting card work mode ... - + Set card work mode - + Getting card work mode ... - + Get card work mode - + Resolution Config 解像度設定 - + Full screen フルスクリーン - + Part セクション - + Display Mode 表示モード - + Screen Position - + Offset - + Hidden Settings - + Click right button to hide - - + + Update MCU - + Get MCU Version - + Baud Config - + Model - + Uart - + Baud - - - - - - + + + + + + Get 得る - + Timing Reboot スケジュール再起動 - + Protocol プロトコル - + Server サービス - + Client クライアント - - + + SetScreenRotation 画面の回転を設定する - - + + SetMinBrightness 最小輝度値を設定します - - + + SetMaxBrightness 輝度最大値を設定 - - + + GetMinBrightness 輝度最小値を取得 - - + + GetMaxBrightness 輝度最大値を取得 - - + + Card work mode - - + + SetSpecialResolution 解像度を設定 - - + + GetSpecialResolution 読み込み解像度 - - + + CleanDisplayScreenSize デフォルトの解像度を復元 - - + + SetHighForBusy 客レベルの設定 - - + + GetStateForBusy ゲストレベルを取得 - + InputAliasTip エイリアスを入力してください - - + + SetCardAlias エイリアスの設定 - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tip 提示 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + NoSelectedController 先に大きいスクリーンを選んでください - + InputWidthTip 正しい幅のピクセル値を入力してください - + InputHeightTip 正しい高さのピクセル値を入力してください - + Password is error パスワード @@ -1849,8 +1508,8 @@ - - + + Tip 提示 @@ -1864,8 +1523,8 @@ - - + + NoSelectedController 先に大きいスクリーンを選んでください @@ -1948,49 +1607,49 @@ 輝度値を取得 - + Brightness スクリーン輝度 - + Import File インポートファイル - - + + BrightnessSchedule (*.bjs) - + Save File 保存 - + BrightnessValue 輝度値 - + Start Time 開始時間 - + End Time 終了時間 - - + + SetAutoBrightnessTask 送信タイミング輝度表 - + GetAutoBrightnessTask 取得タイミング輝度表 @@ -2001,127 +1660,127 @@ エラー - + Brightness Configuration 輝度の設定 - + Auto 自動 - + Manual 手動 - + Schedule スケジュール - + Adapt to Old Devices 古い設備に適合する - + BrightTip1 最大輝度が64であるならば、最小の明るさは1%または適切な値として構成されることができます;最大の明るさが255であるならば、最小の明るさは36%かそれ以上として構成されなければなりません、さもなければ、明るさは低くなります。 - + BrightTip2 ファイルをアップロードする時、正しいセンサータイプを選択してください。でないと、無効です。 - + Sensitivity 感度 - + Minbrightness 最小輝度 - - - + + + Set セット - + Upload ファイルのアップロード - + + - - + Readback 読み戻し - + ReadbackTable 読み戻し - + Refresh 更新 - + Cur Brigntness カールの明るさ - + Brightness value 輝度値 - + Default brightness 標準の明るさ - + Add 追加 - + Clear クリア - + Delete 削除 - + Import インポート - + Export 出力 - + Apply 適用 - + Default brightness tip ヒント:この設定時間内は明るさを設定し、設定時間外はデフォルトの明るさとなります。例えば、デフォルトの輝度を50%とし、設定輝度は80%とし、時間範囲は8:00〜17:00とすると、時間範囲は80%となり、他の時間はデフォルトの輝度50%となる。 @@ -2129,17 +1788,17 @@ CtrlHdmiPanel - + HDMI Configuration ビデオソースの設定 - + Manual 手動 - + Schedule スケジュール @@ -2205,99 +1864,99 @@ - + Async アシュリン - + Set セット - - + + Readback 読み戻し - + Start Time 開始時間 - + End Time 終了時間 - + SUN 日曜日 - + MON 月曜日 - + TUE 火曜日 - + WED 水曜日 - + THU 木曜日 - + FRI 金曜日 - + SAT 土曜日 - + Add 追加 - - + + Apply 適用 - + Clear クリア - + Delete 削除 - + Import インポート - + Export 出力 - + By default, the asynchronous content is played, and the synchronous signal content is played in the fixed time period 非同期のコンテンツをデフォルトで再生し、同期のHMI-INポートに入力します @@ -2305,561 +1964,561 @@ CtrlNetworkPanel - + Wire Enther(RJ45) Configuration 有線ネットワークの設定 - + DHCP - + Specify IP 指定IP - + IP Address IPアドレス - + Gateway ゲートウェイ - + DNS Address DNSアドレス - - - + + + Set セット - - - - + + + + Readback 読み戻し - + WIFI Configuration WiFiの設定 - + WiFi Mode WiFi機能 - + Cellular Config セルラーデータ構成 - + Enable Cellular Data セルラーデータを有効にする - + Get cellular network status information セルラーネットワーク状態情報を取得する - + Through the check status button 「ステータスを取得」ボタンを使用すると、国コードに自動的に一致し、対応するAPN情報を取得するには「事業者」を選択します。 - + Set APN Info APN情報を設定する - + Country ID(mcc): 国号(mcc): - + Carrier Name 運営者 - + APN(Required) APN(必ず記入) - + Flight Mode 飛行モード - + WiFi name WiFiの名前 - - - + + + Password パスワード - - + + Input password パスワードを入力 - + Scan スキャン - + Ap Mode APエネルギー - + OFF オフ - + ON オン - + AP name AP名 - + Subnet mask サブネットマスク - + Input ap name APの名前を入力 - - - - - - - - - - - - + + + + + + + + + + + + Tip 提示 - - - - - - - - - - - + + + + + + + + + + + NoSelectedController 先に大きいスクリーンを選んでください - - + + SetEthernet 有線網を設置する - - - - + + + + Attention 注意 - + Please input IP address! IPアドレスを入力してください! - + Please input Mask address! サブネットマスクの住所を入力してください! - + Please input Gateway address! ゲートウェイのアドレスを入力してください! - + Please input DNS address! DNSアドレスを入力してください! - - + + GetEthernet 有線ネットワークの設定を取得 - + DHCP IP DHCP IP - + STATIC IP 静的IP - - + + ConfigurationWiFi WiFiの設定 - - + + IsPortableHotSpot ホットスポットとWiFiモードの取得 - + GetWifiList スキャンWiFi - - + + ConfigurationHotSpot ホットスポットの設定 - + success 成功 - + WifiName Wifiの名前 - + ApName AP名前 - - + + GetCurrentAPN APN情報の取得 - + GetSIMStatus SIM状態を取得 - - + + SetAPN APNの設定 - + 状态: 状態: - + Error エラー - + 未知 不明 - + 锁定状态,需要用户的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 いいえ - + 数据连接状态: データ接続状態: - + 断开 切断 - + 正在连接 接続中 - + 已连接 接続済み - + 暂停 一時停止 - + 数据活动休眠状态: データアクティビティの休止状態: - + 活动,但无数据发送和接收 アクティブですが、データ送信と受信はありません - + 活动,正在接收数据 アクティブ、データ受信中 - + 活动,正在发送数据 イベント、データ送信中 - + 活动,正在接收和发送数据 イベント、データ受信と送信中 - + 休眠状态 スリープ状態 - + 信号强度: 信号の強度: - + User ユーザー - + Type タイプ - + Server サービス - + Port ポート - + Proxy プロキシ - + MMS Port MMS ポート - + MMS Proxy MMS プロキシ - - + + SetSwitchSimData 4G/5Gスイッチの設定 - - + + ContrFlightMode 飛行モードの設定 - - + + GetFlightModeState 飛行モード状態を取得 @@ -2867,419 +2526,856 @@ CtrlPwdPanel - + Set Password パスワードの設定 - + Original password 元のパスワード - + original password 元のパスワード - - + + New password 新しいパスワード - + Repeat new password 繰り返し入力 - - - - + + + + Set encryption 暗号化 - + Cancel encryption 暗号化を解除 - + Enter again 再入力 - - - - - - - - - + + + + + + + + + Tip 提示 - - + + NoSelectedController 先に大きいスクリーンを選んでください - - + + InputOriginalPasswordTip オリジナルのパスワードを入力してください - + InputNewPasswordTip 新しいパスワードを入力してください - + InputRepeatPasswordTip 新しいパスワードを繰り返して入力してください - + InputRepeatPasswordNotSameTip 二回入力したパスワードが一致しません - + Tip Info ヒント - + After setting the password, please remember the password and record it. If you forget the password, the device will be unable to operate. Are you sure you want to continue with this operation? パスワードを設定した後、パスワードを覚えて、それを記録してください。パスワードを忘れた場合は、デバイスが動作することができなくなります。この操作を続行しますか? - - - - + + + + SetControllerPassword 暗号化の設定 - - + + Error エラー - - + + Success 成功 - - - + + + Modify password パスワードを変更 - - - - + + + + OriginalPasswordErrorTip 元のパスワードが間違っています - CtrlVerifyClockPanel + CtrlTestPanel - - Verify Clock Configuration - 検証クロック設定 + + Test Screen + テスト画面 - - - Verify to Computer time - コンピュータ時刻の確認 + + Line test + 線テスト - - Cur time of controller - ディスプレイの現在の時間 + + + + + Red + - - - LAN - LAN + + + + + Green + - - - - - - - - - - - + + + + + Blue + + + + + + + + White + + + + + Vertical + 縦線 + + + + Slash + 斜線 + + + + + Horizontal + 水平線 + + + + + Speed + スピード + + + + ms(>10) + ミリ秒(>10) + + + + Line Distance + 線の間隔 + + + px + px + + + + + + Test + テスト + + + + Gradation test + グレースケールテスト + + + + Only the gray value is displayed + 色の値のみを表示 + + + + GrayValue + グレースケール値 + + + + Color test + カラーテスト + + + + Gradient + グラデーション + + + 8 + 8 + + + 2 + 2 + + + 3 + 3 + + + 6 + 6 + + + 4 + 4 + + + 5 + 5 + + + 1 + 1 + + + 9 + 9 + + + 7 + 7 + + + 0 + 0 + + + + Clear + クリア + + + + Reset + ループ + + + + + + + Anycast + リクエスト + + + + Stop + 停止 + + + + + + + + + + Tip - ヒント + 提示 - - - - - - - - - - - + + + + + + NoSelectedController 先に大きいスクリーンを選んでください - + + + + + + + StartTest + テストを開始します + + + Success + 成功 + + + failed + 失敗 + + + + + StopTest + テストを中止します + + + + loopback mode + サイクルモード + + + + Connect timeout + 接続タイムアウト + + + + + receive + 受信 + + + + Connect + 接続 + + + + timeout + タイムアウト + + + + Reset loop mode + ループを設定 + + + + + success + 成功 + + + DeviceItem OnProHttpResponse 解析json文件错误! + jsonファイルの解析エラー! + + + + CtrlVerifyClockPanel + + + Verify Clock Configuration + 検証クロック設定 + + + + + Verify to Computer time + コンピュータ時刻の確認 + + + + Cur time of controller + ディスプレイの現在の時間 + + + + + LAN + LAN + + + + + + + + + + + + + + Tip + 提示 + + + + + + + + + + + + + + NoSelectedController + 先に大きいスクリーンを選んでください + + + screenSwitch スクリーンの切り替え - + YES 開く - + NO オフ - + volume 音量 - + brightness 明るさ - - + + identificationCode 識別コード - - + + delaySync 時間オフセット - - + + msec ミリ秒 - - - - + + + + OtherSyncItem その他の同期項目 - - - - + + + + lastSynchronousTime 最終同期時間 - + checkNtpTime 同期間隔 - + Lora identity ロラの身分 - + (min/time) (分/回) - + identification code 識別コード - + Time offset(msec) タイム・オフセット( msec ) - + Brightness スクリーン輝度 - + Volume 体積 - + Screen on/off スクリーンスイッチ - - + + Slave から - + NTP Server NTPサーバ - - + + NTP Server address NTPサーバのアドレス - + TimeZone タイムゾーン - - - - - + + + + + Set セット - + Language: 言語: - + Enable Synchronous playing 画面を同期させる機能 - - + + Sync time interval 同期時間間隔 - - - - + + + + Readback 読み戻し - - + + Master - + Identification Code 識別コード - - + + SetNtpServer NTPサービスの設定 - - + + MasterSwitch メインデバイスの設定 - - + + SlaveSwitch スレーブデバイスとして設定 - + IsMasterSlave 主従の身分を読み返す - - + + GetControllerDate 日付時間の取得 - - + + SetingSyncMethod set syncメソッド - - + + SyncTime キャリブレーション時間 - - + + GetNtpServer NTPサービス情報を取得する - - + + GetingSyncMethod 同期方式を取得 - - + + SetTimezone タイムゾーンを設定 + + CtrlVolumePanel + + + + + + Tip + 提示 + + + + + + + NoSelectedController + 先に大きいスクリーンを選んでください + + + + + SetVolume + 音量調節 + + + + + GetVolume + 現在の音量を取得 + + + + Import File + インポートファイル + + + + + Volume Schedule (*.vols) + + + + + Save File + 保存 + + + + + SetAutoVolumeTask + 設定タイミング音量表 + + + + GetAutoVolumeTask + タイミング音量表の取得 + + + + Volume Control + 音量調節 + + + + Manual + 手動 + + + + Schedule + スケジュール + + + + Volume + 音量 + + + + + Readback + 読み戻し + + + + Default volume + デフォルトの音量値 + + + + Add + 追加 + + + + Clear + クリア + + + + Delete + 削除 + + + + Import + インポート + + + + Export + 出力 + + + + Volume value + 音量値 + + + + Start Time + 開始時間 + + + + End Time + 終了時間 + + + + SUN + 日曜日 + + + + MON + 月曜日 + + + + TUE + 火曜日 + + + + WED + 水曜日 + + + + THU + 木曜日 + + + + FRI + 金曜日 + + + + SAT + 土曜日 + + + + Apply + 適用 + + + + Default volume tip + 注意:時間帯以外の時間表示はデフォルトの明るさです + + Def @@ -3297,10 +3393,10 @@ デバイス応答 - - - - + + + + Success 成功 @@ -3313,79 +3409,79 @@ DeviceCtrlPanel - - - - + + + + Current Screen 現在のスクリーン - - + + none なし - - + + Clear クリア - - + + Multi screen operation マルチスクリーン操作 - - + + selected num 選択された数 - + Brightness Adjustment 輝度設定 - + Power Control 電源コントロール - + Net Config ネット配置 - + Time Sync タイマ配置 - + Video source ビデオソース - + Password ひそかに言う - + Advanced 上級パラメータ - + Test テスト - + Volume Adj. 音量調節 @@ -3393,351 +3489,344 @@ DeviceItem - + GetScreenDetailInfo 詳細 - + ReadbackPic 回読画面 - + + + Error + エラー + + + Input password パスワードを入力 - + + VerifyPassword + パスワードの検証 + + + GetScreenshotFull 回読画面 - cur brightness: - 現在の明るさ: + 現在の明るさ: - - android version: - Androidバージョン: + Android Version + Androidバージョン: - - IMEI: - + FPGA Version + FPGAバージョン: - - HardWard Version: - FPGAバージョン: + Brightness Level + 輝度レベル: - - MAX Brightness level: - 輝度レベル: + Android OS Resolution + Androidの解像度: - - Android OS Resolution: - Androidの解像度: + Firmware Version + ファームウェアバージョン: - - Firmware Version: - ファームウェアバージョン: + Player Version + プレーヤーファームウェアバージョン: - - Player Version: - プレーヤーファームウェアバージョン: - - - Detail Info - 詳細 + 詳細 - - - - - - - - - - - - - - - receive - 受信 + 受信 - - AliIotSetting - - - - - GetScreenStatus - スクリーン状態を取得 + スクリーン状態を取得 - - Status - 状態 + 状態 - + Tip Info ヒント - + password is wrong - パスワードが間違っている + パスワードエラー - GetBrightness - 輝度値を取得 + 輝度値を取得 - brightness - 明るさ + 明るさ - SetAutoBrightnessTask - 送信タイミング輝度表 + 送信タイミング輝度表 - SetAutoVolumeTask - 設定タイミング音量表 + 設定タイミング音量表 - SetVolume - 音量調節 + 音量調節 - GetVolume - 現在の音量を取得 + 現在の音量を取得 - SetTimingScreenTask - 画面タイミングスイッチタスクの設定 + 画面タイミングスイッチタスクの設定 - TestScreen - テスト画面 + テスト画面 - SetOnlineAddr - ウェブサーバのアドレスを設定 + ウェブサーバのアドレスを設定 - SetRealtimeServer - RealTimerアドレスを設定 + RealTimerアドレスを設定 - GetCurrentSensorBrightness - 現在の明るさを取得する + 現在の明るさを取得する - Cur brightness - カールの明るさ + カールの明るさ - Connect - 接続 + 接続 - timeout - タイムアウト + タイムアウト - Anycast - リクエスト + リクエスト - volume - 音量 + 音量 - Success - 成功 + 成功 - failed - 失敗 + 失敗 - - - - - - - - - - - - - success - 成功 + 成功 - - - - on + + On オン - - - - off + + Off オフ DevicePanel - - + + All トータル トータル - + Online オンライン中 - - + + Refresh 更新 更新 - - - + + + Specify IP 指定IP 指定IP - + Current Screen 現在のスクリーン - + none なし - + + CheckSoftVersions + ソフトウェアバージョンの取得 + + + + Current Brightness + 現在の明るさ + + + + Android Version + Androidバージョン + + + + FPGA Version + FPGAバージョン + + + + Brightness Level + 輝度レベル + + + + Android OS Resolution + Androidの解像度 + + + + Firmware Version + ファームウェアバージョン + + + + Player Version + プレーヤーファームウェアバージョン + + + + Detail Info + 詳細 + + + Specify IP list 指定 IP リスト - + Search 検索 - - + + Attention 注意 - - + + Please input IP address! IPアドレスを入力してください! - + Cancel キャンセル - + Screen ID ターミナルID - + Screen IP ターミナルIP - + Screen Size スクリーンサイズ - + Remark Name 別名 - + readback pic 読み戻し - - send - 送信 + + On + オン - + + Off + オフ + + + send + 送信 + + + More Info 詳細 - + Cur Brightness 現在の画面の明るさ - + Power Status 画面切り替えステータス - + Security 暗号化 @@ -3746,7 +3835,7 @@ Downloader - + Updater 更新 @@ -3757,8 +3846,8 @@ - - + + Downloading updates 更新をダウンロード @@ -3774,141 +3863,141 @@ - + Stop 停止 - - + + Time remaining 残り時間 - + unknown 不明 - + Error エラー - + Cannot find downloaded update! ダウンロードされたアップデートを見つけることができません! - + Close 確定 - + Download complete! ダウンロード完了! - + The installer will open separately インストーラは別々に開きます - + In order to install the update 更新をインストール - + In order to install the update, you may need to quit the application. This is a mandatory update, exiting now will close the application 更新をインストールするには、アプリケーションを終了する必要があります。これは必須の更新プログラムは、今すぐ終了アプリケーションが終了します - + Tip Info ヒント - + Click the "Open" button to apply the update ボタンをクリックして更新を適用します - + Are you sure you want to cancel the download? あなたは確かにダウンロードをキャンセルしたいですか? - + Are you sure you want to cancel the download? This is a mandatory update, exiting now will close the application あなたは確かにダウンロードをキャンセルしたいですか?これは必須の更新プログラムは、今すぐ終了アプリケーションが終了します - - + + %1 bytes - - + + %1 KB - - + + %1 MB - + of ,総サイズ - + Downloading Updates アップデートのダウンロード - + Time Remaining 残り時間 - + Unknown 不明 - + about %1 hours 約%1時間 - + about one hour 約1時間 - + %1 minutes %1 分 - + 1 minute 1 分 - + %1 seconds %1 秒 - + 1 second 1 秒 @@ -3916,116 +4005,116 @@ EAClock - + Basic Properties 基本的な属性 - + Time Zone タイムゾーン - + Custom Dial ユーザー定義の文字盤 - + Select 選択 - + Select Dail file 文字盤の画像を選択 - + Hour Mark 時間目盛り - - + + Circular 円形 - - + + Rectangle 矩形 - + Number デジタル - - - + + + T - + Min Mark 分目盛り - + Color カラー - + Length 長さ - + Width - + Hour Hand 時針 - + Min Hand 分針 - + Sec Hand 秒針 - + Show 表示 - + Text テキスト - + Play Properties 再生方法 - + Play Duration 再生時間 - + s @@ -4033,39 +4122,32 @@ EAudio - Basic Properties - 基本的な属性 + 基本的な属性 - File - ファイル + ファイル - Play Properties - 再生方法 + 再生方法 - Play Duration - 再生時間 + 再生時間 - Select File - ファイルを選択 + ファイルを選択 - s - + - Audio - オーディオ + オーディオ @@ -4445,37 +4527,37 @@ EGif - + Basic Properties 基本的な属性 - + File ファイル - + Select File ファイルを選択 - + Play Properties 再生方法 - + Play Duration 再生時間 - + s - + Play Times 再生回数 @@ -4483,73 +4565,73 @@ EMultiWin - + Please add media on the right 右側にメディアを追加してください。複数のメディアに参加できます。LEDディスプレイはリスト順に再生されます - + Media List メディアリスト - - - + + + Text テキスト - - - + + + Photo 写真 - - - + + + Video 動画リスト - - - + + + Gif アニメーション - - - + + + DClock デジタル時計 - - - + + + AClock アナログ時計 - - - + + + Select File ファイルを選択 - - + + Environment 環境モニタリング - - + + Timer タイマー @@ -4956,54 +5038,54 @@ EVideo - + Basic Properties 基本的な属性 - + File ファイル - + Play Properties 再生方法 - + Play Duration 再生時間 - + Select File ファイルを選択 - + s - + Play Times 再生回数 - + Video Transcoding - - + + Video Transcoding Progress ビデオ変換の進歩 - - + + Error エラー @@ -5021,17 +5103,17 @@ EWeb - + Basic Properties 基本的な属性 - + Play Duration 再生時間 - + s @@ -5062,82 +5144,82 @@ GenTmpThread - + Preparing ... 準備... - + MON 月曜日 - + TUE 火曜日 - + WED 水曜日 - + THU 木曜日 - + FRI 金曜日 - + SAT 土曜日 - + SUN 日曜日 - + AM 午前 - + PM 午後 - + day - + hour - + min - + sec - + Create json ... クリエイトjson... - + Scan program ... スキャン番組… @@ -5145,7 +5227,7 @@ ImgDlg - + Screenshot スクリーンショット @@ -5196,115 +5278,115 @@ MainWindow - + Language 言語 - + Help ヘルプ - - + + Check for updates アップデートをチェック - - + + firmware manager ファームウェア管理 - - + + Software Config ソフトウェアの設定 - - + + Info 情報 - - - + + + About 当ソフトウェアについて - - + + Setting 設置 - + Software Update ソフトウェアの更新 - + CurVersion 現在のバージョン - + Update 更新 - + LatestVersion: 最新バージョン: - - + + Update log: 更新ログ: - + The current version is already the latest version すでに最新バージョンです。 - + Device 端末管理 - + Program コンテンツ管理 - + Control ターミナルコントロール - + GuangYinPin スクリーン - + Check card ワンタッチ修復 - + Tip Info ヒント - + RestoreLedCardIpByUdpTip この操作はLAN内のすべてのコンピュータIPと同じセグメントにないコントロールカードを固定IPに修正します。慎重に操作してください。 @@ -5415,12 +5497,12 @@ 横位置 右詰め - + Tip Info ヒント - + Clear all medias? @@ -5428,84 +5510,84 @@ PageListItem - + times - + Page name プログラム名 - + New 新規 - + Play times 再生回数 - + Sources Repeat ソースの繰り返し - + Audios オーディオ - + Total Dur 全期間 - - + + s - + Select File ファイルを選択 - + Duration 期間 - + Vol 音量 - + Valid Date 有効期間 - - + + Warning 警告 - + Start Time can't be later than End Time 開始時間は終了時間より後にようにしてください - + End Time can't be earlier than Start Time 終了時間は開始時間より遅いようにしてください - + Plan タイムスケジュール @@ -5518,7 +5600,7 @@ パスワードを入力 - + Change Password パスワード変更 @@ -5526,17 +5608,17 @@ PlayWin - + Move to Top Left 左上隅に移動 - + Set Position 設定位置 - + Close 閉じる @@ -5544,12 +5626,12 @@ PlayerBackSendThread - + Open file failed ファイルのオープンに失敗しました - + Read file failed ファイルの読み込みに失敗しました @@ -5570,248 +5652,246 @@ ProgCreateDlg - + Resolution 解像度 - + Solution Information スケジュール情報 - + Solution Name リスト名 - + Width - + Height 高さ - + Remarks 備考 - + 每段打折宽度 (用空格分隔) - + - OK - 確定 + 確定 - Cancel - キャンセル + キャンセル ProgEditorWin - + Save 保存 - - Save as - 名前を付けて保存 + 名前を付けて保存 - + Setting 設置 - + Text テキスト - + Photo 写真 - + Video ビデオ - + Gif アニメーション - + Clock デジタル時計 - + Analog Clock アナログ時計 - + Environment 環境モニタリング - + Web ウェブページ - + MuliContentWindow マルチ素材ウィンドウ - + In this window, a plurality of different program materials can be added and played according to the order of joining the list; このウィンドウには、複数の異なる番組素材を追加して、リストに追加した順に再生することができます - + Timer タイマー - + Play 再生 - + Stop 停止 - + Publish 転送 - - - - + + + Select File ファイルを選択 - + program 番組リスト - + Add page ページを追加 - + Copy page コピーページ - + Delete page ページを削除 - - + + Tip Info ヒント - + Are you sure you want to delete this program page? 本当にこの番組ページを削除しますか? - + Move up 前へ - + Move down 次頁 - + widget properties パッケージプロパティ - + Page properties プログラムのプロパティ - + Do you want to save the modifications? 変更された内容を保存してもよろしいですか? - - + + Create Dir failed + ディレクトリの作成に失敗しました + + + Saving... 保存中、少々お待ちください... - - + Success 成功 - Save failed - 保存に失敗 + 保存に失敗 - + Convertering データを整理する - + Generate preview data プレビューデータの生成 - - + + + Error エラー - + Rename fail when saving - + Remove Recursively fail when saving - + Warning 警告 @@ -5819,22 +5899,16 @@ ProgItem - - ExportButtonTip - USBメモリで再生する + USBメモリで再生する - - SendButtonTip - 転送 + 転送 - - Convertering - データを整理する + データを整理する @@ -5898,7 +5972,7 @@ Tip - ヒント + 提示 @@ -5971,17 +6045,17 @@ ProgPortDlg - + Solution Name リスト名 - + Progress 程度 - + Done 完了 @@ -5993,6 +6067,77 @@ Setting up the LedOK Express... 初期化LedOK Express… + + + + Input password + パスワードを入力 + + + + VerifyPassword + パスワードの検証 + + + + + Error + エラー + + + + Tip Info + ヒント + + + + password is wrong + パスワードエラー + + + + + ExportButtonTip + USBメモリで再生する + + + + Usb upgrade program + Uディスク更新プログラム + + + + Password + パスワード + + + + + Convertering + データを整理する + + + + + Tip + 提示 + + + + No checked USB device + チェックUSBデバイス + + + + please select usb device in list + リスト内のUSBデバイスを選択してください + + + + + SendButtonTip + 転送 + SendProgThread @@ -6016,73 +6161,72 @@ SendProgramDialog - - + + Publish 転送 - + success info - + Refresh 更新 - Cancel - キャンセル + キャンセル - + Screen ID ターミナルID - + Remark Name 別名 - + Online オンライン中 - + Screen IP ターミナルIP - + Screen Size スクリーンサイズ - + Security 暗号化 - + Progress 程度 - + Remarks 備考 - + This screen is encrypted スクリーンは暗号化されています - + All トータル @@ -6133,50 +6277,40 @@ UpdateLedset3Dialog - LedSet3.0 Update - LedSet 3.0更新 + LedSet 3.0更新 - X - X + X - V1.0.0 - V1.0.0 + V1.0.0 - Update - 更新 + 更新 - - CurVersion - 現在のバージョン + 現在のバージョン - Apk is download finished from internet,you can select LED Screen SYNC firmware now! - APKはインターネットからダウンロードして、あなたは現在、画面の同期ファームウェアを選択することができます! + APKはインターネットからダウンロードして、あなたは現在、画面の同期ファームウェアを選択することができます! - LatestVersion: - 最新バージョン: + 最新バージョン: - Update log: - 更新ログ: + 更新ログ: - The current version is already the latest version,,you can select LED Screen SYNC firmware now! - 現在のバージョンはすでに最新バージョンです、あなたは現在、LEDスクリーン同期ファームウェアを選ぶことができます! + 現在のバージョンはすでに最新バージョンです、あなたは現在、LEDスクリーン同期ファームウェアを選ぶことができます! @@ -6205,268 +6339,273 @@ UpgradeApkDialog - + Update APK 更新APK - + Select apk Appパッケージを選択 - + Upgrade アップグレード - + Uninstall アンマウント - + check running state 運転状態を検出 - + Select Fpga FPGAファイルを選択 - + Installing インストール中 - + Refresh 更新 - + Cancel キャンセル - + Screen ID ターミナルID - + Remark Name 別名 - + Online オンライン中 - + Screen IP ターミナルIP - + Security 暗号化 - + Progress 程度 - + xixunplayer - + cardsystem - + taxiapp - + starter - + connection - + displayer - + FPGA FPGA - + update - + State 状態 - - + + All トータル - + This screen is encrypted スクリーンは暗号化されています - - + + Select Online APK オンラインAPKを選択 - + No Files ファイルがありません - + Name 名前 - + Size サイズ - + Create Time 作成時間 - - - - Tip - ヒント + + Please select a file + ファイルを選択してください - + + + + Tip + 提示 + + + Is upgrading now. Please wait 更新中です、しばらくお待ちください - + NoSelectedController 先に大きいスクリーンを選んでください + - Downloading Online File オンラインファイルをダウンロード中 - - + + Error エラー - + Online file is empty オンラインファイルが空です - + Uploading アップロード中 - + Upload error アップロード エラー - + Install error インストール エラー - + Install success インストールに成功しました - + Reminder ヒント - + Reminder: Uninstalling this program may cause the device to offline, cannot be found, lost configs and have a black screen. Please uninstall with caution! ヒント:このプログラムをアンインストールすると、プラットフォームがオフラインになり、デバイスが見つかりません。構成パラメータが失われ、黒画面の問題が発生します。慎重にアンインストールしてください。 - + Do you want to continue? 続行しますか? - + Uninstalling アンマウント中 - + Uninstall error アンインストール エラー - + Uninstall success アンインストールに成功しました - + Check apk running status APK運転状態監視 - + Check error チェック エラー - + Running 実行中 - + Not running 実行されていません - + The encrypted control card can be upgraded directly 暗号化されたコントロールカードを直接アップグレードすることができます @@ -6474,45 +6613,32 @@ UsbDetectDialog - Usb upgrade program - Uディスク更新プログラム + Uディスク更新プログラム - Password - パスワード + パスワード - OK - 確定 + 確定 - Input password - パスワードを入力 + パスワードを入力 - - - Tip - 提示 - - - No checked USB device - チェックUSBデバイス + チェックUSBデバイス - please select usb device in list - リスト内のUSBデバイスを選択してください + リスト内のUSBデバイスを選択してください - Cancel - キャンセル + キャンセル @@ -6526,427 +6652,384 @@ X_UIMsgBoxOk - - - TextLabel - - - - - X - - - - OK - 確定 + 確定 - Cancel - キャンセル + キャンセル mGuangYingPinWidget - - + + Com シリアル - - + + Main メインデバイス - - - - + + + + PortName シリアル名 - - - - + + + + BaudRate ポートレート - - 1200 - 1200 + 1200 - - 2400 - 2400 + 2400 - - 4800 - 4800 + 4800 - - 9600 - 9600 + 9600 - - 19200 - 19200 + 19200 - - 38400 - 38400 + 38400 - - 57600 - 57600 + 57600 - - 115200 - 115200 + 115200 - - - - + + + + DataBit データビット - - - + 5 5 - - - + 6 6 - - - + 7 7 - - - + 8 8 - - - - + + + + OEBit ビットを検証 - - + + No いいえ - - + + Even - - + + Odd - - + + Space - - + + Mark - - - - + + + + StopBit ストップビット - - - + 1 1 - - - + 2 2 - - 1.5 - 1.5 + 1.5 - - + + State:Close 状態:接続 - - - - - - - - - + + + + + + + + + Open オープン - - + + Auxiliary 副設備 - - + + Refresh 更新 - - + + Param configuration パラメータ設定 - - + + Resend times 再送回数 - - + + Delay millsecond 遅延(マイクロ秒) - + 3 3 - + 4 4 - + 9 9 - - + + Clear クリア - - + + Debug デバッグ - - - + + + 10 10 - - + + Network ネットワーク - + 11 11 - + 12 12 - + 13 13 - + 14 14 - + 15 15 - + 16 16 - + 17 17 - + 18 18 - + 19 19 - + 20 20 - - + + Program number 番組番号 - - + + Send 送信 - - + + Brightness スクリーン輝度 - - + + Set セット - - + + Screen Off スクリーンオフ - + Screen on 気絶する - - - - - - - - + + + + + + + + State:Off 状態:切断 - + Screen On 気絶する - - - - - - - - - - + + + + + + + + + + Close 閉じる - - + + State:On 状態:接続 - - + + Tip 提示 - - + + OpenPort COM failed シリアルのオープンに失敗しました @@ -6992,30 +7075,30 @@ wProgramPublishItem - + Input password パスワードを入力 - - - - Error - エラー + + VerifyPassword + パスワードの検証 - - + Error + エラー + + + Tip Info ヒント - Fail - 失敗 + 失敗 - + password is wrong パスワードエラー @@ -7023,24 +7106,16 @@ wUpgradeApkItem - Input password - パスワードを入力 + パスワードを入力 - Error - エラー + エラー - Tip Info - ヒント - - - - password is wrong - + ヒント diff --git a/LedOK/translations/app_zh_CN.qm b/LedOK/translations/app_zh_CN.qm new file mode 100644 index 0000000..9b8c6dc Binary files /dev/null and b/LedOK/translations/app_zh_CN.qm differ diff --git a/LedOK/translations/app_zh_CN.ts b/LedOK/translations/app_zh_CN.ts index bf45ba7..1b2c5f5 100644 --- a/LedOK/translations/app_zh_CN.ts +++ b/LedOK/translations/app_zh_CN.ts @@ -4,61 +4,59 @@ ChangePasswordForm - + Old password 旧密码 - + New password 新密码 - + Repeat again 重复一遍 - OK - 确认 + 确认 - Cancel - 取消 + 取消 - - - - - + + + + + Tip 提示 - + Please input old password 请输入旧密码 - + Old password is wrong 旧密码错误 - + Please enter a password with more than 6 characters 请输入超过6个字符的密码 - + The new password is not consistent in two times 新密码两次不一致 - + Password changed successfully 密码更改成功 @@ -66,1766 +64,1423 @@ ControlPowerSchedule - Form - Form + Form - Edit area - 编辑区 + 编辑区 - - Add - 添加 + 添加 - - Delete - 删除 + 删除 - - Clear - 清空 + 清空 - - Import - 导入 + 导入 - - Export - 导出 + 导出 - It is power off state outside the schedule time period - 定时时间段内显示屏开启,其他时间段为关屏状态 + 定时时间段内显示屏开启,其他时间段为关屏状态 - Send command - 指令区 + 指令区 - - Apply - 应用 + 应用 - Clear Schedule - 清除定时 + 清除定时 - Readback - 回读 + 回读 - Power On State - 屏开关状态 + 屏开关状态 - Start Time - 开始时间 + 开始时间 - End Time - 结束时间 + 结束时间 - SUN - 星期日 + 星期日 - MON - 星期一 + 星期一 - TUE - 星期二 + 星期二 - WED - 星期三 + 星期三 - THU - 星期四 + 星期四 - FRI - 星期五 + 星期五 - SAT - 星期六 + 星期六 - - - DeviceItem OnProHttpResponse 解析json文件错误! - - - - - On - + - - PowerSchedule (*.pjs) - 开关屏定时(*.pjs) + 开关屏定时(*.pjs) - Save File - 保存文件 + 保存文件 - - - Tip - 提示 + 提示 - - - NoSelectedController - 请先选择大屏幕 + 请先选择大屏幕 - - Tip Info - 提示 + 提示 - - Clear schedule task? - 取消计划任务? + 取消计划任务? - - CleanTimingScreenTask - 取消计划任务 + 取消计划任务 - SetTimingScreenTask - 设置屏幕定时开关任务 + 设置屏幕定时开关任务 - - - - Success - 成功 + 成功 - - - - failed - 失败 + 失败 - GetTimingScreenTask - 获取屏幕定时开关任务 + 获取屏幕定时开关任务 - ControlPowerWidget + CtrlPowerPanel - - + + Off - - + + On - - + + + + + Tip 提示 - - + + + + + NoSelectedController 请先选择大屏幕 - - + + SetScreenOn 打开屏幕电源 - - + + SetScreenOff 关闭屏幕电源 - - + + IsScreenOn 读取开关状态 - + + Import File + 导入文件 + + + + + PowerSchedule (*.pjs) + 开关屏定时(*.pjs) + + + + Save File + 保存文件 + + + + + SetTimingScreenTask + 设置屏幕定时开关任务 + + + + GetTimingScreenTask + 获取屏幕定时开关任务 + + + Power Configuration 开关屏控制 - + Manual 手动 - + Schedule 定时 - + Power 电源 - + + Readback 回读 - - - ControlTestWidget - - Form - Form + + Start Time + 开始时间 - - - Test Screen - 测试屏幕 + + End Time + 结束时间 - - - Line test - 线条测试 + + SUN + 星期日 - - - - - - - - Red - + + MON + 星期一 - - - - - - - - Green - 绿 + + TUE + 星期二 - - - - - - - - Blue - + + WED + 星期三 - - - - - - - - White - + + THU + 星期四 - - - Vertical - 竖线 + + FRI + 星期五 - - - Slash - 斜线 + + SAT + 星期六 - - - - Horizontal - 横线 + + Add + 添加 - - - - - Speed - 速度 + + Apply + 应用 - - - ms(>10) - 毫秒(>10) - - - - - Line Distance - 线距 - - - - px - 像素 - - - - - - - - Test - 测试 - - - - - Gradation test - 灰度测试 - - - - - Only the gray value is displayed - 只显示颜色值 - - - - (>10) - - - - - - GrayValue - 灰度值 - - - - (0-255) - - - - - - Color test - 颜色测试 - - - - - Gradient - 渐变 - - - - 8 - 8 - - - - 2 - 2 - - - - 3 - 3 - - - - 6 - 6 - - - - 4 - 4 - - - - 5 - 5 - - - - 1 - 1 - - - - 9 - 9 - - - - 7 - 7 - - - - 0 - 0 - - - - + Clear 清空 - - - Reset - 循环 + + Delete + 删除 - - - - - Anycast - 点播 + + Import + 导入 - - - Stop - 停止 + + Export + 导出 - - - - - - - - - Tip + + It is power off state outside the schedule time period + 定时时间段内显示屏开启,其他时间段为关屏状态 + + + + Clear Schedule + 清除定时 + + + + Tip Info 提示 - - - - - - NoSelectedController - 请先选择大屏幕 + + Clear schedule task? + 取消计划任务? - - - - StartTest - 开始测试 - - - - - - - Success - 成功 - - - - - - - failed - 失败 - - - - StopTest - 停止测试 - - - - loopback mode - 循环模式 - - - - Connect timeout - 连接超时 - - - - Reset loop mode - 设置循环 - - - - - success - 成功 - - - - - DeviceItem OnProHttpResponse 解析json文件错误! - 解析json文件错误! + + + CleanTimingScreenTask + 取消计划任务 ControlVolumeSchedule - - Defalut volume tip - - - - - Add - 添加 + 添加 - - Delete - 删除 + 删除 - - Clear - 清空 + 清空 - Default Volume - 默认音量 + 默认音量 - - (0-15) - - - - - Import - 导入 + 导入 - - Export - 导出 + 导出 - - Apply - 应用 + 应用 - Readback - 回读 + 回读 - Volume value - 音量值 + 音量值 - Start Time - 开始时间 + 开始时间 - End Time - 结束时间 + 结束时间 - SUN - 星期日 + 星期日 - MON - 星期一 + 星期一 - TUE - 星期二 + 星期二 - WED - 星期三 + 星期三 - THU - 星期四 + 星期四 - FRI - 星期五 + 星期五 - SAT - 星期六 + 星期六 - Default volume tip - 提醒:定时时间段以外的时间显示屏为默认亮度 + 提醒:定时时间段以外的时间显示屏为默认亮度 - Default volume - 默认音量值 + 默认音量值 - - DeviceItem OnProHttpResponse 解析json文件错误! - 解析json文件错误! + 解析json文件错误! - 10 - 10 + 10 - - - Volume Schedule (*.vols) - - - - Save File - 保存文件 + 保存文件 - - Tip - 提示 + 提示 - - NoSelectedController - 请先选择大屏幕 + 请先选择大屏幕 - SetAutoVolumeTask - 配置定时音量表 + 配置定时音量表 - - Success - 成功 + 成功 - - failed - 失败 + 失败 - GetAutoVolumeTask - 获取定时音量表 - - - - ControlVolumeWidget - - - - Tip - 提示 - - - - - NoSelectedController - 请先选择大屏幕 - - - - - SetVolume - 音量调节 - - - - - GetVolume - 获取当前音量 - - - - Volume Control - 音量调节 - - - - Manual - 手动 - - - - Schedule - 定时 - - - - Volume - 音量 - - - - Readback - 回读 + 获取定时音量表 CtrlAdvancedPanel - + Advanced 高级参数 - + Screen Width(pixel) 屏幕宽(像素) - + Width - - + + Height - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + Set 设置 - + Alias 别名 - + Web Server Address: Web服务器地址: - + www.m2mled.net - + www.ledaips.com - + https://www.taxihub.cn:2340 - + https://www.ledaips.com:2340 - + https://www.36taxi.com:2340 - + www.tlzxled.com - + MCU Uploading 正在上传单片机 - + Traffic screen settings 交通屏设置 - + Setting protocol ... 正在设置协议 ... - + Set protocol 设置协议 - + Getting protocol ... 正在回读协议 ... - + Get protocol 回读协议 - - + + Port 端口 - + Realtimer Server Address: Realtimer地址: - + Firmware Management 固件管理 - + update or uninstall 更新或卸载 - + Clear 清空 - + Check Apk 检查Apk - + Uninstall 卸载 - + Running check 运行状态监测 - + Restart 重启 - + Check Log 查看日志 - + Start LedSet4 使用 LedSet4.0 配置LED模组(Apk Display2.0以上版本) - + Open ADB 打开ADB调试功能 - + Post Custom JSON Post Custom JSON - - - - - - - - + + + + + + + + Clear Program 清除节目 - + www.ledokcloud.com/realtime - + Config 配置 - + 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 旋转 - + Min brightness 最低亮度 - - - + + + Readback 回读 - + Send 发送 - + Max brightness 最高亮度 - - + + SetScreenSize 设置屏幕像素尺寸 - - - - + + + + Success 成功 - + Compant ID: 公司ID: - + Compant ID 公司ID - + InputWebServerAddressTip 请输入Web服务器地址 - + InputCompanyIdTip 请输入公司ID - + Do you want to modify webserveraddress and companyId? 是否确认配置服务器地址和公司ID? - - + + SetOnlineAddr 设置web服务器地址 - - + + ClearRealtimeServer 清除 - - + + SetRealtimeServer 设置RealTimer地址 - - - - + + + + Tip Info 提示 - - - + + + Can not find LedSet3.0.exe 找不到 LedSet3.0.exe - - + + RestartAndroid 重启 - - + + running 正在运行 - - + + no running 没有运行 - + Check Apk Version 查询已安装apk版本 - - + + UninstallSoftware 卸载 - - + + Check apk running status 监测APK运行状态 - - + + OpenAdb 打开ADB调试功能 - + indentity voucher (*.ic) 身份凭证(*.ic) - - - - - + + + + + InvokeTaxiAppFunction 绑定证书 - - + + AliIotSetting - + Software Version Info 软件版本信息 - + Package 包名 - + Version 版本 - - + + Package name is null 包名为空 - + Clearing Program 正在清除节目 - - - - + + + + Timeout 超时 - - - - + + + + Failed 失败 - + Getting Log 正在获取日志 - - - - + + + + + + - - - - - - + + + + Error 错误 - + Setting Timing Reboot 正在设置定时重启 - + Set Timing Reboot 设置定时重启 - + Getting Timing Reboot 正在获取定时重启 - + Get Timing Reboot 获取定时重启 - + totalResolution 包括行场数的分辨率 - + strCurDisplayResolution 当前显示屏分辨率 - + File not exist 文件不存在 - + Uploading 正在上传 - - + + Set Display Mode 设置显示模式 - - + + Get Display Mode 获取显示模式 - - + + Set Screen Offset 设置屏幕偏移 - - + + Get Screen Offset 获取屏幕偏移 - + Open file Failed 文件打开失败 - + Setting Wallpaper 正在设置系统桌面背景 - - + + Set Wallpaper 设置系统桌面背景 - + System Updating 系统升级中 - - + + System Update 系统升级 - + Getting MCU Version 正在获取单片机版本 - - + + MCU Version 单片机版本 - + Select File 选择文件 - + Setting player background 正在设置播放器背景 - - + + Set player background 设置播放器背景 - + Clearing player background 正在清除播放器背景 - - - - - - - - + + + + + + + + Clear player background 清除播放器背景 - + Setting Baud Rate 正在设置波特率 - + Set Baud Rate 设置波特率 - + Getting Baud Rate 正在获取波特率 - + Get Baud Rate 获取波特率 - + Text is empty 文本为空 - + Json Parse Error - + Json isn't an Object - + Setting card work mode ... 正在设置控制卡工作模式 ... - + Set card work mode 设置控制卡工作模式 - + Getting card work mode ... 正在回读控制卡工作模式 ... - + Get card work mode 回读控制卡工作模式 - + Resolution Config 分辨率配置 - + Full screen 全屏 - + Part 局部 - + Display Mode 显示模式 - + Screen Position 屏幕位置 - + Offset 偏移 - + Hidden Settings 隐藏的设置 - + Click right button to hide 点击右键隐藏 - - + + Update MCU 更新单片机 - + Get MCU Version 获取单片机版本 - + Baud Config 波特率配置 - + Model 设备型号 - + Uart 串口节点 - + Baud 波特率 - - - - - - + + + + + + Get 获取 - + Timing Reboot 定时重启 - + Protocol 协议 - + Server 服务端 - + Client 客户端 - - + + SetScreenRotation 设置屏幕旋转 - - + + SetMinBrightness 设置最小的亮度值 - - + + SetMaxBrightness 设置亮度最大值 - - + + GetMinBrightness 获取亮度最小值 - - + + GetMaxBrightness 获取亮度最大值 - - + + Card work mode 控制卡工作模式 - - + + SetSpecialResolution 设置分辨率 - - + + GetSpecialResolution 读取分辨率 - - + + CleanDisplayScreenSize 恢复默认分辨率 - - + + SetHighForBusy 设置有无客电平 - - + + GetStateForBusy 获取有无客电平 - + InputAliasTip 请输入别名 - - + + SetCardAlias 设置别名 - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tip 提示 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + NoSelectedController 请先选择大屏幕 - + InputWidthTip 请输入正确的宽度像素值 - + InputHeightTip 请输入正确的高度像素值 - + Password is error 密码错误 @@ -1849,8 +1504,8 @@ - - + + Tip 提示 @@ -1864,8 +1519,8 @@ - - + + NoSelectedController 请先选择大屏幕 @@ -1948,49 +1603,49 @@ 获取亮度值 - + Brightness 屏体亮度 - + Import File 导入文件 - - + + BrightnessSchedule (*.bjs) - + Save File 保存文件 - + BrightnessValue 亮度值 - + Start Time 开始时间 - + End Time 结束时间 - - + + SetAutoBrightnessTask 发送定时亮度表 - + GetAutoBrightnessTask 获取定时亮度表 @@ -2001,127 +1656,127 @@ 错误 - + Brightness Configuration 亮度配置 - + Auto 自动 - + Manual 手动 - + Schedule 定时 - + Adapt to Old Devices 适配旧设备 - + BrightTip1 如果最大亮度为64,则最小亮度可以配置为1%或适当的值;如果最大亮度为255,则最小亮度必须配置为36%或更高,否则亮度将很低。 - + BrightTip2 上传文件时,请确认选择正确的传感器类型,否则无效! - + Sensitivity 灵敏度 - + Minbrightness 最小亮度值 - - - + + + Set 设置 - + Upload 上传配置文件 - + + - - + Readback 回读 - + ReadbackTable 回读 - + Refresh 刷新 - + Cur Brigntness 当前亮度 - + Brightness value 亮度值 - + Default brightness 默认亮度 - + Add 添加 - + Clear 清空 - + Delete 删除 - + Import 导入 - + Export 导出 - + Apply 应用 - + Default brightness tip 提示:时间范围内为设定亮度,时间范围外为默认亮度。例如默认亮度为50%,设定亮度为80%,时间范围是8:00-17:00,则时间范围内亮度为80%,其他时间为默认亮度50% @@ -2129,17 +1784,17 @@ CtrlHdmiPanel - + HDMI Configuration 画面输入源配置 - + Manual 手动 - + Schedule 定时 @@ -2205,99 +1860,99 @@ - + Async 异步 - + Set 设置 - - + + Readback 回读 - + Start Time 开始时间 - + End Time 结束时间 - + SUN 星期日 - + MON 星期一 - + TUE 星期二 - + WED 星期三 - + THU 星期四 - + FRI 星期五 - + SAT 星期六 - + Add 添加 - - + + Apply 应用 - + Clear 清空 - + Delete 删除 - + Import 导入 - + Export 导出 - + By default, the asynchronous content is played, and the synchronous signal content is played in the fixed time period 默认播放异步内容,定时时间段内播放同步HDMI-IN端口输入内容 @@ -2305,561 +1960,561 @@ CtrlNetworkPanel - + Wire Enther(RJ45) Configuration 有线网配置 - + DHCP - + Specify IP 指定IP - + IP Address IP地址 - + Gateway 网关 - + DNS Address DNS地址 - - - + + + Set 设置 - - - - + + + + Readback 回读 - + WIFI Configuration WiFi配置 - + WiFi Mode 使用WiFi - + Cellular Config 蜂窝数据配置 - + Enable Cellular Data 启用蜂窝数据 - + Get cellular network status information 获取蜂窝网络状态信息 - + Through the check status button 通过“获取状态”按钮可以自动匹配国家码,然后选择“运营商”可获取到相应的APN信息。 - + Set APN Info 设置APN信息 - + Country ID(mcc): 国家码(mcc): - + Carrier Name 运营商 - + APN(Required) APN(必填) - + Flight Mode 飞行模式 - + WiFi name WiFi名称 - - - + + + Password 密码 - - + + Input password 输入密码 - + Scan 扫描 - + Ap Mode 使用热点 - + OFF - + ON - + AP name 热点名称 - + Subnet mask 子网掩码 - + Input ap name 输入AP名称 - - - - - - - - - - - - + + + + + + + + + + + + Tip 提示 - - - - - - - - - - - + + + + + + + + + + + NoSelectedController 请先选择大屏幕 - - + + SetEthernet 设置有线网 - - - - + + + + Attention 注意 - + Please input IP address! 请输入IP地址! - + Please input Mask address! 请输入子网掩码地址! - + Please input Gateway address! 请输入网关地址! - + Please input DNS address! 请输入DNS地址! - - + + GetEthernet 获取有线网配置 - + DHCP IP 动态DHCP IP - + STATIC IP 静态IP - - + + ConfigurationWiFi 配置WiFi - - + + IsPortableHotSpot 获取热点和WiFi模式 - + GetWifiList 扫描WiFi - - + + ConfigurationHotSpot 配置热点 - + success 成功 - + WifiName Wifi名称 - + ApName 热点名称 - - + + GetCurrentAPN 获取APN信息 - + GetSIMStatus 获取SIM状态 - - + + SetAPN 设置APN - + 状态: 状态: - + Error 错误 - + 未知 未知 - + 锁定状态,需要用户的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 - + 数据连接状态: 数据连接状态: - + 断开 断开 - + 正在连接 正在连接 - + 已连接 已连接 - + 暂停 暂停 - + 数据活动休眠状态: 数据活动休眠状态: - + 活动,但无数据发送和接收 活动,但无数据发送和接收 - + 活动,正在接收数据 活动,正在接收数据 - + 活动,正在发送数据 活动,正在发送数据 - + 活动,正在接收和发送数据 活动,正在接收和发送数据 - + 休眠状态 休眠状态 - + 信号强度: - + User 用户 - + Type 类型 - + Server 服务端 - + Port 端口 - + Proxy 代理 - + MMS Port 彩信端口 - + MMS Proxy 彩信代理 - - + + SetSwitchSimData 设置4G/5G开关 - - + + ContrFlightMode 配置飞行模式 - - + + GetFlightModeState 获取飞行模式状态 @@ -2867,419 +2522,856 @@ CtrlPwdPanel - + Set Password 安全配置 - + Original password 原始密码 - + original password 原始密码 - - + + New password 新密码 - + Repeat new password 重复输入 - - - - + + + + Set encryption 加密 - + Cancel encryption 取消加密 - + Enter again 再次输入 - - - - - - - - - + + + + + + + + + Tip 提示 - - + + NoSelectedController 请先选择大屏幕 - - + + InputOriginalPasswordTip 请输入原始密码 - + InputNewPasswordTip 请输入新密码 - + InputRepeatPasswordTip 请重复输入新密码 - + InputRepeatPasswordNotSameTip 两次输入的密码不一致 - + Tip Info 提示 - + After setting the password, please remember the password and record it. If you forget the password, the device will be unable to operate. Are you sure you want to continue with this operation? 设置密码后,请记住密码并记录。如果忘记密码,设备将无法运行。确实要继续此操作吗? - - - - + + + + SetControllerPassword 设置加密 - - + + Error 错误 - - + + Success 成功 - - - + + + Modify password 修改密码 - - - - + + + + OriginalPasswordErrorTip 原始密码错误 - CtrlVerifyClockPanel + CtrlTestPanel - - Verify Clock Configuration - 校准时间 + + Test Screen + 测试屏幕 - - - Verify to Computer time - 校准到计算机时间 + + Line test + 线条测试 - - Cur time of controller - LED显示屏设备当前时间 + + + + + Red + - - - LAN - 局域网 + + + + + Green + 绿 - - - - - - - - - - - + + + + + Blue + + + + + + + + White + + + + + Vertical + 竖线 + + + + Slash + 斜线 + + + + + Horizontal + 横线 + + + + + Speed + 速度 + + + + ms(>10) + 毫秒(>10) + + + + Line Distance + 线距 + + + px + 像素 + + + + + + Test + 测试 + + + + Gradation test + 灰度测试 + + + + Only the gray value is displayed + 只显示颜色值 + + + + GrayValue + 灰度值 + + + + Color test + 颜色测试 + + + + Gradient + 渐变 + + + 8 + 8 + + + 2 + 2 + + + 3 + 3 + + + 6 + 6 + + + 4 + 4 + + + 5 + 5 + + + 1 + 1 + + + 9 + 9 + + + 7 + 7 + + + 0 + 0 + + + + Clear + 清空 + + + + Reset + 循环 + + + + + + + Anycast + 点播 + + + + Stop + 停止 + + + + + + + + + + Tip 提示 - - - - - - - - - - - + + + + + + NoSelectedController 请先选择大屏幕 - + + + + + + + StartTest + 开始测试 + + + Success + 成功 + + + failed + 失败 + + + + + StopTest + 停止测试 + + + + loopback mode + 循环模式 + + + + Connect timeout + 连接超时 + + + + + receive + 接收 + + + + Connect + 连接 + + + + timeout + 超时 + + + + Reset loop mode + 设置循环 + + + + + success + 成功 + + + DeviceItem OnProHttpResponse 解析json文件错误! + 解析json文件错误! + + + + CtrlVerifyClockPanel + + + Verify Clock Configuration + 校准时间 + + + + + Verify to Computer time + 校准到计算机时间 + + + + Cur time of controller + LED显示屏设备当前时间 + + + + + LAN + 局域网 + + + + + + + + + + + + + + Tip + 提示 + + + + + + + + + + + + + + NoSelectedController + 请先选择大屏幕 + + + screenSwitch 开关屏 - + YES - + NO - + volume 音量 - + brightness 亮度 - - + + identificationCode 识别码 - - + + delaySync 时间偏移 - - + + msec 毫秒 - - - - + + + + OtherSyncItem 其他同步项 - - - - + + + + lastSynchronousTime 上次同步时间 - + checkNtpTime 同步间隔 - + Lora identity Lora身份 - + (min/time) (分钟/次) - + identification code 同步识别码 - + Time offset(msec) 时间偏移(毫秒) - + Brightness 屏体亮度 - + Volume 音量 - + Screen on/off 屏幕开关 - - + + Slave - + NTP Server NTP服务器 - - + + NTP Server address NTP服务器地址 - + TimeZone 时区 - - - - - + + + + + Set 设置 - + Language: 语言: - + Enable Synchronous playing 使能同步画面功能 - - + + Sync time interval 同步时间间隔 - - - - + + + + Readback 回读 - - + + Master - + Identification Code 识别码 - - + + SetNtpServer 设置NTP服务 - - + + MasterSwitch 设置为主设备 - - + + SlaveSwitch 设置为从设备 - + IsMasterSlave 回读主从身份 - - + + GetControllerDate 获取日期时间 - - + + SetingSyncMethod 设置同步方法 - - + + SyncTime 校准时间 - - + + GetNtpServer 获取NTP服务信息 - - + + GetingSyncMethod 获取同步方式 - - + + SetTimezone 设置时区 + + CtrlVolumePanel + + + + + + Tip + 提示 + + + + + + + NoSelectedController + 请先选择大屏幕 + + + + + SetVolume + 音量调节 + + + + + GetVolume + 获取当前音量 + + + + Import File + 导入文件 + + + + + Volume Schedule (*.vols) + + + + + Save File + 保存文件 + + + + + SetAutoVolumeTask + 配置定时音量表 + + + + GetAutoVolumeTask + 获取定时音量表 + + + + Volume Control + 音量调节 + + + + Manual + 手动 + + + + Schedule + 定时 + + + + Volume + 音量 + + + + + Readback + 回读 + + + + Default volume + 默认音量值 + + + + Add + 添加 + + + + Clear + 清空 + + + + Delete + 删除 + + + + Import + 导入 + + + + Export + 导出 + + + + Volume value + 音量值 + + + + Start Time + 开始时间 + + + + End Time + 结束时间 + + + + SUN + 星期日 + + + + MON + 星期一 + + + + TUE + 星期二 + + + + WED + 星期三 + + + + THU + 星期四 + + + + FRI + 星期五 + + + + SAT + 星期六 + + + + Apply + 应用 + + + + Default volume tip + 提醒:定时时间段以外的时间显示屏为默认亮度 + + Def @@ -3297,10 +3389,10 @@ 设备回复 - - - - + + + + Success 成功 @@ -3313,79 +3405,79 @@ DeviceCtrlPanel - - - - + + + + Current Screen 当前屏幕 - - + + none - - + + Clear 清空 - - + + Multi screen operation 多屏操作 - - + + selected num 选中数目 - + Brightness Adjustment 亮度调节 - + Power Control 电源控制 - + Net Config 网络配置 - + Time Sync 对时管理 - + Video source 同异步配置 - + Password 设置密码 - + Advanced 高级设置 - + Test 测试 - + Volume Adj. 音量调节 @@ -3393,352 +3485,345 @@ DeviceItem - + GetScreenDetailInfo 更多信息 - + ReadbackPic 回读画面 - + + + Error + 错误 + + + Input password 输入密码 - + + VerifyPassword + 验证密码 + + + GetScreenshotFull 回读画面 - cur brightness: - 当前亮度: + 当前亮度: - - android version: - 安卓版本: + Android Version + 安卓版本: - - IMEI: - + FPGA Version + FPGA版本: - - HardWard Version: - FPGA版本: + Brightness Level + 亮度等级: - - MAX Brightness level: - 亮度等级: + Android OS Resolution + 安卓分辨率: - - Android OS Resolution: - 安卓分辨率: + Firmware Version + 固件版本: - - Firmware Version: - 固件版本: + Player Version + 播放器固件版本: - - Player Version: - 播放器固件版本: - - - Detail Info - 详细信息 + 详细信息 - - - - - - - - - - - - - - - receive - 接收 + 接收 - - AliIotSetting - - - - - GetScreenStatus - 获取屏幕状态 + 获取屏幕状态 - - Status - 状态 + 状态 - + Tip Info 提示 - + password is wrong 密码错误 - GetBrightness - 获取亮度值 + 获取亮度值 - brightness - 亮度 + 亮度 - SetAutoBrightnessTask - 发送定时亮度表 + 发送定时亮度表 - SetAutoVolumeTask - 配置定时音量表 + 配置定时音量表 - SetVolume - 音量调节 + 音量调节 - GetVolume - 获取当前音量 + 获取当前音量 - SetTimingScreenTask - 设置屏幕定时开关任务 + 设置屏幕定时开关任务 - TestScreen - 测试屏幕 + 测试屏幕 - SetOnlineAddr - 设置web服务器地址 + 设置web服务器地址 - SetRealtimeServer - 设置RealTimer地址 + 设置RealTimer地址 - GetCurrentSensorBrightness - 获取当前亮度 + 获取当前亮度 - Cur brightness - 当前亮度 + 当前亮度 - Connect - 连接 + 连接 - timeout - 超时 + 超时 - Anycast - 点播 + 点播 - volume - 音量 + 音量 - Success - 成功 + 成功 - failed - 失败 + 失败 - - - - - - - - - - - - - success - 成功 + 成功 - - - - on + + On - - - - off + + Off DevicePanel - - + + All 总数 总数 - + Online 在线 在线 - - + + Refresh 刷新 刷新 - + Current Screen 当前屏幕 - + none - - - + + + Specify IP 指定IP 指定IP - + + CheckSoftVersions + 获取软件版本 + + + + Current Brightness + 当前亮度 + + + + Android Version + 安卓版本 + + + + FPGA Version + FPGA版本 + + + + Brightness Level + 亮度等级 + + + + Android OS Resolution + 安卓分辨率 + + + + Firmware Version + 固件版本 + + + + Player Version + 播放器固件版本 + + + + Detail Info + 详细信息 + + + Specify IP list 指定IP列表 - + Search 搜索 - - + + Attention 注意 - - + + Please input IP address! 请输入IP地址! - + Cancel 取消 - + Screen ID 屏幕ID - + Screen IP 屏幕IP - + Screen Size 屏幕像素 - + Remark Name 别名 - + readback pic 回读画面 - - send - 发送 + + On + - + + Off + + + + send + 发送 + + + More Info 详细信息 - + Cur Brightness 屏幕当前亮度 - + Power Status 屏幕开关状态 - + Security 加密 @@ -3747,7 +3832,7 @@ Downloader - + Updater 更新 @@ -3758,8 +3843,8 @@ - - + + Downloading updates 下载更新 @@ -3775,141 +3860,141 @@ - + Stop 停止 - - + + Time remaining 剩余时间 - + unknown 未知 - + Error 错误 - + Cannot find downloaded update! 找不到下载的更新! - + Close 确认 - + Download complete! 下载完成! - + The installer will open separately 安装程序将单独打开 - + In order to install the update, you may need to quit the application. This is a mandatory update, exiting now will close the application 要安装更新,可能需要退出应用程序。这是强制更新,现在退出将关闭应用程序 - + In order to install the update 安装更新 - + Tip Info 提示 - + Click the "Open" button to apply the update 单击“打开”按钮应用更新 - + Are you sure you want to cancel the download? 您想现在下载更新吗? - + Are you sure you want to cancel the download? This is a mandatory update, exiting now will close the application 确实要取消下载吗?这是强制更新,现在退出将关闭应用程序 - - + + %1 bytes - - + + %1 KB - - + + %1 MB - + of ,总大小 - + Downloading Updates 正在下载更新 - + Time Remaining 剩余时间 - + Unknown 未知 - + about %1 hours 约%1小时 - + about one hour 约1小时 - + %1 minutes %1 分钟 - + 1 minute 1 分钟 - + %1 seconds %1 秒 - + 1 second 1 秒 @@ -3917,116 +4002,116 @@ EAClock - + Basic Properties 基本属性 - + Time Zone 时区 - + Custom Dial 自定义表盘 - + Select 选择 - + Select Dail file 选择表盘图片 - + Hour Mark 时标 - - + + Circular 圆形 - - + + Rectangle 矩形 - + Number 数字 - - - + + + T - + Min Mark 分标 - + Color 颜色 - + Length - + Width - + Hour Hand 时针 - + Min Hand 分针 - + Sec Hand 秒针 - + Show 显示 - + Text 文本 - + Play Properties 播放方式 - + Play Duration 播放时长 - + s @@ -4034,39 +4119,32 @@ EAudio - Basic Properties - 基本属性 + 基本属性 - File - 文件 + 文件 - Play Properties - 播放方式 + 播放方式 - Play Duration - 播放时长 + 播放时长 - Select File - 选择文件 + 选择文件 - s - + - Audio - 音频 + 音频 @@ -4446,37 +4524,37 @@ EGif - + Basic Properties 基本属性 - + File 文件 - + Select File 选择文件 - + Play Properties 播放方式 - + Play Duration 播放时长 - + s - + Play Times 播放次数 @@ -4484,73 +4562,73 @@ EMultiWin - + Please add media on the right 请在右边添加媒体,可以加入多个不同媒体,LED显示屏将按列表先后顺序播放 - + Media List 媒体列表 - - - + + + Text 文本 - - - + + + Photo 图片 - - - + + + Video 视频 - - - + + + Gif 动画 - - - + + + DClock 数字时钟 - - - + + + AClock 模拟时钟 - - - + + + Select File 选择文件 - - + + Environment 环境监测 - - + + Timer 计时器 @@ -4957,54 +5035,54 @@ EVideo - + Basic Properties 基本属性 - + File 文件 - + Play Properties 播放方式 - + Play Duration 播放时长 - + Select File 选择文件 - + s - + Play Times 播放次数 - + Video Transcoding 视频转码 - - + + Video Transcoding Progress 视频转码进度 - - + + Error 错误 @@ -5022,17 +5100,17 @@ EWeb - + Basic Properties 基本属性 - + Play Duration 播放时长 - + s @@ -5063,82 +5141,82 @@ GenTmpThread - + Preparing ... 准备中... - + MON 星期一 - + TUE 星期二 - + WED 星期三 - + THU 星期四 - + FRI 星期五 - + SAT 星期六 - + SUN 星期日 - + AM 上午 - + PM 下午 - + day - + hour - + min - + sec - + Create json ... 生成json... - + Scan program ... 扫描节目... @@ -5146,7 +5224,7 @@ ImgDlg - + Screenshot 屏幕截图 @@ -5197,115 +5275,115 @@ MainWindow - + Language 语言 - + Help 帮助 - - + + Check for updates 检查更新 - - + + firmware manager 固件管理 - - + + Software Config 软件配置 - - + + Info 信息 - - - + + + About 关于 - - + + Setting 设置 - + Software Update 软件更新 - + CurVersion 当前版本 - + Update 更新 - + LatestVersion: 最新版本: - - + + Update log: 更新日志: - + The current version is already the latest version 已经是最新的版本 - + Device 设备管理 - + Program 节目管理 - + Control 终端控制 - + GuangYinPin 光影屏 - + Check card 一键找卡 - + Tip Info 提示 - + RestoreLedCardIpByUdpTip 该操作会把局域网内的所有与计算机IP不在同一网段的控制卡修复成固定IP,请谨慎操作! @@ -5416,12 +5494,12 @@ 水平靠右 - + Tip Info 提示 - + Clear all medias? 清除所有媒体? @@ -5429,84 +5507,84 @@ PageListItem - + times - + Page name 节目名称 - + New 新建 - + Play times 播放次数 - + Sources Repeat 素材循环 - + Audios 音频 - + Total Dur 总时长 - - + + s - + Select File 选择文件 - + Duration 时长 - + Vol 音量 - + Valid Date 有效日期 - - + + Warning 警告 - + Start Time can't be later than End Time 开始时间不能晚于结束时间 - + End Time can't be earlier than Start Time 结束时间不能早于开始时间 - + Plan 时间计划表 @@ -5519,7 +5597,7 @@ 输入密码 - + Change Password 修改密码 @@ -5527,17 +5605,17 @@ PlayWin - + Move to Top Left 移动到左上角 - + Set Position 设置位置 - + Close 关闭 @@ -5545,12 +5623,12 @@ PlayerBackSendThread - + Open file failed 文件读取失败 - + Read file failed 文件读取失败 @@ -5571,248 +5649,246 @@ ProgCreateDlg - + Resolution 分辨率 - + Solution Information 节目信息 - + Solution Name 节目名称 - + Width - + Height - + Remarks 备注 - + 每段打折宽度 (用空格分隔) - OK - 确认 + 确认 - Cancel - 取消 + 取消 ProgEditorWin - + Save 保存 - - Save as - 另存为 + 另存为 - + Setting 设置 - + Text 文本 - + Photo 图片 - + Video 视频 - + Gif 动画 - + Clock 数字时钟 - + Analog Clock 模拟时钟 - + Environment 环境监测 - + Web 网页 - + MuliContentWindow 多素材窗口 - + In this window, a plurality of different program materials can be added and played according to the order of joining the list; 该窗口中可以加入多个不同是节目素材,并按照加入列表的先后顺序播放 - + Timer 计时器 - + Play 播放 - + Stop 停止 - + Publish 发布 - - - - + + + Select File 选择文件 - + program 节目列表 - + Add page 添加页面 - + Copy page 复制页面 - + Delete page 删除页面 - - + + Tip Info 提示 - + Are you sure you want to delete this program page? 确定要删除该节目页吗? - + Move up 向上移动一个页面 - + Move down 向下移动一个页面 - + widget properties 组件属性 - + Page properties 节目属性 - + Do you want to save the modifications? 是否保存修改? - - + + Create Dir failed + 创建目录失败 + + + Saving... 正在保存... - - + Success 成功 - Save failed - 保存失败 + 保存失败 - + Convertering 整理数据中 - + Generate preview data 生成预览数据 - - + + + Error 错误 - + Rename fail when saving 重命名文件夹失败 - + Remove Recursively fail when saving - + Warning 警告 @@ -5820,22 +5896,16 @@ ProgItem - - ExportButtonTip - U盘播放 + U盘播放 - - SendButtonTip - 发布 + 发布 - - Convertering - 整理数据中 + 整理数据中 @@ -5972,17 +6042,17 @@ ProgPortDlg - + Solution Name 节目名称 - + Progress 进度 - + Done 完成 @@ -5994,6 +6064,77 @@ Setting up the LedOK Express... 初始化LedOK Express... + + + + Input password + 输入密码 + + + + VerifyPassword + 验证密码 + + + + + Error + 错误 + + + + Tip Info + 提示 + + + + password is wrong + 密码错误 + + + + + ExportButtonTip + U盘播放 + + + + Usb upgrade program + U盘更新节目 + + + + Password + 密码 + + + + + Convertering + 整理数据中 + + + + + Tip + 提示 + + + + No checked USB device + 未检查USB设备 + + + + please select usb device in list + 请在列表中选择usb设备 + + + + + SendButtonTip + 发布 + SendProgThread @@ -6017,73 +6158,72 @@ SendProgramDialog - - + + Publish 发布 - + success info - + Refresh 刷新 - Cancel - 取消 + 取消 - + Screen ID 屏幕ID - + Remark Name 别名 - + Online 在线 - + Screen IP 屏幕IP - + Screen Size 屏幕像素 - + Security 加密 - + Progress 进度 - + Remarks 备注 - + This screen is encrypted 屏幕已加密 - + All 总数 @@ -6134,50 +6274,40 @@ UpdateLedset3Dialog - LedSet3.0 Update - LedSet3.0更新 + LedSet3.0更新 - X - X + X - V1.0.0 - V1.0.0 + V1.0.0 - Update - 升级 + 升级 - - CurVersion - 当前版本 + 当前版本 - Apk is download finished from internet,you can select LED Screen SYNC firmware now! - 固件APK成功下载,您可以选择需要的LED屏幕同步固件! + 固件APK成功下载,您可以选择需要的LED屏幕同步固件! - LatestVersion: - 最新版本: + 最新版本: - Update log: - 更新日志: + 更新日志: - The current version is already the latest version,,you can select LED Screen SYNC firmware now! - 当前固件APK版本已经是最新版本,您可以选择需要的LED屏幕同步固件! + 当前固件APK版本已经是最新版本,您可以选择需要的LED屏幕同步固件! @@ -6206,268 +6336,273 @@ UpgradeApkDialog - + Update APK 更新APK - + Select apk 选择Apk包 - + Upgrade 升级 - + Uninstall 卸载 - + check running state 检测运行状态 - + Select Fpga 选择FPGA文件 - + Installing 正在安装 - + Refresh 刷新 - + Cancel 取消 - + Screen ID 屏幕ID - + Remark Name 别名 - + Online 在线 - + Screen IP 屏幕IP - + Security 加密 - + Progress 进度 - + xixunplayer - + cardsystem - + taxiapp - + starter - + connection - + displayer - + FPGA FPGA - + update - + State 状态 - - + + All 总数 - + This screen is encrypted 屏幕已加密 - - + + Select Online APK 选择在线APK - + No Files 没有文件 - + Name 名称 - + Size 大小 - + Create Time 创建时间 - - - + + Please select a file + 请选择一个文件 + + + + + Tip 提示 - + Is upgrading now. Please wait 正在更新,请稍后 - + NoSelectedController 请先选择大屏幕 + - Downloading Online File 正在下载在线文件 - - + + Error 错误 - + Online file is empty 在线文件为空 - + Uploading 正在上传 - + Upload error 上传错误 - + Install error 安装错误 - + Install success 安装成功 - + Reminder 提示 - + Reminder: Uninstalling this program may cause the device to offline, cannot be found, lost configs and have a black screen. Please uninstall with caution! 提示:卸载此程序会导致平台掉线,找不到设备,配置参数丢失和黑屏问题,请谨慎卸载! - + Do you want to continue? 是否继续? - + Uninstalling 正在卸载 - + Uninstall error 卸载错误 - + Uninstall success 卸载成功 - + Check apk running status 监测APK运行状态 - + Check error 检查错误 - + Running 正在运行 - + Not running 没有运行 - + The encrypted control card can be upgraded directly 加密控制卡可以直接升级 @@ -6475,45 +6610,36 @@ UsbDetectDialog - Usb upgrade program - U盘更新节目 + U盘更新节目 - Password - 密码 + 密码 - OK - 确认 + 确认 - Input password - 输入密码 + 输入密码 - - Tip - 提示 + 提示 - No checked USB device - 未检查USB设备 + 未检查USB设备 - please select usb device in list - 请在列表中选择usb设备 + 请在列表中选择usb设备 - Cancel - 取消 + 取消 @@ -6527,427 +6653,384 @@ X_UIMsgBoxOk - - - TextLabel - - - - - X - - - - OK - 确认 + 确认 - Cancel - 取消 + 取消 mGuangYingPinWidget - - + + Com 串口 - - + + Main 主设备 - - - - + + + + PortName 串口名称 - - - - + + + + BaudRate 波特率 - - 1200 - 1200 + 1200 - - 2400 - 2400 + 2400 - - 4800 - 4800 + 4800 - - 9600 - 9600 + 9600 - - 19200 - 19200 + 19200 - - 38400 - 38400 + 38400 - - 57600 - 57600 + 57600 - - 115200 - 115200 + 115200 - - - - + + + + DataBit 数据位 - - - + 5 5 - - - + 6 6 - - - + 7 7 - - - + 8 8 - - - - + + + + OEBit 校验位 - - + + No - - + + Even - - + + Odd - - + + Space - - + + Mark - - - - + + + + StopBit 停止位 - - - + 1 1 - - - + 2 2 - - 1.5 - 1.5 + 1.5 - - + + State:Close 状态:连接 - - - - - - - - - + + + + + + + + + Open 打开 - - + + Auxiliary 副设备 - - + + Refresh 刷新 - - + + Param configuration 参数配置 - - + + Resend times 重发次数 - - + + Delay millsecond 延时(微秒) - + 3 3 - + 4 4 - + 9 9 - - + + Clear 清空 - - + + Debug 调试 - - - + + + 10 10 - - + + Network 网络 - + 11 11 - + 12 12 - + 13 13 - + 14 14 - + 15 15 - + 16 16 - + 17 17 - + 18 18 - + 19 19 - + 20 20 - - + + Program number 节目号 - - + + Send 发送 - - + + Brightness 屏体亮度 - - + + Set 设置 - - + + Screen Off 关屏 - + Screen on 开屏 - - - - - - - - + + + + + + + + State:Off 状态:断开 - + Screen On 开屏 - - - - - - - - - - + + + + + + + + + + Close 关闭 - - + + State:On 状态:连接 - - + + Tip 提示 - - + + OpenPort COM failed 串口打开失败 @@ -6993,30 +7076,30 @@ wProgramPublishItem - + Input password 输入密码 - - - - Error - 错误 + + VerifyPassword + 验证密码 - - + Error + 错误 + + + Tip Info 提示 - Fail - 失败 + 失败 - + password is wrong 密码错误 @@ -7024,24 +7107,20 @@ wUpgradeApkItem - Input password - 输入密码 + 输入密码 - Error - 错误 + 错误 - Tip Info - 提示 + 提示 - password is wrong - 密码错误 + 密码错误 diff --git a/LedOK/translations/app_zh_TW.qm b/LedOK/translations/app_zh_TW.qm new file mode 100644 index 0000000..2e903b1 Binary files /dev/null and b/LedOK/translations/app_zh_TW.qm differ diff --git a/LedOK/translations/app_zh_TW.ts b/LedOK/translations/app_zh_TW.ts index 25f1159..3e56c6d 100644 --- a/LedOK/translations/app_zh_TW.ts +++ b/LedOK/translations/app_zh_TW.ts @@ -4,61 +4,59 @@ ChangePasswordForm - + Old password 舊密碼 - + New password 新密碼 - + Repeat again 重複一遍 - OK - 確認 + 確認 - Cancel - 取消 + 取消 - - - - - + + + + + Tip 提示 - + Please input old password 請輸入舊密碼 - + Old password is wrong 舊密碼錯誤 - + Please enter a password with more than 6 characters 請輸入超過6個字元的密碼 - + The new password is not consistent in two times 新密碼兩次不一致 - + Password changed successfully 密碼更改成功 @@ -66,644 +64,392 @@ ControlPowerSchedule - Form - Form + Form - Edit area - 編輯區 + 編輯區 - - Add - 添加 + 添加 - - Delete - 删除 + 删除 - - Clear - 清空 + 清空 - - Import - 導入 + 導入 - - Export - 匯出 + 匯出 - It is power off state outside the schedule time period - 定時時間段內顯示幕開啟,其他時間段為關屏狀態 + 定時時間段內顯示幕開啟,其他時間段為關屏狀態 - Send command - 指令區 + 指令區 - - Apply - 應用 + 應用 - Clear Schedule - 清除定時 + 清除定時 - Readback - 回讀 + 回讀 - Power On State - 屏開關狀態 + 屏開關狀態 - Start Time - 開始時間 + 開始時間 - End Time - 結束時間 + 結束時間 - SUN - 星期日 + 星期日 - MON - 星期一 + 星期一 - TUE - 星期二 + 星期二 - WED - 星期三 + 星期三 - THU - 星期四 + 星期四 - FRI - 星期五 + 星期五 - SAT - 星期六 + 星期六 - - On - + - - PowerSchedule (*.pjs) - 開關屏定時(*.pjs) + 開關屏定時(*.pjs) - Save File - 保存 + 保存 - - - Tip - 提示 + 提示 - - - NoSelectedController - 請先選擇大螢幕 + 請先選擇大螢幕 - - Tip Info - 提示 + 提示 - - Clear schedule task? - 取消計畫任務? + 取消計畫任務? - - CleanTimingScreenTask - 取消計畫任務 + 取消計畫任務 - SetTimingScreenTask - 設定螢幕定時開關任務 + 設定螢幕定時開關任務 - - - - Success - 成功 + 成功 - - DeviceItem OnProHttpResponse 解析json文件错误! - DeviceItem OnProHttpResponse 解析json檔案錯誤! + DeviceItem OnProHttpResponse 解析json檔案錯誤! - - - - failed - 失败 + 失败 - GetTimingScreenTask - 獲取螢幕定時開關任務 + 獲取螢幕定時開關任務 - ControlPowerWidget + CtrlPowerPanel - - + + Off - - + + On - - + + + + + Tip 提示 - - + + + + + NoSelectedController 請先選擇大螢幕 - - + + SetScreenOn 打開螢幕電源 - - + + SetScreenOff 關閉螢幕電源 - - + + IsScreenOn 讀取開關狀態 - + + Import File + 導入檔案 + + + + + PowerSchedule (*.pjs) + 開關屏定時(*.pjs) + + + + Save File + 保存 + + + + + SetTimingScreenTask + 設定螢幕定時開關任務 + + + + GetTimingScreenTask + 獲取螢幕定時開關任務 + + + Power Configuration 開關屏控制 - + Manual 手動 - + Schedule 定時 - + Power 電源 - + + Readback 回讀 - - - ControlTestWidget - - Form - Form + + Start Time + 開始時間 - - - Test Screen - 測試螢幕 + + End Time + 結束時間 - - - Line test - 線條測試 + + SUN + 星期日 - - - - - - - - Red - + + MON + 星期一 - - - - - - - - Green - + + TUE + 星期二 - - - - - - - - Blue - + + WED + 星期三 - - - - - - - - White - + + THU + 星期四 - - - Vertical - 豎線 + + FRI + 星期五 - - - Slash - 斜線 + + SAT + 星期六 - - - - Horizontal - 橫線 + + Add + 添加 - - - - - Speed - 速度 + + Apply + 應用 - - - ms(>10) - 毫秒(>10) - - - - - Line Distance - 線距 - - - - px - px - - - - - - - - Test - 測試 - - - - - Gradation test - 灰度測試 - - - - - Only the gray value is displayed - 只顯示顏色值 - - - - (>10) - - - - - - GrayValue - 灰度值 - - - - (0-255) - - - - - - Color test - 顏色測試 - - - - - Gradient - 漸變 - - - - 8 - 8 - - - - 2 - 2 - - - - 3 - 3 - - - - 6 - 6 - - - - 4 - 4 - - - - 5 - 5 - - - - 1 - 1 - - - - 9 - 9 - - - - 7 - 7 - - - - 0 - 0 - - - - + Clear 清空 - - - Reset - 迴圈 + + Delete + 删除 - - - - - Anycast - 點播 + + Import + 導入 - - - Stop - 停止 + + Export + 匯出 - - - - - - - - - Tip + + It is power off state outside the schedule time period + 定時時間段內顯示幕開啟,其他時間段為關屏狀態 + + + + Clear Schedule + 清除定時 + + + + Tip Info 提示 - - - - - - NoSelectedController - 請先選擇大螢幕 + + Clear schedule task? + 取消計畫任務? - - - - StartTest - 開始測試 - - - - - - - Success - 成功 - - - - - - - failed - 失敗 - - - - StopTest - 停止測試 - - - - loopback mode - 迴圈模式 - - - - Connect timeout - 連接超時 - - - - Reset loop mode - 設定迴圈 - - - - - success - 成功 - - - - - DeviceItem OnProHttpResponse 解析json文件错误! - DeviceItem OnProHttpResponse 解析json檔案錯誤! + + + CleanTimingScreenTask + 取消計畫任務 ControlVolumeSchedule - Defalut volume tip - 提醒:定時時間段內亮度按定時亮度顯示,其他沒有設定時間段為默認亮度值 + 提醒:定時時間段內亮度按定時亮度顯示,其他沒有設定時間段為默認亮度值 - - Add - 添加 + 添加 - - Delete - 删除 + 删除 - - Clear - 清空 + 清空 - Default Volume - 默認音量 + 默認音量 - - (0-15) - - - - - Import - 導入 + 導入 - - Export - 匯出 + 匯出 - - Apply - 應用 + 應用 - Readback - 回讀 + 回讀 - Volume value - 音量值 + 音量值 @@ -711,1126 +457,1043 @@ 開始時間 - Start Time - 開始時間 + 開始時間 - End Time - 結束時間 + 結束時間 - SUN - 星期日 + 星期日 - MON - 星期一 + 星期一 - TUE - 星期二 + 星期二 - WED - 星期三 + 星期三 - THU - 星期四 + 星期四 - FRI - 星期五 + 星期五 - SAT - 星期六 + 星期六 - Default volume tip - 提醒:定時時間段以外的時間顯示幕為默認亮度 + 提醒:定時時間段以外的時間顯示幕為默認亮度 - Default volume - 默認音量值 + 默認音量值 - - DeviceItem OnProHttpResponse 解析json文件错误! - DeviceItem OnProHttpResponse 解析json檔案錯誤! + DeviceItem OnProHttpResponse 解析json檔案錯誤! - 10 - 10 + 10 - - - Volume Schedule (*.vols) - - - - Save File - 保存 + 保存 - - Tip - 提示 + 提示 - - NoSelectedController - 請先選擇大螢幕 + 請先選擇大螢幕 - SetAutoVolumeTask - 配寘定時音量表 + 配寘定時音量表 - - Success - 成功 + 成功 - - failed - 失敗 + 失敗 - GetAutoVolumeTask - 獲取定時音量表 - - - - ControlVolumeWidget - - - - Tip - 提示 - - - - - NoSelectedController - 請先選擇大螢幕 - - - - - SetVolume - 音量調節 - - - - - GetVolume - 獲取當前音量 - - - - Volume Control - 音量調節 - - - - Manual - 手動 - - - - Schedule - 定時 - - - - Volume - 音量 - - - - Readback - 回讀 + 獲取定時音量表 CtrlAdvancedPanel - + Advanced 高級參數 - + Screen Width(pixel) 螢幕寬(點數) - + Width - - + + Height - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + Set 設定 - + Alias 別名 - + Web Server Address: Web伺服器地址: - + www.m2mled.net - + www.ledaips.com - + https://www.taxihub.cn:2340 - + https://www.ledaips.com:2340 - + https://www.36taxi.com:2340 - + www.tlzxled.com - + MCU Uploading 正在上傳單片機 - + Traffic screen settings 交通屏設定 - + Setting protocol ... 正在設定協定 - + Set protocol 設定協定 - + Getting protocol ... 正在回讀協定 ... - + Get protocol 回讀協定 - - + + Port - + Realtimer Server Address: Realtimer地址: - + Firmware Management 固件管理 - + update or uninstall 更新或卸載 - + Clear 清空 - + Check Apk 檢查Apk - + Uninstall 卸載 - + Running check 運行狀態監測 - + Restart 重啓 - + Check Log 查看日誌 - + Start LedSet4 - + Open ADB 打開ADB調試功能 - + Post Custom JSON Post Custom JSON - - - - - - - - + + + + + + + + Clear Program 清除節目 - + www.ledokcloud.com/realtime - + Config 配寘 - + 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 旋轉 - + Min brightness 最低亮度 - - - + + + Readback 回讀 - + Send 發送 - + Max brightness 最高亮度 - - + + SetScreenSize 設定螢幕點數尺寸 - - - - + + + + Success 成功 - + Compant ID: 公司ID: - + Compant ID 公司ID - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + NoSelectedController 請先選擇大螢幕 - + InputWebServerAddressTip 請輸入Web伺服器地址 - + InputCompanyIdTip 請輸入公司ID - + Do you want to modify webserveraddress and companyId? 是否確認配寘伺服器地址和公司ID? - - + + SetOnlineAddr 設定web伺服器地址 - - + + ClearRealtimeServer 清除 - - + + SetRealtimeServer 設定RealTimer地址 - - - - + + + + Tip Info 提示 - - - + + + Can not find LedSet3.0.exe 找不到 LedSet3.0.exe,確認下載並安裝 - - + + RestartAndroid 重啓 - - + + running 正在運行 - - + + no running 沒有運行 - + Check Apk Version 査詢已安裝apk版本 - - + + UninstallSoftware 卸載 - - + + Check apk running status 監測APK運行狀態 - - + + OpenAdb 打開ADB調試功能 - + indentity voucher (*.ic) 身份憑證(*.ic) - - - - - + + + + + InvokeTaxiAppFunction 綁定證書 - - + + AliIotSetting - + Software Version Info 軟體版本資訊 - + Package 包名 - + Version 版本 - - + + Package name is null 包名為空 - + Clearing Program 正在清除節目 - - - - + + + + Timeout 超時 - - - - + + + + Failed 失敗 - + Getting Log 讀取日誌 - - - - + + + + + + - - - - - - + + + + Error 錯誤 - + Setting Timing Reboot 正在設定定時重啓 - + Set Timing Reboot 設定定時重啓 - + Getting Timing Reboot 正在獲取定時重啓 - + Get Timing Reboot 獲取定時重啓 - + totalResolution 行数を含む解像度 - + strCurDisplayResolution 當前顯示分辯率 - + File not exist 檔案不存在 - + Uploading 正在上傳 - - + + Set Display Mode 設定顯示模式 - - + + Get Display Mode 獲取顯示模式 - - + + Set Screen Offset 設定螢幕偏移 - - + + Get Screen Offset 獲取螢幕偏移 - + Open file Failed 檔案打開失敗 - + Setting Wallpaper 正在設定系統桌面背景 - - + + Set Wallpaper 設定系統桌面背景 - + System Updating 系統升級中 - - + + System Update 系統升級 - + Getting MCU Version 正在獲取單片機版本 - - + + MCU Version 單片機版本 - + Select File 選擇檔案 - + Setting player background 正在設定播放機背景 - - + + Set player background 設定播放機背景 - + Clearing player background 正在清除播放機背景 - - - - - - - - + + + + + + + + Clear player background 清除播放機背景 - + Setting Baud Rate 正在設定串列傳輸速率 - + Set Baud Rate 設定串列傳輸速率 - + Getting Baud Rate 正在讀取串列傳輸速率 - + Get Baud Rate 讀取串列傳輸速率 - + Text is empty - + Json Parse Error - + Json isn't an Object - + Setting card work mode ... 正在設定控制卡工作模式 ... - + Set card work mode 設定控制卡工作模式 - + Getting card work mode ... 正在回讀控制卡工作模式 ... - + Get card work mode 回讀控制卡工作模式 - + Resolution Config 分辯率配寘 - + Full screen 全屏 - + Part 局部 - + Display Mode 顯示模式 - + Screen Position 螢幕位置 - + Offset 偏移 - + Hidden Settings 隱藏的設定 - + Click right button to hide 點擊右鍵隱藏 - - + + Update MCU 更新單片機 - + Get MCU Version 獲取單片機版本 - + Baud Config 串列傳輸速率配寘 - + Model 設備型號 - + Uart 串口節點 - + Baud 串列傳輸速率 - - - - - - + + + + + + Get 讀取 - + Timing Reboot 定時重啓 - + Protocol 協定 - + Server 服務端 - + Client 用戶端 - - + + SetScreenRotation 設定螢幕旋轉 - - + + SetMinBrightness 設定最小的亮度值 - - + + SetMaxBrightness 設定亮度最大值 - - + + GetMinBrightness 獲取亮度最小值 - - + + GetMaxBrightness 獲取亮度最大值 - - + + Card work mode 控制卡工作模式 - - + + SetSpecialResolution 設定分辯率 - - + + GetSpecialResolution 讀取分辯率 - - + + CleanDisplayScreenSize 恢復默認分辯率 - - + + SetHighForBusy 設定有無客電平 - - + + GetStateForBusy 獲取有無客電平 - + InputAliasTip 請輸入別名 - - + + SetCardAlias 設定別名 - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Tip 提示 - + InputWidthTip 請輸入正確的寬度點數值 - + InputHeightTip 請輸入正確的高度點數值 - + Password is error 密碼錯誤 @@ -1854,8 +1517,8 @@ - - + + Tip 提示 @@ -1869,8 +1532,8 @@ - - + + NoSelectedController 請先選擇大螢幕 @@ -1953,28 +1616,28 @@ 獲取亮度值 - + Brightness 屏体亮度 - + Import File 導入檔案 - - + + BrightnessSchedule (*.bjs) - + Save File 保存 - + BrightnessValue 亮度值 @@ -1984,23 +1647,23 @@ 開始時間 - + Start Time 開始時間 - + End Time 結束時間 - - + + SetAutoBrightnessTask 發送定時亮度錶 - + GetAutoBrightnessTask 獲取定時亮度錶 @@ -2011,127 +1674,127 @@ 錯誤 - + Brightness Configuration 亮度配寘 - + Auto 自動 - + Manual 手動 - + Schedule 定時 - + Adapt to Old Devices 適配舊設備 - + BrightTip1 如果最大亮度為64,則最小亮度可以配寘為1%或適當的值;如果最大亮度為255,則最小亮度必須配寘為36%或更高,否則亮度將很低。 - + BrightTip2 上傳文件時,請確認選擇正確的感測器類型,否則無效! - + Sensitivity 靈敏度 - + Minbrightness 最小亮度值 - - - + + + Set 設定 - + Upload 上傳設定檔 - + + - - + Readback 回讀 - + ReadbackTable 回讀 - + Refresh 檢測 - + Cur Brigntness 當前亮度 - + Brightness value 亮度值 - + Default brightness 默認亮度 - + Add 添加 - + Clear 清空 - + Delete 删除 - + Import 導入 - + Export 匯出 - + Apply 應用 - + Default brightness tip 提示:時間範圍內為設定亮度,時間範圍外為默認亮度。例如默認亮度為50%,設定亮度為80%,時間範圍是8:00-17:00,則時間範圍內亮度為80%,其他時間為默認亮度50% @@ -2139,17 +1802,17 @@ CtrlHdmiPanel - + HDMI Configuration 畫面輸入源配寘 - + Manual 手動 - + Schedule 定時 @@ -2215,99 +1878,99 @@ - + Async BOX - + Set 設定 - - + + Readback 回讀 - + Start Time 開始時間 - + End Time 結束時間 - + SUN 星期日 - + MON 星期一 - + TUE 星期二 - + WED 星期三 - + THU 星期四 - + FRI 星期五 - + SAT 星期六 - + Add 添加 - - + + Apply 應用 - + Clear 清空 - + Delete 删除 - + Import 導入 - + Export 匯出 - + By default, the asynchronous content is played, and the synchronous signal content is played in the fixed time period 默認播放非同步內容,定時時間段內播放同步HDMI-IN埠輸入內容 @@ -2315,561 +1978,561 @@ CtrlNetworkPanel - + Wire Enther(RJ45) Configuration 有線網配寘 - + DHCP - + Specify IP 指定IP - + IP Address IP地址 - + Gateway 閘道 - + DNS Address DNS地址 - - - + + + Set 設定 - - - - + + + + Readback 回讀 - + WIFI Configuration WiFi配寘 - + WiFi Mode 使用WiFi - + Cellular Config 蜂窩數據配寘 - + Enable Cellular Data 啟用蜂窩數據 - + Get cellular network status information 獲取蜂窩網絡狀態資訊 - + Through the check status button 通過“獲取狀態”按鈕可以自動匹配國家碼,然後選擇“運營商”可獲取到相應的APN資訊。 - + Set APN Info 設定APN資訊 - + Country ID(mcc): 国家码(mcc):國家碼(mcc): - + Carrier Name 運營商 - + APN(Required) APN(必填) - + Flight Mode 飛行模式 - + WiFi name WiFi名稱 - - - + + + Password 密碼 - - + + Input password 輸入密碼 - + Scan 掃描 - + Ap Mode 使用熱點 - + OFF - + ON - + AP name 熱點名稱 - + Subnet mask 子網路遮罩 - + Input ap name 輸入AP名稱 - - - - - - - - - - - - + + + + + + + + + + + + Tip 提示 - - - - - - - - - - - + + + + + + + + + + + NoSelectedController 請先選擇大螢幕 - - + + SetEthernet 設定有線網 - - - - + + + + Attention 注意 - + Please input IP address! 請輸入IP地址! - + Please input Mask address! 請輸入子網路遮罩地址! - + Please input Gateway address! 請輸入閘道地址! - + Please input DNS address! 請輸入DNS地址! - - + + GetEthernet 獲取有線網配寘 - + DHCP IP 動態DHCP IP - + STATIC IP 靜態IP - - + + ConfigurationWiFi 配寘WiFi - - + + IsPortableHotSpot 獲取熱點和WiFi模式 - + GetWifiList 掃描WiFi - - + + ConfigurationHotSpot 配寘熱點 - + success 成功 - + WifiName Wifi名稱 - + ApName 熱點名稱 - - + + GetCurrentAPN 獲取APN資訊 - + GetSIMStatus 獲取SIM狀態 - - + + SetAPN 設定APN - + 状态: 狀態: - + Error 錯誤 - + 未知 未知 - + 锁定状态,需要用户的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 - + 数据连接状态: 數據連接狀態: - + 断开 斷開 - + 正在连接 正在連接 - + 已连接 已連接 - + 暂停 暫停 - + 数据活动休眠状态: 數據活動休眠狀態: - + 活动,但无数据发送和接收 活動,但無數據發送和接收 - + 活动,正在接收数据 活動,正在接收數據 - + 活动,正在发送数据 活動,正在發送數據 - + 活动,正在接收和发送数据 活動,正在接收和發送數據 - + 休眠状态 休眠狀態 - + 信号强度: 信號強度: - + User 用戶 - + Type 型態 - + Server 服務端 - + Port - + Proxy 代理 - + MMS Port 彩信埠 - + MMS Proxy 彩信代理 - - + + SetSwitchSimData 設定4G/5G開關 - - + + ContrFlightMode 配寘飛行模式 - - + + GetFlightModeState 獲取飛行模式狀態 @@ -2877,419 +2540,856 @@ CtrlPwdPanel - + Set Password 安全配寘 - + Original password 原始密碼 - + original password 原始密碼 - - + + New password 新密碼 - + Repeat new password 重複輸入 - - - - + + + + Set encryption 加密 - + Cancel encryption 取消加密 - + Enter again 再次輸入 - - - - - - - - - + + + + + + + + + Tip 提示 - - + + NoSelectedController 請先選擇大螢幕 - - + + InputOriginalPasswordTip 請輸入原始密碼 - + InputNewPasswordTip 請輸入新密碼 - + InputRepeatPasswordTip 請重複輸入新密碼 - + InputRepeatPasswordNotSameTip 兩次輸入的密碼不一致 - + Tip Info 提示 - + After setting the password, please remember the password and record it. If you forget the password, the device will be unable to operate. Are you sure you want to continue with this operation? 設定密碼後,請記住密碼並記錄。如果忘記密碼,設備將無法運行。確實要繼續此操作嗎? - - - - + + + + SetControllerPassword 設定加密 - - + + Error 錯誤 - - + + Success 成功 - - - + + + Modify password 修改密碼 - - - - + + + + OriginalPasswordErrorTip 原始密碼錯誤 - CtrlVerifyClockPanel + CtrlTestPanel - - Verify Clock Configuration - 校準時間 + + Test Screen + 測試螢幕 - - - Verify to Computer time - 校準到電腦時間 + + Line test + 線條測試 - - Cur time of controller - 顯示幕設備當前時間 + + + + + Red + - - - LAN - 局域網 + + + + + Green + - - - - - - - - - - - + + + + + Blue + + + + + + + + White + + + + + Vertical + 豎線 + + + + Slash + 斜線 + + + + + Horizontal + 橫線 + + + + + Speed + 速度 + + + + ms(>10) + 毫秒(>10) + + + + Line Distance + 線距 + + + px + px + + + + + + Test + 測試 + + + + Gradation test + 灰度測試 + + + + Only the gray value is displayed + 只顯示顏色值 + + + + GrayValue + 灰度值 + + + + Color test + 顏色測試 + + + + Gradient + 漸變 + + + 8 + 8 + + + 2 + 2 + + + 3 + 3 + + + 6 + 6 + + + 4 + 4 + + + 5 + 5 + + + 1 + 1 + + + 9 + 9 + + + 7 + 7 + + + 0 + 0 + + + + Clear + 清空 + + + + Reset + 迴圈 + + + + + + + Anycast + 點播 + + + + Stop + 停止 + + + + + + + + + + Tip 提示 - - - - - - - - - - - + + + + + + NoSelectedController 請先選擇大螢幕 - + + + + + + + StartTest + 開始測試 + + + Success + 成功 + + + failed + 失敗 + + + + + StopTest + 停止測試 + + + + loopback mode + 迴圈模式 + + + + Connect timeout + 連接超時 + + + + + receive + 接收 + + + + Connect + 連接 + + + + timeout + 超時 + + + + Reset loop mode + 設定迴圈 + + + + + success + 成功 + + + DeviceItem OnProHttpResponse 解析json文件错误! + DeviceItem OnProHttpResponse 解析json檔案錯誤! + + + + CtrlVerifyClockPanel + + + Verify Clock Configuration + 校準時間 + + + + + Verify to Computer time + 校準到電腦時間 + + + + Cur time of controller + 顯示幕設備當前時間 + + + + + LAN + 局域網 + + + + + + + + + + + + + + Tip + 提示 + + + + + + + + + + + + + + NoSelectedController + 請先選擇大螢幕 + + + screenSwitch 開關屏 - + YES - + NO - + volume 音量 - + brightness 亮度 - - + + identificationCode 識別碼 - - + + delaySync 時間偏移 - - + + msec 毫秒 - - - - + + + + OtherSyncItem 其他同步項 - - - - + + + + lastSynchronousTime 上次同步時間 - + checkNtpTime 同步間隔 - + Lora identity Lora身份 - + (min/time) (分鐘/次) - + identification code 同步识别码 - + Time offset(msec) 時間偏移(毫秒) - + Brightness 屏体亮度 - + Volume 音量 - + Screen on/off 螢幕開關 - - + + Slave - + NTP Server NTP服務器 - - + + NTP Server address NTP服務器地址 - + TimeZone 時區 - - - - - + + + + + Set 設定 - + Language: 語言: - + Enable Synchronous playing 使能同步画面功能 - - + + Sync time interval 同步時間間隔 - - - - + + + + Readback 回讀 - - + + Master - + Identification Code 識別碼 - - + + SetNtpServer 設定NTP服務 - - + + MasterSwitch 設定為主設備 - - + + SlaveSwitch 設定為從設備 - + IsMasterSlave 回讀主從身份 - - + + GetControllerDate 獲取日期時間 - - + + SetingSyncMethod 設定同步方法 - - + + SyncTime 校準時間 - - + + GetNtpServer 獲取NTP服務資訊 - - + + GetingSyncMethod 獲取同步方式 - - + + SetTimezone 設定時區 + + CtrlVolumePanel + + + + + + Tip + 提示 + + + + + + + NoSelectedController + 請先選擇大螢幕 + + + + + SetVolume + 音量調節 + + + + + GetVolume + 獲取當前音量 + + + + Import File + 導入檔案 + + + + + Volume Schedule (*.vols) + + + + + Save File + 保存 + + + + + SetAutoVolumeTask + 配寘定時音量表 + + + + GetAutoVolumeTask + 獲取定時音量表 + + + + Volume Control + 音量調節 + + + + Manual + 手動 + + + + Schedule + 定時 + + + + Volume + 音量 + + + + + Readback + 回讀 + + + + Default volume + 默認音量值 + + + + Add + 添加 + + + + Clear + 清空 + + + + Delete + 删除 + + + + Import + 導入 + + + + Export + 匯出 + + + + Volume value + 音量值 + + + + Start Time + 開始時間 + + + + End Time + 結束時間 + + + + SUN + 星期日 + + + + MON + 星期一 + + + + TUE + 星期二 + + + + WED + 星期三 + + + + THU + 星期四 + + + + FRI + 星期五 + + + + SAT + 星期六 + + + + Apply + 應用 + + + + Default volume tip + 提醒:定時時間段以外的時間顯示幕為默認亮度 + + Def @@ -3307,10 +3407,10 @@ 設備回復 - - - - + + + + Success 成功 @@ -3323,79 +3423,79 @@ DeviceCtrlPanel - - - - + + + + Current Screen 当前屏幕 - - + + none - - + + Clear 清空 - - + + Multi screen operation 多屏操作 - - + + selected num 選中數目 - + Brightness Adjustment 亮度調節 - + Power Control 電源控制 - + Net Config 網絡配寘 - + Time Sync 對時管理 - + Video source 同異步配寘 - + Password 設寘密碼 - + Advanced 高級設定 - + Test 測試 - + Volume Adj. 音量調節 @@ -3403,350 +3503,343 @@ DeviceItem - + GetScreenDetailInfo 更多資訊 - + ReadbackPic 回讀畫面 - + + + Error + 錯誤 + + + Input password 輸入密碼 - + + VerifyPassword + 驗證密碼 + + + GetScreenshotFull 回讀畫面 - cur brightness: - 當前亮度: + 當前亮度: - - android version: - 安卓版本: + Android Version + 安卓版本: - - IMEI: - + FPGA Version + FPGA版本: - - HardWard Version: - FPGA版本: + Brightness Level + 亮度等級: - - MAX Brightness level: - 亮度等級: + Android OS Resolution + 安卓分辯率: - - Android OS Resolution: - 安卓分辯率: + Firmware Version + 固件版本: - - Firmware Version: - 固件版本: + Player Version + 播放機固件版本: - - Player Version: - 播放機固件版本: - - - Detail Info - 詳細資訊 + 詳細資訊 - - - - - - - - - - - - - - - receive - 接收 + 接收 - - AliIotSetting - - - - - GetScreenStatus - 獲取螢幕狀態 + 獲取螢幕狀態 - - Status - 狀態 + 狀態 - + Tip Info 提示 - + password is wrong 密碼錯誤 - GetBrightness - 獲取亮度值 + 獲取亮度值 - brightness - 亮度 + 亮度 - SetAutoBrightnessTask - 發送定時亮度錶 + 發送定時亮度錶 - SetAutoVolumeTask - 配寘定時音量表 + 配寘定時音量表 - SetVolume - 音量調節 + 音量調節 - GetVolume - 獲取當前音量 + 獲取當前音量 - SetTimingScreenTask - 設定螢幕定時開關任務 + 設定螢幕定時開關任務 - TestScreen - 測試螢幕 + 測試螢幕 - SetOnlineAddr - 設定web伺服器地址 + 設定web伺服器地址 - SetRealtimeServer - 設定RealTimer地址 + 設定RealTimer地址 - GetCurrentSensorBrightness - 獲取當前亮度 + 獲取當前亮度 - Cur brightness - 當前亮度 + 當前亮度 - Connect - 連接 + 連接 - timeout - 超時 + 超時 - Anycast - 點播 + 點播 - volume - 音量 + 音量 - Success - 成功 + 成功 - failed - 失敗 + 失敗 - - - - - - - - - - - - - success - 成功 + 成功 - - - - on + + On - - - - off + + Off DevicePanel - - + + All 總數 - + Online 在线 線上 - - + + Refresh 檢測 - - - + + + Specify IP 指定IP 指定IP - + Current Screen 当前屏幕 - + none - + + CheckSoftVersions + 獲取軟體版本 + + + + Current Brightness + 當前亮度 + + + + Android Version + 安卓版本 + + + + FPGA Version + FPGA版本 + + + + Brightness Level + 亮度等級 + + + + Android OS Resolution + 安卓分辯率 + + + + Firmware Version + 固件版本 + + + + Player Version + 播放機固件版本 + + + + Detail Info + 詳細資訊 + + + Specify IP list 指定IP清單 - + Search 蒐索 - - + + Attention 注意 - - + + Please input IP address! 請輸入IP地址! - + Cancel 取消 - + Screen ID 螢幕ID - + Screen IP 螢幕IP - + Screen Size 螢幕點數 - + Remark Name 別名 - + readback pic 回讀畫面 - - send - 發送 + + On + - + + Off + + + + send + 發送 + + + More Info 詳細資訊 - + Cur Brightness 螢幕當前亮度 - + Power Status 螢幕開關狀態 - + Security 加密 @@ -3755,7 +3848,7 @@ Downloader - + Updater 更新 @@ -3766,8 +3859,8 @@ - - + + Downloading updates 下载更新 @@ -3783,141 +3876,141 @@ - + Stop 停止 - - + + Time remaining 剩餘時間 - + unknown 未知 - + Error 錯誤 - + Cannot find downloaded update! 找不到下载的更新! - + Close 确认 - + Download complete! 下载完成! - + The installer will open separately 安裝程式將單獨打開 - + In order to install the update 安装更新 - + In order to install the update, you may need to quit the application. This is a mandatory update, exiting now will close the application 要安裝更新,可能需要退出應用程序。 這是強制更新,現在退出將關閉應用程序 - + Tip Info 提示 - + Click the "Open" button to apply the update 按一下“打開”按鈕應用更新 - + Are you sure you want to cancel the download? 您想現在下載更新嗎? - + Are you sure you want to cancel the download? This is a mandatory update, exiting now will close the application 確實要取消下載嗎? 這是強制更新,現在退出將關閉應用程序 - - + + %1 bytes - - + + %1 KB - - + + %1 MB - + of ,总大小 - + Downloading Updates 正在下载更新 - + Time Remaining 剩餘時間 - + Unknown 未知 - + about %1 hours 約%1小時 - + about one hour 約1小時 - + %1 minutes %1 分鐘 - + 1 minute 1 分鐘 - + %1 seconds %1 秒 - + 1 second 1 秒 @@ -3925,116 +4018,116 @@ EAClock - + Basic Properties 基本屬性 - + Time Zone 時區 - + Custom Dial 自定義錶盤 - + Select 選擇 - + Select Dail file 選擇錶盤圖片 - + Hour Mark 時標 - - + + Circular 圓形 - - + + Rectangle 矩形 - + Number 數位 - - - + + + T - + Min Mark 分標 - + Color 顏色 - + Length - + Width - + Hour Hand 時針 - + Min Hand 分針 - + Sec Hand 分針 - + Show 顯示 - + Text 文字 - + Play Properties 播放管道 - + Play Duration 播放時長 - + s @@ -4042,39 +4135,32 @@ EAudio - Basic Properties - 基本屬性 + 基本屬性 - File - 檔案 + 檔案 - Play Properties - 播放管道 + 播放管道 - Play Duration - 播放時長 + 播放時長 - Select File - 選擇檔案 + 選擇檔案 - s - + - Audio - 音訊 + 音訊 @@ -4454,37 +4540,37 @@ EGif - + Basic Properties 基本屬性 - + File 檔案 - + Select File 選擇檔案 - + Play Properties 播放管道 - + Play Duration 播放時長 - + s - + Play Times 播放次數 @@ -4492,73 +4578,73 @@ EMultiWin - + Please add media on the right 請在右邊添加媒體,可以加入多個不同媒體,LED顯示幕將按清單先後順序播放 - + Media List 媒體清單 - - - + + + Text 文字 - - - + + + Photo 圖片 - - - + + + Video 視頻 - - - + + + Gif 動畫 - - - + + + DClock 數位時鐘 - - - + + + AClock 圓形時鐘 - - - + + + Select File 選擇檔案 - - + + Environment 環境監測 - - + + Timer 計時器 @@ -4965,54 +5051,54 @@ EVideo - + Basic Properties 基本屬性 - + File 檔案 - + Play Properties 播放管道 - + Play Duration 播放時長 - + Select File 選擇檔案 - + s - + Play Times 播放次數 - + Video Transcoding - - + + Video Transcoding Progress 視頻轉碼進度 - - + + Error 錯誤 @@ -5030,17 +5116,17 @@ EWeb - + Basic Properties 基本屬性 - + Play Duration 播放時長 - + s @@ -5071,82 +5157,82 @@ GenTmpThread - + Preparing ... 準備中… - + MON 星期一 - + TUE 星期二 - + WED 星期三 - + THU 星期四 - + FRI 星期五 - + SAT 星期六 - + SUN 星期日 - + AM 上午 - + PM 下午 - + day - + hour - + min - + sec - + Create json ... 生成json… - + Scan program ... 掃描節目… @@ -5154,7 +5240,7 @@ ImgDlg - + Screenshot 螢幕截圖 @@ -5205,115 +5291,115 @@ MainWindow - + Language 語言 - + Help 幫助 - - + + Check for updates 檢查更新 - - + + firmware manager 固件管理 - - + + Software Config 軟件配寘 - - + + Info 資訊 - - - + + + About 關於 - - + + Setting 設定 - + Software Update 軟體更新 - + CurVersion 當前版本 - + Update 更新 - + LatestVersion: 最新版本: - - + + Update log: 更新日誌: - + The current version is already the latest version 已經是最新的版本 - + Device 設備管理 - + Program 節目管理 - + Control 終端控制 - + GuangYinPin 光影屏 - + Check card 一鍵找卡 - + Tip Info 提示 - + RestoreLedCardIpByUdpTip 該操作會把局域網內的所有與電腦IP不在同一網段的控制卡修復成固定IP,請謹慎操作! @@ -5424,12 +5510,12 @@ 水准靠右 - + Tip Info 提示 - + Clear all medias? 清除所有媒體? @@ -5437,84 +5523,84 @@ PageListItem - + times - + Page name 節目名稱 - + New 新建 - + Play times 播放次數 - + Sources Repeat 素材迴圈 - + Audios 音訊 - + Total Dur 總時長 - - + + s - + Select File 選擇檔案 - + Duration 時長 - + Vol 音量 - + Valid Date 有效日期 - - + + Warning 警告 - + Start Time can't be later than End Time 開始時間不能晚於結束時間 - + End Time can't be earlier than Start Time 結束時間不能早於開始時間 - + Plan 時間計畫表 @@ -5527,7 +5613,7 @@ 輸入密碼 - + Change Password 修改密碼 @@ -5535,17 +5621,17 @@ PlayWin - + Move to Top Left 移動到左上角 - + Set Position 設定位置 - + Close 關閉 @@ -5553,12 +5639,12 @@ PlayerBackSendThread - + Open file failed 檔案打開失敗 - + Read file failed 檔案讀取失敗 @@ -5579,248 +5665,246 @@ ProgCreateDlg - + Resolution 分辯率 - + Solution Information 節目資訊 - + Solution Name 節目名稱 - + Width - + Height - + Remarks 備註 - + 每段打折宽度 (用空格分隔) 每段讓利寬度(用空格分隔) - OK - 確認 + 確認 - Cancel - 取消 + 取消 ProgEditorWin - + Save 保存 - - Save as - 另存為 + 另存為 - + Setting 設定 - + Text 文字 - + Photo 圖片 - + Video 視頻 - + Gif 動畫 - + Clock 數位時鐘 - + Analog Clock 圓形時鐘 - + Environment 環境監測 - + Web 網頁 - + MuliContentWindow 多素材視窗 - + In this window, a plurality of different program materials can be added and played according to the order of joining the list; 該視窗中可以加入多個不同是節目素材,並按照加入列表的先後順序播放 - + Timer 計時器 - + Play 播放 - + Stop 停止 - + Publish 發佈 - - - - + + + Select File 選擇檔案 - + program 節目清單 - + Add page 添加頁面 - + Copy page 複製頁面 - + Delete page 删除頁面 - - + + Tip Info 提示 - + Are you sure you want to delete this program page? 確定要删除該節目頁嗎? - + Move up 向上移動一個頁面 - + Move down 向下移動一個頁面 - + widget properties 組件内容 - + Page properties 節目内容 - + Do you want to save the modifications? 是否保存修改? - - + + Create Dir failed + 創建目錄失敗 + + + Saving... 正在保存… - - + Success 成功 - Save failed - 保存失敗 + 保存失敗 - + Convertering 整理數據中 - + Generate preview data 生成預覽數據 - - + + + Error 錯誤 - + Rename fail when saving - + Remove Recursively fail when saving - + Warning 警告 @@ -5828,22 +5912,16 @@ ProgItem - - ExportButtonTip - U盤播放 + U盤播放 - - SendButtonTip - 發佈 + 發佈 - - Convertering - 整理數據中 + 整理數據中 @@ -5980,17 +6058,17 @@ ProgPortDlg - + Solution Name 節目名稱 - + Progress 進度 - + Done 完成 @@ -6002,6 +6080,77 @@ Setting up the LedOK Express... 初始化LedOK Express… + + + + Input password + 輸入密碼 + + + + VerifyPassword + 驗證密碼 + + + + + Error + 錯誤 + + + + Tip Info + 提示 + + + + password is wrong + 密碼錯誤 + + + + + ExportButtonTip + U盤播放 + + + + Usb upgrade program + U盘更新节目 + + + + Password + 密碼 + + + + + Convertering + 整理數據中 + + + + + Tip + 提示 + + + + No checked USB device + 未檢查USB設備 + + + + please select usb device in list + 請在清單中選擇usb設備 + + + + + SendButtonTip + 發佈 + SendProgThread @@ -6025,73 +6174,72 @@ SendProgramDialog - - + + Publish 發佈 - + success info - + Refresh 檢測 - Cancel - 取消 + 取消 - + Screen ID 螢幕ID - + Remark Name 別名 - + Online 線上 - + Screen IP 螢幕IP - + Screen Size 螢幕點數 - + Security 加密 - + Progress 進度 - + Remarks 備註 - + This screen is encrypted 螢幕已加密 - + All 總數 @@ -6142,50 +6290,40 @@ UpdateLedset3Dialog - LedSet3.0 Update - LedSet3.04更新 + LedSet3.04更新 - X - X + X - V1.0.0 - V1.0.0 + V1.0.0 - Update - 陞級 + 陞級 - - CurVersion - 當前版本 + 當前版本 - Apk is download finished from internet,you can select LED Screen SYNC firmware now! - 固件APK成功下載,您可以選擇需要的LED螢幕同步固件! + 固件APK成功下載,您可以選擇需要的LED螢幕同步固件! - LatestVersion: - 最新版本: + 最新版本: - Update log: - 更新日誌: + 更新日誌: - The current version is already the latest version,,you can select LED Screen SYNC firmware now! - 當前固件APK版本已經是最新版本,您可以選擇需要的LED螢幕同步固件! + 當前固件APK版本已經是最新版本,您可以選擇需要的LED螢幕同步固件! @@ -6214,268 +6352,273 @@ UpgradeApkDialog - + Update APK 更新APK - + Select apk 選擇Apk包 - + Upgrade 陞級 - + Uninstall 卸載 - + check running state 檢測運行狀態 - + Select Fpga 選擇FPGA檔案 - + Installing 正在安裝 - + Refresh 檢測 - + Cancel 取消 - + Screen ID 螢幕ID - + Remark Name 別名 - + Online 線上 - + Screen IP 螢幕IP - + Security 加密 - + Progress 進度 - + xixunplayer - + cardsystem - + taxiapp - + starter - + connection - + displayer - + FPGA FPGA - + update - + State 陳述 - - + + All 總數 - + This screen is encrypted 螢幕已加密 - - + + Select Online APK 選擇線上APK - + No Files 沒有檔案 - + Name 名稱 - + Size 大小 - + Create Time 創建時間 - - - + + Please select a file + 請選擇一個檔案 + + + + + Tip 提示 - + Is upgrading now. Please wait 正在更新,請稍後 - + NoSelectedController 請先選擇大螢幕 + - Downloading Online File 正在下載線上檔案 - - + + Error 錯誤 - + Online file is empty 線上檔案為空 - + Uploading - + Upload error 上傳錯誤 - + Install error 安裝錯誤 - + Install success 安裝成功 - + Reminder 提示 - + Reminder: Uninstalling this program may cause the device to offline, cannot be found, lost configs and have a black screen. Please uninstall with caution! 提示:卸載此程式會導致平臺掉線,找不到設備,配寘參數遺失和黑屏問題,請謹慎卸載! - + Do you want to continue? 是否繼續? - + Uninstalling 正在卸載 - + Uninstall error 卸載錯誤 - + Uninstall success 卸載成功 - + Check apk running status 監測APK運行狀態 - + Check error 檢查錯誤 - + Running 正在運行 - + Not running 沒有運行 - + The encrypted control card can be upgraded directly 加密控制卡可以直接陞級 @@ -6483,45 +6626,32 @@ UsbDetectDialog - Usb upgrade program - U盘更新节目 + U盘更新节目 - - Password - - - - OK - 確認 + 確認 - Input password - 輸入密碼 + 輸入密碼 - - Tip - 提示 + 提示 - No checked USB device - 未檢查USB設備 + 未檢查USB設備 - please select usb device in list - 請在清單中選擇usb設備 + 請在清單中選擇usb設備 - Cancel - 取消 + 取消 @@ -6535,427 +6665,384 @@ X_UIMsgBoxOk - - - TextLabel - - - - - X - - - - OK - 確認 + 確認 - Cancel - 取消 + 取消 mGuangYingPinWidget - - + + Com 串口 - - + + Main 主設備 - - - - + + + + PortName 串口名稱 - - - - + + + + BaudRate 串列傳輸速率 - - 1200 - 1200 + 1200 - - 2400 - 2400 + 2400 - - 4800 - 4800 + 4800 - - 9600 - 9600 + 9600 - - 19200 - 19200 + 19200 - - 38400 - 38400 + 38400 - - 57600 - 57600 + 57600 - - 115200 - 115200 + 115200 - - - - + + + + DataBit 數據比特 - - - + 5 5 - - - + 6 6 - - - + 7 7 - - - + 8 8 - - - - + + + + OEBit 校驗比特 - - + + No - - + + Even - - + + Odd - - + + Space - - + + Mark - - - - + + + + StopBit 停止比特 - - - + 1 1 - - - + 2 2 - - 1.5 - 1.5 + 1.5 - - + + State:Close 狀態:連接 - - - - - - - - - + + + + + + + + + Open 打開 - - + + Auxiliary 副設備 - - + + Refresh 檢測 - - + + Param configuration 參數配寘 - - + + Resend times 重發次數 - - + + Delay millsecond 延時(微秒) - + 3 3 - + 4 4 - + 9 9 - - + + Clear 清空 - - + + Debug 調試 - - - + + + 10 10 - - + + Network 網絡 - + 11 11 - + 12 12 - + 13 13 - + 14 14 - + 15 15 - + 16 16 - + 17 17 - + 18 18 - + 19 19 - + 20 20 - - + + Program number 節目號 - - + + Send 發送 - - + + Brightness 屏体亮度 - - + + Set 設定 - - + + Screen Off 關屏 - + Screen on 開屏 - - - - - - - - + + + + + + + + State:Off 狀態:斷開 - + Screen On 開屏 - - - - - - - - - - + + + + + + + + + + Close 關閉 - - + + State:On 狀態:連接 - - + + Tip 提示 - - + + OpenPort COM failed 串口打開失敗 @@ -7001,30 +7088,30 @@ wProgramPublishItem - + Input password 輸入密碼 - - - - Error - 錯誤 + + VerifyPassword + 驗證密碼 - - + Error + 錯誤 + + + Tip Info 提示 - Fail - 失敗 + 失敗 - + password is wrong 密碼錯誤 @@ -7032,24 +7119,20 @@ wUpgradeApkItem - Input password - 輸入密碼 + 輸入密碼 - Error - 錯誤 + 錯誤 - Tip Info - 提示 + 提示 - password is wrong - 密碼錯誤 + 密碼錯誤