|
From: <j-...@us...> - 2012-08-12 18:10:50
|
Revision: 943
http://openautomation.svn.sourceforge.net/openautomation/?rev=943&view=rev
Author: j-n-k
Date: 2012-08-12 18:10:44 +0000 (Sun, 12 Aug 2012)
Log Message:
-----------
knxdmxd: Minor bugfix and binary
Modified Paths:
--------------
tools/knxdmxd/knxdmxd
tools/knxdmxd/knxdmxd.conf
tools/knxdmxd/src/dmxsender.cc
tools/knxdmxd/src/dmxsender.h
tools/knxdmxd/src/knxdmxd.cc
Modified: tools/knxdmxd/knxdmxd
===================================================================
(Binary files differ)
Modified: tools/knxdmxd/knxdmxd.conf
===================================================================
--- tools/knxdmxd/knxdmxd.conf 2012-08-12 16:41:47 UTC (rev 942)
+++ tools/knxdmxd/knxdmxd.conf 2012-08-12 18:10:44 UTC (rev 943)
@@ -1,31 +1,40 @@
// CAUTION : never uses names starting with _ !!! These are used internally !
-{ "fixtures": [ // all fixture definitions
- { "name" : "Treppe", // name is optional, default is _f_<number>
- "channels" : [ // channel definition, dmx is mandatory, default name is _c_<number>
- { "name": "oben", "dmx" : "1.0", "knx" : "1/7/170" },
- { "name": "mitte", "knx" : "1/7/170", "dmx" : "1.1" },
- { "name": "unten", "knx" : "1/7/170", "dmx" : "1.2" }
- ],
- "fading" : { "knx" : "1/6/170", "time": 1 } // knx-like dimming: fading is calculated for 0-100%
- },
- { "name" : "Kueche",
- "channels" : [
- { "name": "R", "knx" : "1/7/141", "dmx" : "1.10" },
- { "name": "G", "knx" : "1/7/142", "dmx" : "1.11" },
- { "name": "B", "knx" : "1/7/143", "dmx" : "1.12" }
- ],
- "fading" : { "knx" : "1/6/141", "time": 3.0 }
- }
+{
+"channels" : [
+ { "name" : "treppe_01", "dmx" : "1.1" },
+ { "name" : "treppe_02", "dmx" : "1.2" },
+ { "name" : "treppe_03", "dmx" : "1.3" },
+ { "name" : "treppe_04", "dmx" : "1.4" },
+ { "name" : "treppe_05", "dmx" : "1.5" },
+ { "name" : "treppe_06", "dmx" : "1.6" },
+ { "name" : "treppe_07", "dmx" : "1.7" },
+ { "name" : "treppe_08", "dmx" : "1.8" },
+ { "name" : "treppe_09", "dmx" : "1.16" },
+ { "name" : "treppe_10", "dmx" : "1.17" },
+ { "name" : "treppe_11", "dmx" : "1.18" },
+ { "name" : "treppe_12", "dmx" : "1.19" },
+ { "name" : "treppe_13", "dmx" : "1.20" },
+ { "name" : "kueche_r", "dmx" : "1.40", "statusga" : "12/1/20"},
+ { "name" : "kueche_g", "dmx" : "1.41", "statusga" : "12/1/21"},
+ { "name" : "kueche_b", "dmx" : "1.42", "statusga" : "12/1/22"}
],
+"dimmers": [ // all dimmer definitions, name is optional (default is _d_<number>), knx-like dimming: fading is calculated for 0-100%
+ { "name" : "Treppe01", "channel" : "treppe_01", "ga" : "12/0/1", "fading" : 1, "fadingga" : "1/6/170" },
+ { "name" : "Treppe02", "channel" : "treppe_02", "ga" : "12/0/2", "fading" : 1, "fadingga" : "1/6/170" },
+ { "name" : "Treppe03", "channel" : "treppe_03", "ga" : "12/0/3", "fading" : 1, "fadingga" : "1/6/170" },
+ { "name" : "KuecheR", "channel" : "kueche_r", "ga" : "12/0/20" },
+ { "name" : "KuecheG", "channel" : "kueche_g", "ga" : "12/0/21" },
+ { "name" : "KuecheB", "channel" : "kueche_b", "ga" : "12/0/22" }
+],
"scenes": [ // all scene definitions
{ "name" : "Treppe_Full_On", // name is optional, default is _s_<number>
"trigger" : {
- "go" : { "knx" : "1/0/170", "value" : 1 }, // if value is omitted, scene is called on any value
+ "go" : { "knx" : "12/0/170", "value" : 1 }, // if value is omitted, scene is called on any value
},
- "channels" : [ // definition of each channel in scene
- { "fixture" : "Treppe", "channel" : "oben", "value" : 255 },
- { "fixture" : "Treppe", "channel" : "mitte", "value" : 255 },
- { "fixture" : "Treppe", "channel" : "unten", "value" : 255 }
+ "data" : [ // definition of each channel in scene
+ { "channel" : "treppe_01", "value" : 255 },
+ { "channel" : "treppe_02", "value" : 255 },
+ { "channel" : "treppe_03", "value" : 255 }
],
"fading" : { // all fading times used on scene call !
"in" : 1.0, // for increasing intensity
@@ -34,12 +43,12 @@
},
{ "name" : "Treppe_Blackout",
"trigger" : {
- "go" : { "knx" : "1/0/170", "value" : 0 },
+ "go" : { "knx" : "12/0/170", "value" : 0 },
},
- "channels" : [
- { "fixture" : "Treppe", "channel" : "oben", "value" : 0 },
- { "fixture" : "Treppe", "channel" : "mitte", "value" : 0 },
- { "fixture" : "Treppe", "channel" : "unten", "value" : 0 }
+ "data" : [
+ { "channel" : "treppe_01", "value" : 0 },
+ { "channel" : "treppe_02", "value" : 0 },
+ { "channel" : "treppe_03", "value" : 0 }
],
"fading" : {
"time" : 1 // used for in and out
@@ -48,51 +57,91 @@
],
"cuelists": [ // all cuelists
{ "name" : "Treppe Disco",
+ "priority" : 100,
+ "release_on_halt" : true,
"trigger" : {
"go" : { "knx" : "1/0/172", "value" : 1 },
- "halt" : { "knx" : "1/0/172", "value" : 0 }
+ "halt" : { "knx" : "1/0/172", "value" : 0 },
+ "direct" : { "knx" : "1/0/173" }, // direct call of a cue (first is 0)
},
"cues" : [ // cues are like scenes, just without individual triggers
- { "name" : "allesaus",
- "channels" : [
- { "fixture" : "Treppe", "channel" : "oben", "value" : 0 },
- { "fixture" : "Treppe", "channel" : "mitte", "value" : 0 },
- { "fixture" : "Treppe", "channel" : "unten", "value" : 0 }
+ { "name" : "start",
+ "data" : [
+ { "channel" : "treppe_01", "value" : 0 },
+ { "channel" : "treppe_02", "value" : 0 },
+ { "channel" : "treppe_03", "value" : 0 }
],
- "waittime" : 3, // only relevant for loops
+ "waittime" : 3.1, // only relevant for loops
+ "delay" : 5,
"fading" : { "time" : 3 }
},
- { "name" : "obenan",
- "channels" : [
- { "fixture" : "Treppe", "channel" : "oben", "value" : 0 },
- { "fixture" : "Treppe", "channel" : "mitte", "value" : 255 },
- { "fixture" : "Treppe", "channel" : "unten", "value" : 0 }
+ { "name" : "c1",
+ "data" : [
+ { "channel" : "treppe_01", "value" : 255 },
+ { "channel" : "treppe_02", "value" : 0 },
+ { "channel" : "treppe_03", "value" : 0 }
],
- "waittime" : 3,
+ "waittime" : 8.1,
"fading" : { "time" : 3 }
},
- { "name" : "beidean",
- "channels" : [
- { "fixture" : "Treppe", "channel" : "oben", "value" : 255 },
- { "fixture" : "Treppe", "channel" : "mitte", "value" : 255 },
- { "fixture" : "Treppe", "channel" : "unten", "value" : 0 }
+ { "name" : "c2",
+ "data" : [
+ { "channel" : "treppe_01", "value" : 0 },
+ { "channel" : "treppe_02", "value" : 255 },
+ { "channel" : "treppe_03", "value" : 0 }
],
- "waittime" : 3, // waittime start after calling previous cue !
+ "waittime" : 3.1, // waittime start after calling previous cue !
"fading" : { "time" : 3 }
},
- { "name" : "untenan",
- "channels" : [
- { "fixture" : "Treppe", "channel" : "oben", "value" : 255 },
- { "fixture" : "Treppe", "channel" : "mitte", "value" : 0 },
- { "fixture" : "Treppe", "channel" : "unten", "value" : 0 }
+ { "name" : "c3",
+ "data" : [
+ { "channel" : "treppe_01", "value" : 0 },
+ { "channel" : "treppe_02", "value" : 0 },
+ { "channel" : "treppe_03", "value" : 255 }
],
- "waittime" : 3,
+ "waittime" : 3.1, // waittime start after calling previous cue !
"fading" : { "time" : 3 }
},
- { "link" : "allesaus"
+ { "link" : "start"
}
-
]
+ },
+ { "name" : "KuecheFarbwechsler",
+ "trigger" : {
+ "go" : { "knx" : "1/0/131", "value" : 1 },
+ "halt" : { "knx" : "1/0/131", "value" : 0 }
+ },
+ "cues" : [ // cues are like scenes, just without individual triggers
+ { "name" : "step1",
+ "data" : [
+ { "channel" : "kueche_r", "value" : 255 },
+ { "channel" : "kueche_g", "value" : 0 },
+ { "channel" : "kueche_b", "value" : 0 }
+ ],
+ "waittime" : 10, // only relevant for loops
+ "fading" : { "time" : 10 },
+ },
+ { "name" : "step2",
+ "data" : [
+ { "channel" : "kueche_r", "value" : 0 },
+ { "channel" : "kueche_g", "value" : 255 },
+ { "channel" : "kueche_b", "value" : 0 }
+ ],
+ "waittime" : 10, // only relevant for loops
+ "fading" : { "time" : 10 },
+ },
+ { "name" : "step3",
+ "data" : [
+ { "channel" : "kueche_r", "value" : 0 },
+ { "channel" : "kueche_g", "value" : 0 },
+ { "channel" : "kueche_b", "value" : 255 }
+ ],
+ "waittime" : 10, // only relevant for loops
+ "fading" : { "time" : 10 },
+ },
+ { "link" : "step1"
+ }
+ ]
}
]
}
Modified: tools/knxdmxd/src/dmxsender.cc
===================================================================
--- tools/knxdmxd/src/dmxsender.cc 2012-08-12 16:41:47 UTC (rev 942)
+++ tools/knxdmxd/src/dmxsender.cc 2012-08-12 18:10:44 UTC (rev 943)
@@ -14,7 +14,9 @@
dmx_addr_t DMX::Address(const std::string addr) {
char universe;
int channel;
+ std::clog << "a " << addr << std::endl;
sscanf( (char*)addr.c_str(), "%d.%d", &universe, &channel);
+ std::clog << "b" << std::endl;
return (channel==-1) ? (universe+512) : ((universe << 9) + channel);
}
Modified: tools/knxdmxd/src/dmxsender.h
===================================================================
--- tools/knxdmxd/src/dmxsender.h 2012-08-12 16:41:47 UTC (rev 942)
+++ tools/knxdmxd/src/dmxsender.h 2012-08-12 18:10:44 UTC (rev 943)
@@ -66,7 +66,7 @@
};
char GetDMXChannel(int channel);
- static dmx_addr_t Address(const std::string s);
+ static dmx_addr_t Address(const std::string addr);
static ola::OlaCallbackClientWrapper& GetOLAClient() { return m_client; };
};
Modified: tools/knxdmxd/src/knxdmxd.cc
===================================================================
--- tools/knxdmxd/src/knxdmxd.cc 2012-08-12 16:41:47 UTC (rev 942)
+++ tools/knxdmxd/src/knxdmxd.cc 2012-08-12 18:10:44 UTC (rev 943)
@@ -376,18 +376,21 @@
for (int i = 0; i < in_length; i++) { // read all
struct json_object *element = json_object_array_get_idx(in_data, i);
struct json_object *name = json_object_object_get(element, "name");
+
std::string name_str =
(name) ? json_object_get_string(name) : "_f_" + t_to_string(i);
struct json_object *dmx = json_object_object_get(element, "dmx");
+
if (!dmx) {
std::clog << kLogInfo << "Skipping channel '" << name_str
<< " (missing dmx)" << std::endl;
continue;
}
- knxdmxd::dmx_addr_t dmx_addr(knxdmxd::DMX::Address(json_object_get_string(dmx)));
+ std::string s = json_object_get_string(dmx);
+
+ knxdmxd::dmx_addr_t dmx_addr(knxdmxd::DMX::Address(s));
sender.AddUniverse((char) (dmx_addr / 512));
channel_names.insert(std::pair<std::string, knxdmxd::dmx_addr_t> (name_str, dmx_addr));
-
std::clog << "Named DMX " << dmx_addr << " as " << name_str;
struct json_object *ga = json_object_object_get(element, "statusga");
if (!ga) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|