File size: 1,614 Bytes
bd61f3f
 
32b5cd7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
import streamlit as st


def sidebar():
    st.sidebar.title("Navigation")
    selection = st.sidebar.radio(
        "Go to",
        [
            "About",
            "Request Key",
            "Livestream",
            "Download",
            "GUI Control",
            "Python Documentation",
        ],
    )
    return selection


if "current_page" not in st.session_state:
    st.session_state.current_page = "Home"


def main():
    selection = sidebar()

    if st.session_state.current_page != selection:
        st.session_state.current_page = selection

        st.session_state.button_clicked = False

    if selection == "About":
        st.title("AC Microscope")
        st.write(
            "This is a request site for credentials to use remote access to Openflexure Microscopes in the AC lab. You can either control the microscopes over python or the GUI with the help of a temporary key. You can view the live camera feed on a livestream. One person can use a microscope at once. Currently only Microscope2 is functional, but they will all be functional in the future"  # noqa: E501
        )

    elif selection == "Request Key":
        import key_request

        key_request.show()
    elif selection == "Livestream":
        import livestream

        livestream.show()
    elif selection == "Download":
        import download

        download.show()
    elif selection == "GUI Control":
        import gui_control

        gui_control.show()
    elif selection == "Python Documentation":
        import documentation

        documentation.show()


if __name__ == "__main__":
    main()