Templot Club forums powered for Martin Wynne by XenForo :
  • 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.

getting T5 off the ground

Quick reply >

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 make
helpful replies.
.
This an old topic. Latest info at:

https://85a.uk/templot/club/index.php?threads/open-source-templot5-now-on-github.969/



@nickom @NoIdea @Rusty @Alistair Ward @graeme @Steve_Cornford @James Walters @Phil G @Paul Boyd

I have created a page for Templot5 on Github:

https://github.com/Martin-Wynne/Templot5

But do not run away with the idea that I have the faintest idea what I'm doing, because I don't. :)

I have uploaded a couple of test files to that page. To do that I installed a (free) program called Github Desktop:

https://github.com/apps/desktop

and selected the default option at each stage of the install. I needed to have created an account on https://github.com first, and I already had Notepad++ on my system as a suitable text editor (free): https://notepad-plus-plus.org

I do not know if you can access that page without doing those things and/or installing Github Desktop.

I do not know what happens next.

But I will upload a few more files from my Lazarus project until eventually the whole lot will be there. And also do some housekeeping here on Templot Club so that we have a separate topic for Git discussions (assuming we need one?).

I shall continue to post zip files here also, because for those I do know what I'm doing.

cheers,

Martin.
 
_______________
message ref: 11889
But it seems that he is still actively working on a version of Templot called bigbang derived from the 2018 code.

bigbang is the name of a Git branch. We don't need to worry about branches for now.

There is very little activity and no contributions by Alistair in 2024, and, since no-one has responded to other attempts to communicate with him, I'm inclined to leave them to their fork of Templot2. This is not unheard of in the open source world.

I have created a page for Templot5 on Github:

Great! I'll have a look and install GitHub Desktop when I get a minute.

I do not know what happens next.

Let's start with understanding where the source code resides on your machine. I'm guessing you have two directories called Templot2 and Templot5 and you copy files to another directory called OpenTemplot which you zip up and publish on the forum?
 
_______________
message ref: 11895
bigbang is the name of a Git branch. We don't need to worry about branches for now.

There is very little activity and no contributions by Alistair in 2024, and, since no-one has responded to other attempts to communicate with him, I'm inclined to leave them to their fork of Templot2. This is not unheard of in the open source world.



Great! I'll have a look and install GitHub Desktop when I get a minute.



Let's start with understanding where the source code resides on your machine. I'm guessing you have two directories called Templot2 and Templot5 and you copy files to another directory called OpenTemplot which you zip up and publish on the forum?
@NoIdea

Hi Martin,

Thanks.

I created a new folder GIT_T5

It has gained a sub-folder .git

When I copy files into it, Github Desktop knows about it and invites me to first Commit, and then Push the files. It seems to work.

I have pushed a few files as a test. Later today I intend to push some modified versions of them which I'm working on, and see what happens. :)

cheers,

Martin.
 
_______________
message ref: 11896
I do not know if you can access that page without doing those things and/or installing Github Desktop.

Hi Martin,

I already had a GitHub account so I've been able to clone your repository to my local machine easily and I've installed the Desktop.

It has gained a sub-folder .git

Everyone has a copy of the entire repository in the .git folder.

Ok, I now need to explain why I asked where you stored your source files. Perhaps if I approach this another way it'll make more sense.

What we're trying to achieve is a single folder GIT_T5 that contains all the Templot 5 files - both open source and the complete version. Now that may sound scary but achieving this will avoid the need to cut-copy-paste anything. The key to this is the ability to ignore files:

1720887075950.png


1720887036767.png


In here you can add the files you DONT want to share. Would you mind giving this a go? To do this create a file called private.pas, add it to ignored files, commit and push. When I pull I will be able to see the ignored file name in the special .gitignore file but I won't be able to see the file itself, or its contents.
 
_______________
message ref: 11899
Hi Martin,

I already had a GitHub account so I've been able to clone your repository to my local machine easily and I've installed the Desktop.



Everyone has a copy of the entire repository in the .git folder.

