diff --git a/.gitignore b/.gitignore index 3206a9e..86f091d 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,49 @@ *.log sftp-config.json .remote-sync.json + +######################## +# sails +######################## +.sails +.waterline +.rigging +.tmp + + +######################## +# node.js / npm +######################## +lib-cov +*.seed +*.log +*.csv +*.dat +*.out +*.pid +*.gz + +pids +logs +results + +node_modules + +npm-debug.log + + +######################## +# misc / editors +######################## +*~ +*# +.DS_STORE +.netbeans +nbproject +.idea + + +######################## +# local config +######################## +config/local.js diff --git a/www/.tmp/public/favicon.ico b/www/.tmp/public/favicon.ico index 0092ec9..648ddb6 100644 Binary files a/www/.tmp/public/favicon.ico and b/www/.tmp/public/favicon.ico differ diff --git a/www/.tmp/public/js/ng/controller_config.js b/www/.tmp/public/js/ng/controller_config.js index ad8a752..12566bd 100644 --- a/www/.tmp/public/js/ng/controller_config.js +++ b/www/.tmp/public/js/ng/controller_config.js @@ -32,9 +32,18 @@ poconsole.controller('configCtrl', function($scope, Page, $log, config, devices) } config.submitParameter($scope.newParam); $scope.loadConfig(); + $scope.newParam.pEntry = ""; + $scope.newParam.val = ""; } }; + $scope.deleteParameter = function(id){ + var deleteParam = config.deleteParameter(id); + deleteParam.then(function(d){ + $scope.loadConfig(); + }); + }; + $scope.checkLogger = function(){ $scope.loggerLoading = true; var checkLoggerStatus = config.getLoggerStatus(); @@ -73,11 +82,19 @@ poconsole.controller('configCtrl', function($scope, Page, $log, config, devices) $scope.addDevice = function(dev){ var addDevice = devices.addDevice(dev); - getDevices.then(function(d){ + addDevice.then(function(d){ $scope.getDevices(); + $scope.newDevice.address = ""; }); }; + $scope.deleteDevice = function(id){ + var deleteDevice = devices.deleteDevice(id); + deleteDevice.then(function(d){ + $scope.getDevices(); + }); + }; + var getDeviceTypes = devices.getDeviceTypes(); getDeviceTypes.then(function(d){ $scope.device_types = d.device_types; diff --git a/www/.tmp/public/js/ng/controller_tags.js b/www/.tmp/public/js/ng/controller_tags.js index 49bbc7c..c7d3dd0 100644 --- a/www/.tmp/public/js/ng/controller_tags.js +++ b/www/.tmp/public/js/ng/controller_tags.js @@ -89,4 +89,8 @@ poconsole.controller('tagsCtrl', function($scope, $route, $http, $routeParams, P $scope.tags_to_plot = tags_to_plot.join(); }; + $scope.device_label = function(data_type_obj){ + return data_type_obj.address + " - " + data_type_obj.device_type.dType; + }; + }); diff --git a/www/.tmp/public/js/ng/factory_config.js b/www/.tmp/public/js/ng/factory_config.js index 34f8a83..a1abc40 100644 --- a/www/.tmp/public/js/ng/factory_config.js +++ b/www/.tmp/public/js/ng/factory_config.js @@ -11,27 +11,39 @@ poconsole.factory('config',function($q, $http, $log){ }; var submitParameter = function(entry){ + var deferred = $q.defer(); $http.post('/config', { parameter: entry.parameter, val: entry.val }).success(function(data){ - return data; + deferred.resolve({ + data:data + }); }); + return deferred.promise; }; var updateParameter = function(entry){ + var deferred = $q.defer(); $http.post('/config/update/' + entry.id, { parameter: entry.parameter, val: entry.val }).success(function(data){ - return data; + deferred.resolve({ + data:data + }); }); + return deferred.promise; }; var deleteParameter = function(id){ + var deferred = $q.defer(); $http.delete('/config/' + id).success(function(data){ - return data; + deferred.resolve({ + data:data + }); }); + return deferred.promise; }; var getLoggerStatus = function(){ diff --git a/www/.tmp/public/js/ng/factory_devices.js b/www/.tmp/public/js/ng/factory_devices.js index c9d2c42..e2395c1 100644 --- a/www/.tmp/public/js/ng/factory_devices.js +++ b/www/.tmp/public/js/ng/factory_devices.js @@ -21,21 +21,29 @@ poconsole.factory('devices', function($q, $http, $log){ var addDevice = function(d){ $log.info(d); + var deferred = $q.defer(); $http.post('/device/create', { address: d.address, device_type: d.device_type.id }).success(function(data){ - return data; + deferred.resolve({ + data:data + }); }); + return deferred.promise; }; var updateDevice = function(d){ + var deferred = $q.defer(); $http.post('/device/update/' + d.id, { address: d.address, device_type: d.device_type.id }).success(function(data){ - return data; + deferred.resolve({ + data:data + }); }); + return deferred.promise; }; var deleteDevice = function(id){ diff --git a/www/.tmp/public/jst.js b/www/.tmp/public/jst.js index d19218a..e54c4f7 100644 --- a/www/.tmp/public/jst.js +++ b/www/.tmp/public/jst.js @@ -4,7 +4,7 @@ this["JST"]["assets/templates/config.html"] = function(obj) { obj || (obj = {}); var __t, __p = '', __e = _.escape; with (obj) { -__p += '
\n\t
\n\t\t
\n\t\t\t

