[C++/Qt] Project Guidance

  • (4 Pages)
  • +
  • 1
  • 2
  • 3
  • Last »

47 Replies - 1903 Views - Last Post: 27 November 2018 - 09:59 AM Rate Topic: -----

#1 dreadstarx   User is offline

  • New D.I.C Head

Reputation: -3
  • View blog
  • Posts: 30
  • Joined: 09-November 18

[C++/Qt] Project Guidance

Posted 09 November 2018 - 12:18 PM

Hey Guys/Gals!

I'm new here, found this place by accident while Googling for some information. I'd like to state that the Project I'm working on is for my company I work for, it's not an assigned project nor am I getting paid for it. I came up with this project as a way to increase Contractor efficiency and add it to my resume. I'm fairly new to Qt/C++ but I've been messing around with it since 1998, when I got my first computer. It's been a, uh, bumpy ride, haha. No Lawsuits, Jail Time, or Handcuffs, so have faith in me :)

Since this project has proprietary information in it, and internal corporate info, I'll be as accurate but generic as possible. I need guidance on how to achieve what I want, and the best way to do it. What I don't want is the exact answer, or people to ask for code. Once I have it working, I'm going to gut a portion of it, and post it for public use. Part of the Licensing requirements for some of the executables I'm using.

So, let me explain the project.

I came up with the idea to use OCR (Optical Character Recognition) to scan the output on my screen, and convert it to text. Why? Because the tool I use (Laptop to Server KVM) doesn't allow for copy and pasting from the server to my laptop. It's crappy, and garbage but there's nothing I can do about it unless I'm converted to Full Time. I couldn't figure out how tesseract-ocr could view output from my application directly, so I came up with a scrolling screenshot, and then it'll decipher from the screenshot.

There are some things I don't know how to do exactly. We have an internal toolbar that Data Center Operations uses, it's a GUI Copy/Paste that allows for multiple buttons to be added with command snippets in them. I need to know how to target that button activation on any of the buttons in the list, and activate the screenshot scrolling code. I also need to know how to target, and attach my application to the side of this kvm software window. If I move the window, it moves the application.

I'd probably have better luck Googling if I knew the proper terminology for what I'm trying to do. If you can provide that first, I'll see what I can dig up on my own, and then I'll come back when I have more questions. Below is the picture of the KVM Software.

Attached Image

Is This A Good Question/Topic? 0
  • +

Replies To: [C++/Qt] Project Guidance

#2 modi123_1   User is offline

  • Suitor #2
  • member icon



Reputation: 14581
  • View blog
  • Posts: 58,445
  • Joined: 12-June 08

Re: [C++/Qt] Project Guidance

Posted 09 November 2018 - 01:17 PM

I am not understanding. I get there's some element of a screen shot and OCR, but what is being read? A terminal? Some app?
Was This Post Helpful? 0
  • +
  • -

#3 Skydiver   User is offline

  • Code herder
  • member icon

Reputation: 6565
  • View blog
  • Posts: 22,530
  • Joined: 05-May 12

Re: [C++/Qt] Project Guidance

Posted 09 November 2018 - 01:59 PM

Supposedly the Crash Cart Adapter software can capture the whole screen:

Quote

take screenshots and scale the display window to full-screen mode or smaller, without scroll bars.


Why do you need a scrolling window over the the entire server to capture (and presumably stitch together) parts of the display window?

Once you have the whole display screenshot, just feed it into your OCR. It shouldn't be any different than feeding a faxed in TIFF, or a scanned in JPEG to extract the text.

Anyway, to do any of the window manipulation and button pressing that you want to do, it'll depend on what OS your laptop is running. From the screenshot above, it looks like Windows. If it's Windows you'll need to send Windows window move messages, and button click messages to the appropriate places.
Was This Post Helpful? 0
  • +
  • -

#4 snoopy11   User is offline

  • Engineering ● Software
  • member icon

