crystalfontz noob help

kwilhite

New member
I just got this project handed over to me and I have very little knowledge of the scripting that is used in these screens. I'm going to explain exactly what I am *trying* to accomplish as best as I can, but bare with me for I have yet to really wrap my hands around this.

I am trying to create a screen that reads off a text file that is a log of a chat room. This chat room is a function of a certain program that my company uses. The logs from the chat are stored in a directory (ex. C:\Program Files\Stuff\chatroom.log). I would like the screen to read off from that log file and display the text onto the LCD screen.

I am using a SolidLogic GS-LCD Fanless Mini-ITX System running the CrystalControl2 software. Any help, comments, or even criticisms would be appreciated. Thank you.
Looking for additional LCD resources? Check out our LCD blog for the latest developments in LCD technology.
 

reider

New member
This sounds very much like a text file reader we have. It reads the top four lines of a given textfile onto the screen of the LCD module. Change the four lines of the textfile, save it, and the LCD module reflects the new text. The text file reader is in an SDK which someone could probably amend to read the next four lines on depression of the `down` key perhaps. Alternatively, a timed scroll so its at reading pace. Though this would require changes to the plugin, beyond my scope. I only write front end screens-though I`m a beta tester. ;)

No doubt CF Admin/Tech will have a solution, pretty damn good at these things. Watch this space......

Reider
 

jc634

Administrator
A screen file is probably very doable, except more information is needed. Specifically:

- How many/which lines of data do you need to display?
- You mention "logs". How dynamic is the naming of the log files/how often do you add a new log file? Also, how often does the text change, etc.
- How long is each line of data? I *assume* that there is a CR/LF between lines of data.
- Answers to the above may generate more questions...

The first question is important as well as the 2nd. If you give us some insight in what you need to display and upload a log file, we may be able to provide a solution.

Oh, BTW, which LCD are you using!

JC
 

reider

New member
Its a 635 in a posh box ;) Thats how mine looks, but has an hardrive in the back of the case. jc has a point about the width of text, only a small screen on it really.

Reider
 

kwilhite

New member
- How many/which lines of data do you need to display?

The chat messages enter the log at the bottom line of the log every time one is made. If the message is larger than one column's worth of space on the LCD screen, than it should wrap around to the next. So, a minimal of 4 lines would be used.


- You mention "logs". How dynamic is the naming of the log files/how often do you add a new log file? Also, how often does the text change, etc.


To be exact, everyday the program creates a new chat log file. Ex: chatlog1213.log / chatlog1214.log / chatlog1215.log

The messages from the chat are entered into it as they come along.


- How long is each line of data? I *assume* that there is a CR/LF between lines of data.


Yes. There is a CR/LF at the end of each message.


- Answers to the above may generate more questions...


Your help will be greatly appreciated. :D
 
Last edited:

jc634

Administrator
CC2 uses simple scripts to tell CC2 what you want it to do. What I mean by simple, is that it is not dynamic in how to obtain data.

The screen file (which actually exists in this forum) would work perfectly for what you want, except....

Your program to generate the log files: how much control do you have over the information it generates?

Specifically, in order for CC2 to do its thing, you (your logging program) would need to create a file (static name), for example, "CC2_Chat.txt". As it adds information to its normal log file, it would need to read the last 4 lines of that file and overwrite everything in the CC2_Chat.txt file. CC2 would then be able to display each line of that file.

Is this possible? CC2 would not be capable of knowing how your logging program dynamically names log files, so unless you want to rewrite the CC2 screen file every morning... You know...

The screen file that I am thinking reads the 1st 4 lines of a text file. I assume that is possible to read the LAST 4 lines of a text file, but I am unsure of the Regex commands to do so, if they do exist.

JC
 

kwilhite

New member
CC2 uses simple scripts to tell CC2 what you want it to do. What I mean by simple, is that it is not dynamic in how to obtain data.

The screen file (which actually exists in this forum) would work perfectly for what you want, except....

Your program to generate the log files: how much control do you have over the information it generates?

Specifically, in order for CC2 to do its thing, you (your logging program) would need to create a file (static name), for example, "CC2_Chat.txt". As it adds information to its normal log file, it would need to read the last 4 lines of that file and overwrite everything in the CC2_Chat.txt file. CC2 would then be able to display each line of that file.

Is this possible? CC2 would not be capable of knowing how your logging program dynamically names log files, so unless you want to rewrite the CC2 screen file every morning... You know...

The screen file that I am thinking reads the 1st 4 lines of a text file. I assume that is possible to read the LAST 4 lines of a text file, but I am unsure of the Regex commands to do so, if they do exist.

JC
Which screen are you referring to?
 

jc634

Administrator
Edit the screen file and change all the options=10 (as per below) to options=0. This will make everything left justified with no scroll.

[r00]
options=10
[r00-i00]
id=@01

[r01]
options=10
[r01-i00]
id=@02

[r02]
options=10
[r02-i00]
id=@03

[r03]
options=10
[r03-i00]
id=@04

JC
 
Top