but then again, these are in debug methods so performance is probably not an issue. :-)

* in gsdcommand() I'm not sure what the return value will be when the case statement hit's one of the when statements that don't have a block. For example, what will be returned when @gsdcommand is 'REPORT ONLY ON PULSE'? You might need an extra return statement at the bottom of the method.

* Sometimes the really long cases can be replaced with a hash lookup. For example, in gsdcommand, you may want to play with something like:

but then again, these are in debug methods so performance is probably not an issue. :-)

* in gsdcommand() I'm not sure what the return value will be when the case statement hit's one of the when statements that don't have a block. For example, what will be returned when @gsdcommand is 'REPORT ONLY ON PULSE'? You might need an extra return statement at the bottom of the method.

* Sometimes the really long cases can be replaced with a hash lookup. For example, in gsdcommand, you may want to play with something like:

Hello and Thanks for the review!This is my SECOND attempt in ERb and I'm still learning the language..

RDOC style Comments: Don't know that yet. will look into it(I have a book on it, but haven't read that chapter yet)Naming Conventions:I wasn't aware of that: Ruby's naming conventions are based on the first character..Yes, I know a few methods are a bit high on the line count half of those lines are logging and comments. (which can be taken out)regarding my log():ok, I originally wrote the log() routine when I started ruby..I ran into problems displaying XML in the log.Then, later, I ran into problems displaying Object.inspect in the log..out of much frustration, that is what I ended up with, and as long as it worked (ie displayed what I needed it to) I left it.ERb (at least in linuxmce) doesn't like displaying <object>. I tries to parse it.Even in the code window, when you want to make a String='<?xml version="1.0"?>', when you save it, you get String=''The debug calls are just them. debug. they can be removed.

That's an interesting way to use a hash! I like that!As far as that long case statement.. Yeah, I should add a return at the end.Most of those functions aren't needed.. but I copied them in from the specs, so they won't hurt.

I've been using Ruby for about 2-3 months now.. Nice to see some feedback!

Regards,

Dan

Logged

The only intuitive interface is the nipple. After that it's all learned.My other computer is your windows box. I'm out of my mind. Back in 5 minutes.Q: What's Red and smells like blue paint?

Ah well.. So, instead of throwing it all away, I've added a threaded flag to the command object.If this flag is NOT set, it will force the routines to wait for a response to that command.

Interestingly enough, it wasn't that hard to do.. and as a side benifit, commands going the other way are not impeded.. ie, switching on a light switch will make it to DCE (and hence the floorplan) whether threading is suspended or not.

In other words, the Threading Suspension is only 1 way: DCE to GSD.

Still have a few things to iron out, but I will post new code soon.

Best Regards,

Dan

Logged

The only intuitive interface is the nipple. After that it's all learned.My other computer is your windows box. I'm out of my mind. Back in 5 minutes.Q: What's Red and smells like blue paint?

regarding my log():ok, I originally wrote the log() routine when I started ruby..I ran into problems displaying XML in the log.Then, later, I ran into problems displaying Object.inspect in the log..out of much frustration, that is what I ended up with, and as long as it worked (ie displayed what I needed it to) I left it.ERb (at least in linuxmce) doesn't like displaying <object>. I tries to parse it.Even in the code window, when you want to make a String='<?xml version="1.0"?>', when you save it, you get String=''The debug calls are just them. debug. they can be removed.

first great thanks for great work. I'm really interested in this one. I have something similar, but done as external driver in Perl, so I'm thinking about moving it to Ruby - but my Ruby knowledge is nearly nonexistent, so don't know if this migration would be easy.

- does anyone know of any source how to learn Ruby and your code efficiently ?

- do you have an option to respond to events also - since you use threads, does this mean you can start something that is continuosly running (I'm interested in this, cause I also try to implement other things for my home automation system - integration of scenes, speech announcements, etc..) ?

- under what licence do you plan to release the code ?

- what steps are needed to customize code to some other protocols (I need UDP connection to my system) ?

- this is really interesting idea - to have common skeleton on LMCE's side and just change modules for each separate protocol on top of that...

first great thanks for great work. I'm really interested in this one. I have something similar, but done as external driver in Perl, so I'm thinking about moving it to Ruby - but my Ruby knowledge is nearly nonexistent, so don't know if this migration would be easy.

- does anyone know of any source how to learn Ruby and your code efficiently ?

- do you have an option to respond to events also - since you use threads, does this mean you can start something that is continuosly running (I'm interested in this, cause I also try to implement other things for my home automation system - integration of scenes, speech announcements, etc..) ?

- under what licence do you plan to release the code ?

- what steps are needed to customize code to some other protocols (I need UDP connection to my system) ?

- this is really interesting idea - to have common skeleton on LMCE's side and just change modules for each separate protocol on top of that...

Thanks in advance for any opinions ,

regards,

Bulek.

Bulek,Thanks for the response! (I love hearing feedback)

Regarding your questions: (I'll try to answer them)

I just googled Ruby... learned by trial and error.. Because Ruby is an interpreted language, you can always test in irb.

I'm not sure I know what you mean by responding to events...My code does NOT use threads (as they exist..) I basically created a 'kernel' that allows each 'command' object to be handled seperately from other 'command' objects.

That said, if you want to respond to a DCE Event, not a problem. an Event is a message, just like a command, just like gsd data coming in, just like gsd data going out..

I pass ALL data IN/OUT (to and from DCE and GSD) to my 'protocolObject' class..It's up the that class to either ACCEPT the data or REJECT the data..

Take a closer look at the remarks in the PLCBUS class... you'll see what I mean.

Under what license do I plan to release the code!?? I firmly believe in GPL.

What steps are needed to customize the code: Create a new protocol object class, and implement the required methods. That's it.

It is designed to be DROP IN replaceable.

HTH,

Dan

Logged

The only intuitive interface is the nipple. After that it's all learned.My other computer is your windows box. I'm out of my mind. Back in 5 minutes.Q: What's Red and smells like blue paint?

I develop on Perl more than 6 years. Recently I created a GSD interface with Ruby. So, I can say that Ruby is very close to Perl. Except Ruby is typified language. IMHO the porting application from Perl to Ruby shouldn't be a big deal. Except you use a lot of Perl modules