Reputation: 1554
  • View blog
  • Posts: 4,930
  • Joined: 20-March 10

Re: [C++/Qt] Project Guidance

Posted 09 November 2018 - 11:16 PM

Let me get this straight you are a 'contractor' that has certain restrictions in place ie 'copying and pasting',

and you want us to help you make a program that gets around this restriction by helping you make a program in Qt that screenshots whatever it is you are working on and uses OCR to convert the text from the screenshot into readable text ie a text file??

Is that wise??
You're breaking your contract in doing this, do you like working there?
Was This Post Helpful? 1
  • +
  • -

#5 Salem_c   User is online

  • void main'ers are DOOMED
  • member icon

Reputation: 2258
  • View blog
  • Posts: 4,347
  • Joined: 30-May 10

Re: [C++/Qt] Project Guidance

Posted 10 November 2018 - 02:59 AM

snoopy11 seems on track.
I got to the end of the OP's post and thought 'automated IP theft' (re: internal corporate info).

> It's been a, uh, bumpy ride, haha. No Lawsuits, Jail Time, or Handcuffs, so have faith in me
So you're just going to keep rolling the dice until officer Dibble shows up?
Was This Post Helpful? 0
  • +
  • -

#6 dreadstarx   User is offline

  • New D.I.C Head

Reputation: -3
  • View blog
  • Posts: 30
  • Joined: 09-November 18

Re: [C++/Qt] Project Guidance

Posted 10 November 2018 - 10:58 AM

View Postmodi123_1, on 09 November 2018 - 01:17 PM, said:

I am not understanding. I get there's some element of a screen shot and OCR, but what is being read? A terminal? Some app?


Now that I'm able to sit down and actually type a thought out response, and I've had some coffee. Let me try and explain this a little better.

The screenshot I showed at the bottom of my original post, was to show you what I was working with as a viewing range. The information I want to scan is in the box at the center of the application. I'll be taking a screen capture of that window, and following it down until it stops. At that point, it'll save the png/jpeg to a directory "Screenshots" with the usual date, time, etc. After that, OCR will kick in, and translate the image. Granted I don't think I can get it to re-produce is exactly, so I know there'll have to be some ingenuity to this.


View Postsnoopy11, on 09 November 2018 - 11:16 PM, said:

Let me get this straight you are a 'contractor' that has certain restrictions in place ie 'copying and pasting',

and you want us to help you make a program that gets around this restriction by helping you make a program in Qt that screenshots whatever it is you are working on and uses OCR to convert the text from the screenshot into readable text ie a text file??

Is that wise??
You're breaking your contract in doing this, do you like working there?

Yes, I'm a contract. Yes, that's what I'm wanting, however, you don't seem to fully understand that I can take a normal screen capture, piece it together myself, and post this information in the god damn ticket. It's just time consuming when you have to piece 40+ images together, and pray to god you didn't miss one or your SOL. I realize now I didn't explain it fully, that's my fault for being too busy at work trying to fix servers with no logs of the problem but dirty reboot anyways. I'll explain a bit more at the bottom.

View PostSalem_c, on 10 November 2018 - 02:59 AM, said:

snoopy11 seems on track.
I got to the end of the OP's post and thought 'automated IP theft' (re: internal corporate info).

> It's been a, uh, bumpy ride, haha. No Lawsuits, Jail Time, or Handcuffs, so have faith in me
So you're just going to keep rolling the dice until officer Dibble shows up?

Automated IP Theft. It's really hard to not be snarky, and sarcastic when you post stupid responses like this. And no, Officer Dibble wouldn't show up. It'd be an SSA from the FBI.


Let me rephrase this so you can understand a bit more. So far I've realized that I did a poor job explaining, and for that, I'm sorry. So let me try this again, now that I actually have time to explain things without some angry Chinese woman screaming at me to get her server back online.


