linx5o commited on
Commit
4844070
·
1 Parent(s): c5b039d

made recommened changed

Browse files
Files changed (1) hide show
  1. app.py +21 -19
app.py CHANGED
@@ -779,7 +779,18 @@ def get_data_default(time_scale, exp):
779
  # Define the interface components
780
  with gr.Blocks() as demo:
781
  with gr.Tab("Default"):
782
- experiment_input = gr.Textbox(label="Experiment", value="Ed")
 
 
 
 
 
 
 
 
 
 
 
783
  experiment_input.input(fn=void_client)
784
 
785
  client = create_client(HOST, PORT, USERNAME, PASSWORD)
@@ -862,7 +873,7 @@ with gr.Blocks() as demo:
862
 
863
  # Button to start automation
864
  with gr.Row():
865
- temp_state = gr.Radio(choices=["start", "stop", "update", "restart"], label="State")
866
  temp = gr.Button("Send Command")
867
 
868
  # Update visibility of the slider based on dropdown selection
@@ -881,7 +892,7 @@ with gr.Blocks() as demo:
881
  with gr.Row():
882
  with gr.Column():
883
  gr.Markdown("# OD Reading")
884
- od_state = gr.Radio(choices=["start", "stop"], label="State")
885
  od_button = gr.Button("Send Command")
886
 
