1 | waitForData(){ |
2 | waitForUpdate=true; |
3 | while (waitForUpdate) { |
4 | idle for 1 sec |
5 | newMod = (new File(testFile)).lastModified; if(newMod>lastMod) waitForUpdate=false; } |
6 | sendData(); fireEvent("Casc2dDone",ev); } |
7 | sendData(){ createContents [OutContents] copy files from casc2Dir to OutFileBase |
8 | } |
9 | Casc2dDone |
10 | event |
11 | Class cas2dThread extends Thread{ |
12 | run(){ |
13 | Process p=Runtime.getRuntime().exec(Casc2dExec); p.waitFor(); }} |
14 | run(){ |
15 | cT = new cas2c2Thread(); cT.start(); waitForData(); } |
16 | runAgain(){ |
17 | receiveData(); moreEvents =nextEvent(lmsStatusFile); |
18 | lastMod=(new File(testFile)).lastModified(); if(moreEvents) { |
19 | reactivateCasc2d(touchCommand); waitForData(); } } |
20 | receiveData(){ |
21 | getHTTPfile(ContentsFile,ContentsFileURL); for i=0;i<nfiles; i++){ |
22 | getHTTPfile(casc2dDir+fn, FileBaseURL+fn);} }} |
23 | EdysDone |
24 | event |
25 | called from Front-End |