model railroad track planning

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

smf
Premier Member
Posts: 172
Joined: Tue Feb 28, 2012 1:05 pm

Re: model railroad track planning

Post by smf » Sat Jan 03, 2015 3:03 pm

So that's it for the moment. Any comment is appreciated. :) If you have any question or suggestion or if you find (some of the surely existing) bugs, please write a comment here.

User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 2541
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: model railroad track planning

Post by Husky » Sat Jan 03, 2015 9:12 pm

Hello smf,

thank you very much for this Script and Tutorial! I'm really impressed!!!
smf wrote:So that's it for the moment. Any comment is appreciated. :) If you have any question or suggestion or if you find (some of the surely existing) bugs, please write a comment here.
I have just started testing the script but may I ask you the first questions .... :shock:

1. Decimal Point:
I run your script on a Computer with a German OS (WinXP).
My OS settings for the Decimal Point = Comma.
My QCAD settings for the Decimal Point = Dot.
- Your script is using the OS settings and not the QCAD settings - would it be possible that your script will adopt the settings from QCAD? Right now your script will change a given value from 250.0 into 2500,0
If I use directly in QCAD wrong Character I will see a red warning which indicates that I do something wrong ... :wink:

2.
Consecutive extension:
It's limited to two - why I can't use more?

3. Language:
I have the feeling that I know a couple guys in Germany which would love to use your script in QCAD ..... 8)
- Do you have any plans to provide a possibility to translate the relevant dialogs in your script? Like ts files .. ?
Work smart, not hard: QCad Pro

smf
Premier Member
Posts: 172
Joined: Tue Feb 28, 2012 1:05 pm

Re: model railroad track planning

Post by smf » Sat Jan 03, 2015 10:38 pm

Hello Husky,

thank you for your response. :) Hopefully the scripts are of help and have not too many bugs...
1. Decimal Point:
I run your script on a Computer with a German OS (WinXP).
My OS settings for the Decimal Point = Comma.
In fact, I have no idea how to change this behaviour. I'm working on an English XUbuntu, all dialogs are designed with Qt4 Designer using a QDoubleSpinBox. Andrew already pointed out that QCad is using a special input box where the user is allowed enter expressions. I will try to migrate to this input box, then I hope my dialogs will behave like the original QCad ones.
2.Consecutive extension:
It's limited to two - why I can't use more?
Uhm, I'm sorry for not fully understanding. What do you mean with "limited to two"? The undo-function is limited to the last inserted track, yes. I thought it would be easier to delete more than one element with the "normal" QCad functions. Adding of elements should be unlimited. Could you please specify what limits the input?
3. Language:
I have the feeling that I know a couple guys in Germany which would love to use your script in QCAD ..... 8)
- Do you have any plans to provide a possibility to translate the relevant dialogs in your script? Like ts files .. ?
Hehe. :D As I'm playing with "Märklin C-Gleis" for a few weeks now, I think I know what you mean. :D I never tried the ts-files before, but it seems that everything has a first time. :) I will have a look at the translation and will provide a German version as soon as possible. I would be pleased to see my scripts used and to see model railroad plans created with QCad.

User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 2541
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: model railroad track planning

Post by Husky » Sun Jan 04, 2015 9:59 am

smf wrote:
2.Consecutive extension:
It's limited to two - why I can't use more?
Uhm, I'm sorry for not fully understanding. What do you mean with "limited to two"? The undo-function is limited to the last inserted track, yes. I thought it would be easier to delete more than one element with the "normal" QCad functions. Adding of elements should be unlimited. Could you please specify what limits the input?
Sorry - my bad! I misinterpreted the left/right box as a multi copy counter. I tested it before I read your manual ...
Questions: Would it make sense to label the top of the columns or change 1, 2 into l, r (=left, right) to prevent confusions?

Drawing navigation with open "Consecutive extension" Window:
It would be nice if I could still navigate (zoom in and out etc) during I use the "Consecutive extension" Tool. Similar to the QCAD Selection Filter Functionality.
smf wrote: Hehe. :D As I'm playing with "Märklin C-Gleis" for a few weeks now, I think I know what you mean. :D I never tried the ts-files before, but it seems that everything has a first time. :) I will have a look at the translation and will provide a German version as soon as possible. I would be pleased to see my scripts used and to see model railroad plans created with QCad.
Sounds good to me - I think the ts files are working very well to get the script multilingual.

