Problem mit jobkette

  • Schön kopiert und angepasst :)

    Deine Wünsch GUI kannste dir mit Koda erstellen in Scite ALT+M drücken falls nix passiert solltest du dir mal scite4autoit installieren, zu finden auf der linken seite in der Box. eventuell solltest du dir auch erstmal die hilfe anschauen und versuchen zu verstehen wie das ganze funktioniert. Kleiner Tipp was für viele einfacher ist wenn du den Opt("GUIOnEventMode", 1) benutzt das ist einfacher zu händeln. Hab dir mal die Prozessliste in deiner GUI rein geholt wie du siehst muss da einiges geändert werden. An besten immer stück für stück arbeiten nicht alles auf einmal reinschreiben das führt nur zu fehlern!

    Hier die angepasste version!

    Spoiler anzeigen
    [autoit]

    #include <GUIConstantsEx.au3>
    #include <GuiListView.au3>
    Opt('MustDeclareVars', 0)

    [/autoit] [autoit][/autoit] [autoit]

    Example()

    [/autoit] [autoit][/autoit] [autoit]

    Func Example()
    ;Local $Pause, $Resume, $mylist, $close, $msg, $input1, $refesh

    [/autoit] [autoit][/autoit] [autoit]

    GUICreate("My GUI list") ; will create a dialog box that when displayed is centered
    $input1 = GUICtrlCreateInput("Prozess eingeben", 64, 32, 175, 25)
    $Pause = GUICtrlCreateButton("Pause", 64, 62, 75, 25)
    $resume = GUICtrlCreateButton("Resume", 64, 92, 75, 25)
    $refesh = GUICtrlCreateButton("Refesh", 64, 122, 75, 25)
    $mylist = GUICtrlCreateListView("", 176, 75, 170, 150)
    _GUICtrlListView_AddColumn($mylist, "Prozess", 100)
    _GUICtrlListView_AddColumn($mylist, "PID", 50)
    GUICtrlSetLimit(-1, 200) ; to limit horizontal scrolling

    [/autoit] [autoit][/autoit] [autoit]

    $close = GUICtrlCreateButton("Exit", 64, 160, 75, 25)

    [/autoit] [autoit][/autoit] [autoit]

    GUISetState()

    [/autoit] [autoit][/autoit] [autoit]

    $msg = 0
    While $msg <> $GUI_EVENT_CLOSE
    $msg = GUIGetMsg()

    [/autoit] [autoit][/autoit] [autoit]

    Select
    Case $msg = $Pause
    ShellExecute(@ScriptDir & "\pausep.exe")
    Case $msg = $resume
    ShellExecute(@ScriptDir & "\pausep.exe")
    Case $msg = $refesh
    _GUICtrlListView_DeleteAllItems(GUICtrlGetHandle($mylist))
    $proli = ProcessList(GUICtrlRead($input1))
    _GUICtrlListView_AddArray($mylist, $proli)
    _GUICtrlListView_DeleteItem(GUICtrlGetHandle($mylist), 0)
    Case $msg = $close
    Exit
    EndSelect
    WEnd
    EndFunc ;==>Example

    [/autoit]

    P.S: Wenn du vor hast den Prozess zu Pausieren kann ich dir sagen das dieses nicht funktioniert! Du kannst den Prozess Beenden oder seine Priorität ändern mehr geht nicht meines wissens!

    Gruss DevFly

    Einmal editiert, zuletzt von DevFly (8. September 2011 um 22:39)

  • Was willste den Ausmisten links haste den OrganizeIncludes der fügt fehlende hinzu und entfernt überflüssige! Das Script kannste in Scite mit F7 erstellen lassen danach hast du eine exe die auf jeden Computer auch ohne AutoIt funktioniert.

    Gruss DevFly

  • Hallo zusammen,
    Ich hatte vor mit einer Gui meine FiniteElementeJobs zu starten und zu überwachen. Im Moment funktioniert alle Buttons außer die Jobkette, bei der soviele Jobs gestartet werden soll wie maximale Cpus vorher angegeben werden.

    Es wird die richtige Anzahl von Jobs gestartet, aber danach friert die Gui ein. Das mag daran liegen, dass ich die Funktion durch eine While-schleife programmiert habe.

    das array FilelisttoArray wird vorher aus dem Ordner input eingelesen

    [autoit]

    $n=1
    Func _startjob()
    _checkeingabe()

    $ifile=@scriptdir&"\inputlist.txt"
    FileOpen($ifile,2)
    _FileWriteFromArray($ifile,$FileListsarray)
    $inputname =FileReadLine($ifile,1)
    dim $name
    $name=StringTrimRight ($inputname,4)

    $stFile = @ScriptDir & "\standardlist.txt"
    FileOpen($stfile,2)
    $standardliste=processlist("svhost.exe")
    _filewritefromarray($stfile,$standardliste)
    $count_sta=0
    $count_sta=filereadline($stfile,0)
    _ArrayDelete($standardliste,0)
    if ProcessExists("standard.exe") then $stacount=$stacount+($cpus*$count_sta)

    $spFile = @ScriptDir & "\prelist.txt"
    FileOpen($spfile,2)
    $preliste=processlist("pre.exe")
    _filewritefromarray($spfile,$preliste)
    $count_pre=0
    $count_pre=FileReadLine($ifile,0)
    _ArrayDelete($preliste,0)
    if ProcessExists("pre.exe") then $pre_count=$pre_count+$count_pre

    ;~ _ArrayAdd($jobs, $inputname)
    ;~ _FileWriteFromArray($stFile,$jobs)
    ;~ ShellExecute ($pfad_Abaqusexe, "job=" & $name & " Input=" & $pfad_input & "\" & $inputname & " cpus="&$cpus,$pfad_workdir1)
    ;~ WinWaitActive ($pfad_abaqusexe)
    ;~ sleep (2000)
    ;~ Send ($eingabe & "{ENTER}")

    [/autoit][autoit][/autoit][autoit]

    $precount=$precount+1+$stacount+$precount
    _ArrayDelete($FileListsarray,0)
    GUICtrlDelete($list_inputfiles)
    $list_inputfiles = GUICtrlCreateList("", 220, 270, 160, 250)
    GUICtrlSetData(-1, _ArrayToString($filelistsarray))

    ;~ Processwait("pre.exe")
    ;~
    ;~
    ;~ Endif
    $precount = $precount+1;+$count_sta+$count_pre
    MsgBox(0,"pre",$precount,1)
    sleep(1500)
    _getpid() ;geht
    EndFunc

    [/autoit]

    ich habe euch hier meine kompletten Quellcode mit 510 Zeilen eingefügt.

    Spoiler anzeigen
    [autoit]

    #include <ButtonConstants.au3>
    #include <EditConstants.au3>
    #include <GUIConstantsEx.au3>
    #include <StaticConstants.au3>
    #include <WindowsConstants.au3>
    #include <Array.au3>
    #include <GuiListView.au3>
    #Include <File.au3>
    #include <GUIListBox.au3>
    #include <GuiConstantsEx.au3>

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    ;~ While $eingabe=0
    ;~ $eingabe = InputBox("Eingabe 1", "Sollen alle vorigen Ergebnisse überschrieben werden?y oder n", "y", " M1", _
    ;~ -1, -1, 0, 0)
    ;~ if not $eingabe="n" then MsgBox (0,"","nur n oder y eingeben")
    ;~ if not $eingabe="y" then MsgBox (0,"","nur n oder y eingeben")
    ;~ if $eingabe="n" then $eingabe=1
    ;~ if $eingabe="y" then $eingabe=1
    ;~ WEnd

    [/autoit] [autoit][/autoit] [autoit]

    Local $Count_pre,$stacount,$pre_count,$count_sta,$listview_pid,$preliste,$preliste2,$standardliste,$standardliste2,$menu1,$pfad_input,$inputname, $list_inputfiles,$precount, $n2, $msg, $menustate, $menutext,$filelistsarray,$sfile,$stempfile,$jobs,$pre,$standard,$ifile

    [/autoit] [autoit][/autoit] [autoit]

    GUICreate("Abaqusstartprogramm_HH",550,720) ; Erstellt ein GUI-Fenster welches mittig ausgerichtet wird

    [/autoit] [autoit][/autoit] [autoit]

    ;~ Opt('MustDeclareVars', 1)
    $cpumax1 = GUICtrlCreateInput("2", 184, 36, 21, 21,$ES_NUMBER& $ES_CENTER)
    $cpus1 = GUICtrlCreateInput("1", 184, 66, 21, 21,$ES_NUMBER& $ES_CENTER)
    $pfad_abaqusexe1 = GUICtrlCreateInput("D:\abaqus\6.9-3\exec\abq693.exe", 184, 96, 180, 21)
    $pfad_input1 = GUICtrlCreateInput("C:\input", 184, 126, 180, 21)
    $pfad_workdir2 = GUICtrlCreateInput("C:\Abaqusrechnungen", 184, 156, 180, 21)

    [/autoit] [autoit][/autoit] [autoit][/autoit] [autoit]

    ;~ $listview_pid = GUICtrlCreateListView("Process Name ", 24, 236, 180, 385)
    $listview_input = GUICtrlCreateListView("pausierte Prozesse|PID ", 220, 540, 160, 101)

    [/autoit] [autoit][/autoit] [autoit]

    ;~ _GUICtrlListView_AddColumn($listview_input, "PID", 40)
    ;~ $listview_input_l = GUICtrlCreateLabel("pausierte Prozesse", 220, 520, 150, 200)

    [/autoit] [autoit][/autoit] [autoit]

    ;~ $markiert_input = GUICtrlCreateInput("",220, 435, 150, 21)

    [/autoit] [autoit][/autoit] [autoit]

    $pfad_abaqusexe=GUICtrlRead($pfad_abaqusexe1)
    ;~ MsgBox(0,"",$pfad_abaqusexe)
    ;~ $pfad_Abaqusexe="D:\abaqus\6.9-3\exec\abq693.exe"
    $pfad_input=GUICtrlRead($pfad_input1)
    ;~ MsgBox(0,"",$pfad_input)
    ;~ $pfad_input="c:\input"
    $pfad_workdir1=GUICtrlRead($pfad_workdir2)
    ;~ MsgBox(0,"",$pfad_workdir1)
    ;~ $pfad_workdir1="c:\abaqusrechnungen"
    $cpumax=GUICtrlRead($cpumax1)
    $cpus=GUICtrlRead($cpus1)

    [/autoit] [autoit][/autoit] [autoit]

    $cpumax_l = GUICtrlCreateLabel("CpuMax", 24, 40, 75, 17)
    $cpus_l = GUICtrlCreateLabel("Cpus_pro_Rechnung", 24, 70, 145, 17)
    $startordner_l = GUICtrlCreateLabel("Startordner", 24, 100, 75, 17)
    $Inputordner_l = GUICtrlCreateLabel("Inputordner", 24, 130, 75, 17)
    $pfad_workdir2_l = GUICtrlCreateLabel("Tempordner", 24, 160, 75, 17)
    $Listview_pid_l = GUICtrlCreateLabel("Prozess in der Liste markieren", 24, 200, 110, 50)
    $Listview_input_l = GUICtrlCreateLabel("Inputfiles vor dem starten markieren", 220, 200, 110, 30)

    [/autoit] [autoit][/autoit] [autoit]

    $markiert_int=GUICtrlCreateInput("",24, 620, 135, 21)
    $markiert2_int=GUICtrlCreateInput("",160, 620, 44, 21)

    [/autoit] [autoit][/autoit] [autoit]

    $Checkbox1 = GUICtrlCreateInput("y", 184, 06, 21,0, $ES_CENTER)
    $eingabe=GUICtrlRead($Checkbox1)
    $Checkbox1_l = GUICtrlCreateLabel("Daten überschreiben", 24, 10,100,0)
    $Button_neuladen = GUICtrlCreateButton("Neu laden", 130, 680, 74,21)
    $Button_Fortsetzen = GUICtrlCreateButton("Resume", 130, 650, 74,21)
    $Button_abbrechen = GUICtrlCreateButton("Prozess abbrechen", 24, 680, 100,21)
    $Button_Pausieren = GUICtrlCreateButton("Pausieren" , 24, 650, 100,21)

    [/autoit] [autoit][/autoit] [autoit]

    $Button_helpcpumax = GUICtrlCreateButton("?", 150, 36, 21, 21, 0)

    [/autoit] [autoit][/autoit] [autoit]

    $Button_beenden = GUICtrlCreateButton("Gui Schliessen", 424, 430, 100, 50,$BS_MULTILINE )
    $Button_checki3 = GUICtrlCreateButton("Check", 130, 96, 41, 21)
    $Button_checki4 = GUICtrlCreateButton("Check", 130, 126, 41, 21)
    $Button_checki5 = GUICtrlCreateButton("Check", 130, 156, 41, 21)

    $Button_refrehinputfiles = GUICtrlCreateButton("Inputfiles neu laden", 220, 235, 160,21)

    [/autoit] [autoit][/autoit] [autoit]

    $Button_jobstartenohnefilm = GUICtrlCreateButton("Job OHNE "&@CRLF&"Filmroutine starten", 424, 235,100,50,$BS_MULTILINE )
    $Button_jobstartenmitfilm = GUICtrlCreateButton("Job MIT "&@CRLF&"Filmroutine starten", 424, 295,100,50,$BS_MULTILINE )
    $button_jobkette = GUICtrlCreateButton("Jobkette starten", 424, 370, 100, 21,$BS_MULTILINE )
    $button_delete = GUICtrlCreateButton("Eintrag entfernen", 424, 400, 100, 21)

    [/autoit] [autoit][/autoit] [autoit]

    $pfad_workdir_c = $pfad_workdir1 &"\Completed"
    if not FileExists($pfad_workdir_c) then DirCreate($pfad_workdir_c)
    $pfad_workdir_e = $pfad_workdir1&"\error"
    if not FileExists($pfad_workdir_e) then DirCreate($pfad_workdir_e)
    FileCreateShortcut($pfad_workdir_e,@DesktopDir & "\Jobs killed.lnk",@WindowsDir,"/e,c:\", "This is an Explorer link;-)", @SystemDir & "\shell32.dll", "^!t", "4", @SW_MINIMIZE)
    FileCreateShortcut($pfad_workdir_c,@DesktopDir & "\Job Completed.lnk",@WindowsDir,"/e,c:\", "", @SystemDir & "\shell32.dll", "^!t", "4", @SW_MINIMIZE)

    [/autoit] [autoit][/autoit] [autoit]

    _checkinputfiles2()
    _getPid()
    _checkeingabe()
    _checkaction()
    _plist1()

    [/autoit] [autoit][/autoit] [autoit]

    ;~ AdlibRegister("_checkinputfiles",1000)
    ;~ AdlibRegister("_checkeingabe",5000)
    AdlibRegister("_checkaction",500)
    AdlibRegister("_checkinput",500)
    AdlibRegister("_getPid",4500)
    AdlibRegister("_plist1",2500)
    _getPid()
    GUISetState()
    $n=1
    Func _startjob()
    _checkeingabe()
    $ifile=@scriptdir&"\inputlist.txt"
    FileOpen($ifile,2)
    $stFile = @ScriptDir & "\standardlist.txt"
    FileOpen($stfile,2)
    $spFile = @ScriptDir & "\prelist.txt"
    FileOpen($spfile,2)
    _FileWriteFromArray($ifile,$FileListsarray)
    $preliste=processlist("preliste.exe")
    _filewritefromarray($spfile,$preliste)
    $standardliste=processlist("standardliste.exe")
    _filewritefromarray($stfile,$standardliste)
    $count_pre=FileReadLine($ifile,0)
    $count_sta=filereadline($stfile,0)
    _ArrayDelete($preliste,0)
    _ArrayDelete($standardliste,0)
    if ProcessExists("pre.exe") then $pre_count=$pre_count+$count_pre
    if ProcessExists("standard.exe") then $stacount=$stacount+($cpus*$count_sta)
    $inputname =FileReadLine($ifile,1)
    ;~ _ArrayAdd($jobs, $inputname)
    ;~ _FileWriteFromArray($stFile,$jobs)
    dim $name
    $name=StringTrimRight ($inputname,4)
    ShellExecute ($pfad_Abaqusexe, "job=" & $name & " Input=" & $pfad_input & "\" & $inputname & " cpus="&$cpus,$pfad_workdir1)
    WinWaitActive ($pfad_abaqusexe)
    sleep (2000)
    Send ($eingabe & "{ENTER}")
    $precount=$precount+1+$stacount+$precount
    _ArrayDelete($FileListsarray,0)
    GUICtrlDelete($list_inputfiles)
    $list_inputfiles = GUICtrlCreateList("", 220, 270, 160, 250)
    GUICtrlSetData(-1, _ArrayToString($filelistsarray))

    Processwait("pre.exe")
    $count_pre=0
    ;~ $preliste=ProcessList("pre.exe")
    ;~ _FileWriteFromArray2D($spfile,$preliste)
    ;~ $count_pre = _FileCountLines($spfile)-1
    ;~ EndIf
    ;~ $count_sta=0
    ;~ if ProcessExists("standard.exe") then
    ;~ $standardliste=ProcessList("standard.exe")
    ;~ _FileWriteFromArray2D($stfile,$standardliste,1)
    ;~ $count_sta = _FileCountLines($stfile)*$cpus-1
    ;~ Endif
    $precount = $precount+1;+$count_sta+$count_pre
    MsgBox(0,"pre",$precount,1)
    sleep(1500)
    _getpid() ;geht
    EndFunc


    Func _checkinputfiles()

    GUICtrlDelete($list_inputfiles)
    $list_inputfiles = GUICtrlCreateList("", 220, 270, 160, 250)
    ;~ $filelistsarray=_FileListToArray($pfad_input,"*.inp")
    $stempfile=@ScriptDir & "\filelisttemp.txt"
    Fileopen($stempfile=@scriptdir&"\filelisttemp.txt",2)
    _FileWriteFromArray($stempFile, $FileListsarray,1)
    GUICtrlSetData(-1, _ArrayToString($filelistsarray), "Eintrag1")
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _checkinputfiles2()

    GUICtrlDelete($list_inputfiles)
    $list_inputfiles = GUICtrlCreateList("", 220, 270, 160, 250)
    $filelistsarray=_FileListToArray($pfad_input,"*.inp")
    $sfile=@ScriptDir & "\filelistkomplett.txt"

    _FileWriteFromArray($sFile, $FileListsarray,1)
    _ArrayDelete($FileListsarray,0)
    GUICtrlSetData(-1, _ArrayToString($filelistsarray), "Eintrag1")
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _checkinput()

    [/autoit] [autoit][/autoit] [autoit]

    $progname = _GUICtrlListView_GetItemTextString($listview_input)
    $progname1 = StringSplit($progname, '|', 1)
    $PID=$progname1[2]
    $name=$progname1[1]
    dim $pid
    if $pid Then
    GUICtrlSetData($markiert_int,$name)
    ;~ if $markiert<>"" then MsgBox(0,"",$markiert)
    GUICtrlSetData($markiert2_int,$PID)
    EndIf
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _checkeingabe()

    $eingabe=GUICtrlRead($checkbox1)
    $cpumax=GUICtrlRead($cpumax1)
    $cpus=GUICtrlRead($cpus1)
    if $cpus > $cpumax then
    GUICtrlSetData($cpus1,$cpumax)

    msgbox(0,"Fehler","Es können nicht mehr Cpus pro Rechnung verwendet werden als in CpuMax angegeben")
    Endif
    $pfad_abaqusexe=GUICtrlRead($pfad_abaqusexe1)
    $pfad_input=GUICtrlRead($pfad_input1)
    $pfad_workdir1=GUICtrlRead($pfad_workdir2)

    [/autoit] [autoit][/autoit] [autoit]

    if not FileExists($pfad_abaqusexe) then
    $abqexist = InputBox("Folder not Exists","Ordner existiert nicht!"&@CRLF&@CRLF&"Soll der Ordner erstellt werden?","n")
    if $abqexist="y" Then
    DirCreate($pfad_abaqusexe)
    ;~ $FileList_to_array =_FileListToArray($pfad_abaqusexe)
    ;~ FileCreateShortcut($pfad_abaqusexe,@DesktopDir & "\Input.lnk",@WindowsDir,"/e,c:\", "This is an Explorer link;-)", @SystemDir & "\shell32.dll", "^!t", "4", @SW_MINIMIZE)
    EndIf
    EndIf
    if not FileExists($pfad_input) then
    $folderexist = InputBox("Folder not Exists","Ordner existiert nicht!"&@CRLF&@CRLF&"Soll der Ordner erstellt werden?","n")
    if $folderexist="y" Then
    DirCreate($pfad_input)
    ;~ $FileList_to_array =_FileListToArray($pfad_input)
    FileCreateShortcut($pfad_input,@DesktopDir & "\Input.lnk",@WindowsDir,"/e,c:\", "This is an Explorer link;-)", @SystemDir & "\shell32.dll", "^!t", "4", @SW_MINIMIZE)
    EndIf
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    if not FileExists($pfad_workdir1) then
    $workdirexist = InputBox("Folder not Exists","Ordner existiert nicht!"&@CRLF&@CRLF&"Soll der Ordner erstellt werden?","n")
    if $workdirexist="y" Then
    DirCreate($pfad_workdir1)
    FileCreateShortcut($pfad_workdir1,@DesktopDir & "\Abaqusrechnungen.lnk",@WindowsDir,"/e,c:\", "", @SystemDir & "\shell32.dll", "^!t", "4", @SW_MINIMIZE)
    EndIf
    EndIf
    if Fileexists(@DesktopDir & "\Abaqusrechnungen.lnk") Then FileCreateShortcut($pfad_workdir1,@DesktopDir & "\Abaqusrechnungen.lnk",@WindowsDir,"/e,c:\", "", @SystemDir & "\shell32.dll", "^!t", "4", @SW_MINIMIZE)
    if Fileexists(@DesktopDir & "\Input.lnk") Then FileCreateShortcut($pfad_input,@DesktopDir & "\Input.lnk",@WindowsDir,"/e,c:\", "This is an Explorer link;-)", @SystemDir & "\shell32.dll", "^!t", "4", @SW_MINIMIZE)

    [/autoit] [autoit][/autoit] [autoit]


    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _checkaction()
    $clicknumber=_GUICtrlListBox_GetCurSel($list_inputfiles)
    $progname_ac = _GUICtrlListView_GetItemTextString($listview_pid)
    $progname1_ac = StringSplit($progname_ac, '|', 1)
    $PID_ac=$progname1_ac[2]
    $name_ac=$progname1_ac[1]

    dim $pid_ac
    if $PID_ac Then
    GUICtrlSetData($markiert_int,$name_ac)
    ;~ if $markiert<>"" then MsgBox(0,"",$markiert)
    GUICtrlSetData($markiert2_int,$PID_ac)
    EndIf
    EndFunc

    Func _startjobkette()
    While 1
    sleep(1000)
    if $precount < $CpuMax then ;läuft
    _startjob()

    EndIf

    if $precount >= $cpumax Then
    if ProcessExists("standard.exe") Then
    $precount=$precount-1+$cpus
    MsgBox(0,"pre",$precount,1)
    ;~ if $precount>$cpumax Then
    $standardliste_pid=_arraytostring($standardliste,"",1)
    dim $PID_sta
    $PID_sta=StringTrimLeft($standardliste_pid,12)
    ;~ ShellExecute (@ScriptDir & "\pausep.exe ", $standardliste_pid)
    ;~ $precount=$precount-$cpus
    MsgBox(0,"pre",$PID_sta,1)
    ;~ EndIf
    ;~ if ProcessWaitClose("standard.exe") then $precount=$precount-$cpus
    EndIf

    EndIf
    If $msg = $Button_beenden Then $msg = $GUI_EVENT_CLOSE
    if $msg = $GUI_EVENT_CLOSE then Exit
    ;~ pausiert alle "standard.exe"
    ;~ if $standardliste="1" Then
    ;~ $standardliste_Pid = $standardliste[1][1]
    ;~ msgbox(0,"standard_pid",$standardliste_Pid)
    ;~ ShellExecute (@ScriptDir & "\pausep.exe ", $standardliste_Pid)

    ;~ EndIf
    ;~ bis ProcessClose("pre.exe")
    ;~ if processclose ("pre.exe")

    if $inputname="" then ExitLoop

    WEnd

    [/autoit] [autoit][/autoit] [autoit]

    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _getPid()
    Local $ar_pause
    _GUICtrllistview_Destroy($listview_pid)
    $listview_pid = GUICtrlCreateListView("Process Name ", 24, 236, 180, 385)
    ;~ $listview_input = GUICtrlCreateListView("Inputfiles ", 220, 436, 150, 200)
    _GUICtrlListView_DeleteAllItems($listview_pid)
    _GUICtrlListView_DeleteAllItems($listview_input)
    _GUICtrlListView_AddColumn($listview_pid, "PID ", 50)
    ;~ _GUICtrlListView_AddColumn($listview_input, "PID", 40)
    ;~ $plist = ProcessList()
    ;~ local $plist
    local $preliste=ProcessList("pre.exe")
    _ArrayDelete($preliste,0)
    local $standardliste=ProcessList("standard.exe")
    _ArrayDelete($standardliste,0)
    dim $name,$pid
    ;~ ~ $ar_pause = $name & $pid

    [/autoit] [autoit][/autoit] [autoit]

    ;~
    ;~ _ArrayDelete($plist,0)

    _GUICtrlListView_DeleteAllItems(GUICtrlGetHandle($preliste))
    _GUICtrlListView_DeleteAllItems(GUICtrlGetHandle($standardliste))
    _GUICtrlListView_DeleteAllItems(GUICtrlGetHandle($ar_pause))

    ;~ _GUICtrlListView_AddArray($listview_pid, $plist)

    _GUICtrlListView_AddArray($listview_pid,$standardliste)
    _GUICtrlListView_AddArray($listview_pid,$preliste)

    _GUICtrlListView_AddArray($listview_input, $ar_pause)

    [/autoit] [autoit][/autoit] [autoit]

    ;~ _GUICtrlListView_DeleteItem(GUICtrlGetHandle($standardliste), 0)
    ;~ _GUICtrlListView_DeleteItem(GUICtrlGetHandle($preliste),0)
    _GUICtrlListView_DeleteItem(GUICtrlGetHandle($ar_pause), 0)

    [/autoit] [autoit][/autoit] [autoit]

    ;~ GUICtrlCreateListViewItem($plist, $listview_pid)
    GUICtrlCreateListViewItem($standardliste, $listview_pid)
    GUICtrlCreateListViewItem($preliste, $listview_pid)
    GUICtrlCreateListViewItem($ar_pause, $listview_input)
    ;~ _plist()
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _plist()
    local $preliste2=ProcessList("pre.exe")
    _ArrayDelete($preliste2,0)
    $preliste = $preliste2
    local $standardliste2=ProcessList("standard.exe")
    _ArrayDelete($standardliste2,0)
    $standardliste=$standardliste2
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    Func _plist1()

    [/autoit] [autoit][/autoit] [autoit]

    local $preliste=ProcessList("pre.exe")
    _ArrayDelete($preliste,0)
    If not $preliste2 = $preliste then
    $preliste2 = $preliste
    _getpid()

    Endif
    ;~ _plist()
    local $standardliste=ProcessList("standard.exe")
    _ArrayDelete($standardliste,0)
    If not $standardliste2 = $standardliste then
    $standardliste2 = $standardliste
    _getpid()

    Endif
    _plist()
    EndFunc

    [/autoit] [autoit][/autoit] [autoit]

    $1=0; Zeigt das leere GUI-Fenster
    $a=1 ; Führt das GUI aus, bis der Dialog geschlossen wird
    while $a=1
    $msg = GUIGetMsg()
    If $msg = $button_delete Then
    _ArrayDelete($FileListsarray,_GUICtrlListBox_GetCurSel($list_inputfiles))
    GUICtrlDelete($list_inputfiles)
    $list_inputfiles = GUICtrlCreateList("", 220, 270, 160, 250)
    GUICtrlSetData(-1, _ArrayToString($filelistsarray), "Eintrag1")
    EndIf

    If $msg = $Button_jobstartenohnefilm Then
    _checkeingabe()
    $inputname = Guictrlread($list_inputfiles)
    dim $name
    $name=StringTrimRight($inputname,4)
    ShellExecute ($pfad_Abaqusexe, "job="&$name&" Input="& $pfad_input&"\" & $inputname & " cpus="&$cpus,$pfad_workdir1)
    WinWaitActive($pfad_abaqusexe)

    Send($eingabe & "{ENTER}" )
    _ArrayDelete($FileListsarray,_GUICtrlListBox_GetCurSel($list_inputfiles))
    GUICtrlDelete($list_inputfiles)
    $list_inputfiles = GUICtrlCreateList("", 220, 270, 160, 250)
    GUICtrlSetData(-1, _ArrayToString($filelistsarray), "Eintrag1")


    EndIf

    If $msg = $Button_jobstartenMitFilm Then
    _checkeingabe()

    $inputname = Guictrlread($list_inputfiles)
    dim $film_mcrr_radial_for
    $film_mcrr_radial_for = $pfad_workdir1 & "\" & "film_mcrr.radial.for"
    ShellExecute ($pfad_Abaqusexe, "j=" & $inputname & " user="& $film_mcrr_radial_for & " cpus="&$cpus,$pfad_workdir1)
    sleep(3000)
    Send($eingabe&"{ENTER}")
    if processexists ("python.exe") Then _ArrayDelete($FileListsarray,_GUICtrlListBox_GetCurSel($list_inputfiles))
    GUICtrlDelete($list_inputfiles)
    $list_inputfiles = GUICtrlCreateList("", 220, 270, 160, 250)
    GUICtrlSetData(-1, _ArrayToString($filelistsarray), "Eintrag1")

    EndIf

    If $msg = $Button_refrehinputfiles Then
    _checkinputfiles2()
    EndIf

    If $msg = $Button_checki3 Then
    $pfad_abaqusexe=GUICtrlRead($pfad_abaqusexe1)
    if not FileExists($pfad_abaqusexe) then
    $abqexist = InputBox("Folder not Exists","Ordner existiert nicht!"&@CRLF&@CRLF&"Soll der Ordner erstellt werden?","n")
    if $abqexist="y" Then
    DirCreate($pfad_abaqusexe)
    $FileList_to_array =_FileListToArray($pfad_abaqusexe)
    FileCreateShortcut($pfad_abaqusexe,@DesktopDir & "\Input.lnk",@WindowsDir,"/e,c:\", "This is an Explorer link;-)", @SystemDir & "\shell32.dll", "^!t", "4", @SW_MINIMIZE)
    EndIf
    EndIf

    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    If $msg = $Button_checki4 Then
    $pfad_input=GUICtrlRead($pfad_input1)
    if not FileExists($pfad_input) then
    $folderexist = InputBox("Folder not Exists","Ordner existiert nicht!"&@CRLF&@CRLF&"Soll der Ordner erstellt werden?","n")
    if $folderexist="y" Then
    DirCreate($pfad_input)
    $FileList_to_array =_FileListToArray($pfad_input)
    FileCreateShortcut($pfad_input,@DesktopDir & "\Input.lnk",@WindowsDir,"/e,c:\", "This is an Explorer link;-)", @SystemDir & "\shell32.dll", "^!t", "4", @SW_MINIMIZE)
    EndIf
    EndIf
    EndIf

    If $msg = $Button_checki5 Then
    $pfad_workdir1=GUICtrlRead($pfad_workdir2)
    if not FileExists($pfad_workdir1) then
    $workdirexist = InputBox("Folder not Exists","Ordner existiert nicht!"&@CRLF&@CRLF&"Soll der Ordner erstellt werden?","n")
    if $workdirexist="y" Then
    DirCreate($pfad_workdir1)
    $FileList_to_array =_FileListToArray($pfad_workdir1)
    FileCreateShortcut($pfad_workdir1,@DesktopDir & "\Input.lnk",@WindowsDir,"/e,c:\", "This is an Explorer link;-)", @SystemDir & "\shell32.dll", "^!t", "4", @SW_MINIMIZE)
    EndIf
    EndIf
    EndIf

    [/autoit] [autoit][/autoit] [autoit]

    If $msg = $Button_helpcpumax Then
    ShellExecute ("dxdiag")
    EndIf

    If $msg = $Button_abbrechen Then
    $markiert=GUICtrlRead($markiert_int)
    ProcessClose($markiert)

    EndIf

    If $msg = $Button_neuladen Then _getpid()

    If $msg = $Button_Pausieren Then
    $1=$1+1
    $markiert2=GUICtrlRead($markiert2_int)
    ShellExecute (@ScriptDir & "\pausep.exe ", $markiert2)
    $progname_ac = _GUICtrlListView_GetItemTextString($listview_pid)
    $progname1_ac = StringSplit($progname_ac, '|', 0)

    $PID_ac=$progname1_ac[2]
    $name_ac=$progname1_ac[1]
    _GUICtrlListView_addItem($listview_input,$name_ac)
    _GUICtrlListView_addSubItem($listview_input,$1,$pid_ac,1)
    EndIf

    If $msg = $Button_Fortsetzen Then
    if $1<0 then $1=1
    ShellExecute (@ScriptDir & "\pausep.exe", $markiert2 & " /r")
    $1=$1+1
    $markiert2=GUICtrlRead($markiert2_int)
    $progname_ac = _GUICtrlListView_GetItemTextString($listview_pid)
    $progname1_ac = StringSplit($progname_ac, '|', 0)
    $PID_ac=$progname1_ac[2]
    $name_ac=$progname1_ac[1]
    _GUICtrlListView_addItem($listview_input,"Resume")
    _GUICtrlListView_addSubItem($listview_input,$1,$pid_ac,1)
    EndIf

    If $msg = $Button_beenden Then $msg = $GUI_EVENT_CLOSE

    [/autoit] [autoit][/autoit] [autoit]

    ;Jobschleife
    if $msg=$button_jobkette Then
    ;~ $cpuInUse=1
    _startjobkette()

    [/autoit] [autoit][/autoit] [autoit]

    EndIf

    ;~ dann standard.exe nacheinander weiterrechnen, wenn $cpu=$CpuMax
    ;~ schleife möglich
    if $msg = $GUI_EVENT_CLOSE then $a=-1
    WEnd

    [/autoit] [autoit][/autoit] [autoit][/autoit]

    2 Mal editiert, zuletzt von Qeles (17. September 2011 um 16:49)