- Timestamp:
- Sep 18, 2017 8:42:29 AM (7 years ago)
- Location:
- palm/trunk/SCRIPTS
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
palm/trunk/SCRIPTS/palmrungui.py
r2413 r2477 25 25 # ----------------- 26 26 # $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 27 31 # Renamed to palmrungui and adapted for use with palmrun instead of mrun. 28 32 # … … 88 92 89 93 self.setupUi(self) 90 self.recent_jobs( 10)94 self.recent_jobs(50) 91 95 commandline = self.groupBox.findChild(QtGui.QLineEdit,"commandline") 92 96 commandline.setText("") … … 176 180 177 181 # Reload recent jobs 178 self.recent_jobs( 10)182 self.recent_jobs(50) 179 183 180 184 … … 200 204 i=len(history)-1 201 205 count = 0 202 while i>=0 and count< 10:206 while i>=0 and count<number: 203 207 timestamp = history[i][:16] 204 208 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(" ","");208 209 matchitems = list_jobname.findItems(listitem, QtCore.Qt.MatchExactly) 209 210 210 211 if ( len(matchitems) == 0 ): 212 listitem = filter(None,listitem.split(" -d"))[1] 213 listitem = filter(None,listitem.split(" -"))[0] 214 listitem = listitem.replace(" ",""); 211 215 list_jobname.addItem(listitem); 212 216 s = "%s (%s)" % (listitem,timestamp) … … 262 266 263 267 264 # select a job via doubleclick from list268 # select a job via click from list 265 269 ################################# 266 270 def choosejob_list(self): … … 272 276 # Reload list 273 277 self.setupUi(self) 274 self.recent_jobs( 10)278 self.recent_jobs(50) 275 279 276 280 # Set selected item to jobname … … 300 304 self.groupBox.findChild(QtGui.QLineEdit,"commandline").setText(palmrunline); 301 305 self.setup_gui(palmrunline); 306 self.list_jobname.item(itemint).setSelected(True); 307 302 308 return 303 309 i = i-1 … … 375 381 else: 376 382 # 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 379 385 if (os.path.exists(usercode) is True): 380 386 self.group_job.findChild(QtGui.QLabel,"label_usercode").setText("<font color='green'>User code found.</font>") … … 390 396 391 397 jobname = self.group_job.findChild(QtGui.QLineEdit, "line_jobname").text() 392 restartfile = "%s/JOBS/%s/INPUT/%s_p3d f" % (version_path,jobname,jobname)398 restartfile = "%s/JOBS/%s/INPUT/%s_p3dr" % (version_path,jobname,jobname) 393 399 394 400 if (os.path.exists(restartfile) == True): … … 397 403 398 404 if ( drop_job == "Restart run (coupled atmosphere ocean)" ): 399 restartfileo = "%s/JOBS/%s/INPUT/%s_p3do f" % (version_path,jobname,jobname)405 restartfileo = "%s/JOBS/%s/INPUT/%s_p3dor" % (version_path,jobname,jobname) 400 406 if (os.path.exists(restartfileo) == True): 401 407 self.group_execution.findChild(QtGui.QLabel,"label_restart").setText("hooo") 402 408 403 409 else: 404 self.group_execution.findChild(QtGui.QLabel,"label_restart").setText("<font color='red'>Warning: No p3do ffile found!</font>")410 self.group_execution.findChild(QtGui.QLabel,"label_restart").setText("<font color='red'>Warning: No p3dor file found!</font>") 405 411 406 412 else: 407 self.group_execution.findChild(QtGui.QLabel,"label_restart").setText("<font color='red'>Warning: No p3d ffile found!</font>")413 self.group_execution.findChild(QtGui.QLabel,"label_restart").setText("<font color='red'>Warning: No p3dr file found!</font>") 408 414 409 415 … … 435 441 436 442 elif (drop_job == "Restart run"): 437 rc_flag = " f"443 rc_flag = "r" 438 444 439 445 elif (drop_job == "Precursor run (atmosphere)"): … … 447 453 448 454 elif (drop_job == "Restart run (coupled atmosphere ocean)"): 449 rc_flag = " f"455 rc_flag = "r" 450 456 451 457 param[0] = "\"d3%s" % (rc_flag) … … 525 531 param[0]="%s restart" % (param[0]) 526 532 527 # Check if _p3d ffile is available, otherwise notice user533 # Check if _p3dr file is available, otherwise notice user 528 534 if (status_restarts == 2): 529 535 jobname = str(self.group_job.findChild(QtGui.QLineEdit, "line_jobname").text())[len(version_path)+len("/JOBS/"):] 530 restartfile = "%s/JOBS/%s/INPUT/%s_p3d f" % (version_path,jobname,jobname)536 restartfile = "%s/JOBS/%s/INPUT/%s_p3dr" % (version_path,jobname,jobname) 531 537 532 538 if (os.path.exists(restartfile) == True): … … 534 540 535 541 else: 536 self.group_execution.findChild(QtGui.QLabel,"label_restart").setText("<font color='red'>Warning: No p3d ffile found!</font>")542 self.group_execution.findChild(QtGui.QLabel,"label_restart").setText("<font color='red'>Warning: No p3dr file found!</font>") 537 543 538 544 else: … … 767 773 self.setupUi(self) 768 774 self.tabWidget.setCurrentIndex(0) 769 self.recent_jobs( 10)775 self.recent_jobs(50) 770 776 771 777 # Safes current commandline and user Parameters to .sav file … … 974 980 options_all = optionssplit[j] 975 981 options_2 = optionssplit[j][:2] 982 976 983 if (options_2 == "ts"): 977 984 self.group_runcontrol.findChild(QtGui.QCheckBox,"check_ts").setChecked(True) … … 1004 1011 self.group_runcontrol.findChild(QtGui.QCheckBox,"check_pts").setChecked(True) 1005 1012 1006 if (options_2 == "d3"): 1007 if (options_all[:3][ :-1] == "#"):1013 if (options_2 == "d3"): 1014 if (options_all[:3][-1] == "#"): 1008 1015 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"): 1011 1017 self.group_job.findChild(QtGui.QComboBox, "drop_job").setCurrentIndex(1) 1012 1018 1013 elif (options_all[:3][ :-1] == "o"):1019 elif (options_all[:3][-1] == "o"): 1014 1020 ocean_run = True 1015 1021 … … 1019 1025 jobname = str(self.group_job.findChild(QtGui.QLineEdit,"line_jobname").text())[len(version_path)+len("/JOBS/"):] 1020 1026 1021 restartfile = "%sJOBS/%s/INPUT/%s_p3d f" % (version_path,jobname,jobname)1027 restartfile = "%sJOBS/%s/INPUT/%s_p3dr" % (version_path,jobname,jobname) 1022 1028 if (os.path.exists(restartfile) == True): 1023 1029 self.group_execution.findChild(QtGui.QLabel,"label_restart").setText("") 1024 1030 1025 1031 else: 1026 self.group_execution.findChild(QtGui.QLabel,"label_restart").setText("<font color='red'>Warning: No p3d ffile \found!</font>")1032 self.group_execution.findChild(QtGui.QLabel,"label_restart").setText("<font color='red'>Warning: No p3dr file \found!</font>") 1027 1033 j = j+1 1028 1034 -
palm/trunk/SCRIPTS/palmrungui_files/mainwindow.ui
r2415 r2477 14 14 <y>0</y> 15 15 <width>600</width> 16 <height>6 80</height>16 <height>655</height> 17 17 </rect> 18 18 </property> … … 26 26 <size> 27 27 <width>600</width> 28 <height>6 80</height>28 <height>655</height> 29 29 </size> 30 30 </property> … … 32 32 <size> 33 33 <width>600</width> 34 <height>6 80</height>34 <height>655</height> 35 35 </size> 36 36 </property> … … 67 67 <rect> 68 68 <x>0</x> 69 <y>5 70</y>69 <y>550</y> 70 70 <width>601</width> 71 71 <height>81</height> … … 76 76 </property> 77 77 <property name="title"> 78 <string >palmrun</string>78 <string/> 79 79 </property> 80 80 <property name="flat"> … … 84 84 <property name="geometry"> 85 85 <rect> 86 <x>1 30</x>86 <x>120</x> 87 87 <y>20</y> 88 88 <width>90</width> … … 102 102 <x>10</x> 103 103 <y>20</y> 104 <width> 120</width>104 <width>91</width> 105 105 <height>21</height> 106 106 </rect> 107 107 </property> 108 <property name="font"> 109 <font> 110 <weight>75</weight> 111 <bold>true</bold> 112 </font> 113 </property> 108 114 <property name="text"> 109 <string>Start palmrun</string> 115 <string>palmrun</string> 116 </property> 117 <property name="checkable"> 118 <bool>false</bool> 110 119 </property> 111 120 </widget> … … 113 122 <property name="geometry"> 114 123 <rect> 115 <x>2 20</x>124 <x>210</x> 116 125 <y>20</y> 117 126 <width>90</width> … … 179 188 </property> 180 189 <property name="currentIndex"> 181 <number> 1</number>190 <number>0</number> 182 191 </property> 183 192 <widget class="QWidget" name="tab"> … … 240 249 <x>10</x> 241 250 <y>65</y> 242 <width>1 01</width>251 <width>151</width> 243 252 <height>16</height> 244 253 </rect> 245 254 </property> 246 255 <property name="text"> 247 <string>Recent 10jobs:</string>256 <string>Recently submitted jobs:</string> 248 257 </property> 249 258 </widget> … … 266 275 <x>10</x> 267 276 <y>270</y> 268 <width> 291</width>277 <width>301</width> 269 278 <height>25</height> 270 279 </rect> … … 307 316 <property name="geometry"> 308 317 <rect> 309 <x>3 10</x>318 <x>320</x> 310 319 <y>267</y> 311 <width>2 71</width>320 <width>261</width> 312 321 <height>31</height> 313 322 </rect> … … 494 503 <property name="geometry"> 495 504 <rect> 496 <x> 330</x>505 <x>290</x> 497 506 <y>30</y> 498 <width> 111</width>507 <width>81</width> 499 508 <height>21</height> 500 509 </rect> … … 510 519 <property name="geometry"> 511 520 <rect> 512 <x>2 70</x>521 <x>230</x> 513 522 <y>25</y> 514 523 <width>51</width> … … 528 537 <x>80</x> 529 538 <y>55</y> 530 <width>1 41</width>539 <width>101</width> 531 540 <height>20</height> 532 541 </rect> … … 555 564 <property name="geometry"> 556 565 <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> 560 569 <height>21</height> 561 570 </rect> … … 568 577 <property name="geometry"> 569 578 <rect> 570 <x> 230</x>571 <y> 75</y>579 <x>190</x> 580 <y>50</y> 572 581 <width>91</width> 573 582 <height>21</height> … … 584 593 <property name="geometry"> 585 594 <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> 589 598 <height>20</height> 590 599 </rect> … … 597 606 <property name="geometry"> 598 607 <rect> 599 <x>2 60</x>600 <y> 55</y>608 <x>220</x> 609 <y>80</y> 601 610 <width>61</width> 602 611 <height>16</height> … … 631 640 <x>80</x> 632 641 <y>80</y> 633 <width>1 41</width>642 <width>101</width> 634 643 <height>20</height> 635 644 </rect> … … 663 672 <x>80</x> 664 673 <y>30</y> 665 <width>1 41</width>674 <width>101</width> 666 675 <height>20</height> 667 676 </rect> … … 676 685 <x>10</x> 677 686 <y>105</y> 678 <width>5 71</width>687 <width>561</width> 679 688 <height>20</height> 680 689 </rect> … … 729 738 <property name="geometry"> 730 739 <rect> 731 <x>1 20</x>740 <x>150</x> 732 741 <y>120</y> 733 <width>4 51</width>742 <width>421</width> 734 743 <height>20</height> 735 744 </rect> … … 759 768 </widget> 760 769 </widget> 770 <zorder>group_job</zorder> 771 <zorder>group_runcontrol</zorder> 772 <zorder>group_execution</zorder> 773 <zorder>groupBox</zorder> 761 774 </widget> 762 775 <widget class="QWidget" name="tab_2"> … … 961 974 </property> 962 975 </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>978 976 </widget> 979 977 <widget class="QLabel" name="label_20">
Note: See TracChangeset
for help on using the changeset viewer.