From 299818d0e89572f2c7340b28b71a43a0806ac50c Mon Sep 17 00:00:00 2001 From: Cay Date: Sun, 4 Feb 2024 23:17:19 -0500 Subject: [PATCH] Start console i/o UI --- src/agent/datapath_communicator.rs | 4 + src/bin/main.rs | 16 +-- src/ui.rs | 5 +- src/ui/assembled_view/component.rs | 10 +- src/ui/console/component.rs | 164 +++++++++------------------ src/ui/console/mod.rs | 3 +- src/ui/footer/component.rs | 132 +++++++++++++++++++++ src/ui/{console => footer}/helper.rs | 0 src/ui/footer/mod.rs | 2 + src/ui/swim_editor/component.rs | 5 +- static/styles/main.css | 27 ++++- 11 files changed, 235 insertions(+), 133 deletions(-) create mode 100644 src/ui/footer/component.rs rename src/ui/{console => footer}/helper.rs (100%) create mode 100644 src/ui/footer/mod.rs diff --git a/src/agent/datapath_communicator.rs b/src/agent/datapath_communicator.rs index 693dc33d8..498ceeff2 100644 --- a/src/agent/datapath_communicator.rs +++ b/src/agent/datapath_communicator.rs @@ -159,4 +159,8 @@ impl DatapathCommunicator { ) -> Box { todo!() } + + pub fn get_accepting_input(&self) -> bool { + todo!() + } } diff --git a/src/bin/main.rs b/src/bin/main.rs index 09c573e43..80ea0ac85 100644 --- a/src/bin/main.rs +++ b/src/bin/main.rs @@ -6,13 +6,11 @@ use js_sys::Object; use monaco::{ api::TextModel, sys::{ - editor::{ - IMarkerData - }, + editor::IMarkerData, MarkerSeverity, } }; -use swim::{parser::parser_assembler_main::parser, ui::{console::component::ConsoleTabState, swim_editor::component::EditorTabState}}; +use swim::{parser::parser_assembler_main::parser, ui::{footer::component::FooterTabState, swim_editor::component::EditorTabState}}; use swim::parser::parser_structs_and_enums::ProgramInfo; use std::rc::Rc; use swim::agent::EmulationCoreAgent; @@ -20,7 +18,7 @@ use swim::agent::datapath_communicator::DatapathCommunicator; use swim::emulation_core::datapath::Datapath; use swim::emulation_core::mips::datapath::MipsDatapath; use swim::emulation_core::mips::datapath::Stage; -use swim::ui::console::component::Console; +use swim::ui::footer::component::Footer; use swim::ui::regview::component::Regview; use swim::ui::swim_editor::component::SwimEditor; use wasm_bindgen::{JsCast, JsValue}; @@ -73,8 +71,12 @@ fn app(props: &AppProps) -> Html { let memory_text_model = use_state_eq(|| TextModel::create(&memory_text_output, Some("ini"), None).unwrap()); + // Show input + let show_input = use_state_eq(|| bool::default()); + show_input.set(true); + // Store the currently selected tabs in windows - let console_active_tab = use_state_eq(ConsoleTabState::default); + let console_active_tab = use_state_eq(FooterTabState::default); let editor_active_tab = use_state_eq(EditorTabState::default); // Since we want the Datapath to be independent from all the @@ -483,7 +485,7 @@ fn app(props: &AppProps) -> Html { // Console - +