From 4cc810b7c6c7b574f5797dc757fa339cc6767651 Mon Sep 17 00:00:00 2001 From: spereirag Date: Fri, 5 Feb 2021 17:43:27 -0300 Subject: [PATCH 01/75] Add ATCS endpoint to utils --- love/src/Utils.js | 64 ++++++++++++++++++++++++++++++++++------------- 1 file changed, 47 insertions(+), 17 deletions(-) diff --git a/love/src/Utils.js b/love/src/Utils.js index 9cd4f818e..7dce197de 100644 --- a/love/src/Utils.js +++ b/love/src/Utils.js @@ -323,6 +323,36 @@ export default class ManagerInterface { }); }); } + + static runATCSCommand(commandName, params) { + const token = ManagerInterface.getToken(); + if (token === null) { + // console.log('Token not found during validation'); + return new Promise((resolve) => resolve(false)); + } + const url = `${this.getApiBaseUrl()}tcs/aux`; + return fetch(url, { + method: 'POST', + headers: this.getHeaders(), + body: JSON.stringify({ + command_name: commandName, + params: params, + }), + }).then((response) => { + if (response.status >= 500) { + // console.error('Error communicating with the server.); + return false; + } + if (response.status === 401 || response.status === 403) { + // console.log('Session expired. Logging out'); + ManagerInterface.removeToken(); + return false; + } + return response.json().then((resp) => { + return resp; + }); + }); + } } /** @@ -569,21 +599,21 @@ export const takeScreenshot = (callback) => { }; /** - * Parse plot inputs and convert them to a format the EFD API understands. - * The transformation is done from: - * [ - * {name: {csc, salindex, topic, item}} - * ] - * to: - * { - * csc: { - * index: { - * topic: [item] - * } - * } - * } - */ - export const parsePlotInputs = (inputs) => { + * Parse plot inputs and convert them to a format the EFD API understands. + * The transformation is done from: + * [ + * {name: {csc, salindex, topic, item}} + * ] + * to: + * { + * csc: { + * index: { + * topic: [item] + * } + * } + * } + */ +export const parsePlotInputs = (inputs) => { const cscs = {}; Object.values(inputs).forEach((input) => { const cscDict = cscs?.[input.csc]; @@ -633,7 +663,7 @@ export const takeScreenshot = (callback) => { * } * } */ -export const parseCommanderData = (data, tsLabel='x', valueLabel='y') => { +export const parseCommanderData = (data, tsLabel = 'x', valueLabel = 'y') => { const newData = {}; Object.keys(data).forEach((topicKey) => { const topicData = data[topicKey]; @@ -648,4 +678,4 @@ export const parseCommanderData = (data, tsLabel='x', valueLabel='y') => { newData[topicKey] = newTopicData; }); return newData; -}; \ No newline at end of file +}; From 82dece1edc2c7de70bcbbb9ad8637ec4664216b7 Mon Sep 17 00:00:00 2001 From: spereirag Date: Fri, 5 Feb 2021 17:43:45 -0300 Subject: [PATCH 02/75] Add TCS commands dict --- love/src/Utils.js | 60 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 60 insertions(+) diff --git a/love/src/Utils.js b/love/src/Utils.js index 7dce197de..0c2c4ad4c 100644 --- a/love/src/Utils.js +++ b/love/src/Utils.js @@ -679,3 +679,63 @@ export const parseCommanderData = (data, tsLabel = 'x', valueLabel = 'y') => { }); return newData; }; + +const rotTypes = [ + { label: 'Sky', value: 0 }, + { label: 'SkyAuto', value: 1 }, + { label: 'Parallactic', value: 2 }, + { label: 'PhysicalSky', value: 3 }, + { label: 'Physical', value: 4 }, +]; + +export const TCSCommands = { + slew_object: { + name: ['string', undefined], + rot: ['angle', 0.0], + rot_type: [rotTypes, rotTypes[1]], + slew_timeout: ['number', 240.0], + }, + slew_icrs: { + ra: ['angle', undefined], + dec: ['angle', undefined], + rot: ['angle', 0.0], + rot_type: [rotTypes, rotTypes[1]], + target_name: ['string', 'slew_icrs'], + slew_timeout: ['number', 240.0], + stop_before_slew: ['boolean', true], + wait_settle: ['boolean', true], + }, + point_azel: { + az: ['angle', undefined], + el: ['angle', undefined], + rot_tel: ['angle', 0.0], + target_name: ['string', 'azel_target'], + wait_dome: ['boolean', false], + slew_timeout: ['number', 1200.0], + }, + offset_xy: { + x: ['number', undefined], + y: ['number', undefined], + relative: ['boolean', false], + persistent: ['boolean', false], + }, + offset_azel: { + az: ['number', undefined], + el: ['number', undefined], + relative: ['boolean', false], + persistent: ['boolean', false], + }, + offset_radec: { + ra: ['angle', undefined], + dec: ['angle', undefined], + }, + slew_dome_to: { + az: ['number', undefined], + }, + // focus_offset: {}, + home_dome: {}, +}; + +export const ATCSCommands = { + ...TCSCommands +}; From 96630190b759ec0080c9892eec8d2f017a1b1553 Mon Sep 17 00:00:00 2001 From: spereirag Date: Mon, 8 Feb 2021 17:14:56 -0300 Subject: [PATCH 03/75] Move TCS commands to Config --- love/src/Config.js | 71 ++++++++++++++++++++++++++++++++++++++++++++++ love/src/Utils.js | 60 --------------------------------------- 2 files changed, 71 insertions(+), 60 deletions(-) diff --git a/love/src/Config.js b/love/src/Config.js index 2bbba638b..bd80a18ae 100644 --- a/love/src/Config.js +++ b/love/src/Config.js @@ -312,3 +312,74 @@ export const severityEnum = { serious: 3, critical: 4, }; + +/** + * Available commands in the TCS and their parameters. Each command is represented + * as a dictionary key and their parameters as the values of said dictionary. + * Within each dictionary value, each parameter is represented in a separate dictionary. + * Each key in this new dictionary contains the parameter name and each corresponding + * value contains a 2 item array with its first element being the param type, e.g. + * 'string', 'angle', 'number', 'boolean'. The second element contains the default + * value. + * + */ + +const rotTypes = [ + { label: 'Sky', value: 0 }, + { label: 'SkyAuto', value: 1 }, + { label: 'Parallactic', value: 2 }, + { label: 'PhysicalSky', value: 3 }, + { label: 'Physical', value: 4 }, +]; + +export const TCSCommands = { + slew_object: { + name: ['string', undefined], + rot: ['angle', 0.0], + rot_type: [rotTypes, rotTypes[1]], + slew_timeout: ['number', 240.0], + }, + slew_icrs: { + ra: ['angle', undefined], + dec: ['angle', undefined], + rot: ['angle', 0.0], + rot_type: [rotTypes, rotTypes[1]], + target_name: ['string', 'slew_icrs'], + slew_timeout: ['number', 240.0], + stop_before_slew: ['boolean', true], + wait_settle: ['boolean', true], + }, + point_azel: { + az: ['angle', undefined], + el: ['angle', undefined], + rot_tel: ['angle', 0.0], + target_name: ['string', 'azel_target'], + wait_dome: ['boolean', false], + slew_timeout: ['number', 1200.0], + }, + offset_xy: { + x: ['number', undefined], + y: ['number', undefined], + relative: ['boolean', false], + persistent: ['boolean', false], + }, + offset_azel: { + az: ['number', undefined], + el: ['number', undefined], + relative: ['boolean', false], + persistent: ['boolean', false], + }, + offset_radec: { + ra: ['angle', undefined], + dec: ['angle', undefined], + }, + slew_dome_to: { + az: ['number', undefined], + }, + // focus_offset: {}, + home_dome: {}, +}; + +export const ATCSCommands = { + ...TCSCommands +}; diff --git a/love/src/Utils.js b/love/src/Utils.js index 0c2c4ad4c..7dce197de 100644 --- a/love/src/Utils.js +++ b/love/src/Utils.js @@ -679,63 +679,3 @@ export const parseCommanderData = (data, tsLabel = 'x', valueLabel = 'y') => { }); return newData; }; - -const rotTypes = [ - { label: 'Sky', value: 0 }, - { label: 'SkyAuto', value: 1 }, - { label: 'Parallactic', value: 2 }, - { label: 'PhysicalSky', value: 3 }, - { label: 'Physical', value: 4 }, -]; - -export const TCSCommands = { - slew_object: { - name: ['string', undefined], - rot: ['angle', 0.0], - rot_type: [rotTypes, rotTypes[1]], - slew_timeout: ['number', 240.0], - }, - slew_icrs: { - ra: ['angle', undefined], - dec: ['angle', undefined], - rot: ['angle', 0.0], - rot_type: [rotTypes, rotTypes[1]], - target_name: ['string', 'slew_icrs'], - slew_timeout: ['number', 240.0], - stop_before_slew: ['boolean', true], - wait_settle: ['boolean', true], - }, - point_azel: { - az: ['angle', undefined], - el: ['angle', undefined], - rot_tel: ['angle', 0.0], - target_name: ['string', 'azel_target'], - wait_dome: ['boolean', false], - slew_timeout: ['number', 1200.0], - }, - offset_xy: { - x: ['number', undefined], - y: ['number', undefined], - relative: ['boolean', false], - persistent: ['boolean', false], - }, - offset_azel: { - az: ['number', undefined], - el: ['number', undefined], - relative: ['boolean', false], - persistent: ['boolean', false], - }, - offset_radec: { - ra: ['angle', undefined], - dec: ['angle', undefined], - }, - slew_dome_to: { - az: ['number', undefined], - }, - // focus_offset: {}, - home_dome: {}, -}; - -export const ATCSCommands = { - ...TCSCommands -}; From f02465ba149a5e5a6b5f4a43c6d072e56069c86e Mon Sep 17 00:00:00 2001 From: spereirag Date: Mon, 8 Feb 2021 19:08:08 -0300 Subject: [PATCH 04/75] Add first version of TCSCommands component --- .../TCSCommands/TCSCommands.container.jsx | 37 ++++++++++++++ .../components/TCSCommands/TCSCommands.jsx | 48 +++++++++++++++++++ .../TCSCommands/TCSCommands.module.css | 15 ++++++ love/src/components/UIF/ComponentIndex.jsx | 10 ++++ 4 files changed, 110 insertions(+) create mode 100644 love/src/components/TCSCommands/TCSCommands.container.jsx create mode 100644 love/src/components/TCSCommands/TCSCommands.jsx create mode 100644 love/src/components/TCSCommands/TCSCommands.module.css diff --git a/love/src/components/TCSCommands/TCSCommands.container.jsx b/love/src/components/TCSCommands/TCSCommands.container.jsx new file mode 100644 index 000000000..4cbb3894a --- /dev/null +++ b/love/src/components/TCSCommands/TCSCommands.container.jsx @@ -0,0 +1,37 @@ +import React from 'react'; +import { connect } from 'react-redux'; +import { requestSALCommand } from '../../redux/actions/ws'; +import TCSCommands from './TCSCommands'; + +export const schema = { + description: 'Panel containing multiple buttons that execute different commands, such as closing the dome', + defaultSize: [57, 35], + props: { + title: { + type: 'string', + description: 'Name diplayed in the title bar (if visible)', + isPrivate: false, + default: 'TCS Commands', + }, + hasRawMode: { + type: 'boolean', + description: 'Whether the component has a raw mode version', + isPrivate: true, + default: false, + }, + }, +}; + +const TCSCommandsContainer = ({ ...props }) => { + return ; +}; + +const mapDispatchToProps = (dispatch, ownProps) => { + return { + requestSALCommand: (component, salindex, cmd) => { + return dispatch(requestSALCommand({ ...cmd, component, salindex })); + }, + }; +}; + +export default connect(() => {}, mapDispatchToProps)(TCSCommandsContainer); diff --git a/love/src/components/TCSCommands/TCSCommands.jsx b/love/src/components/TCSCommands/TCSCommands.jsx new file mode 100644 index 000000000..d1044b04a --- /dev/null +++ b/love/src/components/TCSCommands/TCSCommands.jsx @@ -0,0 +1,48 @@ +import React, { Component } from 'react'; +import styles from './TCSCommands.module.css'; +import Select from 'components/GeneralPurpose/Select/Select'; +import Input from 'components/GeneralPurpose/Input/Input'; +import { TCSCommands } from 'Config.js'; + +export default class CommandPanel extends Component { + constructor(props) { + super(props); + this.state = { + selectedCommand: null, + }; + } + + render() { + console.log(TCSCommands); + console.log(this.state.selectedCommand); + const paramsDict = TCSCommands[this.state.selectedCommand] ?? {}; + + return ( +
+
+ console.log(e)} /> +
+
+ ); + })} + + + ); + } +} diff --git a/love/src/components/TCSCommands/TCSCommands.module.css b/love/src/components/TCSCommands/TCSCommands.module.css new file mode 100644 index 000000000..c4eb7e92f --- /dev/null +++ b/love/src/components/TCSCommands/TCSCommands.module.css @@ -0,0 +1,15 @@ +.container { + display: grid; + grid-template-columns: 1fr; +} + +.selectContainer { + cursor: pointer; +} + +.select { + cursor: pointer; +} + +.commandParamsContainer { +} diff --git a/love/src/components/UIF/ComponentIndex.jsx b/love/src/components/UIF/ComponentIndex.jsx index 5c760053e..01bbf05e2 100644 --- a/love/src/components/UIF/ComponentIndex.jsx +++ b/love/src/components/UIF/ComponentIndex.jsx @@ -320,6 +320,16 @@ export const utilitiesIndex = { }, }, }, + TCSCommands: { + component: require('../TCSCommands/TCSCommands.container').default, + schema: { + ...require('../TCSCommands/TCSCommands.container').schema, + props: { + ...defaultSchemaProps, + ...require('../TCSCommands/TCSCommands.container').schema.props, + }, + }, + }, }; export const internalIndex = { From 4a82e2978c4f58f42bfb99468d7ec85861d51c6d Mon Sep 17 00:00:00 2001 From: spereirag Date: Tue, 9 Feb 2021 14:51:58 -0300 Subject: [PATCH 05/75] Render parameters depending on type --- .../components/TCSCommands/TCSCommands.jsx | 39 ++++++++++++++++--- .../TCSCommands/TCSCommands.module.css | 22 ++++++++++- 2 files changed, 55 insertions(+), 6 deletions(-) diff --git a/love/src/components/TCSCommands/TCSCommands.jsx b/love/src/components/TCSCommands/TCSCommands.jsx index d1044b04a..e53700f0d 100644 --- a/love/src/components/TCSCommands/TCSCommands.jsx +++ b/love/src/components/TCSCommands/TCSCommands.jsx @@ -2,6 +2,7 @@ import React, { Component } from 'react'; import styles from './TCSCommands.module.css'; import Select from 'components/GeneralPurpose/Select/Select'; import Input from 'components/GeneralPurpose/Input/Input'; +import Button from 'components/GeneralPurpose/Button/Button'; import { TCSCommands } from 'Config.js'; export default class CommandPanel extends Component { @@ -12,6 +13,33 @@ export default class CommandPanel extends Component { }; } + renderParam = (name, param) => { + const [paramType, defaultValue] = param; + return ( +
+
{name}
+ {paramType == 'string' && console.log(e)} />} + {paramType == 'number' && console.log(e)} />} + {paramType == 'angle' && console.log(e)} />} + {paramType == 'boolean' && ( + console.log('filled', { value: !input?.filled })} + /> + )} + {Array.isArray(paramType) && ( + console.log(e)} /> -
+ {this.renderParam(key, param)} ); })} + {this.state.selectedCommand &&
+ +
} ); } diff --git a/love/src/components/TCSCommands/TCSCommands.module.css b/love/src/components/TCSCommands/TCSCommands.module.css index c4eb7e92f..77f2ffe62 100644 --- a/love/src/components/TCSCommands/TCSCommands.module.css +++ b/love/src/components/TCSCommands/TCSCommands.module.css @@ -1,6 +1,7 @@ .container { display: grid; - grid-template-columns: 1fr; + grid-template-rows: min-content 1fr min-content; + height: 100%; } .selectContainer { @@ -13,3 +14,22 @@ .commandParamsContainer { } + +.paramContainer { + display: grid; + grid-template-columns: 1fr; + padding: 0.5em; + text-align: left; +} + +.paramLabel { + padding-left: 0.5em; +} + +.checkboxParam { + grid-template-columns: 1fr min-content; +} + +.sendButtonContainer { + padding: 1em; +} \ No newline at end of file From 14bc7ae8943b0b3e88d09f548066483ff72ad1fb Mon Sep 17 00:00:00 2001 From: spereirag Date: Tue, 9 Feb 2021 16:28:49 -0300 Subject: [PATCH 06/75] Save param values in state --- .../components/TCSCommands/TCSCommands.jsx | 59 +++++++++++++------ 1 file changed, 41 insertions(+), 18 deletions(-) diff --git a/love/src/components/TCSCommands/TCSCommands.jsx b/love/src/components/TCSCommands/TCSCommands.jsx index e53700f0d..84a1bd3cc 100644 --- a/love/src/components/TCSCommands/TCSCommands.jsx +++ b/love/src/components/TCSCommands/TCSCommands.jsx @@ -10,39 +10,64 @@ export default class CommandPanel extends Component { super(props); this.state = { selectedCommand: null, + paramValues: {}, }; } + updateParamValue = (name, value) => { + this.setState({ + paramValues: { + ...this.state.paramValues, + [name]: value, + }, + }); + }; + renderParam = (name, param) => { const [paramType, defaultValue] = param; + const { paramValues } = this.state; return (
{name}
- {paramType == 'string' && console.log(e)} />} - {paramType == 'number' && console.log(e)} />} - {paramType == 'angle' && console.log(e)} />} + {paramType == 'string' && ( + this.updateParamValue(name, e.target.value)} /> + )} + {paramType == 'number' && ( + this.updateParamValue(name, e.target.value)} /> + )} + {paramType == 'angle' && ( + this.updateParamValue(name, e.target.value)} /> + )} {paramType == 'boolean' && ( console.log('filled', { value: !input?.filled })} + onChange={(e) => this.updateParamValue(name, e.target.checked)} /> )} {Array.isArray(paramType) && ( this.updateParamValue(name, e.target.value)} /> + this.updateParamValue(name, e.target.value, paramType)} /> )} {paramType == 'number' && ( - this.updateParamValue(name, e.target.value)} /> + this.updateParamValue(name, e.target.value, paramType)} /> )} {paramType == 'angle' && ( - this.updateParamValue(name, e.target.value)} /> + <> + this.updateParamValue(name, e.target.value, paramType)} + onBlur={() => this.checkInvalidAngle(name, paramValues[name])} + /> + {this.state.paramWarnings[name] && ( +
+ Angle should be a float (deg) or a sexagesimal string (DD:MM:SS.S or DD MM SS.S) +
+ )} + )} {paramType == 'boolean' && ( this.updateParamValue(name, e.target.checked)} + onChange={(e) => this.updateParamValue(name, e.target.checked, paramType)} /> )} {Array.isArray(paramType) && ( this.selectCommand(selection?.value)} /> +
+ +
{this.state.selectedCommand && ( diff --git a/love/src/components/TCSCommands/TCSCommands.module.css b/love/src/components/TCSCommands/TCSCommands.module.css index ac2d772e6..a3127f399 100644 --- a/love/src/components/TCSCommands/TCSCommands.module.css +++ b/love/src/components/TCSCommands/TCSCommands.module.css @@ -6,6 +6,9 @@ .selectContainer { cursor: pointer; + display: grid; + grid-template-columns: 1fr min-content; + align-items: center; } .select { @@ -40,4 +43,12 @@ .markdown pre { white-space: pre-wrap; +} + +.buttonWrapper { + padding-left: 0.5em; +} + +.hidden { + visibility: hidden; } \ No newline at end of file From 98f81c4778faf5bf2b4e3136bba6a87a16cc65a9 Mon Sep 17 00:00:00 2001 From: Sebastian Aranda Date: Fri, 12 Feb 2021 20:53:09 -0300 Subject: [PATCH 12/75] Add resizble current script description container --- .../ScriptQueue/ConfigPanel/ConfigPanel.jsx | 4 +- .../GlobalState/GlobalState.module.css | 2 + .../components/ScriptQueue/ScriptQueue.jsx | 89 ++++++++++++++++--- .../ScriptQueue/ScriptQueue.module.css | 31 ++++++- .../ScriptQueue/Scripts/ScriptDetails.jsx | 4 +- 5 files changed, 109 insertions(+), 21 deletions(-) diff --git a/love/src/components/ScriptQueue/ConfigPanel/ConfigPanel.jsx b/love/src/components/ScriptQueue/ConfigPanel/ConfigPanel.jsx index 242f68fe0..49cc90d34 100644 --- a/love/src/components/ScriptQueue/ConfigPanel/ConfigPanel.jsx +++ b/love/src/components/ScriptQueue/ConfigPanel/ConfigPanel.jsx @@ -6,6 +6,8 @@ import YAML from 'yaml'; import 'brace/mode/yaml'; import 'brace/theme/solarized_dark'; +import { SCRIPT_DOCUMENTATION_BASE_URL } from 'Config'; +import Select from 'components/GeneralPurpose/Select/Select'; import styles from './ConfigPanel.module.css'; import Button from '../../GeneralPurpose/Button/Button'; import Input from '../../GeneralPurpose/Input/Input'; @@ -14,9 +16,7 @@ import RotateIcon from '../../icons/RotateIcon/RotateIcon'; import CloseIcon from '../../icons/CloseIcon/CloseIcon'; import Hoverable from '../../GeneralPurpose/Hoverable/Hoverable'; import InfoPanel from '../../GeneralPurpose/InfoPanel/InfoPanel'; -import Select from 'components/GeneralPurpose/Select/Select'; import ManagerInterface from '../../../Utils'; -import { SCRIPT_DOCUMENTATION_BASE_URL } from 'Config'; const NO_SCHEMA_MESSAGE = '# ( waiting for schema . . .)'; diff --git a/love/src/components/ScriptQueue/GlobalState/GlobalState.module.css b/love/src/components/ScriptQueue/GlobalState/GlobalState.module.css index 7a2dce49e..ac99b1356 100644 --- a/love/src/components/ScriptQueue/GlobalState/GlobalState.module.css +++ b/love/src/components/ScriptQueue/GlobalState/GlobalState.module.css @@ -7,6 +7,7 @@ align-items: flex-start; padding-bottom: 1em; padding-left: 0.5rem; + border-right: 1px solid var(--second-tertiary-background-color); } .globalStateContainer { @@ -15,6 +16,7 @@ padding: 0.5em 0.5em; height: 100%; width: 100%; + box-sizing: border-box; } .title { diff --git a/love/src/components/ScriptQueue/ScriptQueue.jsx b/love/src/components/ScriptQueue/ScriptQueue.jsx index 047c7732e..48cda5b64 100644 --- a/love/src/components/ScriptQueue/ScriptQueue.jsx +++ b/love/src/components/ScriptQueue/ScriptQueue.jsx @@ -19,6 +19,7 @@ import Input from '../GeneralPurpose/Input/Input'; import GlobalState from './GlobalState/GlobalState'; import Modal from '../GeneralPurpose/Modal/Modal'; import ScriptDetails from './Scripts/ScriptDetails'; +import CSCExpandedContainer from 'components/CSCSummary/CSCExpanded/CSCExpanded.container'; /** * Display lists of scripts from the ScriptQueue SAL object. It includes: Available scripts list, Waiting scripts list and Finished scripts list. @@ -50,7 +51,12 @@ export default class ScriptQueue extends Component { availableScriptsExternalExpanded: true, availableScriptsFilter: '', scriptModal: null, + currentScriptDetailsHeight: 'initial', + resetButton: }; + + this.observer = null; + this.currentScriptDetailsContainer = React.createRef(); } static defaultProps = { @@ -99,6 +105,15 @@ export default class ScriptQueue extends Component { }; componentDidUpdate = (prevProps, _prevState) => { + if (this.state.currentScriptDetailsHeight !== _prevState.currentScriptDetailsHeight) { + if (this.state.currentScriptDetailsHeight < 360) { + console.log(this.state.currentScriptDetailsHeight); + this.setState({ resetButton: () }); + } else { + this.setState({ resetButton: () }); + } + } + if (this.props.availableScriptList && this.props.availableScriptList !== prevProps.availableScriptList) { this.props.availableScriptList.sort((a, b) => { return a.path.localeCompare(b.path, 'en', { sensitivity: 'base' }); @@ -141,12 +156,34 @@ export default class ScriptQueue extends Component { componentDidMount = () => { this.props.subscribeToStreams(); + + this.observer = new ResizeObserver((entries) => { + this.setState({ + currentScriptDetailsHeight: entries[0].contentRect.height, + }); + }); + if (this.currentScriptDetailsContainer.current) { + this.observer.observe(this.currentScriptDetailsContainer.current); + } }; componentWillUnmount = () => { // this.props.unsubscribeToStreams(); + + if (this.observer) { + this.observer.unobserve(this.currentScriptDetailsContainer.current); + } }; + handleResizeButton = () => { + const { currentScriptDetailsHeight } = this.state; + if (currentScriptDetailsHeight >= 360) { + this.setState({ currentScriptDetailsHeight: 0 }); + } else { + this.setState({ currentScriptDetailsHeight: 'initial' }); + } + } + displayAvailableScripts = () => { this.setState({ isAvailableScriptListVisible: true, @@ -270,13 +307,13 @@ export default class ScriptQueue extends Component { }; launchScriptConfig = (e, script) => { - let { x } = e.target.getBoundingClientRect(); + const { x } = e.target.getBoundingClientRect(); this.setState({ configPanel: { - script: script, + script, name: script.name, show: true, - x: x, + x, y: 100, configSchema: script.configSchema, }, @@ -551,6 +588,19 @@ export default class ScriptQueue extends Component { contextMenuData={this.state.contextMenuData} options={contextMenuOption} /> + + +
@@ -575,17 +625,28 @@ export default class ScriptQueue extends Component {
- +
+ { (this.state.currentScriptDetailsHeight !== 'initial') && ( +
+ {this.state.resetButton} +
+ )} +
+ +
+
+ console.log(a)} + displaySummaryState={false}/> +
+
+ {/* LISTS BODY */}
diff --git a/love/src/components/ScriptQueue/ScriptQueue.module.css b/love/src/components/ScriptQueue/ScriptQueue.module.css index a8a7c4755..2ae573501 100644 --- a/love/src/components/ScriptQueue/ScriptQueue.module.css +++ b/love/src/components/ScriptQueue/ScriptQueue.module.css @@ -1,9 +1,10 @@ .scriptQueueContainer { display: grid; grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr; - grid-template-rows: min-content 1fr; + grid-template-rows: min-content min-content 1fr; grid-template-areas: - 'current current current current global global' + 'global global current current current current' + 'current-details current-details current-details current-details current-details current-details' 'body body body body body body'; color: var(--second-base-font-color); min-width: 1050px; @@ -58,7 +59,6 @@ display: flex; flex-direction: column; justify-content: center; - border-right: 1px solid var(--second-tertiary-background-color); } .currentScriptContainer { @@ -77,6 +77,31 @@ display: flex; } +.currentScriptDetailsWrapper { + grid-area: current-details; + display: grid; + grid-template-columns: 3fr 5fr; + padding-bottom: 1em; + margin-bottom: 1em; + border-bottom: 1px solid var(--second-tertiary-background-color); + resize: vertical; + overflow: scroll; + max-height: 370px; +} + +.currentScriptResetSizeWrapper { + grid-column: 1 / 3; +} + +.currentScriptDescriptionWrapper { + background: var(--second-secondary-background-color); + border-right: 1px solid var(--second-tertiary-background-color); +} + +.currentScriptLogsWrapper { + /* background-color: yellow; */ +} + .scriptList { display: grid; grid-template-rows: min-content 1fr; diff --git a/love/src/components/ScriptQueue/Scripts/ScriptDetails.jsx b/love/src/components/ScriptQueue/Scripts/ScriptDetails.jsx index 7f3452e49..ff5e73bb0 100644 --- a/love/src/components/ScriptQueue/Scripts/ScriptDetails.jsx +++ b/love/src/components/ScriptQueue/Scripts/ScriptDetails.jsx @@ -87,7 +87,7 @@ export default ({
); })} -
+ {/*
console.log(a)} displaySummaryState={false} /> -
+
*/}
); From ee7f40693cd662125f80e2c4c30ef217fce81ce3 Mon Sep 17 00:00:00 2001 From: Sebastian Aranda Date: Mon, 15 Feb 2021 14:49:18 -0300 Subject: [PATCH 13/75] Fix unexpected resize behaviour --- love/package.json | 1 + love/src/components/ScriptQueue/ScriptQueue.jsx | 10 ++++++---- love/src/components/ScriptQueue/ScriptQueue.module.css | 2 +- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/love/package.json b/love/package.json index ca738001d..50d6303e8 100644 --- a/love/package.json +++ b/love/package.json @@ -17,6 +17,7 @@ "html2canvas": "^1.0.0-rc.5", "lodash": "^4.17.19", "lodash.throttle": "^4.1.1", + "lodash.debounce": "^4.0.8", "luxon": "^1.23.0", "ml-matrix": "^6.5.0", "moment-range": "^4.0.0", diff --git a/love/src/components/ScriptQueue/ScriptQueue.jsx b/love/src/components/ScriptQueue/ScriptQueue.jsx index 48cda5b64..accb8c9a4 100644 --- a/love/src/components/ScriptQueue/ScriptQueue.jsx +++ b/love/src/components/ScriptQueue/ScriptQueue.jsx @@ -20,6 +20,7 @@ import GlobalState from './GlobalState/GlobalState'; import Modal from '../GeneralPurpose/Modal/Modal'; import ScriptDetails from './Scripts/ScriptDetails'; import CSCExpandedContainer from 'components/CSCSummary/CSCExpanded/CSCExpanded.container'; +import debounce from 'lodash.debounce'; /** * Display lists of scripts from the ScriptQueue SAL object. It includes: Available scripts list, Waiting scripts list and Finished scripts list. @@ -107,7 +108,6 @@ export default class ScriptQueue extends Component { componentDidUpdate = (prevProps, _prevState) => { if (this.state.currentScriptDetailsHeight !== _prevState.currentScriptDetailsHeight) { if (this.state.currentScriptDetailsHeight < 360) { - console.log(this.state.currentScriptDetailsHeight); this.setState({ resetButton: () }); } else { this.setState({ resetButton: () }); @@ -157,11 +157,13 @@ export default class ScriptQueue extends Component { componentDidMount = () => { this.props.subscribeToStreams(); - this.observer = new ResizeObserver((entries) => { + const debouncedResizeCallback = debounce((entries) => { + const newHeight = entries[0].contentRect.height; this.setState({ - currentScriptDetailsHeight: entries[0].contentRect.height, + currentScriptDetailsHeight: newHeight, }); - }); + }, 100); + this.observer = new ResizeObserver(debouncedResizeCallback); if (this.currentScriptDetailsContainer.current) { this.observer.observe(this.currentScriptDetailsContainer.current); } diff --git a/love/src/components/ScriptQueue/ScriptQueue.module.css b/love/src/components/ScriptQueue/ScriptQueue.module.css index 2ae573501..22822a668 100644 --- a/love/src/components/ScriptQueue/ScriptQueue.module.css +++ b/love/src/components/ScriptQueue/ScriptQueue.module.css @@ -85,7 +85,7 @@ margin-bottom: 1em; border-bottom: 1px solid var(--second-tertiary-background-color); resize: vertical; - overflow: scroll; + overflow-y: scroll; max-height: 370px; } From cce9524bcb4fc4f1bc68f50567824341cb2a0c02 Mon Sep 17 00:00:00 2001 From: spereirag Date: Wed, 17 Feb 2021 13:27:46 -0300 Subject: [PATCH 14/75] Remove documentation outside popup --- love/src/components/TCSCommands/TCSCommands.jsx | 8 -------- 1 file changed, 8 deletions(-) diff --git a/love/src/components/TCSCommands/TCSCommands.jsx b/love/src/components/TCSCommands/TCSCommands.jsx index 4da5c1512..9cbfc7ace 100644 --- a/love/src/components/TCSCommands/TCSCommands.jsx +++ b/love/src/components/TCSCommands/TCSCommands.jsx @@ -138,14 +138,6 @@ export default class CommandPanel extends Component {
- {this.state.selectedCommand && ( -
- )} {Object.keys(paramsDict).map((key) => { const param = paramsDict[key]; return
{this.renderParam(key, param)}
; From 1ff794a463efa0e7ea27b2347fa487f150afcce9 Mon Sep 17 00:00:00 2001 From: spereirag Date: Wed, 17 Feb 2021 13:42:06 -0300 Subject: [PATCH 15/75] Add help icon --- .../src/components/icons/HelpIcon/HelpIcon.jsx | 18 ++++++++++++++++++ .../icons/HelpIcon/HelpIcon.module.css | 8 ++++++++ 2 files changed, 26 insertions(+) create mode 100644 love/src/components/icons/HelpIcon/HelpIcon.jsx create mode 100644 love/src/components/icons/HelpIcon/HelpIcon.module.css diff --git a/love/src/components/icons/HelpIcon/HelpIcon.jsx b/love/src/components/icons/HelpIcon/HelpIcon.jsx new file mode 100644 index 000000000..cc98318bd --- /dev/null +++ b/love/src/components/icons/HelpIcon/HelpIcon.jsx @@ -0,0 +1,18 @@ +import React from 'react'; +import styles from './HelpIcon.module.css'; + +class HelpIcon extends React.Component { + render() { + return ( + + + + ); + } +} + +export default HelpIcon; diff --git a/love/src/components/icons/HelpIcon/HelpIcon.module.css b/love/src/components/icons/HelpIcon/HelpIcon.module.css new file mode 100644 index 000000000..fff2b02f4 --- /dev/null +++ b/love/src/components/icons/HelpIcon/HelpIcon.module.css @@ -0,0 +1,8 @@ +.helpIcon { + display: inline-block; + fill: var(--secondary-font-color); + fill-rule: evenodd; + width: 1em; + padding-right: 0.5em; + padding-left: 0.25em; +} From 9d942f82b4743816e03a1936f51d42e036774c6b Mon Sep 17 00:00:00 2001 From: spereirag Date: Wed, 17 Feb 2021 13:42:21 -0300 Subject: [PATCH 16/75] Use help icon in TCSCommands --- love/src/components/TCSCommands/TCSCommands.jsx | 7 +++---- love/src/components/TCSCommands/TCSCommands.module.css | 1 + 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/love/src/components/TCSCommands/TCSCommands.jsx b/love/src/components/TCSCommands/TCSCommands.jsx index 9cbfc7ace..54de57972 100644 --- a/love/src/components/TCSCommands/TCSCommands.jsx +++ b/love/src/components/TCSCommands/TCSCommands.jsx @@ -7,6 +7,7 @@ import Modal from 'components/GeneralPurpose/Modal/Modal'; import { TCSCommands } from 'Config.js'; import ManagerInterface, { parseCommanderData } from 'Utils'; import { Remarkable } from 'remarkable'; +import HelpIcon from 'components/icons/HelpIcon/HelpIcon'; var md = new Remarkable(); @@ -131,10 +132,8 @@ export default class CommandPanel extends Component { placeholder="Select a command" onChange={(selection) => this.selectCommand(selection?.value)} /> -
- +
this.setState({ isModalOpen: true })} className={this.state.selectedCommand ? styles.buttonWrapper : styles.hidden}> +
diff --git a/love/src/components/TCSCommands/TCSCommands.module.css b/love/src/components/TCSCommands/TCSCommands.module.css index a3127f399..19d4b10d8 100644 --- a/love/src/components/TCSCommands/TCSCommands.module.css +++ b/love/src/components/TCSCommands/TCSCommands.module.css @@ -47,6 +47,7 @@ .buttonWrapper { padding-left: 0.5em; + width: 1em; } .hidden { From aaa496b595f064e46e84a0aca43229d233c67acf Mon Sep 17 00:00:00 2001 From: spereirag Date: Wed, 17 Feb 2021 13:43:46 -0300 Subject: [PATCH 17/75] Add default message when no documentation is available --- love/src/components/TCSCommands/TCSCommands.jsx | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/love/src/components/TCSCommands/TCSCommands.jsx b/love/src/components/TCSCommands/TCSCommands.jsx index 54de57972..ca5ca8983 100644 --- a/love/src/components/TCSCommands/TCSCommands.jsx +++ b/love/src/components/TCSCommands/TCSCommands.jsx @@ -117,12 +117,18 @@ export default class CommandPanel extends Component { contentLabel="Component selection modal" size={50} > -
+ >
: +
+ No documentation available +
+ }
this.selectCommand(selection?.value)} /> -
this.setState({ isModalOpen: true })} className={this.state.selectedCommand ? styles.buttonWrapper : styles.hidden}> +
this.setState({ isModalOpen: true })} + className={this.state.selectedCommand ? styles.buttonWrapper : styles.hidden} + >
@@ -150,7 +175,11 @@ export default class CommandPanel extends Component {
{this.state.selectedCommand && (
-
diff --git a/love/src/components/TCSCommands/TCSCommands.module.css b/love/src/components/TCSCommands/TCSCommands.module.css index 19d4b10d8..0d2410a2c 100644 --- a/love/src/components/TCSCommands/TCSCommands.module.css +++ b/love/src/components/TCSCommands/TCSCommands.module.css @@ -1,9 +1,14 @@ .container { display: grid; grid-template-rows: min-content 1fr min-content; + row-gap: 1em; height: 100%; } +.containerExtraRow { + grid-template-rows: min-content min-content 1fr min-content; +} + .selectContainer { cursor: pointer; display: grid; @@ -52,4 +57,44 @@ .hidden { visibility: hidden; -} \ No newline at end of file +} + +.queueStateContainer { + display: grid; + grid-template-columns: 1fr 12em; + border-bottom: solid var(--second-tertiary-background-color) 1px; + padding: 0.5em 0em; + align-items: center; +} + +.queueStateLabel { + color: var(--base-font-color); + font-size: var(--font-size-medium); + font-weight: bold; + justify-self: left; +} + +.warningText { + justify-self: left; + display: grid; + grid-template-columns: min-content 1fr; + grid-column: 1 / span 2; + align-items: center; +} + +.warningIcon { + width: 1em; + min-width: 1em; + padding: 0.5em; + text-align: center; + user-select: none; + vertical-align: top; +} + +.warningIcon svg { + vertical-align: middle; +} + +.removed { + display: none; +} From b4210d140b5d5feab59fafcc8d91c09e618f7260 Mon Sep 17 00:00:00 2001 From: spereirag Date: Fri, 19 Feb 2021 12:02:55 -0300 Subject: [PATCH 22/75] Fix context menu not displaying properly --- .../ScriptQueue/GlobalState/GlobalState.jsx | 11 +++++++-- .../Scripts/ContextMenu/ContextMenu.jsx | 23 +++++++++++++++---- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/love/src/components/ScriptQueue/GlobalState/GlobalState.jsx b/love/src/components/ScriptQueue/GlobalState/GlobalState.jsx index d41540eea..dd5b9bd45 100644 --- a/love/src/components/ScriptQueue/GlobalState/GlobalState.jsx +++ b/love/src/components/ScriptQueue/GlobalState/GlobalState.jsx @@ -30,11 +30,13 @@ const GlobalState = ({ }) => { const [contextMenuIsOpen, setContextMenuIsOpen] = React.useState(false); const [contextMenuData, setContextMenuData] = React.useState({}); + const [contextMenuTarget, setContextMenuTarget] = React.useState(undefined); const onClickContextMenu = React.useCallback((event) => { event.stopPropagation(); setContextMenuIsOpen((state) => !state); - setContextMenuData(event.target.getBoundingClientRect()); + setContextMenuData(event.currentTarget.getBoundingClientRect()); + setContextMenuTarget(event.currentTarget); }, []); React.useEffect(() => { @@ -137,7 +139,12 @@ const GlobalState = ({
- + ); diff --git a/love/src/components/ScriptQueue/Scripts/ContextMenu/ContextMenu.jsx b/love/src/components/ScriptQueue/Scripts/ContextMenu/ContextMenu.jsx index 63bbb6a96..f6e6bf57c 100644 --- a/love/src/components/ScriptQueue/Scripts/ContextMenu/ContextMenu.jsx +++ b/love/src/components/ScriptQueue/Scripts/ContextMenu/ContextMenu.jsx @@ -1,9 +1,9 @@ -import React, { Component } from 'react'; +import React, { PureComponent } from 'react'; import PropTypes from 'prop-types'; import styles from './ContextMenu.module.css'; -export default class ContextMenu extends Component { +export default class ContextMenu extends PureComponent { static propTypes = { /**Position data for the context menu. * Usually from event.target.getBoundingClientRect() @@ -26,26 +26,41 @@ export default class ContextMenu extends Component { disabled: PropTypes.bool, }), ), + /** Target element which triggered the contextmenu */ + target: PropTypes.object, }; static defaultProps = { contextMenuData: {}, isOpen: false, options: [], + target: undefined, }; constructor(props) { super(props); - this.state = {}; + this.state = { + offset: 0, + }; } + componentDidUpdate = (nextState, nextProps) => { + if (this.props.target !== nextProps.target) { + const parentCustomView = this.props.target ? this.props.target.closest('.react-grid-item') : undefined; + const offset = parentCustomView ? parentCustomView.getBoundingClientRect().x : 0; + this.setState({ + offset, + }); + } + }; + render() { return ( this.props.isOpen && (
e.stopPropagation()} From 0a97fda117fd017c2880aa5b7e758aeef1d7e00b Mon Sep 17 00:00:00 2001 From: spereirag Date: Fri, 19 Feb 2021 14:57:23 -0300 Subject: [PATCH 23/75] Remove log --- love/src/components/TCSCommands/TCSCommands.jsx | 1 - 1 file changed, 1 deletion(-) diff --git a/love/src/components/TCSCommands/TCSCommands.jsx b/love/src/components/TCSCommands/TCSCommands.jsx index d991f189a..5bb6d0078 100644 --- a/love/src/components/TCSCommands/TCSCommands.jsx +++ b/love/src/components/TCSCommands/TCSCommands.jsx @@ -120,7 +120,6 @@ export default class CommandPanel extends Component { name: this.props.state, }; const isAvailable = queueState.name !== 'Running'; - console.log(queueState); return (
Date: Sun, 21 Feb 2021 21:58:22 -0300 Subject: [PATCH 24/75] Formatter fixes --- .../ScriptQueue/GlobalState/GlobalState.module.css | 9 +-------- love/src/components/icons/GearIcon/GearIcon.jsx | 12 +++++++----- .../components/icons/GearIcon/GearIcon.module.css | 7 +++++-- .../icons/ScriptQueue/PauseIcon/PauseIcon.jsx | 11 ++++------- .../ScriptQueue/PauseIcon/PauseIcon.module.css | 13 ++----------- 5 files changed, 19 insertions(+), 33 deletions(-) diff --git a/love/src/components/ScriptQueue/GlobalState/GlobalState.module.css b/love/src/components/ScriptQueue/GlobalState/GlobalState.module.css index ac99b1356..2038af55e 100644 --- a/love/src/components/ScriptQueue/GlobalState/GlobalState.module.css +++ b/love/src/components/ScriptQueue/GlobalState/GlobalState.module.css @@ -76,13 +76,6 @@ } .pauseIconWrapper { - width: 1em; - background: var(--commandable-background); - border: 1px solid var(--commandable-background); - padding: 0.25em 0.5em; + width: 2em; border-radius: 100%; } - -.gearIcon > path { - fill: var(--commandable-font-color); -} diff --git a/love/src/components/icons/GearIcon/GearIcon.jsx b/love/src/components/icons/GearIcon/GearIcon.jsx index 7613ac378..06e86b4af 100644 --- a/love/src/components/icons/GearIcon/GearIcon.jsx +++ b/love/src/components/icons/GearIcon/GearIcon.jsx @@ -5,14 +5,16 @@ export default function GearIcon(props) { const status = props.active ? styles.active : styles.inactive; const className = [styles.gearIcon, props.className, props.style].join(' '); return ( - + ); diff --git a/love/src/components/icons/GearIcon/GearIcon.module.css b/love/src/components/icons/GearIcon/GearIcon.module.css index 250b34895..dd68e13e1 100644 --- a/love/src/components/icons/GearIcon/GearIcon.module.css +++ b/love/src/components/icons/GearIcon/GearIcon.module.css @@ -6,10 +6,13 @@ vertical-align: middle; } -.active { +.cls-1{fill:none;stroke:#1ecfe8;stroke-miterlimit:10;stroke-width:2px;} +.cls-2{fill:#1ecfe8;} + +/* .active { fill: var(--base-font-color); } .inactive { fill: var(--secondary-font-color); -} +} */ diff --git a/love/src/components/icons/ScriptQueue/PauseIcon/PauseIcon.jsx b/love/src/components/icons/ScriptQueue/PauseIcon/PauseIcon.jsx index ec1c9f579..1f26019cf 100644 --- a/love/src/components/icons/ScriptQueue/PauseIcon/PauseIcon.jsx +++ b/love/src/components/icons/ScriptQueue/PauseIcon/PauseIcon.jsx @@ -4,14 +4,11 @@ import styles from './PauseIcon.module.css'; export default class PauseIcon extends Component { render() { return ( - + - ); diff --git a/love/src/components/icons/ScriptQueue/PauseIcon/PauseIcon.module.css b/love/src/components/icons/ScriptQueue/PauseIcon/PauseIcon.module.css index a75696d28..77c076a80 100644 --- a/love/src/components/icons/ScriptQueue/PauseIcon/PauseIcon.module.css +++ b/love/src/components/icons/ScriptQueue/PauseIcon/PauseIcon.module.css @@ -1,14 +1,5 @@ -.st0 { - fill: var(--second-primary-background-color); - stroke: var(--second-primary-background-color); - stroke-miterlimit: 10; -} - -.svg { +.pauseIcon { vertical-align: middle; } -.svg path { - fill: var(--commandable-font-color); - stroke: var(--commandable-font-color); -} +.cls-1{fill:#1ecfe8;} \ No newline at end of file From ce1456884be07df02c26dd88f3b10a2f9e849f1d Mon Sep 17 00:00:00 2001 From: Sebastian Aranda Date: Mon, 22 Feb 2021 14:57:49 -0300 Subject: [PATCH 25/75] Fix JSON parse, dict value NaN didn't come with quotes --- love/src/redux/actions/ws.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/love/src/redux/actions/ws.js b/love/src/redux/actions/ws.js index 2287ba8f6..52a0e91a9 100644 --- a/love/src/redux/actions/ws.js +++ b/love/src/redux/actions/ws.js @@ -195,7 +195,7 @@ export const openWebsocketConnection = () => { try { data = JSON.parse(msg.data); } catch (error) { - data = JSON.parse(msg.data.replace(/\bNaN\b/g, 'NaN')); + data = JSON.parse(msg.data.replace(/\bNaN\b/g, '"NaN"')); } if (!data.category) { From dbc39c7cf3621277e2f9bdc342996a3be7274215 Mon Sep 17 00:00:00 2001 From: Sebastian Aranda Date: Tue, 23 Feb 2021 19:58:47 -0300 Subject: [PATCH 26/75] Fix strange behavior with resize css property --- .../components/ScriptQueue/ScriptQueue.jsx | 99 ++++++++----------- .../ScriptQueue/ScriptQueue.module.css | 8 +- 2 files changed, 46 insertions(+), 61 deletions(-) diff --git a/love/src/components/ScriptQueue/ScriptQueue.jsx b/love/src/components/ScriptQueue/ScriptQueue.jsx index ea8d11a03..56fe34de8 100644 --- a/love/src/components/ScriptQueue/ScriptQueue.jsx +++ b/love/src/components/ScriptQueue/ScriptQueue.jsx @@ -38,8 +38,6 @@ export default class ScriptQueue extends Component { x: 100, y: 100, configSchema: '', - // name: undefined, - // script: {}, }, state: 'Unknown', summaryStateValue: 0, @@ -51,11 +49,9 @@ export default class ScriptQueue extends Component { availableScriptsStandardExpanded: true, availableScriptsExternalExpanded: true, availableScriptsFilter: '', - scriptModal: null, currentScriptDetailState: { height: 'initial', initialHeight: 9999, - display: 'grid', }, resetButton: , }; @@ -112,16 +108,23 @@ export default class ScriptQueue extends Component { componentDidUpdate = (prevProps, _prevState) => { if (this.props.current !== prevProps.current) { if (this.props.current === 'None') { - this.setState({ currentScriptDetailState: { ...this.state.currentScriptDetailState, display: 'none' } }); + this.setState((state) => ({ + currentScriptDetailState: { ...state.currentScriptDetailState, height: 0 }, + })); } else { - this.setState({ currentScriptDetailState: { ...this.state.currentScriptDetailState, display: 'grid' } }); + this.setState((state) => ({ + currentScriptDetailState: { + ...state.currentScriptDetailState, + height: state.currentScriptDetailState.initialHeight, + }, + })); } } if (this.state.currentScriptDetailState !== _prevState.currentScriptDetailState) { if (this.state.currentScriptDetailState.height < this.state.currentScriptDetailState.initialHeight) { - this.setState({ resetButton: () }); + this.setState({ resetButton: }); } else { - this.setState({ resetButton: () }); + this.setState({ resetButton: }); } } @@ -172,37 +175,31 @@ export default class ScriptQueue extends Component { const newHeight = entries[0].target.clientHeight; // console.log("New height: ", newHeight); if (newHeight >= this.state.currentScriptDetailState.initialHeight) { - this.setState({ - currentScriptDetailState: { - ...this.state.currentScriptDetailState, - height: this.state.currentScriptDetailState.initialHeight, - }, - }); - } else if (newHeight <= 20) { - this.setState({ + this.setState((state) => ({ currentScriptDetailState: { - ...this.state.currentScriptDetailState, - height: 0, + ...state.currentScriptDetailState, + height: state.currentScriptDetailState.initialHeight, }, - }); + })); } else { - this.setState({ + this.setState((state) => ({ currentScriptDetailState: { - ...this.state.currentScriptDetailState, + ...state.currentScriptDetailState, height: newHeight, }, - }); + })); } }, 100); this.observer = new ResizeObserver(debouncedResizeCallback); - console.log(this.currentScriptDetailsContainer.current); if (this.currentScriptDetailsContainer.current) { - this.setState({ + const currentHeight = this.currentScriptDetailsContainer.current.clientHeight; + this.setState((state) => ({ currentScriptDetailState: { - ...this.state.currentScriptDetailState, - initialHeight: this.currentScriptDetailsContainer.current.clientHeight, + ...state.currentScriptDetailState, + initialHeight: currentHeight, + height: this.props.current === 'None' ? 0 : currentHeight, }, - }); + })); this.observer.observe(this.currentScriptDetailsContainer.current); } }; @@ -217,13 +214,17 @@ export default class ScriptQueue extends Component { handleResizeButton = () => { const { height, initialHeight } = this.state.currentScriptDetailState; - this.setState({ + this.setState((state) => ({ currentScriptDetailState: { - ...this.state.currentScriptDetailState, - height: height >= initialHeight ? 0 : 'initial', + ...state.currentScriptDetailState, + height: height >= initialHeight ? 0 : initialHeight, }, - }); - } + })); + }; + + onShowScriptDetails = (script) => { + console.log(script); + }; displayAvailableScripts = () => { this.setState({ @@ -243,18 +244,6 @@ export default class ScriptQueue extends Component { return null; }; - onScriptModalOpen = (script) => () => { - this.setState({ - scriptModal: script, - }); - }; - - onScriptModalClose = (event) => { - this.setState({ - scriptModal: null, - }); - }; - onDragStart = (e, draggingId) => { if (!this.props.commandExecutePermission) return; const draggingScriptInstance = this.getScriptFromId(draggingId); @@ -659,26 +648,24 @@ export default class ScriptQueue extends Component { onClickContextMenu={this.onClickContextMenu} commandExecutePermission={this.props.commandExecutePermission} resumeScript={this.resumeScript} - onClick={this.onScriptModalOpen(current)} + onClick={() => null} />
-
- {this.state.resetButton} +
+ {this.state.resetButton}
+ ref={this.currentScriptDetailsContainer} + >
@@ -687,8 +674,9 @@ export default class ScriptQueue extends Component { group={''} name={'Script'} salindex={current.index ?? 0} - onCSCClick={(a) => console.log(a)} - displaySummaryState={false}/> + onCSCClick={() => null} + displaySummaryState={false} + />
@@ -823,7 +811,7 @@ export default class ScriptQueue extends Component { moveScriptDown={this.moveScriptDown} commandExecutePermission={this.props.commandExecutePermission} {...script} - onClick={this.onScriptModalOpen(script)} + onClick={() => this.onShowScriptDetails(script)} /> ); @@ -886,7 +874,7 @@ export default class ScriptQueue extends Component { } requeueScript={this.requeueScript} commandExecutePermission={this.props.commandExecutePermission} - onClick={this.onScriptModalOpen(script)} + onClick={() => this.onShowScriptDetails(script)} /> ); @@ -903,7 +891,6 @@ export default class ScriptQueue extends Component { contentLabel="Component selection modal" parentSelector={() => document.querySelector('#container')} size={50} - /* footerChildren={} */ > diff --git a/love/src/components/ScriptQueue/ScriptQueue.module.css b/love/src/components/ScriptQueue/ScriptQueue.module.css index 494c6ddef..d821701fe 100644 --- a/love/src/components/ScriptQueue/ScriptQueue.module.css +++ b/love/src/components/ScriptQueue/ScriptQueue.module.css @@ -64,7 +64,7 @@ .currentScriptContainer { grid-area: current; text-align: left; - padding: 0.5em 0.5em; + padding: 0.5em 1em; } .currentScriptWrapper { @@ -79,8 +79,6 @@ .currentScriptDetailsWrapper { grid-area: current-details; - display: flex; - flex-direction: column; } .currentScriptResetSize { @@ -89,12 +87,12 @@ .currentScriptDetails { display: grid; - grid-template-columns: 3fr 5fr; + grid-template-columns: 40% 60%; margin-bottom: 1em; border-bottom: 1px solid var(--second-tertiary-background-color); resize: vertical; + overflow-x: hidden; overflow-y: scroll; - /* overflow-x: hidden; */ } .currentScriptDescription { From d3fd08af91d819a3eee87be0921060bcb7134467 Mon Sep 17 00:00:00 2001 From: Sebastian Aranda Date: Tue, 23 Feb 2021 20:01:29 -0300 Subject: [PATCH 27/75] GlobalState small improvements --- love/src/components/ScriptQueue/GlobalState/GlobalState.jsx | 2 +- .../components/ScriptQueue/GlobalState/GlobalState.module.css | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/love/src/components/ScriptQueue/GlobalState/GlobalState.jsx b/love/src/components/ScriptQueue/GlobalState/GlobalState.jsx index d41540eea..3c6e0befb 100644 --- a/love/src/components/ScriptQueue/GlobalState/GlobalState.jsx +++ b/love/src/components/ScriptQueue/GlobalState/GlobalState.jsx @@ -33,7 +33,7 @@ const GlobalState = ({ const onClickContextMenu = React.useCallback((event) => { event.stopPropagation(); - setContextMenuIsOpen((state) => !state); + setContextMenuIsOpen((contextMenuIsOpen) => !contextMenuIsOpen); setContextMenuData(event.target.getBoundingClientRect()); }, []); diff --git a/love/src/components/ScriptQueue/GlobalState/GlobalState.module.css b/love/src/components/ScriptQueue/GlobalState/GlobalState.module.css index 2038af55e..609b994aa 100644 --- a/love/src/components/ScriptQueue/GlobalState/GlobalState.module.css +++ b/love/src/components/ScriptQueue/GlobalState/GlobalState.module.css @@ -41,7 +41,7 @@ .stateCell { display: grid; grid-template-columns: 8em 1fr; - align-items: baseline; + align-items: center; grid-column-gap: 0.5rem; } .stateLabel { From 97ead6343ebc02c6d2e512eee586c0e441638aaa Mon Sep 17 00:00:00 2001 From: Sebastian Aranda Date: Tue, 23 Feb 2021 20:04:17 -0300 Subject: [PATCH 28/75] Add new ResumeIcon --- .../Scripts/ContextMenu/ContextMenu.module.css | 13 +++---------- .../icons/ScriptQueue/ResumeIcon/ResumeIcon.jsx | 7 ++++--- .../ScriptQueue/ResumeIcon/ResumeIcon.module.css | 6 ++---- 3 files changed, 9 insertions(+), 17 deletions(-) diff --git a/love/src/components/ScriptQueue/Scripts/ContextMenu/ContextMenu.module.css b/love/src/components/ScriptQueue/Scripts/ContextMenu/ContextMenu.module.css index b751be791..4f1b905db 100644 --- a/love/src/components/ScriptQueue/Scripts/ContextMenu/ContextMenu.module.css +++ b/love/src/components/ScriptQueue/Scripts/ContextMenu/ContextMenu.module.css @@ -38,11 +38,9 @@ div.buttonText { .iconWrapper { background: none; - border: 1px solid var(--commandable-font-color); - padding: 0.15em; border-radius: 100%; margin-right: 0.4em; - width: 0.8em; + width: 2em; } .enabled { @@ -50,11 +48,6 @@ div.buttonText { cursor: pointer; } -.enabled .iconWrapper { - border: 1px solid var(--commandable-background); - background: var(--commandable-background); +.row:not(.enabled) .iconWrapper path{ + fill: initial; } - -/* .disabled:hover > svg { - background: none; -} */ diff --git a/love/src/components/icons/ScriptQueue/ResumeIcon/ResumeIcon.jsx b/love/src/components/icons/ScriptQueue/ResumeIcon/ResumeIcon.jsx index a942b5b81..e4700db41 100644 --- a/love/src/components/icons/ScriptQueue/ResumeIcon/ResumeIcon.jsx +++ b/love/src/components/icons/ScriptQueue/ResumeIcon/ResumeIcon.jsx @@ -4,10 +4,11 @@ import styles from './ResumeIcon.module.css'; export default class ResumeIcon extends Component { render() { return ( - + ); diff --git a/love/src/components/icons/ScriptQueue/ResumeIcon/ResumeIcon.module.css b/love/src/components/icons/ScriptQueue/ResumeIcon/ResumeIcon.module.css index 9e8a00a5a..c4131e41f 100644 --- a/love/src/components/icons/ScriptQueue/ResumeIcon/ResumeIcon.module.css +++ b/love/src/components/icons/ScriptQueue/ResumeIcon/ResumeIcon.module.css @@ -1,7 +1,5 @@ -.st0 { - fill: var(--commandable-font-color); - stroke: var(--commandable-font-color); - stroke-miterlimit: 10; +.cls-1{ + fill:#1ecfe8; } .svg { From 3041aca4104ec84f281bac8b051dec072a4527e5 Mon Sep 17 00:00:00 2001 From: Sebastian Aranda Date: Tue, 23 Feb 2021 20:05:08 -0300 Subject: [PATCH 29/75] Remove CurrentScript pointer --- .../ScriptQueue/Scripts/CurrentScript/CurrentScript.module.css | 1 - 1 file changed, 1 deletion(-) diff --git a/love/src/components/ScriptQueue/Scripts/CurrentScript/CurrentScript.module.css b/love/src/components/ScriptQueue/Scripts/CurrentScript/CurrentScript.module.css index 88d115cfc..f7355b9fc 100644 --- a/love/src/components/ScriptQueue/Scripts/CurrentScript/CurrentScript.module.css +++ b/love/src/components/ScriptQueue/Scripts/CurrentScript/CurrentScript.module.css @@ -1,6 +1,5 @@ .currentScriptContainer { padding: 0.5em; - cursor: pointer; user-select: none; } From 722640255a862607e811b91c9aa89d9329838fb8 Mon Sep 17 00:00:00 2001 From: Sebastian Aranda Date: Tue, 23 Feb 2021 20:23:32 -0300 Subject: [PATCH 30/75] Rever to commit 20093edc48fc3f5d9afa1c886536c53b84887b80 --- love/src/components/icons/GearIcon/GearIcon.jsx | 12 +++++------- .../components/icons/GearIcon/GearIcon.module.css | 15 ++++++--------- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/love/src/components/icons/GearIcon/GearIcon.jsx b/love/src/components/icons/GearIcon/GearIcon.jsx index 06e86b4af..7613ac378 100644 --- a/love/src/components/icons/GearIcon/GearIcon.jsx +++ b/love/src/components/icons/GearIcon/GearIcon.jsx @@ -5,16 +5,14 @@ export default function GearIcon(props) { const status = props.active ? styles.active : styles.inactive; const className = [styles.gearIcon, props.className, props.style].join(' '); return ( - + ); diff --git a/love/src/components/icons/GearIcon/GearIcon.module.css b/love/src/components/icons/GearIcon/GearIcon.module.css index dd68e13e1..ce73d25cb 100644 --- a/love/src/components/icons/GearIcon/GearIcon.module.css +++ b/love/src/components/icons/GearIcon/GearIcon.module.css @@ -1,18 +1,15 @@ .gearIcon { display: inline-block; - max-height: 100%; - stroke-miterlimit: 10; - stroke-width: 2px; + max-height:100%; + stroke-miterlimit:10; + stroke-width:2px; vertical-align: middle; } -.cls-1{fill:none;stroke:#1ecfe8;stroke-miterlimit:10;stroke-width:2px;} -.cls-2{fill:#1ecfe8;} - -/* .active { - fill: var(--base-font-color); +.active { + fill:var(--base-font-color); } .inactive { fill: var(--secondary-font-color); -} */ +} From 14f77a6645a096b08932d641208697545306163f Mon Sep 17 00:00:00 2001 From: Sebastian Aranda Date: Tue, 23 Feb 2021 20:46:17 -0300 Subject: [PATCH 31/75] Add new GearIcon --- .../ScriptQueue/GlobalState/GlobalState.jsx | 2 +- .../icons/ScriptQueue/GearIcon/GearIcon.jsx | 20 +++++++++++++++++++ .../ScriptQueue/GearIcon/GearIcon.module.css | 14 +++++++++++++ 3 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 love/src/components/icons/ScriptQueue/GearIcon/GearIcon.jsx create mode 100644 love/src/components/icons/ScriptQueue/GearIcon/GearIcon.module.css diff --git a/love/src/components/ScriptQueue/GlobalState/GlobalState.jsx b/love/src/components/ScriptQueue/GlobalState/GlobalState.jsx index 3c6e0befb..649180f0c 100644 --- a/love/src/components/ScriptQueue/GlobalState/GlobalState.jsx +++ b/love/src/components/ScriptQueue/GlobalState/GlobalState.jsx @@ -4,7 +4,7 @@ import styles from './GlobalState.module.css'; import StatusText from 'components/GeneralPurpose/StatusText/StatusText.jsx'; import ResumeIcon from 'components/icons/ScriptQueue/ResumeIcon/ResumeIcon'; import PauseIcon from 'components/icons/ScriptQueue/PauseIcon/PauseIcon'; -import GearIcon from 'components/icons/GearIcon/GearIcon.jsx'; +import GearIcon from 'components/icons/ScriptQueue/GearIcon/GearIcon.jsx'; import ContextMenu from '../Scripts/ContextMenu/ContextMenu'; import CSCDetail from 'components/CSCSummary/CSCDetail/CSCDetail.jsx'; diff --git a/love/src/components/icons/ScriptQueue/GearIcon/GearIcon.jsx b/love/src/components/icons/ScriptQueue/GearIcon/GearIcon.jsx new file mode 100644 index 000000000..9eb2754ef --- /dev/null +++ b/love/src/components/icons/ScriptQueue/GearIcon/GearIcon.jsx @@ -0,0 +1,20 @@ +import React from 'react'; +import styles from './GearIcon.module.css'; + +export default function GearIcon(props) { + const className = [styles.gearIcon, props.className].join(' '); + return ( + + + + + ); +} diff --git a/love/src/components/icons/ScriptQueue/GearIcon/GearIcon.module.css b/love/src/components/icons/ScriptQueue/GearIcon/GearIcon.module.css new file mode 100644 index 000000000..df70827df --- /dev/null +++ b/love/src/components/icons/ScriptQueue/GearIcon/GearIcon.module.css @@ -0,0 +1,14 @@ +.gearIcon { + vertical-align: middle; +} + +.cls-1{ + fill:none; + stroke:#1ecfe8; + stroke-miterlimit:10; + stroke-width:2px; +} + +.cls-2{ + fill:#1ecfe8; +} \ No newline at end of file From ba9aa9da0a0b65f21d43bc7348f16d5d40d2bf74 Mon Sep 17 00:00:00 2001 From: Sebastian Aranda Date: Tue, 23 Feb 2021 21:07:04 -0300 Subject: [PATCH 32/75] Add new LaunchScript and RequeueScript icons --- .../LaunchScriptIcon/LaunchScriptIcon.jsx | 32 +++++++------- .../LaunchScriptIcon.module.css | 29 ++++++++---- .../ScriptQueue/RequeueIcon/RequeueIcon.jsx | 44 +++++++++++-------- .../RequeueIcon/RequeueIcon.module.css | 30 ++++++------- 4 files changed, 76 insertions(+), 59 deletions(-) diff --git a/love/src/components/icons/ScriptQueue/LaunchScriptIcon/LaunchScriptIcon.jsx b/love/src/components/icons/ScriptQueue/LaunchScriptIcon/LaunchScriptIcon.jsx index 962bdc567..377c74393 100644 --- a/love/src/components/icons/ScriptQueue/LaunchScriptIcon/LaunchScriptIcon.jsx +++ b/love/src/components/icons/ScriptQueue/LaunchScriptIcon/LaunchScriptIcon.jsx @@ -9,29 +9,31 @@ export default class LaunchScriptIcon extends Component { render() { return ( - + {this.props.title} - - + ); diff --git a/love/src/components/icons/ScriptQueue/LaunchScriptIcon/LaunchScriptIcon.module.css b/love/src/components/icons/ScriptQueue/LaunchScriptIcon/LaunchScriptIcon.module.css index c4ab0b91d..7bdb584d9 100644 --- a/love/src/components/icons/ScriptQueue/LaunchScriptIcon/LaunchScriptIcon.module.css +++ b/love/src/components/icons/ScriptQueue/LaunchScriptIcon/LaunchScriptIcon.module.css @@ -1,11 +1,24 @@ -.classOne { - fill: none; - /* stroke: var(--second-base-font-color); */ - stroke: var(--commandable-font-color); +.svg { + vertical-align: middle; +} + +.cls-1 { + fill: #122632; + opacity: 0.99; +} + +.cls-2 { + fill: #1ecfe8; +} + +.cls-1, .cls-2 { + fill-rule: evenodd; +} + +.cls-3 { + fill: #2b414d; + stroke: #1ecfe8; stroke-linecap: round; stroke-linejoin: round; -} -.classTwo { - /* fill: var(--second-base-font-color); */ - fill: var(--commandable-font-color); + stroke-width: 2px; } diff --git a/love/src/components/icons/ScriptQueue/RequeueIcon/RequeueIcon.jsx b/love/src/components/icons/ScriptQueue/RequeueIcon/RequeueIcon.jsx index dfbbdf8a1..aa2d47bae 100644 --- a/love/src/components/icons/ScriptQueue/RequeueIcon/RequeueIcon.jsx +++ b/love/src/components/icons/ScriptQueue/RequeueIcon/RequeueIcon.jsx @@ -3,35 +3,41 @@ import styles from './RequeueIcon.module.css'; export default class RequeueIcon extends Component { render() { - const status = this.props.active !== undefined && this.props.active === false ? styles.inactive : styles.active; - const title = this.props.title ? this.props.title : 'Requeue script'; return ( - - {title} + + {this.props.title} + ); diff --git a/love/src/components/icons/ScriptQueue/RequeueIcon/RequeueIcon.module.css b/love/src/components/icons/ScriptQueue/RequeueIcon/RequeueIcon.module.css index b6029e4c3..b1ba2949c 100644 --- a/love/src/components/icons/ScriptQueue/RequeueIcon/RequeueIcon.module.css +++ b/love/src/components/icons/ScriptQueue/RequeueIcon/RequeueIcon.module.css @@ -1,26 +1,22 @@ -.st0 { - fill: none; - stroke: var(--second-primary-background-color); - stroke-linecap: round; - stroke-linejoin: round; -} - -.st1 { - fill: var(--second-primary-background-color); -} - .svg { vertical-align: middle; } -.active { - stroke: var(--second-primary-background-color); +.cls-1 { + fill: #122632; + opacity: 0.99; +} + +.cls-3 { + stroke: #2b414d; + stroke-linecap: round; + stroke-linejoin: round; } -.inactive { - stroke: var(--secondary-font-color); +.cls-1, .cls-2 { + fill-rule: evenodd; } -.svg path { - stroke: var(--commandable-font-color); +.cls-2, .cls-3 { + fill: #1ecfe8; } From 7dc417662c1251ae36e1cd07cc1c74c0e9656b31 Mon Sep 17 00:00:00 2001 From: Sebastian Aranda Date: Tue, 23 Feb 2021 21:49:07 -0300 Subject: [PATCH 33/75] Add new WaitingScripts action button icons --- .../ScriptQueue/Scripts/Scripts.module.css | 20 ------------------- .../ScriptQueue/MoveDownIcon/MoveDownIcon.jsx | 9 ++++----- .../MoveDownIcon/MoveDownIcon.module.css | 9 ++++----- .../ScriptQueue/MoveUpIcon/MoveUpIcon.jsx | 12 +++++------ .../MoveUpIcon/MoveUpIcon.module.css | 16 ++------------- .../icons/ScriptQueue/StopIcon/StopIcon.jsx | 8 ++++---- .../ScriptQueue/StopIcon/StopIcon.module.css | 11 ++-------- 7 files changed, 21 insertions(+), 64 deletions(-) diff --git a/love/src/components/ScriptQueue/Scripts/Scripts.module.css b/love/src/components/ScriptQueue/Scripts/Scripts.module.css index 60f6b980b..1734a9bff 100644 --- a/love/src/components/ScriptQueue/Scripts/Scripts.module.css +++ b/love/src/components/ScriptQueue/Scripts/Scripts.module.css @@ -194,47 +194,27 @@ grid-column-gap: 0.2em; } -.buttonContainer { - padding: 0; - border: 1px solid transparent; - white-space: pre; - background: var(--commandable-background); - border-radius: 100%; - height: 1.5em; - width: 1.5em; - display: flex; - justify-content: center; -} - .noBackgroundButton { background: none; line-height: 1em; } .buttonContainer:hover { - /* background: var(--script-ok-color); */ background: var(--commandable-background-hover); - border: 1px solid var(--commandable-background); } .commandButton { display: grid; - /* grid-template-columns: 2em 1fr; */ padding: 0em; text-align: left; align-items: center; user-select: none; } -.commandButton div { - padding: 0 0.3em; -} - div.commandButtonText { padding-left: 0em; } .compact { - /* grid-template-columns: 2em 0; */ width: 1.8em; } diff --git a/love/src/components/icons/ScriptQueue/MoveDownIcon/MoveDownIcon.jsx b/love/src/components/icons/ScriptQueue/MoveDownIcon/MoveDownIcon.jsx index 2c416ade7..5d0e7faad 100644 --- a/love/src/components/icons/ScriptQueue/MoveDownIcon/MoveDownIcon.jsx +++ b/love/src/components/icons/ScriptQueue/MoveDownIcon/MoveDownIcon.jsx @@ -4,13 +4,12 @@ import styles from './MoveDownIcon.module.css'; export default class MoveDownIcon extends Component { render() { return ( - + {'Move script down'} ); diff --git a/love/src/components/icons/ScriptQueue/MoveDownIcon/MoveDownIcon.module.css b/love/src/components/icons/ScriptQueue/MoveDownIcon/MoveDownIcon.module.css index c85578dd0..3dad44dfa 100644 --- a/love/src/components/icons/ScriptQueue/MoveDownIcon/MoveDownIcon.module.css +++ b/love/src/components/icons/ScriptQueue/MoveDownIcon/MoveDownIcon.module.css @@ -1,8 +1,7 @@ -.path { - fill: var(--commandable-font-color); - stroke: var(--commandable-font-color); -} - .svg { vertical-align: middle; } + +.cls-1 { + fill: #1ecfe8; +} diff --git a/love/src/components/icons/ScriptQueue/MoveUpIcon/MoveUpIcon.jsx b/love/src/components/icons/ScriptQueue/MoveUpIcon/MoveUpIcon.jsx index 303a34dba..a1444fb69 100644 --- a/love/src/components/icons/ScriptQueue/MoveUpIcon/MoveUpIcon.jsx +++ b/love/src/components/icons/ScriptQueue/MoveUpIcon/MoveUpIcon.jsx @@ -4,14 +4,12 @@ import styles from './MoveUpIcon.module.css'; export default class MoveUpIcon extends Component { render() { return ( - - {'Move script up'} + + Move script up ); diff --git a/love/src/components/icons/ScriptQueue/MoveUpIcon/MoveUpIcon.module.css b/love/src/components/icons/ScriptQueue/MoveUpIcon/MoveUpIcon.module.css index 5f4358aff..3dad44dfa 100644 --- a/love/src/components/icons/ScriptQueue/MoveUpIcon/MoveUpIcon.module.css +++ b/love/src/components/icons/ScriptQueue/MoveUpIcon/MoveUpIcon.module.css @@ -1,19 +1,7 @@ -.st0 { - fill: none; - stroke: var(--second-base-font-color); - stroke-linecap: round; - stroke-linejoin: round; -} - -.st1 { - fill: var(--second-base-font-color); -} - .svg { vertical-align: middle; } -.svg path { - fill: var(--commandable-font-color); - stroke: var(--commandable-font-color); +.cls-1 { + fill: #1ecfe8; } diff --git a/love/src/components/icons/ScriptQueue/StopIcon/StopIcon.jsx b/love/src/components/icons/ScriptQueue/StopIcon/StopIcon.jsx index 1e9ef93bd..ecfffbd5d 100644 --- a/love/src/components/icons/ScriptQueue/StopIcon/StopIcon.jsx +++ b/love/src/components/icons/ScriptQueue/StopIcon/StopIcon.jsx @@ -4,13 +4,13 @@ import styles from './StopIcon.module.css'; export default class StopIcon extends Component { render() { return ( - + {'Stop script'} - ); } diff --git a/love/src/components/icons/ScriptQueue/StopIcon/StopIcon.module.css b/love/src/components/icons/ScriptQueue/StopIcon/StopIcon.module.css index 94a78c8d4..3dad44dfa 100644 --- a/love/src/components/icons/ScriptQueue/StopIcon/StopIcon.module.css +++ b/love/src/components/icons/ScriptQueue/StopIcon/StopIcon.module.css @@ -1,14 +1,7 @@ -.st0 { - fill: #798d99; - stroke: #798d99; - stroke-miterlimit: 10; -} - .svg { vertical-align: middle; } -.svg path { - fill: var(--commandable-font-color); - stroke: var(--commandable-font-color); +.cls-1 { + fill: #1ecfe8; } From 339ed9721eedd23f59126a995e71dde9246bee1f Mon Sep 17 00:00:00 2001 From: Sebastian Aranda Date: Tue, 23 Feb 2021 22:13:41 -0300 Subject: [PATCH 34/75] Remove unused code --- .../CSCSummary/CSCExpanded/CSCExpanded.jsx | 20 ------------------- .../LogMessageDisplay/LogMessageDisplay.jsx | 15 +++++++------- 2 files changed, 8 insertions(+), 27 deletions(-) diff --git a/love/src/components/CSCSummary/CSCExpanded/CSCExpanded.jsx b/love/src/components/CSCSummary/CSCExpanded/CSCExpanded.jsx index c22b83cc0..ee2a2c3fc 100644 --- a/love/src/components/CSCSummary/CSCExpanded/CSCExpanded.jsx +++ b/love/src/components/CSCSummary/CSCExpanded/CSCExpanded.jsx @@ -36,18 +36,6 @@ export default class CSCExpanded extends PureComponent { this.props.subscribeToStreams(this.props.name, this.props.salindex); }; - constructor(props) { - super(props); - this.state = { - messageFilters: { - 10: { value: true, name: 'Debug' }, - 20: { value: true, name: 'Info' }, - 30: { value: true, name: 'Warning' }, - 40: { value: true, name: 'Error' }, - }, - }; - } - static states = { 0: { name: 'UNKNOWN', @@ -87,14 +75,6 @@ export default class CSCExpanded extends PureComponent { }, }; - updateFilter = (key, value) => { - const filters = this.state.messageFilters; - filters[key].value = value; - this.setState({ - messageFilters: { ...filters }, - }); - }; - render() { const summaryStateValue = this.props.summaryStateData ? this.props.summaryStateData.summaryState.value : 0; const summaryState = CSCExpanded.states[summaryStateValue]; diff --git a/love/src/components/GeneralPurpose/LogMessageDisplay/LogMessageDisplay.jsx b/love/src/components/GeneralPurpose/LogMessageDisplay/LogMessageDisplay.jsx index 8f4b0a140..c14f74055 100644 --- a/love/src/components/GeneralPurpose/LogMessageDisplay/LogMessageDisplay.jsx +++ b/love/src/components/GeneralPurpose/LogMessageDisplay/LogMessageDisplay.jsx @@ -1,18 +1,19 @@ import React, { useState, memo } from 'react'; import PropTypes from 'prop-types'; -import InfoIcon from '../../icons/InfoIcon/InfoIcon'; -import WarningIcon from '../../icons/WarningIcon/WarningIcon'; -import ErrorIcon from '../../icons/ErrorIcon/ErrorIcon'; +import DebugIcon from '../../icons/CSCExpanded/DebugIcon/DebugIcon'; +import InfoIcon from '../../icons/CSCExpanded/InfoIcon/InfoIcon'; +import WarningIcon from '../../icons/CSCExpanded/WarningIcon/WarningIcon'; +import ErrorIcon from '../../icons/CSCExpanded/ErrorIcon/ErrorIcon'; import Button from '../../GeneralPurpose/Button/Button'; import styles from './LogMessageDisplay.module.css'; import { formatTimestamp } from '../../../Utils'; function LogMessageDisplay({ logMessageData, clearCSCLogMessages }) { const [messageFilters, setMessageFilters] = useState({ - 10: { value: true, name: 'Debug' }, - 20: { value: true, name: 'Info' }, - 30: { value: true, name: 'Warning' }, - 40: { value: true, name: 'Error' }, + 10: { value: true, name: 'Debug', icon: }, + 20: { value: true, name: 'Info', icon: }, + 30: { value: true, name: 'Warning', icon: }, + 40: { value: true, name: 'Error', icon: }, }); const updateFilter = (key, value) => { From 12ed8a5ab3b7d3b8453c6274e47bef25ad662ef6 Mon Sep 17 00:00:00 2001 From: Sebastian Aranda Date: Tue, 23 Feb 2021 22:13:58 -0300 Subject: [PATCH 35/75] Add new CSCExpanded log icons --- .../icons/CSCExpanded/DebugIcon/DebugIcon.jsx | 20 +++++++++++++++++++ .../DebugIcon/DebugIcon.module.css | 3 +++ .../icons/CSCExpanded/ErrorIcon/ErrorIcon.jsx | 20 +++++++++++++++++++ .../ErrorIcon/ErrorIcon.module.css | 3 +++ .../icons/CSCExpanded/InfoIcon/InfoIcon.jsx | 20 +++++++++++++++++++ .../CSCExpanded/InfoIcon/InfoIcon.module.css | 3 +++ .../CSCExpanded/WarningIcon/WarningIcon.jsx | 20 +++++++++++++++++++ .../WarningIcon/WarningIcon.module.css | 3 +++ 8 files changed, 92 insertions(+) create mode 100644 love/src/components/icons/CSCExpanded/DebugIcon/DebugIcon.jsx create mode 100644 love/src/components/icons/CSCExpanded/DebugIcon/DebugIcon.module.css create mode 100644 love/src/components/icons/CSCExpanded/ErrorIcon/ErrorIcon.jsx create mode 100644 love/src/components/icons/CSCExpanded/ErrorIcon/ErrorIcon.module.css create mode 100644 love/src/components/icons/CSCExpanded/InfoIcon/InfoIcon.jsx create mode 100644 love/src/components/icons/CSCExpanded/InfoIcon/InfoIcon.module.css create mode 100644 love/src/components/icons/CSCExpanded/WarningIcon/WarningIcon.jsx create mode 100644 love/src/components/icons/CSCExpanded/WarningIcon/WarningIcon.module.css diff --git a/love/src/components/icons/CSCExpanded/DebugIcon/DebugIcon.jsx b/love/src/components/icons/CSCExpanded/DebugIcon/DebugIcon.jsx new file mode 100644 index 000000000..181ed2a1b --- /dev/null +++ b/love/src/components/icons/CSCExpanded/DebugIcon/DebugIcon.jsx @@ -0,0 +1,20 @@ +import React from 'react'; +import styles from './DebugIcon.module.css'; + +export default function DebugIcon(props) { + const className = [styles.svg, props.className].join(' '); + return ( + + + + + ); +} diff --git a/love/src/components/icons/CSCExpanded/DebugIcon/DebugIcon.module.css b/love/src/components/icons/CSCExpanded/DebugIcon/DebugIcon.module.css new file mode 100644 index 000000000..6e39796cb --- /dev/null +++ b/love/src/components/icons/CSCExpanded/DebugIcon/DebugIcon.module.css @@ -0,0 +1,3 @@ +.svg { + vertical-align: middle; +} \ No newline at end of file diff --git a/love/src/components/icons/CSCExpanded/ErrorIcon/ErrorIcon.jsx b/love/src/components/icons/CSCExpanded/ErrorIcon/ErrorIcon.jsx new file mode 100644 index 000000000..1a1af2e8b --- /dev/null +++ b/love/src/components/icons/CSCExpanded/ErrorIcon/ErrorIcon.jsx @@ -0,0 +1,20 @@ +import React from 'react'; +import styles from './ErrorIcon.module.css'; + +export default function ErrorIcon(props) { + const className = [styles.svg, props.className].join(' '); + return ( + + + + + ); +} diff --git a/love/src/components/icons/CSCExpanded/ErrorIcon/ErrorIcon.module.css b/love/src/components/icons/CSCExpanded/ErrorIcon/ErrorIcon.module.css new file mode 100644 index 000000000..6e39796cb --- /dev/null +++ b/love/src/components/icons/CSCExpanded/ErrorIcon/ErrorIcon.module.css @@ -0,0 +1,3 @@ +.svg { + vertical-align: middle; +} \ No newline at end of file diff --git a/love/src/components/icons/CSCExpanded/InfoIcon/InfoIcon.jsx b/love/src/components/icons/CSCExpanded/InfoIcon/InfoIcon.jsx new file mode 100644 index 000000000..32f95d2cd --- /dev/null +++ b/love/src/components/icons/CSCExpanded/InfoIcon/InfoIcon.jsx @@ -0,0 +1,20 @@ +import React from 'react'; +import styles from './InfoIcon.module.css'; + +export default function InfoIcon(props) { + const className = [styles.svg, props.className].join(' '); + return ( + + + + + ); +} diff --git a/love/src/components/icons/CSCExpanded/InfoIcon/InfoIcon.module.css b/love/src/components/icons/CSCExpanded/InfoIcon/InfoIcon.module.css new file mode 100644 index 000000000..6e39796cb --- /dev/null +++ b/love/src/components/icons/CSCExpanded/InfoIcon/InfoIcon.module.css @@ -0,0 +1,3 @@ +.svg { + vertical-align: middle; +} \ No newline at end of file diff --git a/love/src/components/icons/CSCExpanded/WarningIcon/WarningIcon.jsx b/love/src/components/icons/CSCExpanded/WarningIcon/WarningIcon.jsx new file mode 100644 index 000000000..7981ade09 --- /dev/null +++ b/love/src/components/icons/CSCExpanded/WarningIcon/WarningIcon.jsx @@ -0,0 +1,20 @@ +import React from 'react'; +import styles from './WarningIcon.module.css'; + +export default function WarningIcon(props) { + const className = [styles.svg, props.className].join(' '); + return ( + + + + + ); +} diff --git a/love/src/components/icons/CSCExpanded/WarningIcon/WarningIcon.module.css b/love/src/components/icons/CSCExpanded/WarningIcon/WarningIcon.module.css new file mode 100644 index 000000000..04610fd7b --- /dev/null +++ b/love/src/components/icons/CSCExpanded/WarningIcon/WarningIcon.module.css @@ -0,0 +1,3 @@ +.svg { + vertical-align: middle; +} From 5678c3269e810c1f00b916428a430fffb8a19dc6 Mon Sep 17 00:00:00 2001 From: Sebastian Aranda Date: Tue, 23 Feb 2021 22:24:50 -0300 Subject: [PATCH 36/75] Add new CSCExpanded log icons --- .../LogMessageDisplay/LogMessageDisplay.jsx | 1 + .../icons/CSCExpanded/DebugIcon/DebugIcon.jsx | 13 +++++++------ .../CSCExpanded/DebugIcon/DebugIcon.module.css | 10 +++++++++- .../icons/CSCExpanded/ErrorIcon/ErrorIcon.jsx | 10 +++++----- .../CSCExpanded/ErrorIcon/ErrorIcon.module.css | 13 ++++++++++++- .../icons/CSCExpanded/InfoIcon/InfoIcon.jsx | 13 +++++++------ .../CSCExpanded/InfoIcon/InfoIcon.module.css | 10 +++++++++- .../icons/CSCExpanded/WarningIcon/WarningIcon.jsx | 15 ++++++++++----- .../WarningIcon/WarningIcon.module.css | 8 ++++++++ 9 files changed, 68 insertions(+), 25 deletions(-) diff --git a/love/src/components/GeneralPurpose/LogMessageDisplay/LogMessageDisplay.jsx b/love/src/components/GeneralPurpose/LogMessageDisplay/LogMessageDisplay.jsx index c14f74055..e95ef6f8e 100644 --- a/love/src/components/GeneralPurpose/LogMessageDisplay/LogMessageDisplay.jsx +++ b/love/src/components/GeneralPurpose/LogMessageDisplay/LogMessageDisplay.jsx @@ -36,6 +36,7 @@ function LogMessageDisplay({ logMessageData, clearCSCLogMessages }) { return (
{this.props.displaySummaryState && (
From 675d70a6180b679d6d873b8c978ab296dd20eace Mon Sep 17 00:00:00 2001 From: Sebastian Aranda Date: Mon, 1 Mar 2021 11:01:12 -0300 Subject: [PATCH 39/75] Aesthetic changes --- .../LogMessageDisplay/LogMessageDisplay.jsx | 2 +- .../components/ScriptQueue/ScriptQueue.jsx | 21 ++++++------------- .../ScriptQueue/ScriptQueue.module.css | 12 +++++++---- .../ScriptQueue/Scripts/Scripts.module.css | 1 + 4 files changed, 16 insertions(+), 20 deletions(-) diff --git a/love/src/components/GeneralPurpose/LogMessageDisplay/LogMessageDisplay.jsx b/love/src/components/GeneralPurpose/LogMessageDisplay/LogMessageDisplay.jsx index e95ef6f8e..16fa86497 100644 --- a/love/src/components/GeneralPurpose/LogMessageDisplay/LogMessageDisplay.jsx +++ b/love/src/components/GeneralPurpose/LogMessageDisplay/LogMessageDisplay.jsx @@ -37,13 +37,13 @@ function LogMessageDisplay({ logMessageData, clearCSCLogMessages }) {
); diff --git a/love/src/components/ScriptQueue/ScriptQueue.jsx b/love/src/components/ScriptQueue/ScriptQueue.jsx index 56fe34de8..d847429b4 100644 --- a/love/src/components/ScriptQueue/ScriptQueue.jsx +++ b/love/src/components/ScriptQueue/ScriptQueue.jsx @@ -51,9 +51,9 @@ export default class ScriptQueue extends Component { availableScriptsFilter: '', currentScriptDetailState: { height: 'initial', - initialHeight: 9999, + initialHeight: 350, }, - resetButton: , + resetButton: Hide details ▲, }; this.observer = null; @@ -122,9 +122,9 @@ export default class ScriptQueue extends Component { } if (this.state.currentScriptDetailState !== _prevState.currentScriptDetailState) { if (this.state.currentScriptDetailState.height < this.state.currentScriptDetailState.initialHeight) { - this.setState({ resetButton: }); + this.setState({ resetButton: Show details ▼ }); } else { - this.setState({ resetButton: }); + this.setState({ resetButton: Hide details ▲ }); } } @@ -673,9 +673,10 @@ export default class ScriptQueue extends Component { null} displaySummaryState={false} + hideTitle={true} />
@@ -884,16 +885,6 @@ export default class ScriptQueue extends Component { - - document.querySelector('#container')} - size={50} - > - - ); } diff --git a/love/src/components/ScriptQueue/ScriptQueue.module.css b/love/src/components/ScriptQueue/ScriptQueue.module.css index d821701fe..64082074c 100644 --- a/love/src/components/ScriptQueue/ScriptQueue.module.css +++ b/love/src/components/ScriptQueue/ScriptQueue.module.css @@ -82,7 +82,9 @@ } .currentScriptResetSize { - /* background-color: red; */ + text-align: right; + margin-right: 1em; + padding: 0.5em 0; } .currentScriptDetails { @@ -90,9 +92,10 @@ grid-template-columns: 40% 60%; margin-bottom: 1em; border-bottom: 1px solid var(--second-tertiary-background-color); - resize: vertical; - overflow-x: hidden; - overflow-y: scroll; + /* resize: vertical; */ + /* overflow-x: hidden; */ + overflow-y: hidden; + transition: all 300ms ease-in-out; } .currentScriptDescription { @@ -101,6 +104,7 @@ } .currentScriptLogs { + overflow-y: scroll; } .scriptList { diff --git a/love/src/components/ScriptQueue/Scripts/Scripts.module.css b/love/src/components/ScriptQueue/Scripts/Scripts.module.css index 1734a9bff..284fdf9df 100644 --- a/love/src/components/ScriptQueue/Scripts/Scripts.module.css +++ b/love/src/components/ScriptQueue/Scripts/Scripts.module.css @@ -172,6 +172,7 @@ color: var(--highlighted-font-color); font-size: var(--font-size-large); grid-column-start: span 2; + text-align: left; } .subSectionLabel { From 3e58759ca7eb85f71dbe101a52be68f724c5ead9 Mon Sep 17 00:00:00 2001 From: sebastian-aranda Date: Wed, 10 Mar 2021 19:37:52 -0300 Subject: [PATCH 40/75] Build docker images from tickets branch --- Jenkinsfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Jenkinsfile b/Jenkinsfile index d0966a68c..323eec94c 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -17,6 +17,7 @@ pipeline { branch "bugfix/*" branch "hotfix/*" branch "release/*" + branch "tickets/*" } } steps { @@ -27,7 +28,7 @@ pipeline { if (slashPosition > 0) { git_tag = git_branch.substring(slashPosition + 1, git_branch.length()) git_branch = git_branch.substring(0, slashPosition) - if (git_branch == "release" || git_branch == "hotfix" || git_branch == "bugfix") { + if (git_branch == "release" || git_branch == "hotfix" || git_branch == "bugfix" || git_branch == "tickets") { image_tag = git_tag } } @@ -45,6 +46,7 @@ pipeline { branch "bugfix/*" branch "hotfix/*" branch "release/*" + branch "tickets/*" } } steps { From f9da47a25738e2a3d0bee397975564b8ca92ff7f Mon Sep 17 00:00:00 2001 From: sebastian-aranda Date: Wed, 10 Mar 2021 19:40:39 -0300 Subject: [PATCH 41/75] Add missing unsubscription methods --- love/src/components/AuxTel/Camera/Camera.jsx | 2 ++ .../components/CSCSummary/CSCDetail/CSCDetail.jsx | 2 ++ .../CSCSummary/CSCExpanded/CSCExpanded.jsx | 2 ++ love/src/components/CSCSummary/CSCGroup/CSCGroup.jsx | 4 ++++ love/src/components/EventLog/EventLog.container.jsx | 12 ++++++++++-- love/src/components/EventLog/EventLog.jsx | 5 +++++ .../Plot/PolarPlot/PolarPlot.container.jsx | 8 ++------ .../MainTel/CableWraps/CableWraps.container.jsx | 3 +-- .../src/components/MainTel/CableWraps/CableWraps.jsx | 5 +++++ love/src/components/MainTel/M1M3/M1M3.jsx | 6 ++++++ 10 files changed, 39 insertions(+), 10 deletions(-) diff --git a/love/src/components/AuxTel/Camera/Camera.jsx b/love/src/components/AuxTel/Camera/Camera.jsx index 4983e4f49..da02d0dd7 100644 --- a/love/src/components/AuxTel/Camera/Camera.jsx +++ b/love/src/components/AuxTel/Camera/Camera.jsx @@ -15,6 +15,8 @@ export default class Camera extends Component { calibrationDetailedState: PropTypes.string, shutterDetailedState: PropTypes.string, imageSequence: PropTypes.object, + subscribeToStreams: PropTypes.func, + unsubscribeToStreams: PropTypes.func, }; constructor(props) { diff --git a/love/src/components/CSCSummary/CSCDetail/CSCDetail.jsx b/love/src/components/CSCSummary/CSCDetail/CSCDetail.jsx index a08d7140e..f90fcb85c 100644 --- a/love/src/components/CSCSummary/CSCDetail/CSCDetail.jsx +++ b/love/src/components/CSCSummary/CSCDetail/CSCDetail.jsx @@ -14,6 +14,7 @@ export default class CSCDetail extends Component { heartbeatData: PropTypes.object, summaryStateData: PropTypes.object, subscribeToStreams: PropTypes.func, + unsubscribeToStreams: PropTypes.func, embedded: PropTypes.bool, /* Whether the component should subscribe to streams*/ shouldSubscribe: PropTypes.bool, @@ -27,6 +28,7 @@ export default class CSCDetail extends Component { heartbeatData: null, summaryStateData: undefined, subscribeToStreams: () => {}, + unsubscribeToStreams: () => {}, embedded: false, shouldSubscribe: true, }; diff --git a/love/src/components/CSCSummary/CSCExpanded/CSCExpanded.jsx b/love/src/components/CSCSummary/CSCExpanded/CSCExpanded.jsx index c22b83cc0..d55a22d6c 100644 --- a/love/src/components/CSCSummary/CSCExpanded/CSCExpanded.jsx +++ b/love/src/components/CSCSummary/CSCExpanded/CSCExpanded.jsx @@ -18,6 +18,8 @@ export default class CSCExpanded extends PureComponent { summaryStateData: PropTypes.object, logMessageData: PropTypes.array, errorCodeData: PropTypes.array, + subscribeToStreams: PropTypes.func, + unsubscribeToStreams: PropTypes.func, }; static defaultProps = { diff --git a/love/src/components/CSCSummary/CSCGroup/CSCGroup.jsx b/love/src/components/CSCSummary/CSCGroup/CSCGroup.jsx index 0be7ee833..dc25b303f 100644 --- a/love/src/components/CSCSummary/CSCGroup/CSCGroup.jsx +++ b/love/src/components/CSCSummary/CSCGroup/CSCGroup.jsx @@ -12,17 +12,21 @@ export default class CSCGroup extends Component { selectedCSC: undefined, }; } + static propTypes = { name: PropTypes.string, cscs: PropTypes.array, onCSCClick: PropTypes.func, embedded: PropTypes.bool, + subscribeToStreams: PropTypes.func, + unsubscribeToStreams: PropTypes.func, }; static defaultProps = { name: '', cscs: [], subscribeToStreams: () => 0, + unsubscribeToStreams: () => 0, selectedCSC: undefined, embedded: false, }; diff --git a/love/src/components/EventLog/EventLog.container.jsx b/love/src/components/EventLog/EventLog.container.jsx index c996812ce..2432c3e36 100644 --- a/love/src/components/EventLog/EventLog.container.jsx +++ b/love/src/components/EventLog/EventLog.container.jsx @@ -1,7 +1,7 @@ import React from 'react'; import { connect } from 'react-redux'; import EventLog from './EventLog'; -import { addGroup } from '../../redux/actions/ws'; +import { addGroup, removeGroup } from '../../redux/actions/ws'; import { removeCSCLogMessages, removeCSCErrorCodeData } from '../../redux/actions/summaryData'; import { getGroupSortedErrorCodeData, getGroupSortedLogMessageData } from '../../redux/selectors'; import { CSCSummaryHierarchy } from '../../Config'; @@ -48,6 +48,7 @@ const EventLogContainer = ({ logMessageData, errorCodeData, subscribeToStreams, + unsubscribeToStreams, heartbeatData, ...props }) => { @@ -61,6 +62,7 @@ const EventLogContainer = ({ errorCodeData={errorCodeData} summaryStateData={summaryStateData} subscribeToStreams={subscribeToStreams} + unsubscribeToStreams={unsubscribeToStreams} logMessageData={logMessageData} heartbeatData={heartbeatData} clearCSCLogMessages={clearCSCLogMessages} @@ -77,7 +79,13 @@ const mapDispatchToProps = (dispatch) => { dispatch(addGroup(`event-${nameIndex}-logMessage`)); dispatch(addGroup(`event-${nameIndex}-errorCode`)); }); - // dispatch(addGroup('event-Heartbeat-0-stream')); + }, + unsubscribeToStreams: (cscList) => { + cscList.forEach((cscNameIndex) => { + const nameIndex = Object.values(cscNameIndex).join('-'); + dispatch(removeGroup(`event-${nameIndex}-logMessage`)); + dispatch(removeGroup(`event-${nameIndex}-errorCode`)); + }); }, clearCSCLogMessages: (cscList) => { cscList.forEach((cscNameIndex) => { diff --git a/love/src/components/EventLog/EventLog.jsx b/love/src/components/EventLog/EventLog.jsx index 65d8e657e..c3f64674b 100644 --- a/love/src/components/EventLog/EventLog.jsx +++ b/love/src/components/EventLog/EventLog.jsx @@ -17,6 +17,7 @@ export default class EventLog extends PureComponent { clearCSCErrorCodes: PropTypes.func, clearCSCLogMessages: PropTypes.func, subscribeToStream: PropTypes.func, + unsubscribeToStream: PropTypes.func, errorCodeData: PropTypes.array, embedded: PropTypes.bool, }; @@ -58,6 +59,10 @@ export default class EventLog extends PureComponent { this.props.subscribeToStreams(this.props.cscList); }; + componentWillUnmount = () => { + this.props.unsubscribeToStreams(this.props.cscList); + }; + clearGroupErrorCodes = () => { // this.props.cscList.forEach(({ name, salindex }) => { // this.props.clearCSCErrorCodes(name, salindex); diff --git a/love/src/components/GeneralPurpose/Plot/PolarPlot/PolarPlot.container.jsx b/love/src/components/GeneralPurpose/Plot/PolarPlot/PolarPlot.container.jsx index a2da2aad1..b0eac2e6d 100644 --- a/love/src/components/GeneralPurpose/Plot/PolarPlot/PolarPlot.container.jsx +++ b/love/src/components/GeneralPurpose/Plot/PolarPlot/PolarPlot.container.jsx @@ -1,13 +1,9 @@ import React from 'react'; import { connect } from 'react-redux'; -import { addGroup, requestGroupRemoval } from 'redux/actions/ws'; +import { addGroup, removeGroup } from 'redux/actions/ws'; import { getStreamsData, getTaiToUtc } from 'redux/selectors/selectors'; import PolarPlot from './PolarPlot'; import ManagerInterface, { parseTimestamp, parsePlotInputs, parseCommanderData } from 'Utils'; -import Moment from 'moment'; -import { extendMoment } from 'moment-range'; - -const moment = extendMoment(Moment); export const defaultStyles = [ { @@ -384,7 +380,7 @@ const mapDispatchToProps = (dispatch, ownProps) => { const displayDome = ownProps.displayDome || schema.props.displayDome.default; const groupNames = getGroupNames(inputs, displayDome); groupNames.forEach((groupName) => { - dispatch(requestGroupRemoval(groupName)); + dispatch(removeGroup(groupName)); }); }, }; diff --git a/love/src/components/MainTel/CableWraps/CableWraps.container.jsx b/love/src/components/MainTel/CableWraps/CableWraps.container.jsx index e69edec98..ae7bd3e72 100644 --- a/love/src/components/MainTel/CableWraps/CableWraps.container.jsx +++ b/love/src/components/MainTel/CableWraps/CableWraps.container.jsx @@ -40,8 +40,7 @@ const mapStateToProps = (state) => { }; const mapDispatchToProps = (dispatch) => { - const subscriptions = [ - ]; + const subscriptions = []; return { subscriptions, subscribeToStreams: () => { diff --git a/love/src/components/MainTel/CableWraps/CableWraps.jsx b/love/src/components/MainTel/CableWraps/CableWraps.jsx index b1826d3a6..57c60dd21 100755 --- a/love/src/components/MainTel/CableWraps/CableWraps.jsx +++ b/love/src/components/MainTel/CableWraps/CableWraps.jsx @@ -22,6 +22,7 @@ class CableWraps extends Component { } componentDidMount() { + this.props.subscribeToStreams(); // Replace the following code with data from redux selectors setInterval( () => @@ -39,6 +40,10 @@ class CableWraps extends Component { ); } + componentWillUnmount() { + this.props.unsubscribeToStreams(); + } + receiveMsg(msg) { this.setState({ cable_wraps: msg, diff --git a/love/src/components/MainTel/M1M3/M1M3.jsx b/love/src/components/MainTel/M1M3/M1M3.jsx index 190497fa6..7a5cea296 100644 --- a/love/src/components/MainTel/M1M3/M1M3.jsx +++ b/love/src/components/MainTel/M1M3/M1M3.jsx @@ -19,6 +19,8 @@ export default class M1M3 extends Component { } componentDidMount() { + this.props.subscribeToStreams(); + let yMax = -Infinity; let xMax = -Infinity; let yMin = Infinity; @@ -42,6 +44,10 @@ export default class M1M3 extends Component { }); } + componentWillUnmount() { + this.props.unsubscribeToStreams(); + } + componentDidUpdate(prevProps, prevState) { d3.select('#circle-overlay-' + this.props.id).call(d3.zoom().scaleExtent([1, Infinity]).on('zoom', this.zoomed)); } From 1fa864bfed2328bec6c939922006fb55e4fd247c Mon Sep 17 00:00:00 2001 From: sebastian-aranda Date: Thu, 11 Mar 2021 15:45:57 -0300 Subject: [PATCH 42/75] Add mising unsubscribeToStreams methods --- .../CSCSummary/CSCDetail/CSCDetail.container.jsx | 10 +++++++++- .../components/CSCSummary/CSCDetail/CSCDetail.jsx | 4 ++++ .../CSCExpanded/CSCExpanded.container.jsx | 11 +++++++++-- .../CSCSummary/CSCExpanded/CSCExpanded.jsx | 4 ++++ .../CSCSummary/CSCGroup/CSCGroup.container.jsx | 14 ++++++++++---- .../components/CSCSummary/CSCGroup/CSCGroup.jsx | 8 ++++++++ .../CSCGroupLog/CSCGroupLog.container.jsx | 7 ++++++- .../CSCSummary/CSCGroupLog/CSCGroupLog.jsx | 8 ++++++++ .../components/CSCSummary/CSCSummary.container.jsx | 1 - 9 files changed, 58 insertions(+), 9 deletions(-) diff --git a/love/src/components/CSCSummary/CSCDetail/CSCDetail.container.jsx b/love/src/components/CSCSummary/CSCDetail/CSCDetail.container.jsx index 847f05def..07f339637 100644 --- a/love/src/components/CSCSummary/CSCDetail/CSCDetail.container.jsx +++ b/love/src/components/CSCSummary/CSCDetail/CSCDetail.container.jsx @@ -1,7 +1,7 @@ import React from 'react'; import { connect } from 'react-redux'; import CSCDetail from './CSCDetail'; -import { addGroup } from '../../../redux/actions/ws'; +import { addGroup, removeGroup } from '../../../redux/actions/ws'; import { getStreamData, getCSCHeartbeat } from '../../../redux/selectors'; export const schema = { @@ -67,6 +67,7 @@ const CSCDetailContainer = ({ summaryStateData, onCSCClick, subscribeToStreams, + unsubscribeToStreams, heartbeatData, embedded, }) => { @@ -79,6 +80,7 @@ const CSCDetailContainer = ({ summaryStateData={summaryStateData} onCSCClick={onCSCClick} subscribeToStreams={subscribeToStreams} + unsubscribeToStreams={unsubscribeToStreams} heartbeatData={heartbeatData} embedded={embedded} /> @@ -93,6 +95,12 @@ const mapDispatchToProps = (dispatch) => { dispatch(addGroup(`event-${cscName}-${index}-logMessage`)); dispatch(addGroup(`event-${cscName}-${index}-errorCode`)); }, + unsubscribeToStreams: (cscName, index) => { + dispatch(removeGroup('event-Heartbeat-0-stream')); + dispatch(removeGroup(`event-${cscName}-${index}-summaryState`)); + dispatch(removeGroup(`event-${cscName}-${index}-logMessage`)); + dispatch(removeGroup(`event-${cscName}-${index}-errorCode`)); + }, }; }; diff --git a/love/src/components/CSCSummary/CSCDetail/CSCDetail.jsx b/love/src/components/CSCSummary/CSCDetail/CSCDetail.jsx index f90fcb85c..73a709c46 100644 --- a/love/src/components/CSCSummary/CSCDetail/CSCDetail.jsx +++ b/love/src/components/CSCSummary/CSCDetail/CSCDetail.jsx @@ -76,6 +76,10 @@ export default class CSCDetail extends Component { if (!this.props.shouldSubscribe) this.props.subscribeToStreams(this.props.name, this.props.salindex); }; + componentWillUnmount = () => { + if (!this.props.shouldSubscribe) this.props.unsubscribeToStreams(this.props.name, this.props.salindex); + } + render() { const { props } = this; let heartbeatStatus = 'unknown'; diff --git a/love/src/components/CSCSummary/CSCExpanded/CSCExpanded.container.jsx b/love/src/components/CSCSummary/CSCExpanded/CSCExpanded.container.jsx index f4041739b..0727a4003 100644 --- a/love/src/components/CSCSummary/CSCExpanded/CSCExpanded.container.jsx +++ b/love/src/components/CSCSummary/CSCExpanded/CSCExpanded.container.jsx @@ -1,7 +1,7 @@ import React from 'react'; import { connect } from 'react-redux'; import CSCExpanded from './CSCExpanded'; -import { addGroup } from '../../../redux/actions/ws'; +import { addGroup, removeGroup } from '../../../redux/actions/ws'; import { removeCSCLogMessages, removeCSCErrorCodeData } from '../../../redux/actions/summaryData'; import { getStreamData, getCSCHeartbeat, getCSCLogMessages, getCSCErrorCodeData } from '../../../redux/selectors'; @@ -59,6 +59,7 @@ const CSCExpandedContainer = ({ logMessageData, errorCodeData, subscribeToStreams, + unsubscribeToStreams, heartbeatData, displaySummaryState = true, }) => { @@ -72,6 +73,7 @@ const CSCExpandedContainer = ({ errorCodeData={errorCodeData} summaryStateData={summaryStateData} subscribeToStreams={subscribeToStreams} + unsubscribeToStreams={unsubscribeToStreams} logMessageData={logMessageData} heartbeatData={heartbeatData} clearCSCLogMessages={clearCSCLogMessages} @@ -87,7 +89,12 @@ const mapDispatchToProps = (dispatch) => { dispatch(addGroup(`event-${cscName}-${index}-summaryState`)); dispatch(addGroup(`event-${cscName}-${index}-logMessage`)); dispatch(addGroup(`event-${cscName}-${index}-errorCode`)); - dispatch(addGroup('event-Heartbeat-0-stream')); + }, + unsubscribeToStreams: (cscName, index) => { + dispatch(removeGroup('event-Heartbeat-0-stream')); + dispatch(removeGroup(`event-${cscName}-${index}-summaryState`)); + dispatch(removeGroup(`event-${cscName}-${index}-logMessage`)); + dispatch(removeGroup(`event-${cscName}-${index}-errorCode`)); }, clearCSCLogMessages: (csc, salindex) => { dispatch(removeCSCLogMessages(csc, salindex)); diff --git a/love/src/components/CSCSummary/CSCExpanded/CSCExpanded.jsx b/love/src/components/CSCSummary/CSCExpanded/CSCExpanded.jsx index d55a22d6c..8e8616ec8 100644 --- a/love/src/components/CSCSummary/CSCExpanded/CSCExpanded.jsx +++ b/love/src/components/CSCSummary/CSCExpanded/CSCExpanded.jsx @@ -38,6 +38,10 @@ export default class CSCExpanded extends PureComponent { this.props.subscribeToStreams(this.props.name, this.props.salindex); }; + componentWillUnmount = () => { + this.props.unsubscribeToStreams(this.props.name, this.props.salindex); + } + constructor(props) { super(props); this.state = { diff --git a/love/src/components/CSCSummary/CSCGroup/CSCGroup.container.jsx b/love/src/components/CSCSummary/CSCGroup/CSCGroup.container.jsx index 7cd115bb9..c9a54eafe 100644 --- a/love/src/components/CSCSummary/CSCGroup/CSCGroup.container.jsx +++ b/love/src/components/CSCSummary/CSCGroup/CSCGroup.container.jsx @@ -1,7 +1,7 @@ import React from 'react'; import { connect } from 'react-redux'; import CSCGroup from './CSCGroup'; -import { addGroup } from '../../../redux/actions/ws'; +import { addGroup, removeGroup } from '../../../redux/actions/ws'; import { removeCSCLogMessages, removeCSCErrorCodeData } from '../../../redux/actions/summaryData'; import { getStreamData, getCSCHeartbeat, getCSCLogMessages, getCSCErrorCodeData } from '../../../redux/selectors'; @@ -90,20 +90,26 @@ export const schema = { }, }; -const CSCGroupContainer = ({ subscribeToStreams, ...props }) => { - return ; +const CSCGroupContainer = ({ subscribeToStreams, unsubscribeToStreams, ...props }) => { + return ; }; const mapDispatchToProps = (dispatch, ownProps) => { return { subscribeToStreams: (cscName, index) => { + console.log(`SUBSCRIBING TO ${cscName}-${index}...`); dispatch(addGroup('event-Heartbeat-0-stream')); dispatch(addGroup(`event-${cscName}-${index}-summaryState`)); dispatch(addGroup(`event-${cscName}-${index}-logMessage`)); dispatch(addGroup(`event-${cscName}-${index}-errorCode`)); - dispatch(addGroup('event-Heartbeat-0-stream')); ownProps.subscribeToStreamCallback(cscName, index); }, + unsubscribeToStreams: (cscName, index) => { + dispatch(removeGroup('event-Heartbeat-0-stream')); + dispatch(removeGroup(`event-${cscName}-${index}-summaryState`)); + dispatch(removeGroup(`event-${cscName}-${index}-logMessage`)); + dispatch(removeGroup(`event-${cscName}-${index}-errorCode`)); + }, clearCSCLogMessages: (csc, salindex) => { dispatch(removeCSCLogMessages(csc, salindex)); }, diff --git a/love/src/components/CSCSummary/CSCGroup/CSCGroup.jsx b/love/src/components/CSCSummary/CSCGroup/CSCGroup.jsx index dc25b303f..8760d5b14 100644 --- a/love/src/components/CSCSummary/CSCGroup/CSCGroup.jsx +++ b/love/src/components/CSCSummary/CSCGroup/CSCGroup.jsx @@ -39,6 +39,14 @@ export default class CSCGroup extends Component { } }; + componentWillUnmount = () => { + if (this.props.csc !== undefined) { + this.props.cscs.forEach((csc) => { + this.props.unsubscribeToStreams(csc.name, csc.salindex); + }); + } + } + renderExpandedView = (selectedCSC) => { const groupView = selectedCSC.csc === 'all'; diff --git a/love/src/components/CSCSummary/CSCGroupLog/CSCGroupLog.container.jsx b/love/src/components/CSCSummary/CSCGroupLog/CSCGroupLog.container.jsx index 22c1cdd51..6beb4a5a7 100644 --- a/love/src/components/CSCSummary/CSCGroupLog/CSCGroupLog.container.jsx +++ b/love/src/components/CSCSummary/CSCGroupLog/CSCGroupLog.container.jsx @@ -1,7 +1,7 @@ import React from 'react'; import { connect } from 'react-redux'; import CSCGroupLog from './CSCGroupLog'; -import { addGroup } from '../../../redux/actions/ws'; +import { addGroup, removeGroup } from '../../../redux/actions/ws'; import { getGroupSortedErrorCodeData } from '../../../redux/selectors'; import { removeCSCErrorCodeData } from '../../../redux/actions/summaryData'; @@ -61,6 +61,7 @@ const CSCGroupLogContainer = ({ onCSCClick, clearCSCErrorCodes, subscribeToStream, + unsubscribeToStream, errorCodeData, cscList, embedded, @@ -72,6 +73,7 @@ const CSCGroupLogContainer = ({ onCSCClick={onCSCClick} clearCSCErrorCodes={clearCSCErrorCodes} subscribeToStream={subscribeToStream} + unsubscribeToStream={unsubscribeToStream} errorCodeData={errorCodeData} cscList={cscList} embedded={embedded} @@ -84,6 +86,9 @@ const mapDispatchtoProps = (dispatch) => { subscribeToStream: (cscName, index) => { dispatch(addGroup(`event-${cscName}-${index}-errorCode`)); }, + unsubscribeToStream: (cscName, index) => { + dispatch(removeGroup(`event-${cscName}-${index}-errorCode`)); + }, clearCSCErrorCodes: (csc, salindex) => { dispatch(removeCSCErrorCodeData(csc, salindex)); }, diff --git a/love/src/components/CSCSummary/CSCGroupLog/CSCGroupLog.jsx b/love/src/components/CSCSummary/CSCGroupLog/CSCGroupLog.jsx index 525859507..8c59bf7a1 100644 --- a/love/src/components/CSCSummary/CSCGroupLog/CSCGroupLog.jsx +++ b/love/src/components/CSCSummary/CSCGroupLog/CSCGroupLog.jsx @@ -15,8 +15,10 @@ export default class CSCGroupLog extends Component { clearCSCErrorCodes: PropTypes.func, clearCSCLogMessages: PropTypes.func, subscribeToStream: PropTypes.func, + unsubscribeToStream: PropTypes.func, errorCodeData: PropTypes.array, embedded: PropTypes.bool, + cscList: PropTypes.array, }; static defaultProps = { @@ -36,6 +38,12 @@ export default class CSCGroupLog extends Component { }); }; + componentWillUnmount = () => { + this.props.cscList.forEach(({ name, salindex }) => { + this.props.unsubscribeToStream(name, salindex); + }); + } + clearGroupErrorCodes = () => { this.props.cscList.forEach(({ name, salindex }) => { this.props.clearCSCErrorCodes(name, salindex); diff --git a/love/src/components/CSCSummary/CSCSummary.container.jsx b/love/src/components/CSCSummary/CSCSummary.container.jsx index 1b90b4ab8..000e66a3b 100644 --- a/love/src/components/CSCSummary/CSCSummary.container.jsx +++ b/love/src/components/CSCSummary/CSCSummary.container.jsx @@ -25,7 +25,6 @@ export const schema = { const CSCSummaryContainer = ({ hierarchy = CSCSummaryHierarchy, expandHeight, - subscribeToStreamsWithCallback, ...props }) => { const [subscriptions, setSubscriptions] = useState([]); From 742813d1a97af75fee628c15c5631bf3d6b90444 Mon Sep 17 00:00:00 2001 From: sebastian-aranda Date: Fri, 12 Mar 2021 15:27:21 -0300 Subject: [PATCH 43/75] Add missing unsubscribeToStreams method --- .../CSCSummary/CSCExpanded/CSCExpanded.container.jsx | 10 +++++++++- .../components/CSCSummary/CSCExpanded/CSCExpanded.jsx | 5 +++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/love/src/components/CSCSummary/CSCExpanded/CSCExpanded.container.jsx b/love/src/components/CSCSummary/CSCExpanded/CSCExpanded.container.jsx index c587dd8b7..1e3d2e815 100644 --- a/love/src/components/CSCSummary/CSCExpanded/CSCExpanded.container.jsx +++ b/love/src/components/CSCSummary/CSCExpanded/CSCExpanded.container.jsx @@ -1,7 +1,7 @@ import React from 'react'; import { connect } from 'react-redux'; import CSCExpanded from './CSCExpanded'; -import { addGroup } from '../../../redux/actions/ws'; +import { addGroup, removeGroup } from '../../../redux/actions/ws'; import { removeCSCLogMessages, removeCSCErrorCodeData } from '../../../redux/actions/summaryData'; import { getStreamData, getCSCHeartbeat, getCSCLogMessages, getCSCErrorCodeData } from '../../../redux/selectors'; @@ -59,6 +59,7 @@ const CSCExpandedContainer = ({ logMessageData, errorCodeData, subscribeToStreams, + unsubscribeToStreams, heartbeatData, displaySummaryState = true, hideTitle = false, @@ -73,6 +74,7 @@ const CSCExpandedContainer = ({ errorCodeData={errorCodeData} summaryStateData={summaryStateData} subscribeToStreams={subscribeToStreams} + unsubscribeToStreams={unsubscribeToStreams} logMessageData={logMessageData} heartbeatData={heartbeatData} clearCSCLogMessages={clearCSCLogMessages} @@ -90,6 +92,12 @@ const mapDispatchToProps = (dispatch) => { dispatch(addGroup(`event-${cscName}-${index}-logMessage`)); dispatch(addGroup(`event-${cscName}-${index}-errorCode`)); }, + unsubscribeToStreams: (cscName, index) => { + dispatch(removeGroup('event-Heartbeat-0-stream')); + dispatch(removeGroup(`event-${cscName}-${index}-summaryState`)); + dispatch(removeGroup(`event-${cscName}-${index}-logMessage`)); + dispatch(removeGroup(`event-${cscName}-${index}-errorCode`)); + }, clearCSCLogMessages: (csc, salindex) => { dispatch(removeCSCLogMessages(csc, salindex)); }, diff --git a/love/src/components/CSCSummary/CSCExpanded/CSCExpanded.jsx b/love/src/components/CSCSummary/CSCExpanded/CSCExpanded.jsx index 533d428fb..2d8d35849 100644 --- a/love/src/components/CSCSummary/CSCExpanded/CSCExpanded.jsx +++ b/love/src/components/CSCSummary/CSCExpanded/CSCExpanded.jsx @@ -36,8 +36,13 @@ export default class CSCExpanded extends PureComponent { this.props.subscribeToStreams(this.props.name, this.props.salindex); }; + componentWillUnmount = () => { + this.props.unsubscribeToStreams(this.props.name, this.props.salindex); + }; + componentDidUpdate = (prevProps, prevState) => { if (prevProps.name !== this.props.name || prevProps.salindex !== this.props.salindex) { + this.props.unsubscribeToStreams(prevProps.name, prevProps.salindex); this.props.subscribeToStreams(this.props.name, this.props.salindex); } }; From 8e1763d0621953882dbbc6a4d88dea7eb66ddfb6 Mon Sep 17 00:00:00 2001 From: sebastian-aranda Date: Fri, 12 Mar 2021 16:19:41 -0300 Subject: [PATCH 44/75] Add ScriptDetails expanded view to Waiting and Finished scripts --- .../components/ScriptQueue/ScriptQueue.jsx | 68 ++++++++++--------- .../Scripts/FinishedScript/FinishedScript.jsx | 9 +++ .../ScriptQueue/Scripts/Scripts.module.css | 1 + .../Scripts/WaitingScript/WaitingScript.jsx | 9 +++ 4 files changed, 56 insertions(+), 31 deletions(-) diff --git a/love/src/components/ScriptQueue/ScriptQueue.jsx b/love/src/components/ScriptQueue/ScriptQueue.jsx index 1247b8790..0a47e9032 100644 --- a/love/src/components/ScriptQueue/ScriptQueue.jsx +++ b/love/src/components/ScriptQueue/ScriptQueue.jsx @@ -17,7 +17,6 @@ import MoveToBottomIcon from '../icons/ScriptQueue/MoveToBottomIcon/MoveToBottom import { SALCommandStatus } from '../../redux/actions/ws'; import Input from '../GeneralPurpose/Input/Input'; import GlobalState from './GlobalState/GlobalState'; -import Modal from '../GeneralPurpose/Modal/Modal'; import ScriptDetails from './Scripts/ScriptDetails'; import CSCExpandedContainer from 'components/CSCSummary/CSCExpanded/CSCExpanded.container'; import debounce from 'lodash.debounce'; @@ -223,7 +222,7 @@ export default class ScriptQueue extends Component { }; onShowScriptDetails = (script) => { - console.log(script); + // console.log(script); }; displayAvailableScripts = () => { @@ -466,6 +465,7 @@ export default class ScriptQueue extends Component { }); }; onClickContextMenu = (event, index, currentMenuSelected = false) => { + console.log('Click context menu'); event.stopPropagation(); this.setState({ isContextMenuOpen: !this.state.isContextMenuOpen }); this.setState({ @@ -673,7 +673,7 @@ export default class ScriptQueue extends Component { null} displaySummaryState={false} hideTitle={true} @@ -799,21 +799,25 @@ export default class ScriptQueue extends Component { draggingScriptInstance={this.state.draggingScriptInstance} disabled={!this.props.commandExecutePermission} > - this.onShowScriptDetails(script)} - /> +
+ this.onShowScriptDetails(script)} + /> +
); })} @@ -864,19 +868,21 @@ export default class ScriptQueue extends Component { : script.timestampProcessEnd - script.timestampRunStart; return ( - this.onShowScriptDetails(script)} - /> +
+ this.onShowScriptDetails(script)} + /> +
); })} diff --git a/love/src/components/ScriptQueue/Scripts/FinishedScript/FinishedScript.jsx b/love/src/components/ScriptQueue/Scripts/FinishedScript/FinishedScript.jsx index f319143ad..d6723e7d6 100644 --- a/love/src/components/ScriptQueue/Scripts/FinishedScript/FinishedScript.jsx +++ b/love/src/components/ScriptQueue/Scripts/FinishedScript/FinishedScript.jsx @@ -42,9 +42,13 @@ export default class FinishedScript extends PureComponent { constructor(props) { super(props); + this.state = { + expanded: false, + }; } onClick = () => { + this.setState((state) => ({ expanded: !state.expanded })); this.props.onClick(); }; @@ -126,6 +130,11 @@ export default class FinishedScript extends PureComponent { +
+ +
{this.props.commandExecutePermission && (
this.props.requeueScript(this.props.index)}> diff --git a/love/src/components/ScriptQueue/Scripts/Scripts.module.css b/love/src/components/ScriptQueue/Scripts/Scripts.module.css index 284fdf9df..b6fc31c15 100644 --- a/love/src/components/ScriptQueue/Scripts/Scripts.module.css +++ b/love/src/components/ScriptQueue/Scripts/Scripts.module.css @@ -147,6 +147,7 @@ } .expandedSectionWrapper { + border-top: 1px solid gray; padding: 0.5em; } diff --git a/love/src/components/ScriptQueue/Scripts/WaitingScript/WaitingScript.jsx b/love/src/components/ScriptQueue/Scripts/WaitingScript/WaitingScript.jsx index 3007186a8..887d94406 100644 --- a/love/src/components/ScriptQueue/Scripts/WaitingScript/WaitingScript.jsx +++ b/love/src/components/ScriptQueue/Scripts/WaitingScript/WaitingScript.jsx @@ -61,9 +61,13 @@ export default class WaitingScript extends PureComponent { constructor(props) { super(props); + this.state = { + expanded: false, + }; } onClick = () => { + this.setState((state) => ({ expanded: !state.expanded })); this.props.onClick(); }; @@ -222,6 +226,11 @@ export default class WaitingScript extends PureComponent {
+
+ +
); From 659736cfe3fb12864f6a43ec220d248d192bdb1e Mon Sep 17 00:00:00 2001 From: sebastian-aranda Date: Wed, 17 Mar 2021 17:11:54 -0300 Subject: [PATCH 45/75] Add logs for resetSubscriptions --- love/src/components/Layout/Layout.jsx | 3 ++- love/src/redux/actions/ws.js | 18 +++++++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/love/src/components/Layout/Layout.jsx b/love/src/components/Layout/Layout.jsx index 08cda3a84..8ac8fe684 100644 --- a/love/src/components/Layout/Layout.jsx +++ b/love/src/components/Layout/Layout.jsx @@ -75,7 +75,7 @@ class Layout extends Component { tokenSwapStatus: PropTypes.string, /** Function to be called when requiring a user swap, similar to a logout */ requireUserSwap: PropTypes.func, - /** Function to call in order to rese4t subscriptions (when the manager heartbeat is missed) */ + /** Function to call in order to reset subscriptions (when the manager heartbeat is missed) */ resetSubscriptions: PropTypes.func, }; @@ -202,6 +202,7 @@ class Layout extends Component { const managerKey = HEARTBEAT_COMPONENTS?.MANAGER; if (this.state.heartbeatStatus?.[managerKey] === 'alert' && prevState.heartbeatStatus?.[managerKey] !== 'alert') { + console.log('Reseting from heartbeatStatus[managerKey]...'); this.props.resetSubscriptions(); } }; diff --git a/love/src/redux/actions/ws.js b/love/src/redux/actions/ws.js index 52a0e91a9..0845fb341 100644 --- a/love/src/redux/actions/ws.js +++ b/love/src/redux/actions/ws.js @@ -126,18 +126,18 @@ let resetSubsTimer = null; */ export const resetSubscriptions = (subscriptions = null) => { return (dispatch, getState) => { + console.log('RESETING SUBSCRIPTIONS...'); const subs = subscriptions || getSubscriptions(getState()); clearInterval(resetSubsTimer); resetSubsTimer = setInterval(() => dispatch(resetSubscriptions()), RESET_SUBS_PERIOD); dispatch({ type: RESET_SUBSCRIPTIONS, - subscriptions: subs - ? subs.map((sub) => ({ - ...sub, - status: groupStates.PENDING, - confirmationMessage: undefined, - })) - : [], + subscriptions: + subs?.map((sub) => ({ + ...sub, + status: groupStates.PENDING, + confirmationMessage: undefined, + })) || [], }); dispatch(_requestSubscriptions()); }; @@ -156,6 +156,7 @@ export const openWebsocketConnection = () => { const connectionStatus = getConnectionStatus(getState()); if (connectionStatus !== connectionStates.CLOSED) { dispatch(_changeConnectionState(connectionStates.CLOSED, socket)); + console.log('Reseting from nonConnectableTokenStates...'); dispatch(resetSubscriptions(getSubscriptions(getState()))); } return; @@ -182,10 +183,12 @@ export const openWebsocketConnection = () => { } else { dispatch(_changeConnectionState(connectionStates.RETRYING, socket)); } + console.log('Reseting from onClose socket...'); dispatch(resetSubscriptions(getSubscriptions(getState()))); }, onerror: () => { dispatch(_changeConnectionState(connectionStates.RETRYING, socket)); + console.log('Reseting from onError socket...'); dispatch(resetSubscriptions(getSubscriptions(getState()))); }, onmessage: (msg) => { @@ -286,6 +289,7 @@ export const openWebsocketConnection = () => { */ export const closeWebsocketConnection = () => { return (dispatch, getState) => { + console.log('Reseting from closeWebsocketConnection...'); dispatch(resetSubscriptions(getSubscriptions(getState()))); if (socket && getConnectionStatus(getState()) !== connectionStates.CLOSED) { socket.close(); From 82ec67994f8142dbbe2bc3f327301741f774a555 Mon Sep 17 00:00:00 2001 From: sebastian-aranda Date: Tue, 23 Mar 2021 16:40:01 -0300 Subject: [PATCH 46/75] Try frontend fix --- love/src/components/Layout/Layout.jsx | 4 ++-- love/src/redux/actions/ws.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/love/src/components/Layout/Layout.jsx b/love/src/components/Layout/Layout.jsx index 8ac8fe684..261126377 100644 --- a/love/src/components/Layout/Layout.jsx +++ b/love/src/components/Layout/Layout.jsx @@ -202,8 +202,8 @@ class Layout extends Component { const managerKey = HEARTBEAT_COMPONENTS?.MANAGER; if (this.state.heartbeatStatus?.[managerKey] === 'alert' && prevState.heartbeatStatus?.[managerKey] !== 'alert') { - console.log('Reseting from heartbeatStatus[managerKey]...'); - this.props.resetSubscriptions(); + // console.log('Reseting from heartbeatStatus[managerKey]...'); + // this.props.resetSubscriptions(); } }; diff --git a/love/src/redux/actions/ws.js b/love/src/redux/actions/ws.js index 0845fb341..e0c7dc15f 100644 --- a/love/src/redux/actions/ws.js +++ b/love/src/redux/actions/ws.js @@ -174,8 +174,8 @@ export const openWebsocketConnection = () => { onopen: () => { dispatch(_changeConnectionState(connectionStates.OPEN, socket)); dispatch(_requestSubscriptions()); - clearInterval(resetSubsTimer); - resetSubsTimer = setInterval(() => dispatch(resetSubscriptions()), RESET_SUBS_PERIOD); + // clearInterval(resetSubsTimer); + // resetSubsTimer = setInterval(() => dispatch(resetSubscriptions()), RESET_SUBS_PERIOD); }, onclose: (event) => { if (event.code === 4000 || event.code === 1000) { From 311c7e529a52b998aa2ddf5fde9eb3dc18a67c12 Mon Sep 17 00:00:00 2001 From: sebastian-aranda Date: Tue, 23 Mar 2021 17:33:19 -0300 Subject: [PATCH 47/75] Validation log --- love/src/components/Layout/Layout.jsx | 1 + 1 file changed, 1 insertion(+) diff --git a/love/src/components/Layout/Layout.jsx b/love/src/components/Layout/Layout.jsx index 261126377..5b452fa97 100644 --- a/love/src/components/Layout/Layout.jsx +++ b/love/src/components/Layout/Layout.jsx @@ -452,6 +452,7 @@ class Layout extends Component { (a) => isActive(a) && !isAcknowledged(a) && !isMuted(a) && a.severity?.value >= this.state.minSeverityNotification, ); + console.log('Log for validation...'); return ( <> From 80bdd070a7d4ce322c3794f7d1578c58122eb048 Mon Sep 17 00:00:00 2001 From: Tiago Ribeiro Date: Wed, 24 Mar 2021 15:41:11 -0700 Subject: [PATCH 48/75] Update default CSCSummaryHierarchy. --- love/src/Config.js | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/love/src/Config.js b/love/src/Config.js index a388978e9..f460f35ff 100644 --- a/love/src/Config.js +++ b/love/src/Config.js @@ -14,7 +14,7 @@ export const DATE_TIME_FORMAT = 'YYYY/MM/DD, HH:mm:ss'; // eslint-disable-next-line export const CSCSummaryHierarchy = { - 'Aux Telescope': { + Auxiliary Telescope: { ATTCS: [ { name: 'ATMCS', salindex: 0 }, { name: 'ATPtg', salindex: 0 }, @@ -23,7 +23,6 @@ export const CSCSummaryHierarchy = { { name: 'ATAOS', salindex: 0 }, { name: 'ATPneumatics', salindex: 0 }, { name: 'ATHexapod', salindex: 0 }, - { name: 'GenericCamera', salindex: 1 }, ], ATCalSys: [ { name: 'ATMonochromator', salindex: 0 }, @@ -41,19 +40,32 @@ export const CSCSummaryHierarchy = { { name: 'ATSpectrograph', salindex: 0 }, ], }, - 'Main Telescope': { - 'CSC Group 1': [ - { name: 'Test', salindex: 1 }, - { name: 'Test', salindex: 2 }, + Main Telescope: { + 'MTCS': [ + { name: 'MTMount', salindex: 0 }, + { name: 'MTPtg', salindex: 0 }, + { name: 'MTAOS', salindex: 0 }, + { name: 'MTM1M3', salindex: 0 }, + { name: 'MTM2', salindex: 0 }, + { name: 'MTHexapod', salindex: 1 }, + { name: 'MTHexapod', salindex: 2 }, + { name: 'MTRotator', salindex: 0 }, + { name: 'MTDome', salindex: 0 }, + { name: 'MTDomeTrajectory', salindex: 0 }, + ], + 'ComCam': [ + { name: 'CCCamera', salindex: 0 }, + { name: 'CCArchiver', salindex: 0 }, + { name: 'CCHeaderService', salindex: 0 }, ], - 'CSC Group 2': [], }, - Observatory: { - Queue: [ + 'Observatory': { + 'HigherLevel': [ { name: 'ScriptQueue', salindex: 1 }, { name: 'ScriptQueue', salindex: 2 }, + { name: 'Watcher', salindex: 0 }, ], - WeatherStation: [ + 'Environment': [ { name: 'DIMM', salindex: 1 }, { name: 'DIMM', salindex: 2 }, { name: 'WeatherStation', salindex: 1 }, @@ -470,4 +482,4 @@ export const M1M3ActuatorPositions = [ {id: 441, position: [-1.4399000e+01, 1.5768700e+02]}, {id: 442, position: [-4.2720000e+01, 1.5247100e+02]}, {id: 443, position: [-6.3150000e+01, 1.4538500e+02]} - ] \ No newline at end of file + ] From 6245ae22b73728dbcf408e03084bb6b9d05f80ba Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 30 Mar 2021 16:19:58 +0000 Subject: [PATCH 49/75] Bump y18n from 4.0.0 to 4.0.1 in /love Bumps [y18n](https://github.com/yargs/y18n) from 4.0.0 to 4.0.1. - [Release notes](https://github.com/yargs/y18n/releases) - [Changelog](https://github.com/yargs/y18n/blob/master/CHANGELOG.md) - [Commits](https://github.com/yargs/y18n/commits) Signed-off-by: dependabot[bot] --- love/yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/love/yarn.lock b/love/yarn.lock index cbb6f9135..217e3274b 100644 --- a/love/yarn.lock +++ b/love/yarn.lock @@ -14814,9 +14814,9 @@ xtend@^4.0.0, xtend@^4.0.1, xtend@~4.0.1: integrity sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ== y18n@^4.0.0: - version "4.0.0" - resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.0.tgz#95ef94f85ecc81d007c264e190a120f0a3c8566b" - integrity sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w== + version "4.0.1" + resolved "https://registry.yarnpkg.com/y18n/-/y18n-4.0.1.tgz#8db2b83c31c5d75099bb890b23f3094891e247d4" + integrity sha512-wNcy4NvjMYL8gogWWYAO7ZFWFfHcbdbE57tZO8e4cbpj8tfUcwrwqSl3ad8HxpYWCdXcJUCeKKZS62Av1affwQ== y18n@^5.0.1: version "5.0.5" From b09bd3dcb7f23f8144126d83446cd483e150e48b Mon Sep 17 00:00:00 2001 From: sebastian-aranda Date: Mon, 5 Apr 2021 13:38:38 -0400 Subject: [PATCH 50/75] Add frontend button for Stop All ATCS, also change SVG of dome emergency close --- .../components/CommandPanel/CommandPanel.jsx | 2 + .../CommandPanel/CommandPanel.module.css | 5 ++- .../DomeCloseButton/DomeCloseButton.jsx | 16 +++---- .../DomeCloseButton.module.css | 44 +++++++------------ .../StopAllTSCButton/StopAllTSCButton.jsx | 17 +++++++ .../StopAllTSCButton.module.css | 35 +++++++++++++++ 6 files changed, 78 insertions(+), 41 deletions(-) create mode 100644 love/src/components/CommandPanel/StopAllTSCButton/StopAllTSCButton.jsx create mode 100644 love/src/components/CommandPanel/StopAllTSCButton/StopAllTSCButton.module.css diff --git a/love/src/components/CommandPanel/CommandPanel.jsx b/love/src/components/CommandPanel/CommandPanel.jsx index a2bae37ae..78a779521 100644 --- a/love/src/components/CommandPanel/CommandPanel.jsx +++ b/love/src/components/CommandPanel/CommandPanel.jsx @@ -1,5 +1,6 @@ import React, { Component } from 'react'; import DomeCloseButton from './DomeCloseButton/DomeCloseButton'; +import StopAllTSCButton from './StopAllTSCButton/StopAllTSCButton'; import styles from './CommandPanel.module.css'; export default class CommandPanel extends Component { @@ -7,6 +8,7 @@ export default class CommandPanel extends Component { return (
+
); } diff --git a/love/src/components/CommandPanel/CommandPanel.module.css b/love/src/components/CommandPanel/CommandPanel.module.css index 674249d83..bd3612306 100644 --- a/love/src/components/CommandPanel/CommandPanel.module.css +++ b/love/src/components/CommandPanel/CommandPanel.module.css @@ -2,5 +2,8 @@ display: flex; /* justify-content: center; align-items: center; */ - height: 100%; +} + +.container div { + margin-right: 32px; } diff --git a/love/src/components/CommandPanel/DomeCloseButton/DomeCloseButton.jsx b/love/src/components/CommandPanel/DomeCloseButton/DomeCloseButton.jsx index edd0f89f2..b200bc5ad 100644 --- a/love/src/components/CommandPanel/DomeCloseButton/DomeCloseButton.jsx +++ b/love/src/components/CommandPanel/DomeCloseButton/DomeCloseButton.jsx @@ -6,17 +6,11 @@ export default class DomeCloseButton extends Component { return (
diff --git a/love/src/components/CommandPanel/DomeCloseButton/DomeCloseButton.module.css b/love/src/components/CommandPanel/DomeCloseButton/DomeCloseButton.module.css index 0f5ea2bda..93eb78ef2 100644 --- a/love/src/components/CommandPanel/DomeCloseButton/DomeCloseButton.module.css +++ b/love/src/components/CommandPanel/DomeCloseButton/DomeCloseButton.module.css @@ -1,15 +1,15 @@ .buttonWrapper { + height: 200px; + width: 200px; + text-align: center; } .button { - display: grid; - grid-template-columns: min-content; - grid-template-rows: min-content min-content; + width: 100%; + height: 100%; border-radius: 5px; - overflow: hidden; - width: fit-content; - border: none; - padding: 0; + border: 0; + padding: 16px; cursor: pointer; background: var(--status-alert-color); } @@ -18,32 +18,18 @@ background: var(--status-alert-dimmed-color-2); } -.domeSVG { -} - -.domeSVG path { - transform: translate(-140px, -120px); - fill: #fde8df; -} - -.domePath { -} - -.domeXPath { - stroke: var(--status-alert-color); - stroke-width: 3; - stroke-miterlimit: 10; -} - -.button:hover .domeXPath { - stroke: var(--status-alert-dimmed-color-2); - stroke-width: 3; - stroke-miterlimit: 10; +.svg { + height: 100px; + width: 100px; } .buttonLabel { + display: block; padding: 0.5em 1em; - padding-top: 0; color: white; font-size: var(--font-size-large); } + +.cls-1 { + fill: #fbe6dd; +} diff --git a/love/src/components/CommandPanel/StopAllTSCButton/StopAllTSCButton.jsx b/love/src/components/CommandPanel/StopAllTSCButton/StopAllTSCButton.jsx new file mode 100644 index 000000000..1e0ec9bfa --- /dev/null +++ b/love/src/components/CommandPanel/StopAllTSCButton/StopAllTSCButton.jsx @@ -0,0 +1,17 @@ +import React, { Component } from 'react'; +import styles from './StopAllTSCButton.module.css'; + +export default class StopAllTSCButton extends Component { + render() { + return ( +
+ +
+ ); + } +} diff --git a/love/src/components/CommandPanel/StopAllTSCButton/StopAllTSCButton.module.css b/love/src/components/CommandPanel/StopAllTSCButton/StopAllTSCButton.module.css new file mode 100644 index 000000000..93eb78ef2 --- /dev/null +++ b/love/src/components/CommandPanel/StopAllTSCButton/StopAllTSCButton.module.css @@ -0,0 +1,35 @@ +.buttonWrapper { + height: 200px; + width: 200px; + text-align: center; +} + +.button { + width: 100%; + height: 100%; + border-radius: 5px; + border: 0; + padding: 16px; + cursor: pointer; + background: var(--status-alert-color); +} + +.button:hover { + background: var(--status-alert-dimmed-color-2); +} + +.svg { + height: 100px; + width: 100px; +} + +.buttonLabel { + display: block; + padding: 0.5em 1em; + color: white; + font-size: var(--font-size-large); +} + +.cls-1 { + fill: #fbe6dd; +} From 5d5c46c966a488b1d7c5c85c586341d92687065c Mon Sep 17 00:00:00 2001 From: sebastian-aranda Date: Mon, 5 Apr 2021 17:57:45 -0400 Subject: [PATCH 51/75] Set pre-commit configs --- .pre-commit-config.yaml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 14cf99ca5..9397db097 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -9,9 +9,10 @@ repos: rev: v2.2.1 hooks: - id: prettier - types: [javascript] - repo: https://github.com/pre-commit/mirrors-eslint rev: v7.19.0 hooks: - - id: eslint \ No newline at end of file + - id: eslint + files: \.[j]sx?$ # *.js, *.jsx + types: [file] From af4bb04bbfc987895990d8627b7a0b1951ad79bf Mon Sep 17 00:00:00 2001 From: sebastian-aranda Date: Mon, 5 Apr 2021 17:58:06 -0400 Subject: [PATCH 52/75] Add mapStateToProps --- .../CommandPanel/CommandPanel.container.jsx | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/love/src/components/CommandPanel/CommandPanel.container.jsx b/love/src/components/CommandPanel/CommandPanel.container.jsx index bbbff2a74..62784c9b0 100644 --- a/love/src/components/CommandPanel/CommandPanel.container.jsx +++ b/love/src/components/CommandPanel/CommandPanel.container.jsx @@ -1,6 +1,7 @@ import React from 'react'; import { connect } from 'react-redux'; import { requestSALCommand } from '../../redux/actions/ws'; +import { getPermCmdExec, getScriptQueueState } from '../../redux/selectors'; import CommandPanel from './CommandPanel'; export const schema = { @@ -29,9 +30,19 @@ const CommandPanelContainer = ({ ...props }) => { const mapDispatchToProps = (dispatch, ownProps) => { return { requestSALCommand: (component, salindex, cmd) => { - return dispatch(requestSALCommand({ ...cmd, component, salindex })); + return; + dispatch(requestSALCommand({ ...cmd, component, salindex })); }, }; }; -export default connect(() => {}, mapDispatchToProps)(CommandPanelContainer); +const mapStateToProps = (state) => { + const commandExecutePermission = getPermCmdExec(state); + const queueState = getScriptQueueState(state, 1); + return { + commandExecutePermission: commandExecutePermission, + queueState: queueState, + }; +}; + +export default connect(mapStateToProps, mapDispatchToProps)(CommandPanelContainer); From f332f7d9c6232309d55bff0f5a6112ebabe1524e Mon Sep 17 00:00:00 2001 From: sebastian-aranda Date: Mon, 5 Apr 2021 18:02:27 -0400 Subject: [PATCH 53/75] Code refactor --- .../components/CommandPanel/CommandPanel.jsx | 4 ++-- .../StopAllTSCButton/StopAllTSCButton.jsx | 22 +++++++++++++++++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/love/src/components/CommandPanel/CommandPanel.jsx b/love/src/components/CommandPanel/CommandPanel.jsx index 78a779521..00e6000d3 100644 --- a/love/src/components/CommandPanel/CommandPanel.jsx +++ b/love/src/components/CommandPanel/CommandPanel.jsx @@ -7,8 +7,8 @@ export default class CommandPanel extends Component { render() { return (
- - + +
); } diff --git a/love/src/components/CommandPanel/StopAllTSCButton/StopAllTSCButton.jsx b/love/src/components/CommandPanel/StopAllTSCButton/StopAllTSCButton.jsx index 1e0ec9bfa..38cd47f63 100644 --- a/love/src/components/CommandPanel/StopAllTSCButton/StopAllTSCButton.jsx +++ b/love/src/components/CommandPanel/StopAllTSCButton/StopAllTSCButton.jsx @@ -1,13 +1,31 @@ import React, { Component } from 'react'; import styles from './StopAllTSCButton.module.css'; +import ManagerInterface from 'Utils'; export default class StopAllTSCButton extends Component { + constructor(props) { + super(props); + this.state = {}; + } + + callTSCStopAll() { + ManagerInterface.runATCSCommand('stop_all'); + } + render() { return (
- From 7b87cf35f71e41d1243e047f13440fb23953bd1b Mon Sep 17 00:00:00 2001 From: sebastian-aranda Date: Mon, 5 Apr 2021 18:03:16 -0400 Subject: [PATCH 54/75] Safe params on runATCSCommand --- love/src/Utils.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/love/src/Utils.js b/love/src/Utils.js index 560f8b6b1..5ef162897 100644 --- a/love/src/Utils.js +++ b/love/src/Utils.js @@ -338,7 +338,7 @@ export default class ManagerInterface { headers: this.getHeaders(), body: JSON.stringify({ command_name: commandName, - params: params, + params: params ?? {}, }), }).then((response) => { if (response.status >= 500) { From 18c9638b674ddf774ac591896307612092702974 Mon Sep 17 00:00:00 2001 From: sebastian-aranda Date: Mon, 5 Apr 2021 18:40:38 -0400 Subject: [PATCH 55/75] Add disable style --- .../CommandPanel/DomeCloseButton/DomeCloseButton.module.css | 5 +++++ .../StopAllTSCButton/StopAllTSCButton.module.css | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/love/src/components/CommandPanel/DomeCloseButton/DomeCloseButton.module.css b/love/src/components/CommandPanel/DomeCloseButton/DomeCloseButton.module.css index 93eb78ef2..b4108ecb4 100644 --- a/love/src/components/CommandPanel/DomeCloseButton/DomeCloseButton.module.css +++ b/love/src/components/CommandPanel/DomeCloseButton/DomeCloseButton.module.css @@ -18,6 +18,11 @@ background: var(--status-alert-dimmed-color-2); } +.button[disabled] { + cursor: not-allowed; + background: var(--status-alert-dimmed-color-2); +} + .svg { height: 100px; width: 100px; diff --git a/love/src/components/CommandPanel/StopAllTSCButton/StopAllTSCButton.module.css b/love/src/components/CommandPanel/StopAllTSCButton/StopAllTSCButton.module.css index 93eb78ef2..b4108ecb4 100644 --- a/love/src/components/CommandPanel/StopAllTSCButton/StopAllTSCButton.module.css +++ b/love/src/components/CommandPanel/StopAllTSCButton/StopAllTSCButton.module.css @@ -18,6 +18,11 @@ background: var(--status-alert-dimmed-color-2); } +.button[disabled] { + cursor: not-allowed; + background: var(--status-alert-dimmed-color-2); +} + .svg { height: 100px; width: 100px; From 6995eaf4bbc7c96ca81a92eedfc732747c602ee3 Mon Sep 17 00:00:00 2001 From: sebastian-aranda Date: Wed, 7 Apr 2021 12:01:47 -0400 Subject: [PATCH 56/75] Add missing quotes --- love/src/Config.js | 328 ++++++++++++++++++++++----------------------- 1 file changed, 164 insertions(+), 164 deletions(-) diff --git a/love/src/Config.js b/love/src/Config.js index f460f35ff..d0ccbafdd 100644 --- a/love/src/Config.js +++ b/love/src/Config.js @@ -14,7 +14,7 @@ export const DATE_TIME_FORMAT = 'YYYY/MM/DD, HH:mm:ss'; // eslint-disable-next-line export const CSCSummaryHierarchy = { - Auxiliary Telescope: { + 'Auxiliary Telescope': { ATTCS: [ { name: 'ATMCS', salindex: 0 }, { name: 'ATPtg', salindex: 0 }, @@ -40,8 +40,8 @@ export const CSCSummaryHierarchy = { { name: 'ATSpectrograph', salindex: 0 }, ], }, - Main Telescope: { - 'MTCS': [ + 'Main Telescope': { + MTCS: [ { name: 'MTMount', salindex: 0 }, { name: 'MTPtg', salindex: 0 }, { name: 'MTAOS', salindex: 0 }, @@ -53,19 +53,19 @@ export const CSCSummaryHierarchy = { { name: 'MTDome', salindex: 0 }, { name: 'MTDomeTrajectory', salindex: 0 }, ], - 'ComCam': [ + ComCam: [ { name: 'CCCamera', salindex: 0 }, { name: 'CCArchiver', salindex: 0 }, { name: 'CCHeaderService', salindex: 0 }, ], }, - 'Observatory': { - 'HigherLevel': [ + Observatory: { + HigherLevel: [ { name: 'ScriptQueue', salindex: 1 }, { name: 'ScriptQueue', salindex: 2 }, { name: 'Watcher', salindex: 0 }, ], - 'Environment': [ + Environment: [ { name: 'DIMM', salindex: 1 }, { name: 'DIMM', salindex: 2 }, { name: 'WeatherStation', salindex: 1 }, @@ -326,160 +326,160 @@ export const severityEnum = { }; export const M1M3ActuatorPositions = [ - {id: 101, position: [-3.0582000e+01, 0.0000000e+00]}, - {id: 102, position: [-5.6794000e+01, 0.0000000e+00]}, - {id: 103, position: [-8.3007000e+01, 0.0000000e+00]}, - {id: 104, position: [-1.0922000e+02, 0.0000000e+00]}, - {id: 105, position: [-1.3543300e+02, 0.0000000e+00]}, - {id: 106, position: [-1.5622100e+02, 0.0000000e+00]}, - {id: 107, position: [-1.7475000e+01, -2.2701000e+01]}, - {id: 108, position: [-4.3688000e+01, -2.2701000e+01]}, - {id: 109, position: [-6.9901000e+01, -2.2701000e+01]}, - {id: 110, position: [-9.6114000e+01, -2.2701000e+01]}, - {id: 111, position: [-1.2232600e+02, -2.2701000e+01]}, - {id: 112, position: [-1.4853900e+02, -2.2701000e+01]}, - {id: 113, position: [ 0.0000000e+00, -4.5402000e+01]}, - {id: 114, position: [-3.0582000e+01, -4.5402000e+01]}, - {id: 115, position: [-5.6794000e+01, -4.5402000e+01]}, - {id: 116, position: [-8.3007000e+01, -4.5402000e+01]}, - {id: 117, position: [-1.0922000e+02, -4.5402000e+01]}, - {id: 118, position: [-1.3543300e+02, -4.5402000e+01]}, - {id: 119, position: [-1.5356300e+02, -3.9279000e+01]}, - {id: 120, position: [-1.7475000e+01, -6.8103000e+01]}, - {id: 121, position: [-4.3688000e+01, -6.8103000e+01]}, - {id: 122, position: [-6.9901000e+01, -6.8103000e+01]}, - {id: 123, position: [-9.6113000e+01, -6.8103000e+01]}, - {id: 124, position: [-1.2232600e+02, -6.8103000e+01]}, - {id: 125, position: [-1.4663200e+02, -5.9762000e+01]}, - {id: 126, position: [ 0.0000000e+00, -9.0804000e+01]}, - {id: 127, position: [-3.0582000e+01, -9.0804000e+01]}, - {id: 128, position: [-5.6794000e+01, -9.0804000e+01]}, - {id: 129, position: [-8.3007000e+01, -9.0804000e+01]}, - {id: 130, position: [-1.0922000e+02, -9.0804000e+01]}, - {id: 131, position: [-1.3338400e+02, -8.5331000e+01]}, - {id: 132, position: [-1.7475000e+01, -1.1350500e+02]}, - {id: 133, position: [-4.3688000e+01, -1.1350500e+02]}, - {id: 134, position: [-6.9901000e+01, -1.1350500e+02]}, - {id: 135, position: [-9.6113000e+01, -1.1350500e+02]}, - {id: 136, position: [-1.1572300e+02, -1.0807800e+02]}, - {id: 137, position: [-8.7380000e+00, -1.3620600e+02]}, - {id: 138, position: [-3.4950000e+01, -1.3620600e+02]}, - {id: 139, position: [-6.1163000e+01, -1.2863900e+02]}, - {id: 140, position: [-8.2273000e+01, -1.3529100e+02]}, - {id: 141, position: [-1.4399000e+01, -1.5768700e+02]}, - {id: 142, position: [-4.2720000e+01, -1.5247100e+02]}, - {id: 143, position: [-6.3150000e+01, -1.4538500e+02]}, - {id: 207, position: [ 1.7475000e+01, -2.2701000e+01]}, - {id: 208, position: [ 4.3688000e+01, -2.2701000e+01]}, - {id: 209, position: [ 6.9901000e+01, -2.2701000e+01]}, - {id: 210, position: [ 9.6114000e+01, -2.2701000e+01]}, - {id: 211, position: [ 1.2232600e+02, -2.2701000e+01]}, - {id: 212, position: [ 1.4853900e+02, -2.2701000e+01]}, - {id: 214, position: [ 3.0582000e+01, -4.5402000e+01]}, - {id: 215, position: [ 5.6794000e+01, -4.5402000e+01]}, - {id: 216, position: [ 8.3007000e+01, -4.5402000e+01]}, - {id: 217, position: [ 1.0922000e+02, -4.5402000e+01]}, - {id: 218, position: [ 1.3543300e+02, -4.5402000e+01]}, - {id: 219, position: [ 1.5356300e+02, -3.9279000e+01]}, - {id: 220, position: [ 1.7475000e+01, -6.8103000e+01]}, - {id: 221, position: [ 4.3688000e+01, -6.8103000e+01]}, - {id: 222, position: [ 6.9901000e+01, -6.8103000e+01]}, - {id: 223, position: [ 9.6113000e+01, -6.8103000e+01]}, - {id: 224, position: [ 1.2232600e+02, -6.8103000e+01]}, - {id: 225, position: [ 1.4663200e+02, -5.9762000e+01]}, - {id: 227, position: [ 3.0582000e+01, -9.0804000e+01]}, - {id: 228, position: [ 5.6794000e+01, -9.0804000e+01]}, - {id: 229, position: [ 8.3007000e+01, -9.0804000e+01]}, - {id: 230, position: [ 1.0922000e+02, -9.0804000e+01]}, - {id: 231, position: [ 1.3338400e+02, -8.5331000e+01]}, - {id: 232, position: [ 1.7475000e+01, -1.1350500e+02]}, - {id: 233, position: [ 4.3688000e+01, -1.1350500e+02]}, - {id: 234, position: [ 6.9901000e+01, -1.1350500e+02]}, - {id: 235, position: [ 9.6113000e+01, -1.1350500e+02]}, - {id: 236, position: [ 1.1572300e+02, -1.0807800e+02]}, - {id: 237, position: [ 8.7380000e+00, -1.3620600e+02]}, - {id: 238, position: [ 3.4950000e+01, -1.3620600e+02]}, - {id: 239, position: [ 6.1163000e+01, -1.2863900e+02]}, - {id: 240, position: [ 8.2273000e+01, -1.3529100e+02]}, - {id: 241, position: [ 1.4399000e+01, -1.5768700e+02]}, - {id: 242, position: [ 4.2720000e+01, -1.5247100e+02]}, - {id: 243, position: [ 6.3150000e+01, -1.4538500e+02]}, - {id: 301, position: [ 3.0582000e+01, 0.0000000e+00]}, - {id: 302, position: [ 5.6794000e+01, 0.0000000e+00]}, - {id: 303, position: [ 8.3007000e+01, 0.0000000e+00]}, - {id: 304, position: [ 1.0922000e+02, 0.0000000e+00]}, - {id: 305, position: [ 1.3543300e+02, 0.0000000e+00]}, - {id: 306, position: [ 1.5622100e+02, -9.7000000e-02]}, - {id: 307, position: [ 1.7475000e+01, 2.2701000e+01]}, - {id: 308, position: [ 4.3688000e+01, 2.2701000e+01]}, - {id: 309, position: [ 6.9901000e+01, 2.2701000e+01]}, - {id: 310, position: [ 9.6114000e+01, 2.2701000e+01]}, - {id: 311, position: [ 1.2232600e+02, 2.2701000e+01]}, - {id: 312, position: [ 1.4853900e+02, 2.2701000e+01]}, - {id: 313, position: [ 0.0000000e+00, 4.5402000e+01]}, - {id: 314, position: [ 3.0582000e+01, 4.5402000e+01]}, - {id: 315, position: [ 5.6794000e+01, 4.5402000e+01]}, - {id: 316, position: [ 8.3007000e+01, 4.5402000e+01]}, - {id: 317, position: [ 1.0922000e+02, 4.5402000e+01]}, - {id: 318, position: [ 1.3543300e+02, 4.5402000e+01]}, - {id: 319, position: [ 1.5356300e+02, 3.9279000e+01]}, - {id: 320, position: [ 1.7475000e+01, 6.8103000e+01]}, - {id: 321, position: [ 4.3688000e+01, 6.8103000e+01]}, - {id: 322, position: [ 6.9901000e+01, 6.8103000e+01]}, - {id: 323, position: [ 9.6113000e+01, 6.8103000e+01]}, - {id: 324, position: [ 1.2232600e+02, 6.8103000e+01]}, - {id: 325, position: [ 1.4663200e+02, 5.9762000e+01]}, - {id: 326, position: [ 0.0000000e+00, 9.0804000e+01]}, - {id: 327, position: [ 3.0582000e+01, 9.0804000e+01]}, - {id: 328, position: [ 5.6794000e+01, 9.0804000e+01]}, - {id: 329, position: [ 8.3007000e+01, 9.0804000e+01]}, - {id: 330, position: [ 1.0922000e+02, 9.0804000e+01]}, - {id: 331, position: [ 1.3338400e+02, 8.5331000e+01]}, - {id: 332, position: [ 1.7475000e+01, 1.1350500e+02]}, - {id: 333, position: [ 4.3688000e+01, 1.1350500e+02]}, - {id: 334, position: [ 6.9901000e+01, 1.1350500e+02]}, - {id: 335, position: [ 9.6113000e+01, 1.1350500e+02]}, - {id: 336, position: [ 1.1572300e+02, 1.0807800e+02]}, - {id: 337, position: [ 8.7380000e+00, 1.3620600e+02]}, - {id: 338, position: [ 3.4950000e+01, 1.3620600e+02]}, - {id: 339, position: [ 6.1163000e+01, 1.2863900e+02]}, - {id: 340, position: [ 8.2273000e+01, 1.3529100e+02]}, - {id: 341, position: [ 1.4399000e+01, 1.5768700e+02]}, - {id: 342, position: [ 4.2720000e+01, 1.5247100e+02]}, - {id: 343, position: [ 6.3150000e+01, 1.4538500e+02]}, - {id: 407, position: [-1.7475000e+01, 2.2701000e+01]}, - {id: 408, position: [-4.3688000e+01, 2.2701000e+01]}, - {id: 409, position: [-6.9901000e+01, 2.2701000e+01]}, - {id: 410, position: [-9.6114000e+01, 2.2701000e+01]}, - {id: 411, position: [-1.2232600e+02, 2.2701000e+01]}, - {id: 412, position: [-1.4853900e+02, 2.2701000e+01]}, - {id: 414, position: [-3.0582000e+01, 4.5402000e+01]}, - {id: 415, position: [-5.6794000e+01, 4.5402000e+01]}, - {id: 416, position: [-8.3007000e+01, 4.5402000e+01]}, - {id: 417, position: [-1.0922000e+02, 4.5402000e+01]}, - {id: 418, position: [-1.3543300e+02, 4.5402000e+01]}, - {id: 419, position: [-1.5356300e+02, 3.9279000e+01]}, - {id: 420, position: [-1.7475000e+01, 6.8103000e+01]}, - {id: 421, position: [-4.3688000e+01, 6.8103000e+01]}, - {id: 422, position: [-6.9901000e+01, 6.8103000e+01]}, - {id: 423, position: [-9.6113000e+01, 6.8103000e+01]}, - {id: 424, position: [-1.2232600e+02, 6.8103000e+01]}, - {id: 425, position: [-1.4663200e+02, 5.9762000e+01]}, - {id: 427, position: [-3.0582000e+01, 9.0804000e+01]}, - {id: 428, position: [-5.6794000e+01, 9.0804000e+01]}, - {id: 429, position: [-8.3007000e+01, 9.0804000e+01]}, - {id: 430, position: [-1.0922000e+02, 9.0804000e+01]}, - {id: 431, position: [-1.3338400e+02, 8.5331000e+01]}, - {id: 432, position: [-1.7475000e+01, 1.1350500e+02]}, - {id: 433, position: [-4.3688000e+01, 1.1350500e+02]}, - {id: 434, position: [-6.9901000e+01, 1.1350500e+02]}, - {id: 435, position: [-9.6113000e+01, 1.1350500e+02]}, - {id: 436, position: [-1.1572300e+02, 1.0807800e+02]}, - {id: 437, position: [-8.7380000e+00, 1.3620600e+02]}, - {id: 438, position: [-3.4950000e+01, 1.3620600e+02]}, - {id: 439, position: [-6.1163000e+01, 1.2863900e+02]}, - {id: 440, position: [-8.2273000e+01, 1.3529100e+02]}, - {id: 441, position: [-1.4399000e+01, 1.5768700e+02]}, - {id: 442, position: [-4.2720000e+01, 1.5247100e+02]}, - {id: 443, position: [-6.3150000e+01, 1.4538500e+02]} - ] + { id: 101, position: [-3.0582e1, 0.0] }, + { id: 102, position: [-5.6794e1, 0.0] }, + { id: 103, position: [-8.3007e1, 0.0] }, + { id: 104, position: [-1.0922e2, 0.0] }, + { id: 105, position: [-1.35433e2, 0.0] }, + { id: 106, position: [-1.56221e2, 0.0] }, + { id: 107, position: [-1.7475e1, -2.2701e1] }, + { id: 108, position: [-4.3688e1, -2.2701e1] }, + { id: 109, position: [-6.9901e1, -2.2701e1] }, + { id: 110, position: [-9.6114e1, -2.2701e1] }, + { id: 111, position: [-1.22326e2, -2.2701e1] }, + { id: 112, position: [-1.48539e2, -2.2701e1] }, + { id: 113, position: [0.0, -4.5402e1] }, + { id: 114, position: [-3.0582e1, -4.5402e1] }, + { id: 115, position: [-5.6794e1, -4.5402e1] }, + { id: 116, position: [-8.3007e1, -4.5402e1] }, + { id: 117, position: [-1.0922e2, -4.5402e1] }, + { id: 118, position: [-1.35433e2, -4.5402e1] }, + { id: 119, position: [-1.53563e2, -3.9279e1] }, + { id: 120, position: [-1.7475e1, -6.8103e1] }, + { id: 121, position: [-4.3688e1, -6.8103e1] }, + { id: 122, position: [-6.9901e1, -6.8103e1] }, + { id: 123, position: [-9.6113e1, -6.8103e1] }, + { id: 124, position: [-1.22326e2, -6.8103e1] }, + { id: 125, position: [-1.46632e2, -5.9762e1] }, + { id: 126, position: [0.0, -9.0804e1] }, + { id: 127, position: [-3.0582e1, -9.0804e1] }, + { id: 128, position: [-5.6794e1, -9.0804e1] }, + { id: 129, position: [-8.3007e1, -9.0804e1] }, + { id: 130, position: [-1.0922e2, -9.0804e1] }, + { id: 131, position: [-1.33384e2, -8.5331e1] }, + { id: 132, position: [-1.7475e1, -1.13505e2] }, + { id: 133, position: [-4.3688e1, -1.13505e2] }, + { id: 134, position: [-6.9901e1, -1.13505e2] }, + { id: 135, position: [-9.6113e1, -1.13505e2] }, + { id: 136, position: [-1.15723e2, -1.08078e2] }, + { id: 137, position: [-8.738, -1.36206e2] }, + { id: 138, position: [-3.495e1, -1.36206e2] }, + { id: 139, position: [-6.1163e1, -1.28639e2] }, + { id: 140, position: [-8.2273e1, -1.35291e2] }, + { id: 141, position: [-1.4399e1, -1.57687e2] }, + { id: 142, position: [-4.272e1, -1.52471e2] }, + { id: 143, position: [-6.315e1, -1.45385e2] }, + { id: 207, position: [1.7475e1, -2.2701e1] }, + { id: 208, position: [4.3688e1, -2.2701e1] }, + { id: 209, position: [6.9901e1, -2.2701e1] }, + { id: 210, position: [9.6114e1, -2.2701e1] }, + { id: 211, position: [1.22326e2, -2.2701e1] }, + { id: 212, position: [1.48539e2, -2.2701e1] }, + { id: 214, position: [3.0582e1, -4.5402e1] }, + { id: 215, position: [5.6794e1, -4.5402e1] }, + { id: 216, position: [8.3007e1, -4.5402e1] }, + { id: 217, position: [1.0922e2, -4.5402e1] }, + { id: 218, position: [1.35433e2, -4.5402e1] }, + { id: 219, position: [1.53563e2, -3.9279e1] }, + { id: 220, position: [1.7475e1, -6.8103e1] }, + { id: 221, position: [4.3688e1, -6.8103e1] }, + { id: 222, position: [6.9901e1, -6.8103e1] }, + { id: 223, position: [9.6113e1, -6.8103e1] }, + { id: 224, position: [1.22326e2, -6.8103e1] }, + { id: 225, position: [1.46632e2, -5.9762e1] }, + { id: 227, position: [3.0582e1, -9.0804e1] }, + { id: 228, position: [5.6794e1, -9.0804e1] }, + { id: 229, position: [8.3007e1, -9.0804e1] }, + { id: 230, position: [1.0922e2, -9.0804e1] }, + { id: 231, position: [1.33384e2, -8.5331e1] }, + { id: 232, position: [1.7475e1, -1.13505e2] }, + { id: 233, position: [4.3688e1, -1.13505e2] }, + { id: 234, position: [6.9901e1, -1.13505e2] }, + { id: 235, position: [9.6113e1, -1.13505e2] }, + { id: 236, position: [1.15723e2, -1.08078e2] }, + { id: 237, position: [8.738, -1.36206e2] }, + { id: 238, position: [3.495e1, -1.36206e2] }, + { id: 239, position: [6.1163e1, -1.28639e2] }, + { id: 240, position: [8.2273e1, -1.35291e2] }, + { id: 241, position: [1.4399e1, -1.57687e2] }, + { id: 242, position: [4.272e1, -1.52471e2] }, + { id: 243, position: [6.315e1, -1.45385e2] }, + { id: 301, position: [3.0582e1, 0.0] }, + { id: 302, position: [5.6794e1, 0.0] }, + { id: 303, position: [8.3007e1, 0.0] }, + { id: 304, position: [1.0922e2, 0.0] }, + { id: 305, position: [1.35433e2, 0.0] }, + { id: 306, position: [1.56221e2, -9.7e-2] }, + { id: 307, position: [1.7475e1, 2.2701e1] }, + { id: 308, position: [4.3688e1, 2.2701e1] }, + { id: 309, position: [6.9901e1, 2.2701e1] }, + { id: 310, position: [9.6114e1, 2.2701e1] }, + { id: 311, position: [1.22326e2, 2.2701e1] }, + { id: 312, position: [1.48539e2, 2.2701e1] }, + { id: 313, position: [0.0, 4.5402e1] }, + { id: 314, position: [3.0582e1, 4.5402e1] }, + { id: 315, position: [5.6794e1, 4.5402e1] }, + { id: 316, position: [8.3007e1, 4.5402e1] }, + { id: 317, position: [1.0922e2, 4.5402e1] }, + { id: 318, position: [1.35433e2, 4.5402e1] }, + { id: 319, position: [1.53563e2, 3.9279e1] }, + { id: 320, position: [1.7475e1, 6.8103e1] }, + { id: 321, position: [4.3688e1, 6.8103e1] }, + { id: 322, position: [6.9901e1, 6.8103e1] }, + { id: 323, position: [9.6113e1, 6.8103e1] }, + { id: 324, position: [1.22326e2, 6.8103e1] }, + { id: 325, position: [1.46632e2, 5.9762e1] }, + { id: 326, position: [0.0, 9.0804e1] }, + { id: 327, position: [3.0582e1, 9.0804e1] }, + { id: 328, position: [5.6794e1, 9.0804e1] }, + { id: 329, position: [8.3007e1, 9.0804e1] }, + { id: 330, position: [1.0922e2, 9.0804e1] }, + { id: 331, position: [1.33384e2, 8.5331e1] }, + { id: 332, position: [1.7475e1, 1.13505e2] }, + { id: 333, position: [4.3688e1, 1.13505e2] }, + { id: 334, position: [6.9901e1, 1.13505e2] }, + { id: 335, position: [9.6113e1, 1.13505e2] }, + { id: 336, position: [1.15723e2, 1.08078e2] }, + { id: 337, position: [8.738, 1.36206e2] }, + { id: 338, position: [3.495e1, 1.36206e2] }, + { id: 339, position: [6.1163e1, 1.28639e2] }, + { id: 340, position: [8.2273e1, 1.35291e2] }, + { id: 341, position: [1.4399e1, 1.57687e2] }, + { id: 342, position: [4.272e1, 1.52471e2] }, + { id: 343, position: [6.315e1, 1.45385e2] }, + { id: 407, position: [-1.7475e1, 2.2701e1] }, + { id: 408, position: [-4.3688e1, 2.2701e1] }, + { id: 409, position: [-6.9901e1, 2.2701e1] }, + { id: 410, position: [-9.6114e1, 2.2701e1] }, + { id: 411, position: [-1.22326e2, 2.2701e1] }, + { id: 412, position: [-1.48539e2, 2.2701e1] }, + { id: 414, position: [-3.0582e1, 4.5402e1] }, + { id: 415, position: [-5.6794e1, 4.5402e1] }, + { id: 416, position: [-8.3007e1, 4.5402e1] }, + { id: 417, position: [-1.0922e2, 4.5402e1] }, + { id: 418, position: [-1.35433e2, 4.5402e1] }, + { id: 419, position: [-1.53563e2, 3.9279e1] }, + { id: 420, position: [-1.7475e1, 6.8103e1] }, + { id: 421, position: [-4.3688e1, 6.8103e1] }, + { id: 422, position: [-6.9901e1, 6.8103e1] }, + { id: 423, position: [-9.6113e1, 6.8103e1] }, + { id: 424, position: [-1.22326e2, 6.8103e1] }, + { id: 425, position: [-1.46632e2, 5.9762e1] }, + { id: 427, position: [-3.0582e1, 9.0804e1] }, + { id: 428, position: [-5.6794e1, 9.0804e1] }, + { id: 429, position: [-8.3007e1, 9.0804e1] }, + { id: 430, position: [-1.0922e2, 9.0804e1] }, + { id: 431, position: [-1.33384e2, 8.5331e1] }, + { id: 432, position: [-1.7475e1, 1.13505e2] }, + { id: 433, position: [-4.3688e1, 1.13505e2] }, + { id: 434, position: [-6.9901e1, 1.13505e2] }, + { id: 435, position: [-9.6113e1, 1.13505e2] }, + { id: 436, position: [-1.15723e2, 1.08078e2] }, + { id: 437, position: [-8.738, 1.36206e2] }, + { id: 438, position: [-3.495e1, 1.36206e2] }, + { id: 439, position: [-6.1163e1, 1.28639e2] }, + { id: 440, position: [-8.2273e1, 1.35291e2] }, + { id: 441, position: [-1.4399e1, 1.57687e2] }, + { id: 442, position: [-4.272e1, 1.52471e2] }, + { id: 443, position: [-6.315e1, 1.45385e2] }, +]; From cd2ee2e100ea96b96c90a012f9abbbd68a9347f2 Mon Sep 17 00:00:00 2001 From: sebastian-aranda Date: Mon, 19 Apr 2021 13:37:00 -0400 Subject: [PATCH 57/75] Add new CSC LOVE-producers to the HEARTBEAT_COMPONENTS list --- love/src/Config.js | 327 +++++++++++++------------- love/src/components/Layout/Layout.jsx | 70 ++++-- 2 files changed, 213 insertions(+), 184 deletions(-) diff --git a/love/src/Config.js b/love/src/Config.js index a388978e9..e305d2da7 100644 --- a/love/src/Config.js +++ b/love/src/Config.js @@ -289,12 +289,15 @@ export const stateToStyleMotorBrake = { export const HEARTBEAT_COMPONENTS = { MANAGER: 'Manager', - EVENTS: 'Events', - TELEMETRIES: 'Telemetries', - HEARTBEATS: 'CSCHeartbeats', - LOVE: 'LOVE CSC', - SCRIPTQUEUE: 'ScriptQueue-1', COMMANDER: 'Commander', + ATDOME: 'ATDome', + ATMCS: 'ATMCS', + WATCHER: 'Watcher', + // GENERICCAMERA: 'GenericCamera', + SCRIPTQUEUE: 'ScriptQueue', + SCRIPT: 'Script', + // LOVE: 'LOVE', + WEATHERSTATION: 'WeatherStation', }; export const severityToStatus = { @@ -314,160 +317,160 @@ export const severityEnum = { }; export const M1M3ActuatorPositions = [ - {id: 101, position: [-3.0582000e+01, 0.0000000e+00]}, - {id: 102, position: [-5.6794000e+01, 0.0000000e+00]}, - {id: 103, position: [-8.3007000e+01, 0.0000000e+00]}, - {id: 104, position: [-1.0922000e+02, 0.0000000e+00]}, - {id: 105, position: [-1.3543300e+02, 0.0000000e+00]}, - {id: 106, position: [-1.5622100e+02, 0.0000000e+00]}, - {id: 107, position: [-1.7475000e+01, -2.2701000e+01]}, - {id: 108, position: [-4.3688000e+01, -2.2701000e+01]}, - {id: 109, position: [-6.9901000e+01, -2.2701000e+01]}, - {id: 110, position: [-9.6114000e+01, -2.2701000e+01]}, - {id: 111, position: [-1.2232600e+02, -2.2701000e+01]}, - {id: 112, position: [-1.4853900e+02, -2.2701000e+01]}, - {id: 113, position: [ 0.0000000e+00, -4.5402000e+01]}, - {id: 114, position: [-3.0582000e+01, -4.5402000e+01]}, - {id: 115, position: [-5.6794000e+01, -4.5402000e+01]}, - {id: 116, position: [-8.3007000e+01, -4.5402000e+01]}, - {id: 117, position: [-1.0922000e+02, -4.5402000e+01]}, - {id: 118, position: [-1.3543300e+02, -4.5402000e+01]}, - {id: 119, position: [-1.5356300e+02, -3.9279000e+01]}, - {id: 120, position: [-1.7475000e+01, -6.8103000e+01]}, - {id: 121, position: [-4.3688000e+01, -6.8103000e+01]}, - {id: 122, position: [-6.9901000e+01, -6.8103000e+01]}, - {id: 123, position: [-9.6113000e+01, -6.8103000e+01]}, - {id: 124, position: [-1.2232600e+02, -6.8103000e+01]}, - {id: 125, position: [-1.4663200e+02, -5.9762000e+01]}, - {id: 126, position: [ 0.0000000e+00, -9.0804000e+01]}, - {id: 127, position: [-3.0582000e+01, -9.0804000e+01]}, - {id: 128, position: [-5.6794000e+01, -9.0804000e+01]}, - {id: 129, position: [-8.3007000e+01, -9.0804000e+01]}, - {id: 130, position: [-1.0922000e+02, -9.0804000e+01]}, - {id: 131, position: [-1.3338400e+02, -8.5331000e+01]}, - {id: 132, position: [-1.7475000e+01, -1.1350500e+02]}, - {id: 133, position: [-4.3688000e+01, -1.1350500e+02]}, - {id: 134, position: [-6.9901000e+01, -1.1350500e+02]}, - {id: 135, position: [-9.6113000e+01, -1.1350500e+02]}, - {id: 136, position: [-1.1572300e+02, -1.0807800e+02]}, - {id: 137, position: [-8.7380000e+00, -1.3620600e+02]}, - {id: 138, position: [-3.4950000e+01, -1.3620600e+02]}, - {id: 139, position: [-6.1163000e+01, -1.2863900e+02]}, - {id: 140, position: [-8.2273000e+01, -1.3529100e+02]}, - {id: 141, position: [-1.4399000e+01, -1.5768700e+02]}, - {id: 142, position: [-4.2720000e+01, -1.5247100e+02]}, - {id: 143, position: [-6.3150000e+01, -1.4538500e+02]}, - {id: 207, position: [ 1.7475000e+01, -2.2701000e+01]}, - {id: 208, position: [ 4.3688000e+01, -2.2701000e+01]}, - {id: 209, position: [ 6.9901000e+01, -2.2701000e+01]}, - {id: 210, position: [ 9.6114000e+01, -2.2701000e+01]}, - {id: 211, position: [ 1.2232600e+02, -2.2701000e+01]}, - {id: 212, position: [ 1.4853900e+02, -2.2701000e+01]}, - {id: 214, position: [ 3.0582000e+01, -4.5402000e+01]}, - {id: 215, position: [ 5.6794000e+01, -4.5402000e+01]}, - {id: 216, position: [ 8.3007000e+01, -4.5402000e+01]}, - {id: 217, position: [ 1.0922000e+02, -4.5402000e+01]}, - {id: 218, position: [ 1.3543300e+02, -4.5402000e+01]}, - {id: 219, position: [ 1.5356300e+02, -3.9279000e+01]}, - {id: 220, position: [ 1.7475000e+01, -6.8103000e+01]}, - {id: 221, position: [ 4.3688000e+01, -6.8103000e+01]}, - {id: 222, position: [ 6.9901000e+01, -6.8103000e+01]}, - {id: 223, position: [ 9.6113000e+01, -6.8103000e+01]}, - {id: 224, position: [ 1.2232600e+02, -6.8103000e+01]}, - {id: 225, position: [ 1.4663200e+02, -5.9762000e+01]}, - {id: 227, position: [ 3.0582000e+01, -9.0804000e+01]}, - {id: 228, position: [ 5.6794000e+01, -9.0804000e+01]}, - {id: 229, position: [ 8.3007000e+01, -9.0804000e+01]}, - {id: 230, position: [ 1.0922000e+02, -9.0804000e+01]}, - {id: 231, position: [ 1.3338400e+02, -8.5331000e+01]}, - {id: 232, position: [ 1.7475000e+01, -1.1350500e+02]}, - {id: 233, position: [ 4.3688000e+01, -1.1350500e+02]}, - {id: 234, position: [ 6.9901000e+01, -1.1350500e+02]}, - {id: 235, position: [ 9.6113000e+01, -1.1350500e+02]}, - {id: 236, position: [ 1.1572300e+02, -1.0807800e+02]}, - {id: 237, position: [ 8.7380000e+00, -1.3620600e+02]}, - {id: 238, position: [ 3.4950000e+01, -1.3620600e+02]}, - {id: 239, position: [ 6.1163000e+01, -1.2863900e+02]}, - {id: 240, position: [ 8.2273000e+01, -1.3529100e+02]}, - {id: 241, position: [ 1.4399000e+01, -1.5768700e+02]}, - {id: 242, position: [ 4.2720000e+01, -1.5247100e+02]}, - {id: 243, position: [ 6.3150000e+01, -1.4538500e+02]}, - {id: 301, position: [ 3.0582000e+01, 0.0000000e+00]}, - {id: 302, position: [ 5.6794000e+01, 0.0000000e+00]}, - {id: 303, position: [ 8.3007000e+01, 0.0000000e+00]}, - {id: 304, position: [ 1.0922000e+02, 0.0000000e+00]}, - {id: 305, position: [ 1.3543300e+02, 0.0000000e+00]}, - {id: 306, position: [ 1.5622100e+02, -9.7000000e-02]}, - {id: 307, position: [ 1.7475000e+01, 2.2701000e+01]}, - {id: 308, position: [ 4.3688000e+01, 2.2701000e+01]}, - {id: 309, position: [ 6.9901000e+01, 2.2701000e+01]}, - {id: 310, position: [ 9.6114000e+01, 2.2701000e+01]}, - {id: 311, position: [ 1.2232600e+02, 2.2701000e+01]}, - {id: 312, position: [ 1.4853900e+02, 2.2701000e+01]}, - {id: 313, position: [ 0.0000000e+00, 4.5402000e+01]}, - {id: 314, position: [ 3.0582000e+01, 4.5402000e+01]}, - {id: 315, position: [ 5.6794000e+01, 4.5402000e+01]}, - {id: 316, position: [ 8.3007000e+01, 4.5402000e+01]}, - {id: 317, position: [ 1.0922000e+02, 4.5402000e+01]}, - {id: 318, position: [ 1.3543300e+02, 4.5402000e+01]}, - {id: 319, position: [ 1.5356300e+02, 3.9279000e+01]}, - {id: 320, position: [ 1.7475000e+01, 6.8103000e+01]}, - {id: 321, position: [ 4.3688000e+01, 6.8103000e+01]}, - {id: 322, position: [ 6.9901000e+01, 6.8103000e+01]}, - {id: 323, position: [ 9.6113000e+01, 6.8103000e+01]}, - {id: 324, position: [ 1.2232600e+02, 6.8103000e+01]}, - {id: 325, position: [ 1.4663200e+02, 5.9762000e+01]}, - {id: 326, position: [ 0.0000000e+00, 9.0804000e+01]}, - {id: 327, position: [ 3.0582000e+01, 9.0804000e+01]}, - {id: 328, position: [ 5.6794000e+01, 9.0804000e+01]}, - {id: 329, position: [ 8.3007000e+01, 9.0804000e+01]}, - {id: 330, position: [ 1.0922000e+02, 9.0804000e+01]}, - {id: 331, position: [ 1.3338400e+02, 8.5331000e+01]}, - {id: 332, position: [ 1.7475000e+01, 1.1350500e+02]}, - {id: 333, position: [ 4.3688000e+01, 1.1350500e+02]}, - {id: 334, position: [ 6.9901000e+01, 1.1350500e+02]}, - {id: 335, position: [ 9.6113000e+01, 1.1350500e+02]}, - {id: 336, position: [ 1.1572300e+02, 1.0807800e+02]}, - {id: 337, position: [ 8.7380000e+00, 1.3620600e+02]}, - {id: 338, position: [ 3.4950000e+01, 1.3620600e+02]}, - {id: 339, position: [ 6.1163000e+01, 1.2863900e+02]}, - {id: 340, position: [ 8.2273000e+01, 1.3529100e+02]}, - {id: 341, position: [ 1.4399000e+01, 1.5768700e+02]}, - {id: 342, position: [ 4.2720000e+01, 1.5247100e+02]}, - {id: 343, position: [ 6.3150000e+01, 1.4538500e+02]}, - {id: 407, position: [-1.7475000e+01, 2.2701000e+01]}, - {id: 408, position: [-4.3688000e+01, 2.2701000e+01]}, - {id: 409, position: [-6.9901000e+01, 2.2701000e+01]}, - {id: 410, position: [-9.6114000e+01, 2.2701000e+01]}, - {id: 411, position: [-1.2232600e+02, 2.2701000e+01]}, - {id: 412, position: [-1.4853900e+02, 2.2701000e+01]}, - {id: 414, position: [-3.0582000e+01, 4.5402000e+01]}, - {id: 415, position: [-5.6794000e+01, 4.5402000e+01]}, - {id: 416, position: [-8.3007000e+01, 4.5402000e+01]}, - {id: 417, position: [-1.0922000e+02, 4.5402000e+01]}, - {id: 418, position: [-1.3543300e+02, 4.5402000e+01]}, - {id: 419, position: [-1.5356300e+02, 3.9279000e+01]}, - {id: 420, position: [-1.7475000e+01, 6.8103000e+01]}, - {id: 421, position: [-4.3688000e+01, 6.8103000e+01]}, - {id: 422, position: [-6.9901000e+01, 6.8103000e+01]}, - {id: 423, position: [-9.6113000e+01, 6.8103000e+01]}, - {id: 424, position: [-1.2232600e+02, 6.8103000e+01]}, - {id: 425, position: [-1.4663200e+02, 5.9762000e+01]}, - {id: 427, position: [-3.0582000e+01, 9.0804000e+01]}, - {id: 428, position: [-5.6794000e+01, 9.0804000e+01]}, - {id: 429, position: [-8.3007000e+01, 9.0804000e+01]}, - {id: 430, position: [-1.0922000e+02, 9.0804000e+01]}, - {id: 431, position: [-1.3338400e+02, 8.5331000e+01]}, - {id: 432, position: [-1.7475000e+01, 1.1350500e+02]}, - {id: 433, position: [-4.3688000e+01, 1.1350500e+02]}, - {id: 434, position: [-6.9901000e+01, 1.1350500e+02]}, - {id: 435, position: [-9.6113000e+01, 1.1350500e+02]}, - {id: 436, position: [-1.1572300e+02, 1.0807800e+02]}, - {id: 437, position: [-8.7380000e+00, 1.3620600e+02]}, - {id: 438, position: [-3.4950000e+01, 1.3620600e+02]}, - {id: 439, position: [-6.1163000e+01, 1.2863900e+02]}, - {id: 440, position: [-8.2273000e+01, 1.3529100e+02]}, - {id: 441, position: [-1.4399000e+01, 1.5768700e+02]}, - {id: 442, position: [-4.2720000e+01, 1.5247100e+02]}, - {id: 443, position: [-6.3150000e+01, 1.4538500e+02]} - ] \ No newline at end of file + { id: 101, position: [-3.0582e1, 0.0] }, + { id: 102, position: [-5.6794e1, 0.0] }, + { id: 103, position: [-8.3007e1, 0.0] }, + { id: 104, position: [-1.0922e2, 0.0] }, + { id: 105, position: [-1.35433e2, 0.0] }, + { id: 106, position: [-1.56221e2, 0.0] }, + { id: 107, position: [-1.7475e1, -2.2701e1] }, + { id: 108, position: [-4.3688e1, -2.2701e1] }, + { id: 109, position: [-6.9901e1, -2.2701e1] }, + { id: 110, position: [-9.6114e1, -2.2701e1] }, + { id: 111, position: [-1.22326e2, -2.2701e1] }, + { id: 112, position: [-1.48539e2, -2.2701e1] }, + { id: 113, position: [0.0, -4.5402e1] }, + { id: 114, position: [-3.0582e1, -4.5402e1] }, + { id: 115, position: [-5.6794e1, -4.5402e1] }, + { id: 116, position: [-8.3007e1, -4.5402e1] }, + { id: 117, position: [-1.0922e2, -4.5402e1] }, + { id: 118, position: [-1.35433e2, -4.5402e1] }, + { id: 119, position: [-1.53563e2, -3.9279e1] }, + { id: 120, position: [-1.7475e1, -6.8103e1] }, + { id: 121, position: [-4.3688e1, -6.8103e1] }, + { id: 122, position: [-6.9901e1, -6.8103e1] }, + { id: 123, position: [-9.6113e1, -6.8103e1] }, + { id: 124, position: [-1.22326e2, -6.8103e1] }, + { id: 125, position: [-1.46632e2, -5.9762e1] }, + { id: 126, position: [0.0, -9.0804e1] }, + { id: 127, position: [-3.0582e1, -9.0804e1] }, + { id: 128, position: [-5.6794e1, -9.0804e1] }, + { id: 129, position: [-8.3007e1, -9.0804e1] }, + { id: 130, position: [-1.0922e2, -9.0804e1] }, + { id: 131, position: [-1.33384e2, -8.5331e1] }, + { id: 132, position: [-1.7475e1, -1.13505e2] }, + { id: 133, position: [-4.3688e1, -1.13505e2] }, + { id: 134, position: [-6.9901e1, -1.13505e2] }, + { id: 135, position: [-9.6113e1, -1.13505e2] }, + { id: 136, position: [-1.15723e2, -1.08078e2] }, + { id: 137, position: [-8.738, -1.36206e2] }, + { id: 138, position: [-3.495e1, -1.36206e2] }, + { id: 139, position: [-6.1163e1, -1.28639e2] }, + { id: 140, position: [-8.2273e1, -1.35291e2] }, + { id: 141, position: [-1.4399e1, -1.57687e2] }, + { id: 142, position: [-4.272e1, -1.52471e2] }, + { id: 143, position: [-6.315e1, -1.45385e2] }, + { id: 207, position: [1.7475e1, -2.2701e1] }, + { id: 208, position: [4.3688e1, -2.2701e1] }, + { id: 209, position: [6.9901e1, -2.2701e1] }, + { id: 210, position: [9.6114e1, -2.2701e1] }, + { id: 211, position: [1.22326e2, -2.2701e1] }, + { id: 212, position: [1.48539e2, -2.2701e1] }, + { id: 214, position: [3.0582e1, -4.5402e1] }, + { id: 215, position: [5.6794e1, -4.5402e1] }, + { id: 216, position: [8.3007e1, -4.5402e1] }, + { id: 217, position: [1.0922e2, -4.5402e1] }, + { id: 218, position: [1.35433e2, -4.5402e1] }, + { id: 219, position: [1.53563e2, -3.9279e1] }, + { id: 220, position: [1.7475e1, -6.8103e1] }, + { id: 221, position: [4.3688e1, -6.8103e1] }, + { id: 222, position: [6.9901e1, -6.8103e1] }, + { id: 223, position: [9.6113e1, -6.8103e1] }, + { id: 224, position: [1.22326e2, -6.8103e1] }, + { id: 225, position: [1.46632e2, -5.9762e1] }, + { id: 227, position: [3.0582e1, -9.0804e1] }, + { id: 228, position: [5.6794e1, -9.0804e1] }, + { id: 229, position: [8.3007e1, -9.0804e1] }, + { id: 230, position: [1.0922e2, -9.0804e1] }, + { id: 231, position: [1.33384e2, -8.5331e1] }, + { id: 232, position: [1.7475e1, -1.13505e2] }, + { id: 233, position: [4.3688e1, -1.13505e2] }, + { id: 234, position: [6.9901e1, -1.13505e2] }, + { id: 235, position: [9.6113e1, -1.13505e2] }, + { id: 236, position: [1.15723e2, -1.08078e2] }, + { id: 237, position: [8.738, -1.36206e2] }, + { id: 238, position: [3.495e1, -1.36206e2] }, + { id: 239, position: [6.1163e1, -1.28639e2] }, + { id: 240, position: [8.2273e1, -1.35291e2] }, + { id: 241, position: [1.4399e1, -1.57687e2] }, + { id: 242, position: [4.272e1, -1.52471e2] }, + { id: 243, position: [6.315e1, -1.45385e2] }, + { id: 301, position: [3.0582e1, 0.0] }, + { id: 302, position: [5.6794e1, 0.0] }, + { id: 303, position: [8.3007e1, 0.0] }, + { id: 304, position: [1.0922e2, 0.0] }, + { id: 305, position: [1.35433e2, 0.0] }, + { id: 306, position: [1.56221e2, -9.7e-2] }, + { id: 307, position: [1.7475e1, 2.2701e1] }, + { id: 308, position: [4.3688e1, 2.2701e1] }, + { id: 309, position: [6.9901e1, 2.2701e1] }, + { id: 310, position: [9.6114e1, 2.2701e1] }, + { id: 311, position: [1.22326e2, 2.2701e1] }, + { id: 312, position: [1.48539e2, 2.2701e1] }, + { id: 313, position: [0.0, 4.5402e1] }, + { id: 314, position: [3.0582e1, 4.5402e1] }, + { id: 315, position: [5.6794e1, 4.5402e1] }, + { id: 316, position: [8.3007e1, 4.5402e1] }, + { id: 317, position: [1.0922e2, 4.5402e1] }, + { id: 318, position: [1.35433e2, 4.5402e1] }, + { id: 319, position: [1.53563e2, 3.9279e1] }, + { id: 320, position: [1.7475e1, 6.8103e1] }, + { id: 321, position: [4.3688e1, 6.8103e1] }, + { id: 322, position: [6.9901e1, 6.8103e1] }, + { id: 323, position: [9.6113e1, 6.8103e1] }, + { id: 324, position: [1.22326e2, 6.8103e1] }, + { id: 325, position: [1.46632e2, 5.9762e1] }, + { id: 326, position: [0.0, 9.0804e1] }, + { id: 327, position: [3.0582e1, 9.0804e1] }, + { id: 328, position: [5.6794e1, 9.0804e1] }, + { id: 329, position: [8.3007e1, 9.0804e1] }, + { id: 330, position: [1.0922e2, 9.0804e1] }, + { id: 331, position: [1.33384e2, 8.5331e1] }, + { id: 332, position: [1.7475e1, 1.13505e2] }, + { id: 333, position: [4.3688e1, 1.13505e2] }, + { id: 334, position: [6.9901e1, 1.13505e2] }, + { id: 335, position: [9.6113e1, 1.13505e2] }, + { id: 336, position: [1.15723e2, 1.08078e2] }, + { id: 337, position: [8.738, 1.36206e2] }, + { id: 338, position: [3.495e1, 1.36206e2] }, + { id: 339, position: [6.1163e1, 1.28639e2] }, + { id: 340, position: [8.2273e1, 1.35291e2] }, + { id: 341, position: [1.4399e1, 1.57687e2] }, + { id: 342, position: [4.272e1, 1.52471e2] }, + { id: 343, position: [6.315e1, 1.45385e2] }, + { id: 407, position: [-1.7475e1, 2.2701e1] }, + { id: 408, position: [-4.3688e1, 2.2701e1] }, + { id: 409, position: [-6.9901e1, 2.2701e1] }, + { id: 410, position: [-9.6114e1, 2.2701e1] }, + { id: 411, position: [-1.22326e2, 2.2701e1] }, + { id: 412, position: [-1.48539e2, 2.2701e1] }, + { id: 414, position: [-3.0582e1, 4.5402e1] }, + { id: 415, position: [-5.6794e1, 4.5402e1] }, + { id: 416, position: [-8.3007e1, 4.5402e1] }, + { id: 417, position: [-1.0922e2, 4.5402e1] }, + { id: 418, position: [-1.35433e2, 4.5402e1] }, + { id: 419, position: [-1.53563e2, 3.9279e1] }, + { id: 420, position: [-1.7475e1, 6.8103e1] }, + { id: 421, position: [-4.3688e1, 6.8103e1] }, + { id: 422, position: [-6.9901e1, 6.8103e1] }, + { id: 423, position: [-9.6113e1, 6.8103e1] }, + { id: 424, position: [-1.22326e2, 6.8103e1] }, + { id: 425, position: [-1.46632e2, 5.9762e1] }, + { id: 427, position: [-3.0582e1, 9.0804e1] }, + { id: 428, position: [-5.6794e1, 9.0804e1] }, + { id: 429, position: [-8.3007e1, 9.0804e1] }, + { id: 430, position: [-1.0922e2, 9.0804e1] }, + { id: 431, position: [-1.33384e2, 8.5331e1] }, + { id: 432, position: [-1.7475e1, 1.13505e2] }, + { id: 433, position: [-4.3688e1, 1.13505e2] }, + { id: 434, position: [-6.9901e1, 1.13505e2] }, + { id: 435, position: [-9.6113e1, 1.13505e2] }, + { id: 436, position: [-1.15723e2, 1.08078e2] }, + { id: 437, position: [-8.738, 1.36206e2] }, + { id: 438, position: [-3.495e1, 1.36206e2] }, + { id: 439, position: [-6.1163e1, 1.28639e2] }, + { id: 440, position: [-8.2273e1, 1.35291e2] }, + { id: 441, position: [-1.4399e1, 1.57687e2] }, + { id: 442, position: [-4.272e1, 1.52471e2] }, + { id: 443, position: [-6.315e1, 1.45385e2] }, +]; diff --git a/love/src/components/Layout/Layout.jsx b/love/src/components/Layout/Layout.jsx index 08cda3a84..1f8935d36 100644 --- a/love/src/components/Layout/Layout.jsx +++ b/love/src/components/Layout/Layout.jsx @@ -118,7 +118,7 @@ class Layout extends Component { this.props.subscribeToStreams(); this.heartbeatInterval = setInterval(() => { this.checkHeartbeat(); - }, 3000); + }, 15000); }; componentWillUnmount = () => { @@ -326,6 +326,7 @@ class Layout extends Component { if (!summaryHeartbeats.every((hb) => hb === undefined)) { summaryHeartbeatStatus = summaryHeartbeats.includes('alert') ? 'alert' : 'ok'; } + console.log(this.state.heartbeatStatus); return (
From bc108c555912a618943deced09fc01e49a3d0246 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 20 Apr 2021 01:17:13 +0000 Subject: [PATCH 58/75] Bump ssri from 6.0.1 to 6.0.2 in /love Bumps [ssri](https://github.com/npm/ssri) from 6.0.1 to 6.0.2. - [Release notes](https://github.com/npm/ssri/releases) - [Changelog](https://github.com/npm/ssri/blob/v6.0.2/CHANGELOG.md) - [Commits](https://github.com/npm/ssri/compare/v6.0.1...v6.0.2) Signed-off-by: dependabot[bot] --- love/yarn.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/love/yarn.lock b/love/yarn.lock index 217e3274b..5fc174b6e 100644 --- a/love/yarn.lock +++ b/love/yarn.lock @@ -12562,9 +12562,9 @@ sshpk@^1.7.0: tweetnacl "~0.14.0" ssri@^6.0.1: - version "6.0.1" - resolved "https://registry.yarnpkg.com/ssri/-/ssri-6.0.1.tgz#2a3c41b28dd45b62b63676ecb74001265ae9edd8" - integrity sha512-3Wge10hNcT1Kur4PDFwEieXSCMCJs/7WvSACcrMYrNp+b8kDL1/0wJch5Ni2WrtwEa2IO8OsVfeKIciKCDx/QA== + version "6.0.2" + resolved "https://registry.yarnpkg.com/ssri/-/ssri-6.0.2.tgz#157939134f20464e7301ddba3e90ffa8f7728ac5" + integrity sha512-cepbSq/neFK7xB6A50KHN0xHDotYzq58wWCa5LeWqnPrHG8GzfEjO/4O8kpmcGW+oaxkvhEJCWgbgNk4/ZV93Q== dependencies: figgy-pudding "^3.5.1" From 49dec4e2003c5ac68ec4ba2e28213c2e58bd1f5f Mon Sep 17 00:00:00 2001 From: sebastian-aranda Date: Tue, 20 Apr 2021 19:01:31 -0400 Subject: [PATCH 59/75] Remove unused code --- love/src/Config.js | 1 - love/src/components/Layout/Layout.jsx | 13 +++---------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/love/src/Config.js b/love/src/Config.js index e305d2da7..6e5688d3b 100644 --- a/love/src/Config.js +++ b/love/src/Config.js @@ -295,7 +295,6 @@ export const HEARTBEAT_COMPONENTS = { WATCHER: 'Watcher', // GENERICCAMERA: 'GenericCamera', SCRIPTQUEUE: 'ScriptQueue', - SCRIPT: 'Script', // LOVE: 'LOVE', WEATHERSTATION: 'WeatherStation', }; diff --git a/love/src/components/Layout/Layout.jsx b/love/src/components/Layout/Layout.jsx index 1f8935d36..114238728 100644 --- a/love/src/components/Layout/Layout.jsx +++ b/love/src/components/Layout/Layout.jsx @@ -116,9 +116,10 @@ class Layout extends Component { componentDidMount = () => { this.moveCustomTopbar(); this.props.subscribeToStreams(); + this.checkHeartbeat(); this.heartbeatInterval = setInterval(() => { this.checkHeartbeat(); - }, 15000); + }, 10000); }; componentWillUnmount = () => { @@ -326,7 +327,7 @@ class Layout extends Component { if (!summaryHeartbeats.every((hb) => hb === undefined)) { summaryHeartbeatStatus = summaryHeartbeats.includes('alert') ? 'alert' : 'ok'; } - console.log(this.state.heartbeatStatus); + return (
); })} - {/*
- console.log(a)} - displaySummaryState={false} - /> -
*/}
); From cbfc556ba986872e05aa1955edc338c31ffbb0bc Mon Sep 17 00:00:00 2001 From: sebastian-aranda Date: Fri, 23 Apr 2021 15:36:58 -0400 Subject: [PATCH 61/75] Add backwards compatibility --- love/src/Config.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/love/src/Config.js b/love/src/Config.js index 49a7de917..75cb17049 100644 --- a/love/src/Config.js +++ b/love/src/Config.js @@ -309,6 +309,9 @@ export const HEARTBEAT_COMPONENTS = { SCRIPTQUEUE: 'ScriptQueue', // LOVE: 'LOVE', WEATHERSTATION: 'WeatherStation', + // FOR OLD PRODUCER VERSION + EVENTS: 'Events', + TELEMETRIES: 'Telemetries', }; export const severityToStatus = { From 870f0eb0a7b860e6aec3f575349e25c413432467 Mon Sep 17 00:00:00 2001 From: sebastian-aranda Date: Mon, 26 Apr 2021 16:39:00 -0400 Subject: [PATCH 62/75] Remove console.log --- love/src/redux/actions/ws.js | 5 ----- 1 file changed, 5 deletions(-) diff --git a/love/src/redux/actions/ws.js b/love/src/redux/actions/ws.js index e0c7dc15f..011b079d4 100644 --- a/love/src/redux/actions/ws.js +++ b/love/src/redux/actions/ws.js @@ -126,7 +126,6 @@ let resetSubsTimer = null; */ export const resetSubscriptions = (subscriptions = null) => { return (dispatch, getState) => { - console.log('RESETING SUBSCRIPTIONS...'); const subs = subscriptions || getSubscriptions(getState()); clearInterval(resetSubsTimer); resetSubsTimer = setInterval(() => dispatch(resetSubscriptions()), RESET_SUBS_PERIOD); @@ -156,7 +155,6 @@ export const openWebsocketConnection = () => { const connectionStatus = getConnectionStatus(getState()); if (connectionStatus !== connectionStates.CLOSED) { dispatch(_changeConnectionState(connectionStates.CLOSED, socket)); - console.log('Reseting from nonConnectableTokenStates...'); dispatch(resetSubscriptions(getSubscriptions(getState()))); } return; @@ -183,12 +181,10 @@ export const openWebsocketConnection = () => { } else { dispatch(_changeConnectionState(connectionStates.RETRYING, socket)); } - console.log('Reseting from onClose socket...'); dispatch(resetSubscriptions(getSubscriptions(getState()))); }, onerror: () => { dispatch(_changeConnectionState(connectionStates.RETRYING, socket)); - console.log('Reseting from onError socket...'); dispatch(resetSubscriptions(getSubscriptions(getState()))); }, onmessage: (msg) => { @@ -289,7 +285,6 @@ export const openWebsocketConnection = () => { */ export const closeWebsocketConnection = () => { return (dispatch, getState) => { - console.log('Reseting from closeWebsocketConnection...'); dispatch(resetSubscriptions(getSubscriptions(getState()))); if (socket && getConnectionStatus(getState()) !== connectionStates.CLOSED) { socket.close(); From 99d0ba8f41d8bbd7942717196cb8f9fb1f0ea577 Mon Sep 17 00:00:00 2001 From: sebastian-aranda Date: Mon, 26 Apr 2021 16:40:16 -0400 Subject: [PATCH 63/75] Remove console.log --- love/src/components/Layout/Layout.jsx | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/love/src/components/Layout/Layout.jsx b/love/src/components/Layout/Layout.jsx index 6e07ed68f..9d6aa2e30 100644 --- a/love/src/components/Layout/Layout.jsx +++ b/love/src/components/Layout/Layout.jsx @@ -328,7 +328,7 @@ class Layout extends Component { if (!summaryHeartbeats.every((hb) => hb === undefined)) { summaryHeartbeatStatus = summaryHeartbeats.includes('alert') ? 'alert' : 'ok'; } - + return (
-
+
LOVE manager
-
+ {/*
LOVE producers: - - {HEARTBEAT_COMPONENTS.LOVE} + + {HEARTBEAT_COMPONENTS['LOVE:0']} - - {HEARTBEAT_COMPONENTS.ATDOME} + + {HEARTBEAT_COMPONENTS['ATDome:0']} - - {HEARTBEAT_COMPONENTS.ATMCS} + + {HEARTBEAT_COMPONENTS['ATMCS:0']} - - {HEARTBEAT_COMPONENTS.WATCHER} + + {HEARTBEAT_COMPONENTS['Watcher:0']} - {HEARTBEAT_COMPONENTS.GENERICCAMERA} + {HEARTBEAT_COMPONENTS['GenericCamera:0']} - {HEARTBEAT_COMPONENTS['SCRIPTQUEUE-1']} + {HEARTBEAT_COMPONENTS['ScriptQueue:1']} - {HEARTBEAT_COMPONENTS['WEATHERSTATION-1']} + {HEARTBEAT_COMPONENTS['WeatherStation:1']} -
-
+
*/} +
LOVE commander
From 76d70e50ce95a186709e28e542cc56f65be45bd1 Mon Sep 17 00:00:00 2001 From: sebastian-aranda Date: Thu, 29 Apr 2021 12:20:28 -0400 Subject: [PATCH 67/75] Remove producer heartbeats summary --- love/src/Config.js | 14 +++++++------- love/src/components/Layout/Layout.jsx | 27 +++++++++++++-------------- 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/love/src/Config.js b/love/src/Config.js index b17cdc049..ba8bedffe 100644 --- a/love/src/Config.js +++ b/love/src/Config.js @@ -302,13 +302,13 @@ export const stateToStyleMotorBrake = { export const HEARTBEAT_COMPONENTS = { Manager: 'Manager', Commander: 'Commander', - 'LOVE:0': 'LOVE:0', - 'ATDome:0': 'ATDome:0', - 'ATMCS:0': 'ATMCS:0', - 'Watcher:0': 'Watcher:0', - 'GenericCamera:0': 'GenericCamera:0', - 'ScriptQueue:1': 'ScriptQueue:1', - 'WeatherStation:1': 'WeatherStation:1', + // 'LOVE:0': 'LOVE:0', + // 'ATDome:0': 'ATDome:0', + // 'ATMCS:0': 'ATMCS:0', + // 'Watcher:0': 'Watcher:0', + // 'GenericCamera:0': 'GenericCamera:0', + // 'ScriptQueue:1': 'ScriptQueue:1', + // 'WeatherStation:1': 'WeatherStation:1', }; export const severityToStatus = { diff --git a/love/src/components/Layout/Layout.jsx b/love/src/components/Layout/Layout.jsx index 9fcadef28..1f761118b 100644 --- a/love/src/components/Layout/Layout.jsx +++ b/love/src/components/Layout/Layout.jsx @@ -306,22 +306,21 @@ class Layout extends Component { }; renderHeartbeatsMenu = () => { - const producerHeartbeats = [ - HEARTBEAT_COMPONENTS['LOVE:0'], - HEARTBEAT_COMPONENTS['ATDome:0'], - HEARTBEAT_COMPONENTS['ATMCS:0'], - HEARTBEAT_COMPONENTS['Watcher:0'], - // HEARTBEAT_COMPONENTS['GenericCamera:0'], - HEARTBEAT_COMPONENTS['ScriptQueue:1'], - HEARTBEAT_COMPONENTS['WeatherStation:1'], - ].map((source) => this.state.heartbeatStatus[source]); - let producerHeartbeatStatus; - if (!producerHeartbeats.every((hb) => hb === undefined)) { - producerHeartbeatStatus = producerHeartbeats.includes('alert') ? 'alert' : 'ok'; - } + // const producerHeartbeats = [ + // HEARTBEAT_COMPONENTS['LOVE:0'], + // HEARTBEAT_COMPONENTS['ATDome:0'], + // HEARTBEAT_COMPONENTS['ATMCS:0'], + // HEARTBEAT_COMPONENTS['Watcher:0'], + // HEARTBEAT_COMPONENTS['GenericCamera:0'], + // HEARTBEAT_COMPONENTS['ScriptQueue:1'], + // HEARTBEAT_COMPONENTS['WeatherStation:1'], + // ].map((source) => this.state.heartbeatStatus[source]); + // let producerHeartbeatStatus; + // if (!producerHeartbeats.every((hb) => hb === undefined)) { + // producerHeartbeatStatus = producerHeartbeats.includes('alert') ? 'alert' : 'ok'; + // } const summaryHeartbeats = [ - // Uncomment when fixing LOVE:0 heartbeats // producerHeartbeatStatus, this.state.heartbeatStatus[HEARTBEAT_COMPONENTS.Manager], this.state.heartbeatStatus[HEARTBEAT_COMPONENTS.Commander], From 4eed23421e9eeb6bc86d8a4643532cd2400194e5 Mon Sep 17 00:00:00 2001 From: sebastian-aranda Date: Thu, 29 Apr 2021 12:22:22 -0400 Subject: [PATCH 68/75] Small refactor --- love/src/Config.js | 4 ++-- love/src/components/Layout/Layout.jsx | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/love/src/Config.js b/love/src/Config.js index ba8bedffe..b14b5fee1 100644 --- a/love/src/Config.js +++ b/love/src/Config.js @@ -300,8 +300,8 @@ export const stateToStyleMotorBrake = { }; export const HEARTBEAT_COMPONENTS = { - Manager: 'Manager', - Commander: 'Commander', + MANAGER: 'Manager', + COMMANDER: 'Commander', // 'LOVE:0': 'LOVE:0', // 'ATDome:0': 'ATDome:0', // 'ATMCS:0': 'ATMCS:0', diff --git a/love/src/components/Layout/Layout.jsx b/love/src/components/Layout/Layout.jsx index 1f761118b..20650926d 100644 --- a/love/src/components/Layout/Layout.jsx +++ b/love/src/components/Layout/Layout.jsx @@ -322,8 +322,8 @@ class Layout extends Component { const summaryHeartbeats = [ // producerHeartbeatStatus, - this.state.heartbeatStatus[HEARTBEAT_COMPONENTS.Manager], - this.state.heartbeatStatus[HEARTBEAT_COMPONENTS.Commander], + this.state.heartbeatStatus[HEARTBEAT_COMPONENTS.MANAGER], + this.state.heartbeatStatus[HEARTBEAT_COMPONENTS.COMMANDER], ]; let summaryHeartbeatStatus; if (!summaryHeartbeats.every((hb) => hb === undefined)) { @@ -346,11 +346,11 @@ class Layout extends Component {
-
+
LOVE manager
@@ -427,11 +427,11 @@ class Layout extends Component { {HEARTBEAT_COMPONENTS['WeatherStation:1']}
*/} -
+
LOVE commander
From 1f3af51b8240df2a76cd5d33cfaf560ebea70dd6 Mon Sep 17 00:00:00 2001 From: sebastian-aranda Date: Thu, 29 Apr 2021 17:37:36 -0400 Subject: [PATCH 69/75] Add toast notifications to runATCSCommand --- love/src/Utils.js | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/love/src/Utils.js b/love/src/Utils.js index 5ef162897..4caf8d93b 100644 --- a/love/src/Utils.js +++ b/love/src/Utils.js @@ -3,6 +3,7 @@ import React, { useState } from 'react'; import html2canvas from 'html2canvas'; import { DateTime } from 'luxon'; +import { toast } from 'react-toastify'; import { WEBSOCKET_SIMULATION } from 'Config.js'; import { SALCommandStatus } from 'redux/actions/ws'; @@ -326,7 +327,7 @@ export default class ManagerInterface { }); } - static runATCSCommand(commandName, params) { + static runATCSCommand(commandName, params = {}) { const token = ManagerInterface.getToken(); if (token === null) { // console.log('Token not found during validation'); @@ -338,19 +339,25 @@ export default class ManagerInterface { headers: this.getHeaders(), body: JSON.stringify({ command_name: commandName, - params: params ?? {}, + params, }), }).then((response) => { if (response.status >= 500) { - // console.error('Error communicating with the server.); + toast.error('Error communicating with the server.'); return false; } if (response.status === 401 || response.status === 403) { - // console.log('Session expired. Logging out'); + toast.error('Session expired. Logging out.'); ManagerInterface.removeToken(); return false; } + if (response.status === 400) { + return response.json().then((resp) => { + toast.error(resp.ack); + }); + } return response.json().then((resp) => { + toast.info(resp.ack); return resp; }); }); From e8dc7b28b87a618b05913f0338c0316b11e93f25 Mon Sep 17 00:00:00 2001 From: sebastian-aranda Date: Thu, 29 Apr 2021 17:37:59 -0400 Subject: [PATCH 70/75] Comment EmergencyClose --- love/src/components/CommandPanel/CommandPanel.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/love/src/components/CommandPanel/CommandPanel.jsx b/love/src/components/CommandPanel/CommandPanel.jsx index 00e6000d3..1b0b89d40 100644 --- a/love/src/components/CommandPanel/CommandPanel.jsx +++ b/love/src/components/CommandPanel/CommandPanel.jsx @@ -1,5 +1,5 @@ import React, { Component } from 'react'; -import DomeCloseButton from './DomeCloseButton/DomeCloseButton'; +// import DomeCloseButton from './DomeCloseButton/DomeCloseButton'; import StopAllTSCButton from './StopAllTSCButton/StopAllTSCButton'; import styles from './CommandPanel.module.css'; @@ -7,7 +7,7 @@ export default class CommandPanel extends Component { render() { return (
- + {/* */}
); From 688363cb6cbdf9383f745e109f197d38140f4235 Mon Sep 17 00:00:00 2001 From: sebastian-aranda Date: Thu, 29 Apr 2021 17:38:38 -0400 Subject: [PATCH 71/75] TODO: reference command name rather than from plain string --- .../CommandPanel/StopAllTSCButton/StopAllTSCButton.jsx | 2 ++ 1 file changed, 2 insertions(+) diff --git a/love/src/components/CommandPanel/StopAllTSCButton/StopAllTSCButton.jsx b/love/src/components/CommandPanel/StopAllTSCButton/StopAllTSCButton.jsx index 38cd47f63..db9d2dd33 100644 --- a/love/src/components/CommandPanel/StopAllTSCButton/StopAllTSCButton.jsx +++ b/love/src/components/CommandPanel/StopAllTSCButton/StopAllTSCButton.jsx @@ -1,6 +1,7 @@ import React, { Component } from 'react'; import styles from './StopAllTSCButton.module.css'; import ManagerInterface from 'Utils'; +// import { TCSCommands } from 'Config.js'; export default class StopAllTSCButton extends Component { constructor(props) { @@ -9,6 +10,7 @@ export default class StopAllTSCButton extends Component { } callTSCStopAll() { + // TODO: Reference command from variable ManagerInterface.runATCSCommand('stop_all'); } From c61d9527e7f64e58892868d634640353c990246b Mon Sep 17 00:00:00 2001 From: sebastian-aranda Date: Thu, 29 Apr 2021 17:39:39 -0400 Subject: [PATCH 72/75] Add runATCSCommand command --- love/src/components/TCSCommands/TCSCommands.jsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/love/src/components/TCSCommands/TCSCommands.jsx b/love/src/components/TCSCommands/TCSCommands.jsx index 5bb6d0078..a2f023616 100644 --- a/love/src/components/TCSCommands/TCSCommands.jsx +++ b/love/src/components/TCSCommands/TCSCommands.jsx @@ -177,7 +177,7 @@ export default class CommandPanel extends Component { From b13d0eca8246e94bcdba84b01b61ba5d26e6d798 Mon Sep 17 00:00:00 2001 From: sebastian-aranda Date: Thu, 29 Apr 2021 17:39:54 -0400 Subject: [PATCH 73/75] Missing test fix --- love/src/redux/tests/heartbeats.test.js | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/love/src/redux/tests/heartbeats.test.js b/love/src/redux/tests/heartbeats.test.js index 4ce9de926..72bf0962f 100644 --- a/love/src/redux/tests/heartbeats.test.js +++ b/love/src/redux/tests/heartbeats.test.js @@ -28,11 +28,6 @@ const heartbeatsInfo = [ data: [{ csc: 'manager', salindex: 0, data: { timestamp: 1692141499.626869 } }], subscription: 'heartbeat', }, - { - category: 'heartbeat', - data: [{ csc: HEARTBEAT_COMPONENTS.EVENTS, salindex: 0, data: { timestamp: 1992141499.626869 } }], - subscription: 'heartbeat', - }, ]; const compareSalIndex = (a, b) => { @@ -91,15 +86,15 @@ describe('GIVEN we are subscribed to the manager heartbeat', () => { }); }); - describe('WHEN we receive a producer heartbeat', () => { - it('THEN we store it the state ', async () => { - // Arrange: - await server.send(heartbeatsInfo[2]); - const lastProducerHeartbeat = getLastComponentHeartbeat(store.getState(), HEARTBEAT_COMPONENTS.EVENTS); - // Assert: - expect(lastProducerHeartbeat).toEqual(heartbeatsInfo[2].data[0]); - }); - }); + // describe('WHEN we receive a producer heartbeat', () => { + // it('THEN we store it the state ', async () => { + // // Arrange: + // await server.send(heartbeatsInfo[2]); + // const lastProducerHeartbeat = getLastComponentHeartbeat(store.getState(), HEARTBEAT_COMPONENTS.EVENTS); + // // Assert: + // expect(lastProducerHeartbeat).toEqual(heartbeatsInfo[2].data[0]); + // }); + // }); describe('WHEN we receive 2 manager heartbeats', () => { it('THEN we store the last one ', async () => { From 9b1f606931b45975132f2eec87eb6e5a9919a6b4 Mon Sep 17 00:00:00 2001 From: sebastian-aranda Date: Mon, 3 May 2021 18:22:02 -0400 Subject: [PATCH 74/75] heartbeats summary refactor --- love/src/Config.js | 10 ++-- love/src/components/Layout/Layout.jsx | 67 ++++++++++--------------- love/src/redux/tests/heartbeats.test.js | 25 +++++---- 3 files changed, 44 insertions(+), 58 deletions(-) diff --git a/love/src/Config.js b/love/src/Config.js index 8978c922f..1803f43a2 100644 --- a/love/src/Config.js +++ b/love/src/Config.js @@ -302,13 +302,9 @@ export const stateToStyleMotorBrake = { export const HEARTBEAT_COMPONENTS = { MANAGER: 'Manager', COMMANDER: 'Commander', - // 'LOVE:0': 'LOVE:0', - // 'ATDome:0': 'ATDome:0', - // 'ATMCS:0': 'ATMCS:0', - // 'Watcher:0': 'Watcher:0', - // 'GenericCamera:0': 'GenericCamera:0', - // 'ScriptQueue:1': 'ScriptQueue:1', - // 'WeatherStation:1': 'WeatherStation:1', + /** Deprecated: used for old producer version */ + /* EVENTS: 'Events', + TELEMETRIES: 'Telemetries', */ }; export const severityToStatus = { diff --git a/love/src/components/Layout/Layout.jsx b/love/src/components/Layout/Layout.jsx index 20650926d..b40ce3cca 100644 --- a/love/src/components/Layout/Layout.jsx +++ b/love/src/components/Layout/Layout.jsx @@ -354,77 +354,62 @@ class Layout extends Component { /> LOVE manager
- {/*
+ {/** Deprecated: used for old producer version */ + /*
LOVE producers: - - {HEARTBEAT_COMPONENTS['LOVE:0']} + + {HEARTBEAT_COMPONENTS.EVENTS} - - {HEARTBEAT_COMPONENTS['ATDome:0']} - - - - {HEARTBEAT_COMPONENTS['ATMCS:0']} - - - - {HEARTBEAT_COMPONENTS['Watcher:0']} + + {HEARTBEAT_COMPONENTS.TELEMETRIES} - {HEARTBEAT_COMPONENTS['GenericCamera:0']} + {HEARTBEAT_COMPONENTS.HEARTBEATS} - - {HEARTBEAT_COMPONENTS['ScriptQueue:1']} + + {HEARTBEAT_COMPONENTS.LOVE} - {HEARTBEAT_COMPONENTS['WeatherStation:1']} + {HEARTBEAT_COMPONENTS.SCRIPTQUEUE}
*/}
diff --git a/love/src/redux/tests/heartbeats.test.js b/love/src/redux/tests/heartbeats.test.js index 72bf0962f..7516795f2 100644 --- a/love/src/redux/tests/heartbeats.test.js +++ b/love/src/redux/tests/heartbeats.test.js @@ -28,6 +28,11 @@ const heartbeatsInfo = [ data: [{ csc: 'manager', salindex: 0, data: { timestamp: 1692141499.626869 } }], subscription: 'heartbeat', }, + { + category: 'heartbeat', + data: [{ csc: 'commander', salindex: 0, data: { timestamp: 1692141499.626869 } }], + subscription: 'heartbeat', + }, ]; const compareSalIndex = (a, b) => { @@ -86,16 +91,6 @@ describe('GIVEN we are subscribed to the manager heartbeat', () => { }); }); - // describe('WHEN we receive a producer heartbeat', () => { - // it('THEN we store it the state ', async () => { - // // Arrange: - // await server.send(heartbeatsInfo[2]); - // const lastProducerHeartbeat = getLastComponentHeartbeat(store.getState(), HEARTBEAT_COMPONENTS.EVENTS); - // // Assert: - // expect(lastProducerHeartbeat).toEqual(heartbeatsInfo[2].data[0]); - // }); - // }); - describe('WHEN we receive 2 manager heartbeats', () => { it('THEN we store the last one ', async () => { // Arrange: @@ -107,6 +102,16 @@ describe('GIVEN we are subscribed to the manager heartbeat', () => { }); }); + describe('WHEN we receive a commander heartbeat', () => { + it('THEN we store it the state ', async () => { + // Arrange: + await server.send(heartbeatsInfo[2]); + const lastProducerHeartbeat = getLastComponentHeartbeat(store.getState(), HEARTBEAT_COMPONENTS.COMMANDER); + // Assert: + expect(lastProducerHeartbeat).toEqual(heartbeatsInfo[2].data[0]); + }); + }); + describe('WHEN we lose server connection', () => { it('THEN we dont receive new manager heartbeats ', async () => { // Arrange: From 03903607fcfcd293757b723c5a5e7b3048c9e8dc Mon Sep 17 00:00:00 2001 From: sebastian-aranda Date: Mon, 3 May 2021 18:56:03 -0400 Subject: [PATCH 75/75] Using capital case to read hearbeat CSC --- love/src/redux/selectors/selectors.js | 2 +- love/src/redux/tests/heartbeats.test.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/love/src/redux/selectors/selectors.js b/love/src/redux/selectors/selectors.js index 8d7f2bec0..eca3f8beb 100644 --- a/love/src/redux/selectors/selectors.js +++ b/love/src/redux/selectors/selectors.js @@ -445,7 +445,7 @@ export const getCSCHeartbeat = (state, csc, salindex) => { */ export const getLastManagerHeartbeat = (state) => { if (state.heartbeats === undefined) return undefined; - return state.heartbeats?.lastHeartbeatInfo?.manager; + return state.heartbeats?.lastHeartbeatInfo?.Manager; }; /** diff --git a/love/src/redux/tests/heartbeats.test.js b/love/src/redux/tests/heartbeats.test.js index 7516795f2..67ca7f93a 100644 --- a/love/src/redux/tests/heartbeats.test.js +++ b/love/src/redux/tests/heartbeats.test.js @@ -20,17 +20,17 @@ let server; const heartbeatsInfo = [ { category: 'heartbeat', - data: [{ csc: 'manager', salindex: 0, data: { timestamp: 1582141499.626869 } }], + data: [{ csc: 'Manager', salindex: 0, data: { timestamp: 1582141499.626869 } }], subscription: 'heartbeat', }, { category: 'heartbeat', - data: [{ csc: 'manager', salindex: 0, data: { timestamp: 1692141499.626869 } }], + data: [{ csc: 'Manager', salindex: 0, data: { timestamp: 1692141499.626869 } }], subscription: 'heartbeat', }, { category: 'heartbeat', - data: [{ csc: 'commander', salindex: 0, data: { timestamp: 1692141499.626869 } }], + data: [{ csc: 'Commander', salindex: 0, data: { timestamp: 1792141499.626869 } }], subscription: 'heartbeat', }, ];