JonYang 1 місяць тому
батько
коміт
86feda2650

+ 10 - 10
View/die-bonder-ui/MainWnd.ui

@@ -62,7 +62,7 @@
       </font>
      </property>
      <property name="text">
-      <string extracomment="焊接">Home</string>
+      <string extracomment="主页面">Home</string>
      </property>
      <property name="iconSize">
       <size>
@@ -158,7 +158,7 @@
       </font>
      </property>
      <property name="text">
-      <string extracomment="焊接">Prod. Assist</string>
+      <string extracomment="产品协助">Prod. Assist</string>
      </property>
      <property name="iconSize">
       <size>
@@ -209,7 +209,7 @@
       </font>
      </property>
      <property name="text">
-      <string extracomment="焊接">Programme</string>
+      <string extracomment="方案">Programme</string>
      </property>
      <property name="iconSize">
       <size>
@@ -260,7 +260,7 @@
       </font>
      </property>
      <property name="text">
-      <string extracomment="焊接">Message</string>
+      <string extracomment="消息">Message</string>
      </property>
      <property name="iconSize">
       <size>
@@ -311,7 +311,7 @@
       </font>
      </property>
      <property name="text">
-      <string extracomment="焊接">Calibration</string>
+      <string extracomment="校准">Calibration</string>
      </property>
      <property name="iconSize">
       <size>
@@ -362,7 +362,7 @@
       </font>
      </property>
      <property name="text">
-      <string extracomment="焊接">Module Config.</string>
+      <string extracomment="模块配置">Module Config.</string>
      </property>
      <property name="iconSize">
       <size>
@@ -413,7 +413,7 @@
       </font>
      </property>
      <property name="text">
-      <string extracomment="焊接">Diagnosis</string>
+      <string extracomment="诊断">Diagnosis</string>
      </property>
      <property name="iconSize">
       <size>
@@ -464,7 +464,7 @@
       </font>
      </property>
      <property name="text">
-      <string extracomment="焊接">System Info.</string>
+      <string extracomment="系统信息">System Info.</string>
      </property>
      <property name="iconSize">
       <size>
@@ -515,7 +515,7 @@
       </font>
      </property>
      <property name="text">
-      <string extracomment="焊接">Help</string>
+      <string extracomment="帮助">Help</string>
      </property>
      <property name="iconSize">
       <size>
@@ -546,7 +546,7 @@
       </rect>
      </property>
      <property name="text">
-      <string>CLOSE</string>
+      <string extracomment="关闭">CLOSE</string>
      </property>
     </widget>
    </widget>

+ 74 - 25
View/die-bonder-ui/OriginalWnd/DbTreeViewManager.cpp

@@ -2171,27 +2171,25 @@ void DbTreeViewManager::displayThirdLevelFields(const QList<ST_TABLE_CONTROL_DAT
                         }
                         else
                         {
-                            nMin = fieldUpLimit.toInt();
-                            nMax = fieldDownLimit.toInt();
+                            nMin = fieldDownLimit.toInt();
+                            nMax = fieldUpLimit.toInt();
 
-                            doMin = fieldUpLimit.toDouble();
-                            doMan = fieldDownLimit.toDouble();
+                            doMin = fieldDownLimit.toDouble();
+                            doMan = fieldUpLimit.toDouble();
                         }
 
-                        if (fieldType == "input")
+                        if (fieldType == "LONG")
                         {
                             //int 类型
                             QIntValidator* validator = new QIntValidator(nMin, nMax, lineEdit);
                             lineEdit->setValidator(validator);
                         }
-                        else if (fieldType == "LONG")
+                        else if (fieldType =="input")
                         {
                             QDoubleValidator* validator = new QDoubleValidator(doMin, doMan, 4, lineEdit);
                             validator->setNotation(QDoubleValidator::StandardNotation);
                             lineEdit->setValidator(validator);
                         }
-                        
-
 
                         lineEdit->setAlignment(Qt::AlignLeft);
                     
