From c39feead6b8a792b86e43e18fdf7c13ddaaf0387 Mon Sep 17 00:00:00 2001 From: nielmishra Date: Mon, 4 Jan 2016 15:14:57 +0530 Subject: beta-1 --- __init__.py | 0 __main__.py | 72 +++ buttons/download.png | Bin 0 -> 659 bytes buttons/generate.png | Bin 0 -> 2860 bytes docs/.~lock.development doc .odt# | 1 + docs/development doc .odt | Bin 0 -> 369590 bytes download.php | 53 ++- favicon.ico | Bin icons/logo.png | Bin schematic.html | 33 +- .../Screenshot from 2015-10-14 15_10_50.png | Bin 0 -> 83775 bytes .../Screenshot from 2015-10-14 15_11_03.png | Bin 0 -> 87330 bytes .../Screenshot from 2015-10-14 15_11_14.png | Bin 0 -> 98539 bytes .../Screenshot from 2015-10-14 15_11_44.png | Bin 0 -> 116979 bytes script/savenetlist.js | 137 ++++-- script/savenetlist.js~ | 511 --------------------- simulation.php | 42 ++ 17 files changed, 260 insertions(+), 589 deletions(-) create mode 100755 __init__.py create mode 100755 __main__.py create mode 100755 buttons/download.png create mode 100755 buttons/generate.png create mode 100644 docs/.~lock.development doc .odt# create mode 100644 docs/development doc .odt mode change 100644 => 100755 favicon.ico mode change 100644 => 100755 icons/logo.png create mode 100755 screenshorts/Screenshot from 2015-10-14 15_10_50.png create mode 100755 screenshorts/Screenshot from 2015-10-14 15_11_03.png create mode 100755 screenshorts/Screenshot from 2015-10-14 15_11_14.png create mode 100755 screenshorts/Screenshot from 2015-10-14 15_11_44.png delete mode 100755 script/savenetlist.js~ create mode 100755 simulation.php diff --git a/__init__.py b/__init__.py new file mode 100755 index 0000000..e69de29 diff --git a/__main__.py b/__main__.py new file mode 100755 index 0000000..dc2985a --- /dev/null +++ b/__main__.py @@ -0,0 +1,72 @@ +import os +import sys +import numpy as np + +import matplotlib +# Force matplotlib to not use any Xwindows backend. +matplotlib.use('Agg') + +import matplotlib.pyplot as plt + +def get_plot_files(file): + open_file = open(os.path.realpath(file),'r') + raw_data = open_file.read() + array = raw_data.split('* ') + + array.pop(0) + dict_data = {} + parameters = [] + parsed_files = [] + dir1 = str(file) + + + if not os.path.exists(dir1[:-4]): + os.makedirs(dir1[:-4]) + + + for i in range(len(array)): + dict_data[i] = array[i] + + sample = dict_data[i].split('\n') + write_file = open(os.path.realpath(dir1[:-4])+'/parsed_%s.txt'%(i),'w') + + for j in sample[3:]: + if j.startswith('Index'): + items = j.split() + parameters.append(items) if len(parameters) < i+1 else None + continue + if j.startswith('--') or '*' in j: + continue + else: + write_file.write(j+'\n') + + parsed_files.append(os.path.realpath(dir1[:-4])+'/parsed_%s.txt'%(i)) + return parameters, parsed_files + +def parse_files(file): + parameters, parsed_files = get_plot_files(file) + + for plot_file, parameter in zip(parsed_files, parameters): + data = np.loadtxt(plot_file, unpack=True, dtype=str) + for i in range(2, len(data)): + + plt.plot([x.strip(',') for x in data[1]], [y.strip(',') for y in data[i]]) + + try: + plt.xlabel(parameter[1]), plt.ylabel(parameter[i]) + plt.title('%s vs %s'%(parameter[1], parameter[i])) + plt.savefig(plot_file+str(i)+'.png'), plt.clf() + except IndexError: + plt.xlabel(parameter[1]), plt.ylabel('missing y label') + plt.title('%s vs missing y label'%(parameter[1], )) + plt.savefig(plot_file+str(i)+'.png'), plt.clf() + + +def main(): + + files = sys.argv[1:] + for fi in files: + parse_files(fi) + +if __name__ == '__main__': + main() diff --git a/buttons/download.png b/buttons/download.png new file mode 100755 index 0000000..29bae4b Binary files /dev/null and b/buttons/download.png differ diff --git a/buttons/generate.png b/buttons/generate.png new file mode 100755 index 0000000..57a5e16 Binary files /dev/null and b/buttons/generate.png differ diff --git a/docs/.~lock.development doc .odt# b/docs/.~lock.development doc .odt# new file mode 100644 index 0000000..59f528c --- /dev/null +++ b/docs/.~lock.development doc .odt# @@ -0,0 +1 @@ +,fossee,fossee-HP-240-G3-Notebook-PC,04.01.2016 15:01,file:///home/fossee/.config/libreoffice/4; \ No newline at end of file diff --git a/docs/development doc .odt b/docs/development doc .odt new file mode 100644 index 0000000..132a866 Binary files /dev/null and b/docs/development doc .odt differ diff --git a/download.php b/download.php index cc2a8f3..a0ecaf7 100755 --- a/download.php +++ b/download.php @@ -1,47 +1,58 @@ diff --git a/favicon.ico b/favicon.ico old mode 100644 new mode 100755 diff --git a/icons/logo.png b/icons/logo.png old mode 100644 new mode 100755 diff --git a/schematic.html b/schematic.html index 2ee409b..fee90c2 100755 --- a/schematic.html +++ b/schematic.html @@ -29,7 +29,7 @@ toolbar
$output