|
hari
|
 |
« on: February 09, 2009, 01:11:08 am » |
|
Hi Girls and Guys, I've written a small DataLogger plugin for the DCERouter. It is way not finished and only stores the value of co2 level change events for now: mysql> select PK_Datapoints,EK_Device,Description,timestamp,Datapoint,Unit from Datapoints,Unit where FK_Unit=PK_Unit order by timestamp desc limit 5; +---------------+-----------+-------------+---------------------+-----------+------+ | PK_Datapoints | EK_Device | Description | timestamp | Datapoint | Unit | +---------------+-----------+-------------+---------------------+-----------+------+ | 106 | 101 | CO2 level | 2009-02-09 01:07:42 | 410 | ppm | | 105 | 101 | CO2 level | 2009-02-09 01:06:42 | 416 | ppm | | 104 | 101 | CO2 level | 2009-02-09 01:05:42 | 417 | ppm | | 103 | 101 | CO2 level | 2009-02-09 01:04:42 | 419 | ppm | | 102 | 101 | CO2 level | 2009-02-09 01:03:42 | 411 | ppm | +---------------+-----------+-------------+---------------------+-----------+------+ 5 rows in set (0.00 sec)
DT is on schema, the code is in the 0810 branch, src/DataLogger_Plugin and src/lmce_datalog. best regards, Hari
|
|
|
|
|
Logged
|
|
|
|
|
maybeoneday
|
 |
« Reply #1 on: February 09, 2009, 03:01:14 am » |
|
Hari, nice.....wheres the sensor ? 419 | ppm !! cut down on the smoking  regards Ian
|
|
|
|
|
Logged
|
|
|
|
jondecker76
Alumni
wants to work for LinuxMCE

Posts: 763
|
 |
« Reply #2 on: February 09, 2009, 03:11:51 am » |
|
Hari -
very neat idea for a plugin. I deally you could set it up to log any command or event. I'll have to take a look at the source!
|
|
|
|
|
Logged
|
|
|
|
colinjones
Alumni
LinuxMCE God

Posts: 3003
|
 |
« Reply #3 on: February 09, 2009, 03:20:02 am » |
|
Hari -
very neat idea for a plugin. I deally you could set it up to log any command or event. I'll have to take a look at the source!
Indeed! I firealarm perhaps? I wonder if the CO2 concentrations during the early parts of a fire allow for positive discrimination?
|
|
|
|
|
Logged
|
|
|
|
darrenmason
Addicted

Posts: 529
|
 |
« Reply #4 on: February 09, 2009, 05:10:43 am » |
|
Fantastic idea Hari,
Couple of questions... 1. Is it possible to register the interceptor method multiple times for each of the specific Event types that you would like to log. I am just trying to work out how that part could be made configurable.
2. Do you think that it would be possible to have the message interceptor callback to not have code specific to each event type?
Well done.
Darren
|
|
|
|
|
Logged
|
|
|
|
|
hari
|
 |
« Reply #5 on: February 09, 2009, 10:37:48 pm » |
|
cut down on the smoking  lol.. wait, DIN allows for 1000ppm :-) br
|
|
|
|
|
Logged
|
|
|
|
|
hari
|
 |
« Reply #6 on: February 09, 2009, 10:38:30 pm » |
|
I'll have to take a look at the source!
at your own risk! Beware the dragon. It is in there..
|
|
|
|
|
Logged
|
|
|
|
|
hari
|
 |
« Reply #7 on: February 09, 2009, 10:43:02 pm » |
|
Fantastic idea Hari,
Couple of questions... 1. Is it possible to register the interceptor method multiple times for each of the specific Event types that you would like to log. I am just trying to work out how that part could be made configurable.
I just register an interceptor for all events: RegisterMsgInterceptor((MessageInterceptorFn)(&DataLogger_Plugin::ProcessEvent) ,0,0,0,0,MESSAGETYPE_EVENT,0); ProcessEvent() then looks at pMessage->m_dwID to switch() event types. 2. Do you think that it would be possible to have the message interceptor callback to not have code specific to each event type?
as each event has different event parameters I have no idea how to do some "generic" translation... br, Hari
|
|
|
|
|
Logged
|
|
|
|
|
maybeoneday
|
 |
« Reply #8 on: February 10, 2009, 11:35:22 am » |
|
Hari "lol.. wait, DIN allows for 1000ppm :-)"........does that allow for the popcorn to burn ocaisionally ?  Ian
|
|
|
|
|
Logged
|
|
|
|
bulek
Administrator
wants to work for LinuxMCE
    
Posts: 868
Living with LMCE
|
 |
« Reply #9 on: February 11, 2009, 12:21:38 pm » |
|
Fantastic idea Hari,
Couple of questions... 1. Is it possible to register the interceptor method multiple times for each of the specific Event types that you would like to log. I am just trying to work out how that part could be made configurable.
... Darren
I think it can be done by just sequence of register commands. HTH, regards, Bulek.
|
|
|
|
|
Logged
|
Thanks in advance,
regards,
Bulek.
|
|
|
darrenmason
Addicted

Posts: 529
|
 |
« Reply #10 on: February 11, 2009, 01:53:27 pm » |
|
That is what I thought... so in theory it could read events from the device data and register interceptor for each one.
|
|
|
|
|
Logged
|
|
|
|
|
hari
|
 |
« Reply #11 on: February 11, 2009, 09:02:11 pm » |
|
That is what I thought... so in theory it could read events from the device data and register interceptor for each one.
? I mean you still have to interpret the device data in code.. or do I miss something here?
|
|
|
|
« Last Edit: February 11, 2009, 09:40:12 pm by hari »
|
Logged
|
|
|
|
krys
Addicted

Posts: 583
|
 |
« Reply #12 on: February 11, 2009, 09:25:49 pm » |
|
now work on one that can log data from a ph meter and a water temp sensor and I can hook LMCE up to my saltwater aquarium  -Krys
|
|
|
|
|
Logged
|
|
|
|
|
hari
|
 |
« Reply #13 on: February 14, 2009, 05:17:09 pm » |
|
a few lines of php later..
|
|
|
|
|
Logged
|
|
|
|
|
totallymaxed
|
 |
« Reply #14 on: February 14, 2009, 08:46:52 pm » |
|
a few lines of php later..
Love it :-) Andrew
|
|
|
|
|
Logged
|
|
|
|
|