Skip to content

Commit

Permalink
Merge pull request #476 from lsst-ts/tickets/LOVE-195
Browse files Browse the repository at this point in the history
Subsystem EUIs Implementation
  • Loading branch information
areyesd14 authored Jun 22, 2023
2 parents a11e842 + 957a3ba commit 61d1ed7
Show file tree
Hide file tree
Showing 11 changed files with 92 additions and 163 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ v5.22.0

* Glycol Loop Implementation `<https://github.com/lsst-ts/LOVE-frontend/pull/475>`_
* Include Dynalene System and MTAirCompressor devices to Facility Map `<https://github.com/lsst-ts/LOVE-frontend/pull/474>`_

* Subsystem EUIs Implementation `<https://github.com/lsst-ts/LOVE-frontend/pull/476>`_

v5.21.0
--------
Expand Down
178 changes: 19 additions & 159 deletions love/src/Config.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,21 @@ export const SCRIPT_DOCUMENTATION_BASE_URL = 'https://ts-standardscripts.lsst.io

// URL for external Cloud Map Service
export const CLOUD_MAP_SERVICE = {
url:
'https://www.meteoblue.com/en/weather/maps/widget/-30.245N-70.749E2605_America%2FSantiago?windAnimation=0&gust=0&satellite=0&cloudsAndPrecipitation=0&cloudsAndPrecipitation=1&temperature=0&sunshine=0&extremeForecastIndex=0&geoloc=fixed&tempunit=C&windunit=km%252Fh&lengthunit=metric&zoom=9&autowidth=auto',
url: 'https://www.meteoblue.com/en/weather/maps/widget/-30.245N-70.749E2605_America%2FSantiago?windAnimation=0&gust=0&satellite=0&cloudsAndPrecipitation=0&cloudsAndPrecipitation=1&temperature=0&sunshine=0&extremeForecastIndex=0&geoloc=fixed&tempunit=C&windunit=km%252Fh&lengthunit=metric&zoom=9&autowidth=auto',
copyrigth:
'https://www.meteoblue.com/en/weather/maps/-30.245N-70.749E2605_America%2FSantiago?utm_source=weather_widget&utm_medium=linkus&utm_content=map&utm_campaign=Weather%2BWidget',
};

// URLs for Component EUIs
export const EUIs = {
M1M3: 'https://ls.st/m1m3-dev',
M2: 'https://ls.st/hexrot-vm01',
ROTATOR: 'https://ls.st/hexrot-vm01',
HEXAPOD: 'https://ls.st/hexrot-vm01',
TMA: 'https://confluence.lsstcorp.org/pages/viewpage.action?pageId=214147380',
ATDOME: 'https://atmcs-dev.cp.lsst.org',
};

// Moment formats
export const ISO_STIRNG_DATE_TIME_FORMAT = 'YYYY-MM-DDTHH:mm:ss';
export const ISO_STIRNG_DATE_FORMAT = 'YYYY-MM-DD';
Expand All @@ -36,7 +45,8 @@ export const TIME_FORMAT = 'HH:mm:ss';
export const DATE_TIME_FORMAT = 'YYYY/MM/DD, HH:mm:ss';

// Regex
export const URL_REGEX = /((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)/;
export const URL_REGEX =
/((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[\w]*))?)/;

/*****************************************************************************/
/****************************Limits configurations****************************/
Expand Down Expand Up @@ -1891,162 +1901,12 @@ export const M1M3YActuatorsMapping = [
];

export const M1M3ZActuatorsMapping = [
0,
1,
2,
3,
4,
5,
6,
7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17,
18,
19,
20,
21,
22,
23,
24,
25,
26,
27,
28,
29,
30,
31,
32,
33,
34,
35,
36,
37,
38,
39,
40,
41,
42,
43,
44,
45,
46,
47,
48,
49,
50,
51,
52,
53,
54,
55,
56,
57,
58,
59,
60,
61,
62,
63,
64,
65,
66,
67,
68,
69,
70,
71,
72,
73,
74,
75,
76,
77,
78,
79,
80,
81,
82,
83,
84,
85,
86,
87,
88,
89,
90,
91,
92,
93,
94,
95,
96,
97,
98,
99,
100,
101,
102,
103,
104,
105,
106,
107,
108,
109,
110,
111,
112,
113,
114,
115,
116,
117,
118,
119,
120,
121,
122,
123,
124,
125,
126,
127,
128,
129,
130,
131,
132,
133,
134,
135,
136,
137,
138,
139,
140,
141,
142,
143,
144,
145,
146,
147,
148,
149,
150,
151,
152,
153,
154,
155,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60,
61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89,
90, 91, 92, 93, 94, 95, 96, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114,
115, 116, 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127, 128, 129, 130, 131, 132, 133, 134, 135, 136, 137,
138, 139, 140, 141, 142, 143, 144, 145, 146, 147, 148, 149, 150, 151, 152, 153, 154, 155,
];

export const M1M3SActuatorsMapping = [
Expand Down
9 changes: 8 additions & 1 deletion love/src/components/AuxTel/Dome/Dome.container.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import Dome from './Dome';
import { getDomeState, getATMCSState } from '../../../redux/selectors';
import { addGroup, removeGroup } from '../../../redux/actions/ws';
import SubscriptionTableContainer from '../../GeneralPurpose/SubscriptionTable/SubscriptionTable.container';
import { EUIs } from 'Config';

export const schema = {
description: 'Summary view of the ATDome. Contains general information about the dome and mount state',
Expand All @@ -21,6 +22,12 @@ export const schema = {
default: true,
isPrivate: false,
},
EUI: {
type: 'boolean',
description: 'Whether the component has a EUI link',
isPrivate: false,
default: EUIs.ATDOME,
},
},
};

