Subversion Repositories HomeAutomation

Rev

Blame | Last modification | View Log | SVN | RSS feed

  1.  
  2. function input(type, name, id)
  3. {
  4.     this.CanService(type, name, id);
  5.     this.myLastValue = new Array();
  6. }
  7.  
  8. extend(input, CanService);
  9.  
  10. input.prototype.myReportInterval = null;
  11. input.prototype.myLastValue = null;
  12.  
  13. input.prototype.canMessageHandler = function(canMessage)
  14. {
  15.     if (canMessage.getDirectionFlag() == "From_Owner")
  16.     {
  17.         switch (canMessage.getCommandName())
  18.         {
  19.         case "PinStatus":
  20.         //log(this.myName + ":" + this.myId + "> New value: " + canMessage.getData("Value") + "\n");
  21.         this.myLastValue[canMessage.getData("PinId")] = canMessage.getData("Status");
  22.         this.callEvent("newValue", canMessage.getData("PinId"));
  23.         break;
  24.         }
  25.     }
  26.    
  27.     this.CanService.prototype.canMessageHandler.call(this, canMessage);
  28. }
  29.  
  30. input.prototype.getValue = function(chnId)
  31. {
  32.     return this.myLastValue[chnId];
  33. }
  34.  
  35.  
  36.  
  37.  
  38.