Changeset 2477 for palm/trunk/SCRIPTS


Ignore:
Timestamp:
Sep 18, 2017 8:42:29 AM (7 years ago)
Author:
maronga
Message:

bugfix in palmrungui

Location:
palm/trunk/SCRIPTS
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SCRIPTS/palmrungui.py

    r2413 r2477  
    2525# -----------------
    2626# $Id$
     27# Renamed restart run appendix from "f" to "r". Bugfix for displaying restart runs.>
     28# Revised list of recently submitted jobs
     29#
     30# 2413 2017-09-06 12:48:29Z maronga
    2731# Renamed to palmrungui and adapted for use with palmrun instead of mrun.
    2832#
     
    8892       
    8993        self.setupUi(self)
    90         self.recent_jobs(10)
     94        self.recent_jobs(50)
    9195        commandline = self.groupBox.findChild(QtGui.QLineEdit,"commandline")
    9296        commandline.setText("")
     
    176180       
    177181        # Reload recent jobs
    178         self.recent_jobs(10)
     182        self.recent_jobs(50)
    179183       
    180184       
     
    200204        i=len(history)-1
    201205        count = 0
    202         while i>=0 and count<10:
     206        while i>=0 and count<number:
    203207            timestamp = history[i][:16]
    204208            listitem = history[i][17:len(history[i])-1]
    205             listitem = filter(None,listitem.split(" -d"))[1]
    206             listitem = filter(None,listitem.split(" -"))[0]
    207             listitem = listitem.replace(" ","");
    208209            matchitems = list_jobname.findItems(listitem, QtCore.Qt.MatchExactly)
    209210
    210211            if ( len(matchitems) == 0 ):
     212                listitem = filter(None,listitem.split(" -d"))[1]
     213                listitem = filter(None,listitem.split(" -"))[0]
     214                listitem = listitem.replace(" ","");
    211215                list_jobname.addItem(listitem);
    212216                s = "%s (%s)" % (listitem,timestamp)
     
    262266   
    263267       
    264     # select a job via doubleclick from list
     268    # select a job via click from list
    265269    #################################
    266270    def choosejob_list(self):
     
    272276        # Reload list
    273277        self.setupUi(self)
    274         self.recent_jobs(10)
     278        self.recent_jobs(50)
    275279   
    276280        # Set selected item to jobname
     
    300304                self.groupBox.findChild(QtGui.QLineEdit,"commandline").setText(palmrunline);
    301305                self.setup_gui(palmrunline);
     306                self.list_jobname.item(itemint).setSelected(True);   
     307               
    302308                return
    303309            i = i-1
     
    375381            else:
    376382                # Check if user code is available
    377                 usercode = "%s/USER_CODE/%s" % (version_path,param[0])
    378                
     383                usercode = "%s/JOBS/%s/USER_CODE" % (version_path,param[0])
     384                               
    379385                if (os.path.exists(usercode) is True):
    380386                    self.group_job.findChild(QtGui.QLabel,"label_usercode").setText("<font color='green'>User code found.</font>")
     
    390396
    391397                    jobname = self.group_job.findChild(QtGui.QLineEdit, "line_jobname").text()
    392                     restartfile = "%s/JOBS/%s/INPUT/%s_p3df" % (version_path,jobname,jobname)
     398                    restartfile = "%s/JOBS/%s/INPUT/%s_p3dr" % (version_path,jobname,jobname)
    393399
    394400                    if (os.path.exists(restartfile) == True):                 
     
    397403
    398404                        if ( drop_job == "Restart run (coupled atmosphere ocean)" ):
    399                             restartfileo = "%s/JOBS/%s/INPUT/%s_p3dof" % (version_path,jobname,jobname)
     405                            restartfileo = "%s/JOBS/%s/INPUT/%s_p3dor" % (version_path,jobname,jobname)
    400406                            if (os.path.exists(restartfileo) == True):                 
    401407                                self.group_execution.findChild(QtGui.QLabel,"label_restart").setText("hooo")
    402408                 
    403409                            else:       
    404                                 self.group_execution.findChild(QtGui.QLabel,"label_restart").setText("<font color='red'>Warning: No p3dof file found!</font>")   
     410                                self.group_execution.findChild(QtGui.QLabel,"label_restart").setText("<font color='red'>Warning: No p3dor file found!</font>")   
    405411               
    406412                    else:       
    407                         self.group_execution.findChild(QtGui.QLabel,"label_restart").setText("<font color='red'>Warning: No p3df file found!</font>")
     413                        self.group_execution.findChild(QtGui.QLabel,"label_restart").setText("<font color='red'>Warning: No p3dr file found!</font>")
    408414         
    409415               
     
    435441           
    436442            elif (drop_job == "Restart run"):           
    437                 rc_flag = "f"
     443                rc_flag = "r"
    438444           
    439445            elif (drop_job == "Precursor run (atmosphere)"):           
     
    447453           
    448454            elif (drop_job == "Restart run (coupled atmosphere ocean)"):           
    449                 rc_flag = "f"
     455                rc_flag = "r"
    450456           
    451457            param[0] = "\"d3%s" % (rc_flag)
     
    525531                param[0]="%s restart" % (param[0])
    526532   
    527                 # Check if _p3df file is available, otherwise notice user
     533                # Check if _p3dr file is available, otherwise notice user
    528534                if (status_restarts == 2):
    529535                    jobname = str(self.group_job.findChild(QtGui.QLineEdit, "line_jobname").text())[len(version_path)+len("/JOBS/"):]
    530                     restartfile = "%s/JOBS/%s/INPUT/%s_p3df" % (version_path,jobname,jobname)
     536                    restartfile = "%s/JOBS/%s/INPUT/%s_p3dr" % (version_path,jobname,jobname)
    531537                   
    532538                    if (os.path.exists(restartfile) == True):                   
     
    534540                   
    535541                    else:                   
    536                         self.group_execution.findChild(QtGui.QLabel,"label_restart").setText("<font color='red'>Warning: No p3df file found!</font>")
     542                        self.group_execution.findChild(QtGui.QLabel,"label_restart").setText("<font color='red'>Warning: No p3dr file found!</font>")
    537543
    538544            else: 
     
    767773        self.setupUi(self)
    768774        self.tabWidget.setCurrentIndex(0)
    769         self.recent_jobs(10)
     775        self.recent_jobs(50)
    770776       
    771777    # Safes current commandline and user Parameters to .sav file
     
    974980                    options_all = optionssplit[j]
    975981                    options_2 = optionssplit[j][:2]
     982                                     
    976983                    if (options_2 == "ts"):
    977984                        self.group_runcontrol.findChild(QtGui.QCheckBox,"check_ts").setChecked(True)
     
    10041011                        self.group_runcontrol.findChild(QtGui.QCheckBox,"check_pts").setChecked(True)
    10051012                   
    1006                     if (options_2 == "d3"):       
    1007                         if (options_all[:3][:-1] == "#"):
     1013                    if (options_2 == "d3"):     
     1014                        if (options_all[:3][-1] == "#"):
    10081015                            self.group_job.findChild(QtGui.QComboBox, "drop_job").setCurrentIndex(0)
    1009                        
    1010                         elif (options_all[:3][:-1] == "f"):
     1016                        elif (options_all[:3][-1] == "r"):
    10111017                            self.group_job.findChild(QtGui.QComboBox, "drop_job").setCurrentIndex(1)
    10121018                       
    1013                         elif (options_all[:3][:-1] == "o"):
     1019                        elif (options_all[:3][-1] == "o"):
    10141020                            ocean_run = True
    10151021                       
     
    10191025                        jobname = str(self.group_job.findChild(QtGui.QLineEdit,"line_jobname").text())[len(version_path)+len("/JOBS/"):]
    10201026                       
    1021                         restartfile = "%sJOBS/%s/INPUT/%s_p3df" % (version_path,jobname,jobname)
     1027                        restartfile = "%sJOBS/%s/INPUT/%s_p3dr" % (version_path,jobname,jobname)
    10221028                        if (os.path.exists(restartfile) == True):   
    10231029                            self.group_execution.findChild(QtGui.QLabel,"label_restart").setText("")
    10241030                       
    10251031                        else:
    1026                             self.group_execution.findChild(QtGui.QLabel,"label_restart").setText("<font color='red'>Warning: No p3df file \found!</font>")
     1032                            self.group_execution.findChild(QtGui.QLabel,"label_restart").setText("<font color='red'>Warning: No p3dr file \found!</font>")
    10271033                    j = j+1
    10281034
  • palm/trunk/SCRIPTS/palmrungui_files/mainwindow.ui

    r2415 r2477  
    1414    <y>0</y>
    1515    <width>600</width>
    16     <height>680</height>
     16    <height>655</height>
    1717   </rect>
    1818  </property>
     
    2626   <size>
    2727    <width>600</width>
    28     <height>680</height>
     28    <height>655</height>
    2929   </size>
    3030  </property>
     
    3232   <size>
    3333    <width>600</width>
    34     <height>680</height>
     34    <height>655</height>
    3535   </size>
    3636  </property>
     
    6767     <rect>
    6868      <x>0</x>
    69       <y>570</y>
     69      <y>550</y>
    7070      <width>601</width>
    7171      <height>81</height>
     
    7676    </property>
    7777    <property name="title">
    78      <string>palmrun</string>
     78     <string/>
    7979    </property>
    8080    <property name="flat">
     
    8484     <property name="geometry">
    8585      <rect>
    86        <x>130</x>
     86       <x>120</x>
    8787       <y>20</y>
    8888       <width>90</width>
     
    102102       <x>10</x>
    103103       <y>20</y>
    104        <width>120</width>
     104       <width>91</width>
    105105       <height>21</height>
    106106      </rect>
    107107     </property>
     108     <property name="font">
     109      <font>
     110       <weight>75</weight>
     111       <bold>true</bold>
     112      </font>
     113     </property>
    108114     <property name="text">
    109       <string>Start palmrun</string>
     115      <string>palmrun</string>
     116     </property>
     117     <property name="checkable">
     118      <bool>false</bool>
    110119     </property>
    111120    </widget>
     
    113122     <property name="geometry">
    114123      <rect>
    115        <x>220</x>
     124       <x>210</x>
    116125       <y>20</y>
    117126       <width>90</width>
     
    179188    </property>
    180189    <property name="currentIndex">
    181      <number>1</number>
     190     <number>0</number>
    182191    </property>
    183192    <widget class="QWidget" name="tab">
     
    240249         <x>10</x>
    241250         <y>65</y>
    242          <width>101</width>
     251         <width>151</width>
    243252         <height>16</height>
    244253        </rect>
    245254       </property>
    246255       <property name="text">
    247         <string>Recent 10 jobs:</string>
     256        <string>Recently submitted jobs:</string>
    248257       </property>
    249258      </widget>
     
    266275         <x>10</x>
    267276         <y>270</y>
    268          <width>291</width>
     277         <width>301</width>
    269278         <height>25</height>
    270279        </rect>
     
    307316       <property name="geometry">
    308317        <rect>
    309          <x>310</x>
     318         <x>320</x>
    310319         <y>267</y>
    311          <width>271</width>
     320         <width>261</width>
    312321         <height>31</height>
    313322        </rect>
     
    494503       <property name="geometry">
    495504        <rect>
    496          <x>330</x>
     505         <x>290</x>
    497506         <y>30</y>
    498          <width>111</width>
     507         <width>81</width>
    499508         <height>21</height>
    500509        </rect>
     
    510519       <property name="geometry">
    511520        <rect>
    512          <x>270</x>
     521         <x>230</x>
    513522         <y>25</y>
    514523         <width>51</width>
     
    528537         <x>80</x>
    529538         <y>55</y>
    530          <width>141</width>
     539         <width>101</width>
    531540         <height>20</height>
    532541        </rect>
     
    555564       <property name="geometry">
    556565        <rect>
    557          <x>330</x>
    558          <y>80</y>
    559          <width>111</width>
     566         <x>290</x>
     567         <y>55</y>
     568         <width>61</width>
    560569         <height>21</height>
    561570        </rect>
     
    568577       <property name="geometry">
    569578        <rect>
    570          <x>230</x>
    571          <y>75</y>
     579         <x>190</x>
     580         <y>50</y>
    572581         <width>91</width>
    573582         <height>21</height>
     
    584593       <property name="geometry">
    585594        <rect>
    586          <x>330</x>
    587          <y>55</y>
    588          <width>111</width>
     595         <x>290</x>
     596         <y>80</y>
     597         <width>81</width>
    589598         <height>20</height>
    590599        </rect>
     
    597606       <property name="geometry">
    598607        <rect>
    599          <x>260</x>
    600          <y>55</y>
     608         <x>220</x>
     609         <y>80</y>
    601610         <width>61</width>
    602611         <height>16</height>
     
    631640         <x>80</x>
    632641         <y>80</y>
    633          <width>141</width>
     642         <width>101</width>
    634643         <height>20</height>
    635644        </rect>
     
    663672         <x>80</x>
    664673         <y>30</y>
    665          <width>141</width>
     674         <width>101</width>
    666675         <height>20</height>
    667676        </rect>
     
    676685         <x>10</x>
    677686         <y>105</y>
    678          <width>571</width>
     687         <width>561</width>
    679688         <height>20</height>
    680689        </rect>
     
    729738       <property name="geometry">
    730739        <rect>
    731          <x>120</x>
     740         <x>150</x>
    732741         <y>120</y>
    733          <width>451</width>
     742         <width>421</width>
    734743         <height>20</height>
    735744        </rect>
     
    759768      </widget>
    760769     </widget>
     770     <zorder>group_job</zorder>
     771     <zorder>group_runcontrol</zorder>
     772     <zorder>group_execution</zorder>
     773     <zorder>groupBox</zorder>
    761774    </widget>
    762775    <widget class="QWidget" name="tab_2">
     
    961974       </property>
    962975      </widget>
    963       <zorder>check_x</zorder>
    964       <zorder>check_O</zorder>
    965       <zorder>check_k</zorder>
    966       <zorder>check_I</zorder>
    967       <zorder>check_F</zorder>
    968       <zorder>check_b</zorder>
    969       <zorder>check_Z</zorder>
    970       <zorder>line_2</zorder>
    971       <zorder>line_user</zorder>
    972       <zorder>line_w</zorder>
    973       <zorder>line_s</zorder>
    974       <zorder>line_D</zorder>
    975       <zorder>line_M</zorder>
    976       <zorder>line_m</zorder>
    977       <zorder>line_user</zorder>
    978976     </widget>
    979977     <widget class="QLabel" name="label_20">
Note: See TracChangeset for help on using the changeset viewer.