Loading Config...

\n\t\t\t\n\t\t
\n\t
\n
\n\n
\n\t
\n\t\t
\n\t\t\t
\n\t\t\t\t

Error Caught!

\n\t\t\t\t
{{message}}
\n\t\t\t\t\n\t\t\t
\n\t\t
\n\t
\n\n\t
\n\t\t
\n\t\t\t
\n\t\t\t\t

Logger Status:\n\t\t\t\t\tRunning\n\t\t\t\t\tNot Running\n\t\t\t\t

\n\t\t\t\t

\n\t\t\t\t\tChecking Logger Status...\n\t\t\t\t

\n\t\t\t\t \n\t\t\t
\n\t\t
\n\n\t\t
\n\t\t\t
\n\t\t\t\t

Devices

\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
IDAddressType
{{device.id}}{{device.address}}{{device.device_type.dType}}
\n\t\t\t
\n\n\t\t\t
\n\t\t\t\t

Configuration Parameters

\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
ParameterValue
{{param.parameter}}{{param.val}}
\n\t\t\t
\n\t\t
\n\t\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\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
AddressType
{{device.address}}{{device.device_type.dType}}
\n\t\t\t
\n\n\t\t\t
\n\t\t\t\t

Configuration Parameters

\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
ParameterValue
{{param.parameter}}{{param.val}}
\n\t\t\t
\n\t\t
\n\t\t
\n\t\t\t
\n\t\t\t\t

New Device

\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\n\t\t\t
\n\t\t\t\t

New Parameter

\n\t\t\t\t
\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\n\t\t\t\t\t
\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
\n\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t
\n\t\t
\n\t
\n
\n'; } return __p @@ -34,7 +34,7 @@ this["JST"]["assets/templates/tags.html"] = function(obj) { obj || (obj = {}); var __t, __p = '', __e = _.escape; with (obj) { -__p += '\n\n\n\n\n\n\n\n\n\n\n\n\n
\n\t
\n\t\t
\n\t\t\t

Loading Tags..

\n\t\t\t\n\t\t
\n\t
\n
\n\n
\n\t
\n\t\t
\n\t\t\t
\n\t\t\t\t

Error Caught!

\n\t\t\t\t
{{message}}
\n\t\t\t
\n\t\t
\n\t
\n\n\t
\n\t\t
\n\t\t\t
\n \n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
IDNameMin Expected ValueMax Expected ValueUnits
{{tag.id}}{{tag.name}} {{tag.minExpected}}{{tag.maxExpected}}{{tag.units}}
\n \n Compare Tags\n \n\t\t\t
\n\t\t
\n\t
\n
\n'; +__p += '\n\n\n\n\n\n\n\n\n\n\n\n\n
\n\t
\n\t\t
\n\t\t\t

Loading Tags..

\n\t\t\t\n\t\t
\n\t
\n
\n\n
\n\t
\n\t\t
\n\t\t\t
\n\t\t\t\t

Error Caught!

