Templot Club forums powered for Martin Wynne by XenForo :

TEMPLOT 3D PLUG TRACK - To get up to speed with this experimental project click here.   To watch an introductory video click here.   See the User Guide at Bexhill West.

     Templot5 - To join this open-source project on GitHub click here.  For the latest on-going developments click here.

  • The Plug Track functions are experimental and still being developed. Some of the earlier pages of this topic are now out-of-date.

    For an updated overview of this project see this topic.   For some practical modelling aspects of using Plug Track see Building 3D Track.

    The assumption is that you have your own machines on which to experiment, or helpful friends with machines. Please do not send Templot files to commercial laser cutting or 3D printing firms while this project is still experimental, because the results are unpredictable and possibly wasteful.

    Some pages of this and other topics include contributions from members who are creating and posting their own CAD designs for 3D printing and laser-cutting. Do not confuse them with Templot's own exported CAD files. All files derived from Templot are © Martin Wynne.
  • The Plug Track functions are experimental and still being developed.

    For an updated overview of this project see this topic.   For some practical modelling aspects of using Plug Track see Building 3D Track.

    The assumption is that you have your own machines on which to experiment, or helpful friends with machines. Please do not send Templot files to commercial laser cutting or 3D printing firms while this project is still experimental, because the results are unpredictable and possibly wasteful.

    Some pages of this and other topics include contributions from members who are creating and posting their own CAD designs for 3D printing and laser-cutting. Do not confuse them with Templot's own exported CAD files. All files derived from Templot are © Martin Wynne.

Templot5 - progress discussions

Quick reply >
Hi Martin,
I found out about the 2 click concept during testing, but didnt notice the height change.
Also found discovered the paper/scroll switch meaning.

I am sure the 8 sided chairs rewrite will be worth it in the long run.
Steve
 
_______________
message ref: 12399
Thanks Steve.

current WIP:

FP error in picture shapes.

Tried and failed to get the scanner functions working (fine in T2). They will have to wait.

Hoping we might get a version of T5 bundled with T2 in time for Scaleforum, so changed the OT bang:


alert_t2_swap.png



Hopefully swapping to and fro can be made almost seamless -- until the bright new dawn when T2 isn't there anymore and no-one notices.

Also made a new T5 logo. We need our style advisor for something a bit more original. :)


t5_logo_splash.png


Martin.
 
_______________
message ref: 12408
Hi Martin,
map_loader_unit
Step 1
Cosmetic changes, parentfont = false, and groupbox > panel + tlabel.

Pull request created.

