mirror of
https://github.com/brendanhaines/RasPi.git
synced 2024-11-09 16:44:40 -07: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
|
* @param reconnect - tells server whether to listen for new connections. If false, server will shut down
|
||||||
*/
|
*/
|
||||||
public void disconnectTcp( boolean reconnect ) {
|
public void disconnectTcp( boolean reconnect ) {
|
||||||
out.print( "DISCONNECT" );
|
out.print( "DISCONNECT " );
|
||||||
out.print( "D" );
|
out.print( "D" );
|
||||||
if( reconnect ) out.print( "_R" );
|
if( reconnect ) out.print( "_R" );
|
||||||
out.println();
|
out.println();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
tcpTimer.stop();
|
||||||
in.close();
|
in.close();
|
||||||
out.close();
|
out.close();
|
||||||
tcpSocket.close();
|
tcpSocket.close();
|
||||||
|
@ -131,20 +132,21 @@ class ConnectionPanel extends JPanel implements ActionListener {
|
||||||
out.print( "H " ); // Heartbeat / begin message indicator
|
out.print( "H " ); // Heartbeat / begin message indicator
|
||||||
if( contentOut.getMotorsEnabled() ) out.print( "E " ); // enable motors
|
if( contentOut.getMotorsEnabled() ) out.print( "E " ); // enable motors
|
||||||
if( contentOut.motorTesting ) {
|
if( contentOut.motorTesting ) {
|
||||||
for( int i = 0; i < contentOut.motorValues.length; i++ )
|
for( int i = 0; i < contentOut.motorValues.length; i++ ) {
|
||||||
out.printf( "M%2d_%4d ", i, contentOut.motorValues[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 ) {
|
if( contentOut.controls ) {
|
||||||
for( int i = 0; i < contentOut.controlValues.length; i++ )
|
for( int i = 0; i < contentOut.controlValues.length; i++ ) {
|
||||||
out.printf( "C%2d_%4d ", i, contentOut.controlValues[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++ )
|
for( int i = 0; i < contentOut.orientValues.length; i++ )
|
||||||
out.print( "O" + i + "_" + contentOut.orientValues[i] + " " );
|
out.print( "O" + i + "_" + contentOut.orientValues[i] + " " );
|
||||||
}
|
}*/
|
||||||
if( contentOut.getMotorsEnabled() ) out.print( "E " ); // enable motors (redundant)
|
|
||||||
out.println();
|
out.println();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -40,6 +40,9 @@ class GroundStation implements ActionListener {
|
||||||
connectPanel.setEnabled( true );
|
connectPanel.setEnabled( true );
|
||||||
mainWindow.getContentPane().add( connectPanel );
|
mainWindow.getContentPane().add( connectPanel );
|
||||||
|
|
||||||
|
JButton fcButton = new JButton( "arm" );
|
||||||
|
mainWindow.getContentPane().add( fcButton );
|
||||||
|
|
||||||
tabbedPane = new JTabbedPane();
|
tabbedPane = new JTabbedPane();
|
||||||
mainWindow.getContentPane().add( tabbedPane );
|
mainWindow.getContentPane().add( tabbedPane );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user