Ok, I now need to explain why I asked where you stored your source files. Perhaps if I approach this another way it'll make more sense.

What we're trying to achieve is a single folder GIT_T5 that contains all the Templot 5 files - both open source and the complete version. Now that may sound scary but achieving this will avoid the need to cut-copy-paste anything. The key to this is the ability to ignore files:

View attachment 10138

View attachment 10137

In here you can add the files you DONT want to share. Would you mind giving this a go? To do this create a file called private.pas, add it to ignored files, commit and push. When I pull I will be able to see the ignored file name in the special .gitignore file but I won't be able to see the file itself, or its contents.
@NoIdea

Hi Martin,

Thanks for that, but some confusion here. There aren't any files in the Templot5 project which I don't want to share.

Those files are in the Templot2 project which is in a completely different set of folders and compiled in Delphi5. I have worked round them for Templot5 in Lazarus by using helper executables compiled in Delphi. I am licensed to publish the executables but not the source or access keys. It means those functions will be available on Windows only, but Templot has always been so. Running on other platforms will have to go without such functions until we can find open-source alternatives.

re gitignore, can you clarify whether such files (if I need to use them at any time) are uploaded to the Github server, but then not accessible to anyone? Or do they never leave my computer? I think the former would break the licence terms for the components, since obviously they would be accessible to the Github admin.

Where I'm not clear is the whole process of merging files from other contributors. How you get to try them out in advance, and how you decide which bits to merge into which other bits, and which not?

Thanks again,

Martin.
 
_______________
message ref: 11900
A quick update, I'm still following the discussion.

Have setup a local git repository, with a simple test Lazarus project in it.

Have setup a GitHub repository for the project, and pushed the local repository to it.

Have pulled the GitHub repository to a different machine, modified the program and pushed the changes to back GitHub.

Will have more of a play around with Lazarus and Pascal, and then start trying to learn the Templot code.

Kind regards,
Tim.
 
_______________
message ref: 11903
Are you still modifying files in Templot2, Martin?
@NoIdea

Hi Martin,

I haven't done since I released 245a. I'm not planning to do any more development in Templot2.

My plan is to release one final version of Templot2 to automate a seamless transition to Templot5. There is no time-scale for that until we have got Templot5 working smoothly. Ideally the transition will be completely transparent* to users, although it will be hard work to eliminate every slight quirk.

I don't know yet how the automated updates will work in Templot5? Will the update be on my server as it is now, or will it be on Github?

*Apart from the missing sketchboard. To use that it will be necessary to retain the final Templot2 release.

cheers,

Martin.
 
_______________
message ref: 11905
OK, so you are now doing all your development work in a folder called, say, Templot5, and experimenting with GIT in your GIT_T5 folder?
 
_______________
message ref: 11906
OK, so you are now doing all your development work in a folder called, say, Templot5, and experimenting with GIT in your GIT_T5 folder?

Yes. The working folder is called LAZARUS_T5.

I also use AJC Active Backup, which means I have a full set of files going back through all the changes:

https://www.ajcsoft.com/active-backup.htm

cheers,

Martin.
 
_______________
message ref: 11907
My plan is to release one final version of Templot2 to automate a seamless transition to Templot5. There is no time-scale for that until we have got Templot5 working smoothly. Ideally the transition will be completely transparent to users, although it will be hard work to eliminate every slight quirk.
Makes sense.
I don't know yet how the automated updates will work in Templot5? Will the update be on my server as it is now, or will it be on Github?
No, I don't yet either :).

For the time being you could remain as the publisher as you do now so the update would be on your server.

re gitignore, can you clarify whether such files (if I need to use them at any time) are uploaded to the Github server, but then not accessible to anyone? Or do they never leave my computer? I think the former would break the licence terms for the components, since obviously they would be accessible to the Github admin.
They never leave your computer. We can all see a reference to the file name in gitignore, but not the file or its contents.
Where I'm not clear is the whole process of merging files from other contributors. How you get to try them out in advance, and how you decide which bits to merge into which other bits, and which not?
I'd like to say there's a simple answer to this, but there isn't. There are ways to handle this but I don't want to overload the participants in this thread too much.

