Dimension changing to inches

Bug #1782797 reported by Hildo Guillardi Júnior
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Fix Released
Medium
Jeff Young

Bug Description

Dimensions text/tool always change to in (inches) when I move it or change it dimension to measure after already placed.

Application: kicad
Version: 6.0.0-rc1-unknown-da35b16~65~ubuntu16.04.1, release build
Libraries:
    wxWidgets 3.0.2
    libcurl/7.47.0 OpenSSL/1.0.2g zlib/1.2.8 libidn/1.32 librtmp/2.3
Platform: Linux 4.4.0-130-generic x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.2 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24
    Boost: 1.58.0
    OpenCASCADE Community Edition: 6.8.0
    Curl: 7.47.0
    Compiler: GCC 5.4.0 with C++ ABI 1009

Build settings:
    USE_WX_GRAPHICS_CONTEXT=OFF
    USE_WX_OVERLAY=OFF
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_WXPYTHON=OFF
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

Revision history for this message
Seth Hillbrand (sethh) wrote :

This happens even when the board units are set to mm. Maybe related to the units rework, Jeff?

Changed in kicad:
importance: Undecided → Medium
milestone: none → 5.1.0
status: New → Confirmed
Revision history for this message
Jeff Young (jeyjey) wrote :

If you create the dimension in inches then it will always be inches, even if it's edited after changing the board units to mm.

But it sounds like you guys are saying it changes to inches even if it's originally created in mm? Can you gives steps to reproduce?

Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :

Yes, usually (and always for measure indications / user annotation) I use metric.
So, with mm selected I just change the extreme / text position of the measure and it change to imperial (inches).

1) Select mm to edit your PCB;
2) Add the measure;
3) Move one the the extrem or the text of the measure.

It you change to inch.

Revision history for this message
Seth Hillbrand (sethh) wrote :

Hi Jeff-

Previous behavior was that the measurement markings would keep their units until edited, at which point they would adopt the current board-level units.

Step to reproduce:
Open "video" demo project
Ensure your board units are "mm"
Edit the dimensions at the bottom
Note that they change to "in" from "mm"

Revision history for this message
Jeff Young (jeyjey) wrote :

@Seth, I'd consider that a bug. It's certainly surprising when that's not what you wanted, and not easily discovered even when it is what you want.

If we think we need to allow changing the dimension units, we should put a control in the edit dialog.

However, it looks like Hildo is experiencing something different. Can you reproduce it given his steps (I can't on OSX).

Revision history for this message
Seth Hillbrand (sethh) wrote :

I cannot recreate Hildo's report. On Linux, I need to save the dimension to file, close and re-open before the units change to inches. Newly created dimensions keep the units that they were created with.

I've been used to having units adjust when I change board-level units. So, it's become part of my workflow. But I'm not opposed to having it be selectable in the edit dialog.

Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :

Yes, @Seth, you are correct:

1) Select mm to edit your PCB;
2) Add the measure;
3) Save the file (doesn't need a project);
4) Close Pcbnew;
5) Reopen the file just saved;
6) Move one the the extrem or the text of the measure (always with `mm` slected);
The number will change to inch.

Revision history for this message
Jeff Young (jeyjey) wrote :

Got it. (And yes, I can reproduce it with a round-trip through the file format.)

Changed in kicad:
assignee: nobody → Jeff Young (jeyjey)
Jeff Young (jeyjey)
Changed in kicad:
status: Confirmed → In Progress
Revision history for this message
Jeff Young (jeyjey) wrote :

File round-trip issue fixes, and I also added units to the edit dialog.

Bonus: we now support mils as well.

summary: - Dimension changing to in
+ Dimension changing to inches
Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

Fixed in revision 5c646119a7f72a294848101f971ac8b092dbc455
https://git.launchpad.net/kicad/patch/?id=5c646119a7f72a294848101f971ac8b092dbc455

Changed in kicad:
status: In Progress → Fix Committed
Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :

Still on

Application: kicad
Version: 6.0.0-rc1-unknown-16b5f40~65~ubuntu16.04.1, release build
Libraries:
    wxWidgets 3.0.2
    libcurl/7.47.0 OpenSSL/1.0.2g zlib/1.2.8 libidn/1.32 librtmp/2.3
Platform: Linux 4.4.0-130-generic x86_64, 64 bit, Little endian, wxGTK
Build Info:
    wxWidgets: 3.0.2 (wchar_t,wx containers,compatible with 2.8) GTK+ 2.24
    Boost: 1.58.0
    OpenCASCADE Community Edition: 6.8.0
    Curl: 7.47.0
    Compiler: GCC 5.4.0 with C++ ABI 1009

Build settings:
    USE_WX_GRAPHICS_CONTEXT=OFF
    USE_WX_OVERLAY=OFF
    KICAD_SCRIPTING=ON
    KICAD_SCRIPTING_MODULES=ON
    KICAD_SCRIPTING_WXPYTHON=OFF
    KICAD_SCRIPTING_ACTION_MENU=ON
    BUILD_GITHUB_PLUGIN=ON
    KICAD_USE_OCE=ON
    KICAD_USE_OCC=OFF
    KICAD_SPICE=ON

Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :

