minmod + modifications majeures BDD
This commit is contained in:
parent
b9e5a0563b
commit
f1678ccdf6
|
@ -103,7 +103,7 @@
|
||||||
"getById"
|
"getById"
|
||||||
],
|
],
|
||||||
|
|
||||||
"state": [
|
"global_state": [
|
||||||
"getAll"
|
"getAll"
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|
|
@ -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() : [];
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -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; }
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
|
@ -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]))}})();
|
||||||
|
|
|
@ -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]);
|
||||||
};
|
};
|
||||||
|
|
||||||
})();
|
})();
|
||||||
|
|
Loading…
Reference in New Issue