kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #28815
Re: Fixing libcommon
-
To:
<kicad-developers@xxxxxxxxxxxxxxxxxxx>
-
From:
Maciej Sumiński <maciej.suminski@xxxxxxx>
-
Date:
Wed, 22 Mar 2017 09:41:15 +0100
-
Authentication-results:
spf=pass (sender IP is 188.184.36.46) smtp.mailfrom=cern.ch; lists.launchpad.net; dkim=none (message not signed) header.d=none;lists.launchpad.net; dmarc=bestguesspass action=none header.from=cern.ch;
-
In-reply-to:
<7c55fd72-a461-8963-270c-3723ae0cfb02@gmail.com>
-
Spamdiagnosticmetadata:
NSPM
-
Spamdiagnosticoutput:
1:99
-
User-agent:
Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.1
On 03/20/2017 02:36 PM, Wayne Stambaugh wrote:
> On 3/18/2017 10:18 AM, Maciej Suminski wrote:
>> In order to remove the hardcoded values from WORKSHEET_VIEWITEM, I
>> started moving code that used to be compiled multiple times to separate
>> units. This is also a basic way to solve the internal units conversion
>> problem.
>>
>> There are still a few more files that are compiled multiple times. I
>> plan to fix them as well, but first I want to send the first patches to
>> see if we all agree on the proposed solution.
>>
>> Alternatively, there could be an abstract class to provide conversion
>> methods. If it is preferred, then we need to decide how to access its
>> instance (singleton, attach to KiFace, static object?)
>
> This would be my preference. The solution in your patch set has a lot
> of duplicate code with different per application scalars. I would think
> that an abstract class would be a more elegant design. I OK with
> pushing your current patches and refactoring the scalar code into an
> abstract class at a later date. I don't have a strong preference for
> singleton versus static.
Then we could have a look at old Tom's branch [1]. It provides UNITS
class with derived classes to handle all KiCad applications. Just by
looking at the code, it seems to completely eliminate #ifdefs in libcommon.
If you are ok with his changes, I can rebase them and test if they work
as expected.
Regards,
Orson
1. https://github.com/twlostow/kicad-dev/tree/libcommon-deifdefied
>> Ultimately we can have a real common library for all apps (libkicommon?)
>> that could be compiled as a shared library. Such approach should reduce
>> *.kiface files size and linking time.
>
> This should be the goal. My guess is there are lots of
> inter-dependencies that will make this goal more challenging then you
> might expect. I looked at this a long time ago and that was the
> conclusion that I came to. Maybe over the years, some of that ugliness
> has been refactored away.
>
> Cheers,
>
> Wayne
>
>>
>> Any thoughts?
>>
>> Regards,
>> Orson
>>
>>
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~kicad-developers
>> Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~kicad-developers
>> More help : https://help.launchpad.net/ListHelp
>>
>
> _______________________________________________
> Mailing list: https://launchpad.net/~kicad-developers
> Post to : kicad-developers@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~kicad-developers
> More help : https://help.launchpad.net/ListHelp
>
Attachment:
signature.asc
Description: OpenPGP digital signature
Follow ups
References