LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-01-2018, 04:25 PM   #1
bkelly
Member
 
Registered: Jan 2008
Distribution: Centos 7-4
Posts: 205

Rep: Reputation: 13
QTCreator, OpenGL, strip chart


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.

Thank you
 
Old 10-02-2018, 01:06 PM   #2
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,225

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
Definitely don't try to code the chart in OpenGL. I'd embed a web view and find a C++ charts library that renders to HTML and Javascript.

Last edited by dugan; 10-02-2018 at 02:11 PM.
 
Old 10-02-2018, 04:17 PM   #3
bkelly
Member
 
Registered: Jan 2008
Distribution: Centos 7-4
Posts: 205

Original Poster
Rep: Reputation: 13
Hello dugan,
I have been advised, instructed, to do exactly that. Why do you advise to not do that.
 
Old 10-02-2018, 04:48 PM   #4
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,225

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
Quote:
Originally Posted by bkelly View 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?

Last edited by dugan; 10-02-2018 at 04:55 PM.
 
Old 10-02-2018, 06:09 PM   #5
bkelly
Member
 
Registered: Jan 2008
Distribution: Centos 7-4
Posts: 205

Original Poster
Rep: Reputation: 13
That is a bit of a testy response. And it does not answer the question.
Why do you recommend against using OpenGL for a strip chart.
 
Old 10-02-2018, 06:22 PM   #6
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,225

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
Quote:
Originally Posted by bkelly View Post
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.

Last edited by dugan; 10-02-2018 at 06:35 PM.
 
Old 10-02-2018, 06:37 PM   #7
bkelly
Member
 
Registered: Jan 2008
Distribution: Centos 7-4
Posts: 205

Original Poster
Rep: Reputation: 13
You don't want to say why. So be it.

Anyone else?
 
Old 10-02-2018, 06:38 PM   #8
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,225

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
Quote:
Originally Posted by bkelly View Post
You don't want to say why. So be it.

Anyone else?
Of course not. Everyone else saw how you acted.
 
Old 10-02-2018, 06:41 PM   #9
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,225

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
Quote:
Originally Posted by dugan View Post
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.
Quote:
Originally Posted by bkelly View Post
You don't want to say why. So be it.
Well, that's not what I said, is it.

I meant what I said. The offer stands.

Last edited by dugan; 10-02-2018 at 06:52 PM.
 
Old 10-02-2018, 06:45 PM   #10
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,225

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
I'll give you a hint, bkelly:

The message you've clearly sent to everyone is that you're asking for homework help, and refusing to be honest about it even when asked.

Last edited by dugan; 10-02-2018 at 06:54 PM.
 
Old 10-02-2018, 07:24 PM   #11
astrogeek
Moderator
 
Registered: Oct 2008
Distribution: Slackware [64]-X.{0|1|2|37|-current} ::12<=X<=15, FreeBSD_12{.0|.1}
Posts: 6,264
Blog Entries: 24

Rep: Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195Reputation: 4195
All, let's try to stay on topic, please.

@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.
 
Old 10-03-2018, 09:43 AM   #12
bkelly
Member
 
Registered: Jan 2008
Distribution: Centos 7-4
Posts: 205

Original Poster
Rep: Reputation: 13
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
 
1 members found this post helpful.
Old 10-03-2018, 12:30 PM   #13
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,225

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
"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.

Last edited by dugan; 10-03-2018 at 12:40 PM.
 
1 members found this post helpful.
Old 10-03-2018, 03:11 PM   #14
bkelly
Member
 
Registered: Jan 2008
Distribution: Centos 7-4
Posts: 205

Original Poster
Rep: Reputation: 13
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.
 
Old 10-03-2018, 03:43 PM   #15
dugan
LQ Guru
 
Registered: Nov 2003
Location: Canada
Distribution: distro hopper
Posts: 11,225

Rep: Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320Reputation: 5320
Quote:
Originally Posted by bkelly View Post
Is there a way to give GL an array of pixels
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.

Last edited by dugan; 10-03-2018 at 03:48 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
URGENT: strip: Unable to recognise the format of the input file: doesn't strip any libraries c_kvasud Linux - Newbie 3 06-05-2017 07:27 PM
qtCreator build with Errors on Slackware antuanS Slackware 8 08-08-2015 06:53 AM
QtCreator - official vs maintainer packages displace Linux - Software 1 12-02-2014 06:59 AM
QtCreator and Kubuntu 11.10 John S. Maude Linux - Software 0 11-02-2011 04:46 AM
[SOLVED] How do I search and replace in QtCreator? MTK358 Linux - Software 1 08-02-2010 06:44 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 06:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration