PDA

View Full Version : Whatever happened to the remote control wizard?



haltux
November 14th, 2015, 04:47 PM
Hello,

I try to switch from Girder 5 to Girder 6, without success. I use USB-UIRT and I want to use Girder to control my PC with my remote control (which happened to be a Logitech Harmony but it does not matter). I could import my .GML from Girder 5.
But my problem is that I don't know how to use my remote control.USB-UIRT pluging works, I can see in the log that when I press "PLAY" it sends a signal to the console, "source; USB UIRT, message: some seqence of numbers". The problem is that my GML file is configured to send the play command when it gets the "PLAY" signal, and I find no way to associate the "PLAY" signal to the sequence of number which is sent by my remote when I press the "PLAY" key.

In girder 5, that was easy, there were a "remote control wizard" precisely for this purpose. But in Girder 6 I can't find how to do that.

Thanks for your help.

Regards,

Ron
November 16th, 2015, 07:48 AM
We had not put this back into G6 as it was a never ending source of confusion for people. I'll see if we can re-instate it but name it different. "Event Translator" comes to mind. That should help avoid the confusion.

Ron
November 16th, 2015, 01:03 PM
I think this conversion script will be enough to get you by. Girder 6 by itself can do 90% of what the Event Mapper in Girder 5 did. Simply run the script below in a Girder 6 scripting action on your Girder 5 default.xml file and import the resulting gml file.



local lom = require('lxp.lom') local io = require('io')
local table = require('table')


local inputFile = "C:\\Users\\ron\\AppData\\Roaming\\Promixis\\Girder \\5\\default.xml";
local outputFile = "C:\\Users\\ron\\AppData\\Roaming\\Promixis\\Girder \\5\\default.gml";



local f = io.open(inputFile)
if not f then
print("Could not open input file")
return
end


local of = io.open(outputFile, "w+");
if not of then
print("Could not open output file.")
return
end

-- read the whole file:
local xml = f:read("*a")
f:close()

local xmlTable, err = lom.parse(xml)
if not xmlTable then
print(err)
return
end

if xmlTable.tag ~= "Mapping" then
print("Not a Event Mapping file")
return
end


function randHex( l )


local str = ""

for i=1,l do
str = str .. string.format("%x", math.random(1,16))
end


return str

end


function createUUID()
return "{" .. randHex(8) .. "-" .. randHex(4) .. "-" .. randHex(4) .. "-" .. randHex(4) .. "-" .. randHex(12) .. "}"
end




of:write("<Girder Version=\"600\">\n")
of:write( string.format("<FileRoot FileGUID=\"%s\" Name=\"Event Mapper\">\n", createUUID()))


local id = 1


for _, device in ipairs(xmlTable) do


if device.tag == "Device" then


local enabled = ''
if device.attr["Enabled"] ~= "TRUE" then
enabled = " Enabled=\"0\"";
end

local deviceId = device.attr["DeviceID"]

of:write( string.format("\t<Group Name=%q Identifier=\"%d\"%s>\n", device.attr["Name"], id, enabled) )
id = id + 1

for _, map in ipairs( device ) do

if map.tag == "Map" then


local enabled = ''
if map.attr["Enabled"] ~= "TRUE" then
enabled = " Enabled=\"0\"";
end

of:write( string.format("\t\t<Command Name=%q %s Identifier=\"%d\">\n", map.attr["EventString"], enabled, id))
id = id + 1
of:write( string.format("\t\t\t<ActionType>4</ActionType>\n\t\t\t<ActionSubType>34</ActionSubType>\n\t\t\t<sValue1>local mod = 1\nif event and event.modifier > 0 then\n\tmod = event.modifier\nend\ngir.triggerEvent(%q, %d, mod)</sValue1>\n", map.attr["EventString"], deviceId))

for _, event in ipairs( map ) do

if event.tag == "Event" then

local enabled = ''
if event.attr["Enabled"] ~= "TRUE" then
enabled = " Enabled=\"0\"";
end

of:write( string.format("\t\t\t<EventString KeyMod=\"7\" Device=\"%d\" Name=%q Invert=\"0\" UseRegExp=\"0\" IrStr=%q AntiRepeat=\"0\" Identifier=\"%d\" %s/>\n", event.attr["EventDevice"], event.attr["EventString"], event.attr["EventString"], id, enabled ))
id = id + 1


end

end --EVENT

of:write( "\t\t</Command>\n" );

end

end -- MAP

of:write( "\t</Group>\n" );

end

end -- DEVICE


of:write( "</FileRoot>\n</Girder>");


of:close()


print(string.format("Conversion to GML DONE! Import %s into Girder", outputFile))


Adjust the file paths at the top to reflect your own installation and then import the generated file into Girder 6. I believe that should do the trick.