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

    Some pages of this topic 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.

Version control

Martin Wynne

Admin
Location
West of the Severn UK
Info
.
Enjoy using Templot?
Thanks.

Please do not send requests for help direct to me via email.

Post your questions on the forum where everyone can see them and add
helpful replies.
@graeme

Hi Graeme,

My thought was your option 1.b

Diff the modified T2 against the previous T2, and copy all the changes into my cleaned-up T3 version. You could then diff it against your existing T3 version.

But ideally we wouldn't get to needing that, because as I'm developing some changes I would be posting the code and discussing it as we go along. You would then know what was involved in a given change, and decide whether to adopt it for T3, or not, or do it differently. This is what I meant about active code discussions, and what I envisaged happening when I open-sourced Templot. But we have never got that far.

Of course I don't yet know what the next changes might be, if any. There are lots of ideas in my notebook. One which I'm quite keen to get done is to put a proper knuckle bend radius on the K-crossings. There are implications for the switch tips for moveable K-crossings.

cheers,

Martin.
 
_______________
message ref: 1592

Martin Wynne

Admin
Location
West of the Severn UK
Info
.
Enjoy using Templot?
Thanks.

Please do not send requests for help direct to me via email.

Post your questions on the forum where everyone can see them and add
helpful replies.
@Alistair Ward @graeme

Hi Alistair, Graeme,

I've posted a couple of my current T2 files at:

https://85a.uk/templot/club/index.php?threads/t4-files.192/

Please let me know if this format is acceptable, and I will do some more.

Note that these are not Lazarus files, they are from Delphi. So they won't work in Lazarus as they stand. But they don't need to work in Lazarus if your intention is only to diff the changes across into the existing T3 files.

cheers,

Martin.
 
_______________
message ref: 1596

graeme

Member
Location
Bangkok
Hi Martin,

These are certainly workable. However they do throw up a lot of differences with T3, on which all our work so far has been based.

Between my earlier pdf changes and the more recent changes Alistair and I have made, we have 50+ sets of changes based on 2.94a.

Would it be possible, rather than go through the whole cleanup exercise again, to simply diff your changes and apply them to that version of T3?

Your call, of course, as only you can judge the cleanup effort, but this alternative sounds easier for everyone.

Cheers,

g
 
_______________
message ref: 1598

Martin Wynne

Admin
Location
West of the Severn UK
Info
.
Enjoy using Templot?
Thanks.

Please do not send requests for help direct to me via email.

Post your questions on the forum where everyone can see them and add
helpful replies.
Would it be possible, rather than go through the whole cleanup exercise again, to simply diff your changes and apply them to that version of T3?

Your call, of course, as only you can judge the cleanup effort, but this alternative sounds easier for everyone.
@graeme

Hi Graeme,

It doesn't sound easier to me!

You asked me to provide my current T2 files. And that's what I have done for the ones I posted last night. The only "cleanup" needed for those was to add the open-source legal stuff. Otherwise those are my current files unchanged.

I've been thinking back to the work I did to get the original T3 files done 3 years ago. It did indeed take me a couple of weeks or more to do. But the greater part of that was to convert them to be usable in Lazarus, so that I could post a project which would compile straight off in Lazarus. The actual cleaning up of the files by deleting all the commented-out stuff didn't take too long, and I'm willing to do that again.

I might even park the old files in an archive and start using the cleaned-up versions for real in T2. It's long-overdue housekeeping. :)

Are you saying that you have got the PDF exports working in T3?

cheers,

Martin.
 
_______________
message ref: 1599

graeme

Member
Location
Bangkok
It doesn't sound easier to me!
Well, as I said, you are best placed to decide that. :)

I might even park the old files in an archive and start using the cleaned-up versions for real in T2. It's long-overdue housekeeping. :)
That's better than I dared hope for. I did wonder whether the (at least partly) cleaned up files might be 'nicer' for you to work on going forward. It's great news that you will get some benefit from the exercise.

Are you saying that you have got the PDF exports working in T3?
Hmmmm - I think I would cautiously answer 'partly' to that one.

It is still missing a couple of key items before I would offer it as complete.
  • fonts are sizeable, but typefaces are limited to the 'standard' PDF fonts until I figure out how to embed a font into a PDF file. For me this would not be an issue. Sizing a font, I would require, but being able to specify Verdant Roman Fontface 37 for timber labels or whatever is just not something I care about, though I know some people do
  • I recall something about 'secondary' or 'alternate' colours which I don't think I ever really understood.
  • probably other bits
  • DEFINITELY thorough testing of all the combination of options needed
