Modifs OSC

This commit is contained in:
tzim 2015-05-20 07:02:57 +00:00
parent cd540eca4e
commit dc2f54bcd2
3 changed files with 17 additions and 19 deletions

View file

@ -43,7 +43,7 @@ namespace DMX2
Fin
}
const int timeout = 200;
const int timeout = 1000;
// tampons Entrée/Sortie
public byte[] inputbuffer = new byte[532];

View file

@ -316,11 +316,14 @@ namespace DMX2
try {
while (running) {
recv = udpCli.Receive (ref remep);
Console.WriteLine(remep);
//Console.WriteLine(remep);
OSCMessage msg = new OSCMessage(recv);
Console.WriteLine(msg.Address);
#if DEBUG
Console.Write(msg.Address);
Console.Write(" ");
foreach(var arg in msg.Args)
Console.WriteLine(arg.GetString());
#endif
try{
ProcessMessage(msg,remep);
}catch{}
@ -502,7 +505,7 @@ namespace DMX2
break;
case "off":
if(!int.TryParse(toks[3],out dimId))return;
//if( msg.Args[0].GetInt() !=0)
if( msg.Args[0].GetInt() !=0)
if(univ.AllumageForce.Contains(dimId))
univ.AllumageForce.Remove(dimId);
break;
@ -540,13 +543,13 @@ namespace DMX2
int cirId;
if (!int.TryParse (toks [2], out cirId))
return;
//if (msg.Args [0].GetInt () != 0) {
if (msg.Args [0].GetInt () != 0) {
if (cirId > 0 && cirId <= Conduite.Courante.Circuits.Count) {
Circuit c = Conduite.Courante.Circuits [cirId - 1];
if (Conduite.Courante.CircuitTelecomande.Contains (c))
Conduite.Courante.CircuitTelecomande.Remove (c);
}
//}
}
}
break;
case "alloff":

View file

@ -67,7 +67,7 @@ control.modeFunc = function(p1){
if( control.regMode == "UNI")
lblMode.setValue("Mode : Univers n°"+control.regUniv);
control.reglValChange(reglval.value);
}
control.reglValChange = function(val){
@ -87,12 +87,7 @@ control.reglValChange = function(val){
control.btnRegl = function(id,val)
{
//if(val==0)return;
/*for(var i = 0;i<control.regPageCount;i++){
if(i!=id && mulButton.children[i].value !=0)
mulButton.children[i].setValue(0);
}*/
// reglval.setValue(0);
id = id + control.regPageCount *control.regPage +1;
if(val==0) onoff= "/off/";
else onoff="/on/";
@ -100,12 +95,12 @@ control.btnRegl = function(id,val)
if( control.regMode == "UNI")
{
var addr = "/universe/"+ control.regUniv + onoff + (id-1);
oscManager.sendOSC([addr,"f",val]);
oscManager.sendOSC([addr,"f",1]);
}
if( control.regMode == "CIR")
{
var addr = "/circuitTel" + onoff + (id);
oscManager.sendOSC([addr,"f",val]);
oscManager.sendOSC([addr,"f",1]);
}
control.reglmem[id]=val;
}
@ -147,7 +142,7 @@ oscManager.delegate = {
lblGoBack.setValue("Precedent : "+args[0]);
break;
case "/masterseq/time":
lblTime.setValue("T : "+args[0]);
lblTime.setValue("T : "+args[0].toFixed(1));
break;
default:
oscManager.processOSC(oscAddress, typetags, args);
@ -313,13 +308,13 @@ pages = [
"bounds": [.4,.3,.59,.58],
"rows" : 4, "columns" : 8,
"shouldLabel":"true",
"ontouchstart": "control.btnRegl(this.childID, this.value)",
"onvaluechange": "control.btnRegl(this.childID, this.value)",
"stroke":"#FFFFFF", "color":"#8888FF"
},
{
"name": "btnMulPlus", "type": "Button",
"bounds": [.325,.3,.05,.1],
"bounds": [.325,.78,.05,.1],
"mode": "momentary",
"ontouchstart":"control.pageUp()",
"label":"+"
@ -327,7 +322,7 @@ pages = [
{
"name": "btnMulMoins", "type": "Button",
"bounds": [.325,.78,.05,.1],
"bounds": [.325,.3,.05,.1],
"mode": "momentary",
"label":"-",
"ontouchstart":"control.pageDown()"