LCDInfo.com
http://forum.lcdinfo.com/

Plug-in Development Discussion - Text Reader
http://forum.lcdinfo.com/viewtopic.php?f=17&t=1013
Page 1 of 1

Author:  Syridian [ Sun Jan 23, 2005 4:00 ]
Post subject:  Plug-in Development Discussion - Text Reader

Welcome,

Just thought I would start the ball rolling on a development discussion about a Text Reader plug-in. I have a vision... And here it is.

While a test reader plugin itself probably shouldn't be a hard thing to do. What I think would make this plug-in really special is the ability to parse a text file for valuable information, and provide user configurable plug-in variables.

The way I see this working, (and I'm no programmer, so feel free to flame me ), is that The plugin itself loads some sort of configuration file which tells it how to parse the information, and what variables to assign it to. This would need to be loaded at startup, and I'm unsure as to how LCDinfo would handle this as the variable would need to be assigned within the plug-in before LCDinfo checks for plugin variables? (Henri, any idea's?) *Edit: OK, I just looked at the Starting a plug-in post Henri provided http://forum.lcdinfo.com/viewtopic.php?t=448, and I think there shouldn't be a problem with the config file, as there is space provided for Plug-in startup stuff... But... I could be wrong..

The idea is to start with something basic but utilising the concept above. This would open up the plugin for future expansion. Further parsing code could be added, allowing more complex information to be retrieved as more time can be devoted to the development.

Basic parsing code to start with could include:
Line (number)
Tab delimiting (Tab column number)
Comma delimiting (comma column number)
Text labels

In the future, things could be expanded to include:
Date/time lookups
XML tags

And anything else the LCDinfo community can think to add.

With the config file idea, it might also be possible to handle multiple text file handling from the same plugin instance with the config file grouping particular variables and parsing data with a particular file.

OK... Now for the reasons... A text reader plug-in with these features could be used to collect a wide variety of data, and could actually be used to replace the need for multiple plug-ins which basically do the same thing. Reading log files to provide firewall and secuity data, reading your IM client log files to show msgs from a specific contact. Reading any sort of log file can provide a great deal of information that currently isn't available on LCDinfo. Hmm... The possibilities are endless... Think of all of those plain text files on your computer, and what info is in them.... Ok OK... I'm getting a little excited about those possibilities... Thats why I'm a geek.

Anyway... Discuss, flame, invent, think outside the box.



The possibilities... Hmmm Amasing...

Hmmm geek.. yes...

Author:  MrBosco [ Mon Feb 07, 2005 21:06 ]
Post subject:  Text Reader..

Syridian -

You've hit the nail on the head with the functionality. I think a great starting point is the ability to pull a single line from a text file. I also like the XML idea - very much in keeping with LCDInfo's design approach.

As I mentioned in another thread, the work around I've come up with is to have my external program recreate the entire screen file. When I want to update the display, I have a script that stops and restarts LCDInfo.

It's an ugly work around, but it works!

MrB

Author:  Syridian [ Tue Feb 08, 2005 1:09 ]
Post subject: 

MrB,

Do you have much experiance with programming? Or is it only a script that creates the screen file?

We are always looking for new developers willing to help out, if you wish to lend us some of your expertise. ;)

Author:  MrBosco [ Fri Feb 11, 2005 17:59 ]
Post subject:  My programming skills are pretty weak...

Unfortunately, my programming skills stop at vbscript and a little VB.NET. Back in the day, I was a darn good FORTRAN and COBOL programmer, but that was a LONG time ago...

Thanks,

MrB

Author:  Syridian [ Sat Feb 12, 2005 1:16 ]
Post subject: 

Well then. ;) Time to pick up a beginners C++ book. ;) You'll certainly have the edge on me... I used to be a pretty ordinary Basic hack, back when I was a kid... But with the right book, and a bit of previous experience, I'm picking it up reasonably fast... Take a look at some of the source files, they are great at giving you an idea of how well you can understand C++. :)

Author:  zeus[x] [ Sun Feb 27, 2005 14:56 ]
Post subject: 

