Skip to content

Commit

Permalink
Project setup
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Vach committed Jun 20, 2014
1 parent fdc4e84 commit 5b7e10a
Show file tree
Hide file tree
Showing 391 changed files with 139,950 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#.gitignore
/_project/*
/nbproject/*
106 changes: 106 additions & 0 deletions app/core/app.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
/**
* Application base
* @author Martin Vach
*/

//Define an angular module for our app
var angApp = angular.module('angApp', [
'ngRoute',
'appController',
'appFactory',
'appConfig'
]);

//Define Routing for app
angApp.config(['$routeProvider',
function($routeProvider) {
$routeProvider.
// Home
when('/', {
templateUrl: 'app/views/home/home.html'
}).
// Test
when('/test', {
templateUrl: 'app/views/test.html'
}).
// Controll
when('/controll/switch', {
templateUrl: 'app/views/controll/switch.html'
}).
when('/controll/dimmer', {
templateUrl: 'app/views/controll/dimmer.html'
}).
when('/controll/sensors', {
templateUrl: 'app/views/controll/sensors.html'
}).
when('/controll/meters', {
templateUrl: 'app/views/controll/meters.html'
}).
when('/controll/thermostat', {
templateUrl: 'app/views/controll/thermostat.html'
}).
when('/controll/locks', {
templateUrl: 'app/views/controll/locks.html'
}).
// Device
when('/device/status', {
templateUrl: 'app/views/device/status.html'
}).
when('/device/battery', {
templateUrl: 'app/views/device/battery.html'
}).
when('/device/type', {
templateUrl: 'app/views/device/type.html'
}).
when('/device/firmware', {
templateUrl: 'app/views/device/firmware.html'
}).
when('/device/security', {
templateUrl: 'app/views/device/security.html'
}).
// Config
when('/config/assoc', {
templateUrl: 'app/views/config/assoc.html'
}).
when('/config/wakeup', {
templateUrl: 'app/views/config/wakeup.html'
}).
when('/config/protection', {
templateUrl: 'app/views/config/protection.html'
}).
when('/config/configuration/:device_id?', {
templateUrl: 'app/views/config/configuration.html'
}).
// Network
when('/network/controll', {
templateUrl: 'app/views/network/controll.html'
}).
when('/network/routing', {
templateUrl: 'app/views/network/routing.html'
}).
when('/network/reorganization', {
templateUrl: 'app/views/network/reorganization.html'
}).
when('/network/statistics', {
templateUrl: 'app/views/network/statistics.html'
}).
// Expert
when('/expert/controller', {
templateUrl: 'app/views/expert/controller.html'
}).
when('/expert/commands', {
templateUrl: 'app/views/expert/commands.html'
}).
// Test
when('/detail/:phoneId', {
templateUrl: 'app/views/detail.html'
}).
when('/list', {
templateUrl: 'app/views/list.html'
}).
otherwise({
redirectTo: '/'
});
}]);


22 changes: 22 additions & 0 deletions app/core/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/**
* App configuration
* @author Martin Vach
*/

var config_module = angular.module('appConfig', []);
var config_data = {
'cfg': {
'app_name': 'Z-Wave',
'app_version': '0.1',
'user_field': 'USERXXXX',
'pass_field': 'PSWDXXXX',
'interval': 3000, // Set interval in miliseconds to refresh data
'server_url': 'http://192.168.10.167:8083', // Remote JSON
'update_url': '/ZWaveAPI/Data/', // Url for update (refresh data)
'store_url': '/ZWaveAPI/Run/' // Url for store data

}
};
angular.forEach(config_data,function(key,value) {
config_module.constant(value,key);
});
81 changes: 81 additions & 0 deletions app/core/controllers/_controllers.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
/**
* Application bcontrollers
* @author Martin Vach
*/
var appController = angular.module('appController', []);

// Home controller
appController.controller('HomeController', function($scope) {
$scope.add_ = function() {
$scope.message = 'The content comes here';
};
$scope.message = 'The content comes here';

});
appController.controller('ProductController', function($scope, $routeParams, $log,Phone) {
// $scope.list = function() {
// console.log($routeParams.phoneId);
// $scope.phones = Phone.all.query();
//
// };
// $scope.detail = function() {
// $scope.phoneee = Phone.find.get({phoneId: $routeParams.phoneId}, function(phoneee) {
// $scope.mainImageUrl = phoneee.images[0];
// });
// };

if($routeParams.phoneId){
$log.info('SomeCtrl - starting up, yeah!');
$scope.phoneee = Phone.find.get({phoneId: $routeParams.phoneId}, function(phoneee) {
$scope.mainImageUrl = phoneee.images[0];
});
}else{
$scope.phones = Phone.all.query();
}


// Phones.getPhones(function(results) {
// $scope.phones = results;
// });
//$scope.phones = Phones.getPhones();
// $scope.phoneee = Phone.get({phoneId: $routeParams.phoneId}, function(phoneee) {
// $scope.mainImageUrl = phoneee.images[0];
// });

$scope.orderProp = 'age';

});
appController.controller('ListController', function($scope, Phone) {

$scope.phones = Phone.query();

$scope.orderProp = 'age';

});
appController.controller('DetailController_', function($scope, $routeParams, Phone) {
$scope.phone = Phone.get({phoneId: $routeParams.phoneId}, function(phone) {
$scope.mainImageUrl = phone.images[0];
});
$scope.phoneId = $routeParams.phoneId;

$scope.message = 'This is DETAIL screen';

});


//angApp.controller('ListController', function($scope) {
//
// $scope.message = 'This is LIST screen';
//
//});



//vadesControllers.controller('PhoneListCtrl', ['$scope', '$http',
// function($scope, $http) {
// $http.get('phones/phones.json').success(function(data) {
// $scope.phones = data;
// });
//
// $scope.orderProp = 'age';
// }]);
Loading

0 comments on commit 5b7e10a

Please sign in to comment.