Spaces:
Sleeping
Sleeping
File size: 1,653 Bytes
5877840 b477385 5877840 b477385 5877840 b477385 5877840 b477385 |
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 63 64 65 |
import streamlit as st
st.set_page_config(layout="wide", page_title='Kvl Visualisation')
from load_css import local_css
# import pandas as pd
# Local Imports
import home
# import raw_data
import plotting
import header
import read_kvl_file as kvl
import output_xyz
# import plotly.express as px
# from io import StringIO
local_css("style.css")
@st.cache_data
def load_data(uploaded_file):
if uploaded_file is not None:
try:
data=kvl.read_kvl_file(uploaded_file)
except UnicodeDecodeError as e:
st.error(f"error loading log.kvl: {e}")
else:
data=None
return data
# Sidebar Options & File Uplaod
kvl_file=None
st.sidebar.write('# KVL Data Visualisation')
st.sidebar.write('To begin using the app, load your KVL file using the file upload option below.')
path = st.sidebar.file_uploader('Choose a kvl files', accept_multiple_files=True, type=['.kvl'])
for uploadfile in path:
#uploadedfile =
kvl_file = load_data(uploadfile)
if kvl_file:
st.sidebar.success('File Uploaded Successfully')
st.sidebar.write(f'<b>Keys Name</b>: {kvl_file.keys()}',unsafe_allow_html=True)
# Sidebar Navigation
st.sidebar.title('Navigation')
options = st.sidebar.radio('Select a page:',
['Home', 'Keys Information', 'Data Visualisation', 'Convert KVL to XYZ',
])
if options == 'Home':
home.home()
elif options == 'Keys Information':
header.header(kvl_file)
# elif options == 'Data Information':
# raw_data.raw_data(kvl_file)
elif options == 'Data Visualisation':
plotting.plot(kvl_file)
elif options == 'Convert KVL to XYZ':
output_xyz.output_xyz(kvl_file)
|