mirror of
https://github.com/brendanhaines/RasPi.git
synced 2025-04-11 19:24:51 -06:00
fixes tx protocol for groundstation
This commit is contained in:
parent
ffc1c2fe77
commit
3ca4c787c6
@ -107,12 +107,13 @@ class ConnectionPanel extends JPanel implements ActionListener {
|
||||
* @param reconnect - tells server whether to listen for new connections. If false, server will shut down
|
||||
*/
|
||||
public void disconnectTcp( boolean reconnect ) {
|
||||
out.print( "DISCONNECT" );
|
||||
out.print( "DISCONNECT " );
|
||||
out.print( "D" );
|
||||
if( reconnect ) out.print( "_R" );
|
||||
out.println();
|
||||
|
||||
try {
|
||||
tcpTimer.stop();
|
||||
in.close();
|
||||
out.close();
|
||||
tcpSocket.close();
|
||||
@ -131,20 +132,21 @@ class ConnectionPanel extends JPanel implements ActionListener {
|
||||
out.print( "H " ); // Heartbeat / begin message indicator
|
||||
if( contentOut.getMotorsEnabled() ) out.print( "E " ); // enable motors
|
||||
if( contentOut.motorTesting ) {
|
||||
for( int i = 0; i < contentOut.motorValues.length; i++ )
|
||||
out.printf( "M%2d_%4d ", i, contentOut.motorValues[i] );
|
||||
for( int i = 0; i < contentOut.motorValues.length; i++ ) {
|
||||
out.printf( "M%02d_%04d ", i, contentOut.motorValues[i] );
|
||||
if( contentOut.getMotorsEnabled() ) out.print( "E " ); // enable motors (redundant)
|
||||
}
|
||||
}
|
||||
if( contentOut.getMotorsEnabled() ) out.print( "E " ); // enable motors (redundant)
|
||||
if( contentOut.controls ) {
|
||||
for( int i = 0; i < contentOut.controlValues.length; i++ )
|
||||
out.printf( "C%2d_%4d ", i, contentOut.controlValues[i] );
|
||||
for( int i = 0; i < contentOut.controlValues.length; i++ ) {
|
||||
out.printf( "C%02d_%04d ", i, contentOut.controlValues[i] );
|
||||
if( contentOut.getMotorsEnabled() ) out.print( "E " ); // enable motors (redundant)
|
||||
}
|
||||
}
|
||||
if( contentOut.getMotorsEnabled() ) out.print( "E " ); // enable motors (redundant)
|
||||
if( contentOut.orientation ) {
|
||||
/*if( contentOut.orientation ) {
|
||||
for( int i = 0; i < contentOut.orientValues.length; i++ )
|
||||
out.print( "O" + i + "_" + contentOut.orientValues[i] + " " );
|
||||
}
|
||||
if( contentOut.getMotorsEnabled() ) out.print( "E " ); // enable motors (redundant)
|
||||
}*/
|
||||
out.println();
|
||||
}
|
||||
|
||||
|
@ -40,6 +40,9 @@ class GroundStation implements ActionListener {
|
||||
connectPanel.setEnabled( true );
|
||||
mainWindow.getContentPane().add( connectPanel );
|
||||
|
||||
JButton fcButton = new JButton( "arm" );
|
||||
mainWindow.getContentPane().add( fcButton );
|
||||
|
||||
tabbedPane = new JTabbedPane();
|
||||
mainWindow.getContentPane().add( tabbedPane );
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user