For now it appears that Steve is the only contributor and if he's happy to post files on the forum and you are happy to diff the changes in your files I'd stick with that for now. I need to remind myself how GitHub handles submissions (note: not file merges) - which deals with the 'try them out in advance' problem. [For those following along I'm referring to Pull Requests.]
 
_______________
message ref: 11908
@nickom @NoIdea @Rusty @Alistair Ward @graeme @Steve_Cornford @James Walters @Phil G @Paul Boyd @Tim Adams

I have created a new forum section specifically for the Templot5 Git discussions and moved some of the existing posts into this topic.

If you want to receive email notifications for all the posts on this new section, you need to add this section to your watched forums in your account settings:

https://85a.uk/templot/club/index.php?forums/templot5-on-git.57/



I have now uploaded to GitHub a full set of my current Lazarus files, as at 15th July 2024.

See: https://github.com/Martin-Wynne/Templot5

If you look at pdf_laz_unit.pas and export_unit.pas you can see the diffs from the previous version in multicolour.

In addition to the files there are 2 folders:

HTML_VIEWER_MODS contains the modified files for the FrameViewer09/HtmlViewer package. These are the same as in the zip file which I posted a few weeks ago. There are no changes.

TEMPLOT5_OUTPUT is a dummy Templot5 installation and includes the Templot folder structure. It includes in the \internal\ folder, with 2 helper executable files:

t2_converter.exe does the file conversion for loading old-format Templot2 BOX files. It's not needed for the current BOX file format. It could be open-sourced but since it will compile only on Delphi5 and not on Lazarus, it could get confusing and get folks in a muddle.

pdf\pdf_creator.exe does the PDF export function. Templot5 generates an EMF file for each template page, and pdf_creator.exe uses them to create a single PDF file. This is also compiled on Delphi5, but can't be open-sourced because it uses a licensed PDF generator component.

TEMPLOT5_OUTPUT also contains templot_5.exe which is the latest runnable update version of Templot 555a.


I have also uploaded Steve's most recent dxf_unit.pas without as yet modifying my working copy of dxf_unit.pas . You can therefore see the diffs between them in multicolour at:

https://github.com/Martin-Wynne/Templot5/commit/5bba3c724000e061070f45cc65688724e49bea04



Hopefully these files will get Templot5 going as an active GitHub project, which will prove useful. I'm still a bit unsure about whether all this Git stuff is going to be a help or a hindrance to the project.

p.s. This doesn't replace the zip files on here, I will post another one shortly. No doubt time will tell which way of working is best for us.


EMF metafiles were needed for the PDF export, and I found myself re-working stuff that I did 5 years ago:

https://85a.uk/templot/archive/topics/topic_3545.php

Where did the time go? :)

Martin.
 
_______________
message ref: 11930
A quick update, I'm still following the discussion.

Have setup a local git repository, with a simple test Lazarus project in it.

Have setup a GitHub repository for the project, and pushed the local repository to it.

Have pulled the GitHub repository to a different machine, modified the program and pushed the changes to back GitHub.

Will have more of a play around with Lazarus and Pascal, and then start trying to learn the Templot code.

Kind regards,
Tim.
@Tim Adams

Hi Tim,

Welcome to Templot Club. :)

Good to have you along on this project. As you've probably realised it's a big change happening at present. For over 25 years now Templot has been a closed-source program compiled in Delphi5, and before that on other computers. The move to working in Lazarus and fully open-source is a sea-change and it's all new to me. Every day is a school-day. :)

cheers,

Martin.
 
_______________
message ref: 11931
OR perhaps once I have edited a file on my pc do I fork , then make a pull request to Martin?
Steve
@nickom @NoIdea @Rusty @Alistair Ward @graeme @Steve_Cornford @James Walters @Phil G @Paul Boyd @Tim Adams

Hi Steve,

This is where we are waiting for guidance from those in the know. :unsure:

I'm very reluctant to be in a position where I have to provide permission for anyone to do anything. As far as I know anyone can commit, push or pull or whatever on the current Templot5 GitHub and I'm happy with that. I want anyone to be able to join in without asking. Presumably if we don't like something which someone has put there we don't pull it back into our own copy of Git.

Whether we need another GitHub thingy with restricted access I'm not sure. It's still clear as mud after all these years. :(

For OpenTemplot2024 I'm assuming we just post files here on Templot Club, and folks do whatever they want with them, with no reference to Git. Or maybe not?

cheers,

Martin.
 
_______________
message ref: 11941
_______________
message ref: 11943
Hi Martin,

I had used git desktop to create a Templot5 in my local github, and just now have used the fetch origin to update my local copy with the latest dfx_unit that you had uploaded to your github.

I then used git desktop to invoke explorer in my local Templot5 (cant use the notepad++ button in gitdesktop as it says there are too many files to open) to browse the files.
I double clicked on dfx_unit, which opend it in Lazarus IDE.

I then added a // minibo section to both load and save sections.
I then exited from Lazarus iDE and it asked if i should save changes, to which i said yes.

GD (gitdesktop) the showed that the file had been changed (and also that a /backup/dfx_unit.pas had been created).

having read the GitPro document.

I selected the changed dfx_unit, then took the option "create fork", which creates a local fork and allowed me to commit.

This then created a pull request to you, so that you can check the revisions (or so I understand) before you either accept or reject them.
I think!

Hopefully you can reject the backup copy and just accept the edited copy?

1721138796430.png




Steve
 
_______________
message ref: 11944
Hi Martin,
then I discovered a typo.....
I had misread bl_x, bl_y,bl_z as b1_x,b1_y,b1_z

ie had used digit 1 instead of character l.

doh... bl short for backlash.

so having corrected typo, GD allowed me to push the change to you... I think!

Sorry for any confusion.
Steve

ps the commit labelled typo was wrong, so I have reverted it....
the correct commit is labelled "update dxf_unit.pas"

double sorry if I have mucked it all up.
Stev
 
_______________
message ref: 11945
Last edited:
@Steve_Cornford

Hi Steve,

I'm lost. I haven't received any email or notification that you have sent me anything or are requesting me to do anything.

On GitHub I see that I now have 1 branch and 2 forks. When I click on 2 forks I see only one fork -- yours. If I click on it it takes me to your GitHub page, but no indication of what I should do when I get there. It seems to be very similar to mine.

In GitHub Desktop, nothing has changed at all since I uploaded your previous file an hour or so ago.

You seem to be saying that you are working in Lazarus directly in your Git folder? Is that how it's intended to work? That must mean that GitHub Desktop sees all your Lazarus files including the object files, backups and settings? Surely we don't need all those in the Git?

Reading elsewhere we can apparently choose between a "fork and pull" model or a "shared repository" model. I don't know which I have created or how to change from one to the other.

Hopefully someone will arrive to explain it. :confused:

cheers,

Martin.
 
_______________
message ref: 11946
_______________
message ref: 11947
@Steve_Cornford

Hi Steve,

I think in order to send stuff back from your fork to mine you need to synchronize the fork:


sync_fork.png



Did you do that? I still can't see any evidence that you have sent me anything. :(

cheers,

Martin.
 
_______________
message ref: 11948
Hi Martin,

It would not let me sync, but suggested i create a pull request.

You should now be able to see that you have 1 pull request, and be able to view it.

Steve
@Steve_Cornford

Hi Steve,

(y) Yes, I've received an email with a link to the page on GitHub. On there I can see a green button to try automatically merging it, so I will see what that does. :)

Martin.
 
_______________
message ref: 11951
@Steve_Cornford

That seems to have worked and shows dxf_unit.pas with your changes. :)

However, it now also contains a folder called backup containing a file called dxf_unit.pas.bak

What's more those are also magically in the Git folder on my computer!

These appear to be your Lazarus backups and are surely not wanted by anyone else?

I'm running Lazarus in a separate folder and copying files to my Git folder only when ready to share them. Is that the intended method, or are we in a muddle?