Question to "Create Track" dialog:
1. Block name - If I use accidentally the same block name twice - the first created block will be overwritten by this action.
The warning is only in the Command line but not everybody works with a visible CL.
I think some kind of protection in the dialog like the warnings in QCAD would be nice.

2. Cost:
Would it be possible to fill in a full price like 12.70 instead of 1270?

3. Remember function:
I can change the pre filled Fields but after restarting the tool everything is back to default.
Would it be possible that the dialog remembers the last used dimensions?



Question to: "Show Part List":
In QCAD we have already a "Export Block List" script which will print the Block List in a Text file.
(Misc/Block/Export Block List)
Would it make sense to have the "Show Part List" also printed in a Text File?


However - your scripts are amazing!!! 8)
Work smart, not hard: QCad Pro

smf
Premier Member
Posts: 172
Joined: Tue Feb 28, 2012 1:05 pm

Re: model railroad track planning

Post by smf » Sun Jan 04, 2015 11:27 am

I tried to insert translation files, and it seems to work "sometimes". Attached is a new version with some basic translations. Menu items and Dialogs are :D translated, but most of the console output is not yet translated. Starting QCad without parameter seems to work, but unfortunately, with inserted translation files and with enabled script debugger QCad seems to crash. Calling

Code: Select all

qcad -rescan -enable-script-debugger
results in

Code: Select all

