2017-09-27 14:59:53 +13:00

21 lines
433 B
JavaScript

function Port(host,name,input,output,value,max,docs)
{
this.host = host;
this.name = name;
this.input = input;
this.output = output;
this.value = value;
this.max = max;
this.docs = docs;
this.write = function(value)
{
this.value = value;
var target = this.host.routes[this.name];
if(!target){ console.log("No output for",this.name); return; }
this.host.ports[target].write(this.value);
}
}