but basically the core functionality works - i.e. it draws rails - and accurately, and labels all the various bits, so definitely usable for me.

See below for a couple of examples of where I got to. I have no idea what setting produced these, or what aspect I was testing at the time - just a sample from my test output. :)

Cheers,

Graeme
 

Attachments

  • midland_central_2020_08_07_1542_56.png
    midland_central_2020_08_07_1542_56.png
    86.6 KB · Views: 114
  • midland_central_pages_2020_08_13_1022_11.pdf
    300.5 KB · Views: 110
  • midland_central_pages_2020_08_13_1020_46.pdf
    403.9 KB · Views: 105
_______________
message ref: 1605

graeme

Member
Location
Bangkok
Just FYI ......

I suddenly remembered as I fell asleep last night that the thing I was going to tackle next for PDF was the various forms of hatching available for sleepers. That DID seem to me to be a must-have before the code could really considered ready for serious use (perhaps the last such item - well, aside from a shedful of testing).

It should not be hard, as the PDF has such in-fill of shapes as a native capability. :)

Graeme
 
_______________
message ref: 1609

graeme

Member
Location
Bangkok
... and my next dopey idea in a long (seemingly endless!) series ...

For version numbering T4, how about using the 4xx series, with the xx indicating which version of T2 the code came from.

So for example, the 2.27 version of T2 would give rise to the 4.27 version of T4.

I expect that this will give us a few odd changes to make wherever version testing takes place, but on the plus side, it may help our poor old brains (mine at least) to keep things straight. :)

Cheers,

g
 
_______________
message ref: 1610

Martin Wynne

Admin
Location
West of the Severn UK
Info
.
Enjoy using Templot?
Thanks.

Please do not send requests for help direct to me via email.

Post your questions on the forum where everyone can see them and add
helpful replies.
For version numbering T4, how about using the 4xx series, with the xx indicating which version of T2 the code came from.

So for example, the 2.27 version of T2 would give rise to the 4.27 version of T4.
@graeme @Alistair Ward

Hi Graeme,

The original plan was for Templot2 to continue with version space up to 2.89

Templot3 preliminary development space 2.90 .. 2.99

Templot3 first full release as a replacement for Templot2 as 3.00

That would be as a fully open-source Lazarus project.

The open-source files I'm posting as Templot4/T4 are for Delphi5, not Lazarus. I called them T4 simply to differentiate them from Templot2 (not open-source) and from T3 (Lazarus).

I didn't give it a lot of thought. It's not too late to change the name on them if you want to keep the Templot4 name for future Lazarus developments.

cheers,

Martin.
 
_______________
message ref: 1612

Martin Wynne

Admin
Location
West of the Severn UK
Info
.
Enjoy using Templot?
Thanks.

Please do not send requests for help direct to me via email.

Post your questions on the forum where everyone can see them and add
helpful replies.
but basically the core functionality works - i.e. it draws rails - and accurately, and labels all the various bits, so definitely usable for me.
@graeme @Alistair Ward

Hi Graeme,

That PDF is looking good. :)

Is that all done open-source? Have you posted the code anywhere? I see you are posting stuff on Alistair's page at https://github.com/alistair-ward/templot3 , although I find it very difficult to follow what I'm seeing on there. Is the PDF stuff on there?

Should I be linking to there from my SourceForge account? Or closing that down, which I was thinking of doing?

cheers,

Martin.
 
_______________
message ref: 1613

graeme

Member
Location
Bangkok
That PDF is looking good. :)
Well it does OK with the 'default' template, but I have no allusions that it will stand up to rigorous use, given the level of testing it has had. :)
As a friend of mine often points out "nothing tests a system like production"

Is that all done open-source?
Yes indeed, as part of T3, though I did not actually intend to release it 'publicly' just yet.

There are actually 2 files:
  • pdf_unit.pas
  • pdf_lib_unit.pas
The first of these is heavily based on the original pdf_unit, and 'knows about' Templot data structures and drawing templates.
The second is a library unit which acts as a wrapper around the pdf library I chose. The idea was to remove any pdf-specific code from pdf_unit, and hide the details of the interface to the specific pdf library used.

