Minor tweaks to get exec.connected working
This commit is contained in:
@@ -45,6 +45,9 @@ subprojects {
|
|||||||
maven {
|
maven {
|
||||||
url 'https://github.com/Boukefalos/jlibwinapi/raw/mvn-repo/'
|
url 'https://github.com/Boukefalos/jlibwinapi/raw/mvn-repo/'
|
||||||
}
|
}
|
||||||
|
maven {
|
||||||
|
url 'https://github.com/Boukefalos/jlibusb/raw/mvn-repo/'
|
||||||
|
}
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -36,15 +36,14 @@ import de.hardcode.jxinput.event.JXInputDirectionalEvent;
|
|||||||
|
|
||||||
public abstract class JavaInputDevice extends Component implements Device {
|
public abstract class JavaInputDevice extends Component implements Device {
|
||||||
protected String name;
|
protected String name;
|
||||||
|
protected JavaInputListener javaInputListener;
|
||||||
|
protected Button previousDirectionalButton;
|
||||||
|
|
||||||
public JavaInputDevice(String title, String name) {
|
public JavaInputDevice(String title, String name) {
|
||||||
super(title);
|
super(title);
|
||||||
this.name = name;
|
this.name = name;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected JavaInputListener javaInputListener;
|
|
||||||
protected Button previousDirectionalButton;
|
|
||||||
|
|
||||||
public void activate() throws ActivateException {
|
public void activate() throws ActivateException {
|
||||||
try {
|
try {
|
||||||
JXInputDevice jxinputDevice = getDevice(name);
|
JXInputDevice jxinputDevice = getDevice(name);
|
||||||
|
|||||||
@@ -106,7 +106,5 @@ public abstract class Listen<E> extends Work implements Listener<E> {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void input(E element) {
|
public abstract void input(E element);
|
||||||
System.err.println(element);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,4 +23,10 @@ public class DummyListen<T> extends Listen<T> {
|
|||||||
public void input(byte[] input) {
|
public void input(byte[] input) {
|
||||||
System.out.println("#" + id + ", input = " + new String(input).trim());
|
System.out.println("#" + id + ", input = " + new String(input).trim());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void input(T element) {
|
||||||
|
// TODO Auto-generated method stub
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ dependencies {
|
|||||||
|
|
||||||
compile 'com.esotericsoftware.yamlbeans:yamlbeans:1.09'
|
compile 'com.esotericsoftware.yamlbeans:yamlbeans:1.09'
|
||||||
|
|
||||||
// compile 'com.github.boukefalos:jlibibuddy:1.1'
|
compile 'com.github.boukefalos:jlibibuddy:1.1'
|
||||||
// compile 'com.github.boukefalos:jliblirc:1.1'
|
compile 'com.github.boukefalos:jliblirc:1.1'
|
||||||
|
compile 'com.github.boukefalos:jlibusb:0.5.7'
|
||||||
}
|
}
|
||||||
@@ -20,19 +20,15 @@ import java.io.FileReader;
|
|||||||
import java.io.OutputStreamWriter;
|
import java.io.OutputStreamWriter;
|
||||||
import java.lang.reflect.Field;
|
import java.lang.reflect.Field;
|
||||||
import java.lang.reflect.ParameterizedType;
|
import java.lang.reflect.ParameterizedType;
|
||||||
import java.lang.reflect.Type;
|
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import yaml.Contact;
|
|
||||||
|
|
||||||
import com.esotericsoftware.yamlbeans.YamlReader;
|
import com.esotericsoftware.yamlbeans.YamlReader;
|
||||||
import com.esotericsoftware.yamlbeans.YamlWriter;
|
import com.esotericsoftware.yamlbeans.YamlWriter;
|
||||||
|
|
||||||
|
import yaml.Contact;
|
||||||
|
|
||||||
public class TestFromYaml {
|
public class TestFromYaml {
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
YamlReader reader = new YamlReader(new FileReader("test.yml"));
|
YamlReader reader = new YamlReader(new FileReader("test.yml"));
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,8 @@ public class TestTcpCommunication {
|
|||||||
|
|
||||||
Properties iBuddyProperties = new Properties();
|
Properties iBuddyProperties = new Properties();
|
||||||
iBuddyProperties.setProperty("implementation", "local");
|
iBuddyProperties.setProperty("implementation", "local");
|
||||||
iBuddy iBuddy = new com.github.boukefalos.ibuddy.Loader(iBuddyProperties).getiBuddy();
|
iBuddy iBuddy = new com.github.boukefalos.ibuddy.Loader(iBuddyProperties).getiBuddy();
|
||||||
|
|
||||||
Dummy dummy = new Dummy(localLirc, iBuddy);
|
Dummy dummy = new Dummy(localLirc, iBuddy);
|
||||||
|
|
||||||
Control server = localLoader.getServer();
|
Control server = localLoader.getServer();
|
||||||
|
|||||||
@@ -16,18 +16,18 @@
|
|||||||
*/
|
*/
|
||||||
package dummy;
|
package dummy;
|
||||||
|
|
||||||
import lirc.Lirc.Color;
|
|
||||||
import lirc.Lirc.Direction;
|
|
||||||
import lirc.Lirc.Number;
|
|
||||||
import lirc.Lirc.Signal;
|
|
||||||
import base.work.Listen;
|
|
||||||
|
|
||||||
import com.github.boukefalos.ibuddy.iBuddy;
|
import com.github.boukefalos.ibuddy.iBuddy;
|
||||||
import com.github.boukefalos.lirc.Lirc;
|
import com.github.boukefalos.lirc.Lirc;
|
||||||
import com.github.boukefalos.lirc.LircButton;
|
import com.github.boukefalos.lirc.LircButton;
|
||||||
import com.github.boukefalos.lirc.util.SignalObject;
|
import com.github.boukefalos.lirc.util.SignalObject;
|
||||||
|
|
||||||
public class Dummy extends Listen<Object> {
|
import base.work.ReflectiveListen;
|
||||||
|
import lirc.Lirc.Color;
|
||||||
|
import lirc.Lirc.Direction;
|
||||||
|
import lirc.Lirc.Number;
|
||||||
|
import lirc.Lirc.Signal;
|
||||||
|
|
||||||
|
public class Dummy extends ReflectiveListen {
|
||||||
protected Lirc lirc;
|
protected Lirc lirc;
|
||||||
protected iBuddy iBuddy;
|
protected iBuddy iBuddy;
|
||||||
|
|
||||||
@@ -45,7 +45,6 @@ public class Dummy extends Listen<Object> {
|
|||||||
public void input(SignalObject<Object> signalObject) {
|
public void input(SignalObject<Object> signalObject) {
|
||||||
Signal signal = signalObject.signal;
|
Signal signal = signalObject.signal;
|
||||||
Object object = signalObject.object;
|
Object object = signalObject.object;
|
||||||
System.out.println(object);
|
|
||||||
try {
|
try {
|
||||||
// Move these mappings to config file?
|
// Move these mappings to config file?
|
||||||
if (object instanceof LircButton) {
|
if (object instanceof LircButton) {
|
||||||
|
|||||||
Reference in New Issue
Block a user