Any information I retrieve from the server, customer data excluded, I can post in my ticket for others to see. We have an automated system that grabs the output of the command we run, but that system is constantly breaking. If the servers are having any sort of network issue, it won't post the information. Thus the reason for the program. Nothing about this is illegal, or theft of any kind. I could already do those actions without even having this application.

All I'm "circumventing" is the broken systems that can't upload this output of information, even the full time employees will benefit from this application because there are servers that will still be broken and can't upload. Before I even test it on a laptop at work, I'm pushing it through the corporate InfoSec team, and getting the correct approvals. I didn't think it was necessary for me to explain all this. As for the jabs at the legal comments, I intend to stay out of jail and out of trouble. I won't explain my family problems, but my mom's had enough heartbreak for 3 life times. None of it is from me, out of three children, I'm the well behaved child with a good job, and a bright future. I've got goals of making $150k+ / year, and climbing up the food chain to where I can buy a nice cottage for my mom to live the rest of her days out. I've got no time for screwing that up. Hell, i rarely speed, and if I do, it's to pass some twat bag whose being a dick.

Sorry for the tangent, snoopy11's comment irked me a bit.

Bottom Line: All I'm here for is to learn, speed up my work efficiency, make a good impression with the bosses for the remainder of my contract, and slowly migrate from the life of abusing my body physically to abusing my mind. I'm off to family farm, I'll check back later. I'll re-build the application without any company wording or information and post it here.
Was This Post Helpful? 0
  • +
  • -

#7 snoopy11   User is offline

  • Engineering ● Software
  • member icon

Reputation: 1554
  • View blog
  • Posts: 4,930
  • Joined: 20-March 10

Re: [C++/Qt] Project Guidance

Posted 10 November 2018 - 11:19 AM

Well ok,

My Intention was not to irk you,

I still have no idea why I have irked you just asked you if it was wise??

But great news if you are going through corporate security before deploying it!!

Good Choice!!

(As an aside I'm possibly the most experienced here in Qt, maybe Skydiver might have more experience but I'm not sure so, yeah, Good Luck!!)
Was This Post Helpful? 0
  • +
  • -

#8 Skydiver   User is offline

  • Code herder
  • member icon

Reputation: 6565
  • View blog
  • Posts: 22,530
  • Joined: 05-May 12

Re: [C++/Qt] Project Guidance

Posted 10 November 2018 - 12:33 PM

I only tried out Qt once to help someone out. After that I ran away and I avoid it like I avoid MFC, Visual SourceSafe, and Oracle Web Center. :)
Was This Post Helpful? 1
  • +
  • -

#9 snoopy11   User is offline

  • Engineering ● Software
  • member icon

Reputation: 1554
  • View blog
  • Posts: 4,930
  • Joined: 20-March 10

Re: [C++/Qt] Project Guidance

Posted 10 November 2018 - 12:36 PM

Well there you go, it's me !! :)

Happy Days !!
Was This Post Helpful? 1
  • +
  • -

#10 dreadstarx   User is offline

  • New D.I.C Head

Reputation: -3
  • View blog
  • Posts: 30
  • Joined: 09-November 18

Re: [C++/Qt] Project Guidance

Posted 10 November 2018 - 03:13 PM

Snoopy, that's why I hate texting. Theres no emotion in it. I'm trying to go beyond my knowledge and needed help but all I got were weird responses and what seemed like judgemental responses.

But hey, now I know your intentions were good, so no sweat.

As for Skydiver, I'm disappointed with your response. But i cant blame you. I started with VC++ and couldnt find squat for help. Closest help I got was "Use C#".

I'm not a fan of GUIs. I hate them but when coding something for the general public and employees with low technical experience/IQs, you gotta get dirty. Believe me, after this project, I'm going to go enjoy a nice hot shower, and drink enough beer to kill an elephant and pray I forget about it.


Since none of you are familiar with Qt, let me ask this. I'll also start thinking about how I can make it cli based.

How would you proceed with this?
Was This Post Helpful? 0
  • +
  • -

#11 snoopy11   User is offline

  • Engineering ● Software
  • member icon