It also hides other 'messy' details such as:
  • the fact that pdf.pas has the y-axis reversed (top<->bottom) from the normal pdf file convention. (Actually, I could have told pdf to act the other way up, but chose to keep the PDF files as near 'vanilla' as possible)
  • the fact that windows stores RGB colours as GBR internally, whereas PDF uses RGB. (@Alistair Ward - this sounds like it may have cross-platform implications)
If you wanted to move off the PDF library you are using, which I know is one of the proprietary components of T2, then by all means have a go at rolling this into your current source. I would be very pleased to have some more extensive usage, though I think you can tell from my description, it is far from ready for prime time, but if you think it looks promising, I would be happy to give it more focus.

I see you are posting stuff on Alistair's page at https://github.com/alistair-ward/templot3 , although I find it very difficult to follow what I'm seeing .....
If you look at the top left of that page, you will see "forked from openTemplot/templot3". My own templot3 repo has a similar pointer.

We have set up an organisation on GitHub (called openTemplot) to be the owner of the master repository for this code so it does not belong to any one single person. Then each of us has forked from that master, and we push changes to it when they are ready.

This is what Alistair was referring to when he spoke of protecting the code from 'vandalism'. Anyone can make a fork of the master and change that copy to their heart's content, but in reality neither we nor anyone else can actually 'push' code back to master. We raise what's known as a 'Pull Request' and the changes have to be pulled over from the master side, thus establishing the control.

Should I be linking to there from my SourceForge account? Or closing that down, which I was thinking of doing?
With regard to a link, I think it's a good idea, but maybe not until we have a clearer picture of how we will move from T3-based to T4-based. Perhaps if you could leave it a few days?

With respect to closing it down entirely, I have been pondering this since you posted a similar question a few days ago.

I did wonder whether perhaps that would be a good place to post the T4 code? Or would you prefer to post that only on the Club pages? SourceForge is a handy spot to have all the files grouped together in one place, but is that a useful thing?

Do I sound indecisive enough? o_O :ROFLMAO:

To be honest, I can see benefits for both options, and no strong reason against either. @Alistair Ward, any clearer (or at least more useful) thoughts?

Cheers,

g
 
_______________
message ref: 1614

Martin Wynne

Admin
Location
West of the Severn UK
Info
.
Enjoy using Templot?
Thanks.

Please do not send requests for help direct to me via email.

Post your questions on the forum where everyone can see them and add
helpful replies.
Do I sound indecisive enough? o_O
@graeme @Alistair Ward

Hi Graeme,

I'm as fuzzy-headed about all this as you are indecisive. :)

I don't think there is likely to be anyone else wanting to develop Templot in Delphi5 or Delphi7. It's not compatible as it stands with modern versions of Delphi. My only reason for posting my Templot2 files as open-source is so that you can rob them of code for use in Templot3, as you wanted.

Given that they would if compiled form a lesser version of Templot2 with bits missing, I have decided to rename them Templot1 (T1). There never was a Templot1, we went straight from TemplotZero to Templot2.

This leaves you or anyone else free to develop new versions of Templot from 3 to 99 or whatever.

I have renamed the topic T1 files, and updated the attached files.

My preference would be to post files and discuss them here on Templot Club. That gives Templot users a chance to follow the action and join in with useful ideas, even if they can't do the coding stuff.

The main point of the SourceForge account was so that a Templot download remains available if I get run over by a bus and stop paying for the Templot Club hosting. That's still a valid point, although it's going to get confusing if the actual development is elsewhere from SourceForge on your Git pages.

cheers,

Martin.
 
_______________
message ref: 1615

Martin Wynne

Admin
Location
West of the Severn UK
Info
.
Enjoy using Templot?
Thanks.

Please do not send requests for help direct to me via email.

Post your questions on the forum where everyone can see them and add
helpful replies.
If you wanted to move off the PDF library you are using, which I know is one of the proprietary components of T2, then by all means have a go at rolling this into your current source.
@graeme

The main reason for including a native PDF export in Templot (instead of simply using one of the many virtual printers), is that users can set a large PDF page size, several metres long and a metre or so wide. For wide-format printing of track plans on roll paper. Is your PDF library able to do that -- I'm a bit puzzled by your saying the Y-dimension is reversed, the TCanvas origin is always top-left?

cheers,

Martin.
 
_______________
message ref: 1616

Phil O

Member
Location
Plymouth.
Hi, Martin and Graeme,

