QCAD Bugtracker

  • Status Closed
  • Percent Complete
    100%
  • Task Type Bug Report
  • Category QCAD (main)
  • Assigned To
    Andrew
  • Operating System All
  • Severity Low
  • Priority Very Low
  • Reported Version 3.31.2
  • Due in Version Undecided
  • Due Date Undecided
  • Votes
  • Private
Attached to Project: QCAD Bugtracker
Opened by David Smith - 24.12.2024
Last edited by Andrew - 04.01.2025

FS#2622 - Linetypes and patterns are always from metric storage

I created two linetype definitions (.lin file) and placed it in the linetypes directory of the installation. The linetypes in the definition in the metrics directory are named so that metric is part of the name. The linetypes in the definition in the imperial directory are named so that imperial is part of the name. The application and drawing preferences have Imperial set as the measurement system (as well as Drawing and Paper Unit in inches).

When I open the application and look at the 0 layer of the default drawing I see that the metric linetypes are included and not the imperial ones.

Happens in QCAD Pro as well as in a build of the latest source of the community edition.

Debugging the community edition I notice that when getUnit is called in RDocument::getDefaultLinetypes it returns NULL indicating that the document does not have any document variables. Looking at the code RDocument::init I see the docVars variable is set with the correct unit and measurement. But the docVars variable is not the object until the end of the routine and thus not available when getUnit is called.

I am not sure what the fix it (relatively new to the source code) but it means that defining imperial linetypes and patterns does not work. I verified that it does not work with the application directory and the local directory (AppData on windows). I think this is a rather severe problem since it is broken functionality.

Closed by  Andrew
04.01.2025 11:00
Reason for closing:  Fixed
CVH commented on 26.12.2024 06:53

Hi,
Normally we would address this in the QCAD Forum
After verification I have to confirm that there is a problem and a reason for this report.

First of all: The attached ZIP contains only the standard LIN files.
So there is nothing for us to test with.

The application preferences only applies to new documents.
The ones that matter are the drawing preferences of the current (possibly new) drawing.

In general, the debug mode is not considered stable, events can be processed in an unpredictable order. But it can be unrelated here.

Severity = Medium would mean that it affects all users without really crashing.
In this case it only affects users that install custom line types and not the majority.



I used 2 custom LIN files based on the data listed in FS#2616

customiso.lin with DASHEDC and DOTTEDC in the metric folder
customimp.lin with DASHEDCI and DOTTEDCI in the imperial folder
I didn't change anything to the patterns.

After restarting QCAD I additionally get:

  • Only the custom metric types in a metric drawing.
  • All 4 types in an imperial drawing.
  • > > > The metric ones seem to be scaled.

The odd thing is that:
It doesn't seem to rely on the 'Measurement System' preference.
2 or 4 custom types seems to depend on the drawing unit.

Regards,
CVH

David Smith commented on 26.12.2024 17:32

Sorry about the incorrect files. Here are the ones I intended to provide.

CVH commented on 27.12.2024 18:08

You seem to be right, only metric is loaded whatever I do.

Seeing both DASHEDC and DASHEDCI listed is probably because I copied over patterned lines from one drawing to another, metric ↔ imperial.

This also explains the pattern scaling of the custom pattern that I reported.
Converting on the fly ... Still, converting form inch to mm or the other way around does not affect the measurement system.
Some more investigation is required to fully understand the process.
Kinda disagree with the statement that patterns are in mm and not in units.

To proof things I deleted the class.lin file in the imperial folder.
Starting a new imperial file, I simply get your custom metric patterns listed.

Some remarks:
- The header of the class.lin for metric states 'QCAD linetypes for imperial system'.
(Plain copy except the pattern naming)
- class.lin definitions for metric should be factor 25.4 larger.
⇒ Also meaning that patterns are in units, mm or inch only.
- I would diversify the 'class' LIN file name similar as the default LIN files.
- It is of no use to define a Continuous pattern like you did.

A,0.039370079 means a dash about 0.04 long, no space and that repeated endlessly.
Such a line is thus a continuous chain of dashes.
It would only take longer to render compared to a real continuous line.

Regards,
CVH

David Smith commented on 27.12.2024 19:36

I have a fix. Do you wish me to create a pull request with it? The problem is that the setup of the linetypes is done before the variables are actually defined on the document. Moving it after the adding of the vars to the document fixes the problem.

David Smith commented on 29.12.2024 22:55

Added Pull Request #51 which includes fix for both linetypes and patterns not using Measurement System as defined in the General→Drawing Unit preferences. In addition, the lintype determination of the metric vs imperial was being done at a time where the document had not had it's variables set. This is fixed in the pull request.

Loading...

Available keyboard shortcuts

Tasklist

Task Details

Task Editing