Console App versus GUI? RESOLVED a GUI

This forum is for 'Work-in-Progress' QCAD user developed script Add Ons and Plug-ins.

Please use this forum to request/submit your script Add-Ons & Plug-in idea's.

Moderators: andrew, Husky, J-J

Post Reply
Joseph1916
Active Member
Posts: 36
Joined: Wed Jul 12, 2023 2:58 pm
Location: Florida

Console App versus GUI? RESOLVED a GUI

Post by Joseph1916 » Wed Aug 30, 2023 8:41 pm

Could a Console Application window be a more suitable solution for COGO?
As with QCAD, an API, tend to be Graphically oriented.
COGO not as much so.

Engineers and Surveyors are more exacting with their results than Drafting is within their results.
If so, is it a waste of time to develop a Console (text) Application??
Or perhaps not even possible??

If not possible, then a GUI is the answer. COGO will have found a new home. :-) Just curious. My partner says GUI, I lean towards Console !!

Joseph1916
Last edited by Joseph1916 on Mon Sep 11, 2023 8:43 pm, edited 1 time in total.

CVH
Premier Member
Posts: 3480
Joined: Wed Sep 27, 2017 4:17 pm

Re: Console App versus GUI?

Post by CVH » Thu Aug 31, 2023 6:53 am

Joseph1916,

Difficult to answer because we don't know what the goal is.
And then I mean not in details.
We've seen you struggle with simple sample QCAD scripts, but nothing like "I have this data and I want that result."

Nowadays most things are more graphically simply because computer graphics evolved very hard and are still evolving fast.
Raw textual data is usually hard to visualise for humans, binary data is even harder to interpret but dedicated code can visualise both with ease.
In reverse, data from a draft can easily be exported in whatever textual or binary style required.

Reading this: https://help.autodesk.com/view/MAP/2022 ... 4BB22762F1
Then a so-called 'COGO Input dialog box' would be easy to implement in QCAD.
Not knowing for sure if that is the goal.

Regards,
CVH

Joseph1916
Active Member
Posts: 36
Joined: Wed Jul 12, 2023 2:58 pm
Location: Florida

Re: Console App versus GUI?

Post by Joseph1916 » Fri Sep 01, 2023 8:00 pm

CVH

Finally, getting back with you..... I'm going with the GUI... the more modern approach, as your Auto-CAD examples demonstrate.

Beyond that, I am going to Post code for a 5 Column by 1000 row array in JavaScript to store Survey field Points.

The 5 Columns Are:
Point Number
Eastern
Northern
Elevation
Description

We plan to migrate to the C Programming Language, eventually, so I reference cJSON. I suspect you are familiar with the cJSON library. Could come in handy as a STANDARD to read/write/modify the use of JSON in C. cJSON come along with an API.

I will post the Array Code shortly.

Joseph1916

CVH
Premier Member
Posts: 3480
Joined: Wed Sep 27, 2017 4:17 pm

Re: Console App versus GUI?

Post by CVH » Sat Sep 02, 2023 2:05 am

Joseph1916,

A list of 1000 points with (Point number, Y, X, Z, Description) can already be imported if presented as CSV:
https://qcad.org/en/tutorial-importing- ... s-from-csv

You can extend QCAD functionality with C++ libraries but natively you work in ECMAScript:
https://www.ribbonsoft.com/en/qcad-scripting

JSON is supported out of the box in ECMAScript ... 'JavaScript Object Notation'
Built in function for converting JSON strings into JavaScript objects: var object = JSON.parse(jsonTextString);
In reverse: var jsonTextString = JSON.stringify(object);
And very similar for arrays or a mix of things, all within JSON limitations/restrictions.

Regards,
CVH

Joseph1916
Active Member
Posts: 36
Joined: Wed Jul 12, 2023 2:58 pm
Location: Florida

Re: Console App versus GUI?

Post by Joseph1916 » Sat Sep 02, 2023 2:41 am

CVH

Thank you for your reply....... Very helpful....

I stumbled across something that at first was confusing me, now I can see why....

The "prompt method" was not working as I thought it would with Node.js ....
Now I am understanding the issue.... how to handle user input synchronously in Node.js.
I am seeing synchronous and asynchronous communications as the issue ..

Now I can rest......

Joseph1916

CVH
Premier Member
Posts: 3480
Joined: Wed Sep 27, 2017 4:17 pm

Re: Console App versus GUI?