Still working on it?

Author:  Syridian [ Mon Feb 28, 2005 1:40 ]
Post subject: 

Course...

But well... Finding the time is the hard part. I work full time, 2 hours of each day is taken up in travelling to and from work... Anyway... you guys all know the drill. ;) It's a labour of love, that has to fit into a schedule... Excuses excuses.... ;)

Anyway. I'll get into it... eventually.. But I have actually written some code... not much... but some. ;)

Author:  MrBosco [ Fri Jun 17, 2005 1:58 ]
Post subject:  Any updates?

It's been a while since I checked in with the forum. Has there been any updates on the text reader function front?

LCDInfo has been running 24x7 for 4+ months now on my media server with no issues. Great, stable program, but I really need that text read function!!!

Thanks,

MrB

Author:  Rexxie [ Wed Jul 27, 2005 17:47 ]
Post subject: 

Hi there!

I started using LCDInfo about a year ago, and back then I requested a text file plugin. Well, a lot of time has passed since then and to my surprise I still don't see any text file reading plugins.

Found my VFD about a week ago, and decided to try and do something about this myself. I'm a very, very novice C++ programmer, although I've been programming PHP and some other scripting languages for a while now.

What would be really nice would be a better implementation of variables in the screenfiles. Passing along data to the plugins would be nice. Here's an example...

Currently, this is (afaik) basicly all you can do:
Code:
<item type="plugintext" x="1" y="1">
   <scrolltype>none</scrolltype>
   <textpos>left</textpos>
   <fieldsize>20</fieldsize>
   <varid>ReadText.ReadLine</varid>
   <refresh>500</refresh>
</item>


This is what I'd LIKE to be able to do:
Code:
<item type="plugintext" x="1" y="1">
   <scrolltype>none</scrolltype>
   <textpos>left</textpos>
   <fieldsize>20</fieldsize>
   <varid>ReadText.ReadLine</varid>
   <varparameters>F:\something\textfile.txt 57</varparameters>
   <refresh>500</refresh>
</item>


This would allow the user to easily configure the text reader to read from different text files on different lines, and in the future you'd also be able to specify which format the file was in (XML etc).

Is there any ideas how I might go about simulating this behaviour? Or does Henri or anyone else feel like trying to rewrite the plugins part a bit to allow parameters to be passed to the plugin?

Author:  Rexxie [ Sun Aug 21, 2005 10:47 ]
Post subject: 

Well, somehow my beloved VFD died a week ago, and it's hard to test this thing without a VFD :(

I managed to get quite far on the plugin.. So far it reads a specific line from a text file, or the last line if no specific line is given (useful for chat logs etc). It also handles linebreaks at the end of the file, so it doesn't read an empty line because of it.

I also made the XML part read the <parameter> tag, and all I needed it to do was pass this variable to the part which actually calls up the plugin to do it's stuff.

Unfortunately, I'm not too motivated to try and make it work when I don't have an LCD/VFD to test this on myself, so I'm going to have to try and get hold of one before I continue.

Author:  Rexxie [ Sun Nov 13, 2005 13:26 ]
Post subject: 

Well, the text plugin works now, partly.
It reads a specified line from a text file, or the last line if no line number is given.

Unfortunately, I am still having a hard time figuring out a way to make the screen files set the filename and line number to be read, which is pretty essential. Right now I have to compile it in.

If anyone has any bright ideas how to add parameters to the screen files, I'm listening. I managed to add a <parameters> field and set it to variables, I'm however having trouble making them unique per screen file.

Author:  Deadzone [ Fri Aug 04, 2006 15:15 ]
Post subject: 

Hello, im just wondering if anyone is still working on this? It seems it could be very useful..

Author:  _Lone_Wolf_ [ Sat Dec 16, 2006 17:52 ]
Post subject: 

I dont know, but I have been developing a little in the sysinfo plugin on my own, I can already show info of all the hard drives and the cpugraph now works much better etc.

I would like to help develop this plugin, if there was some source code where i could work it would be easier :)

Page 1 of 1 All times are UTC + 2 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/