Reputation: 1554
  • View blog
  • Posts: 4,930
  • Joined: 20-March 10

Re: [C++/Qt] Project Guidance

Posted 10 November 2018 - 04:02 PM

I am familiar with Qt though,

I'm just the one who is most familiar with Qt,

Generally, in the past, I have been the one to deal with the Qt questions Skydiver usually chimes in with some advice on the Qt posts which is why I included him but generally, it's me who ends up solving whatever banal Qt question it is.

I would think you are going to need an OCR library and a GUI, you could use a framework like Qt to make life easier or go down the rabbit hole of another one of my passions the Win32 API.

It is, however, your project so up to you really, I would not think a command line interface would work that well but not impossible, just it would be very clunky and there is the obvious Visual component to this, which makes a GUI an obvious choice.
Was This Post Helpful? 0
  • +
  • -

#12 Skydiver   User is offline

  • Code herder
  • member icon

Reputation: 6565
  • View blog
  • Posts: 22,530
  • Joined: 05-May 12

Re: [C++/Qt] Project Guidance

Posted 10 November 2018 - 04:39 PM

Actually, I started off teaching myself BASIC on a pocket TRS-80, then on a Apple II, then a C-64. On the C-64 I also taught my self 6502 assembly, Forth and Pascal. I fell in love with C when I went to college, and then taught myself C++ with Turbo C++ which unfortunately was C with classes because of the way Turbo C++'s manual, as well as the various early C++ books. This was also my first encounter with a GUI framework: Borland's OWL: Object Windows Library. At first I thought that it was the greatest thing in the world. It was only a bit later that I realized how bad an influence it was on my early architectural designs. OWL (as well as MFC and Qt) encouragse the everything-including-the-kitchen-sink mentality within a monolithic (and fragile) class hierarchy. Need to use a string? It has to be the the framework's string class. You can't introduce a different string class, like the STL std::string. Need a some UI widget? It has to be a written from the ground-up within that framework -- can't take advantage of C++'s multiple inheritance. I could potentially write some very useful and generic use classes that does data compression, but guess what: I need to pass it a OWL or MFC CString or think in terms of how MFC or OWL does it progress bars. This is my reason for running away from Qt and MFC the I noted above.

Admittedly some of the newer iterations of these frameworks don't try to sell themselves as the the one stop shop anymore and allow more hooks to be able to create adapters between their internal data types and other data types. Back in the 80's the idea of implementing an adapter class was anathema to a C++ programmer because that meant a performance drain. Nowadays, people tend to think: there is more than enough CPU horsepower to go around -- who cares if it's an extra 6 steps inside an adapter to convert from one type to another type.

Anyway, if you love Qt, I encourage you to continue using it. It's a tool for transforming your ideas into reality. I prefer other tools, but if it works well for you, maximize it's utility.
Was This Post Helpful? 1
  • +
  • -

#13 snoopy11   User is offline

  • Engineering ● Software
  • member icon

Reputation: 1554
  • View blog
  • Posts: 4,930
  • Joined: 20-March 10

Re: [C++/Qt] Project Guidance

Posted 10 November 2018 - 04:54 PM

Yes, I 100% agree,

I have said it before and I will say it again, Qt is bloated, that is why as you know I prefer my own framework libraries that I know work in a sane way, Qt also has a peculiarity about it everything is a pointer, I find some of its design considerations weird and yes I take into account its cross-platform nature, it is also rather counter-intuitive which as a programmer I hate, as you know once you have gained a certain amount of experience in a language and you encounter some new feature you can guess at how it should work, and hey you turn out to be right.

I have my own framework libs for cross-platform development in Windows and Linux and they are easier to use and less bloated that any framework out there, and they serve my purposes fine.

But that said I have seen many Qt developer jobs in C++ out there and no one wants to use the Win32 API because they don't understand it, in my opinion, also the same is true for XWindows in Linux.

