kicad-developers team mailing list archive
-
kicad-developers team
-
Mailing list archive
-
Message #24655
Re: Accessing PNS settings
-
To:
Chris Pavlina <pavlina.chris@xxxxxxxxx>, <kicad-developers@xxxxxxxxxxxxxxxxxxx>
-
From:
Tomasz Wlostowski <tomasz.wlostowski@xxxxxxx>
-
Date:
Fri, 13 May 2016 11:38:34 +0200
-
Authentication-results:
spf=pass (sender IP is 188.184.36.48) 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:
<20160513014557.GC8054@turnip.local>
-
Spamdiagnosticmetadata:
NSPM
-
Spamdiagnosticoutput:
1:23
-
User-agent:
Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.7.2
On 13.05.2016 03:45, Chris Pavlina wrote:
> Hi,
>
> Excuse my unfamiliarity with the architecture of the PNS router - could someone
> more familiar with it help me out and explain what the preferred way to
> access settings, like PNS_ROUTING_SETTINGS::CanViolateDRC, from contexts
> outside the routing tools is? I need a way to implement things like toolbar
> buttons (currently I'm looking at merging duplicate functionality like
> PNS_ROUTING_SETTINGS::CanViolateDrc and g_Drc_On), and I'm having trouble
> seeing a good way to get the data between the routing context and the GUI
> context.
>
Hi Chris,
Quick solution:
- retrieve the routing tool:
ROUTER_TOOL* theRouter = static_cast<ROUTER_TOOL*>( m_toolMgr->FindTool(
"pcbnew.InteractiveRouter" ) );
- retrieve the settings object
PNS_ROUTING_SETTINGS& settings = theRouter->PNSSettings();
Cheers,
Tom
Follow ups
References