({
+ masterStatus: state.fieldStore.masterStatus,
+ teamNumber: state.fieldStore.teamNumber,
+ teamColor: state.fieldStore.teamColor,
robotState: state.info.robotState,
heart: state.fieldStore.heart,
ipAddress: state.info.ipAddress,
diff --git a/dawn/renderer/components/StatusLabel.js b/dawn/renderer/components/StatusLabel.js
index 8f880d4e..b7735d79 100644
--- a/dawn/renderer/components/StatusLabel.js
+++ b/dawn/renderer/components/StatusLabel.js
@@ -7,6 +7,15 @@ import numeral from 'numeral';
const StatusLabelComponent = (props) => {
let labelStyle = 'default';
let labelText = 'Disconnected';
+ const masterRobotHeader = 'Master Robot: Team ';
+ const teamIP = props.ipAddress.substring(props.ipAddress.length - 2, props.ipAddress.length);
+ let masterRobotStyle = ' ';
+ if (props.teamColor === 'blue') {
+ masterRobotStyle = 'primary';
+ } else if (props.teamColor === 'gold') {
+ masterRobotStyle = 'warning';
+ }
+
if (props.connectionStatus) {
if (!props.runtimeStatus) {
labelStyle = 'danger';
@@ -20,7 +29,14 @@ const StatusLabelComponent = (props) => {
}
}
return (
-
+
+
+ {' '}
+
+
);
};
@@ -29,12 +45,21 @@ StatusLabelComponent.propTypes = {
runtimeStatus: PropTypes.bool.isRequired,
batteryLevel: PropTypes.number.isRequired,
batterySafety: PropTypes.bool.isRequired,
+ teamColor: PropTypes.string.isRequired,
+ teamNumber: PropTypes.number.isRequired,
+ ipAddress: PropTypes.string.isRequired,
+ fieldControlStatus: PropTypes.bool.isRequired,
};
const mapStateToProps = state => ({
batteryLevel: state.peripherals.batteryLevel,
batterySafety: state.peripherals.batterySafety,
+ masterStatus: state.fieldStore.masterStatus,
+ teamNumber: state.fieldStore.teamNumber,
+ teamColor: state.fieldStore.teamColor,
+ ipAddress: state.info.ipAddress,
+ fieldControlStatus: state.fieldStore.fieldControl,
});
const StatusLabel = connect(mapStateToProps)(StatusLabelComponent);
diff --git a/dawn/renderer/constants/Constants.js b/dawn/renderer/constants/Constants.js
index 37fe67c3..212ca856 100755
--- a/dawn/renderer/constants/Constants.js
+++ b/dawn/renderer/constants/Constants.js
@@ -18,6 +18,7 @@ export const PeripheralTypes = keyMirror({
BatteryBuzzer: null,
TeamFlag: null,
GameValues: null,
+ master: null,
});
export const ActionTypes = keyMirror({
@@ -39,6 +40,7 @@ export const ActionTypes = keyMirror({
UPDATE_HEART: null,
UPDATE_ROBOT: null,
UPDATE_MATCH: null,
+ UPDATE_MASTER: null,
ADD_ALERT: null,
REMOVE_ALERT: null,
CLEAR_CONSOLE: null,
diff --git a/dawn/renderer/reducers/FieldStore.js b/dawn/renderer/reducers/FieldStore.js
index 2ad86c06..c30e12ce 100644
--- a/dawn/renderer/reducers/FieldStore.js
+++ b/dawn/renderer/reducers/FieldStore.js
@@ -7,9 +7,12 @@ const initialFieldState = {
rTeamNumber: 0,
rTeamName: 'Unknown',
heart: false,
+ masterStatus: false,
mMatchNumber: 0,
mTeamNumbers: [0, 0, 0, 0],
mTeamNames: ['Offline', 'Offline', 'Offline', 'Offline'],
+ teamNumber: 0,
+ teamColor: 'Unknown',
};
const fieldStore = (state = initialFieldState, action) => {
@@ -30,6 +33,13 @@ const fieldStore = (state = initialFieldState, action) => {
...state,
heart: !state.heart,
};
+ case ActionTypes.UPDATE_MASTER:
+ return {
+ ...state,
+ masterStatus: true,
+ teamNumber: action.teamNumber,
+ teamColor: action.alliance,
+ };
case ActionTypes.UPDATE_MATCH:
return {
...state,
diff --git a/dawn/renderer/reducers/info.js b/dawn/renderer/reducers/info.js
index df663435..dddc0ce7 100644
--- a/dawn/renderer/reducers/info.js
+++ b/dawn/renderer/reducers/info.js
@@ -9,6 +9,7 @@ const initialInfoState = {
isRunningCode: false,
connectionStatus: false,
runtimeStatus: false,
+ masterStatus: false,
notificationHold: 0,
fieldControlDirective: robotState.TELEOP,
fieldControlActivity: false,
@@ -40,6 +41,11 @@ const info = (state = initialInfoState, action) => {
...state,
runtimeStatus: true,
};
+ case 'MASTER_ROBOT':
+ return {
+ ...state,
+ masterStatus: true,
+ };
case 'RUNTIME_DISCONNECT':
return {
...state,