I have never used or studied MFC as I always thought was/is the point of that terrible library, I have always used the Win32 API as you know instead.

OWL I have never heard of as at that time I was using Delphi ie (Pascal).

If we ever get any OWL questions I will send you a message :).

Have a great night !!
Was This Post Helpful? 1
  • +
  • -

#14 Skydiver   User is offline

  • Code herder
  • member icon

Reputation: 6565
  • View blog
  • Posts: 22,530
  • Joined: 05-May 12

Re: [C++/Qt] Project Guidance

Posted 10 November 2018 - 05:45 PM

If you've seen Windows UI look like this, you've used an OWL based application:
Posted Image
Was This Post Helpful? 0
  • +
  • -

#15 Skydiver   User is offline

  • Code herder
  • member icon

Reputation: 6565
  • View blog
  • Posts: 22,530
  • Joined: 05-May 12

Re: [C++/Qt] Project Guidance

Posted 10 November 2018 - 06:15 PM

I still don't understand why would need to scroll around take snapshots, and then stitch together. From the Product Datasheet:

Quote

Features
• Durable performance, with a rubberized housing
• Maximum portability with a compact footprint, built-in KVM cables
and USB power
• Hassle-free setup with plug-and-play installation
• Built-in cables with strain relief to prevent wearing or breaking
• Supports file sharing and video capture between your laptop and the connected server
• Optimized viewing with automatic video scaling that resizes the viewing panel to avoid scroll bars
• Supports resolutions up to 1920x1200

• LED indicators for USB, video, and console link
• Works with legacy and industrial devices


Reading the Product Manual:

Quote

About the Zoom menu
The Zoom menu includes a number of options that you can use to set the zoom percentage and resize the window accordingly. For example, if the attached server is running at XGA resolution (1024 x 768) and you select 50% zoom, the main window is set to a size of approximately 512 x 384.

Note: Not all of the zoom options are possible because laptop screens are too small for the larger zoom percentages. In those cases, the software resizes the screen to the largest window possible.

The following options are available in the Zoom menu:
• Center the window on the screen. This option is useful when the window is off of the edge of the screen.
• Turn on full-screen mode. This option is ideal for smaller screens. To stop running full-screen mode, click the icon again. If the toolbar is disabled when you enter full-screen mode, a smaller toolbar with only the full-screen and quit options is displayed. This smaller toolbar floats and can be moved, but it can’t be hidden.
• Locate the toolbar along the left or right vertical edge. This option is useful if your laptop features a widescreen display (for example, 16:10 aspect or 1280 x 800), as it provides more usable screen height.

The following are some things to note when using some of the options available in the Zoom menu:
• This program doesn’t enlarge video, it only shrinks it. As such, text mode (720 x 480 or similar) won’t be enlarged to fill your screen.


It sounds to me it's just a matter of getting a laptop whose native screen resolution is larger than 1920x1200. Perhaps have the company splurge on a gaming class laptop (that weight 7+ lbs), and you'll then be able to just send a key press to hit toolbar button #12 (Zoom to 100% or largest possible) and the press button #5 (Take a screenshot and save to file). Sending the keypresses can be done by just using AutoHotKey instead of having to write your program. Of course, if you use Qt, you'll simply have to call the appropriate Win32 API calls to send the same windows messages that AutoHotKey would have sent.

As a quick aside regarding the topic of needing a GUI vs console program: As I recall there is a video format converter program (ffmpeg) which is command line only. You would assume that something that involves video should be a GUI, but this one chose not to.

As another quick aside, do any of the machines you connect to support VNC? Why not simply use VNC to get the screenshots since the VNC protocol (traditionally) sends fullframe updates. (I think it was only later versions that sent screen deltas like other modern video compression formats.) Or are the machines usually is such a bad state that VNC or RDP doesn't work by the time you need to connect a crashcart?
Was This Post Helpful? 0
  • +
  • -

  • (4 Pages)
  • +
  • 1
  • 2
  • 3
  • Last »