\n\t\t\t\t
{{message}}
\n\t\t\t
\n\t\t
\n\t
\n\n\t
\n\t\t
\n\t\t\t
\n \n\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n \n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
IDNameMin Expected ValueMax Expected ValueUnits
{{tag.id}}{{tag.name}} {{tag.minExpected}}{{tag.maxExpected}}{{tag.units}}
\n \n Compare Tags\n \n\t\t\t
\n\t\t
\n\t
\n
\n'; } return __p diff --git a/www/.tmp/public/templates/config.html b/www/.tmp/public/templates/config.html index 6f29b44..e05344c 100644 --- a/www/.tmp/public/templates/config.html +++ b/www/.tmp/public/templates/config.html @@ -39,17 +39,21 @@ - + + + - + + +
ID Address Type
{{device.id}} {{device.address}} {{device.device_type.dType}}
@@ -63,6 +67,8 @@ Parameter Value + + @@ -70,6 +76,8 @@ {{param.parameter}} {{param.val}} + + diff --git a/www/.tmp/public/templates/tags.html b/www/.tmp/public/templates/tags.html index 6e93f3e..c5a103f 100644 --- a/www/.tmp/public/templates/tags.html +++ b/www/.tmp/public/templates/tags.html @@ -81,7 +81,7 @@
- +
diff --git a/www/assets/favicon.ico b/www/assets/favicon.ico index 0092ec9..648ddb6 100644 Binary files a/www/assets/favicon.ico and b/www/assets/favicon.ico differ diff --git a/www/assets/js/ng/controller_config.js b/www/assets/js/ng/controller_config.js index ad8a752..12566bd 100644 --- a/www/assets/js/ng/controller_config.js +++ b/www/assets/js/ng/controller_config.js @@ -32,9 +32,18 @@ poconsole.controller('configCtrl', function($scope, Page, $log, config, devices) } config.submitParameter($scope.newParam); $scope.loadConfig(); + $scope.newParam.pEntry = ""; + $scope.newParam.val = ""; } }; + $scope.deleteParameter = function(id){ + var deleteParam = config.deleteParameter(id); + deleteParam.then(function(d){ + $scope.loadConfig(); + }); + }; + $scope.checkLogger = function(){ $scope.loggerLoading = true; var checkLoggerStatus = config.getLoggerStatus(); @@ -73,11 +82,19 @@ poconsole.controller('configCtrl', function($scope, Page, $log, config, devices) $scope.addDevice = function(dev){ var addDevice = devices.addDevice(dev); - getDevices.then(function(d){ + addDevice.then(function(d){ $scope.getDevices(); + $scope.newDevice.address = ""; }); }; + $scope.deleteDevice = function(id){ + var deleteDevice = devices.deleteDevice(id); + deleteDevice.then(function(d){ + $scope.getDevices(); + }); + }; + var getDeviceTypes = devices.getDeviceTypes(); getDeviceTypes.then(function(d){ $scope.device_types = d.device_types; diff --git a/www/assets/js/ng/controller_tags.js b/www/assets/js/ng/controller_tags.js index 49bbc7c..c7d3dd0 100644 --- a/www/assets/js/ng/controller_tags.js +++ b/www/assets/js/ng/controller_tags.js @@ -89,4 +89,8 @@ poconsole.controller('tagsCtrl', function($scope, $route, $http, $routeParams, P $scope.tags_to_plot = tags_to_plot.join(); }; + $scope.device_label = function(data_type_obj){ + return data_type_obj.address + " - " + data_type_obj.device_type.dType; + }; + }); diff --git a/www/assets/js/ng/factory_config.js b/www/assets/js/ng/factory_config.js index 34f8a83..a1abc40 100644 --- a/www/assets/js/ng/factory_config.js +++ b/www/assets/js/ng/factory_config.js @@ -11,27 +11,39 @@ poconsole.factory('config',function($q, $http, $log){ }; var submitParameter = function(entry){ + var deferred = $q.defer(); $http.post('/config', { parameter: entry.parameter, val: entry.val }).success(function(data){ - return data; + deferred.resolve({ + data:data + }); }); + return deferred.promise; }; var updateParameter = function(entry){ + var deferred = $q.defer(); $http.post('/config/update/' + entry.id, { parameter: entry.parameter, val: entry.val }).success(function(data){ - return data; + deferred.resolve({ + data:data + }); }); + return deferred.promise; }; var deleteParameter = function(id){ + var deferred = $q.defer(); $http.delete('/config/' + id).success(function(data){ - return data; + deferred.resolve({ + data:data + }); }); + return deferred.promise; }; var getLoggerStatus = function(){ diff --git a/www/assets/js/ng/factory_devices.js b/www/assets/js/ng/factory_devices.js index c9d2c42..e2395c1 100644 --- a/www/assets/js/ng/factory_devices.js +++ b/www/assets/js/ng/factory_devices.js @@ -21,21 +21,29 @@ poconsole.factory('devices', function($q, $http, $log){ var addDevice = function(d){ $log.info(d); + var deferred = $q.defer(); $http.post('/device/create', { address: d.address, device_type: d.device_type.id }).success(function(data){ - return data; + deferred.resolve({ + data:data + }); }); + return deferred.promise; }; var updateDevice = function(d){ + var deferred = $q.defer(); $http.post('/device/update/' + d.id, { address: d.address, device_type: d.device_type.id }).success(function(data){ - return data; + deferred.resolve({ + data:data + }); }); + return deferred.promise; }; var deleteDevice = function(id){ diff --git a/www/assets/templates/config.html b/www/assets/templates/config.html index 6f29b44..e05344c 100644 --- a/www/assets/templates/config.html +++ b/www/assets/templates/config.html @@ -39,17 +39,21 @@ - + + + - + + +
ID Address Type
{{device.id}} {{device.address}} {{device.device_type.dType}}
@@ -63,6 +67,8 @@ Parameter Value + + @@ -70,6 +76,8 @@ {{param.parameter}} {{param.val}} + + diff --git a/www/assets/templates/tags.html b/www/assets/templates/tags.html index 6e93f3e..c5a103f 100644 --- a/www/assets/templates/tags.html +++ b/www/assets/templates/tags.html @@ -81,7 +81,7 @@
- +