Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

addValidCommandHint #142

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file modified .gitattributes
100644 → 100755
Empty file.
Empty file modified .github/ISSUE_TEMPLATE/bug-report.md
100644 → 100755
Empty file.
Empty file modified .github/ISSUE_TEMPLATE/feature-request.md
100644 → 100755
Empty file.
Empty file modified .github/workflows/docker-build.yml
100644 → 100755
Empty file.
Empty file modified .github/workflows/tests.yml
100644 → 100755
Empty file.
Empty file modified .gitignore
100644 → 100755
Empty file.
Empty file modified .gitmodules
100644 → 100755
Empty file.
Empty file modified .travis.yml
100644 → 100755
Empty file.
Empty file modified INSTALL-OLD.md
100644 → 100755
Empty file.
Empty file modified INSTALL.md
100644 → 100755
Empty file.
Empty file modified README.md
100644 → 100755
Empty file.
Empty file modified automation.py
100644 → 100755
Empty file.
Empty file modified automation.txt
100644 → 100755
Empty file.
Empty file modified cli.py
100644 → 100755
Empty file.
Empty file modified comm.py
100644 → 100755
Empty file.
Empty file modified dev.Dockerfile
100644 → 100755
Empty file.
Empty file modified docker-compose.prod.yml
100644 → 100755
Empty file.
Empty file modified docker-compose.yml
100644 → 100755
Empty file.
Empty file modified docs/.nojekyll
100644 → 100755
Empty file.
Empty file modified docs/Makefile
100644 → 100755
Empty file.
Empty file modified docs/_sources/backend_api_docs.rst.txt
100644 → 100755
Empty file.
Empty file modified docs/_sources/endpoints_api.rst.txt
100644 → 100755
Empty file.
Empty file modified docs/_sources/groundstation.rst.txt
100644 → 100755
Empty file.
Empty file modified docs/_sources/groundstation_modules.rst.txt
100644 → 100755
Empty file.
Empty file modified docs/_sources/groundstation_tests.rst.txt
100644 → 100755
Empty file.
Empty file modified docs/_sources/index.rst.txt
100644 → 100755
Empty file.
Empty file modified docs/_sources/modules_api.rst.txt
100644 → 100755
Empty file.
Empty file modified docs/_static/alabaster.css
100644 → 100755
Empty file.
Empty file modified docs/_static/basic.css
100644 → 100755
Empty file.
Empty file modified docs/_static/custom.css
100644 → 100755
Empty file.
Empty file modified docs/_static/doctools.js
100644 → 100755
Empty file.
Empty file modified docs/_static/documentation_options.js
100644 → 100755
Empty file.
Empty file modified docs/_static/file.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified docs/_static/jquery-3.4.1.js
100644 → 100755
Empty file.
Empty file modified docs/_static/jquery.js
100644 → 100755
Empty file.
Empty file modified docs/_static/language_data.js
100644 → 100755
Empty file.
Empty file modified docs/_static/minus.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified docs/_static/plus.png
100644 → 100755
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified docs/_static/pygments.css
100644 → 100755
Empty file.
Empty file modified docs/_static/searchtools.js
100644 → 100755
Empty file.
Empty file modified docs/_static/underscore-1.3.1.js
100644 → 100755
Empty file.
Empty file modified docs/_static/underscore.js
100644 → 100755
Empty file.
Empty file modified docs/backend_api_docs.html
100644 → 100755
Empty file.
Empty file modified docs/endpoints_api.html
100644 → 100755
Empty file.
Empty file modified docs/genindex.html
100644 → 100755
Empty file.
Empty file modified docs/groundstation.html
100644 → 100755
Empty file.
Empty file modified docs/groundstation_modules.html
100644 → 100755
Empty file.
Empty file modified docs/groundstation_tests.html
100644 → 100755
Empty file.
Empty file modified docs/index.html
100644 → 100755
Empty file.
Empty file modified docs/make.bat
100644 → 100755
Empty file.
Empty file modified docs/modules_api.html
100644 → 100755
Empty file.
Empty file modified docs/objects.inv
100644 → 100755
Empty file.
Empty file modified docs/py-modindex.html
100644 → 100755
Empty file.
Empty file modified docs/requirements.txt
100644 → 100755
Empty file.
Empty file modified docs/search.html
100644 → 100755
Empty file.
Empty file modified docs/searchindex.js
100644 → 100755
Empty file.
Empty file modified docs/source/backend_api_docs.rst
100644 → 100755
Empty file.
Empty file modified docs/source/conf.py
100644 → 100755
Empty file.
Empty file modified docs/source/endpoints_api.rst
100644 → 100755
Empty file.
Empty file modified docs/source/groundstation.rst
100644 → 100755
Empty file.
Empty file modified docs/source/groundstation_modules.rst
100644 → 100755
Empty file.
Empty file modified docs/source/groundstation_tests.rst
100644 → 100755
Empty file.
Empty file modified docs/source/index.rst
100644 → 100755
Empty file.
Empty file modified docs/source/modules_api.rst
100644 → 100755
Empty file.
Empty file modified flightschedules/README.md
100644 → 100755
Empty file.
Empty file modified groundstation/__init__.py
100644 → 100755
Empty file.
Empty file modified groundstation/backend_api/__init__.py
100644 → 100755
Empty file.
Empty file modified groundstation/backend_api/auth.py
100644 → 100755
Empty file.
Empty file modified groundstation/backend_api/automatedcommand.py
100644 → 100755
Empty file.
Empty file modified groundstation/backend_api/communications.py
100644 → 100755
Empty file.
Empty file modified groundstation/backend_api/flightschedule.py
100644 → 100755
Empty file.
Empty file modified groundstation/backend_api/housekeeping.py
100644 → 100755
Empty file.
Empty file modified groundstation/backend_api/models.py
100644 → 100755
Empty file.
Empty file modified groundstation/backend_api/passover.py
100644 → 100755
Empty file.
Empty file modified groundstation/backend_api/telecommand.py
100644 → 100755
Empty file.
Empty file modified groundstation/backend_api/user.py
100644 → 100755
Empty file.
Empty file modified groundstation/backend_api/utils.py
100644 → 100755
Empty file.
Empty file modified groundstation/backend_api/validators.py
100644 → 100755
Empty file.
Empty file modified groundstation/config.py
100644 → 100755
Empty file.
Empty file modified groundstation/public/css/App.css
100644 → 100755
Empty file.
Empty file modified groundstation/public/css/main.css
100644 → 100755
Empty file.
Empty file modified groundstation/static/.babelrc
100644 → 100755
Empty file.
Empty file modified groundstation/static/.prettierrc
100644 → 100755
Empty file.
Empty file modified groundstation/static/__init__.py
100644 → 100755
Empty file.
Empty file modified groundstation/static/js/App.jsx
100644 → 100755
Empty file.
Empty file modified groundstation/static/js/components/AddFlightschedule.jsx
100644 → 100755
Empty file.
Empty file modified groundstation/static/js/components/AddUser.jsx
100644 → 100755
Empty file.
Empty file modified groundstation/static/js/components/AutomatedCommandSequence.jsx
100644 → 100755
Empty file.
Empty file.
Empty file modified groundstation/static/js/components/CommunicationsListFull.jsx
100644 → 100755
Empty file.
Empty file modified groundstation/static/js/components/Countdown.jsx
100644 → 100755
Empty file.
Empty file modified groundstation/static/js/components/DeleteFlightschedule.jsx
100644 → 100755
Empty file.
Empty file modified groundstation/static/js/components/FlightSchedule.jsx
100644 → 100755
Empty file.
Empty file modified groundstation/static/js/components/FlightScheduleList.jsx
100644 → 100755
Empty file.
Empty file modified groundstation/static/js/components/FlightscheduleCommand.jsx
100644 → 100755
Empty file.
Empty file modified groundstation/static/js/components/Help.jsx
100644 → 100755
Empty file.
Empty file modified groundstation/static/js/components/Home.jsx
100644 → 100755
Empty file.
Empty file modified groundstation/static/js/components/Housekeeping.jsx
100644 → 100755
Empty file.
Empty file modified groundstation/static/js/components/HousekeepingDialog.jsx
100644 → 100755
Empty file.
Empty file modified groundstation/static/js/components/HousekeepingListFull.jsx
100644 → 100755
Empty file.
54 changes: 49 additions & 5 deletions groundstation/static/js/components/LiveCommands.jsx
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ class LiveCommands extends Component {
last_id: undefined,
errorMessage: '',
textBoxValue: '',
execCommand: {
command_name: '',
num_arguments: '',
about_info: ''
},
displayLog: [],
isSatCli: false,
currentSatCli: {
Expand All @@ -60,6 +65,7 @@ class LiveCommands extends Component {
}
};
this.handleChangeCommand = this.handleChangeCommand.bind(this);
this.handleChangeText = this.handleChangeText.bind(this);
this.handleToggleSatCli = this.handleToggleSatCli.bind(this);
this.handleChangeSatCli = this.handleChangeSatCli.bind(this);
this.formatToSatCliCommand = this.formatToSatCliCommand.bind(this);
Expand Down Expand Up @@ -92,7 +98,6 @@ class LiveCommands extends Component {
...option,
}
})
console.log(options)
this.setState({options:options})
} else {
console.error('Error loading telecommands!');
Expand Down Expand Up @@ -190,8 +195,19 @@ class LiveCommands extends Component {
return true;
}

handleChangeCommand(event) {
this.setState({ textBoxValue: event.target.value });
// Check value updated by auto complete
handleChangeCommand(event, value) {
const command = this.state.options.find(
(option) => option.command_name === value.command_name
);
if (command) {
this.setState({execCommand: command})
}
}

// Update value in text field
handleChangeText(event){
this.setState({textBoxValue: event.target.value})
}

handleToggleSatCli(event) {
Expand Down Expand Up @@ -301,6 +317,7 @@ class LiveCommands extends Component {
options={this.state.options.sort((a, b) => -b.firstLetter.localeCompare(a.firstLetter))}
groupBy={(option) => option.firstLetter}
getOptionLabel={(option) => option.command_name}
onChange={(event, value) => this.handleChangeCommand(event, value)}
sx={{ width: '100%'}}
renderInput={(params) =>
<TextField
Expand All @@ -312,7 +329,7 @@ class LiveCommands extends Component {
variant="outlined"
style={{ width: '100%', backgroundColor: 'white' }}
value={this.state.textBoxValue}
onChange={(event) => this.handleChangeCommand(event)}
onChange={(event) => this.handleChangeText(event)}
onKeyDown={(event) => this.handleKeyPress(event)}
error={!(this.state.errorMessage === '')}/>}
/>
Expand Down Expand Up @@ -344,7 +361,34 @@ class LiveCommands extends Component {
<img src="http://anon:[email protected]/cgi-bin/video.cgi"
alt="http://anon:[email protected]/cgi-bin/video.cgi" class="shrinkToFit" style={{ marginBottom: '30px' , marginRight: '10px'}}/>
<img src="http://anon:[email protected]/cgi-bin/video.cgi"
alt="http://anon:[email protected]/cgi-bin/video.cgi" class="shrinkToFit" style={{ marginRight: '10px'}}/>
alt="http://anon:[email protected]/cgi-bin/video.cgi" class="shrinkToFit" style={{ marginBottom: '30px' , marginRight: '10px'}}/>
<Paper
style={{
marginTop: '10px',
marginBottom: '15px',
maxHeight: '60vh',
overflow: 'auto',
borderStyle: 'solid',
borderColor: 'black'
}}
>
{
this.state.execCommand.command_name!=''
? (
<Typography variant="body1" style={{ paddingLeft: "10px" }}>
<strong>{this.state.execCommand.command_name.slice(4)}</strong>
<span style={{ fontStyle: "italic" }}>
{" (" + this.state.execCommand.num_arguments + ")"}
</span>
{this.state.execCommand.about_info != null ? (
<p style={{ paddingLeft: "5%" }}>{this.state.execCommand.about_info}</p>
) : null}
<hr></hr>
</Typography>
)
: null
}
</Paper>
</div>
</Grid>
</Grid>
Expand Down
Empty file modified groundstation/static/js/components/Login.jsx
100644 → 100755
Empty file.
Empty file modified groundstation/static/js/components/Logout.jsx
100644 → 100755
Empty file.
Empty file modified groundstation/static/js/components/ManageUsers.jsx
100644 → 100755
Empty file.
Empty file modified groundstation/static/js/components/Passovers.jsx
100644 → 100755
Empty file.
Empty file modified groundstation/static/js/components/ResetPassword.jsx
100644 → 100755
Empty file.
Empty file modified groundstation/static/js/components/ViewLogs.jsx
100644 → 100755
Empty file.
Empty file modified groundstation/static/js/helpers.js
100644 → 100755
Empty file.
Empty file modified groundstation/static/js/index.jsx
100644 → 100755
Empty file.
Empty file modified groundstation/static/js/routes.jsx
100644 → 100755
Empty file.
Empty file modified groundstation/static/package-lock.json
100644 → 100755
Empty file.
Empty file modified groundstation/static/package.json
100644 → 100755
Empty file.
Empty file modified groundstation/static/webpack.config.js
100644 → 100755
Empty file.
Empty file modified groundstation/templates/__init__.py
100644 → 100755
Empty file.
Empty file modified groundstation/templates/index.html
100644 → 100755
Empty file.
Empty file modified groundstation/tests/__init__.py
100644 → 100755
Empty file.
Empty file modified groundstation/tests/base.py
100644 → 100755
Empty file.
Empty file modified groundstation/tests/frontend_test.py
100644 → 100755
Empty file.
Empty file modified groundstation/tests/groundstation_test.py
100644 → 100755
Empty file.
Empty file modified groundstation/tests/test_api.py
100644 → 100755
Empty file.
Empty file modified groundstation/tests/test_auth.py
100644 → 100755
Empty file.
Empty file modified groundstation/tests/test_backend_utils.py
100644 → 100755
Empty file.
Empty file modified groundstation/tests/test_config.py
100644 → 100755
Empty file.
Empty file modified groundstation/tests/test_models.py
100644 → 100755
Empty file.
Empty file modified groundstation/tests/test_sat_sim.py
100644 → 100755
Empty file.
Empty file modified groundstation/tests/utils.py
100644 → 100755
Empty file.
Empty file modified groundstation/views.py
100644 → 100755
Empty file.
Empty file modified manage.py
100644 → 100755
Empty file.
Empty file modified migrations/README
100644 → 100755
Empty file.
Empty file modified migrations/alembic.ini
100644 → 100755
Empty file.
Empty file modified migrations/env.py
100644 → 100755
Empty file.
Empty file modified migrations/script.py.mako
100644 → 100755
Empty file.
Empty file modified migrations/versions/caeaf052096c_initial_migration.py
100644 → 100755
Empty file.
Empty file modified nginx.conf
100644 → 100755
Empty file.
Empty file modified requirements.txt
100644 → 100755
Empty file.
Empty file modified run.py
100644 → 100755
Empty file.
Empty file modified sat_sim_example_usage.py
100644 → 100755
Empty file.
Empty file modified satellite_simulator/__init__.py
100644 → 100755
Empty file.
Empty file modified satellite_simulator/antenna.py
100644 → 100755
Empty file.
Empty file modified satellite_simulator/helpers.py
100644 → 100755
Empty file.
Empty file modified satellite_simulator/sat_server.py
100644 → 100755
Empty file.
Empty file modified satellite_simulator/sat_sim.py
100644 → 100755
Empty file.
Empty file modified satellite_simulator/test_flight_schedule1.txt
100644 → 100755
Empty file.
Empty file modified setup.txt
100644 → 100755
Empty file.
Empty file modified test_key.dat
100644 → 100755
Empty file.
Empty file modified user.Dockerfile
100644 → 100755
Empty file.