I am return to confirmed because this issue remain on KiCad 201807260648+1e43773~65~ubuntu16.04.01 Nightly.

Changed in kicad:
status: Fix Committed → Confirmed
Revision history for this message
Jeff Young (jeyjey) wrote :

@Hildo, is it still the steps in comment #7? I can't reproduce that.

Could you check in the Dimension Text Properties dialog (hit 'E' with the dimension selected) and see what units it says both before saving and after re-opening?

Thanks,
Jeff.

Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :

Yes, same steps.
Checked the proprieties, observations (always keeping mm in Pcbnew option):
1) After create the dimension annotation, in the 'E' dialog is marked as 'mm / millimeter' (correctly);
2) Closing and re-opening the file (even before try to move the annotation) the option is already marked as inches.

If help, this is the file part with this annotation:

  (dimension 16 (width 0.15) (layer F.SilkS)
    (gr_text "16,000 mm" (at 235 30.7) (layer F.SilkS)
      (effects (font (size 1 1) (thickness 0.15)))
    )
    (feature1 (pts (xy 243 35) (xy 243 31.413579)))
    (feature2 (pts (xy 227 35) (xy 227 31.413579)))
    (crossbar (pts (xy 227 32) (xy 243 32)))
    (arrow1a (pts (xy 243 32) (xy 241.873496 32.586421)))
    (arrow1b (pts (xy 243 32) (xy 241.873496 31.413579)))
    (arrow2a (pts (xy 227 32) (xy 228.126504 32.586421)))
    (arrow2b (pts (xy 227 32) (xy 228.126504 31.413579)))
  )

Revision history for this message
Jeff Young (jeyjey) wrote :

Hmm... I'll bet we're failing to parse the "mm" at the end because we're stumbling over the ',' decimal separator....

Revision history for this message
Jeff Young (jeyjey) wrote :

It *looks* like the code is processing decimal separators correctly. Just to check, could you replace the ',' in your file with a '.' and see if it reads it in correctly that way?

Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :

Exactly, as I was suspecting, is the decimal separator. Creating two dimension annotation, in the file after save:

  (dimension 51 (width 0.12) (layer F.SilkS)
    (gr_text "51.000 mm" (at 132.5 98.73) (layer F.SilkS)
      (effects (font (size 1 1) (thickness 0.15)))
    )
    (feature1 (pts (xy 158 107) (xy 158 99.413579)))
    (feature2 (pts (xy 107 107) (xy 107 99.413579)))
    (crossbar (pts (xy 107 100) (xy 158 100)))
    (arrow1a (pts (xy 158 100) (xy 156.873496 100.586421)))
    (arrow1b (pts (xy 158 100) (xy 156.873496 99.413579)))
    (arrow2a (pts (xy 107 100) (xy 108.126504 100.586421)))
    (arrow2b (pts (xy 107 100) (xy 108.126504 99.413579)))
  )
  (dimension 64 (width 0.12) (layer F.SilkS)
    (gr_text "64,000 mm" (at 131 87.73) (layer F.SilkS)
      (effects (font (size 1 1) (thickness 0.15)))
    )
    (feature1 (pts (xy 163 100) (xy 163 88.413579)))
    (feature2 (pts (xy 99 100) (xy 99 88.413579)))
    (crossbar (pts (xy 99 89) (xy 163 89)))
    (arrow1a (pts (xy 163 89) (xy 161.873496 89.586421)))
    (arrow1b (pts (xy 163 89) (xy 161.873496 88.413579)))
    (arrow2a (pts (xy 99 89) (xy 100.126504 89.586421)))
    (arrow2b (pts (xy 99 89) (xy 100.126504 88.413579)))
  )

The "51.000 mm" worked fine (the proprieties also ok on the dialog), the issue reported here happens on "64,000 mm".
After modify both on Pcbnew, the "51.000 mm" is replaced by "51,000 mm", so the error happens again in both.

Revision history for this message
Jeff Young (jeyjey) wrote :

I've implemented a simpler version of the decimal separator processing which may (or may not) fix the issue.

Revision history for this message
KiCad Janitor (kicad-janitor) wrote :

Fixed in revision 18d2f95fd58b9489d086a53aff2626e102edbd85
https://git.launchpad.net/kicad/patch/?id=18d2f95fd58b9489d086a53aff2626e102edbd85

Changed in kicad:
status: Confirmed → Fix Committed
Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :

Fix working!

Revision history for this message
Jeff Young (jeyjey) wrote :

Thanks for your patience with that one, Hildo.

Revision history for this message
Hildo Guillardi Júnior (hildogjr) wrote :

No problem, I keep tracking the issues reported by me on each new Nightly.

Changed in kicad:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.