From 782fb73518821fd5d64060bc3e2491b69f2702be Mon Sep 17 00:00:00 2001 From: Darsh Patel Date: Mon, 27 Apr 2020 11:12:02 +0530 Subject: [PATCH] Added django-mongo integration dependencies, minor config changes (#14) * Add simulationAPI app boilerplate * add parser to parse data from output of ngspice and return data as json * modify parser to take filepath as commandline argument * Merge Develop branch changes (#11) * EDA React application starter pack * Hotfix: Docker command * Included Arduino Frontend * Configured For github actions * Optimize build caching , add mysql , celery deps * Configure Containers * Add dev environment documentation * Added docker config for eda-frontend * Added Layout and Grid for simulator interface * Added docker config for eda-frontend * Docker config for angular-frontend Co-authored-by: dssudake Co-authored-by: Navonil Das Co-authored-by: Meet10 <61341284+meet-10@users.noreply.github.com> Co-authored-by: felixfaisal * Revert "Merge Develop branch changes (#11)" This reverts commit 719ec10f84deb3c3862f75f65e78d1641a33d920. * Added django-mongo integration dependencies and config * Remove redundant env variables * removed main * add general parser but requirerefactoring * add parser to parse output generated by ngspice for any type of analysis. needs refactoring! --- .env.public | 5 +- esim-cloud-backend/.gitignore | 3 + esim-cloud-backend/esimCloud/settings.py | 19 ++- esim-cloud-backend/requirements.txt | 12 +- esim-cloud-backend/simulationAPI/__init__.py | 0 esim-cloud-backend/simulationAPI/admin.py | 3 + esim-cloud-backend/simulationAPI/apps.py | 5 + .../simulationAPI/helpers/parse.py | 67 ++++++++ .../helpers/sample_files/data.txt | 155 ++++++++++++++++++ .../helpers/sample_files/plot_data_i.txt | 105 ++++++++++++ .../helpers/sample_files/plot_data_v.txt | 105 ++++++++++++ .../simulationAPI/migrations/__init__.py | 0 esim-cloud-backend/simulationAPI/models.py | 3 + esim-cloud-backend/simulationAPI/tests.py | 3 + esim-cloud-backend/simulationAPI/views.py | 3 + 15 files changed, 476 insertions(+), 12 deletions(-) create mode 100644 esim-cloud-backend/.gitignore create mode 100644 esim-cloud-backend/simulationAPI/__init__.py create mode 100644 esim-cloud-backend/simulationAPI/admin.py create mode 100644 esim-cloud-backend/simulationAPI/apps.py create mode 100644 esim-cloud-backend/simulationAPI/helpers/parse.py create mode 100644 esim-cloud-backend/simulationAPI/helpers/sample_files/data.txt create mode 100644 esim-cloud-backend/simulationAPI/helpers/sample_files/plot_data_i.txt create mode 100644 esim-cloud-backend/simulationAPI/helpers/sample_files/plot_data_v.txt create mode 100644 esim-cloud-backend/simulationAPI/migrations/__init__.py create mode 100644 esim-cloud-backend/simulationAPI/models.py create mode 100644 esim-cloud-backend/simulationAPI/tests.py create mode 100644 esim-cloud-backend/simulationAPI/views.py diff --git a/.env.public b/.env.public index 10c581355..7894a8ce7 100644 --- a/.env.public +++ b/.env.public @@ -10,9 +10,6 @@ MYSQL_DATABASE=esimcloud_db MYSQL_USER=user MYSQL_PASSWORD=password -SQL_DATABASE=esimcloud_db -SQL_USER=user -SQL_PASSWORD=password - MONGO_INITDB_ROOT_USERNAME=user MONGO_INITDB_ROOT_PASSWORD=password +MONGO_INITDB_DATABASE=esimcloud_db diff --git a/esim-cloud-backend/.gitignore b/esim-cloud-backend/.gitignore new file mode 100644 index 000000000..a403b4750 --- /dev/null +++ b/esim-cloud-backend/.gitignore @@ -0,0 +1,3 @@ +*.sqlite3 +__pycache__ +venv/ diff --git a/esim-cloud-backend/esimCloud/settings.py b/esim-cloud-backend/esimCloud/settings.py index 304b0abbc..e6572b2d2 100644 --- a/esim-cloud-backend/esimCloud/settings.py +++ b/esim-cloud-backend/esimCloud/settings.py @@ -24,7 +24,7 @@ # SECURITY WARNING: don't run with debug turned on in production! DEBUG = bool(os.environ.get("DJANGO_DEBUG", default=True)) -ALLOWED_HOSTS = [] +ALLOWED_HOSTS = ['0.0.0.0'] # Application definition @@ -77,11 +77,22 @@ DATABASES = { "default": { "ENGINE": os.environ.get("SQL_ENGINE", "django.db.backends.sqlite3"), - "NAME": os.environ.get("SQL_DATABASE", os.path.join(BASE_DIR, "db.sqlite3")), - "USER": os.environ.get("SQL_USER", "user"), - "PASSWORD": os.environ.get("SQL_PASSWORD", "password"), + "NAME": os.environ.get("MYSQL_DATABASE", os.path.join(BASE_DIR, "db.sqlite3")), + "USER": os.environ.get("MYSQL_USER", "user"), + "PASSWORD": os.environ.get("MYSQL_PASSWORD", "password"), "HOST": os.environ.get("SQL_HOST", "localhost"), "PORT": os.environ.get("SQL_PORT", "5432"), + }, + "mongodb":{ + "ENGINE": 'djongo', + "NAME": os.environ.get("MONGO_INITDB_DATABASE", "esimcloud_db"), + "USER": os.environ.get("MONGO_INITDB_ROOT_USERNAME", "user"), + "PASSWORD": os.environ.get("MONGO_INITDB_ROOT_PASSWORD", "password"), + "HOST": "mongodb", + "PORT": 27017, + 'AUTH_SOURCE': 'admin', + 'AUTH_MECHANISM': 'SCRAM-SHA-1', + } } diff --git a/esim-cloud-backend/requirements.txt b/esim-cloud-backend/requirements.txt index 9ac664579..884ea618b 100644 --- a/esim-cloud-backend/requirements.txt +++ b/esim-cloud-backend/requirements.txt @@ -1,18 +1,22 @@ -amqp==2.5.2 asgiref==3.2.7 billiard==3.6.3.0 +bson==0.5.8 celery==4.4.2 configparse==0.1.5 configparser==5.0.0 -Django==3.0.5 +dataclasses==0.6 +Django==2.2.12 django-cors-headers==3.2.1 -django-mysql==3.4.0 djangorestframework==3.11.0 +djongo==1.3.2 gunicorn==20.0.4 kombu==4.6.8 mysqlclient==1.4.6 +pymongo==3.10.1 +python-dateutil==2.8.1 pytz==2019.3 redis==3.4.1 -sqlparse==0.3.1 +six==1.14.0 +sqlparse==0.2.4 vine==1.3.0 whitenoise==5.0.1 diff --git a/esim-cloud-backend/simulationAPI/__init__.py b/esim-cloud-backend/simulationAPI/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/esim-cloud-backend/simulationAPI/admin.py b/esim-cloud-backend/simulationAPI/admin.py new file mode 100644 index 000000000..8c38f3f3d --- /dev/null +++ b/esim-cloud-backend/simulationAPI/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/esim-cloud-backend/simulationAPI/apps.py b/esim-cloud-backend/simulationAPI/apps.py new file mode 100644 index 000000000..501903774 --- /dev/null +++ b/esim-cloud-backend/simulationAPI/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class SimulationapiConfig(AppConfig): + name = 'simulationAPI' diff --git a/esim-cloud-backend/simulationAPI/helpers/parse.py b/esim-cloud-backend/simulationAPI/helpers/parse.py new file mode 100644 index 000000000..3ef87d307 --- /dev/null +++ b/esim-cloud-backend/simulationAPI/helpers/parse.py @@ -0,0 +1,67 @@ +import re +import json +import sys + + +def extract_data_from_ngspice_output(pathToFile): + + """ Parses the output file generated by ngspice and + returns a json containing points to plot graph. + """ + + try: + with open(pathToFile,'r') as f: + f_contents = f.readlines() + json_data = {"total_number_of_tables":0,"data":[]} + curernt_headers = [] + total_number_of_tables = 0 + + for line in f_contents: + contents_of_line = line.split() + + if('Index' in contents_of_line): + line_set = remove_duplicate_items_from_list(contents_of_line) + + if(line_set != curernt_headers): + curernt_headers = line_set + json_data["data"].append({"labels":[],"x":[],"y":[]}) + index = len(json_data["data"]) - 1 + for x in range(2,len(curernt_headers)): + json_data["data"][index]["y"].append([]) + + for x in range(1,len(curernt_headers)): + json_data["data"][index]["labels"].append(curernt_headers[x]) + total_number_of_tables += 1 + + else: + m = re.match('[0-9]+',line) + if(m): + d = (contents_of_line) + index = len(json_data["data"]) - 1 + data = json_data["data"][index] + data["x"].append(contents_of_line[1]) + + for x in range(len(data["y"])): + data["y"][x].append(contents_of_line[x+2]) + + + json_data["total_number_of_tables"] = total_number_of_tables - len(json_data["data"]) + return json.dumps(json_data) + + except IOError as e: + return "Cannot open file." + + +def remove_duplicate_items_from_list(line_list): + res = [] + for i in line_list: + if i not in res: + res.append(i) + return res + + +#for testing provide the filepath as command line argument +if __name__ == "__main__": + + filePath = sys.argv[1] + print(extract_data_from_ngspice_output(filePath)) diff --git a/esim-cloud-backend/simulationAPI/helpers/sample_files/data.txt b/esim-cloud-backend/simulationAPI/helpers/sample_files/data.txt new file mode 100644 index 000000000..458a8bb51 --- /dev/null +++ b/esim-cloud-backend/simulationAPI/helpers/sample_files/data.txt @@ -0,0 +1,155 @@ + + Transient Analysis Sun Apr 26 18:25:24 2020 +-------------------------------------------------------------------------------- +Index time in out time +-------------------------------------------------------------------------------- +0 0.000000e+00 0.000000e+00 -1.21023e-22 0.000000e+00 +1 1.000000e-05 1.570794e-02 1.570075e-02 1.000000e-05 +2 2.000000e-05 3.141572e-02 3.140645e-02 2.000000e-05 +3 4.000000e-05 6.283020e-02 6.281484e-02 4.000000e-05 +4 8.000000e-05 1.256505e-01 1.256003e-01 8.000000e-05 +5 1.600000e-04 2.512216e-01 2.504194e-01 1.600000e-04 +6 3.200000e-04 5.018086e-01 4.396405e-01 3.200000e-04 +7 5.343163e-04 8.353661e-01 5.117272e-01 5.343163e-04 +8 7.511639e-04 1.169004e+00 5.404550e-01 7.511639e-04 +9 1.014269e-03 1.566385e+00 5.610074e-01 1.014269e-03 +10 1.540478e-03 2.326420e+00 5.852507e-01 1.540478e-03 +11 2.592896e-03 3.637196e+00 6.101154e-01 2.592896e-03 +12 4.592896e-03 4.959163e+00 6.259915e-01 4.592896e-03 +13 6.592896e-03 4.386898e+00 6.198553e-01 6.592896e-03 +14 8.592896e-03 2.138988e+00 5.802750e-01 8.592896e-03 +15 1.059290e-02 -9.25943e-01 -5.21192e-01 1.059290e-02 +16 1.168731e-02 -2.52802e+00 -5.90034e-01 1.168731e-02 +17 1.260627e-02 -3.65157e+00 -6.10029e-01 1.260627e-02 +18 1.351234e-02 -4.46380e+00 -6.20549e-01 1.351234e-02 +19 1.532450e-02 -4.97404e+00 -6.26197e-01 1.532450e-02 +20 1.732450e-02 -3.72500e+00 -6.11244e-01 1.732450e-02 +21 1.932450e-02 -1.05313e+00 -5.32182e-01 1.932450e-02 +22 2.109176e-02 1.681502e+00 5.658107e-01 2.109176e-02 +23 2.284255e-02 3.894825e+00 6.136953e-01 2.284255e-02 +24 2.446551e-02 4.929676e+00 6.256863e-01 2.446551e-02 +25 2.603276e-02 4.739130e+00 6.236773e-01 2.603276e-02 +26 2.803276e-02 2.897143e+00 5.977803e-01 2.803276e-02 +27 3.003276e-02 -5.14551e-02 -5.14419e-02 3.003276e-02 +28 3.181211e-02 -2.69517e+00 -5.93524e-01 3.181211e-02 +29 3.353100e-02 -4.47693e+00 -6.20747e-01 3.353100e-02 +30 3.548425e-02 -4.94225e+00 -6.26203e-01 3.548425e-02 +31 3.748425e-02 -3.55298e+00 -6.08802e-01 3.748425e-02 +32 3.948425e-02 -8.06597e-01 -5.07973e-01 3.948425e-02 +33 4.084025e-02 1.304594e+00 5.485420e-01 4.084025e-02 +34 4.232563e-02 3.336652e+00 6.053367e-01 4.232563e-02 +35 4.432563e-02 4.888208e+00 6.256007e-01 4.432563e-02 +36 4.614809e-02 4.678280e+00 6.231567e-01 4.614809e-02 +37 4.814809e-02 2.747621e+00 5.949600e-01 4.814809e-02 +38 5.014809e-02 -2.32536e-01 -2.32009e-01 5.014809e-02 +39 5.106495e-02 -1.64179e+00 -5.64133e-01 5.106495e-02 +40 5.192012e-02 -2.83650e+00 -5.96466e-01 5.192012e-02 +41 5.288026e-02 -3.93170e+00 -6.14042e-01 5.288026e-02 +42 5.433190e-02 -4.89027e+00 -6.25323e-01 5.433190e-02 +43 5.633190e-02 -4.56865e+00 -6.21871e-01 5.633190e-02 +44 5.833190e-02 -2.50196e+00 -5.89905e-01 5.833190e-02 +45 6.033190e-02 5.203956e-01 4.469106e-01 6.033190e-02 +46 6.201058e-02 2.952352e+00 5.985459e-01 6.201058e-02 +47 6.359054e-02 4.517790e+00 6.212035e-01 6.359054e-02 +48 6.524527e-02 4.985165e+00 6.263736e-01 6.524527e-02 +49 6.724527e-02 3.806855e+00 6.123643e-01 6.724527e-02 +50 6.924527e-02 1.174457e+00 5.410754e-01 6.924527e-02 +51 7.069407e-02 -1.08163e+00 -5.34385e-01 7.069407e-02 +52 7.237416e-02 -3.39303e+00 -6.06125e-01 7.237416e-02 +53 7.412120e-02 -4.81065e+00 -6.24769e-01 7.412120e-02 +54 7.582571e-02 -4.83272e+00 -6.24761e-01 7.582571e-02 + +Index time in out time +-------------------------------------------------------------------------------- +55 7.782571e-02 -3.15590e+00 -6.02409e-01 7.782571e-02 +56 7.982571e-02 -2.73641e-01 -2.72327e-01 7.982571e-02 +57 8.082874e-02 1.287122e+00 5.479313e-01 8.082874e-02 +58 8.192022e-02 2.836635e+00 5.964361e-01 8.192022e-02 +59 8.332868e-02 4.326466e+00 6.189574e-01 8.332868e-02 +60 8.468753e-02 4.975928e+00 6.262056e-01 8.468753e-02 +61 8.668753e-02 4.313647e+00 6.188623e-01 8.668753e-02 +62 8.868753e-02 2.003700e+00 5.763923e-01 8.868753e-02 +63 9.068753e-02 -1.07159e+00 -5.33642e-01 9.068753e-02 +64 9.256918e-02 -3.61153e+00 -6.09422e-01 9.256918e-02 +65 9.445688e-02 -4.92739e+00 -6.26152e-01 9.445688e-02 +66 9.621191e-02 -4.64196e+00 -6.22698e-01 9.621191e-02 +67 9.821191e-02 -2.66332e+00 -5.93225e-01 9.821191e-02 +68 1.000000e-01 -6.12323e-15 -5.42079e-06 1.000000e-01 + + + Transient Analysis Sun Apr 26 18:25:24 2020 +-------------------------------------------------------------------------------- +Index time v1#branch +-------------------------------------------------------------------------------- +0 0.000000e+00 -1.21023e-25 +1 1.000000e-05 -7.18261e-09 +2 2.000000e-05 -9.27278e-09 +3 4.000000e-05 -1.53546e-08 +4 8.000000e-05 -5.02056e-08 +5 1.600000e-04 -8.02233e-07 +6 3.200000e-04 -6.21680e-05 +7 5.343163e-04 -3.23639e-04 +8 7.511639e-04 -6.28549e-04 +9 1.014269e-03 -1.00538e-03 +10 1.540478e-03 -1.74117e-03 +11 2.592896e-03 -3.02708e-03 +12 4.592896e-03 -4.33317e-03 +13 6.592896e-03 -3.76704e-03 +14 8.592896e-03 -1.55871e-03 +15 1.059290e-02 4.047519e-04 +16 1.168731e-02 1.937990e-03 +17 1.260627e-02 3.041544e-03 +18 1.351234e-02 3.843251e-03 +19 1.532450e-02 4.347845e-03 +20 1.732450e-02 3.113754e-03 +21 1.932450e-02 5.209497e-04 +22 2.109176e-02 -1.11569e-03 +23 2.284255e-02 -3.28113e-03 +24 2.446551e-02 -4.30399e-03 +25 2.603276e-02 -4.11545e-03 +26 2.803276e-02 -2.29936e-03 +27 3.003276e-02 1.323245e-08 +28 3.181211e-02 2.101648e-03 +29 3.353100e-02 3.856183e-03 +30 3.548425e-02 4.316048e-03 +31 3.748425e-02 2.944182e-03 +32 3.948425e-02 2.986236e-04 +33 4.084025e-02 -7.56052e-04 +34 4.232563e-02 -2.73131e-03 +35 4.432563e-02 -4.26261e-03 +36 4.614809e-02 -4.05512e-03 +37 4.814809e-02 -2.15266e-03 +38 5.014809e-02 5.269492e-07 +39 5.106495e-02 1.077659e-03 +40 5.192012e-02 2.240032e-03 +41 5.288026e-02 3.317656e-03 +42 5.433190e-02 4.264945e-03 +43 5.633190e-02 3.946775e-03 +44 5.833190e-02 1.912051e-03 +45 6.033190e-02 -7.34851e-05 +46 6.201058e-02 -2.35381e-03 +47 6.359054e-02 -3.89659e-03 +48 6.524527e-02 -4.35879e-03 +49 6.724527e-02 -3.19449e-03 +50 6.924527e-02 -6.33382e-04 +51 7.069407e-02 5.472455e-04 +52 7.237416e-02 2.786905e-03 +53 7.412120e-02 4.185885e-03 +54 7.582571e-02 4.207954e-03 + +Index time v1#branch +-------------------------------------------------------------------------------- +55 7.782571e-02 2.553494e-03 +56 7.982571e-02 1.314865e-06 +57 8.082874e-02 -7.39190e-04 +58 8.192022e-02 -2.24020e-03 +59 8.332868e-02 -3.70751e-03 +60 8.468753e-02 -4.34972e-03 +61 8.668753e-02 -3.69479e-03 +62 8.868753e-02 -1.42731e-03 +63 9.068753e-02 5.379516e-04 +64 9.256918e-02 3.002108e-03 +65 9.445688e-02 4.301241e-03 +66 9.621191e-02 4.019265e-03 +67 9.821191e-02 2.070094e-03 +68 1.000000e-01 -5.42079e-09 diff --git a/esim-cloud-backend/simulationAPI/helpers/sample_files/plot_data_i.txt b/esim-cloud-backend/simulationAPI/helpers/sample_files/plot_data_i.txt new file mode 100644 index 000000000..92cdd2add --- /dev/null +++ b/esim-cloud-backend/simulationAPI/helpers/sample_files/plot_data_i.txt @@ -0,0 +1,105 @@ + + Transient Analysis Fri Apr 24 23:37:52 2020 +-------------------------------------------------------------------------------- +Index time v1#branch v2#branch +-------------------------------------------------------------------------------- +0 0.000000e+00 0.000000e+00 -1.44364e-11 +1 5.000000e-06 -1.08398e-06 4.220864e-07 +2 1.000000e-05 -1.07855e-06 4.224245e-07 +3 2.000000e-05 -1.06529e-06 4.230573e-07 +4 3.122027e-05 -1.09702e-06 4.237329e-07 +5 4.261616e-05 -1.40088e-06 4.242644e-07 +6 5.453771e-05 -1.55219e-06 4.227076e-07 +7 7.296709e-05 -1.47175e-06 4.041312e-07 +8 9.144949e-05 -1.55369e-06 3.516220e-07 +9 1.284143e-04 -1.47267e-06 8.098758e-08 +10 2.023439e-04 -1.56072e-06 -1.30887e-06 +11 3.502031e-04 -1.49613e-06 -4.87527e-06 +12 5.000000e-04 -1.14389e-06 2.970244e-07 +13 5.010313e-04 -4.25119e-10 -3.23614e-12 +14 5.030940e-04 -1.18963e-10 -3.37536e-12 +15 5.072194e-04 -4.25205e-10 -3.24360e-12 +16 5.154701e-04 -1.19414e-10 -3.39089e-12 +17 5.319715e-04 -4.25984e-10 -3.27483e-12 +18 5.649744e-04 -1.21104e-10 -3.45147e-12 +19 6.309801e-04 -4.29615e-10 -3.39337e-12 +20 7.629914e-04 -1.29787e-10 -3.68303e-12 +21 1.027014e-03 -4.55655e-10 -3.84134e-12 +22 1.555060e-03 -2.74051e-10 -4.52651e-12 +23 2.611151e-03 -4.60756e-09 -5.32636e-12 +24 4.611151e-03 -2.18631e-08 -6.71107e-12 +25 6.611151e-03 -2.46290e-09 -7.28349e-12 +26 8.611151e-03 -1.19971e-08 -7.79571e-12 +27 1.061115e-02 4.330151e-09 -7.84913e-12 +28 1.261115e-02 -8.21108e-09 -8.08054e-12 +29 1.461115e-02 6.287619e-09 -7.99010e-12 +30 1.656886e-02 -7.23655e-09 -8.14967e-12 +31 1.850200e-02 6.763943e-09 -8.02346e-12 +32 2.042896e-02 -7.00042e-09 -8.16602e-12 +33 2.236466e-02 6.884703e-09 -8.03164e-12 +34 2.430032e-02 -6.93989e-09 -8.17011e-12 +35 2.623482e-02 6.912354e-09 -8.03390e-12 +36 2.816446e-02 -6.92609e-09 -8.17090e-12 +37 3.009657e-02 6.919218e-09 -8.03452e-12 +38 3.202839e-02 -6.92264e-09 -8.17116e-12 +39 3.396181e-02 6.920921e-09 -8.03442e-12 +40 3.589384e-02 -6.92177e-09 -8.17133e-12 +41 3.782674e-02 6.921336e-09 -8.03423e-12 +42 3.975935e-02 -6.92154e-09 -8.17124e-12 +43 4.175935e-02 6.921431e-09 -8.03435e-12 +44 4.375935e-02 -6.92148e-09 -8.17124e-12 +45 4.575935e-02 6.921445e-09 -8.03435e-12 +46 4.775935e-02 -6.92145e-09 -8.17124e-12 +47 4.975935e-02 6.921438e-09 -8.03435e-12 +48 5.000000e-02 -6.92139e-09 -8.17124e-12 +49 5.000344e-02 1.073445e-06 -2.29261e-07 +50 5.001031e-02 1.062517e-06 -2.18132e-07 +51 5.002405e-02 1.057252e-06 -2.12216e-07 +52 5.003890e-02 1.179433e-06 -3.00119e-07 +53 5.005236e-02 1.647596e-06 -9.67225e-07 +54 5.006621e-02 1.362141e-06 -2.32705e-06 + +Index time v1#branch v2#branch +-------------------------------------------------------------------------------- +55 5.007947e-02 1.653940e-06 -4.70595e-06 +56 5.009790e-02 1.361331e-06 -8.93152e-06 +57 5.012743e-02 1.653052e-06 -1.88474e-05 +58 5.017360e-02 1.361145e-06 -4.08411e-05 +59 5.024499e-02 1.654734e-06 -9.18089e-05 +60 5.035306e-02 1.367456e-06 -2.14666e-04 +61 5.050000e-02 1.308831e-06 -4.81732e-04 +62 5.050138e-02 2.449697e-10 -4.81265e-04 +63 5.050415e-02 -7.33525e-11 -4.81204e-04 +64 5.050886e-02 2.448991e-10 -4.81102e-04 +65 5.051827e-02 -7.32262e-11 -4.80897e-04 +66 5.053710e-02 2.450062e-10 -4.80485e-04 +67 5.057476e-02 -7.29317e-11 -4.79658e-04 +68 5.065008e-02 2.455833e-10 -4.77988e-04 +69 5.080073e-02 -7.16665e-11 -4.74582e-04 +70 5.110201e-02 2.485198e-10 -4.67524e-04 +71 5.170459e-02 -6.33768e-11 -4.52499e-04 +72 5.290973e-02 2.876237e-10 -4.19529e-04 +73 5.490973e-02 5.463069e-10 -3.59768e-04 +74 5.690973e-02 5.709571e-09 -2.99143e-04 +75 5.890973e-02 6.043230e-09 -2.42387e-04 +76 6.090973e-02 6.573391e-09 -1.92306e-04 +77 6.290973e-02 4.836922e-09 -1.50032e-04 +78 6.490973e-02 4.729522e-09 -1.15521e-04 +79 6.690973e-02 2.963431e-09 -8.80490e-05 +80 6.890973e-02 3.065391e-09 -6.65913e-05 +81 7.090973e-02 1.579419e-09 -5.00669e-05 +82 7.290973e-02 1.955450e-09 -3.74849e-05 +83 7.490973e-02 7.124459e-10 -2.79620e-05 +84 7.690973e-02 1.290972e-09 -2.08077e-05 +85 7.890973e-02 2.069733e-10 -1.54552e-05 +86 8.090973e-02 9.095159e-10 -1.14644e-05 +87 8.290973e-02 -7.92520e-11 -8.49513e-06 +88 8.490973e-02 6.956285e-10 -6.29066e-06 +89 8.690973e-02 -2.38603e-10 -4.65524e-06 +90 8.890973e-02 5.771652e-10 -3.44402e-06 +91 9.090973e-02 -3.26527e-10 -2.54674e-06 +92 9.290973e-02 5.119823e-10 -1.88325e-06 +93 9.490973e-02 -3.74807e-10 -1.39194e-06 +94 9.690973e-02 4.762428e-10 -1.02913e-06 +95 9.890973e-02 -4.01248e-10 -7.60373e-07 +96 1.000000e-01 4.601805e-10 -6.45655e-07 diff --git a/esim-cloud-backend/simulationAPI/helpers/sample_files/plot_data_v.txt b/esim-cloud-backend/simulationAPI/helpers/sample_files/plot_data_v.txt new file mode 100644 index 000000000..4caaa152b --- /dev/null +++ b/esim-cloud-backend/simulationAPI/helpers/sample_files/plot_data_v.txt @@ -0,0 +1,105 @@ + + Transient Analysis Fri Apr 24 23:37:52 2020 +-------------------------------------------------------------------------------- +Index time in out vcc +-------------------------------------------------------------------------------- +0 0.000000e+00 0.000000e+00 5.000000e+00 5.000000e+00 +1 5.000000e-06 5.000000e-02 5.000002e+00 5.000000e+00 +2 1.000000e-05 1.000000e-01 5.000004e+00 5.000000e+00 +3 2.000000e-05 2.000000e-01 5.000008e+00 5.000000e+00 +4 3.122027e-05 3.122027e-01 5.000013e+00 5.000000e+00 +5 4.261616e-05 4.261616e-01 5.000017e+00 5.000000e+00 +6 5.453771e-05 5.453771e-01 5.000005e+00 5.000000e+00 +7 7.296709e-05 7.296709e-01 4.999871e+00 5.000000e+00 +8 9.144949e-05 9.144949e-01 4.999479e+00 5.000000e+00 +9 1.284143e-04 1.284143e+00 4.997339e+00 5.000000e+00 +10 2.023439e-04 2.023439e+00 4.984459e+00 5.000000e+00 +11 3.502031e-04 3.502031e+00 4.910883e+00 5.000000e+00 +12 5.000000e-04 5.000000e+00 4.767735e+00 5.000000e+00 +13 5.010313e-04 5.000000e+00 4.766519e+00 5.000000e+00 +14 5.030940e-04 5.000000e+00 4.764088e+00 5.000000e+00 +15 5.072194e-04 5.000000e+00 4.759227e+00 5.000000e+00 +16 5.154701e-04 5.000000e+00 4.749516e+00 5.000000e+00 +17 5.319715e-04 5.000000e+00 4.730128e+00 5.000000e+00 +18 5.649744e-04 5.000000e+00 4.691496e+00 5.000000e+00 +19 6.309801e-04 5.000000e+00 4.614812e+00 5.000000e+00 +20 7.629914e-04 5.000000e+00 4.463791e+00 5.000000e+00 +21 1.027014e-03 5.000000e+00 4.171338e+00 5.000000e+00 +22 1.555060e-03 5.000000e+00 3.625886e+00 5.000000e+00 +23 2.611151e-03 5.000000e+00 2.693993e+00 5.000000e+00 +24 4.611151e-03 5.000000e+00 1.452843e+00 5.000000e+00 +25 6.611151e-03 5.000000e+00 7.469712e-01 5.000000e+00 +26 8.611151e-03 5.000000e+00 3.737508e-01 5.000000e+00 +27 1.061115e-02 5.000000e+00 1.843359e-01 5.000000e+00 +28 1.261115e-02 5.000000e+00 9.025318e-02 5.000000e+00 +29 1.461115e-02 5.000000e+00 4.402884e-02 5.000000e+00 +30 1.656886e-02 5.000000e+00 2.179764e-02 5.000000e+00 +31 1.850200e-02 5.000000e+00 1.088616e-02 5.000000e+00 +32 2.042896e-02 5.000000e+00 5.447191e-03 5.000000e+00 +33 2.236466e-02 5.000000e+00 2.715556e-03 5.000000e+00 +34 2.430032e-02 5.000000e+00 1.353813e-03 5.000000e+00 +35 2.623482e-02 5.000000e+00 6.752433e-04 5.000000e+00 +36 2.816446e-02 5.000000e+00 3.374345e-04 5.000000e+00 +37 3.009657e-02 5.000000e+00 1.684679e-04 5.000000e+00 +38 3.202839e-02 5.000000e+00 8.412501e-05 5.000000e+00 +39 3.396181e-02 5.000000e+00 4.198760e-05 5.000000e+00 +40 3.589384e-02 5.000000e+00 2.097374e-05 5.000000e+00 +41 3.782674e-02 5.000000e+00 1.047916e-05 5.000000e+00 +42 3.975935e-02 5.000000e+00 5.242170e-06 5.000000e+00 +43 4.175935e-02 5.000000e+00 2.560529e-06 5.000000e+00 +44 4.375935e-02 5.000000e+00 1.256841e-06 5.000000e+00 +45 4.575935e-02 5.000000e+00 6.230583e-07 5.000000e+00 +46 4.775935e-02 5.000000e+00 3.149387e-07 5.000000e+00 +47 4.975935e-02 5.000000e+00 1.651510e-07 5.000000e+00 +48 5.000000e-02 5.000000e+00 1.538261e-07 5.000000e+00 +49 5.000344e-02 4.965649e+00 -1.29499e-06 5.000000e+00 +50 5.001031e-02 4.896947e+00 -4.18960e-06 5.000000e+00 +51 5.002405e-02 4.759543e+00 -9.96317e-06 5.000000e+00 +52 5.003890e-02 4.610955e+00 -1.64325e-05 5.000000e+00 +53 5.005236e-02 4.476410e+00 -2.11536e-05 5.000000e+00 +54 5.006621e-02 4.337862e+00 -1.32460e-05 5.000000e+00 + + +-------------------------------------------------------------------------------- +55 5.007947e-02 4.205277e+00 1.896545e-05 5.000000e+00 +56 5.009790e-02 4.021012e+00 1.240988e-04 5.000000e+00 +57 5.012743e-02 3.725657e+00 4.986274e-04 5.000000e+00 +58 5.017360e-02 3.264038e+00 1.804424e-03 5.000000e+00 +59 5.024499e-02 2.550110e+00 6.343132e-03 5.000000e+00 +60 5.035306e-02 1.469424e+00 2.230900e-02 5.000000e+00 +61 5.050000e-02 0.000000e+00 7.287392e-02 5.000000e+00 +62 5.050138e-02 0.000000e+00 7.353952e-02 5.000000e+00 +63 5.050415e-02 0.000000e+00 7.487065e-02 5.000000e+00 +64 5.050886e-02 0.000000e+00 7.713572e-02 5.000000e+00 +65 5.051827e-02 0.000000e+00 8.166442e-02 5.000000e+00 +66 5.053710e-02 0.000000e+00 9.071601e-02 5.000000e+00 +67 5.057476e-02 0.000000e+00 1.087959e-01 5.000000e+00 +68 5.065008e-02 0.000000e+00 1.448616e-01 5.000000e+00 +69 5.080073e-02 0.000000e+00 2.166106e-01 5.000000e+00 +70 5.110201e-02 0.000000e+00 3.585322e-01 5.000000e+00 +71 5.170459e-02 0.000000e+00 6.357220e-01 5.000000e+00 +72 5.290973e-02 0.000000e+00 1.161181e+00 5.000000e+00 +73 5.490973e-02 0.000000e+00 1.940478e+00 5.000000e+00 +74 5.690973e-02 0.000000e+00 2.599383e+00 5.000000e+00 +75 5.890973e-02 0.000000e+00 3.140901e+00 5.000000e+00 +76 6.090973e-02 0.000000e+00 3.575581e+00 5.000000e+00 +77 6.290973e-02 0.000000e+00 3.917907e+00 5.000000e+00 +78 6.490973e-02 0.000000e+00 4.183450e+00 5.000000e+00 +79 6.690973e-02 0.000000e+00 4.387012e+00 5.000000e+00 +80 6.890973e-02 0.000000e+00 4.541646e+00 5.000000e+00 +81 7.090973e-02 0.000000e+00 4.658300e+00 5.000000e+00 +82 7.290973e-02 0.000000e+00 4.745848e+00 5.000000e+00 +83 7.490973e-02 0.000000e+00 4.811292e+00 5.000000e+00 +84 7.690973e-02 0.000000e+00 4.860060e+00 5.000000e+00 +85 7.890973e-02 0.000000e+00 4.896321e+00 5.000000e+00 +86 8.090973e-02 0.000000e+00 4.923240e+00 5.000000e+00 +87 8.290973e-02 0.000000e+00 4.943198e+00 5.000000e+00 +88 8.490973e-02 0.000000e+00 4.957983e+00 5.000000e+00 +89 8.690973e-02 0.000000e+00 4.968929e+00 5.000000e+00 +90 8.890973e-02 0.000000e+00 4.977028e+00 5.000000e+00 +91 9.090973e-02 0.000000e+00 4.983018e+00 5.000000e+00 +92 9.290973e-02 0.000000e+00 4.987448e+00 5.000000e+00 +93 9.490973e-02 0.000000e+00 4.990723e+00 5.000000e+00 +94 9.690973e-02 0.000000e+00 4.993144e+00 5.000000e+00 +95 9.890973e-02 0.000000e+00 4.994933e+00 5.000000e+00 +96 1.000000e-01 0.000000e+00 4.995700e+00 5.000000e+00 diff --git a/esim-cloud-backend/simulationAPI/migrations/__init__.py b/esim-cloud-backend/simulationAPI/migrations/__init__.py new file mode 100644 index 000000000..e69de29bb diff --git a/esim-cloud-backend/simulationAPI/models.py b/esim-cloud-backend/simulationAPI/models.py new file mode 100644 index 000000000..71a836239 --- /dev/null +++ b/esim-cloud-backend/simulationAPI/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/esim-cloud-backend/simulationAPI/tests.py b/esim-cloud-backend/simulationAPI/tests.py new file mode 100644 index 000000000..7ce503c2d --- /dev/null +++ b/esim-cloud-backend/simulationAPI/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/esim-cloud-backend/simulationAPI/views.py b/esim-cloud-backend/simulationAPI/views.py new file mode 100644 index 000000000..91ea44a21 --- /dev/null +++ b/esim-cloud-backend/simulationAPI/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here.