2 Replies - 3352 Views - Last Post: 08 June 2010 - 01:36 AM Rate Topic: -----

#1 yarok  Icon User is offline

  • New D.I.C Head

Reputation: 4
  • View blog
  • Posts: 12
  • Joined: 11-January 10

Loading a LUT (Look Up Table) in C#

Posted 06 June 2010 - 06:11 AM

Hey all!
I want to be able to load a LUT (Look Up Table) in my windows form.
The aim is this:
I have a robot communicating with my form, and I want to give the robot different orders based on it's sensors.
In order to do this I need to implement several LUTs, each one representing one sensor and one wheel of the robot.
Do you have any idea How to implement it?

One option that I am trying to do is to load a .csv file, and using switch-case drilling down to the connections I need.

I would be grateful for any insight or help on this matter,
Yarok

Is This A Good Question/Topic? 0
  • +

Replies To: Loading a LUT (Look Up Table) in C#

#2 Momerath  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1010
  • View blog
  • Posts: 2,444
  • Joined: 04-October 09

Re: Loading a LUT (Look Up Table) in C#

Posted 06 June 2010 - 10:23 AM

Dictionary<> makes a good lookup object, since that's what it is for. But, your problem statement isn't very clear on what you are really doing and there may be better methods to accomplish your goal.
Was This Post Helpful? 1
  • +
  • -

#3 yarok  Icon User is offline

  • New D.I.C Head

Reputation: 4
  • View blog
  • Posts: 12
  • Joined: 11-January 10

Re: Loading a LUT (Look Up Table) in C#

Posted 08 June 2010 - 01:36 AM

View PostMomerath, on 06 June 2010 - 09:23 AM, said:

Dictionary<> makes a good lookup object, since that's what it is for. But, your problem statement isn't very clear on what you are really doing and there may be better methods to accomplish your goal.


Thanks for the tip, I will look into it.
I'll try to explain myself, and what I'm trying to accomplish:
I'm building a GUI which is an interface for a robot, it has two sensors, and two powered wheels.
The user should be able to load a LUT, that will "convert" the data from the sensor/s to commands for each wheel, meaning that it has to be a dynamic LUT (dynamic runtime LUT? I'm not sure about the correct terminology, the thing is that the user loads the table after getting the GUI).

example -
for the left sensor:
read 5, turn right wheel at 15 rpm
read 6, turn right wheel at 14 rpm
read 7, turn right wheel at 21 rpm
...

and so on, with the right sensor as well...


the reason I want to do it with a LUT is that I have 1023 (10 bits) different values for each sensor,
and I want to be able to give commands to both wheels or either one based on the sensors readings.

I hope this explanation is better, if not let me know and I'll try again.
Is Dictionary<> still the best way to implement it?
If so, what is the best way to load it into the program? I saw that there is a load file dialog component, is that the way to go? I will try it, but if you have some tip or advice about how to use it, Please let me know.

thank you for your time,
yarok
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1