Thanks for the book link, I will have a look.

cheers,

Martin.
 
_______________
message ref: 11953
@Steve_Cornford

Hi Steve,

dxf_unit.pas is a big and important unit with a lot of the 3D stuff in it.

I think it might be better to be experimenting in Git on something smaller in case we mess up. I'm minded to split the custom load/save functions into a separate small unit. This will also mean we can have a modal form showing the readable contents of the file before saving and after loading before clicking OK. Which would be useful to see exactly what is in a given SK4 file while the plug track is being developed and new functions added.

It will also be interesting to see what Git makes of such a change, which is the sort of thing I do often.

cheers,

Martin.
 
_______________
message ref: 11954
Hi Martin,
I have now deleted the backup folder in my local github folder. Then I committed that change, which meant it was documented within online GitHub.
Then within online Github I created a pull request for you.

I believe if you action it, it will have the effect of also removing the backup folder from within your Templot5 folder.


Splitting dxf_unit.pas

Whatever you think best Martin.
Would that mean that you somehow define the parameters being saved as global?
STeve
 
_______________
message ref: 11955
Would that mean that you somehow define the parameters being saved as global?
@Steve_Cornford

Hi Steve,

No, it just means moving any of them which are declared in the implementation section into the interface section. Most of them are already there. It won't have any effect on the changes you have made.

I will have a boiled egg and then have a look at it. :)

p.s. that pull has worked and removed the backup. It also vanished from my Git folder as soon as I opened GitHub Desktop. (y)

Martin.
 
_______________
message ref: 11956
Glad that worked

I have a couple of more lines to add to the save and load sections, is it ok if i add them whilst you are pondering & digesting that oval thingy?


Thanks Martin,
Another something new learnt today.

Interface == public == what i used to know as a data division global
Implementation == private == what i used to know as a data division local

By the way when I was cross referencing I came across the following variables that were being used but did not have an associated form to allow user amendment :-

seat_thick (previously notified & you responded)

clip_shaft_width
clip_top_width
clip_top_length
clip_arms_width
clip_outers_width
clip_outers_length

clip_socket_flap_top_depth
clip_socket_flap_top_length

clip_tang_roof_front_depth
clip_tang_roof_back_depth
clip_tang_floor_depth
clip_tang_default_depth

loose_pin_bottom_chamfer_clear
slot_angle

fw_correction_check
fw_tweak_xing
fw_tweak_check

chair_web_adjustment


Just thought I would send you this list for completeness

Steve
 
_______________
message ref: 11957
Last edited:
Glad that worked

I have a couple of more lines to add to the save and load sections, is it ok if i add them whilst you are pondering & digesting that oval thingy?


Thanks Martin,
Another something new learnt today.

Interface == public == what i used to know as a data division local
Implementation == private == what i used to know as a data division global

By the way when I was cross referencing I came across the following variables that were being used but did not have an associated form to allow user amendment :-

seat_thick (previously notified & you responded)

clip_shaft_width
clip_top_width
clip_top_length
clip_arms_width
clip_outers_width
clip_outers_length

clip_socket_flap_top_depth
clip_socket_flap_top_length

clip_tang_roof_front_depth
clip_tang_roof_back_depth
clip_tang_floor_depth
clip_tang_default_depth

loose_pin_bottom_chamfer_clear
slot_angle

fw_correction_check
fw_tweak_xing
fw_tweak_check

chair_web_adjustment


Just thought I would send you this list for completeness

Steve
@Steve_Cornford

Hi Steve,

Yes, carry on with whatever you want to do. I can easily move the relevant lines later if I change things.

Thanks for compiling the list. The reason is that all those are still very experimental. Or at least they were at the time -- several months have gone by since without any changes.

I notice in the naming that we have two different meanings for "clip_" -- one is for the brick connector clips, and the other is for the clip-fit plugs. Ideally that needs changing.

p.s. Having now escaped from the PDF and EMF device contexts, I have finally had a proper look at what you have been doing. You have done an amazing amount of work and I am very grateful. Thanks. :)