Post by CVH » Sat Sep 02, 2023 3:16 am

Joseph1916 wrote:
Sat Sep 02, 2023 2:41 am
The "prompt method" was not working as I thought it would with Node.js ....
Not knowing what Node.js has to do with QCAD.
https://www.qcad.org/rsforum/viewtopic.php?f=32&t=9662

Regards,
CVH

Joseph1916
Active Member
Posts: 36
Joined: Wed Jul 12, 2023 2:58 pm
Location: Florida

Re: Console App versus GUI?

Post by Joseph1916 » Mon Sep 04, 2023 8:00 pm

CVH

OK, thank you for pointing out the Technology differences between node.js a QCAD. And it is different, very different.

My work around will be to have Utility Functions outside of QCAD, using Node.js, and simple sharing the output data, until a better solution become available. I do this in the interest of filling the gaps in my approach. Perhaps others can find better solutions. We will have results to look at.

I could see Python processing output files that could be useful. I will use any Utility at my disposal.

My first out put file will be a table of a two-dimensional array of point values, that can be manipulated.

Joseph1916

Joseph1916
Active Member
Posts: 36
Joined: Wed Jul 12, 2023 2:58 pm
Location: Florida

Re: Console App versus GUI?

Post by Joseph1916 » Wed Sep 06, 2023 9:58 pm

Sorry for re Posting.... Minor update, the file format I will USE is JSON. I have been reading on it, and it is a common interchange format, oriented towards JavaScript (JavaScript Object Notation).

CVH
Premier Member
Posts: 3480
Joined: Wed Sep 27, 2017 4:17 pm

Re: Console App versus GUI?

Post by CVH » Wed Sep 06, 2023 10:39 pm

Joseph1916 wrote:
Wed Sep 06, 2023 9:58 pm
it is a common interchange format, oriented towards JavaScript (JavaScript Object Notation).
Yep, already mentioned 4 & 5 posts up:
CVH wrote:
Sat Sep 02, 2023 2:05 am
JSON is supported out of the box in ECMAScript ... 'JavaScript Object Notation'
Array based or object based ( [...] or {...})?
Or mixed?

An array of points is easy to iterate.
Creating an RVector for each, at that location an RPoint and adding additional data as custom properties.
You will need to implement a specific QCAD import tool .... A script.

The required functionality exceeds the Simple API.

Regards,
CVH

Joseph1916
Active Member
Posts: 36
Joined: Wed Jul 12, 2023 2:58 pm
Location: Florida

Re: Console App versus GUI?

Post by Joseph1916 » Mon Sep 11, 2023 8:41 pm

CVH

Support for JSON will be very helpful going forward. The original TOPIC is resolved. COGO will use a GUI ..... TOPIC RESOLVED

Thank you for your support......

Joseph1916

siyagomes
Registered Member
Posts: 1
Joined: Sun Sep 24, 2023 4:16 pm
Location: india

Re: Console App versus GUI? RESOLVED a GUI

Post by siyagomes » Mon Sep 25, 2023 7:40 am

Joseph1916 wrote:
Wed Aug 30, 2023 8:41 pm
Could a Console Application window be a more suitable solution for COGO?
As with QCAD, an API, tend to be Graphically oriented.
COGO not as much so.

Engineers and Surveyors are more exacting with their results than Drafting is within their results.
If so, is it a waste of time to develop a Console (text) Application??
Or perhaps not even possible??

If not possible, then a GUI is the answer. COGO will have found a new home. :-) Just curious. My partner says GUI, I lean towards Console !!

Joseph1916
Developing a Console Application for COGO can be practical, offering precision and ease of use. It's not a waste of time; it caters to a specific audience seeking efficiency. GUI remains an option, but the Console serves a purpose.

Joseph1916
Active Member
Posts: 36
Joined: Wed Jul 12, 2023 2:58 pm
Location: Florida

Re: Console App versus GUI? RESOLVED a GUI

Post by Joseph1916 » Tue Oct 03, 2023 6:22 pm

Interesting. Your points were what I saw.

But that would leave me building a Console Application in Qt5. That would require some guidance from others to keep me on track. I could still have questions.

And a major issue is my Development Environment.

I am 100 percent Linux, because of cost issues. I am very restricted because of that.

Relocation out of the U.S. is always on the table.

This is moving towards a Console Application in Qt.

Joseph1916

Post Reply

Return to “QCAD 'Script Add-On & Plug-in challenge' - Work in Progress”