diff --git a/README.md b/README.md index abdc752..4116fc4 100644 --- a/README.md +++ b/README.md @@ -1 +1,11 @@ -# ascom-ui \ No newline at end of file +# ascom-ui + +cd into /ascom-ui +then use the command: docker compose -f docker-compose.yml up --build + +then command: docker build -t davidruddell/ascom-streamlit:latest . + +now we run the streamlit app +use command: docker run --rm -e PYTHONUNBUFFERED=1 -p 8501:8501 davidruddell/ascom-streamlit:latest + +to accesss streamlit app, on google go to localhost:8501 \ No newline at end of file diff --git "a/pages/1_\360\237\214\216_TLE_file.py" "b/pages/1_\360\237\214\216_TLE_file.py" new file mode 100644 index 0000000..e256007 --- /dev/null +++ "b/pages/1_\360\237\214\216_TLE_file.py" @@ -0,0 +1,42 @@ +import streamlit as st +import time +import numpy as np + +st.set_page_config(page_title="Telescope App", page_icon="🔭", layout="wide") + +st.title("TLE File / Settings") +st.sidebar.header("TLE File / Settings") + +uploaded_file = st.file_uploader("Select TLE file", type=["tle"], accept_multiple_files=False) +if uploaded_file is not None: + for i in range(len(uploaded_file)): + head, sep, tail = str(uploaded_file[i].name).partition(".") + st.write("file name:"+str(head)) + st.write("file type:"+str(tail)) + st.write(uploaded_file) + +c1, c2, c3 = st.columns(3) + +with c1: + num_images = st.number_input('Number of images', min_value = 1, max_value=None, value=1, key = 1) + + expose_time = st.number_input('Expose time', min_value = 0.0, max_value=None, value=1.0, key = 2) + + max_visits_per_field = st.number_input('Max visits per field', min_value = 1, max_value=None, value=5, key = 3) + + st.write('') + st.write('Shutdown time') + +col1, col2, col3, col4, col5, col6, col7 = st.columns(7) +with col1: + hour = st.number_input('Hour (0-23)', min_value = 0, max_value=23, value=19, key = 4) + +with col2: + minute = st.number_input('Minute (0-59)', min_value = 0, max_value=59, value=35, key = 5) + + +st.write('Current number of images:', num_images) +st.write('Current expose time:', expose_time, 'seconds') +st.write('Current max visits per field:', max_visits_per_field) +st.write('Current hour:', hour) +st.write('Current minute:', minute) \ No newline at end of file diff --git "a/\360\237\217\240_Home.py" "b/\360\237\224\255_Home.py" similarity index 63% rename from "\360\237\217\240_Home.py" rename to "\360\237\224\255_Home.py" index 14893d2..6b96b6e 100644 --- "a/\360\237\217\240_Home.py" +++ "b/\360\237\224\255_Home.py" @@ -1,10 +1,30 @@ import streamlit as st - -st.title("Telescope App") - import time +import numpy as np from alpaca.telescope import * # Multiple Classes including Enumerations from alpaca.exceptions import * # Or just the exceptions you want to catch +import streamlit as st + +st.set_page_config(page_title="Telescope App", page_icon="🔭") + +st.title("🔭 Telescope App") + +st.sidebar.header("TXT File / Launch") + + +uploaded_file = st.file_uploader("Select txt file", type=["txt"], accept_multiple_files=False) +if uploaded_file is not None: + for i in range(len(uploaded_file)): + head, sep, tail = str(uploaded_file[i].name).partition(".") + st.write("file name:"+str(head)) + st.write("file type:"+str(tail)) + st.write(uploaded_file) + +col1, col2, col3, col4, col5, col6, col7 = st.columns(7) +with col1: + if st.button('Launch'): + st.write('Launching!') + T = Telescope('host.docker.internal:80', 0) # Local Omni Simulator @@ -28,4 +48,4 @@ print(f'Slew failed: {str(e)}') finally: # Assure that you disconnect print("Disconnecting...") - T.Connected = False \ No newline at end of file + T.Connected = False