Warning:  QWidget::repaint: Recursive repaint detected
/opt/qcad-3.6.0-pro-linux-x86_64/qcad: line 18:  4979 Segmentation fault      (core dumped) LD_LIBRARY_PATH="$DIR" "$binary" -style plastique "$@"
So I'm surely doing something wrong, but I don't have a clue what. :( I created ts-files using something like

Code: Select all

lupdate Variegate* -source-language en -target-language de -ts ts/Variegate_de.ts
and then edited this ts-file with Qt Linguist. As the "normal" ts files seem not to work in QCad (?), I saved them additionally as qm files, then the translation appeared.
Attachments
QCTrack_V51_TranslationBase.zip
(41.92 KiB) Downloaded 106 times

smf
Premier Member
Posts: 172
Joined: Tue Feb 28, 2012 1:05 pm

Re: model railroad track planning

Post by smf » Sun Jan 04, 2015 11:55 am

Hi Husky,

thanks again for your suggestions! :)
Would it make sense to label the top of the columns or change 1, 2 into l, r (=left, right) to prevent confusions?
Yes indeed. I didn't figure out how to do this in a "nice" way, but I will have a look at this.
Drawing navigation with open "Consecutive extension" Window:
It would be nice if I could still navigate (zoom in and out etc) during I use the "Consecutive extension" Tool. Similar to the QCAD Selection Filter Functionality.
Again: yes. I tried several approaches, but never succeeded. :( Andrew helped me out at some points, but my main problem was/is the data exchange between multiple script engines. I will try to understand the QCad Selection Filter, perhaps this points into the right direction for a better solution.
1. Block name - If I use accidentally the same block name twice - the first created block will be overwritten by this action.
The warning is only in the Command line but not everybody works with a visible CL.
I think some kind of protection in the dialog like the warnings in QCAD would be nice.
I will insert this in the (hopefully soon released) next version.
2. Cost:
Would it be possible to fill in a full price like 12.70 instead of 1270?
I thought of this, but as floating points are not really precise, I decided to use integer numbers. But I admit that this is not very comfortable. Would it be helpful to display the result formatted, i.e. to divide the Cents by 100 for the output?
3. Remember function:
I can change the pre filled Fields but after restarting the tool everything is back to default.
Would it be possible that the dialog remembers the last used dimensions?
Yes, as soon as I change the DoubleSpinBox to RMathLineEdit or the already updated WidgetFactory is inserted. The persistent Widget functionallity was inserted but removed for the releases as the DoubleSpinBox aren't persistent with QCad 3.7.5.
Question to: "Show Part List":
In QCAD we have already a "Export Block List" script which will print the Block List in a Text file.
(Misc/Block/Export Block List)
Would it make sense to have the "Show Part List" also printed in a Text File?
Thank you for this hint - I did not recognize this function but will look at it. Of course a text file would be of help for many people.

I have some other work to do :( now but will post here as soon as possible. :D Thanks again for your suggestions!
Last edited by smf on Fri Jan 09, 2015 9:31 pm, edited 1 time in total.

smf
Premier Member
Posts: 172
Joined: Tue Feb 28, 2012 1:05 pm

Re: model railroad track planning

Post by smf » Sun Jan 04, 2015 5:37 pm

Hi there,

I now inserted some improvements(?) to have the new attached version.

Unfortunately, the column header thing didn't worked too well, so I decided to insert a ToolTip clarifying the SpinBox in the ConsecExtend dialog. As for now, the dialog is still modal so you can not zoom / move while the dialog is open. But if you select "Select new destination", you may zoom and move the window and get back to the same dialog immediately. I am still in search of a better solution.

On creation there now will be an error message in an alert-box additionally to the console output.

Everything should be translated now and available in German if QCad is set to German user interface. For unknown reasons, QCad stopped crashing if debugger is enabled, so my question above is obsolete.
Attachments
QCTrack_V54_CreateErrorBeautify.zip
QCTrack version 54
(50.18 KiB) Downloaded 94 times

User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 2541
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: model railroad track planning

Post by Husky » Sun Jan 04, 2015 9:42 pm

smf wrote:Everything should be translated now and available in German if QCad is set to German user interface. For unknown reasons, QCad stopped crashing if debugger is enabled, so my question above is obsolete.
What I have seen till now looks pretty good! I'm a native German speaker ... :wink:

Note: The "Duplicate and move" command isn't working in the V54. :cry:
Work smart, not hard: QCad Pro

User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 2541
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: model railroad track planning

Post by Husky » Mon Jan 05, 2015 8:24 am

Husky wrote:Note: The "Duplicate and move" command isn't working in the V54. :cry:
I don't know why but now it's working. Maybe I did something wrong .... :oops:
Sorry!
Work smart, not hard: QCad Pro

smf
Premier Member
Posts: 172
Joined: Tue Feb 28, 2012 1:05 pm

Re: model railroad track planning

Post by smf » Mon Jan 05, 2015 10:34 am

Attached is the new version 56 with most of the discussed features. Still missing are "save last options in Create" and "move/zoom while Consecutive Extension" - as for now I'm sure with a "normal" widget instead of the dialog, for each track to be inserted the connection track end has to be selected. In sum this would be better than the current approach I must admit, but I think I need some more time to change this concept.

Cost is now based on integer during calculation but can be entered as "normal" dollars / euros / whatever. The output is formatted accordingly, all existing plans will work without change (the text on TR_COST still contains Cent).
Attachments
QCTrack_V56_Cost100.zip
QCTrack version 56
(52.33 KiB) Downloaded 95 times

smf
Premier Member
Posts: 172
Joined: Tue Feb 28, 2012 1:05 pm

Re: model railroad track planning

Post by smf » Mon Jan 05, 2015 10:35 am

I'm a native German speaker ... :wink:
Ich auch - ich befürchtete bereits, man würde es dem holprigen englischen Text anmerken... :wink:

User avatar
Clive
Moderator / Drawing Help
Posts: 1327
Joined: Thu Aug 25, 2011 9:28 pm
Location: UK

Re: model railroad track planning

Post by Clive » Mon Jan 05, 2015 1:49 pm

Hi Stefan

Well you have certainly been busy with this project, thank you for your step by step tutorial, when I get the time I will digest it and try out what you have accomplished so far, all that remains is to say very well done indeed Stefan I am sure your addition will attract quite a few people and encourage others to use QCAD for implementing their own extensions.
For the best support please state your operating system, QCAD version and add any supporting DXF/DWG files, screenshots etc...

User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 2541
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: model railroad track planning

Post by Husky » Tue Jan 06, 2015 9:18 am

Hi smf - thanks again! I will play around with the new version .... :wink:
smf wrote:... but I think I need some more time to change this concept.
Take your time - nobody is chasing you! 8)
Work smart, not hard: QCad Pro

User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 2541
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: model railroad track planning

Post by Husky » Tue Jan 06, 2015 9:21 am

smf wrote:Ich auch - ich befürchtete bereits, man würde es dem holprigen englischen Text anmerken... :wink:
Da gingen meine Ahnungen ja in die richtige Richtung - so gut konnte keine "Online Übersetzung" sein! :wink:
Work smart, not hard: QCad Pro

User avatar
Husky
Moderator/Drawing Help/Testing
Posts: 2541
Joined: Wed May 11, 2011 9:25 am
Location: USA

Re: model railroad track planning

Post by Husky » Tue Jan 06, 2015 10:03 pm

And now I've seen that a Tool Bar is also in progress. Nice! :wink:
Work smart, not hard: QCad Pro

Post Reply

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