← Back to team overview

kicad-developers team mailing list archive

Re: Accessing PNS settings

 

As I recall, I got that far and wasn't sure how to get at m_toolMgr from where
I was - but I'm going to be out all day so I can't really take much of a look
at it until tomorrow or late tonight.

For the purpose of merging the two settings, which do you think would best fit
with the current structure: keep the two settings separate internally and make
the GUI elements toggle both, or replace all uses of g_Drc_On with accesses to
CanViolateDrc() to merge them completely? I was looking at doing the latter and
couldn't find how to access the setting from every place g_Drc_On is used,
looks like I may have to do the former.

On Fri, May 13, 2016 at 11:38:34AM +0200, Tomasz Wlostowski wrote:
> 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
> 
> 
> 


References