@@ -2264,25 +2262,76 @@ void DbTreeViewManager::displayThirdLevelFields(const QList<ST_TABLE_CONTROL_DAT
                         //    }
 
                         //    });
-						connect(lineEdit, &QLineEdit::textChanged, [this, lineEdit, fieldUpLimit, fieldDownLimit, pFieldDescribeLabel]() {
+						connect(lineEdit, &QLineEdit::textChanged, [this, fieldType,lineEdit, fieldUpLimit, fieldDownLimit, pFieldDescribeLabel]() {
 							if ((fieldUpLimit != "") && (fieldDownLimit != ""))
 							{
-								int uplimit = fieldUpLimit.toInt();
-								int downlimit = fieldDownLimit.toInt();
-								int inputvalue = (lineEdit->text()).toInt();
-								if ((inputvalue <= uplimit) && (inputvalue >= downlimit))
-								{
-									pFieldDescribeLabel->setProperty("value", lineEdit->text());
-                                    pFieldDescribeLabel->setDisabled(true);
-									//label->setStyleSheet("color: #5c63be;");
-									modifiedLabels.insert(pFieldDescribeLabel);
-									// m_sqlOper->updateControlData(fieldTableName, fieldName, lineEdit->text());
-									//updateDb(fieldTableName, fieldId, lineEdit->text());
-								}
-								else
-								{
-									lineEdit->setPlaceholderText(tr("out of range,please input again","超出设定范围,请重新输入"));
-								}
+                                if (fieldType == "LONG")
+                                {
+                                    int uplimit = fieldUpLimit.toInt();
+                                    int downlimit = fieldDownLimit.toInt();
+                                    int inputvalue = lineEdit->text().toInt();
+                                    if ((inputvalue <= uplimit) && (inputvalue >= downlimit))
+                                    {
+                                        pFieldDescribeLabel->setProperty("value", lineEdit->text());
+                                        pFieldDescribeLabel->setDisabled(true);
+                                        //label->setStyleSheet("color: #5c63be;");
+                                        modifiedLabels.insert(pFieldDescribeLabel);
+                                        // m_sqlOper->updateControlData(fieldTableName, fieldName, lineEdit->text());
+                                        //updateDb(fieldTableName, fieldId, lineEdit->text());
+                                    }
+                                    else
+                                    {
+                                        lineEdit->undo();
+                                        QString strErr = QString(tr("Current Limit Range:%1~%2", "当前限定范围:%1~%2").
+                                            arg(downlimit).
+                                            arg(uplimit));
+                                        JMessageTip::Message_information(strErr);
+                                        //lineEdit->setPlaceholderText(tr("out of range,please input again","超出设定范围,请重新输入"));
+                                    }
+                                }
+                                else if (fieldType == "input")
+                                {
+                                    double uplimit = fieldUpLimit.toDouble();
+                                    double downlimit = fieldDownLimit.toDouble();
+
+                                    //auto isDoubleFun = [](const QString& str)
+                                    //{
+                                    //    QRegExp regExp("^-?\\d*\\.?\\d+$");  // 匹配浮点数(包括负数)
+                                    //    return regExp.exactMatch(str);
+                                    //};
+
+                                    //double inputvalue = 0.0;
+                                    //QString isDouble = lineEdit->text();
+                                    //if (isDoubleFun(isDouble))
+                                    //{
+                                    //    inputvalue = isDouble.toDouble();
+                                    //}
+                                    //else
+                                    //{
+                                    //    inputvalue = isDouble.toInt();
+                                    //}
+                                    double inputvalue = lineEdit->text().toDouble();
+                                    if ((inputvalue <= uplimit) && (inputvalue >= downlimit))
+                                    {
+                                        pFieldDescribeLabel->setProperty("value", lineEdit->text());
+                                        pFieldDescribeLabel->setDisabled(true);
+                                        //label->setStyleSheet("color: #5c63be;");
+                                        modifiedLabels.insert(pFieldDescribeLabel);
+                                        // m_sqlOper->updateControlData(fieldTableName, fieldName, lineEdit->text());
+                                        //updateDb(fieldTableName, fieldId, lineEdit->text());
+                                    }
+                                    else
+                                    {
+                                        lineEdit->undo();
+                                        QString strErr = QString(tr("Current Limit Range:%1~%2", "当前限定范围:%1~%2").
+                                            arg(downlimit).
+                                            arg(uplimit));
+                                        JMessageTip::Message_information(strErr);
+                                        //lineEdit->setPlaceholderText(tr("out of range,please input again","超出设定范围,请重新输入"));
+                                    }
+                                }
+
+								
 							}
 							else if (fieldDownLimit != "")
 							{

+ 41 - 0
View/die-bonder-ui/OriginalWnd/TreeViewManager/JCustomLabelControls.h

@@ -218,4 +218,45 @@ private:
 };
 
 
+class YourClass : public QWidget
+{
+private:
+    QLineEdit* lineEdit;
+    QString lastValidText;  // 保存上一次的有效值
+
+public:
+    void setupLineEdit()
+    {
+        lineEdit = new QLineEdit(this);
+        QIntValidator* validator = new QIntValidator(0, 3, this);
+        lineEdit->setValidator(validator);
+
+        // 保存初始值
+        lastValidText = "0";
+
+        // 连接信号
+        connect(lineEdit, &QLineEdit::textChanged, this, &YourClass::onTextChanged);
+    }
+
+private:
+    void onTextChanged(const QString& text)
+    {
+        bool ok;
+        int value = text.toInt(&ok);
+
+        if (ok && value >= 0 && value <= 3)
+        {
+            lastValidText = text;  // 保存有效值
+        }
+        else
+        {
+            // 恢复上一次的有效值
+            lineEdit->setText(lastValidText);
+            // 将光标移到末尾
+            lineEdit->setCursorPosition(lineEdit->text().length());
+        }
+    }
+};
+
+
 #endif  //__CUSTOMLABELCONTROLS_H__

+ 32 - 25
View/die-bonder-ui/Src/Res/Translate/SBT_en.ts

@@ -389,44 +389,50 @@
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../OriginalWnd/DbTreeViewManager.cpp" line="2284"/>
-        <location filename="../../../OriginalWnd/DbTreeViewManager.cpp" line="2302"/>
-        <location filename="../../../OriginalWnd/DbTreeViewManager.cpp" line="2320"/>
+        <location filename="../../../OriginalWnd/DbTreeViewManager.cpp" line="2285"/>
+        <location filename="../../../OriginalWnd/DbTreeViewManager.cpp" line="2326"/>
+        <source>Current Limit Range:%1~%2</source>
+        <comment>当前限定范围:%1~%2</comment>
+        <translation type="unfinished"></translation>
+    </message>
+    <message>
+        <location filename="../../../OriginalWnd/DbTreeViewManager.cpp" line="2351"/>
+        <location filename="../../../OriginalWnd/DbTreeViewManager.cpp" line="2369"/>
         <source>out of range,please input again</source>
         <comment>超出设定范围,请重新输入</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../OriginalWnd/DbTreeViewManager.cpp" line="2868"/>
-        <location filename="../../../OriginalWnd/DbTreeViewManager.cpp" line="2887"/>
-        <location filename="../../../OriginalWnd/DbTreeViewManager.cpp" line="2928"/>
+        <location filename="../../../OriginalWnd/DbTreeViewManager.cpp" line="2917"/>
+        <location filename="../../../OriginalWnd/DbTreeViewManager.cpp" line="2936"/>
+        <location filename="../../../OriginalWnd/DbTreeViewManager.cpp" line="2977"/>
         <source>Open</source>
         <comment>开</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../OriginalWnd/DbTreeViewManager.cpp" line="2868"/>
-        <location filename="../../../OriginalWnd/DbTreeViewManager.cpp" line="2897"/>
-        <location filename="../../../OriginalWnd/DbTreeViewManager.cpp" line="2933"/>
+        <location filename="../../../OriginalWnd/DbTreeViewManager.cpp" line="2917"/>
+        <location filename="../../../OriginalWnd/DbTreeViewManager.cpp" line="2946"/>
+        <location filename="../../../OriginalWnd/DbTreeViewManager.cpp" line="2982"/>
         <source>Close</source>
         <comment>关</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../OriginalWnd/DbTreeViewManager.cpp" line="4163"/>
+        <location filename="../../../OriginalWnd/DbTreeViewManager.cpp" line="4210"/>
         <source>Save</source>
         <comment>保存</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../OriginalWnd/DbTreeViewManager.cpp" line="4187"/>
+        <location filename="../../../OriginalWnd/DbTreeViewManager.cpp" line="4234"/>
         <source>No components were modified!</source>
         <comment>没有任何组件被修改!</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
-        <location filename="../../../OriginalWnd/DbTreeViewManager.cpp" line="4191"/>
-        <location filename="../../../OriginalWnd/DbTreeViewManager.cpp" line="4204"/>
+        <location filename="../../../OriginalWnd/DbTreeViewManager.cpp" line="4238"/>
+        <location filename="../../../OriginalWnd/DbTreeViewManager.cpp" line="4251"/>
         <source>Modifications detected, do you want to save?</source>
         <comment>检测到修改内容,是否保存?</comment>
         <translation type="unfinished"></translation>
@@ -572,7 +578,7 @@
     <message>
         <location filename="../../common/JMessageTip.cpp" line="11"/>
         <source>hint</source>
-        <comment>��ʾ</comment>
+        <comment>提示</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
@@ -583,13 +589,13 @@
     <message>
         <location filename="../../common/JMessageTip.cpp" line="21"/>
         <source>Currently exiting.....</source>
-        <comment>��ǰ�����˳�.....</comment>
+        <comment>当前正在退出.....</comment>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../common/JMessageTip.cpp" line="22"/>
         <source>The current camera initialization failed and no camera is available.</source>
-        <comment>��ǰ������ʼ��ʧ�ܣ�û�п�������</comment>
+        <comment>当前相机初始化失败,没有可用相机</comment>
         <translation type="unfinished"></translation>
     </message>
 </context>
@@ -814,60 +820,61 @@
     <message>
         <location filename="../../../MainWnd.ui" line="65"/>
         <source>Home</source>
-        <extracomment>焊接</extracomment>
+        <extracomment>主页面</extracomment>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../MainWnd.ui" line="161"/>
         <source>Prod. Assist</source>
-        <extracomment>焊接</extracomment>
+        <extracomment>产品协助</extracomment>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../MainWnd.ui" line="212"/>
         <source>Programme</source>
-        <extracomment>焊接</extracomment>
+        <extracomment>方案</extracomment>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../MainWnd.ui" line="263"/>
         <source>Message</source>
-        <extracomment>焊接</extracomment>
+        <extracomment>消息</extracomment>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../MainWnd.ui" line="314"/>
         <source>Calibration</source>
-        <extracomment>焊接</extracomment>
+        <extracomment>校准</extracomment>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../MainWnd.ui" line="365"/>
         <source>Module Config.</source>
-        <extracomment>焊接</extracomment>
+        <extracomment>模块配置</extracomment>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../MainWnd.ui" line="416"/>
         <source>Diagnosis</source>
-        <extracomment>焊接</extracomment>
+        <extracomment>诊断</extracomment>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../MainWnd.ui" line="467"/>
         <source>System Info.</source>
-        <extracomment>焊接</extracomment>
+        <extracomment>系统信息</extracomment>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../MainWnd.ui" line="518"/>
         <source>Help</source>
-        <extracomment>焊接</extracomment>
+        <extracomment>帮助</extracomment>
         <translation type="unfinished"></translation>
     </message>
     <message>
         <location filename="../../../MainWnd.ui" line="549"/>
         <source>CLOSE</source>
+        <extracomment>关闭</extracomment>
         <translation type="unfinished"></translation>
     </message>
     <message>

BIN
View/die-bonder-ui/Src/Res/Translate/SBT_zh_CN.qm


Різницю між файлами не показано, бо вона завелика
+ 235 - 228
View/die-bonder-ui/Src/Res/Translate/SBT_zh_CN.ts


+ 2 - 0
View/die-bonder-ui/Src/RewriteControl/LightJoystickSwitchPage.cpp

@@ -641,5 +641,7 @@ void LightJoystickSwitchPage::on_modeComboBox_currentIndexChanged(int index)
             DisableLayoutWidgets(it.value(), true);
         }
     }   
+
+    m_moveAxisInfo.ModuleType = ui->modeComboBox->currentText().toStdString();
 }
 

+ 3 - 3
View/die-bonder-ui/Src/common/JMessageTip.cpp

@@ -8,7 +8,7 @@ JMessageTip::JMessageTip()
 
 void JMessageTip::Message_information(const QString& strTip, QWidget* parent /*= nullptr*/)
 {
-    QMessageBox::information(parent, tr("hint", "提示"), strTip);
+    QMessageBox::information(parent, tr("hint", "鎻愮ず"), strTip);
 }
 
 QMessageBox::StandardButton JMessageTip::Message_question(const QString& strMsg, QWidget* parent /*= nullptr*/)
@@ -18,8 +18,8 @@ QMessageBox::StandardButton JMessageTip::Message_question(const QString& strMsg,
 
 void JMessageTip::Message_warning(const QString& strMsg, QWidget* parent /*= nullptr*/)
 {
-    QMessageBox::warning(nullptr, tr("Currently exiting.....","当前正在退出....."),
-        tr("The current camera initialization failed and no camera is available.","当前相机初始化失败,没有可用相机"));
+    QMessageBox::warning(nullptr, tr("Currently exiting.....","褰撳墠姝e湪閫€鍑�....."),
+        tr("The current camera initialization failed and no camera is available.","褰撳墠鐩告満鍒濆�鍖栧け璐ワ紝娌℃湁鍙�敤鐩告満"));
 }
 
 void JMessageTip::Message_warning(const QString& title, const QString& text, QWidget* parent /*= nullptr*/)

+ 10 - 10
View/die-bonder-ui/Src/common/JMessageTip.h

@@ -1,11 +1,11 @@
 // *****************************************************************************
-// 版权所有(C)2023~2099 上海骄成超声波技术有限公司
-// 保留所有权利
+// 鐗堟潈鎵€鏈夛紙C锛�2023~2099 涓婃捣楠勬垚瓒呭0娉㈡妧鏈�湁闄愬叕鍙�
+// 淇濈暀鎵€鏈夋潈鍒�
 // *****************************************************************************
-// 作者 : 杨坚
-// 版本 : 1.0
-// 功能说明:
-//          这个是为了消息弹框做准备的,因为现在没有统一的样式
+// 浣滆€� : 鏉ㄥ潥
+// 鐗堟湰 : 1.0
+// 鍔熻兘璇存槑:
+//          杩欎釜鏄�负浜嗘秷鎭�脊妗嗗仛鍑嗗�鐨�,鍥犱负鐜板湪娌℃湁缁熶竴鐨勬牱寮�
 // *****************************************************************************
 
 #ifndef __JMESSAGETIP_H__
@@ -23,24 +23,24 @@ public:
 
     static void Message_information(const QString& strTip, QWidget* parent = nullptr);
 
-    /**询问
+    /**璇㈤棶
     */
     static QMessageBox::StandardButton Message_question(const QString& strMsg, QWidget* parent = nullptr);
 
-    /**警告消息
+    /**璀﹀憡娑堟伅
     */
     static void Message_warning(const QString& strMsg, QWidget* parent = nullptr);
 
     static void Message_warning(const QString& title, const QString& text, QWidget* parent = nullptr);
 
 
-    /**自定义
+    /**鑷�畾涔�
     */
     static void Message_critical(const QString& strTip, QWidget* parent = nullptr);
     static void Message_critical(const QString& title, const QString& text, QWidget* parent = nullptr);
 
 
-    /**先创建一个
+    /**鍏堝垱寤轰竴涓�
      */
     static void CreateCustomMessageDlg(const ns_module::ST_BUTTON_DONE& butDone);
 };

Деякі файли не було показано, через те що забагато файлів було змінено