From df830dab4cf9d010204234843138fe5db2463838 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Wed, 27 Sep 2017 18:56:06 +0200 Subject: [PATCH] Add comments and a comment asking to fix a call to a GUI inside a io plugin, that is not allowed --- pcbnew/pcb_parser.cpp | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/pcbnew/pcb_parser.cpp b/pcbnew/pcb_parser.cpp index b867490440..dfcc790dc9 100644 --- a/pcbnew/pcb_parser.cpp +++ b/pcbnew/pcb_parser.cpp @@ -2,7 +2,7 @@ * This program source code file is part of KiCad, a free EDA CAD application. * * Copyright (C) 2012 CERN - * Copyright (C) 2012-2016 KiCad Developers, see AUTHORS.txt for contributors. + * Copyright (C) 2012-2017 KiCad Developers, see AUTHORS.txt for contributors. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -2820,15 +2820,16 @@ ZONE_CONTAINER* PCB_PARSER::parseZONE_CONTAINER() NeedRIGHT(); break; - case T_layer: + case T_layer: // keyword for zones that are on only one layer zone->SetLayer( parseBoardItemLayer() ); NeedRIGHT(); break; - case T_layers: - zone->SetLayerSet( parseBoardItemLayersAsMask() ); - break; - + case T_layers: // keyword for zones that can live on a set of layer + // currently: keepout zones + zone->SetLayerSet( parseBoardItemLayersAsMask() ); + break; + case T_tstamp: zone->SetTimeStamp( parseHex() ); NeedRIGHT(); @@ -3079,7 +3080,7 @@ ZONE_CONTAINER* PCB_PARSER::parseZONE_CONTAINER() break; default: - Expecting( "net, layer/layers, tstamp, hatch, priority, connect_pads, min_thickness, " + Expecting( "net, layer/layers, tstamp, hatch, priority, connect_pads, min_thickness, " "fill, polygon, filled_polygon, or fill_segments" ); } } @@ -3128,6 +3129,8 @@ ZONE_CONTAINER* PCB_PARSER::parseZONE_CONTAINER() // and update the zone netcode zone->SetNetCode( net->GetNet() ); + // FIXME: a call to any GUI item is not allowed in io plugins: + // Change this code to generate a warning message outside this plugin // Prompt the user wxString msg; msg.Printf( _( "There is a zone that belongs to a not existing net\n"