From 738504ec3646d1849e1d0152e66b1023f5393ea7 Mon Sep 17 00:00:00 2001 From: SiyuZhou Date: Wed, 29 Mar 2023 13:10:49 -0400 Subject: [PATCH 1/5] 0 --- .idea/workspace.xml | 271 ++++++++++++++++++++++++++++++++++++++++++++ client.py | 0 db_gui.py | 37 ++++++ requirements.txt | 3 +- server.py | 45 ++++++++ 5 files changed, 355 insertions(+), 1 deletion(-) create mode 100644 .idea/workspace.xml create mode 100644 client.py create mode 100644 db_gui.py create mode 100644 server.py diff --git a/.idea/workspace.xml b/.idea/workspace.xml new file mode 100644 index 0000000..282e2e6 --- /dev/null +++ b/.idea/workspace.xml @@ -0,0 +1,271 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + { + "keyToString": { + "ASKED_ADD_EXTERNAL_FILES": "true", + "ASKED_SHARE_PROJECT_CONFIGURATION_FILES": "true", + "RunOnceActivity.OpenProjectViewOnStart": "true", + "RunOnceActivity.ShowReadmeOnStart": "true", + "WebServerToolWindowFactoryState": "false", + "last_opened_file_path": "/Users/emtzhou/BME547_repos/Classwork_Spring2023", + "node.js.detected.package.eslint": "true", + "node.js.detected.package.tslint": "true", + "node.js.selected.package.eslint": "(autodetect)", + "node.js.selected.package.tslint": "(autodetect)", + "vue.rearranger.settings.migration": "true" + } +} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1678800813175 + + + + + + + + + + + + \ No newline at end of file diff --git a/client.py b/client.py new file mode 100644 index 0000000..e69de29 diff --git a/db_gui.py b/db_gui.py new file mode 100644 index 0000000..82890a1 --- /dev/null +++ b/db_gui.py @@ -0,0 +1,37 @@ +import tkinter as tk +from tkinter import ttk + + +def set_up_window(): + + def ok_btn_cmd(): + + + root = tk.Tk() + root.title("Donor") + root.geometry("800x800") + + top_label = ttk.Label(root, text="blood") + top_label.grid(column=0, row=0) + + name_label = ttk.Label(root, text="Name:") + name_label.grid(column=0, row=1) + name_entry = ttk.Entry(root, width=50) + name_entry.grid(column=1, row=1) + + id_label = ttk.Label(root, text="Id:") + id_label.grid(column=0, row=2) + id_entry = ttk.Entry(root) + id_entry.grid(column=1, row=2) + + root.mainloop() + + +if __name__ == '__main__': + set_up_window() + + + + # root = tk.Tk() # Defines the top, or root, window, so doesn't have a parent + # content = ttk.Frame(root) # The content Frame is placed in root + # ok_btn = ttk.Button(content) # The ok_btn button is placed in the content Frame \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index d4a6728..5f8df1b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,6 @@ jupyter pytest pytest-pycodestyle - +requests +flask diff --git a/server.py b/server.py new file mode 100644 index 0000000..3f9bc49 --- /dev/null +++ b/server.py @@ -0,0 +1,45 @@ +from flask import Flask + +app = Flask(__name__) + + +@app.route("/", methods=["GET"]) +def server_status(): + return "Server On" + + +@app.route("/info", methods=["GET"]) +def info_route(): + return "This server was written for BME 547" + + +if __name__ == '__main__': + app.run() + +# from flask import Flask, request, jsonify +# @app.route("/HDL_analysis", methods=["POST"]) +# def HDL_route_handler(): +# """ +# in_data = {"name": , +# "HDL_value": } +# """ +# from blood_calculator import HDL_analysis +# in_data = request.get_json() +# # print("Received HDL value of {}".format(in_data["HDL_value"])) +# diagnosis = HDL_analysis(in_data["HDL_value"]) +# return diagnosis +# +# +# @app.route("/add", methods=["POST"]) +# def add_numbers(): +# in_data = request.get_json() +# answer = in_data["a"] + in_data["b"] +# if answer < 0: +# return "The answer was less than zero. BAD", 400 +# return jsonify(answer) +# +# +# @app.route("/add_two//", methods=["GET"]) +# def add_two_handlere(a, b): +# answer = int(a) + int(b) +# return jsonify(answer) From c8ea40e091cc0ce8703b3d03bc5dd47f36a5f394 Mon Sep 17 00:00:00 2001 From: SiyuZhou Date: Fri, 31 Mar 2023 10:44:44 -0400 Subject: [PATCH 2/5] 0 --- .idea/Classwork_Spring2023.iml | 16 + .idea/inspectionProfiles/Project_Default.xml | 6 + .../inspectionProfiles/profiles_settings.xml | 6 + .idea/misc.xml | 4 + .idea/vcs.xml | 8 + .idea/workspace.xml | 140 ++++---- LRLTimer.cpp | 22 ++ LRLonly.cpp | 25 ++ PACETimer.cpp | 32 ++ Pace.cpp | 47 +++ blood_calculator.py | 26 +- card.cpp | 31 ++ client.py | 36 ++ health_db_client.py | 33 ++ health_db_server.py | 321 ++++++++++++++++++ jupyter_practice.ipynb | 304 ++++++++++++++++- mongo_db_jupyter_example | 1 + server.py | 28 +- 18 files changed, 994 insertions(+), 92 deletions(-) create mode 100644 .idea/Classwork_Spring2023.iml create mode 100644 .idea/inspectionProfiles/Project_Default.xml create mode 100644 .idea/inspectionProfiles/profiles_settings.xml create mode 100644 .idea/misc.xml create mode 100644 .idea/vcs.xml create mode 100644 LRLTimer.cpp create mode 100644 LRLonly.cpp create mode 100644 PACETimer.cpp create mode 100644 Pace.cpp create mode 100644 card.cpp create mode 100644 health_db_client.py create mode 100644 health_db_server.py create mode 160000 mongo_db_jupyter_example diff --git a/.idea/Classwork_Spring2023.iml b/.idea/Classwork_Spring2023.iml new file mode 100644 index 0000000..d2095d5 --- /dev/null +++ b/.idea/Classwork_Spring2023.iml @@ -0,0 +1,16 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml new file mode 100644 index 0000000..03d9549 --- /dev/null +++ b/.idea/inspectionProfiles/Project_Default.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..d6988f1 --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..9a5bdc1 --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/workspace.xml b/.idea/workspace.xml index 282e2e6..4749fbb 100644 --- a/.idea/workspace.xml +++ b/.idea/workspace.xml @@ -4,7 +4,14 @@