ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I need to create a simple strip chart showing the values of one or a few parameters that are received as the application runs. Don't worry about acquiring the data, just displaying it. I will test with something like a sine function.
The environment is Linux with QT Creator and OpenGL. My searches have so far been unfruitful. I can write pretty good complex C++ procedural code (meaning very little experience with templates and the like) but am a novice at QT and have never used OpenGL.
I do not expect a tutorial here. If you have a favorite place that does present the concepts, please post.
I have been advised, instructed, to do exactly that.
Well you have just been advised and instructed not to. By me!
What is your relationship to the person who told you to use OpenGL, and why would you possibly listen to them over me, a person who obviously knows better? Are, they, for example, paying you? Do they determine your grade as a student?
That is a bit of a testy response. And it does not answer the question.
Answer the question? You mean like you just did?
If you do not actually give me a reason to change my answer, then the answer will not change.
If you want an answer to give to whoever "instructed" you to use OpenGL, then you tell me what your relationship to them is, and I will give you an answer that is appropriate for you to give to someone in that position.
If you want an answer to give to whoever "instructed" you to use OpenGL, then you tell me what your relationship to them is, and I will give you an answer that is appropriate for you to give to someone in that position.
@bkelly: It would be helpful if you could provide a little more information on your actual requirement - what you are trying to accomplish and any constraints on language or runtime environment.
You have stated QT Creator and OpenGL but not really indicated if that is a requirement or a suggestion.
Others may have different ideas about how to code a strip chart application and suggest alternatives for good reasons, but without a more complete picture of what you are trying to write, the discussion may easily go off track...
Please review the Site FAQ for guidance in posting complete questions and general forum usage.
Ok, some details. I work for the Air Force and we do a lot of telemetry work with aircraft. My last eight years were at an another Air Force Base where I processed all the data from missile shots. I configured the hardware to capture the data and wrote the software to do the decom, in Windows and Visual Studio. I completed my CS degree in the '80s, significantly older than most graduates. Now I am at another base and working another aspect of telemetry. Everything here is Linux based and I have never used Linux/Unix until now. The stuff here is ten times more complicated than my previous job, and I really mean that number ten. If you can see my email address it ends with @us.af.mil. ( Then again, I forget my email here. The government computers have very aggressive firewalls and often block the pages needed to establish an account. I might have used a personal account here to get started. If you really want to verify you can PM me and we can trade emails and see my at work address. And that is why I often post that I cannot copy paste from my work computer to my internet computer. Our working systems are completely isolated from the outside world.)
We need a utility that we can start up and look at telemetry parameters from multiple targets and various places in the system. The guy running the show, call him J, has so little time I don't see him ten minutes a day. He is the system architect and created the entire system. Now he works at a much higher abstraction, but is critical to this place. There are other things that go on and I don't need to bore you with it.
We use a system called IADS made by Symvionics for all of our displays. They do the strip charts and a whole flock of widgets to display aircraft parameters. A very impressive system for those that need that. However, their system requires significant TLC and we cannot just pop up a stripchart anywhere we want. J has stated we need that. We have few Linux people out here. I am willing to do the job, so I have that task. I am finding that Linux (in multiple flavors) is a really incredible OS, but just as incredibly difficult to learn.
We have a rather impressive software support system (meaning the software that moves the data from here to there and extracts information about the aircraft) and use QT Creator to provide status and control for our applications, quite distinct from the displays for telemetry data. One person does OpenGL and creates specialized displays for IADS, which runs under Windows. QT Creator is rather impressive, as is OpenGL. So J thinks that is the way to go. I flat don't know. However, from my very limited looking around, it may not be. If I provide good logic that it is not, J will accept that and we will do something different. But I need to line up my ducks first.
From my perspective, dugan's response: Well you have just been advised and instructed not to. By me! Is not appropriate for a forum environment. I'll not take the bait and argue with him. I am here to find out how and why.
As stated in the OP, I do not expect a tutorial here, rather some pointers as to where to look. Yes, I have searched and investigated a flock of web sites. I am finding very little on strip charts.
Edit: just checked my email and it was a personal account. Usually the problem is that our firewalls block some of the stuff for captcha validation. Now that I am already in I was able to change to my work email and get the validation message.
And I forgot to mention that the stripchart will be in C++. The distro is under my user name to the left.
Last edited by bkelly; 10-03-2018 at 10:12 AM.
Reason: more info
"It's an embedded system" is a perfectly good reason for OpenGL being a constraint. You could have just said that.
Well, as I'm sure you know, OpenGL's primitives are just vertices. You use OpenGL to tell the GPU whether the vertices are meant to be individual points, or parts of lines or triangles. You would be building up the chart that way. In your program's initialization, you would use OpenGL to set the GPU to use an orthographic projection, because you don't want perspective (things becoming smaller or bigger as they move along the Z dimension) and you want your drawing context to be a 2D canvas. Working only with OpenGL, you would be able to draw those shapes. And flat colors.
If you want anything more elaborate, you'd load them as textures and apply them to the quads that you draw as two triangles. Obviously, you'll need to draw text. For that, I've previously used ftgl. For more general images, you can (IIRC) load bitmaps using Qt (QImage/QPixmap) and convert them to a format that the GPU can use. Or you can use DevIL or SOIL, both of which are pretty popular for that.
Finally: know whether the IADS supports OpenGL 2 or 3. They're completely different. OpenGL 3 made it a goal to remove the parts of the API that the driver vendors had trouble supporting well.
All the computers I will be working on are PC type high end workstations or servers with several gigs of memory and plenty of drive space so I hesitate to call this embedded work.
The part I predict as being the most difficult is moving the chart. Every time interval all the points must move over some making way for the newest point. I don't know how much of that GL can do for me. Should there be an array of pixels with a head and tail pointer that move one pixel each time? Is there a way to give GL an array of pixels to display then tell it to move the entire display some amount to the left or right (or up or down)? There is probably another method I have yet to think of.
How much of the work can the display adapter do? And how much can GL know about that adapter? I will need to check and see if they have some GL enhancements or libraries.
Too many questions. Maybe someone can popup and say look here. The next few months will be interesting.
Yes. In 3D programming, that array of pixels is called a "texture".
2D programs (like game emulators) that render using OpenGL typically maintain one texture in memory, representing the current frame, and then draw on it as needed.
Quote:
then tell it to move the entire display some amount to the left or right (or up or down)?
If the "entire display" is two triangles with a texture on them, then you'd just move the vertexes.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.