click here for a list of all existing Templot documentation
Important Privacy Information cookie information pre-print options:    

click image to open Templot Club in a new tab
Templot club top logo
looking for Templot? - (free)



 you are not logged in  - Login | Join


receive all messages by email: info


Recent Topics
Front Page  Search  Image Gallery  Gallery Upload  My Account  Members  Open Source  TemplotMEC  Help  
make a donation  
please click: important information for new members and first-time visitors Templot Companion - User Guide
            messages archive on Yahoo
page trail:  Templot Club > Forums > OpenTemplot Project > Making changes to OpenTemplot versions
Templot web site

                                       Making changes to OpenTemplot versions
     
 Start new topic   Reply blank   Printer friendly 
  Rate this topic  
AuthorMessage
 Clicked a link? Wrong message? Wait until the page has finished loading, click in the address bar and then press the Enter key. This is a timing bug in some browsers.
1st message | this message only posted: 14 Jun 2018 22:29
 PM  Reply with quote  Reply blank 
from:
Adrian
 

 

view images in gallery
view images as slides
Hi,
Okay this is my first effort at trying to contribute to the OpenTemplot build. 

I started looking at the pdf export but I can't find the procedure pdf_draw so I presume it's been completely removed for licencing reasons. So I thought I'd start with something simple just to see if I could remember some of my pascal programming from years ago. 

In Martins list of missing features it mentions the lack of being able to print the function key chart. So that's what I looked at tonight.

So attached is an updated chat_unit.pas file with the changes necessary to enable the function key chart processing. The form also needs updating to include the TPrinterDialog but I can't work out how to post with 2 attachments. Perhaps it's a feature of using Safari on OSX?

__________
message ref: 25005
Attachment: chat_unit.pas (Downloaded 13 times)
 
 Clicked a link? Wrong message? Wait until the page has finished loading, click in the address bar and then press the Enter key. This is a timing bug in some browsers.
2nd message | this message only posted: 14 Jun 2018 22:32
 PM  Reply with quote  Reply blank 
from:
Adrian
 

 

view images in gallery
view images as slides
and as mentioned this is the form.
I'd be interested to know if people can use these 2 files as supplied. If included in the build then under the help menu where there is the option to print the Function Key Chart this should now work.

I get the same output from Templot2 and OpenTemplot.

Regards

Adrian

__________
message ref: 25006
Attachment: chat_unit.lfm (Downloaded 9 times)
 
 Clicked a link? Wrong message? Wait until the page has finished loading, click in the address bar and then press the Enter key. This is a timing bug in some browsers.
3rd message | this message only posted: 14 Jun 2018 23:24
 PM  Reply with quote  Reply blank 
from:
Rob Manchester
Manchester



view images in gallery
view images as slides
Adrian wrote: Hi,
I can't work out how to post with 2 attachments. Perhaps it's a feature of using Safari on OSX?
Adrian,

As far as I know it is 1 attachment per post regardless of the browser/OS.

Rob


__________
message ref: 25007

 
 Clicked a link? Wrong message? Wait until the page has finished loading, click in the address bar and then press the Enter key. This is a timing bug in some browsers.
4th message | this message only posted: 15 Jun 2018 01:12
 PM  Reply with quote  Reply blank 
from:
Martin Wynne
West Of The Severn, United Kingdom



view images in gallery
view images as slides

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

Post your questions on the forum where everyone can see them and add helpful replies.
Hi Adrian,

Many thanks for doing that. :thumb:

Well done for finding the F-key chart in the chat_unit. I have no idea why it is there and not in the help_sheet, it's just a legacy from the beginning of time. You will find a great many similar illogicalities in the code. I leave them alone on the basis of if it ain't broke don't fix it. :)

A few points:

