From cec838aa0a61ef62ee908078aada47f0ba2cc9bb Mon Sep 17 00:00:00 2001 From: Brandon Ball <74022057+bhball22@users.noreply.github.com> Date: Fri, 22 Apr 2022 14:20:32 -0500 Subject: [PATCH 1/6] Reset button on Hydraulic System --- src/Componets/HydrolicSystem.jsx | 7 +++++++ src/Componets/Styles/HydrolicSystem.css | 14 ++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/src/Componets/HydrolicSystem.jsx b/src/Componets/HydrolicSystem.jsx index 225536b..45dde1b 100644 --- a/src/Componets/HydrolicSystem.jsx +++ b/src/Componets/HydrolicSystem.jsx @@ -11,6 +11,7 @@ class HydrolicSystem extends Component { super(props); //Simulation Variables / Default values this.state = {psi: 1500 , PsiColor: 'green',LHV: "Open", RHV: "Open", LHF: false, RHF: false, HYD: false, HydPress:"Norm", PRV:"Working", LeftEngine:"Functioning", RightEngine:"Functioning", LeftFilter:"Flowing", RightFilter:"Flowing", TopFilter:"Flowing"}; + this.initialState = this.state; this.handleChange = this.handleChange.bind(this); this.updateSimVariables = this.updateSimVariables.bind(this); } @@ -21,6 +22,9 @@ class HydrolicSystem extends Component { event.preventDefault(); + if(event.target.id === 'RESET'){ + await this.setState(this.initialState); + } if(event.target.id === 'LV'){ //ID: LV and LVENG both open and close the left valve. await this.setState({ LHV: this.state.LHV === "Open" ? "Closed" : "Open"}); } @@ -329,6 +333,9 @@ class HydrolicSystem extends Component { +
+ +
) } } diff --git a/src/Componets/Styles/HydrolicSystem.css b/src/Componets/Styles/HydrolicSystem.css index 243ead6..96367fa 100644 --- a/src/Componets/Styles/HydrolicSystem.css +++ b/src/Componets/Styles/HydrolicSystem.css @@ -59,6 +59,20 @@ font-size: 16px; } +.sim-button-reset{ + background-color: #1c2224; + width: 150PX; + border: 3px; + border-color: #ffffff00; + color: white; + padding: 10px 10px; + margin: 5px; + text-align:center; + text-decoration: none; + font-size: 16px; + float: right; +} + h3{ color: white; display: inline; From 979d50d7919856b36fd223d1b6e7ed2554b8dd6a Mon Sep 17 00:00:00 2001 From: Brandon Ball <74022057+bhball22@users.noreply.github.com> Date: Fri, 22 Apr 2022 14:47:09 -0500 Subject: [PATCH 2/6] Remove zoom buttons --- src/App.jsx | 28 ++-------------------------- 1 file changed, 2 insertions(+), 26 deletions(-) diff --git a/src/App.jsx b/src/App.jsx index e0a3e67..f2ff5ee 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -14,30 +14,10 @@ function App(props) { const shouldRender = false; - function setRadarView(){ - setZoom(40) - setPosy(-10) - setPosx(-88) - } - function setSystemView(){ - setZoom(50) - setPosy(30) - setPosx(-168) - } - function setDisplayView(){ - setZoom(40) - setPosy(-26) - setPosx(10) - } - function setNavView(){ - setZoom(30) - setPosy(-12) - setPosx(-130) - } function setWideView(){ setZoom(1) - setPosy(30) - setPosx(6) + setPosy(0) + setPosx(0) } function hideNavBar() { if (document.getElementById('navBar').style.width != '0px'){ @@ -82,10 +62,6 @@ function App(props) { hideNavBar()} id="NavBarClosed" />