887
  od_button.click(
@@ -891,7 +902,7 @@ with gr.Blocks() as demo:
891
 
892
  with gr.Column():
893
  gr.Markdown("# Growth Rate")
894
- gr_state = gr.Radio(choices=["start", "stop"], label="State")
895
  gr_button = gr.Button("Send Command")
896
 
897
  gr_button.click(
@@ -980,20 +991,11 @@ with gr.Blocks() as demo:
980
  inputs=[cycle_media_sec, experiment_input]
981
  )
982
 
983
- with gr.Blocks():
984
- gr.Markdown("# Example workflow")
985
-
986
- gr.HTML("""
987
- <a target="_blank" href="https://colab.research.google.com/github/AccelerationConsortium/ac-training-lab/blob/51-pioreactor-mqtt-and-streamlit/notebooks/Pioreactor_Example_Workflow.ipynb">
988
- <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>
989
- </a>
990
- """)
991
-
992
- gr.Markdown("This is an example workflow that demonstrates how to use the Pioreactor MQTT API.")
993
 
994
  with gr.Tab("Default Graphs"):
995
  with gr.Row():
996
- time_scale = gr.Radio(label="Time Scale", choices=["1 hour", "24 hour", "All Data"])
997
  get_graphs = gr.Button("Get Graphs")
998
 
999
  plot1 = gr.Plot()
@@ -1082,7 +1084,7 @@ with gr.Blocks() as demo:
1082
  rpm_input = gr.Slider(minimum=0, maximum=2000, step=50, label="RPM")
1083
 
1084
  with gr.Row():
1085
- stir_state = gr.Radio(choices=["start", "stop", "update"], label="State")
1086
 
1087
  st = gr.Button("Send Command")
1088
 
@@ -1106,7 +1108,7 @@ with gr.Blocks() as demo:
1106
 
1107
  # Button to start automation
1108
  with gr.Row():
1109
- temp_state = gr.Radio(choices=["start", "stop", "update", "restart"], label="State")
1110
  temp = gr.Button("Send Command")
1111
 
1112
  # Update visibility of the slider based on dropdown selection
@@ -1125,7 +1127,7 @@ with gr.Blocks() as demo:
1125
  with gr.Row():
1126
  with gr.Column():
1127
  gr.Markdown("# OD Reading")
1128
- od_state = gr.Radio(choices=["start", "stop"], label="State")
1129
  od_button = gr.Button("Send Command")
1130
 
1131
  od_button.click(
@@ -1135,7 +1137,7 @@ with gr.Blocks() as demo:
1135
 
1136
  with gr.Column():
1137
  gr.Markdown("# Growth Rate")
1138
- gr_state = gr.Radio(choices=["start", "stop"], label="State")
1139
  gr_button = gr.Button("Send Command")
1140
 
1141
  gr_button.click(
 
779
  # Define the interface components
780
  with gr.Blocks() as demo:
781
  with gr.Tab("Default"):
782
+
783
+ with gr.Blocks():
784
+ gr.HTML("""
785
+ <a target="_blank" href="https://colab.research.google.com/github/AccelerationConsortium/ac-training-lab/blob/51-pioreactor-mqtt-and-streamlit/notebooks/Pioreactor_Example_Workflow.ipynb">
786
+ <img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Open In Colab"/>
787
+ </a>
788
+ """)
789
+ gr.Markdown("This is a control panel for the Pioreactor. You can use this to control the Pioreactor. You can also view the status of the Pioreactor and view graphs of the data. To use a custom Pioreactor, click on the Custom tab.")
790
+
791
+
792
+ gr.Markdown("The experiment name is required for all commands. You can get the experiment name from the status tab. When changing experiments, remember to update the experiment name.")
793
+ experiment_input = gr.Textbox(label="Experiment", placeholder="Get Experiment Name From Status")
794
  experiment_input.input(fn=void_client)
795
 
796
  client = create_client(HOST, PORT, USERNAME, PASSWORD)
 
873
 
874
  # Button to start automation
875
  with gr.Row():
876
+ temp_state = gr.Radio(choices=["start", "stop", "update", "restart"], label="State", value="start")
877
  temp = gr.Button("Send Command")
878
 
879
  # Update visibility of the slider based on dropdown selection
 
892
  with gr.Row():
893
  with gr.Column():
894
  gr.Markdown("# OD Reading")
895
+ od_state = gr.Radio(choices=["start", "stop"], label="State", value="start")
896
  od_button = gr.Button("Send Command")
897
 
898
  od_button.click(
 
902
 
903
  with gr.Column():
904
  gr.Markdown("# Growth Rate")
905
+ gr_state = gr.Radio(choices=["start", "stop"], label="State", value="start")
906
  gr_button = gr.Button("Send Command")
907
 
908
  gr_button.click(
 
991
  inputs=[cycle_media_sec, experiment_input]
992
  )
993
 
994
+
 
 
 
 
 
 
 
 
 
995
 
996
  with gr.Tab("Default Graphs"):
997
  with gr.Row():
998
+ time_scale = gr.Radio(label="Time Scale", choices=["1 hour", "24 hour", "All Data"], value="All Data")
999
  get_graphs = gr.Button("Get Graphs")
1000
 
1001
  plot1 = gr.Plot()
 
1084
  rpm_input = gr.Slider(minimum=0, maximum=2000, step=50, label="RPM")
1085
 
1086
  with gr.Row():
1087
+ stir_state = gr.Radio(choices=["start", "stop", "update"], label="State", value="start")
1088
 
1089
  st = gr.Button("Send Command")
1090
 
 
1108
 
1109
  # Button to start automation
1110
  with gr.Row():
1111
+ temp_state = gr.Radio(choices=["start", "stop", "update", "restart"], label="State", value="start")
1112
  temp = gr.Button("Send Command")
1113
 
1114
  # Update visibility of the slider based on dropdown selection
 
1127
  with gr.Row():
1128
  with gr.Column():
1129
  gr.Markdown("# OD Reading")
1130
+ od_state = gr.Radio(choices=["start", "stop"], label="State", value="start")
1131
  od_button = gr.Button("Send Command")
1132
 
1133
  od_button.click(
 
1137
 
1138
  with gr.Column():
1139
  gr.Markdown("# Growth Rate")
1140
+ gr_state = gr.Radio(choices=["start", "stop"], label="State", value="start")
1141
  gr_button = gr.Button("Send Command")
1142
 
1143
  gr_button.click(