Martin.
 
_______________
message ref: 11958
Hi Martin,

Just sent you a pull requestfor dxf_unit containing the final last two save , load sections that I have added.

I think that is the lot for now, well until you add a load more variables for your eight sided chairs. :)

Only too glad to help spread the load.

Let me know if there is anything else you want to delegate.

Steve
 
_______________
message ref: 11959
Let me know if there is anything else you want to delegate.
@Steve_Cornford

Hi Steve,

Well ok, here you go. :)

I've just added this menu item and uploaded it to Git:


conn_clip_dims.png



The file is bgnd_unit.pas (background shapes).

The code for the OnClick event is at the bottom of the file. If you wanted to add some code to enter the clip dimensions, that would be fine. But only when you have time and feel the need to do a bit of coding. :)

You should be able to copy the code from other similar places and edit it.

Note that this will change the size of all the clips. Adding some code to set the size of each clip individually would be a lot more work.

cheers,

Martin.
 
_______________
message ref: 11960
@Steve_Cornford

Hi Steve,

I think this is worth doing, although most users will probably click straight through:


custom_data_preview.png



When loading a file you can see the contents before clicking ok to load.

It's not quite finished yet, and I won't have much time to do any more today.

Thanks again for your help on this.

cheers,

Martin.
 
_______________
message ref: 11961
I copied the latest bgnd_unit.pas file into my Lazarus IDE folder.
I inserted some code using Lazarus IDE, and when built & tested error free (fingers crossed) I exited from Lazarus IDE and chose the option to [update]

I then invoked GD (GitDesktop) to get this screen:
1721227756475.png

as you can see this states "no local changes".

I then copied the updated file form my Lazarus folder into my local GITHUB repository which resulted in GD recognising this and showing:-
1721227930238.png

I then typed some info into the description box that is just above the (Commit to main) blue button.
1721228199717.png

then clicked the (Commit to main) button.
This results in:-
1721228273214.png

Now we need to click on the (push origin) button in order to apply the local to my (Steve Cornford) fork of Templot5 on the online GitHub system.

GD now displays:-
1721228428929.png

The next step is to select Repository > View on GitHub fomr the GD menu bar.
This invokes my browser (firefox) and displays this web page:-
1721228591154.png

I now need to click on the dropdown arrow in the fork button :
1721228684257.png

and select "SteveCornford/Templot5" to show:-
1721228789054.png

You can see it states "this branch is 1 commit ahead of Martin-Wynne/Templot5:main"
Clicking on the blue text
1 commit ahead of invokes this screen:-
1721228965445.png

and now all i have to do is click on the green ( create pull request ) button. This sends a pull request to Martin, which he can then take action on.

Steve
 
_______________
message ref: 11976
This sends a pull request to Martin, which he can then take action on.
@Steve_Cornford

Hi Steve,

Email received and actioned, and then fetched into my Git folder. (y)

I then copy and paste the new file(s) into my Lazarus project folder. I think you are skipping that step by having your Lazarus project in your Git folder? What are the pros and cons of that?

cheers,

Martin.
 
_______________
message ref: 11977
Hi Martin,
No I did not skip that.

Step 1 was:
Copy bgnd_unit.pas from my local /github/templot5 folder to my Lazarus IDE folder which is actually c:/opentemplot2024.

Then used Lazurys IDE to update it..... etc


I have stopped using Lazarus IDE directly on a file in my locall /github/templot5 folder as when you
Exit from Lazarus it creates the backup sub folder which if it is in my local /github/templot5 folder gets included in the commit to main snapshot on the remote GitHub
.

I suppose I could switch off backups in Lazarus.

Steve
 
_______________
message ref: 11978
Separate lazarus folder to github
Con
Have to be careful when copying files that we copy the right file.
Yet two more steps in process.

Same Lazarus folder to github
Con
The Lazarus backup sub folder gets tracked By github, UNLESS lazarus backup is switched off.
Pro
Less steps in development process.


Steve
 
_______________
message ref: 11979
Back
Top