12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- clear;
- redrawoff;
- status = layoutmode;
- slash = "/";
- if (operatingsystem == "windows") {slash = "\\";}
- curdir = pwd;
- if (fileexists("temppath.txt")) {
- temppath = read("temppath.txt");
- len = length(temppath);
- temppath = substring(temppath,1,len-2);
- cd(temppath);
- if (fileexists("hostname.txt")) {
- hostname = read("hostname.txt");
- len = length(hostname);
- hostname = substring(hostname,1,len-2);
- cd(curdir);
- } else {
- cd(curdir);
- break;
- }
- } else {
- break;
- }
- files = splitstring(dir,endl);
- isCreated = false;
- fname = curdir+slash+hostname+"exec.bat";
- if (fileexists(fname)){rm(fname);}
- for(i=1:length(files)) {
- if(fileextension(files{i}) == "fsp") {
- lockfile = files{i}+".lock";
- if (!fileexists(lockfile)){
- load(files{i});
- status = layoutmode;
- if (status == 1) {
- write(fname,"IF EXIST \""+lockfile+"\" exit /b 1");
- write(fname,"copy /y NUL "+lockfile+" >NUL");
- write(fname,"\"C:\Program Files\Lumerical\FDTD\bin\fdtd-engine\" -t 32 "+files{i});
- write(fname,"del "+lockfile);
- write(fname,"exit /b 1");
- break;
- }
- }
- }
- }
- write(fname,"exit /b 0");
- redrawon;
|