1. Yes, only one file attachment per post on this forum. I feel that's a good thing because it means each file gets its own description with no risk of confusion. It's no real hardship to make another post, but if necessary several files can be put in a single zip file. (This doesn't apply to images, which go in the image gallery, not file attachments. You can have as many of those in a post as you wish.)

2. There was no need to add a printer dialog to the form, the dialog in use is created in code and the one you added isn't used. Which in turn means there was no need for any changes to the .lfm file.

It's done that way because at one time (you may remember) there were problems with Templot crashing on startup if there was no default printer installed on the system. The form can't be created (in Delphi5) if it contains a printer dialog component and there is no default printer available. Nowadays there is always a printer, because Windows7+ installs the Microsoft XPS writer, so it is no longer a problem.

3. You set:

   width_dots:=Printer.PaperSize.Width;
  length_dots:=Printer.PaperSize.Height;


For the printed templates I used:

      width_dots:=Printer.PageWidth;
  length_dots:=Printer.PageHeight;


Generally the printable page area is smaller than the paper size.

However in this case these two values aren't actually used, except to establish that we are getting sensible data from the printer driver. The F-Key chart is printed at a fixed size to match the function key spacing on a standard Windows keyboard, so that it can be placed directly behind the keyboard. So the paper size and page size doesn't come into it.

There is far more information available in the Windows GetCaps than in this simplified Lazarus printer wrapper, but it seems to cover all we need.

4. Now I have a question. How is the best way to handle a file update such as this? Does it need a version number in the file name? Should it be posted as a .txt file rather than .pas to allow that? For example this file could have been chat_unit_v2.txt

Users can then open it in any editor and copy and paste into their chat_unit.pas file in Lazarus. The name of that file can't change -- it would need a lot of editing in other units. So simply replacing it leaves you with no record that you have done so.

Also, I would think the version number needs to be in the file at the top comments.

On the other hand, should this download be on Sourceforge instead of here? Or is that done only after we have tried and tested it here?

I must confess that I'm mighty confused how these collaborative projects are best handled. :?

cheers,

Martin.

__________
message ref: 25008

 
 Clicked a link? Wrong message? Wait until the page has finished loading, click in the address bar and then press the Enter key. This is a timing bug in some browsers.
5th message | this message only posted: 15 Jun 2018 12:08
 PM  Reply with quote  Reply blank 
from:
Martin Wynne
West Of The Severn, United Kingdom



view images in gallery
view images as slides

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

Post your questions on the forum where everyone can see them and add helpful replies.
Hi Adrian,

I think perhaps we need a convention where anyone posting modified code adds their name (or an identifer) and the date, such as

    width_dpi:=Printer.XDPI;  // 14-06-18  Adrian

or

  // printer mods for OT from T2  14-06-18  Adrian BEGIN ...

    code
    code
    code

  // Adrian END

That would protect their copyright in the event they post a brilliant new idea, and makes it easier for anyone wanting to query the change to know who to ask. The date makes it possible to trace the sequence of changes if necessary.

On the other hand that's just my idea, I've no knowledge of how other projects handle such things.

I have again tried to do in Tortoise what Sourceforge is telling me to do, but no matter what I try it produces error messages. I really don't want this hassle, it seems to be way over the top in complexity for what we need. I especially don't want anyone to have to go through the same hassle just to get a copy of the latest code. There must be something simpler?

Also at present I have to log in to make changes, which defeats the purpose of creating something which can continue without me.

The same would apply to anyone else who sets something up, if the bus then gets them. :(

How do other projects get round this?

cheers,

Martin.

__________
message ref: 25012

 
 Clicked a link? Wrong message? Wait until the page has finished loading, click in the address bar and then press the Enter key. This is a timing bug in some browsers.
6th message | this message only posted: 15 Jun 2018 12:44
 PM  Reply with quote  Reply blank 
from:
Adrian
 

 

view images in gallery
view images as slides
Martin Wynne wrote:
2. There was no need to add a printer dialog to the form, the dialog in use is created in code and the one you added isn't used. Which in turn means there was no need for any changes to the .lfm file.
Thanks for the feedback - I'm always willing to learn.
I said it was a long time ago using pascal, and with respect to the printer dialog I've worked out what happened. When I first ran the print F-key routine it gave me the following error



So the usual click and fiddle technique of mine I dropped the TprinterDialog onto the form and lo and behold the error message went away. So that was a result in my book.

With respect to your note I went back in and removed the printer dialog from the form and it still worked! A little more digging around I finally realised that the process of adding the printer dialog to the form added in to the uses clause the PrintersDlgs class (do they call them classes or units or something else?). So that was today's lesson.:D



When I get time I'll try and respond to your other points.

Regards

Adrian



__________
message ref: 25013

 
 Clicked a link? Wrong message? Wait until the page has finished loading, click in the address bar and then press the Enter key. This is a timing bug in some browsers.
7th message | this message only posted: 15 Jun 2018 13:43
 PM  Reply with quote  Reply blank 
from:
Martin Wynne
West Of The Severn, United Kingdom



view images in gallery
view images as slides

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

Post your questions on the forum where everyone can see them and add helpful replies.
Adrian wrote:I finally realised that the process of adding the printer dialog to the form added in to the uses clause the PrintersDlgs class (do they call them classes or units or something else?).Hi Adrian,

It's called a Unit. It is just a file containing a chunk of code. (Classes have properties, methods, etc.)

You can see what's in it (and modify it if feeling brave) by clicking on it in the editor and then right-clicking, then Find Declaration of PrintersDlgs.

When you get a "not found" error, the first place to look is always in the uses clauses (there are 2 of them).

I found when converting to Lazarus that several things are in different units from Delphi.

Note also when looking for "not founds" that Pascal is a single-pass compiler. That means things need to be declared before you can reference them. To reference another routine it needs to be earlier in the code.

To get round that restriction if you need to, you can use a forward declaration:

function do_it:boolean;forward;  // one line
...
...
procedure do_something;

begin
  ...
  if do_it ...
  ...

end;
...
...
function do_it:boolean;

begin
  ...
  RESULT:=

(forward isn't needed if you put the first declaration in the interface section.)

cheers,

Martin.

__________
message ref: 25014

 
 Clicked a link? Wrong message? Wait until the page has finished loading, click in the address bar and then press the Enter key. This is a timing bug in some browsers.
8th message | this message only posted: 15 Jun 2018 17:31
 PM  Reply with quote  Reply blank 
from:
Adrian
 

 

view images in gallery
view images as slides
Martin Wynne wrote:
3. You set:

   width_dots:=Printer.PaperSize.Width;
  length_dots:=Printer.PaperSize.Height;


For the printed templates I used:

      width_dots:=Printer.PageWidth;
  length_dots:=Printer.PageHeight;


Generally the printable page area is smaller than the paper size.

However in this case these two values aren't actually used, except to establish that we are getting sensible data from the printer driver. The F-Key chart is printed at a fixed size to match the function key spacing on a standard Windows keyboard, so that it can be placed directly behind the keyboard. So the paper size and page size doesn't come into it.

There is far more information available in the Windows GetCaps than in this simplified Lazarus printer wrapper, but it seems to cover all we need.


With respect to this point - my thinking was that you had helpfully labelled up the variable width_dots to be the width in dots. However the Lazarus documentation wasn't clear on the units for PageWidth whereas the paper size height and width did document it's units. Hence I was happier using that at this stage. I then realised it wasn't being later on but just forgot to go back and revert to PageWidth.

I'm still exploring the Lazarus interface, debugging and documentation.

Regards

Adrian

__________
message ref: 25015

 
 Clicked a link? Wrong message? Wait until the page has finished loading, click in the address bar and then press the Enter key. This is a timing bug in some browsers.
9th message | this message only posted: 15 Jun 2018 17:59
 PM  Reply with quote  Reply blank 
from:
Martin Wynne
West Of The Severn, United Kingdom



view images in gallery
view images as slides

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

Post your questions on the forum where everyone can see them and add helpful replies.
Adrian wrote:However the Lazarus documentation wasn't clearHi Adrian,

I agree. It's very difficult to find stuff. You might find referring to the Delphi docs is a better bet for a lot of things, e.g.

 http://docwiki.embarcadero.com/Libraries/Tokyo/en/Vcl.Graphics.TBitmap.PixelFormat

 http://lazarus-ccr.sourceforge.net/docs/lcl/graphics/trasterimage.pixelformat.html

I have now established that the problem with background picture shapes is that in Lazarus, TBitmap.PixelFormat is read-only. In Delphi5 bitmaps can be set to any PixelFormat and converted between them. But nowhere is this difference documented that I can find -- in fact the above link suggests otherwise. If so, it doesn't work.

But we now have a fix for the picture shapes problem. :)

Setting 24-bit format (without an alpha transparency channel) allows deeper zooming. It seems that all bitmaps in Lazarus are loaded as 32-bit regardless. However this doesn't seem to be as damaging to deep zooming as it is in Delphi5. One advantage of using a more up-to-date compiler is that it can use the later features of the Windows API.

Martin.

__________
message ref: 25016

 
 Clicked a link? Wrong message? Wait until the page has finished loading, click in the address bar and then press the Enter key. This is a timing bug in some browsers.
10th message | this message only posted: 15 Jun 2018 21:38
 PM  Reply with quote  Reply blank 
from:
Adrian
 

 

view images in gallery
view images as slides

Martin Wynne wrote: Hi Adrian,

I think perhaps we need a convention where anyone posting modified code adds their name (or an identifer) and the date, such as

    width_dpi:=Printer.XDPI;  // 14-06-18  Adrian

or

  // printer mods for OT from T2  14-06-18  Adrian BEGIN ...

    code
    code
    code

  // Adrian END

That would protect their copyright in the event they post a brilliant new idea, and makes it easier for anyone wanting to query the change to know who to ask. The date makes it possible to trace the sequence of changes if necessary.

On the other hand that's just my idea, I've no knowledge of how other projects handle such things.

I have again tried to do in Tortoise what Sourceforge is telling me to do, but no matter what I try it produces error messages. I really don't want this hassle, it seems to be way over the top in complexity for what we need. I especially don't want anyone to have to go through the same hassle just to get a copy of the latest code. There must be something simpler?

Also at present I have to log in to make changes, which defeats the purpose of creating something which can continue without me.

The same would apply to anyone else who sets something up, if the bus then gets them. :(

How do other projects get round this?

cheers,

Martin.
Lots of questions so how to answer in a coherent way? It's my fault really I posted this simple mod to try and stimulate this sort of discussion. So I will try to address some of your queries.
To start with your last question - how do other projects get round this? By a happy co-incidence I found a similar project on SourceForge to use as an example, you may have heard of it XTrkCAD. :D

https://sourceforge.net/projects/xtrkcad-fork/

So I will use this as the example and you can try it for yourself to see how it can work.

First point regarding having to login to make changes and the succession if the proverbial bus comes round the corner. You can see on the XTrkCAD project there are 3 users managing the project, so if the bus gets one of them the other 2 can still manage the project. 



Next point to make there is no hassle at all at grabbing the latest version of the code. You do not have to have a SourceForge account. In fact try it, log out of SourceForge and go to the XTrkCAD project. Select the 'xtrkcad' tab and you will see a 'button' to 'Download Snapshot' - this will download a zip file of the latest standard of the code. How difficult is that? 



Next issue is regarding the convention of commenting in the code a name and date for the change. Once you get accustomed to using a version control system this will seem very onerous. In a similar way regarding an earlier question about labelling up the file with a version number. With a version control system this version/author/date identification is all taken care of automatically by the version control system.

Again using XTrkCAD as the example - on the image above where I pointed out the download snapshot option next to it is the History option. If you select that it will bring up a list of all the changes made, i.e. a complete history of the code. As indicated below each row lists a change, it identifies the author and date. It has a brief description, the number in the square bracket i.e. [71bba8] is a link - click on it and it will give you a list of all the modified code for that update. On the righthand side is a 'tree' link, this will take you to a list of all the code at that version. i.e. a complete history. 

This is why I didn't add my name, date or version to my code as it is all logged automatically in the version control system. Personally I think this is easier than digging through the code to find who made what change.



Another feature to look at on XTrkCAD is how they use the feature requests and bug fixes. This comes back to one of my earlier issues about avoiding duplication of effort. They have a list of bug reports and feature requests. So you have a simple list of things that need doing, as a project manager you can choose to reject them - like an XP ribbon interface. However for those issue that do need sorting you can assign an owner which is a good indicator of who is working on the problem and can therefore avoid duplication of effort.



and bug lists



Finally to the issue you raise about Tortoise and SourceForge errors. Which version control system were you trying to use? Personally I struggle with GIT and much prefer Mercurial (there are other reasons as well why I prefer Mercurial but probably out of scope for this forum!).

I do think Mercurial is a simpler system for engineers to use rather than GIT and I will try to put together a simple guide on how I use it. That may answer some of your queries but it'll take me a day or so to sort it out whilst I learn how SourceForge works with Mercurial.

Regards

Adrian


__________
message ref: 25018

 
 Clicked a link? Wrong message? Wait until the page has finished loading, click in the address bar and then press the Enter key. This is a timing bug in some browsers.
11th message | this message only posted: 15 Jun 2018 22:17
 PM  Reply with quote  Reply blank 
from:
Martin Wynne
West Of The Severn, United Kingdom



view images in gallery
view images as slides

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

Post your questions on the forum where everyone can see them and add helpful replies.
Hi Adrian,

Thanks for that. :)

Do you want me to install Mercurial on Sourceforge instead of Subversion?  Done

 https://sourceforge.net/projects/opentemplot/

Do you want to be added as an admin? I don't know your user name on there and can't find a membership list:



Yes, I'm aware of the xtrkcad project -- I've been a member of the mailing list for years and contributed occasionally.

In fact Adam Richards (xtrkcad admin: tynewydd) was on here discussing a possible tie-up with Templot a little while ago, see:

 http://85a.co.uk/forum/view_topic.php?id=3230&forum_id=1

I added some DXF-connectors in readiness for any developments, see the xtc_unit:



(screenshot from Templot2)

I haven't got involved in their coding because I just don't understand all those abbreviations and acronyms they use in their posts -- certainly they are not using Delphi or Lazarus. So I haven't experimented with downloading their files, I will go and try it.

cheers,

Martin.

__________
message ref: 25019

 
 Clicked a link? Wrong message? Wait until the page has finished loading, click in the address bar and then press the Enter key. This is a timing bug in some browsers.
12th message | this message only posted: 16 Jun 2018 04:16
 PM  Reply with quote  Reply blank 
from:
Martin Wynne
West Of The Severn, United Kingdom



view images in gallery
view images as slides

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

Post your questions on the forum where everyone can see them and add helpful replies.
Hi Adrian,

I've now had a look at the Xtrkcad site on Sourceforge.

(I wish they would make up their minds whether it is called Xtrkcad or XTrackCAD. :? )

I can see the colour-coded diffing tools showing changes, etc., and downloaded some of it. The C code is all utterly alien to me, but I expect they would say the same about the Templot code.

I'm happy to go along with that, if that's the consensus here.

If someone simply wants to post on here a bit of code showing, say, how they changed the fixing peg from red to purple in their own version, presumably one of us would upload it to Sourceforge for them? And others could use it in their own versions if they wished simply by copying and pasting from here without going through the palaver of getting and extracting files from Sourceforge?

What should happen next? I have updates ready to fix the broken drag & drop functions, and the background picture shapes, which could test the system.

Also I am renaming this topic because it has drifted away from printing and the F-key chart. :)

cheers,

Martin.

__________
message ref: 25021

 
 Clicked a link? Wrong message? Wait until the page has finished loading, click in the address bar and then press the Enter key. This is a timing bug in some browsers.
13th message | this message only posted: 16 Jun 2018 18:25
 PM  Reply with quote  Reply blank 
from:
Adrian
 

 

view images in gallery
view images as slides
Martin Wynne wrote:
Thanks for that. Do you want me to install Mercurial on Sourceforge instead of Subversion?  Done  https://sourceforge.net/projects/opentemplot/  
Thanks for that.

Do you want to be added as an admin? I don't know your user name on there and can't find a membership list:If that is okay with you it would help - again I'm conscious that I think many would prefer you to be concentrating on Templot2 rather than OpenTemplot so if no one objects I'm happy to help out with the admin on the OpenTemplot side.

My username on sourceForge is apcherry 

  Hi Adrian,

I've now had a look at the Xtrkcad site on Sourceforge.

(I wish they would make up their minds whether it is called Xtrkcad or XTrackCAD. :? )

I can see the colour-coded diffing tools showing changes, etc., and downloaded some of it. The C code is all utterly alien to me, but I expect they would say the same about the Templot code.

I'm happy to go along with that, if that's the consensus here.

If someone simply wants to post on here a bit of code showing, say, how they changed the fixing peg from red to purple in their own version, presumably one of us would upload it to Sourceforge for them? And others could use it in their own versions if they wished simply by copying and pasting from here without going through the palaver of getting and extracting files from Sourceforge?

What should happen next? I have updates ready to fix the broken drag & drop functions, and the background picture shapes, which could test the system.

Also I am renaming this topic because it has drifted away from printing and the F-key chart. :)

