OSDN Git Service

Fixed lib get and import table display bug
authorENDO Michiaki <dinosaur@db3.so-net.ne.jp>
Fri, 6 Mar 2015 02:52:31 +0000 (11:52 +0900)
committerENDO Michiaki <dinosaur@db3.so-net.ne.jp>
Fri, 6 Mar 2015 02:52:31 +0000 (11:52 +0900)
KODS_GUI.pro.user
mainwindow.cpp
mainwindow.h

index c6ad331..dba764c 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <!DOCTYPE QtCreatorProject>
-<!-- Written by QtCreator 3.1.2, 2015-03-05T15:54:02. -->
+<!-- Written by QtCreator 3.1.2, 2015-03-05T16:34:19. -->
 <qtcreator>
  <data>
   <variable>ProjectExplorer.Project.ActiveTarget</variable>
@@ -57,7 +57,7 @@
    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Qt 5.3.0 (gcc_64)</value>
    <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Qt 5.3.0 (gcc_64)</value>
    <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">{aa373e8a-d4f9-42e3-9eb7-d6f59780e830}</value>
-   <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
+   <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">1</value>
    <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
    <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
    <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
index 35e80ed..d0e221e 100644 (file)
@@ -265,6 +265,15 @@ void MainWindow::slot_commandExec()
         proc->write("EXIT\n");
     }
 
+    if (cmd.trimmed().startsWith("lib"))
+    {
+        proc->write("LENSSAVE\n");
+        proc->write("RTG ALL\n");
+        delay();
+        ReadFileToTable(hdir+"/LENSES/LENS.PRG");
+        qDebug() << input;
+    }
+
     cmdLine->clear();
 }
 
@@ -880,6 +889,8 @@ void MainWindow::DataRead(QString BinName, QString name, int k){
 
     qDebug() << nD;
     qDebug() << Abbe;
+    qDebug() << lC;
+    qDebug() << lD;
     table->setItem(k,3,new QTableWidgetItem(QString::number(nD)));
     table->setItem(k,4,new QTableWidgetItem(QString::number(Abbe)));
 
@@ -1286,7 +1297,7 @@ void MainWindow::slot_actionImport_Zemax()
         proc->write("ZMX2PRG "+filename.toUtf8()+"\n");
         proc->write("LENSSAVE\n");
         proc->write("RTG ALL\n");
-
+        delay();
         ReadFileToTable(hdir+"/LENSES/LENS.PRG");
         proc->write("VIE XZ\n");
         return;
@@ -1309,8 +1320,9 @@ void MainWindow::slot_actionImport_CODE_V()
     if (filename!=""){
         proc->write("\n");
         proc->write("CV2PRG "+filename.toUtf8()+"\n");
-        proc->write("RTG ALL\n");
         proc->write("LENSSAVE\n");
+        proc->write("RTG ALL\n");
+        delay();
         ReadFileToTable(hdir+"/LENSES/LENS.PRG");
         proc->write("VIE XZ\n");
         return;
@@ -1773,3 +1785,10 @@ bool MainWindow::eventFilter(QObject* object, QEvent* event)
         return QWidget::eventFilter(object, event);
 }
 
+void MainWindow::delay()  //Code from StackOverFlow
+{
+    QTime dieTime= QTime::currentTime().addMSecs(100);
+    while( QTime::currentTime() < dieTime )
+    QCoreApplication::processEvents(QEventLoop::AllEvents, 100);
+}
+
index 8a4a1e3..4efbfc3 100644 (file)
@@ -122,6 +122,8 @@ private slots:
     void InputAir();
     void InputReflector();
 
+    void delay();
+
 };