Expand Down Expand Up @@ -103,7 +110,7 @@ const DomeContainer = ({
const mapStateToProps = (state) => {
const domeState = getDomeState(state);
const mountState = getATMCSState(state);
return {...domeState, ...mountState};
return { ...domeState, ...mountState };
};

const mapDispatchToProps = (dispatch) => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import SummaryPanel from './SummaryPanel';
import { getMountState, getMountSubscriptions } from '../../../../redux/selectors';
import { addGroup, removeGroup } from '../../../../redux/actions/ws';
import SubscriptionTableContainer from '../../../GeneralPurpose/SubscriptionTable/SubscriptionTable.container';
import { EUIs } from 'Config';

export const schema = {
description: `Panel containing summary information about the AT, including the ATMCS, ATPneumatics and ATHexapod`,
Expand All @@ -15,6 +16,12 @@ export const schema = {
isPrivate: false,
default: 'AT summary',
},
EUI: {
type: 'boolean',
description: 'Whether the component has a EUI link',
isPrivate: false,
default: EUIs.ATDOME,
},
},
};

Expand Down
13 changes: 13 additions & 0 deletions love/src/components/GeneralPurpose/Panel/Panel.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ export default class Panel extends Component {
hasRawMode: PropTypes.bool,
/** If a valid url, displayed as a link button in the title bar*/
link: PropTypes.string,
/** If the component have a EUI, displayed as a link button in the tittle bar */
EUI: PropTypes.string,
};

static defaultProps = {
Expand Down Expand Up @@ -58,12 +60,23 @@ export default class Panel extends Component {
});
});
const hasLink = this.props.link && this.props.link !== '';
const hasEUI = this.props.EUI && this.props.EUI !== '';
return (
<div className={classNames}>
{this.props.title !== undefined && (
<div className={styles.panelHeading}>
<h3 className={styles.panelTitle}>{this.props.title}</h3>
<div className={[styles.panelButtonWrapper, hasLink ? styles.panelTwoButtonsWrapper : null].join(' ')}>
{hasEUI && (
<Button
title={`External link: ${this.props.EUI}`}
onClick={() => window.open(this.props.EUI, '_blank')}
className={styles.panelButton}
size={'small'}
>
<span>EUI</span>
</Button>
)}
{this.props.hasRawMode && (
<Button
title={this.state.isRaw ? 'Regular view' : 'Raw telemetry data'}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
import { addGroup, removeGroup } from '../../../redux/actions/ws';
import CableWraps from './CableWraps';
import SubscriptionTableContainer from '../../GeneralPurpose/SubscriptionTable/SubscriptionTable.container';
import { EUIs } from 'Config';

export const schema = {
description: 'View of both Simonyi azimuth and Camera cable wraps',
Expand All @@ -21,6 +22,12 @@ export const schema = {
isPrivate: false,
default: 'CableWraps',
},
EUI: {
type: 'boolean',
description: 'Whether the component has a EUI link',
isPrivate: false,
default: EUIs.ROTATOR,
},
},
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import CameraHexapod from './CameraHexapod';
import SubscriptionTableContainer from 'components/GeneralPurpose/SubscriptionTable/SubscriptionTable.container';
import { addGroup, removeGroup } from 'redux/actions/ws';
import { getHexapodStatus, getHexapodTables } from 'redux/selectors';
import { EUIs } from 'Config';

export const schema = {
description: 'View of Camera Hexapod',
Expand All @@ -21,6 +22,12 @@ export const schema = {
isPrivate: false,
default: 1,
},
EUI: {
type: 'boolean',
description: 'Whether the component has a EUI link',
isPrivate: false,
default: EUIs.HEXAPOD,
},
},
};

Expand Down
9 changes: 8 additions & 1 deletion love/src/components/MainTel/M1M3/M1M3.container.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import {
} from 'redux/selectors';
import SubscriptionTableContainer from 'components/GeneralPurpose/SubscriptionTable/SubscriptionTable.container';
import M1M3 from './M1M3';
import { EUIs } from 'Config';

export const schema = {
description: 'View of M1M3 actuators',
Expand All @@ -21,11 +22,17 @@ export const schema = {
isPrivate: false,
default: 'M1M3',
},
EUI: {
type: 'boolean',
description: 'Whether the component has a EUI link',
isPrivate: false,
default: EUIs.M1M3,
},
},
};

const M1M3Container = ({ subscribeToStreams, unsubscribeToStreams, ...props }) => {
if (props.isRaw) {
if (props.isRaw && props.hasEUI) {
return <SubscriptionTableContainer subscriptions={props.subscriptions}></SubscriptionTableContainer>;
}
return <M1M3 subscribeToStreams={subscribeToStreams} unsubscribeToStreams={unsubscribeToStreams} {...props} />;
Expand Down
7 changes: 7 additions & 0 deletions love/src/components/MainTel/M2/M2.container.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { addGroup, removeGroup } from 'redux/actions/ws';
import { getM2State, getM2Inclinometer, getM2Actuator, getM2ActuatorForce } from 'redux/selectors';
import SubscriptionTableContainer from 'components/GeneralPurpose/SubscriptionTable/SubscriptionTable.container';
import M2 from './M2';
import { EUIs } from 'Config';

export const schema = {
description: 'View of M2 actuators',
Expand Down Expand Up @@ -33,6 +34,12 @@ export const schema = {
isPrivate: false,
default: false,
},
EUI: {
type: 'boolean',
description: 'Whether the component has a EUI link',
isPrivate: false,
default: EUIs.M2,
},
},
};

Expand Down
Loading

0 comments on commit 61d1ed7

Please sign in to comment.