cheers,

Martin.
So yes if people want to post little bits of code I'm quite prepared to upload it to the SourceForge repository.

I will try and post a little user guide on using TortoiseHg to show how the files can be managed.

My suggestion for what next is for me to sort out the user guide to explain how it can work and also for me to create the initial code upload - my idea was that I could upload the original files you released to the SourceForge code area and then update it with my changes to the chat unit for the f-key chart.

That way we have the full history of all the file changes from your first release.
You may notice that I have already tested this in a temporary project under my username just see how it could work
https://sourceforge.net/p/opentemplottest/code/commit_browser

Regards

Adrian

__________
message ref: 25022

 
 Clicked a link? Wrong message? Wait until the page has finished loading, click in the address bar and then press the Enter key. This is a timing bug in some browsers.
14th message | this message only posted: 16 Jun 2018 18:45
 PM  Reply with quote  Reply blank 
from:
Martin Wynne
West Of The Severn, United Kingdom



view images in gallery
view images as slides

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

Post your questions on the forum where everyone can see them and add helpful replies.
Adrian wrote:My suggestion for what next is for me to sort out the user guide to explain how it can work and also for me to create the initial code upload - my idea was that I could upload the original files you released to the SourceForge code area and then update it with my changes to the chat unit for the f-key chart.Hi Adrian,

