Commit bc9d5217 authored by jean-pierre charras's avatar jean-pierre charras

Eeschema: fix bug in load_one_schematic_file.cpp: error about files version,...

Eeschema: fix bug in load_one_schematic_file.cpp: error about files version, that create errors for hierarchical labels.
Pcbnew: cleaning code in block.cpp, and modifye previous way to calculate block size in block command, because old way creates unexpected behavior in block rotate and block flip.
Pcbnew: Fix a bug in plot silkscreen layers.
Cvpcb: Fix compilation issue under MACOX
parent 25df2772
......@@ -15,6 +15,7 @@
#include "protos.h"
#include "cvstruct.h"
#include "colors_selection.h"
#include "cvpcb_id.h"
#include "build_version.h"
......
......@@ -71,10 +71,14 @@ bool WinEDA_SchematicFrame::LoadOneEEFile( SCH_SCREEN* screen, const wxString& F
return FALSE;
}
// get the file version here. TODO: Support version numbers > 9
char version = line[9 + sizeof(SCHEMATIC_HEAD_STRING)];
int ver = version - '0';
if( ver > EESCHEMA_VERSION )
// get the file version here.
char *strversion = line + 9 + sizeof(SCHEMATIC_HEAD_STRING);
// Skip blanks
while( *strversion && *strversion < '0' )
strversion++;
int version = atoi(strversion);
if( version > EESCHEMA_VERSION )
{
MsgDiag = FullFileName + _( " was created by a more recent \
version of EESchema and may not load correctly. Please consider updating!" );
......@@ -83,7 +87,7 @@ version of EESchema and may not load correctly. Please consider updating!" );
#if 0
// Compile it if the new version is unreadable by previous eeschema versions
else if( ver < EESCHEMA_VERSION )
else if( version < EESCHEMA_VERSION )
{
MsgDiag = FullFileName + _( " was created by an older version of \
EESchema. It will be stored in the new file format when you save this file \
......@@ -159,9 +163,9 @@ again." );
}
else if( Name1[0] == 'L' )
item = new SCH_LABEL();
else if( Name1[0] == 'G' && ver > '1' )
else if( Name1[0] == 'G' && version > 1 )
item = new SCH_GLOBALLABEL();
else if( (Name1[0] == 'H') || (Name1[0] == 'G' && ver == '1') )
else if( (Name1[0] == 'H') || (Name1[0] == 'G' && version == 1) )
item = new SCH_HIERLABEL();
else
item = new SCH_TEXT();
......
......@@ -4,6 +4,7 @@ add_definitions(-DPCBNEW)
# Includes
###
include_directories(${CMAKE_CURRENT_SOURCE_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/dialogs
${Boost_INCLUDE_DIR}
../3d-viewer
../common
......@@ -41,6 +42,7 @@ set(PCBNEW_SRCS
cross-probing.cpp
debug_kbool_key_file_fct.cpp
deltrack.cpp
dialogs/dialog_block_options_base.cpp
dialog_copper_zones.cpp
dialog_copper_zones_base.cpp
dialog_design_rules.cpp
......
This diff is collapsed.
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Sep 8 2010)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "dialog_block_options_base.h"
///////////////////////////////////////////////////////////////////////////
DIALOG_BLOCK_OPTIONS_BASE::DIALOG_BLOCK_OPTIONS_BASE( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style )
{
this->SetSizeHints( wxDefaultSize, wxDefaultSize );
wxBoxSizer* bSizerMain;
bSizerMain = new wxBoxSizer( wxVERTICAL );
wxGridSizer* gSizer1;
gSizer1 = new wxGridSizer( 4, 2, 0, 0 );
m_Include_Modules = new wxCheckBox( this, wxID_ANY, _("Include Modules"), wxDefaultPosition, wxDefaultSize, 0 );
gSizer1->Add( m_Include_Modules, 0, wxALL, 5 );
m_Include_PcbTextes = new wxCheckBox( this, wxID_ANY, _("Include Texts on Copper Layers"), wxDefaultPosition, wxDefaultSize, 0 );
gSizer1->Add( m_Include_PcbTextes, 0, wxALL, 5 );
m_IncludeLockedModules = new wxCheckBox( this, wxID_ANY, _("Include Locked Modules"), wxDefaultPosition, wxDefaultSize, 0 );
gSizer1->Add( m_IncludeLockedModules, 0, wxALL, 5 );
m_Include_Draw_Items = new wxCheckBox( this, wxID_ANY, _("Include Drawings"), wxDefaultPosition, wxDefaultSize, 0 );
gSizer1->Add( m_Include_Draw_Items, 0, wxALL, 5 );
m_Include_Tracks = new wxCheckBox( this, wxID_ANY, _("Include Tracks"), wxDefaultPosition, wxDefaultSize, 0 );
gSizer1->Add( m_Include_Tracks, 0, wxALL, 5 );
m_Include_Edges_Items = new wxCheckBox( this, wxID_ANY, _("Include Board Outline Layer"), wxDefaultPosition, wxDefaultSize, 0 );
gSizer1->Add( m_Include_Edges_Items, 0, wxALL, 5 );
m_Include_Zones = new wxCheckBox( this, wxID_ANY, _("Include Zones"), wxDefaultPosition, wxDefaultSize, 0 );
gSizer1->Add( m_Include_Zones, 0, wxALL, 5 );
m_DrawBlockItems = new wxCheckBox( this, wxID_ANY, _("Draw Block Items while Moving"), wxDefaultPosition, wxDefaultSize, 0 );
gSizer1->Add( m_DrawBlockItems, 0, wxALL, 5 );
bSizerMain->Add( gSizer1, 0, wxEXPAND, 5 );
m_staticline1 = new wxStaticLine( this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
bSizerMain->Add( m_staticline1, 0, wxEXPAND | wxALL, 5 );
m_sdbSizer1 = new wxStdDialogButtonSizer();
m_sdbSizer1OK = new wxButton( this, wxID_OK );
m_sdbSizer1->AddButton( m_sdbSizer1OK );
m_sdbSizer1Cancel = new wxButton( this, wxID_CANCEL );
m_sdbSizer1->AddButton( m_sdbSizer1Cancel );
m_sdbSizer1->Realize();
bSizerMain->Add( m_sdbSizer1, 0, wxALIGN_RIGHT|wxALL, 5 );
this->SetSizer( bSizerMain );
this->Layout();
this->Centre( wxBOTH );
// Connect Events
m_Include_Modules->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this );
m_Include_PcbTextes->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this );
m_IncludeLockedModules->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this );
m_Include_Draw_Items->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this );
m_Include_Tracks->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this );
m_Include_Edges_Items->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this );
m_Include_Zones->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this );
m_DrawBlockItems->Connect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this );
m_sdbSizer1Cancel->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::OnCancel ), NULL, this );
m_sdbSizer1OK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::ExecuteCommand ), NULL, this );
}
DIALOG_BLOCK_OPTIONS_BASE::~DIALOG_BLOCK_OPTIONS_BASE()
{
// Disconnect Events
m_Include_Modules->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this );
m_Include_PcbTextes->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this );
m_IncludeLockedModules->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this );
m_Include_Draw_Items->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this );
m_Include_Tracks->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this );
m_Include_Edges_Items->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this );
m_Include_Zones->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this );
m_DrawBlockItems->Disconnect( wxEVT_COMMAND_CHECKBOX_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::checkBoxClicked ), NULL, this );
m_sdbSizer1Cancel->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::OnCancel ), NULL, this );
m_sdbSizer1OK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BLOCK_OPTIONS_BASE::ExecuteCommand ), NULL, this );
}
This diff is collapsed.
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Sep 8 2010)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __dialog_block_options_base__
#define __dialog_block_options_base__
#include <wx/intl.h>
#include <wx/string.h>
#include <wx/checkbox.h>
#include <wx/gdicmn.h>
#include <wx/font.h>
#include <wx/colour.h>
#include <wx/settings.h>
#include <wx/sizer.h>
#include <wx/statline.h>
#include <wx/button.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_BLOCK_OPTIONS_BASE
///////////////////////////////////////////////////////////////////////////////
class DIALOG_BLOCK_OPTIONS_BASE : public wxDialog
{
private:
protected:
wxCheckBox* m_Include_Modules;
wxCheckBox* m_Include_PcbTextes;
wxCheckBox* m_IncludeLockedModules;
wxCheckBox* m_Include_Draw_Items;
wxCheckBox* m_Include_Tracks;
wxCheckBox* m_Include_Edges_Items;
wxCheckBox* m_Include_Zones;
wxCheckBox* m_DrawBlockItems;
wxStaticLine* m_staticline1;
wxStdDialogButtonSizer* m_sdbSizer1;
wxButton* m_sdbSizer1OK;
wxButton* m_sdbSizer1Cancel;
// Virtual event handlers, overide them in your derived class
virtual void checkBoxClicked( wxCommandEvent& event ) { event.Skip(); }
virtual void OnCancel( wxCommandEvent& event ) { event.Skip(); }
virtual void ExecuteCommand( wxCommandEvent& event ) { event.Skip(); }
public:
DIALOG_BLOCK_OPTIONS_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 397,171 ), long style = wxDEFAULT_DIALOG_STYLE );
~DIALOG_BLOCK_OPTIONS_BASE();
};
#endif //__dialog_block_options_base__
......@@ -67,8 +67,8 @@ void WinEDA_BasePcbFrame::Plot_Serigraphie( PLOTTER* plotter,
/* Plot pads (creates pads outlines, for pads on silkscreen layers) */
int layersmask_plotpads = masque_layer;
// Calculate the mask layers of allowed layers for pads
if( !g_pcb_plot_options.PlotPadsOnSilkLayer )
layersmask_plotpads &= ~(SILKSCREEN_LAYER_BACK || SILKSCREEN_LAYER_FRONT);
if( !g_pcb_plot_options.PlotPadsOnSilkLayer ) // Do not plot pads on silk screen layers
layersmask_plotpads &= ~(SILKSCREEN_LAYER_BACK | SILKSCREEN_LAYER_FRONT );
if( layersmask_plotpads )
{
for( MODULE* Module = m_Pcb->m_Modules; Module; Module = Module->Next() )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment