Page 1 of 1

Submasters Control

Posted: April 7th, 2013, 8:13 pm
by Danski123
Hi Guys!

Some time ago I developed an android app to control the submasters in FreeStyler.
Now I decided to share this program with you.
Screenshot_2013-04-07-21-07-11.jpg
This app basically displays the submasters from the first two submaster-pages (only seven per column) in button style on your android device.

The app is written for android 4.1.1 and I use it on an acer iconia a700 (res= 1920x1200).
It should work with other resolutions too. So far I was not successful to run in on android 2.3.
For the connection to FreeStyler you have to run the Freestyler TCPIP Server Program.
You will find the complete android project in the attached Freestyler Submstrs offc.zip.

A little inside in the source code:
(Freestyler Submstrs offc\src\roman10\tutorial\tcpcommclient\TcpClient.java)

##############################################################################
...
...
private static final int TCP_SERVER_PORT = 3332;
private String serverIpAddress = "192.168.1.100"; //Enter your IpAddress before compiling !!
.....
.....

sub1_1_1.setOnClickListener(new OnClickListener() {
public void onClick(View v){
if(sub1_1_1b){
order(1,1,1); //Do order 1,1,1 if the button sub1_1_1 is pressed
}
}
});
....
...
private void order(int x,int y,int z){ //this is the order function

if(x>1){
page(x); //go to Submaster page x
}

while( i<z-1){
go(y); //move in column y down (z-1 times)
i++;
}
i = 0;
run(y); //run selected submaster
while(i<z-1){
back(y); //go back in column y
i++;
}
i=0;
if(x>1){
page(1); //go back to page 1
}
}



//sends the byte array to FreeStyler Server for moving to mth submaster page
private void page(int m){
byte[] buffer = {70,83,79,68,(byte)(196 + m),0,85,0,0} ;
try {
sendMsg(buffer, s);
} catch (IOException e) {
e.printStackTrace();
}
}
....
....
.....
########################################################################

:fs:

Cheers
Daniel