Open lshems opened 3 years ago
@lshems so basically like a "logging" window, right?
Yes, just force it over any other lcd commands.
It is for logging, but also for very simple user scripts, such as:
if getValue("input3")==-1024 then print("throttle off") end
it would just put a line on top of the screen and shift all others down on every pass.
So for this simple script, as soon as the condition becomes true, it would print the text on the first pass on the first line, shifting any other existing lines down, and keep doing that until the condition becomes false again.
But it would allow to create VERY simple script for people starting with LUA, that may encourage more people to start using LUA.
As a quick solution redirecting LUA print output to any file would be really great dev improvement. Now we have to debug using different code than in Companion. If companion supports firmware :) simple print with file output would be such a relief cause lcd error formating is kind of disaster. I'm using xpcall but with more data browsing on lcd is cumbersome.
Do understand I dont want to mix up things here. I was referring to use print() as an effective command piping the output to the lcd for use in simple user scripts. Not for debugging purposes.
It would indeed mean that we would need to have an alternative for the current print command pushing the output into the debug window in the simulator, where it gets mixed with the radio debug info. This should be done with io.stderr:write(message), which is meant exactly for that purpose: mix an error message in the standard C debug output.
The only thing you need extra, is to be able to define the standard error output to be a file rather than the debug window.
changed the title, as it seemd confusing. I suggest to open a new issue for the io.stderr:write(message) request.
logged a new suggestion #90
Make the PRINT command working on a dedicated screen
After every print command shift the lines down one row, and keep them in the 'print buffer'. Every line that 'falls off the screen" get's removed from the buffer.