Skip to content

Commit

Permalink
Merge pull request #27 from ut-issl/feature/Release_v2.0.0
Browse files Browse the repository at this point in the history
Release v2.0.0
  • Loading branch information
TomokiMochizuki authored Aug 14, 2023
2 parents 7b493e5 + 6ed9efb commit fb67832
Show file tree
Hide file tree
Showing 48 changed files with 640 additions and 127 deletions.
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@ The application listed below is required:
docker-compose down
```
### Operation
1. Fulfill comment and select a component in the main page.
2. Click the operation start button.
3. Connect WINGS_TMTC_IF to the the operation.
4. Click the operation join button.
5. You can show telemetries and send commands while joining the operation.
1. Add the component name you want to communicate with, along with the Command APID and Telemetry APID, to the config.json file.
2. Fulfill comment and select a component in the main page.
3. Click the operation start button.
4. Connect WINGS_TMTC_IF to the the operation.
5. Click the operation join button.
6. You can show telemetries and send commands while joining the operation.
### Command
- You can send commands by clicking command line and pushing `"Shift" + "Return"` keys.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const OpenPlanDialog = (props: OpenPlanDialogProps) => {
};

const handleOk = () => {
if (values != []) {
if (values.length != 0) {
indexes.forEach(index => {
if (values.indexOf(index.id) >= 0) {
dispatch(openPlan(index.id));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ import OpenPlanDialog from './OpenPlanDialog';
import PlanTabPanel from './PlanTabPanel';
import IconButtonInTabs from '../../common/IconButtonInTabs';
import { UNPLANNED_ID } from '../../../constants';
import Radio from '@material-ui/core/Radio';
import RadioGroup from '@material-ui/core/RadioGroup';
import FormControlLabel from '@material-ui/core/FormControlLabel';
import FormControl from '@material-ui/core/FormControl';
import FormLabel from '@material-ui/core/FormLabel';
import Toolbar from '@material-ui/core/Toolbar';
import { getCmdType } from '../../../redux/plans/selectors';
import { setCmdTypeAction } from '../../../redux/plans/actions';

const useStyles = makeStyles(
createStyles({
Expand Down Expand Up @@ -46,6 +54,10 @@ const useStyles = makeStyles(
width: '80%',
maxHeight: 435,
},
cmdTypeField: {
fontSize: "10pt",
textAlign:"center"
},
planTab: {
width: 700
}
Expand All @@ -71,6 +83,7 @@ const PlanDisplayArea = () => {
const planContents = getPlanContents(selector);
const inExecution = getInExecution(selector);
const value = openedIds.indexOf(activePlanId);
const [cmdType, setCmdType] = React.useState(getCmdType(selector));

const handleDialogOpen = () => {
if (!inExecution) {
Expand All @@ -89,6 +102,12 @@ const PlanDisplayArea = () => {
}
};

const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
let cmdType = (event.target as HTMLInputElement).value
setCmdType(cmdType);
dispatch(setCmdTypeAction(cmdType));
};

const closePlan = (id: string) => {
dispatch(closePlanAction(id));
}
Expand Down Expand Up @@ -135,9 +154,20 @@ const PlanDisplayArea = () => {
</IconButtonInTabs>
</Tabs>
<div className={classes.planTab} >
<FormControl component="fieldset">
<Toolbar>
<FormLabel component="legend" className={classes.cmdTypeField}>Data Type</FormLabel>
<RadioGroup aria-label="data-type" name="data-type" value={cmdType} onChange={handleChange}>
<Toolbar>
<FormControlLabel value="Type-A" control={<Radio />} label="Type-A" />
<FormControlLabel value="Type-B" control={<Radio />} label="Type-B" />
</Toolbar>
</RadioGroup>
</Toolbar>
</FormControl>
{planIndexes.length > 0 && (
planIndexes.map((index,i) => (
<PlanTabPanel key={index.id} value={value} index={i} name={index.name} content={planContents[index.id]} />
<PlanTabPanel key={index.id} value={value} index={i} name={index.name} content={planContents[index.id]} cmdType={cmdType} />
))
)}
</div>
Expand Down Expand Up @@ -182,9 +212,20 @@ const PlanDisplayArea = () => {
</IconButtonInTabs>
</Tabs>
<div className={classes.planTab} >
<FormControl component="fieldset">
<Toolbar>
<FormLabel component="legend" className={classes.cmdTypeField}>Data Type</FormLabel>
<RadioGroup aria-label="data-type" name="data-type" value={cmdType} onChange={handleChange}>
<Toolbar>
<FormControlLabel value="Type-A" control={<Radio />} label="Type-A" />
<FormControlLabel value="Type-B" control={<Radio />} label="Type-B" />
</Toolbar>
</RadioGroup>
</Toolbar>
</FormControl>
{planIndexes.length > 0 && (
planIndexes.map((index,i) => (
<PlanTabPanel key={index.id} value={value} index={i} name={index.name} content={planContents[index.id]} />
<PlanTabPanel key={index.id} value={value} index={i} name={index.name} content={planContents[index.id]} cmdType={cmdType} />
))
)}
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import TableCell from '@material-ui/core/TableCell';
import TableContainer from '@material-ui/core/TableContainer';
import TableHead from '@material-ui/core/TableHead';
import TableRow from '@material-ui/core/TableRow';
import { CommandPlanLine, RequestStatus, CmdFileVariable } from '../../../models';
import { CommandPlanLine, RequestStatus, CmdFileVariable, Telemetry, TlmCmdConfigurationInfo } from '../../../models';
import RequestTableRow from './RequestTableRow';
import { selectedPlanRowAction, execRequestSuccessAction, execRequestErrorAction, execRequestsStartAction, execRequestsEndAction, cmdFileVariableEditAction } from '../../../redux/plans/actions';
import { getActivePlanId, getAllIndexes, getInExecution, getPlanContents, getSelectedRow, getCommandFileVariables } from '../../../redux/plans/selectors';
Expand All @@ -22,6 +22,7 @@ import DialogActions from '@material-ui/core/DialogActions';
import { Dialog } from '@material-ui/core';
import { getOpid } from '../../../redux/operations/selectors';
import { finishEditCommandLineAction } from '../../../redux/plans/actions';
import { getTlmCmdConfig } from '../../../redux/operations/selectors';

const useStyles = makeStyles(
createStyles({
Expand All @@ -37,6 +38,10 @@ const useStyles = makeStyles(
button: {
width: 120
},
cmdTypeField: {
fontSize: "10pt",
textAlign:"center"
},
activeTab: {
height: 700,
zIndex: 99,
Expand All @@ -57,11 +62,12 @@ export interface PlanTabPanelProps {
value: number,
index: number,
name: string,
content: CommandPlanLine[]
content: CommandPlanLine[],
cmdType: string
}

const PlanTabPanel = (props: PlanTabPanelProps) => {
const {value, index, name, content } = props;
const {value, index, name, content, cmdType } = props;
const classes = useStyles();
const dispatch = useDispatch();
const selector = useSelector((state: RootState) => state);
Expand All @@ -70,6 +76,7 @@ const PlanTabPanel = (props: PlanTabPanelProps) => {

const opid = getOpid(selector);
const activePlanId = getActivePlanId(selector);
const tlmCmdConfig = getTlmCmdConfig(selector);

const [showModal, setShowModal] = React.useState(false);
const [text, setText] = React.useState("");
Expand Down Expand Up @@ -216,7 +223,7 @@ const PlanTabPanel = (props: PlanTabPanelProps) => {
const executeMultipleRequests = async () => {
let row = selectedRow;
do {
const exeret = await executeRequest(row);
const exeret = await executeRequest(row, cmdType);
await sendCmdFileLine(row, exeret);
if (content[row].request.method == "call") {
break;
Expand All @@ -240,7 +247,20 @@ const PlanTabPanel = (props: PlanTabPanelProps) => {
outcome.value = cmdFileVariables[variableIndex].value;
outcome.isSuccess = true;
} else if (variableName.indexOf('.') > -1) {
var tlms = getLatestTelemetries(selector)[variableName.split('.')[0]];
let tlms: Telemetry[] = [];
let latestTelemetries = getLatestTelemetries(selector);
let variableNameSplitList = variableName.split('.');
let tlmCmdConfigIndex = 0;
try {
tlms = latestTelemetries[variableNameSplitList[0]][variableNameSplitList[1]];
} catch (e) {
tlmCmdConfigIndex = tlmCmdConfig.findIndex(index => (latestTelemetries[index.compoName] != undefined && latestTelemetries[index.compoName][variableNameSplitList[0]] != undefined));
if (tlmCmdConfigIndex != -1) {
tlms = latestTelemetries[tlmCmdConfig[tlmCmdConfigIndex].compoName][variableNameSplitList[0]];
} else {
tlms = latestTelemetries["MOBC"][variableNameSplitList[0]];
}
}
if (tlms.findIndex(index => index.telemetryInfo.name === variableName) >= 0) {
variableIndex = tlms.findIndex(index => index.telemetryInfo.name === variableName);
} else if (tlms.findIndex(index => index.telemetryInfo.name === variableName.split('.').slice(1).join('.')) >= 0) {
Expand Down Expand Up @@ -316,7 +336,7 @@ const PlanTabPanel = (props: PlanTabPanelProps) => {
}
}

const executeRequest = async (row: number): Promise<boolean> => {
const executeRequest = async (row: number, cmdType: string): Promise<boolean> => {
const req = content[row].request;
let exeret = false;
switch (req.type) {
Expand Down Expand Up @@ -372,7 +392,7 @@ const PlanTabPanel = (props: PlanTabPanelProps) => {
}
}
}
await dispatch(postCommand(row, req, paramsValue, commandret));
await dispatch(postCommand(row, cmdType, req, paramsValue, commandret));
exeret = commandret[0];
break;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,19 @@ const useStyles = makeStyles((theme: Theme) =>
width: "3cm",
fontSize: "10pt"
},
title: {
color: '#ffff00'
},
titleWithSpace: {
color: 'white',
fontSize: 12,
paddingRight: 20
},
titleWithOutSpace: {
color: 'white',
fontSize: 12,
paddingRight: 20
}
}));

export interface GraphTabPanelProps {
Expand All @@ -74,7 +87,7 @@ const GraphTabPanel = (props: GraphTabPanelProps) => {
const selector = useSelector((state: RootState) => state);
const classes = useStyles();
const dispatch = useDispatch();
const telemetryHistories = getTelemetryHistories(selector)[tab.name];
const telemetryHistories = getTelemetryHistories(selector);

const [dataType, setDataType] = React.useState(tab.dataType);
const [dataLength, setDataLength] = React.useState(tab.dataLength);
Expand Down Expand Up @@ -111,7 +124,7 @@ const GraphTabPanel = (props: GraphTabPanelProps) => {
},[setDataLength]);

const inputYlabelMin = React.useCallback((event) => {
if (Number(event.target.value) != NaN){
if (!isNaN(Number(event.target.value))){
setYlabelMin(event.target.value);
}
else{
Expand All @@ -120,7 +133,7 @@ const GraphTabPanel = (props: GraphTabPanelProps) => {
},[setYlabelMin]);

const inputYlabelMax = React.useCallback((event) => {
if (Number(event.target.value) != NaN){
if (!isNaN(Number(event.target.value))){
setYlabelMax(event.target.value);
}
else{
Expand All @@ -133,7 +146,7 @@ const GraphTabPanel = (props: GraphTabPanelProps) => {
let isFirstValueSet = false;

tab.selectedTelemetries.forEach((telemetryName,index) =>{
const selectedTelemetryHistory = telemetryHistories.find(element => element.telemetryInfo.name == telemetryName);
const selectedTelemetryHistory = telemetryHistories[tab.compoName][tab.name].find(element => element.telemetryInfo.name == telemetryName);
if (selectedTelemetryHistory != undefined) {
let tlmDataTmp: number[] = [];
let tlmLabelTmp: string[] = [];
Expand Down Expand Up @@ -235,6 +248,15 @@ const GraphTabPanel = (props: GraphTabPanelProps) => {

return (
<div className={classes.root}>
<div className={classes.titleWithSpace}>
<span className={classes.title}>Name : </span>{tab.name}
</div>
<div className={classes.titleWithSpace}>
<span className={classes.title}>Apid : </span> 0x{Number(tab.tlmApid).toString(16)}
</div>
<div className={classes.titleWithOutSpace}>
<span className={classes.title}>Packet Id : </span> 0x{Number(tab.packetId).toString(16)}
</div>
<Toolbar>
<TextField
label="Data Length" onChange={inputDataLength}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const OpenGraphTabDialog = (props: OpenGraphTabDialogProps) => {
const dispatch = useDispatch();
const formGroupRef = React.useRef<HTMLElement>(null);

const telemetryHistories = getTelemetryHistories(selector)[tab.name];
const telemetryHistories = getTelemetryHistories(selector)[tab.compoName][tab.name];
const telemetryOptions: SelectOption[] = telemetryHistories.map(telemetryHistory => ({ id: telemetryHistory.telemetryInfo.name, name: telemetryHistory.telemetryInfo.name }));


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const OpenPacketTabDialog = (props: OpenPacketTabDialogProps) => {

const formGroupRef = React.useRef<HTMLElement>(null);

const latestTelemetries = getLatestTelemetries(selector)[tab.name];
const latestTelemetries = getLatestTelemetries(selector)[tab.compoName][tab.name];
const telemetryOptions: SelectOption[] = latestTelemetries.map(latestTelemetry => ({id:latestTelemetry.telemetryInfo.name, name:latestTelemetry.telemetryInfo.name}));


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const OpenViewDialog = (props: OpenViewDialogProps) => {
}
if (type === "packet"){
let telemetryShowed :string[] = [];
let tlms = getLatestTelemetries(selector)[element.name];
let tlms = getLatestTelemetries(selector)[element.compoName][element.name];
tlms.forEach(tlm => {
telemetryShowed.push(tlm.telemetryInfo.name);
})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,21 +80,18 @@ const useStyles = makeStyles((theme: Theme) =>
width: '80%',
maxHeight: 435,
},
packetId: {
title: {
color: '#ffff00'
},
titleWithSpace: {
color: 'white',
fontSize: 12,
paddingRight: 20
},
packetIdTitle: {
color: '#ffff00'
},
tabName: {
titleWithOutSpace: {
color: 'white',
fontSize: 12,
paddingRight: 20
},
tabNameTitle: {
color: '#ffff00'
}
}));

Expand All @@ -108,7 +105,7 @@ const PacketTabPanel = (props: PacketTabPanelProps) => {
const selector = useSelector((state: RootState) => state);
const classes = useStyles();
const dispatch = useDispatch();
const tlms = getLatestTelemetries(selector)[tab.name];
const tlms = getLatestTelemetries(selector)[tab.compoName][tab.name];
const selectedTelemetries = tab.selectedTelemetries;
const tlmClassList: string[] = [tab.name];
const tlmColor = getTelemetryColor(selector);
Expand Down Expand Up @@ -216,11 +213,14 @@ const PacketTabPanel = (props: PacketTabPanelProps) => {
</RadioGroup>
</Toolbar>
</FormControl>
<div className={classes.tabName}>
<span className={classes.tabNameTitle}>Name : </span>{tab.name}
<div className={classes.titleWithSpace}>
<span className={classes.title}>Name : </span>{tab.name}
</div>
<div className={classes.titleWithSpace}>
<span className={classes.title}>Apid : </span> 0x{Number(tab.tlmApid).toString(16)}
</div>
<div className={classes.packetId}>
<span className={classes.packetIdTitle}>Packet Id : </span> 0x{Number(tab.packetId).toString(16)}
<div className={classes.titleWithOutSpace}>
<span className={classes.title}>Packet Id : </span> 0x{Number(tab.packetId).toString(16)}
</div>
<Button onClick={handleOk} color="primary">
SET
Expand Down
3 changes: 2 additions & 1 deletion aspnetapp/WINGS/ClientApp/src/models/CommandPlan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ export type CommandPlanLine = {

export type CommandPlanState = {
allIndexes: CommandPlanIndex[],
cmdFileVariables: CmdFileVariable[];
cmdFileVariables: CmdFileVariable[],
cmdType: string,
openedIds: string[],
activeId: string,
selectedRow: number,
Expand Down
Loading

0 comments on commit fb67832

Please sign in to comment.