diff --git a/.gitignore b/.gitignore index c16ce28..a0155d3 100644 --- a/.gitignore +++ b/.gitignore @@ -368,3 +368,4 @@ env/ GroundControlFiles/ SatFiles/ /test.png +/bosloo_env diff --git a/BoSLOO.pyproj b/BoSLOO.pyproj index ec1770b..1e0b50d 100644 --- a/BoSLOO.pyproj +++ b/BoSLOO.pyproj @@ -11,7 +11,7 @@ . BoSLOO BoSLOO - MSBuild|BoSLOOenv|$(MSBuildProjectFullPath) + MSBuild|bosloo_env|$(MSBuildProjectFullPath) true @@ -28,6 +28,15 @@ + + bosloo_env + 3.10 + bosloo_env (Python 3.10 (64-bit)) + Scripts\python.exe + Scripts\pythonw.exe + PYTHONPATH + X64 + BoSLOOenv 3.8 @@ -41,6 +50,14 @@ + + + + + + + + @@ -93,6 +110,26 @@ + + + + + + + + + + + + + + + + + + + + + + + React App + + + + +
+ + + diff --git a/GroundControl/frontend/public/logo192.png b/GroundControl/frontend/public/logo192.png new file mode 100644 index 0000000..fc44b0a Binary files /dev/null and b/GroundControl/frontend/public/logo192.png differ diff --git a/GroundControl/frontend/public/logo512.png b/GroundControl/frontend/public/logo512.png new file mode 100644 index 0000000..a4e47a6 Binary files /dev/null and b/GroundControl/frontend/public/logo512.png differ diff --git a/GroundControl/frontend/public/manifest.json b/GroundControl/frontend/public/manifest.json new file mode 100644 index 0000000..080d6c7 --- /dev/null +++ b/GroundControl/frontend/public/manifest.json @@ -0,0 +1,25 @@ +{ + "short_name": "React App", + "name": "Create React App Sample", + "icons": [ + { + "src": "favicon.ico", + "sizes": "64x64 32x32 24x24 16x16", + "type": "image/x-icon" + }, + { + "src": "logo192.png", + "type": "image/png", + "sizes": "192x192" + }, + { + "src": "logo512.png", + "type": "image/png", + "sizes": "512x512" + } + ], + "start_url": ".", + "display": "standalone", + "theme_color": "#000000", + "background_color": "#ffffff" +} diff --git a/GroundControl/frontend/public/robots.txt b/GroundControl/frontend/public/robots.txt new file mode 100644 index 0000000..e9e57dc --- /dev/null +++ b/GroundControl/frontend/public/robots.txt @@ -0,0 +1,3 @@ +# https://www.robotstxt.org/robotstxt.html +User-agent: * +Disallow: diff --git a/GroundControl/frontend/src/BoSLOO logo.json b/GroundControl/frontend/src/BoSLOO logo.json new file mode 100644 index 0000000..5cf7c52 --- /dev/null +++ b/GroundControl/frontend/src/BoSLOO logo.json @@ -0,0 +1,3 @@ +{ + "logo": " ______ _______ _____ _______ _______ \n| __ \\.-----.| __|| |_ | || |\n| __ <| _ ||__ || || - || - |\n|______/|_____||_______||_______||_______||_______|" +} \ No newline at end of file diff --git a/GroundControl/frontend/src/commands.js b/GroundControl/frontend/src/commands.js new file mode 100644 index 0000000..4ed7171 --- /dev/null +++ b/GroundControl/frontend/src/commands.js @@ -0,0 +1,68 @@ +import Typing from 'react-typing-animation'; +import React from 'react'; + +class Command { + constructor(keyword, fullName) { + this.keyword = keyword; + this.fullName = fullName; + + this.helpString = "No help text for this command. Vivian, please be sure to fix this before deploying." + } + + call(body) { + return 'This command exists, but does nothing. Vivian, please be sure to fix this before deploying.'; + } +} + +class helpCommand extends Command{ + constructor() { + super('help','help'); + + this.helpString = "This contains basic help and usage instructions for all commands." + } + + call(body) { + if (body === "") { + var commands = ""; + for (let command of commandList) { + commands += command.keyword + " "; + } + return (commands); + } else { + for (let command of commandList) { + if (body === command.keyword || body === command.fullName) { + return (command.helpString); + } + } + return ("Unrecognized command. Use without arguments to see full list.") + } + } +} + +class loremCommand extends Command { + constructor() { + super('lorem', 'loremipsum'); + + this.helpString = 'Prints a lorem string.' + } + + call(body) { + return ('Space, the final frontier. These are the voyages of the Starship Enterprise. Its five-year mission: to explore strange new worlds, to seek out new life and new civilizations, to boldly go where no man has gone before. Many say exploration is part of our destiny, but it is actually our duty to future generations and their quest to ensure the survival of the human species.'); + } +} + +const commandList = [new helpCommand(), new loremCommand()]; + +function sentCommand(sentCommand) { + var commandId = sentCommand.split(" ")[0] + var commandBody = sentCommand.split(" ").slice(1).join(' ') + for (let command of commandList) { + if (commandId === command.keyword || commandId === command.fullName) { + return ({command.call(commandBody.trim())}); + } + } + + return (Unrecognized command.); +} + +export default sentCommand \ No newline at end of file diff --git a/GroundControl/frontend/src/index.css b/GroundControl/frontend/src/index.css new file mode 100644 index 0000000..c375230 --- /dev/null +++ b/GroundControl/frontend/src/index.css @@ -0,0 +1,126 @@ +@import url('https://fonts.googleapis.com/css?family=VT323'); + +body { + font: 18px "VT323", "Courier New", monospace; + background-color: black; + background-image: radial-gradient(at bottom right, rgb(30 30 30), black); + height: 100vh; + overflow: hidden; + color: #02d300; + text-shadow: 0 0 6px #73ff71; +} + +body::after { + content: ""; + position: absolute; + top: 0; + left: 0; + width: 100vw; + height: 99vh; + background: repeating-linear-gradient( 0deg, rgb(0 0 0 / 0.20), rgb(0 0 0 / 0.15) 3px, transparent 2px, transparent 6px); + pointer-events: none; +} + +::selection{ + background: #793d71; + text-shadow: none; +} + +.power-on-container { + height: 90vh; + align-items:center; + justify-items:center; + text-align: center; +} + +.power-on-box { + position: relative; + justify-self: center; + margin-top: 20vh; + +} + +#start-text { + font-size: 30px; + border: ridge; + padding: 2em 6em; + box-shadow: 0 0 3px 1px rgb(49 255 0 / 0.70); +} + +.console { + padding-top: 15vh; + height: 70vh; + overflow: hidden; + display: flex; + flex-direction: column; +} + +.logo { + white-space: pre-wrap; +} + +.fail-text { + color: #d82222; + text-shadow: 0 0 6px #ff1111; +} + +.power-on-self-test{ + + padding-left: 4em; +} + +.terminal-window { + + +} + +.power-on-self-test, .terminal-window { + border:groove; + margin-left: 5vw; + margin-top: -5vh; + padding-bottom: 1em; + padding-right: 2em; + width: 60vw; + overflow-y: auto; + overflow-x: hidden; + flex-grow: 1; + display: flex; + flex-direction: column-reverse; + box-sizing: border-box; + box-shadow: 0 0 3px 1px rgb(49 255 0 / 0.70); +} + +.terminal{ + +} + +.active-line{ + outline: none; + width: 2em; + resize:horizontal; +} + +.blink-text { + animation: blinker 1s step-start infinite; +} + +.typed-line{ + display: inline; +} + +.terminal-line th{ + text-align: right; + vertical-align: top; + padding-right: 0.2em; + width: 4em; +} + +.terminal-line td{ + text-align: left; +} + +@keyframes blinker { + 50% { + opacity: 0; + } +} \ No newline at end of file diff --git a/GroundControl/frontend/src/index.js b/GroundControl/frontend/src/index.js new file mode 100644 index 0000000..9920270 --- /dev/null +++ b/GroundControl/frontend/src/index.js @@ -0,0 +1,98 @@ +import React from 'react'; +import ReactDOM from 'react-dom/client'; +import Typing from 'react-typing-animation'; +import ClickableDiv from 'react-clickable-div'; +import KeyboardEventHandler from 'react-keyboard-event-handler' +import './index.css'; +import logos from './BoSLOO logo.json'; +import Terminal from './terminal.js'; +import StatusBar from './statusbar.js'; + +const nominal = ; + +class Console extends React.Component { + constructor(props) { + super(props); + this.swapper = this.swapper.bind(this); + this.state = { + bodyObj: , + init: 0, + } + } + + swapper(key, e) { + if (this.state.init === 0) { + this.replaceBody(); + this.playSound(); + } else if (this.state.init === 1) { + this.replaceBody(nominal); + } + this.setState({ init: this.state.init + 1 }); + } + + appendToBody(newContent) { + let bodyObj = JSON.parse(JSON.stringify(this.state.bodyObj)) + newContent; + this.setState({ + bodyObj: bodyObj + }); + } + + replaceBody(newContent) { + this.setState({ + bodyObj: newContent + }); + } + + playSound() { + var sound = document.getElementById("boot-sound") + sound.volume = 0.1; + sound.play(); + } + + render() { + return ( +
+ + {this.state.bodyObj} + {this.state.init >= 2 ? : null} +
+ ); + } +} + +class SelfTest extends React.Component { + constructor(props) { + super(props); + this.state = { + logodisplay: false + } + } + + render() { + const final = {logos.logo} < br />

Press any key to continue...
{'>'} _
; + return ( +
+ {this.state.logodisplay ? final : null} + this.setState({ logodisplay: true })}> + BoSLOO ACPI BIOS v0.1
+ Sakimori Ind. 2022
+ Initializing cache.................................... OK!
+ Initializing network.................................. OK!
+ Initializing GPU...................................... FAIL!
+
+
+
+ ) + } +} + +function PowerOn(props) { + return ( +
START
+ ); +} + +// ========================================= + +const root = ReactDOM.createRoot(document.getElementById("root")); +root.render(); \ No newline at end of file diff --git a/GroundControl/frontend/src/statusbar.js b/GroundControl/frontend/src/statusbar.js new file mode 100644 index 0000000..b285a95 --- /dev/null +++ b/GroundControl/frontend/src/statusbar.js @@ -0,0 +1,9 @@ +import React from 'react'; + +class StatusBar extends React.Component { + render() { + return null; + } +} + +export default StatusBar \ No newline at end of file diff --git a/GroundControl/frontend/src/terminal.js b/GroundControl/frontend/src/terminal.js new file mode 100644 index 0000000..94ae2d2 --- /dev/null +++ b/GroundControl/frontend/src/terminal.js @@ -0,0 +1,100 @@ +import React from 'react'; +import ReactDOM from 'react-dom/client'; +import * as KeyboardEventHandler from 'react-keyboard-event-handler'; +import sentCommand from './commands.js' + +class Terminal extends React.Component { + constructor(props) { + super(props); + this.state = { + lines: [-20Welcome to BoSLOO Ground Control Console., -10 Time of connection: {new Date().toLocaleString('en-US')}], + lastLine : '', + waitForUser: false, + lineNumber: 0, + controlHeld: false, + }; + this.charIn = this.charIn.bind(this); + this.handleKey = this.handleKey.bind(this); + + const window = document.getRootNode(); + + window.addEventListener('paste', (e) => { + e.preventDefault(); + + let paste = (e.clipboardData || window.clipboardData).getData('text'); + this.appendText(paste); + }); + } + + addLines(newLinesArray) { + let currLines = this.state.lines + this.setState({ + lines: currLines.concat(newLinesArray), + }); + } + + addCharacter(newChar) { + this.setState({ + lastLine: JSON.parse(JSON.stringify(this.state.lastLine)) + newChar, + }); + } + + appendText(newText) { + this.setState({ + lastLine: JSON.parse(JSON.stringify(this.state.lastLine)) + newText, + }); + } + + deleteCharacter() { + this.setState({ + lastLine: this.state.lastLine.slice(0,-1), + }); + } + + finishLine() { + let commandBody = sentCommand(this.state.lastLine); + this.addLines([{this.state.lineNumber}{'>'}{this.state.lastLine}, + {this.state.lineNumber + 10}{commandBody}]); + this.setState({ lastLine: '', lineNumber: this.state.lineNumber+20 }); + } + + charIn(newCharObj) { + this.setState({ + lastLine: newCharObj.target.value, + }); + } + + handleKey(key, e) { + if (e.key === 'Enter') { + this.finishLine(); + } else if (e.keyCode === 8) { /*backspace*/ + this.deleteCharacter(); + } else if (e.ctrlKey) { + return; + } else if (e.keyCode === 32) { + this.addCharacter(' '); + } else if (e.keyCode >= 40) { + this.addCharacter(e.key); + } + } + + displayLines() { + return this.state.lines; + } + + render() { + return ( +
+ + + + {this.displayLines()} + + +
{this.state.lineNumber}{'>'}{this.state.lastLine}_
+
+ ) + } +} + +export default Terminal \ No newline at end of file