Support URLs in user-defined fields

Bug #1785879 reported by NhatKhai on 2018-08-07
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
KiCad
Wishlist
Jeff Young

Bug Description

I would like have the similar feature in eschematic that allow user to open datasheet. But it would be nice if all the fields in symbol that has value like relative/absolute path or link also open like datasheet from pop-up menu. If this feature also work for layout (PcbNew) will also very help-full for loop up the part data sheet, or footprint. This feature would allow people like me can work online/offline(no internet) environments.

Application: kicad
Version: (5.0.0), release build
Libraries:
    wxWidgets 3.0.3
    libcurl/7.54.1 OpenSSL/1.0.2l zlib/1.2.11 libssh2/1.8.0 nghttp2/1.23.1 librtmp/2.3
Platform: Windows 7 (build 7601, Service Pack 1), 64-bit edition, 64 bit, Little endian, wxMSW
Build Info:
    wxWidgets: 3.0.3 (wchar_t,wx containers,compatible with 2.8)
    Boost: 1.60.0
    OpenCASCADE Community Edition: 6.8.0
    Curl: 7.54.1
    Compiler: GCC 7.1.0 with C++ ABI 1011

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

Jeff Young (jeyjey) on 2018-08-07
summary: - eeschema: open addition datasheet/file from popup menu
+ Support URLs in user-defined fields
Changed in kicad:
status: New → Triaged
importance: Undecided → Wishlist
KiCad Janitor (kicad-janitor) wrote :

Fixed in revision 99ed476de1b9c208e7a87386a1d6b77177e98fdb
https://git.launchpad.net/kicad/patch/?id=99ed476de1b9c208e7a87386a1d6b77177e98fdb

Changed in kicad:
status: Triaged → Fix Committed
assignee: nobody → Jeff Young (jeyjey)
ronnie (ronnie81) wrote :

@Jeff: Sorry to question this: I'm not 100% sure but I think Nhat had also URLs like file:// in mind.

quote:"if all the fields in symbol that has value like relative/absolute path or link" ... "allow people like me can work online/offline(no internet)"

I'd guess "file://" is easy to match too, I'm not so sure how one would handle relative (to the project) paths.

Just my 2cts.

Jeff Young (jeyjey) wrote :

@ronnie, good point. That might also be why he wants more than one field (one for a local link and one for the reference link).

NhatKhai (nhatkhai) wrote :

Thank for look into my request. Yes, I'm having in mine that if KiCad support both file:// or http:// would be nice. And for relative path I think there is couple way for help it more flexible for example:

Most likely, it make for sense to relative path to the folder where the symbol got defined (the library folder). And we can invent a syntax for relative path as such:

1. "file://./../doc/A744.pdf". Using the "dot" indicate the current folder of the symbol.
2. "file://{ENVIRONMENT_VARIABLE}/doc/A744.pdf". Using the environment variable for location of the datasheet.

What do you think?

Jeff Young (jeyjey) wrote :

I don't think my original idea of "sniffing" the field value is going to cut it.

So instead I'm going to add a column to the Field Name Templates for "URL". Selecting that will cause the button to appear in fields of that name.

The button will work as the Datasheet field does today: it handles http:,https:,ftp:,www. and file: without any environment variable expansion, and paths with environment expansion. I'm not sure if/how it handles relative paths, but someone could experiment with today's Datasheet field to find out....

(Thanks to NhatKhai who pointed out that I originally put this comment in the wrong bug. Too many browser windows open!)

Jeff Young (jeyjey) wrote :
NhatKhai (nhatkhai) wrote :

That is one of the solution would help me a lot. But I think your original idea may be more intuitive to user. Like look for the "file:" "http:", "ftp:", "https:" prefix then apply environment expansion only when program need to actual file from pop-up menu. But I guess you find a technical issue of doing that right?

Jeff Young (jeyjey) on 2018-08-08
Changed in kicad:
milestone: none → 5.1.0
NhatKhai (nhatkhai) wrote :

By the way, I found that there are a filed for "Documentation File Name" to set on the symbol editor, but it seem to not have the same level of accessing it such as pop-menu like the datasheet field, or the new URL type file that you at proposed. What do you think?

Jeff Young (jeyjey) wrote :

That's just a case of us exposing too much of the internals. That field is only for aliases; when an alias is placed into a schematic it's copied into the Datasheet field.

There's a bug logged already for the confusing user model around aliases. I was thinking of combining the Description and Aliases tab of the Symbol Properties dialog into a single tab: it would have a list of aliases down the left side, and then a pane on the right side which has a grid view of the Reference, Value, Description and Datasheet for that alias. (The Reference would be read-only, and the Value would always match the alias name.)

I think I like this idea. But please allow using relative path (support by
KiCad4), and url for at least datasheet (If URL automatically support for
any field by prefix event better, Altium PCB doing that, it just append all
the URL found into pop-up menu).

The way I use Documentation File Name in KiCad4 was point it to local
datasheet file, and use the datasheet field point to http online. That, I
can still access them from eeschema in some way for local, or online one.

On Thu, Aug 9, 2018 at 5:15 PM Jeff Young <email address hidden>
wrote:

> That's just a case of us exposing too much of the internals. That field
> is only for aliases; when an alias is placed into a schematic it's
> copied into the Datasheet field.
>
> There's a bug logged already for the confusing user model around
> aliases. I was thinking of combining the Description and Aliases tab of
> the Symbol Properties dialog into a single tab: it would have a list of
> aliases down the left side, and then a pane on the right side which has
> a grid view of the Reference, Value, Description and Datasheet for that
> alias. (The Reference would be read-only, and the Value would always
> match the alias name.)
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1785879
>
> Title:
> Support URLs in user-defined fields
>
> Status in KiCad:
> Fix Committed
>
> Bug description:
> I would like have the similar feature in eschematic that allow user to
> open datasheet. But it would be nice if all the fields in symbol that
> has value like relative/absolute path or link also open like datasheet
> from pop-up menu. If this feature also work for layout (PcbNew) will
> also very help-full for loop up the part data sheet, or footprint.
> This feature would allow people like me can work online/offline(no
> internet) environments.
>
> Application: kicad
> Version: (5.0.0), release build
> Libraries:
> wxWidgets 3.0.3
> libcurl/7.54.1 OpenSSL/1.0.2l zlib/1.2.11 libssh2/1.8.0
> nghttp2/1.23.1 librtmp/2.3
> Platform: Windows 7 (build 7601, Service Pack 1), 64-bit edition, 64
> bit, Little endian, wxMSW
> Build Info:
> wxWidgets: 3.0.3 (wchar_t,wx containers,compatible with 2.8)
> Boost: 1.60.0
> OpenCASCADE Community Edition: 6.8.0
> Curl: 7.54.1
> Compiler: GCC 7.1.0 with C++ ABI 1011
>
> Build settings:
> USE_WX_GRAPHICS_CONTEXT=OFF
> USE_WX_OVERLAY=OFF
> KICAD_SCRIPTING=ON
> KICAD_SCRIPTING_MODULES=ON
> KICAD_SCRIPTING_WXPYTHON=ON
> KICAD_SCRIPTING_ACTION_MENU=OFF
> BUILD_GITHUB_PLUGIN=ON
> KICAD_USE_OCE=ON
> KICAD_USE_OCC=OFF
> KICAD_SPICE=ON
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/kicad/+bug/1785879/+subscriptions
>

--
Nhat *Khai* Nguyen

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

Other bug subscribers