bug fixes

Former-commit-id: 73a44e02291ae0e73acd589f5c82bd270357ac78
This commit is contained in:
Daniel Collin 2015-12-07 16:47:48 +01:00
parent 4c05900dfc
commit 9b9774e150
4 changed files with 11 additions and 10 deletions

View file

@ -25,7 +25,7 @@
<!-- ________________________ PUBLIC TARGETS ________________________ --> <!-- ________________________ PUBLIC TARGETS ________________________ -->
<target name="run-local-sensor" depends="build"> <target name="run-local-sensor" depends="">
<java fork="true" failonerror="true" classname="se.koc.hal.plugin.localsensor.ImpulseTracker"> <java fork="true" failonerror="true" classname="se.koc.hal.plugin.localsensor.ImpulseTracker">
<classpath> <classpath>
<pathelement path="${buildDir}/hal.jar"/> <!--wildcard may not be platform independent, ok?--> <pathelement path="${buildDir}/hal.jar"/> <!--wildcard may not be platform independent, ok?-->
@ -34,7 +34,7 @@
</java> </java>
</target> </target>
<target name="run-remote-sensor" depends="build"> <target name="run-remote-sensor" depends="">
<java fork="true" failonerror="true" classname="se.koc.hal.plugin.tellstick.TelstickSerialCommTest"> <java fork="true" failonerror="true" classname="se.koc.hal.plugin.tellstick.TelstickSerialCommTest">
<classpath> <classpath>
<pathelement path="${buildDir}/hal.jar"/> <!--wildcard may not be platform independent, ok?--> <pathelement path="${buildDir}/hal.jar"/> <!--wildcard may not be platform independent, ok?-->
@ -43,7 +43,7 @@
</java> </java>
</target> </target>
<target name="run-main-server" depends="build"> <target name="run-main-server" depends="">
<java fork="true" failonerror="true" classname="se.koc.hal.PowerChallenge"> <java fork="true" failonerror="true" classname="se.koc.hal.PowerChallenge">
<classpath> <classpath>
<pathelement path="${buildDir}/hal.jar"/> <!--wildcard may not be platform independent, ok?--> <pathelement path="${buildDir}/hal.jar"/> <!--wildcard may not be platform independent, ok?-->
@ -64,10 +64,12 @@
<mkdir dir="${buildDir}" /> <mkdir dir="${buildDir}" />
<javac srcdir="${srcDir}" destdir="${buildDir}" fork="yes"> <javac srcdir="${srcDir}" destdir="${buildDir}" fork="yes">
<include name="**/*.java" /> <include name="**/*.java" />
<exclude name="se/koc/hal/tts/GoogleTTSClient.java" />
<classpath refid="classpath.build" /> <classpath refid="classpath.build" />
</javac> </javac>
<javac srcdir="${testDir}" destdir="${buildDir}" fork="yes"> <javac srcdir="${testDir}" destdir="${buildDir}" fork="yes">
<include name="**/*.java" /> <include name="**/*.java" />
<exclude name="se/koc/hal/test/JarvisSyntersizerTest.java" />
<classpath refid="classpath.build" /> <classpath refid="classpath.build" />
</javac> </javac>
<jar destfile="${buildDir}/hal.jar" basedir="${buildDir}" excludes="hal.jar" /> <jar destfile="${buildDir}/hal.jar" basedir="${buildDir}" excludes="hal.jar" />
@ -87,4 +89,4 @@
</target> </target>
</project> </project>

View file

@ -43,11 +43,11 @@ public class PowerChallenge {
daemon.initiate(daemonTimer); daemon.initiate(daemonTimer);
} }
/*HttpServer http = new HttpServer(80); HttpServer http = new HttpServer(80);
http.setDefaultPage(new HttpFilePage(FileUtil.find("web-resource/"))); http.setDefaultPage(new HttpFilePage(FileUtil.find("web-resource/")));
http.setPage("/", new PCOverviewHttpPage()); http.setPage("/", new PCOverviewHttpPage());
http.setPage("/configure", new PCConfigureHttpPage()); http.setPage("/configure", new PCConfigureHttpPage());
http.setPage("/heatmap", new PCHeatMapHttpPage()); http.setPage("/heatmap", new PCHeatMapHttpPage());
http.start();*/ http.start();
} }
} }

View file

@ -21,8 +21,7 @@ import zutil.net.threaded.ThreadedTCPNetworkServerThread;
public class DataSynchronizationDaemon extends ThreadedTCPNetworkServer implements HalDaemon{ public class DataSynchronizationDaemon extends ThreadedTCPNetworkServer implements HalDaemon{
private static final Logger logger = LogUtil.getLogger(); private static final Logger logger = LogUtil.getLogger();
//public static final int SERVER_PORT = 6666; public static final int SERVER_PORT = 6666;
public static final int SERVER_PORT = 80;
public DataSynchronizationDaemon() { public DataSynchronizationDaemon() {

View file

@ -59,7 +59,7 @@ public class ImpulseTracker implements Runnable {
//start a daemon thread to save the impulse count every minute //start a daemon thread to save the impulse count every minute
Thread thread = new Thread(this); Thread thread = new Thread(this);
thread.setDaemon(true); thread.setDaemon(false);
thread.start(); thread.start();
} }
@ -102,7 +102,7 @@ public class ImpulseTracker implements Runnable {
@Override @Override
public void run() { public void run() {
try { try {
db.exec("INSERT INTO sensor_data_raw (timestamp, sensor_id, data) VALUE("+timestamp_end+", "+2+", "+data+")"); db.exec("INSERT INTO sensor_data_raw(timestamp, sensor_id, data) VALUES("+timestamp_end+", "+2+", "+data+")");
} catch (SQLException e) { } catch (SQLException e) {
e.printStackTrace(); e.printStackTrace();
} }