Yes please, I'm happy to hand over to you. :)

I have made you an admin on there. I deleted SVN and installed Mercurial, but so far have done nothing with it.

The original release is attached here:

 http://85a.co.uk/forum/view_topic.php?id=3282&forum_id=25

Thanks,

Martin.

__________
message ref: 25023

 
This is topic ID = 3289     Page created at 04:27 (local time)  
You can type a quick reply to this topic here.

Click in the box to begin.


But to reply to an individual message, or to include images, attachments and formatted text, use the reply buttons on each message above.

To start a new topic in this forum, click the Start new topic button below.
To start a new topic in a different forum, click the Forum Jump drop-down list below.

             Start new topic 

 click to jump to a different forum:     Back to top of page

Templot Club > Forums > OpenTemplot Project > Making changes to OpenTemplot versions
about Templot Club

list recently active topics Templot Companion - User Guide - A-Z Index Old Templot Companion Please click: important information for new members and first-time visitors.
indexing link for search engines only

back to top of page


Please read this important note about copyright: Unless stated otherwise, all the files submitted to this web site are copyright and the property of the respective contributor. You are welcome to use them for your own personal non-commercial purposes, and in your messages on this web site. If you want to publish any of this material elsewhere or use it commercially, you must first obtain the owner's permission to do so.

The small print: All material submitted to this web site is the responsibility of the respective contributor. By submitting material to this web site you acknowledge that you accept full responsibility for the material submitted. The owner of this web site is not responsible for any content displayed here other than his own contributions. The owner of this web site may edit, modify or remove any content at any time without giving notice or reason.
Problems with this web site? Contact webmaster@templot.com.   This web site uses cookies: click for information.  
© 2018  

Powered by UltraBB - © 2009 Data 1 Systems