changed indent to space and removed created by comment
This commit is contained in:
parent
8526e5157d
commit
6a15640aea
44 changed files with 721 additions and 814 deletions
|
|
@ -30,9 +30,6 @@ import zutil.io.file.FileUtil;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by Ziver on 2015-05-07.
|
|
||||||
*/
|
|
||||||
public class AliceBot implements HalBot{
|
public class AliceBot implements HalBot{
|
||||||
private Chat chatSession;
|
private Chat chatSession;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,9 +22,6 @@
|
||||||
|
|
||||||
package se.hal.intf;
|
package se.hal.intf;
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by Ziver on 2015-05-07.
|
|
||||||
*/
|
|
||||||
public interface HalBot {
|
public interface HalBot {
|
||||||
|
|
||||||
void initialize();
|
void initialize();
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,6 @@ package se.hal.intf;
|
||||||
|
|
||||||
import java.util.concurrent.ScheduledExecutorService;
|
import java.util.concurrent.ScheduledExecutorService;
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by Ziver on 2015-12-03.
|
|
||||||
*/
|
|
||||||
public interface HalDaemon extends Runnable{
|
public interface HalDaemon extends Runnable{
|
||||||
|
|
||||||
void initiate(ScheduledExecutorService executor);
|
void initiate(ScheduledExecutorService executor);
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,6 @@ package se.hal.intf;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface representing one report from an event
|
* Interface representing one report from an event
|
||||||
*
|
|
||||||
* Created by Ziver on 2016-08-17.
|
|
||||||
*/
|
*/
|
||||||
public abstract class HalDeviceData {
|
public abstract class HalDeviceData {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,6 @@ package se.hal.intf;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface representing event type specific configuration data.
|
* Interface representing event type specific configuration data.
|
||||||
*
|
|
||||||
* Created by Ziver on 2015-12-23.
|
|
||||||
*/
|
*/
|
||||||
public interface HalEventConfig {
|
public interface HalEventConfig {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,5 @@
|
||||||
package se.hal.intf;
|
package se.hal.intf;
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by Ziver on 2015-12-15.
|
|
||||||
*/
|
|
||||||
public interface HalEventController {
|
public interface HalEventController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,6 @@ package se.hal.intf;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface representing one report from an event
|
* Interface representing one report from an event
|
||||||
*
|
|
||||||
* Created by Ziver on 2016-08-17.
|
|
||||||
*/
|
*/
|
||||||
public abstract class HalEventData extends HalDeviceData{
|
public abstract class HalEventData extends HalDeviceData{
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,9 +16,6 @@ import java.io.IOException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by Ziver on 2015-12-10.
|
|
||||||
*/
|
|
||||||
public abstract class HalHttpPage implements HttpPage{
|
public abstract class HalHttpPage implements HttpPage{
|
||||||
private static final String TEMPLATE = "resource/web/main_index.tmpl";
|
private static final String TEMPLATE = "resource/web/main_index.tmpl";
|
||||||
private static Navigation rootNav = Navigation.createRootNav();
|
private static Navigation rootNav = Navigation.createRootNav();
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,6 @@ package se.hal.intf;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface representing sensor type specific configuration data.
|
* Interface representing sensor type specific configuration data.
|
||||||
*
|
|
||||||
* Created by Ziver on 2015-12-23.
|
|
||||||
*/
|
*/
|
||||||
public interface HalSensorConfig {
|
public interface HalSensorConfig {
|
||||||
enum AggregationMethod{
|
enum AggregationMethod{
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,5 @@
|
||||||
package se.hal.intf;
|
package se.hal.intf;
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by Ziver on 2015-12-15.
|
|
||||||
*/
|
|
||||||
public interface HalSensorController {
|
public interface HalSensorController {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,6 @@ package se.hal.intf;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Interface representing one data report from a sensor.
|
* Interface representing one data report from a sensor.
|
||||||
*
|
|
||||||
* Created by Ziver on 2016-08-17.
|
|
||||||
*/
|
*/
|
||||||
public abstract class HalSensorData extends HalDeviceData{
|
public abstract class HalSensorData extends HalDeviceData{
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,9 +12,6 @@ import java.util.*;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by ezivkoc on 2016-01-20.
|
|
||||||
*/
|
|
||||||
public class HalAlertManager implements HttpPage {
|
public class HalAlertManager implements HttpPage {
|
||||||
private static final Logger logger = LogUtil.getLogger();
|
private static final Logger logger = LogUtil.getLogger();
|
||||||
private static final String TMPL_PATH = "resource/web/main_alerts.tmpl";
|
private static final String TMPL_PATH = "resource/web/main_alerts.tmpl";
|
||||||
|
|
|
||||||
|
|
@ -16,9 +16,6 @@ import java.io.IOException;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by Ziver on 2016-06-23.
|
|
||||||
*/
|
|
||||||
public class MapHttpPage extends HalHttpPage {
|
public class MapHttpPage extends HalHttpPage {
|
||||||
private static final String TEMPLATE = "resource/web/map.tmpl";
|
private static final String TEMPLATE = "resource/web/map.tmpl";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,6 @@ import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TODO: This json endpoint might not be needed as we have SensorJsonPage?
|
* TODO: This json endpoint might not be needed as we have SensorJsonPage?
|
||||||
*
|
|
||||||
* Created by Ziver on 2016-06-23.
|
|
||||||
*/
|
*/
|
||||||
public class MapJsonPage extends HalJsonPage {
|
public class MapJsonPage extends HalJsonPage {
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ import java.util.logging.Logger;
|
||||||
* type: sensor data type name
|
* type: sensor data type name
|
||||||
*
|
*
|
||||||
* Data filtering parameters:
|
* Data filtering parameters:
|
||||||
* aggr: Aggrigation periods, needs to be provided to retrieve data. Possible values: minute,hour,day,week
|
* aggr: Aggregation periods, needs to be provided to retrieve data. Possible values: minute,hour,day,week
|
||||||
* </pre>
|
* </pre>
|
||||||
*/
|
*/
|
||||||
public class SensorJsonPage extends HalJsonPage {
|
public class SensorJsonPage extends HalJsonPage {
|
||||||
|
|
|
||||||
|
|
@ -18,9 +18,6 @@ import java.util.concurrent.TimeUnit;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by Ziver on 2016-09-30.
|
|
||||||
*/
|
|
||||||
public class NetScanController implements HalEventController, HalAutoScannableController, InetScanListener, Runnable{
|
public class NetScanController implements HalEventController, HalAutoScannableController, InetScanListener, Runnable{
|
||||||
public static Logger logger = LogUtil.getLogger();
|
public static Logger logger = LogUtil.getLogger();
|
||||||
private static final int NETWORK_SYNC_INTERVAL = 3 * 60 * 60 * 1000; // 3 hours
|
private static final int NETWORK_SYNC_INTERVAL = 3 * 60 * 60 * 1000; // 3 hours
|
||||||
|
|
|
||||||
|
|
@ -6,9 +6,6 @@ import se.hal.intf.HalEventData;
|
||||||
import se.hal.struct.devicedata.SwitchEventData;
|
import se.hal.struct.devicedata.SwitchEventData;
|
||||||
import zutil.ui.Configurator;
|
import zutil.ui.Configurator;
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by Ziver on 2016-10-02.
|
|
||||||
*/
|
|
||||||
public class NetworkDevice implements HalEventConfig {
|
public class NetworkDevice implements HalEventConfig {
|
||||||
|
|
||||||
@Configurator.Configurable("IP Address")
|
@Configurator.Configurable("IP Address")
|
||||||
|
|
|
||||||
|
|
@ -15,9 +15,6 @@ import java.util.concurrent.TimeUnit;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by Ziver on 2016-05-25.
|
|
||||||
*/
|
|
||||||
public class NutUpsController implements HalSensorController, HalAutoScannableController, Runnable{
|
public class NutUpsController implements HalSensorController, HalAutoScannableController, Runnable{
|
||||||
public static Logger logger = LogUtil.getLogger();
|
public static Logger logger = LogUtil.getLogger();
|
||||||
private static final int SYNC_INTERVAL = 60 * 1000;
|
private static final int SYNC_INTERVAL = 60 * 1000;
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,6 @@ import se.hal.struct.devicedata.PowerConsumptionSensorData;
|
||||||
import zutil.osal.linux.app.NutUPSClient;
|
import zutil.osal.linux.app.NutUPSClient;
|
||||||
import zutil.ui.Configurator;
|
import zutil.ui.Configurator;
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by Ziver on 2016-05-25.
|
|
||||||
*/
|
|
||||||
public class NutUpsDevice implements HalSensorConfig{
|
public class NutUpsDevice implements HalSensorConfig{
|
||||||
|
|
||||||
@Configurator.Configurable("UPS id")
|
@Configurator.Configurable("UPS id")
|
||||||
|
|
|
||||||
|
|
@ -20,9 +20,6 @@ import java.util.List;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by Ziver on 2015-12-15.
|
|
||||||
*/
|
|
||||||
@DBBean.DBTable(value="event", superBean=true)
|
@DBBean.DBTable(value="event", superBean=true)
|
||||||
public class Event extends AbstractDevice<Event, HalEventConfig,HalEventData>{
|
public class Event extends AbstractDevice<Event, HalEventConfig,HalEventData>{
|
||||||
private static final Logger logger = LogUtil.getLogger();
|
private static final Logger logger = LogUtil.getLogger();
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,6 @@ import java.sql.PreparedStatement;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by Ziver on 2015-12-03.
|
|
||||||
*/
|
|
||||||
@DBBean.DBTable("user")
|
@DBBean.DBTable("user")
|
||||||
public class User extends DBBean{
|
public class User extends DBBean{
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,6 @@ package se.hal.struct.devicedata;
|
||||||
|
|
||||||
import se.hal.intf.HalEventData;
|
import se.hal.intf.HalEventData;
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by Ziver on 2015-05-07.
|
|
||||||
*/
|
|
||||||
public class DimmerEventData extends HalEventData {
|
public class DimmerEventData extends HalEventData {
|
||||||
|
|
||||||
private double dimmValue;
|
private double dimmValue;
|
||||||
|
|
|
||||||
|
|
@ -3,9 +3,6 @@ package se.hal.struct.devicedata;
|
||||||
|
|
||||||
import se.hal.intf.HalSensorData;
|
import se.hal.intf.HalSensorData;
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by Ziver on 2015-12-03.
|
|
||||||
*/
|
|
||||||
public class HumiditySensorData extends HalSensorData {
|
public class HumiditySensorData extends HalSensorData {
|
||||||
|
|
||||||
private double humidity;
|
private double humidity;
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,6 @@ package se.hal.struct.devicedata;
|
||||||
|
|
||||||
import se.hal.intf.HalSensorData;
|
import se.hal.intf.HalSensorData;
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by Ziver on 2015-12-03.
|
|
||||||
*/
|
|
||||||
public class LightSensorData extends HalSensorData {
|
public class LightSensorData extends HalSensorData {
|
||||||
|
|
||||||
private double lux;
|
private double lux;
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,6 @@ package se.hal.struct.devicedata;
|
||||||
|
|
||||||
import se.hal.intf.HalSensorData;
|
import se.hal.intf.HalSensorData;
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by Ziver on 2015-12-03.
|
|
||||||
*/
|
|
||||||
public class PowerConsumptionSensorData extends HalSensorData {
|
public class PowerConsumptionSensorData extends HalSensorData {
|
||||||
|
|
||||||
private double wattHours;
|
private double wattHours;
|
||||||
|
|
|
||||||
|
|
@ -24,9 +24,6 @@ package se.hal.struct.devicedata;
|
||||||
|
|
||||||
import se.hal.intf.HalEventData;
|
import se.hal.intf.HalEventData;
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by Ziver on 2015-05-07.
|
|
||||||
*/
|
|
||||||
public class SwitchEventData extends HalEventData {
|
public class SwitchEventData extends HalEventData {
|
||||||
|
|
||||||
private boolean enabled;
|
private boolean enabled;
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,6 @@ package se.hal.struct.devicedata;
|
||||||
|
|
||||||
import se.hal.intf.HalSensorData;
|
import se.hal.intf.HalSensorData;
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by Ziver on 2015-12-03.
|
|
||||||
*/
|
|
||||||
public class TemperatureSensorData extends HalSensorData {
|
public class TemperatureSensorData extends HalSensorData {
|
||||||
|
|
||||||
private double temperature;
|
private double temperature;
|
||||||
|
|
|
||||||
|
|
@ -30,9 +30,6 @@ import se.hal.intf.HalSpeechToText;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by Ziver on 2015-05-08.
|
|
||||||
*/
|
|
||||||
public class Sphinx4STTClient implements HalSpeechToText {
|
public class Sphinx4STTClient implements HalSpeechToText {
|
||||||
private LiveSpeechRecognizer recognizer;
|
private LiveSpeechRecognizer recognizer;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,9 +7,6 @@ import zutil.ui.Configurator.PreConfigurationActionListener;
|
||||||
|
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class DateTimeTrigger implements HalTrigger,Configurator.PostConfigurationActionListener {
|
public class DateTimeTrigger implements HalTrigger,Configurator.PostConfigurationActionListener {
|
||||||
|
|
||||||
@Configurator.Configurable("Minute (Cron format)")
|
@Configurator.Configurable("Minute (Cron format)")
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,6 @@ import java.sql.SQLException;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class EventTrigger extends DeviceTrigger{
|
public class EventTrigger extends DeviceTrigger{
|
||||||
private static final Logger logger = LogUtil.getLogger();
|
private static final Logger logger = LogUtil.getLogger();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -9,9 +9,6 @@ import java.sql.SQLException;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
import java.util.logging.Logger;
|
import java.util.logging.Logger;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class SensorTrigger extends DeviceTrigger{
|
public class SensorTrigger extends DeviceTrigger{
|
||||||
private static final Logger logger = LogUtil.getLogger();
|
private static final Logger logger = LogUtil.getLogger();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -4,9 +4,6 @@ import se.hal.intf.HalTrigger;
|
||||||
import zutil.Timer;
|
import zutil.Timer;
|
||||||
import zutil.ui.Configurator;
|
import zutil.ui.Configurator;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class TimerTrigger implements HalTrigger {
|
public class TimerTrigger implements HalTrigger {
|
||||||
|
|
||||||
@Configurator.Configurable("Countdown time (in seconds)")
|
@Configurator.Configurable("Countdown time (in seconds)")
|
||||||
|
|
|
||||||
|
|
@ -32,9 +32,6 @@ import se.hal.intf.HalTextToSpeech;
|
||||||
import javax.sound.sampled.AudioInputStream;
|
import javax.sound.sampled.AudioInputStream;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class MaryTTSLocalClient implements HalTextToSpeech {
|
public class MaryTTSLocalClient implements HalTextToSpeech {
|
||||||
private MaryInterface marytts;
|
private MaryInterface marytts;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,6 @@ import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.sql.Statement;
|
import java.sql.Statement;
|
||||||
|
|
||||||
/**
|
|
||||||
* Created by Ziver on 2016-08-22.
|
|
||||||
*/
|
|
||||||
public class DeviceDataSqlResult implements SQLResultHandler<HalDeviceData> {
|
public class DeviceDataSqlResult implements SQLResultHandler<HalDeviceData> {
|
||||||
|
|
||||||
private Class<? extends HalDeviceData> clazz;
|
private Class<? extends HalDeviceData> clazz;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue