forked from ControlCore-Project/concore
-
Notifications
You must be signed in to change notification settings - Fork 0
/
import_concore.m
42 lines (36 loc) · 924 Bytes
/
import_concore.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
function import_concore
global concore;
try
pid = getpid();
catch exc
pid = feature('getpid');
end
outputpid = fopen('concorekill.bat','w');
fprintf(outputpid,'%s',['taskkill /F /PID ',num2str(pid)]);
fclose(outputpid);
try
iportfile = fopen('concore.iport');
concore.iports = fscanf(iportfile,'%c');
catch exc
iportfile = '';
end
try
oportfile = fopen('concore.oport');
concore.oports = fscanf(oportfile,'%c');
catch exc
oportfile = '';
end
concore.s = '';
concore.olds = '';
concore.delay = 1;
concore.retrycount = 0;
if exist('/in1','dir')==7 % 5/20/21 work for docker or local
concore.inpath = '/in';
concore.outpath = '/out';
else
concore.inpath = 'in';
concore.outpath = 'out';
end
concore.simtime = 0;
concore_default_maxtime(100);
end