|
1 | | -function import_concore |
2 | | - global concore; |
3 | | - |
4 | | - try |
5 | | - pid = getpid(); |
6 | | - catch exc |
7 | | - pid = feature('getpid'); |
8 | | - end |
9 | | - outputpid = fopen('concorekill.bat','w'); |
10 | | - fprintf(outputpid,'%s',['taskkill /F /PID ',num2str(pid)]); |
11 | | - fclose(outputpid); |
12 | | - |
13 | | - |
14 | | - try |
15 | | - iportfile = fopen('concore.iport'); |
16 | | - concore.iports = fscanf(iportfile,'%c'); |
17 | | - catch exc |
18 | | - iportfile = ''; |
19 | | - end |
20 | | - |
21 | | - try |
22 | | - oportfile = fopen('concore.oport'); |
23 | | - concore.oports = fscanf(oportfile,'%c'); |
24 | | - catch exc |
25 | | - oportfile = ''; |
26 | | - end |
27 | | - |
28 | | - concore.s = ''; |
29 | | - concore.olds = ''; |
30 | | - concore.delay = 1; |
31 | | - concore.retrycount = 0; |
32 | | - if exist('/in1','dir')==7 % 5/20/21 work for docker or local |
33 | | - concore.inpath = '/in'; |
34 | | - concore.outpath = '/out'; |
35 | | - else |
36 | | - concore.inpath = 'in'; |
37 | | - concore.outpath = 'out'; |
38 | | - end |
39 | | - concore.simtime = 0; |
40 | | - |
41 | | - concore_default_maxtime(100); |
42 | | -end |
| 1 | +function import_concore |
| 2 | + global concore; |
| 3 | + |
| 4 | + if ispc |
| 5 | + try |
| 6 | + pid = getpid(); |
| 7 | + catch exc |
| 8 | + pid = feature('getpid'); |
| 9 | + end |
| 10 | + outputpid = fopen('concorekill.bat','w'); |
| 11 | + fprintf(outputpid,'%s',['taskkill /F /PID ',num2str(pid)]); |
| 12 | + fclose(outputpid); |
| 13 | + end |
| 14 | + |
| 15 | + |
| 16 | + try |
| 17 | + iportfile = fopen('concore.iport'); |
| 18 | + concore.iports = fscanf(iportfile,'%c'); |
| 19 | + catch exc |
| 20 | + iportfile = ''; |
| 21 | + end |
| 22 | + |
| 23 | + try |
| 24 | + oportfile = fopen('concore.oport'); |
| 25 | + concore.oports = fscanf(oportfile,'%c'); |
| 26 | + catch exc |
| 27 | + oportfile = ''; |
| 28 | + end |
| 29 | + |
| 30 | + concore.s = ''; |
| 31 | + concore.olds = ''; |
| 32 | + concore.delay = 1; |
| 33 | + concore.retrycount = 0; |
| 34 | + if exist('/in1','dir')==7 % 5/20/21 work for docker or local |
| 35 | + concore.inpath = '/in'; |
| 36 | + concore.outpath = '/out'; |
| 37 | + else |
| 38 | + concore.inpath = 'in'; |
| 39 | + concore.outpath = 'out'; |
| 40 | + end |
| 41 | + concore.simtime = 0; |
| 42 | + |
| 43 | + concore_default_maxtime(100); |
| 44 | +end |
0 commit comments