The ability to get large prints is definitely a big plus having recently had a 5M x 3.5M print done in 4 rows. I don't have a clue about the rest of the thread content, but I follow it incase I can learn something.
 
_______________
message ref: 1619

Alistair Ward

Member
Thread starter
@graeme

Hi Martin and Graeme,

I've been fairly quiet on this so far :) (it wasn't a great weekend here - massive rainfall, flooding etc, topped off with a nasty cold and a couple of days off work)

Martin, I'm really pleased to see the "T1" files appearing. I hope that you are actually able to keep using these as your base for ongoing development, as it will make things much easier to merge changes.

Graeme, I would suggest creating a separate repo under the openTemplot organisation (called templot1 perhaps?), and committing the files from Martin as he releases them. Make sure there is a suitable warning that this is not intended to be a compilable/usable project!

It will then be up to us to scan through those files for relevant changes to merge into t3. In the future, if Martin bases ongoing development on those files, then we will easily be able to get diffs for new work.

In the meantime, I started pulling on a thread... I was looking at pulling stuff out of pad_unit, so I could try to reduce the cross-unit dependencies. I am now in the process of reworking the dummy vehicle code, pulling it out into a separate, unit-testable class. (or as Capt. Oates said, "I'm just going outside and I may be some time...").

Cheers,
Alistair.
 
_______________
message ref: 1624

graeme

Member
Location
Bangkok
Given that they would if compiled form a lesser version of Templot2 with bits missing, I have decided to rename them Templot1 (T1).
That sounds like a great idea, and is a much better reflection of where they stand in the scheme of things (logically, if not chronologically).

My preference would be to post files and discuss them here on Templot Club. That gives Templot users a chance to follow the action and join in with useful ideas, even if they can't do the coding stuff.
This sounds good too.

The main point of the SourceForge account was so that a Templot download remains available if I get run over by a bus and stop paying for the Templot Club hosting.
This rationale has now taken something of a back seat as we now have several people with copies of the source and a home on Github (where I will open a repo for T1).

I agree that it could be a bit confusing, and feel more confident to suggest that perhaps Sourceforge is not needed now.

Cheers,

Graeme
 
_______________
message ref: 1625

graeme

Member
Location
Bangkok
The main reason for including a native PDF export in Templot (instead of simply using one of the many virtual printers), is that users can set a large PDF page size, several metres long and a metre or so wide. For wide-format printing of track plans on roll paper. Is your PDF library able to do that
Yes indeed - although I just did a quick test and it seems I may have some issues to address in my code. :oops:

-- I'm a bit puzzled by your saying the Y-dimension is reversed, the TCanvas origin is always top-left?
Absolutely ... BUT ... PDF files natively have the origin at the bottom left.

I origin(no pun intended)ally decided to go with the native PDF style (i.e. bottom left) but have now decided it was a bad choice. I will be amending the code accordingly. It created more work for no real benefit.

Cheers,

g
 
_______________
message ref: 1626

graeme

Member
Location
Bangkok
topped off with a nasty cold and a couple of days off work)
Doesn't sound good! I hope you are on the mend soon.

Graeme, I would suggest creating a separate repo .....
hahahaha - in hand as we speak

In the meantime, I started pulling on a thread... I was looking at pulling stuff out of pad_unit, so I could try to reduce the cross-unit dependencies. I am now in the process of reworking the dummy vehicle code, pulling it out into a separate, unit-testable class. (or as Capt. Oates said, "I'm just going outside and I may be some time...").
This kind of thing normally leaves me with no jumper and a pile of wool next to me. Good luck!
 
_______________
message ref: 1627

graeme

Member
Location
Bangkok
Absolutely ... BUT ... PDF files natively have the origin at the bottom left.

I origin(no pun intended)ally decided to go with the native PDF style (i.e. bottom left) but have now decided it was a bad choice. I will be amending the code accordingly. It created more work for no real benefit.

Sorry, Martin, but I just realised that I missed out half of the explanation here! :/

I am not using a TCanvas. I am making my own calls on the PDF library to do the actual drawing directly, rather than drawing on a TCanvas then asking for that to be translated into a PDF for me.

Hence, it matters to me that the PDF origin is at a different place from the TCanvas origin, and it is that 'caring' that is hidden away in my pdf_lib_unit.

I hope that's a bit clearer.

Cheers,

g
 
_______________
message ref: 1628
Top