minmod + modifications majeures BDD

This commit is contained in:
xdrm-brackets 2016-07-19 00:31:13 +02:00
parent 0170415103
commit 9bc638df39
6 changed files with 765 additions and 648 deletions

File diff suppressed because it is too large Load Diff

View File

@ -103,7 +103,7 @@
"getById" "getById"
], ],
"state": [ "global_state": [
"getAll" "getAll"
], ],

View File

@ -380,7 +380,7 @@
/* [2] On récupère la liste des états /* [2] On récupère la liste des états
=========================================================*/ =========================================================*/
$statesReq = new Repo('state/getAll'); $statesReq = new Repo('global_state/getAll');
$states = ($statesReq->error==0) ? $statesReq->answer() : []; $states = ($statesReq->error==0) ? $statesReq->answer() : [];

View File

@ -6,9 +6,9 @@
use \manager\ManagerError; use \manager\ManagerError;
use \manager\repo\cluster as clusterRepo; use \manager\repo\cluster as clusterRepo;
class state extends parentRepo{ class global_state extends parentRepo{
protected static function table_name(){ static $table_name = 'state'; return $table_name; } protected static function table_name(){ static $table_name = 'global_state'; return $table_name; }
} }

View File

@ -3,4 +3,4 @@ var Chip;
Chip.prototype.getPin=function(a){if(parseInt(a)==a&&this.pin.hasOwnProperty(a))return this.pin[a]};Chip.prototype.getPins=function(){for(var a=[],b=0;b<this.pins.length;b++)a.push(this.getPin(this.pins[b]));return a}})();var LedInterface; Chip.prototype.getPin=function(a){if(parseInt(a)==a&&this.pin.hasOwnProperty(a))return this.pin[a]};Chip.prototype.getPins=function(){for(var a=[],b=0;b<this.pins.length;b++)a.push(this.getPin(this.pins[b]));return a}})();var LedInterface;
(function(){LedInterface=function(a,b){a instanceof Chip&&b instanceof Element&&(this.chip=a,this.container=b)};LedInterface.prototype={chip:this.chip,container:this.container};LedInterface.prototype.apply=function(){this.container.style.background="rgb("+this.chip.pin[0]+","+this.chip.pin[1]+","+this.chip.pin[2]+")"}})();var RelayInterface; (function(){LedInterface=function(a,b){a instanceof Chip&&b instanceof Element&&(this.chip=a,this.container=b)};LedInterface.prototype={chip:this.chip,container:this.container};LedInterface.prototype.apply=function(){this.container.style.background="rgb("+this.chip.pin[0]+","+this.chip.pin[1]+","+this.chip.pin[2]+")"}})();var RelayInterface;
(function(){RelayInterface=function(a,b){a instanceof Chip&&b instanceof Element&&(this.chip=a,this.container=b)};RelayInterface.prototype={chip:this.chip,container:this.container};RelayInterface.prototype.apply=function(){this.chip.pin[0]?this.container.addClass("active"):this.container.remClass("active")}})();var previous,action; (function(){RelayInterface=function(a,b){a instanceof Chip&&b instanceof Element&&(this.chip=a,this.container=b)};RelayInterface.prototype={chip:this.chip,container:this.container};RelayInterface.prototype.apply=function(){this.chip.pin[0]?this.container.addClass("active"):this.container.remClass("active")}})();var previous,action;
(function(){previous=function(a,b){a=a.toLowerCase();for(var c=0;c<a.length;c++)if("x"!=a[c]&&a[c]!=b[c])return!1;return!0};action=function(a,b){a=a.toLowerCase();for(var c=0;c<a.length;c++)"x"!=a[c]&&(isNaN(a[c])||(b[c]=parseInt(a[c])))}})(); (function(){previous=function(a,b){a=a.toLowerCase();for(var c=0;c<a.length;c++)if("x"!=a[c]&&a[c]!=b[c])return!1;return!0};action=function(a,b){a=a.toLowerCase();for(var c=0;c<a.length;c++)"x"!=a[c]&&(b[c]=parseInt(a[c]))}})();

View File

@ -245,7 +245,7 @@ var action;
for( var i = 0 ; i < action.length ; i++ ) for( var i = 0 ; i < action.length ; i++ )
if( action[i] == 'x' ) continue; if( action[i] == 'x' ) continue;
else if( !isNaN(action[i]) ) state[i] = parseInt(action[i]); else state[i] = parseInt(action[i]);
}; };
})(); })();