I have some scripts that calculate the moonillumination/full moon/... and other stuff.
Some data is just a String (not a number).
Can I import these values by a plugin (data0/data1..)? I don't think so because everything must be a value...
Is there a possibility to add data that's not a number?
Or is there some simple api to add classes to meteohub itself?
Add user-defined values in meteohub (plugin of C-code)
Moderator: Mattk
-
- Platinum Boarder
- Posts: 873
- Joined: Fri Jan 25, 2008 6:27 pm
- Location: Isle of Skye, Scotland
Re:Add user-defined values in meteohub (plugin of C-code)
I assume you are aware that Meteohub already provides a "sensor" called "lunar"?Periklast wrote:I have some scripts that calculate the moonillumination/full moon/... and other stuff.
Some data is just a String (not a number).
Can I import these values by a plugin (data0/data1..)? I don't think so because everything must be a value...
That aside, yes data values need to be numeric, so to "record" your strings you'll need to devise some sort of index, then post data values using the relevant index in place of the string.
e.g. if you decide to call New Moon as 0 and Full Moon as 4, then to represent Full Moon you might have a plug-in record of
data0 400
(data values are scaled by 100, so 400 is used where you want to record 4).
In places where you used your data0 you could then have code that 'understood' that 4 => Full Moon.
Does that make sense?
Re:Add user-defined values in meteohub (plugin of C-code)
yes, that makes sense. I will try to do that in that way.
Thanks.
Thanks.