Skip to content
Snippets Groups Projects
Commit 687b9f29 authored by Joachim Reif's avatar Joachim Reif
Browse files

Fix Problem with merger.exe.

parent 907c748f
Branches feature.editor
No related tags found
No related merge requests found
No preview for this file type
No preview for this file type
No preview for this file type
...@@ -211,7 +211,7 @@ def start_simulation(request): ...@@ -211,7 +211,7 @@ def start_simulation(request):
validate_start_message(message) validate_start_message(message)
except ValidationError: except ValidationError:
return HttpResponse("incorrect startmessage", status=400) return HttpResponse("incorrect startmessage", status=400)
# calculate_metrics() #FIXME merger does not work calculate_metrics()
return HttpResponse(True, status=200) return HttpResponse(True, status=200)
def get_files_from_folder(folder, file_prefix, file_suffix): def get_files_from_folder(folder, file_prefix, file_suffix):
...@@ -224,21 +224,22 @@ def get_files_from_folder(folder, file_prefix, file_suffix): ...@@ -224,21 +224,22 @@ def get_files_from_folder(folder, file_prefix, file_suffix):
def calculate_metrics(): def calculate_metrics():
file_list = get_files_from_folder(FOLDER_PATH / "output", "read_spikes_node", "bin") file_list = get_files_from_folder(FOLDER_PATH / "output", "read_spikes_node", "bin")
command = "cd \"{}\" & merger.exe".format(str(PurePath.as_posix(FOLDER_PATH/ "programs")))
command = str(FOLDER_PATH / "programs" / "merger.exe") #FIXME Problem with spaces in directorypath cur_path = Path.cwd();
for file in file_list: for file in file_list:
command += " "+ file command += " \"{}\"".format(file)
command += " -o \"{}\"".format(str(PurePath.as_posix(FOLDER_PATH / "output")))
command += " & cd \"{}\"".format(str(PurePath.as_posix(cur_path)))
command += " -o "+str(PurePath.as_posix(FOLDER_PATH / "output")) print(command)
res = os.popen(command) res = os.popen(command)
print(res.read()) print(res.read())
#print("NumFiles: {0}, Files: {1}".format(num_files, file_str)); #print("NumFiles: {0}, Files: {1}".format(num_files, file_str));
#req_files = file_str.encode("utf-8")
#__merger.merge(req_files)
library_path = FOLDER_PATH / "programs" / "createMetrics.so" library_path = FOLDER_PATH / "programs" / "createMetrics.so"
__creater = ct.CDLL(str(library_path)) __creater = ct.CDLL(str(library_path))
...@@ -255,12 +256,13 @@ def calculate_metrics(): ...@@ -255,12 +256,13 @@ def calculate_metrics():
print(ret) print(ret)
@login_required @login_required
@require_safe
def read_cluster_informations(request): def read_cluster_informations(request):
if request.method == "GET": if request.method == "GET":
path = FOLDER_PATH / "clusterlayout.txt" path = FOLDER_PATH / "clusterlayout.txt"
ret = {} ret = {}
BOARDS_LIST = [] global BOARDS_LIST
with open(path, "r") as file: with open(path, "r") as file:
for line in file: for line in file:
if "#" in line: if "#" in line:
...@@ -270,7 +272,7 @@ def read_cluster_informations(request): ...@@ -270,7 +272,7 @@ def read_cluster_informations(request):
BOARDS_LIST.append([]) BOARDS_LIST.append([])
content = line.split(",") content = line.split(",")
for element in content: for element in content:
element = element.replace("\n", ""); element = element.replace("\n", "")
BOARDS_LIST[-1].append(element) BOARDS_LIST[-1].append(element)
break; break;
content = line.partition(":") content = line.partition(":")
...@@ -282,6 +284,7 @@ def read_cluster_informations(request): ...@@ -282,6 +284,7 @@ def read_cluster_informations(request):
return HttpResponse("wrong method", status=405) return HttpResponse("wrong method", status=405)
@login_required @login_required
@require_safe
def get_connections_infomations(request): def get_connections_infomations(request):
if request.method == "GET": if request.method == "GET":
ret = {} ret = {}
......
This diff is collapsed.
File added
176.67845 0.01016 176.67845 0.00466
177.69260 0.00012
178.70674 0.00000
179.72089 0.00000
180.73503 0.00000
181.74918 0.00000
182.76332 0.00000
183.77747 0.00000
184.79161 0.00000
185.80576 0.00000
186.81990 0.00000
187.83405 0.00000
188.84819 0.00000
189.86234 0.00000
190.87648 0.00000
191.89062 0.00000
192.90477 0.00000
193.91891 0.00000
194.93306 0.00000
195.94720 0.00000
196.96135 0.00000
197.97549 0.00000
198.98964 0.00000
200.00378 0.00000
201.01793 0.00000
202.03207 0.00000
203.04622 0.00000
204.06036 0.00000
205.07451 0.00000
206.08865 0.00000
207.10280 0.00000
208.11694 0.00000
209.13109 0.00000
210.14523 0.00000
211.15938 0.00000
212.17352 0.00000
213.18767 0.00000
214.20181 0.00000
215.21596 0.00000
216.23010 0.00000
217.24425 0.00000
218.25839 0.00000
219.27254 0.00000
220.28668 0.00000
221.30083 0.00000
222.31497 0.00000
223.32912 0.00000
224.34326 0.00000
225.35741 0.00000
226.37155 0.00000
227.38570 0.00000
228.39984 0.00000
229.41399 0.00000
230.42813 0.00000
231.44228 0.00000
232.45642 0.00000
233.47057 0.00000
234.48471 0.00000
235.49886 0.00000
236.51300 0.00000
237.52715 0.00000
238.54129 0.00000
239.55544 0.00000
240.56958 0.00000
241.58372 0.00000
242.59787 0.00000
243.61201 0.00000
244.62616 0.00000
245.64030 0.00000
246.65445 0.00000
247.66859 0.00000
248.68274 0.00000
249.69688 0.00000
250.71103 0.00000
251.72517 0.00000
252.73932 0.00000
253.75346 0.00000
254.76761 0.00000
255.78175 0.00000
256.79590 0.00000
257.81003 0.00000
258.82416 0.00000
259.83829 0.00000
260.85242 0.00000
261.86655 0.00000
262.88068 0.00000
263.89481 0.00000
264.90894 0.00000
265.92307 0.00000
266.93719 0.00000
267.95132 0.00000
268.96545 0.00000
269.97958 0.00466
270.99371 0.00013
272.00784 0.00000
273.02197 0.00000
274.03610 0.00000
275.05023 0.00000
276.06436 0.00000
277.07849 0.00000
278.09262 0.00000
279.10675 0.00000
280.12088 0.00000
281.13501 0.00000
282.14914 0.00000
283.16327 0.00000
284.17740 0.00000
285.19153 0.00000
286.20566 0.00000
287.21979 0.00000
288.23392 0.00000
289.24805 0.00000
290.26218 0.00000
291.27631 0.00000
292.29044 0.00000
293.30457 0.00000
294.31870 0.00000
295.33282 0.00000
296.34695 0.00000
297.36108 0.00000
298.37521 0.00000
299.38934 0.00000
300.40347 0.00000
301.41760 0.00000
302.43173 0.00000
303.44586 0.00000
304.45999 0.00000
305.47412 0.00000
306.48825 0.00000
307.50238 0.00000
308.51651 0.00000
309.53064 0.00000
310.54477 0.00000
311.55890 0.00000
312.57303 0.00000
313.58716 0.00000
314.60129 0.00000
315.61542 0.00000
316.62955 0.00000
317.64368 0.00466
318.65781 0.00013
319.67194 0.00000
320.68607 0.00000
321.70020 0.00000
322.71432 0.00000
323.72845 0.00000
324.74258 0.00000
325.75671 0.00000
326.77084 0.00000
327.78497 0.00000
328.79910 0.00000
329.81323 0.00000
330.82736 0.00000
331.84149 0.00000
332.85562 0.00000
333.86975 0.00000
334.88388 0.00000
335.89801 0.00000
336.91214 0.00000
337.92627 0.00000
338.94040 0.00000
339.95453 0.00000
340.96866 0.00000
341.98279 0.00000
342.99692 0.00000
344.01105 0.00000
345.02518 0.00000
346.03931 0.00000
347.05344 0.00000
348.06757 0.00000
349.08170 0.00000
350.09583 0.00466
351.10995 0.00013
352.12408 0.00000
353.13821 0.00000
354.15234 0.00000
355.16647 0.00000
356.18060 0.00000
357.19473 0.00000
358.20886 0.00000
359.22299 0.00000
360.23712 0.00000
361.25125 0.00000
362.26538 0.00000
363.27951 0.00000
364.29364 0.00000
365.30777 0.00000
366.32190 0.00000
367.33603 0.00000
368.35016 0.00000
369.36429 0.00000
370.37842 0.00000
371.39255 0.00000
372.40668 0.00000
373.42081 0.00000
374.43494 0.00000
375.44907 0.00000
376.46320 0.00000
377.47733 0.00000
378.49146 0.00000
379.50558 0.00000
380.51971 0.00000
381.53384 0.00000
382.54797 0.00000
383.56210 0.00000
384.57623 0.00000
385.59036 0.00000
386.60449 0.00000
387.61862 0.00000
388.63275 0.00000
389.64688 0.00000
390.66101 0.00000
391.67514 0.00000
392.68927 0.00000
393.70340 0.00000
394.71753 0.00000
395.73166 0.00000
396.74579 0.00000
397.75992 0.00000
398.77405 0.00466
399.78818 0.00013
400.80231 0.00000
401.81644 0.00000
402.83057 0.00000
403.84470 0.00000
404.85883 0.00466
405.87296 0.00013
406.88708 0.00000
407.90121 0.00000
408.91534 0.00000
409.92947 0.00000
410.94360 0.00000
411.95773 0.00000
412.97186 0.00000
413.98599 0.00000
415.00012 0.00000
416.01425 0.00466
417.02838 0.00013
418.04251 0.00000
419.05664 0.00000
420.07077 0.00000
421.08490 0.00000
422.09903 0.00000
423.11316 0.00000
424.12729 0.00000
425.14142 0.00000
426.15555 0.00000
427.16968 0.00000
428.18381 0.00000
429.19794 0.00000
430.21207 0.00000
431.22620 0.00000
432.24033 0.00000
433.25446 0.00000
434.26859 0.00466
435.28271 0.00013
436.29684 0.00000
437.31097 0.00933
438.32510 0.00025
439.33923 0.00000
440.35336 0.00000
441.36749 0.00466
442.38162 0.00013
443.39575 0.00000
444.40988 0.00000
445.42401 0.00000
446.43814 0.00000
447.45227 0.00467
448.46640 0.00479
449.48053 0.00013
450.49466 0.01866
451.50879 0.01449
452.52292 0.00038
453.53705 0.00934
454.55118 0.01891
455.56531 0.00050
456.57944 0.00000
457.59357 0.00467
458.60770 0.00946
459.62183 0.00491
460.63596 0.00013
461.65009 0.00000
462.66422 0.00466
463.67834 0.00013
464.69247 0.00934
465.70660 0.01891
466.72073 0.00050
467.73486 0.00468
468.74899 0.03279
469.76312 0.02420
470.77725 0.00063
471.79138 0.01868
472.80551 0.04715
473.81964 0.00148
474.83377 0.55975
475.84790 0.01500
476.86203 0.00000
477.87616 0.00000
478.89029 0.00000
479.90442 0.00000
480.91855 0.00000
481.93268 0.00000
482.94681 0.00000
483.96094 0.00000
484.97507 0.00000
485.98920 0.00000
487.00333 0.00000
488.01746 0.00000
489.03159 0.00000
490.04572 0.00000
491.05984 0.00000
492.07397 0.00000
493.08810 0.00000
494.10223 0.00000
495.11636 0.00000
496.13049 0.00000
497.14462 0.00000
498.15875 0.00000
499.17288 0.00000
500.18701 0.00001
501.20114 0.02799
502.21527 0.00078
503.22940 0.07463
504.24353 0.00200
No preview for this file type
No preview for this file type
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment