Input-lirc-helper tool with automapping

problems with keyboard, lirc or evdev

Moderator: Moderator

User avatar
arj
Site Admin
Posts: 2316
Joined: Thu Dec 01, 2005 8:51 pm
Location: Denmark
Contact:

Postby arj » Thu Dec 28, 2006 11:29 am

Drawing is correct.

Here's how I would implement it using one array in pseudo code:

the array contains nodes of: [parent_id, keys]
keys is an array of: [id, binding]

code:

Code: Select all

conflict = false

for each node in nodes:
      parent_id = nodes[node.parent_id]
      for each key in node.keys:
            #check against all keys in current node
            for each key2 in node.keys:
                  if key2.node_id != key.node_id && key2.binding == key.binding:
                         conflict = true
             # recursively check parent
             while (parent_id != empty):
                  parent_node = nodes[parent_id]
                  for each key2 in parent_node.keys:
                      if key2.binding == key.binding:
                         conflict = true
                   parent_id = parent_node.parent_id

I'll implement it in C++ so that we have that check there also. Would be quite nice to have it both places in case one doesn't use your nice tool :)

User avatar
acmelabs
Overlord
Posts: 2365
Joined: Mon Feb 20, 2006 9:18 pm
Location: Germany
Contact:

Postby acmelabs » Thu Dec 28, 2006 3:59 pm

arj wrote:Drawing is correct.

Here's how I would implement it using one array in pseudo code:

the array contains nodes of: [parent_id, keys]
keys is an array of: [id, binding]

code:

Code: Select all

conflict = false

for each node in nodes:
      parent_id = nodes[node.parent_id]
      for each key in node.keys:
            #check against all keys in current node
            for each key2 in node.keys:
                  if key2.node_id != key.node_id && key2.binding == key.binding:
                         conflict = true
             # recursively check parent
             while (parent_id != empty):
                  parent_node = nodes[parent_id]
                  for each key2 in parent_node.keys:
                      if key2.binding == key.binding:
                         conflict = true
                   parent_id = parent_node.parent_id

I'll implement it in C++ so that we have that check there also. Would be quite nice to have it both places in case one doesn't use your nice tool :)

nice idea,
and what should happen, if a input-lirc-mapping does not pass the check? Warning? Abort? In my eyes, you'll force people to use my tool ;-)

Anyway, here's the full mms-module-dependencies graphic:
Image
original open-office-impress: http://mms.mymediasystem.net/mms-wiki/mms-module-dependencies-full.odp

In the first approach, I think, I will just add an additional condition-check for my graphical-mismatch. And then I will think about how I can realize your pseudo-code in perl. I've dig around a bit, and found such thinks like 'Classes' and 'structs', well - I'll see. Thanks very much for your help. I really appreciate it!

Regards,

Andreas

ps: will add now this graphic into our wiki


Return to “input”

Who is online

Users browsing this forum: No registered users and 1 guest