Step 2 will be having a go at the synapse integration, so will need to reverse the ot2024 commenting out as you suggested and take it from there.
I have unzipped synapse, and copied synapse_units folder into my Lazarus IDE folder, and my Github Folder (but it might need to go into \github\Templot5\ folder ?

Steve
 
_______________
message ref: 12409
@Steve_Cornford

Woah Steve.

I have already done map_loader and synapse stuff. It's all working but I can't test it properly until I have fixed the picture shapes.

Sorry I should have posted a Wip.

Martin.
 
_______________
message ref: 12410
@Steve_Cornford

Hi Steve,

Sorry about last night's mess-up.

Current WIP: I'm in a bit of a pickle here, with half a dozen units containing half-finished changes.

I can't test the map tiles until I have got the picture shapes working. I can't do that until I have sorted out EMF metafiles.

Ever since I first set eyes on Lazarus I've known that the elephant in the room would be EMF metafiles. They are everywhere in Templot, but not supported in Lazarus (presumably because they are Windows-only). It was one reason for looking at the Delphi Community Edition.

For example they provide the page previews in the print_unit. They are integral to the sketchboard. They are supported in the picture shapes as a vector-based alternative to fuzzy bitmaps. They are integral to the PDF export.

I found some code on the Lazarus GitHub site which claimed to implement metafiles, but it's not working, and seems to have been abandoned. There is a partial metafile implementation in the HTMLViewer package (TMetafilePrinter), but that's not working properly in Lazarus either.

Fortunately I have managed to get metafiles working for the PDF export. The only solution is to go all through Templot and replace the metafiles with the same solution. That's a lot of work.

Also not working is the option to drag and drop files into Templot. That also needs to be fixed or removed.

All of which means current WIP: pad_unit, bgnd_unit, keep_select, bgkeeps_unit, help_sheet, export_unit, print_unit, pdf_units, map_loader_unit, control_room

Fortunately metafiles are not needed for plug track or normal track planning.

I will post again when I have got something working -- or decided what to do instead. :(

cheers,

Martin.
 
_______________
message ref: 12411
Hi Martin,
I have found a bug, but not solved it yet. It might be self inflicted....

Having loaded this box file, then displayed the box, when i press the delete key & then confirm deletion i get this:-
1723474149560.png

Just keeping you in the loop before I investigate.
Steve
 

Attachments

  • market_square_2024_08_12_1543_59.box
    95.7 KB · Views: 21
_______________
message ref: 12414
@Steve_Cornford @Paul Boyd

Thanks Steve.

I've seen it a few times, but not yet had time to go looking for it. If you look back through the forum archive you will find that List Index out of bounds was a frequent bug, and took years to find. :( Hopefully not this time. It's not usually fatal and means the storage box is empty (Count<1) when Templot was expecting to find something in it, or failed to check whether it was empty first. Or it is trying to index past the maximum.

Remember that everywhere in Delphi and Lazarus, Count is one more than the max index:

for n:=0 to (list.Count-1) do ...

cheers,

Martin.
 
_______________
message ref: 12416
Hi Martin,
Having restored previous, then loaded the box file.
If you delete he control template first, then you dont get the error when you delete the last template in the storage box.

Also if i insert showmessage statements then instead of getting the Tlistbox error I get a Templot error code 199.

1723543365521.png

displays the sbc 1319 message
Steve
 
_______________
message ref: 12440
@Steve_Cornford

Thanks Steve.

199 means the keeps_list and memo_list have got out of sync.

But please note keep_select.pas is on my WIP in the ongoing EMF battle. Best to leave making changes until I have pushed the results.

cheers,

Martin.
 
_______________
message ref: 12443
Hi Martin,
Yes I realise it's on your WIP, but just thought I would do some detective work in the meantime.

What I cant understand is why my adding a showmessage statement had the effect of replacing the tlistbox error with your error 199.
It is almost as if there is code being processed in parallel so that adding the showmessage gives a delay to one bit of code so that the 199 procedure gets finished first.
Are both bits of code using the same variable n?

Even Sooty is confused!
Steve
 
_______________
message ref: 12456
Hi Martin,
Yes I realise it's on your WIP, but just thought I would do some detective work in the meantime.

What I cant understand is why my adding a showmessage statement had the effect of replacing the tlistbox error with your error 199.
It is almost as if there is code being processed in parallel so that adding the showmessage gives a delay to one bit of code so that the 199 procedure gets finished first.
Are both bits of code using the same variable n?

Even Sooty is confused!
Steve
@Steve_Cornford

Hi Steve,

When using showmessage it's a good idea to resize the pad window small enough to leave the middle area of the screen free for the showmessage to appear. If the showmessage window is in the middle of the pad, or overlaps it, when you close the message it causes Windows to repaint the pad to replace the missing area. Pad repaints are set to cause Templot to do a re-calc and re-draw, which can cause other errors to re-appear.

I don't know if this explains what you are seeing. Nor do I now whether this repaint behaviour is actually needed with Lazarus. There is so much testing and learning still to do -- see in pad_form the OnPaint event.

I'm sure Sooty knows the answers if you ask him nicely.

cheers,

Martin.
 
_______________
message ref: 12458
Hi Martin,

Templot5
start templot 5, load templates from the recent file.
the backgound templates are displayed, as is the control template.
1723571722928.png

When you select the menu entry box, the storage box is displayed, but the control template also remains displayed.
1723571822821.png

when you click delete you get the Tlistbox error.

Templot2
start templot 5, load templates from the recent file.
the backgound templates are displayed, as is the control template.
1723572433566.png

When you select the menu entry box, the storage box is displayed, but the control template disappears.
1723572517909.png

When you press the delete key, no errors are generated.
Steve
 
_______________
message ref: 12459
@Steve_Cornford

Thanks Steve.

I can replicate the changed behaviour of the control template, but not the error.

The idea of hiding the control template when the storage box is showing, is to prevent confusion as to which template is being referred to if you click the info button. This was a frequent cause of confusion in the early days.

Why it is working differently in Lazarus I don't know. It is controlled by whether keep_form.Active is True. I have read somewhere that ActiveForm and Form.Activate differ in Lazarus from Delphi, but I can't find the details.

There is likely to be a lot of quirks like this to fix until we get T5 running as smoothly as T2, but hopefully we can get T5 released first and chase down these oddities in a more leisurely fashion afterwards. We can't go anywhere until I have got this EMF stuff sorted. :(

p.s. what happens if you click a blank part of the storage box before clicking Delete?

p.p.s. I have just fixed the bug on the info button.

cheers,

Martin.
 
_______________
message ref: 12460
Hi Martin,

I think I have made some progress.
I have added two lines to the delete_menu_entryClick procedure.
1723589347008.png

When I now load that box file, and then invoke box, then immediately press del with the third template drawing showing it all works fine.

But, to be honest, I dont know why.

BUt in fact it is not a total cure, as the problem just moves elsewhere, because if you actually list the box, then delete the last one you still get the Tlistbox error ......

Steve
 
_______________
message ref: 12469
Last edited:
Hi Martin,

Belay all that!

I have now done this instead:-
1723592302528.png

and so far have not been able to reproduce the error after applying just this mod.
So I really think it might be solved.....
Might have an 🥚 for breakfast in celebration
Steve
 
_______________
message ref: 12470
Hi Martin,
Although the modification above (replacing -1 with 2), I believe the actual problem lies within the procedure current_state.
1723626128670.png

Code block B needs to be performed before code block A, otherwise when invoking current_state(-1), keepform_listbox.ItemIndex has the potential of being set to an invalid value.

I mention this because there might be other instances of current_state(-1) being invoked where list_position is out of bounds.

I believe left to its own devices Lazarus keeps keepform_listbox.ItemIndex to legal values, so we have to ensure that where we intervene we only use legal values.

hope this makes sense.
Steve
 
_______________
message ref: 12477
@Steve_Cornford

Thanks Steve.

I'm making some progress with the EMF battle, I should be able to push it all up to GitHub later today. We can then have a look at this error.

According to the Git enthusiasts we should be able to do both things at once, but I'm not convinced.

cheers,

Martin.
 
_______________
message ref: 12478
Or as usable code copy:-
Code:
          // SC 15/08/24
          // ensure list_position within bounds before using to update Keepform_listbox.ItemIndex
          // occurs having deleted last item in list

          if list_position>keeps_list.count-1 then list_position:=keeps_list.count-1;
              
          // sc 15/08/24

Steve
 
_______________
message ref: 12506
add to WIP

image_viewer_unit
bitmap_viewer_unit
 
_______________
message ref: 12517
Hi Martin, I have been watching your progress with Templot 5 and keen to help in any way I can but, I'm not a Software/programmer. But, If You want someone to occasionally open/run/test Templot 5 (beta) then I'm more than willing to assist. Just let me know how to open/run Templot 5 and I'll play around and report on any omissions or opportunities (bugs). If its too soon then that's OK just let me know when.
 
_______________
message ref: 12521
Hi Martin, I have been watching your progress with Templot 5 and keen to help in any way I can but, I'm not a Software/programmer. But, If You want someone to occasionally open/run/test Templot 5 (beta) then I'm more than willing to assist. Just let me know how to open/run Templot 5 and I'll play around and report on any omissions or opportunities (bugs). If its too soon then that's OK just let me know when.
@Terry Downes @Steve_Cornford

Thanks Terry.

All help gratefully received. (y)

In addition to help with coding, Templot5 and plug track needs docs, tutorials, videos, diagrams, etc.

If you would like to try Templot5 as it stands today, I have attached a ZIP file below. Extract it somewhere which is nowhere near Templot2 (on a USB stick would be good). Then run the file templot_5.exe

(You will likely have to jump through the usual Windows security warnings.)

You will find lots of stuff not quite right, and some windows will look odd. But the basic functionality should be there, such as loading some of your existing BOX files, printing templates. The background maps are not working yet.

You might like to print the same templates in Templot5 and Templot2 and check for any discrepancies. To help you avoid getting Templot5 confused with Templot2 you will see that the yellow hard hat has changed to green.

Just at the moment I have got myself in a pickle trying to get EMF metafiles to work as smoothly in Templot5 as in Templot2. They are not natively supported in the Lazarus compiler, so it's tricky. They are needed in various places, such as the PDF exports and the page previews when printing paper templates. I won't be around much today, so fixing it will have to wait a bit longer. Some of it is working, e.g. PDF exports.

Thanks again,

Martin.
 

Attachments

  • TEMPLOT5_OUTPUT.zip
    7.5 MB · Views: 39
_______________
message ref: 12522
@Hayfield

Making the STL for John, see:

https://85a.uk/templot/club/index.php?posts/12526

has reminded me that I intended an option to omit the timber webs independently of the end flanges. This would allow connector clips to be further outboard for improved alignment accuracy. Also avoid having to snip the webs off the ends after printing. The snag is, where to put 4 more tick-boxes?

shove_ticks.png


I think this dialog will have to increase in size yet again. With all these dialogs, there will soon be no screen space to see the actual track! :)

Martin.
 
_______________
message ref: 12527
has reminded me that I intended an option to omit the timber webs independently of the end flanges. This would allow connector clips to be further outboard for improved alignment accuracy. Also avoid having to snip the webs off the ends after printing. The snag is, where to put 4 more tick-boxes?
@Steve_Cornford @Hayfield

That's now done and working in Templot5. :)

I re-arranged the shove timbers dialog yet again, and added 4 more tick-boxes. All 4 webs around a timber can now be individually omitted. This makes sense only for the end timbers, and for only 2 of the webs on any given timber. But it will work for any timber if you need the webs omitted for some reason:
t5_no_webs1.png

t5_no_webs2.png


Apart from not needing to trim them off after printing, this also allows the connector clips to be moved further outboard for improved alignment accuracy. It might also be useful to omit the end webs if the brick is a tight fit on the build plate.

This will be in Templot5 accessible from the next Templot2 update.

I will also use it for John's STLs for Scaleforum shortly.

Steve, I will push the files to GitHub shortly. Pushed.

Martin.
 
_______________
message ref: 12531
Hi Martin,
I expect you are still workng on emf_unit.lfm & emf_unit.pas, but without these I get compilation errors.

I have been trying to solve an annoying problem in platform_unit.lfm, platform_unit.pas.

ms tabsheet works fine:-
1723933308292.png

1723933404428.png

in that you can tick and untick the box. (just ignore the bad group box display for now, thats just cosmetic)
But when you click on the ts tabsheet, once you tick the checkbox, it disappears so that you can't untick it!
1723933543763.png

obviously it work in Templot2 just fine!

Trackbed edges exhibit the same phenomenen!
1723933649593.png

ms on & off ok, but ts tickbox dissappears!
1723933706753.png


I cannot see for the life of me any parameter differences between the ts_ and ms_ objects.

I tried putting in some showmessages but then discovered the concept of OnIdle!

Might have to redesign the tabs so that the are similar to the dxf_unit tabsheets.

Steve
 
_______________
message ref: 12533
Hi Martin,
by redesign, i dont mean anything drastic.
For instance by changing ts_panel.align from alClient to alNone, and moving the ts_panel down by 24 to get something like this:-
1723968578831.png

so that the tickbox is not overlaid by the Tpanel might work.
Ignoring the group boxes and other cosmetic details that I can sort out once this issue is resolved.

any chance you can send me copies of emf_unit files so that i can get Templot5 to compile?
Steve
 
_______________
message ref: 12534
Hi Martin,
by redesign, i dont mean anything drastic.
For instance by changing ts_panel.align from alClient to alNone, and moving the ts_panel down by 24 to get something like this:-
View attachment 10632
so that the tickbox is not overlaid by the Tpanel might work.
Ignoring the group boxes and other cosmetic details that I can sort out once this issue is resolved.

any chance you can send me copies of emf_unit files so that i can get Templot5 to compile?
Steve
@Steve_Cornford

Good morning Steve.

I'm equally baffled. I spent over an hour last night trying to find the cause. It's fine in T2. :unsure:

Yes, do whatever you think best. We need to get T5 usable and released, we can come back to these issues at our leisure later on.

If you need to change the form Height, be sure to set the FormCreate event to match (ClientHeight).

I'm just about to push dxf_unit with a change to the brim fence on the connector clips, and also it is now on by default (was off).

There is also a bug appeared in the shapes sync which I need to find.

cheers,

Martin.
 
_______________
message ref: 12535
Yes it is baffling.
Why does it work on the 2nd tab & not on the 1st tab? (Rhetorical question, no need to answer)

will ensure I maintain client.height etc.

I am assuming it is the Tpanel that is obscuring the checkbox.

At least I have learnt about Tpanel.align

Steve
 
_______________
message ref: 12536
I am assuming it is the Tpanel that is obscuring the checkbox.

I'm not sure about that, I tried changing the Z-order, bringing the checkbox to the top. Also tried swapping the tab positions over. Still error on TS and not MS.

Just pushed some changes to dxf_unit.

cheers,

Martin.
 
_______________
message ref: 12537
_______________
message ref: 12539
Hi Martin,
Thanks for that.
I also had to delete the trial_button object from the pad_unit.lfm in order to get Templot5 to load, but no real problem.

Setting the ts_panel.align to alNone and setting top to 24 had the desired effect. ts_ checkbox now working....

1723988142872.png


Just need to do the cosmetic tidying now.

Oh and apply to the ms_ tab so that the style is consistent, and also the trackbed edges etc.

Steve
 
_______________
message ref: 12547
If that is ok with you, will apply to ms_tab and other related forms
@Steve_Cornford

Hi Steve,

That's ok, but there is excessive bottom border. For child forms, delete datestamp_label if it exists. Use the yellow hide_panel to define the bottom corner of the form (Windows adds plenty enough border by itself).

1. make sure you are working at 120dpi screen, and running at medium program size on the slider, when testing stuff.

2. move yellow hide_panel down a bit so that its bottom edge is level with, or fractionally below all the other controls. and move it across if necessary so that its right edge is level with, fractionally beyond all the other controls.

3. set the form.width AND the clientwidth in form.create to the hide_panel's (left+width). Set the form.Height AND the clienttheight to the hide_panel's (top+height).


child_form_corners.png




For normal (non-child) forms, use datestamp_label in the same way -- its bottom-right corner defines the form size and the client size. In this case the label itself is 4 pixels high and makes the bottom border. Set its width to 4 pixels wider than all the other controls to create the right-hand border. Set the form sizes and client sizes accordingly.



The Templot program sizing will then work nicely with neat borders and no scrollbars appearing at any program size (Lazarus permitting). :)

cheers,

Martin.
 
_______________
message ref: 12551
@Steve_Cornford

Hi Steve,

Perfect. Have a boiled egg. :)

steve_platform.png


Many thanks.

p.s. a form in need of attention is rail_options_unit. :)

cheers,

Martin.
 
_______________
message ref: 12553
Back
Top