Commit 2a9a799f authored by charras's avatar charras

eeschema: Added: option to print ALL (more than 8) users fields in B.O.M.

pcbnew: added 5 metric grids and fixed a very minor bug when creating drill map.
parent 3bd6aa1d
...@@ -5,6 +5,16 @@ Started 2007-June-11 ...@@ -5,6 +5,16 @@ Started 2007-June-11
Please add newer entries at the top, list the date and your name with Please add newer entries at the top, list the date and your name with
email address. email address.
2009-mar-12 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================
++eeschema:
Added: option to print ALL users fields in B.O.M.,
so if more than 8 fields, they are printed. (issue 2680640)
++pcbnew:
Added 5 metric grids (1mm, 0.5mm 0.25mm 0.2mm and 0.1mm) in default grid list.
Minor bug in drill map creation (PS format) fixed
2009-mar-11 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr> 2009-mar-11 UPDATE Jean-Pierre Charras <jean-pierre.charras@inpg.fr>
================================================================================ ================================================================================
++pcbnew: ++pcbnew:
......
...@@ -285,15 +285,19 @@ ReturnValueFromString( int Units, ...@@ -285,15 +285,19 @@ ReturnValueFromString( int Units,
} }
/*
* Convert in inch or mm the variable "val" given in internal units
*/
/******************************************************************/ /******************************************************************/
double double To_User_Unit( bool is_metric,
To_User_Unit( bool is_metric,
int val, int val,
int internal_unit_value ) int internal_unit_value )
/******************************************************************/ /******************************************************************/
/**
* Function To_User_Unit
* Convert in inch or mm the variable "val" (double)given in internal units
* @return the converted value, in double
* @param is_metric : true if the result must be returned in mm , false if inches
* @param val : integer : the given value
* @param internal_unit_value = internal units per inch
*/
{ {
double value; double value;
...@@ -305,6 +309,31 @@ To_User_Unit( bool is_metric, ...@@ -305,6 +309,31 @@ To_User_Unit( bool is_metric,
return value; return value;
} }
/******************************************************************/
double To_User_Unit( bool is_metric,
double val,
int internal_unit_value )
/******************************************************************/
/**
* Function To_User_Unit
* Convert in inch or mm the variable "val" (double)given in internal units
* @return the converted value, in double
* @param is_metric : true if the result must be returned in mm , false if inches
* @param val : double : the given value
* @param internal_unit_value = internal units per inch
*/
{
double value;
if( is_metric )
value = val * 25.4 / internal_unit_value;
else
value = val / internal_unit_value;
return value;
}
/* /*
* Return in internal units the value "val" given in inch or mm * Return in internal units the value "val" given in inch or mm
......
...@@ -247,7 +247,7 @@ void WinEDA_DrawPanel::AddMenuZoom( wxMenu* MasterMenu ) ...@@ -247,7 +247,7 @@ void WinEDA_DrawPanel::AddMenuZoom( wxMenu* MasterMenu )
for( i = 0; i < GetScreen()->m_GridList.GetCount(); i++ ) for( i = 0; i < GetScreen()->m_GridList.GetCount(); i++ )
{ {
tmp = GetScreen()->m_GridList[i]; tmp = GetScreen()->m_GridList[i];
gridValue = To_User_Unit( g_UnitMetric, (int) round(tmp.m_Size.x), gridValue = To_User_Unit( g_UnitMetric, tmp.m_Size.x,
( (WinEDA_DrawFrame*)m_Parent )->m_InternalUnits ); ( (WinEDA_DrawFrame*)m_Parent )->m_InternalUnits );
if( tmp.m_Id == ID_POPUP_GRID_USER ) if( tmp.m_Id == ID_POPUP_GRID_USER )
{ {
...@@ -256,9 +256,9 @@ void WinEDA_DrawPanel::AddMenuZoom( wxMenu* MasterMenu ) ...@@ -256,9 +256,9 @@ void WinEDA_DrawPanel::AddMenuZoom( wxMenu* MasterMenu )
else else
{ {
if ( g_UnitMetric == 0 ) // inches if ( g_UnitMetric == 0 ) // inches
msg.Printf( wxT( "%g mils" ), gridValue * 1000 ); msg.Printf( wxT( "%.1f mils" ), gridValue * 1000 );
else else
msg.Printf( wxT( "%g mm" ), gridValue ); msg.Printf( wxT( "%.3f mm" ), gridValue );
msg = _( "Grid: " ) + msg; msg = _( "Grid: " ) + msg;
} }
gridMenu->Append( tmp.m_Id, msg, wxEmptyString, true ); gridMenu->Append( tmp.m_Id, msg, wxEmptyString, true );
......
...@@ -37,6 +37,7 @@ set(EESCHEMA_SRCS ...@@ -37,6 +37,7 @@ set(EESCHEMA_SRCS
# dialog_backanno.cpp # dialog_backanno.cpp
dialog_bodygraphictext_properties_base.cpp dialog_bodygraphictext_properties_base.cpp
dialog_build_BOM.cpp dialog_build_BOM.cpp
dialog_build_BOM_base.cpp
# dialog_cmp_graphic_properties.cpp # dialog_cmp_graphic_properties.cpp
dialog_create_component.cpp dialog_create_component.cpp
# dialog_edit_component_in_lib.cpp # dialog_edit_component_in_lib.cpp
......
...@@ -74,7 +74,7 @@ static char s_ExportSeparatorSymbol; ...@@ -74,7 +74,7 @@ static char s_ExportSeparatorSymbol;
/**************************************************************************/ /**************************************************************************/
void WinEDA_Build_BOM_Frame::Create_BOM_Lists( bool aTypeFileIsExport, void DIALOG_BUILD_BOM::Create_BOM_Lists( bool aTypeFileIsExport,
bool aIncludeSubComponents, bool aIncludeSubComponents,
char aExportSeparatorSymbol, char aExportSeparatorSymbol,
bool aRunBrowser ) bool aRunBrowser )
...@@ -125,7 +125,7 @@ void WinEDA_Build_BOM_Frame::Create_BOM_Lists( bool aTypeFileIsExport, ...@@ -125,7 +125,7 @@ void WinEDA_Build_BOM_Frame::Create_BOM_Lists( bool aTypeFileIsExport,
/****************************************************************************/ /****************************************************************************/
void WinEDA_Build_BOM_Frame::CreateExportList( const wxString& aFullFileName, void DIALOG_BUILD_BOM::CreateExportList( const wxString& aFullFileName,
bool aIncludeSubComponents ) bool aIncludeSubComponents )
/****************************************************************************/ /****************************************************************************/
...@@ -164,7 +164,7 @@ void WinEDA_Build_BOM_Frame::CreateExportList( const wxString& aFullFileName, ...@@ -164,7 +164,7 @@ void WinEDA_Build_BOM_Frame::CreateExportList( const wxString& aFullFileName,
/****************************************************************************/ /****************************************************************************/
void WinEDA_Build_BOM_Frame::GenereListeOfItems( const wxString& aFullFileName, void DIALOG_BUILD_BOM::GenereListeOfItems( const wxString& aFullFileName,
bool aIncludeSubComponents ) bool aIncludeSubComponents )
/****************************************************************************/ /****************************************************************************/
...@@ -515,7 +515,7 @@ static void DeleteSubCmp( std::vector <OBJ_CMP_TO_LIST>& aList ) ...@@ -515,7 +515,7 @@ static void DeleteSubCmp( std::vector <OBJ_CMP_TO_LIST>& aList )
/*******************************************************************************************/ /*******************************************************************************************/
void WinEDA_Build_BOM_Frame::PrintFieldData( FILE* f, SCH_COMPONENT* DrawLibItem, void DIALOG_BUILD_BOM::PrintFieldData( FILE* f, SCH_COMPONENT* DrawLibItem,
bool CompactForm ) bool CompactForm )
/*******************************************************************************************/ /*******************************************************************************************/
{ {
...@@ -547,12 +547,19 @@ void WinEDA_Build_BOM_Frame::PrintFieldData( FILE* f, SCH_COMPONENT* DrawLibItem ...@@ -547,12 +547,19 @@ void WinEDA_Build_BOM_Frame::PrintFieldData( FILE* f, SCH_COMPONENT* DrawLibItem
for( ii = FIELD1; ii < DrawLibItem->GetFieldCount(); ii++ ) for( ii = FIELD1; ii < DrawLibItem->GetFieldCount(); ii++ )
{ {
FieldCtrl = FieldListCtrl[ii - FIELD1]; if ( ii <= FIELD8 ) // see users fields 1 to 8
if( FieldCtrl == NULL ) {
continue; FieldCtrl = FieldListCtrl[ii - FIELD1];
if( FieldCtrl == NULL )
continue;
if( !FieldCtrl->IsChecked() ) if( !FieldCtrl->IsChecked() && !m_AddAllFields->IsChecked() )
continue; continue;
}
if( ! m_AddAllFields->IsChecked() )
break;
if( CompactForm ) if( CompactForm )
fprintf( f, "%c%s", s_ExportSeparatorSymbol, fprintf( f, "%c%s", s_ExportSeparatorSymbol,
...@@ -564,7 +571,7 @@ void WinEDA_Build_BOM_Frame::PrintFieldData( FILE* f, SCH_COMPONENT* DrawLibItem ...@@ -564,7 +571,7 @@ void WinEDA_Build_BOM_Frame::PrintFieldData( FILE* f, SCH_COMPONENT* DrawLibItem
/*********************************************************************************************/ /*********************************************************************************************/
int WinEDA_Build_BOM_Frame::PrintComponentsListByRef( int DIALOG_BUILD_BOM::PrintComponentsListByRef(
FILE* f, FILE* f,
std::vector <OBJ_CMP_TO_LIST>& aList, std::vector <OBJ_CMP_TO_LIST>& aList,
bool CompactForm, bool CompactForm,
...@@ -706,7 +713,7 @@ int WinEDA_Build_BOM_Frame::PrintComponentsListByRef( ...@@ -706,7 +713,7 @@ int WinEDA_Build_BOM_Frame::PrintComponentsListByRef(
/*********************************************************************************************/ /*********************************************************************************************/
int WinEDA_Build_BOM_Frame::PrintComponentsListByVal( int DIALOG_BUILD_BOM::PrintComponentsListByVal(
FILE* f, FILE* f,
std::vector <OBJ_CMP_TO_LIST>& aList, std::vector <OBJ_CMP_TO_LIST>& aList,
bool bool
......
This diff is collapsed.
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Name: dialog_build_BOM.h // Name: dialog_build_BOM.h
// Purpose:
// Author: jean-pieere Charras
// Modified by:
// Created: 01/15/06 18:18:44
// RCS-ID:
// Copyright: GNU license // Copyright: GNU license
// Licence: // Licence:
///////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////
// Generated by DialogBlocks (unregistered), 01/15/06 18:18:44
#ifndef _DIALOG_BUILD_BOM_H_ #ifndef _DIALOG_BUILD_BOM_H_
#define _DIALOG_BUILD_BOM_H_ #define _DIALOG_BUILD_BOM_H_
#if defined(__GNUG__) && !defined(__APPLE__) #include "dialog_build_BOM_base.h"
#pragma interface "dialog_build_BOM.cpp"
#endif
/*!
* Includes
*/
////@begin includes
#include "wx/valgen.h"
////@end includes
/*!
* Forward declarations
*/
////@begin forward declarations
////@end forward declarations
/*!
* Control identifiers
*/
////@begin control identifiers
#define ID_DIALOG 10000
#define ID_CHECKBOX1 10001
#define ID_CHECKBOX2 10002
#define ID_CHECKBOX3 10003
#define ID_CHECKBOX4 10004
#define ID_CHECKBOX5 10005
#define ID_RADIOBOX_SELECT_FORMAT 10006
#define ID_RADIOBOX_SEPARATOR 10007
#define ID_CHECKBOX6 10008
#define ID_CHECKBOX_FOOTPRINT_FIELD 10018
#define ID_CHECKBOX_FIELD1 10009
#define ID_CHECKBOX_FIELD2 10010
#define ID_CHECKBOX_FIELD3 10011
#define ID_CHECKBOX_FIELD4 10012
#define ID_CHECKBOX_FIELD5 10013
#define ID_CHECKBOX_FIELD6 10014
#define ID_CHECKBOX_FIELD7 10015
#define ID_CHECKBOX_FIELD8 10016
#define ID_CREATE_LIST 10017
#define SYMBOL_WINEDA_BUILD_BOM_FRAME_STYLE wxDEFAULT_DIALOG_STYLE|wxCAPTION|wxSYSTEM_MENU|wxCLOSE_BOX|MAYBE_RESIZE_BORDER
#define SYMBOL_WINEDA_BUILD_BOM_FRAME_TITLE _("List of Material")
#define SYMBOL_WINEDA_BUILD_BOM_FRAME_IDNAME ID_DIALOG
#define SYMBOL_WINEDA_BUILD_BOM_FRAME_SIZE wxSize(400, 300)
#define SYMBOL_WINEDA_BUILD_BOM_FRAME_POSITION wxDefaultPosition
////@end control identifiers
/*!
* Compatibility
*/
#ifndef wxCLOSE_BOX class DIALOG_BUILD_BOM : public DIALOG_BUILD_BOM_BASE
#define wxCLOSE_BOX 0x1000
#endif
#ifndef wxFIXED_MINSIZE
#define wxFIXED_MINSIZE 0
#endif
/*!
* WinEDA_Build_BOM_Frame class declaration
*/
class WinEDA_Build_BOM_Frame: public wxDialog
{ {
DECLARE_DYNAMIC_CLASS( WinEDA_Build_BOM_Frame ) private:
DECLARE_EVENT_TABLE() WinEDA_DrawFrame * m_Parent;
wxConfig* m_Config;
public: wxString m_ListFileName;
/// Constructors
WinEDA_Build_BOM_Frame( );
WinEDA_Build_BOM_Frame( WinEDA_DrawFrame* parent,
wxWindowID id = SYMBOL_WINEDA_BUILD_BOM_FRAME_IDNAME,
const wxString& caption = SYMBOL_WINEDA_BUILD_BOM_FRAME_TITLE,
const wxPoint& pos = SYMBOL_WINEDA_BUILD_BOM_FRAME_POSITION,
const wxSize& size = SYMBOL_WINEDA_BUILD_BOM_FRAME_SIZE,
long style = SYMBOL_WINEDA_BUILD_BOM_FRAME_STYLE );
/// Creation
bool Create( wxWindow* parent, wxWindowID id = SYMBOL_WINEDA_BUILD_BOM_FRAME_IDNAME, const wxString& caption = SYMBOL_WINEDA_BUILD_BOM_FRAME_TITLE, const wxPoint& pos = SYMBOL_WINEDA_BUILD_BOM_FRAME_POSITION, const wxSize& size = SYMBOL_WINEDA_BUILD_BOM_FRAME_SIZE, long style = SYMBOL_WINEDA_BUILD_BOM_FRAME_STYLE );
/// Creates the controls and sizers
void CreateControls();
////@begin WinEDA_Build_BOM_Frame event handler declarations
/// wxEVT_COMMAND_RADIOBOX_SELECTED event handler for ID_RADIOBOX_SELECT_FORMAT private:
void OnRadioboxSelectFormatSelected( wxCommandEvent& event ); void OnRadioboxSelectFormatSelected( wxCommandEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_CREATE_LIST
void OnCreateListClick( wxCommandEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
void OnOkClick( wxCommandEvent& event ); void OnOkClick( wxCommandEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL
void OnCancelClick( wxCommandEvent& event ); void OnCancelClick( wxCommandEvent& event );
/// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_APPLY void SavePreferences();
void OnApplyClick( wxCommandEvent& event ); void Init( );
////@end WinEDA_Build_BOM_Frame event handler declarations
////@begin WinEDA_Build_BOM_Frame member function declarations
/// Retrieves bitmap resources
wxBitmap GetBitmapResource( const wxString& name );
/// Retrieves icon resources
wxIcon GetIconResource( const wxString& name );
////@end WinEDA_Build_BOM_Frame member function declarations
void Create_BOM_Lists(bool aTypeFileIsExport, void Create_BOM_Lists(bool aTypeFileIsExport,
bool aIncludeSubComponents, bool aIncludeSubComponents,
char aExportSeparatorSymbol, char aExportSeparatorSymbol,
...@@ -139,38 +34,14 @@ public: ...@@ -139,38 +34,14 @@ public:
int PrintComponentsListByVal( FILE *f, std::vector <OBJ_CMP_TO_LIST>& aList, int PrintComponentsListByVal( FILE *f, std::vector <OBJ_CMP_TO_LIST>& aList,
bool aIncludeSubComponents); bool aIncludeSubComponents);
void PrintFieldData(FILE * f, SCH_COMPONENT * DrawLibItem, bool CompactForm = FALSE); void PrintFieldData(FILE * f, SCH_COMPONENT * DrawLibItem, bool CompactForm = FALSE);
void SavePreferences();
/// Should we show tooltips?
static bool ShowToolTips();
////@begin WinEDA_Build_BOM_Frame member variables
wxCheckBox* m_ListCmpbyRefItems;
wxCheckBox* m_ListSubCmpItems;
wxCheckBox* m_ListCmpbyValItems;
wxCheckBox* m_GenListLabelsbyVal;
wxCheckBox* m_GenListLabelsbySheet;
wxRadioBox* m_OutputFormCtrl;
wxRadioBox* m_OutputSeparatorCtrl;
wxCheckBox* m_GetListBrowser;
wxStaticBoxSizer* m_FieldsToAppendListSizer;
wxCheckBox* m_AddFootprintField;
wxCheckBox* m_AddField1;
wxCheckBox* m_AddField2;
wxCheckBox* m_AddField3;
wxCheckBox* m_AddField4;
wxCheckBox* m_AddField5;
wxCheckBox* m_AddField6;
wxCheckBox* m_AddField7;
wxCheckBox* m_AddField8;
wxButton* m_btClose;
////@end WinEDA_Build_BOM_Frame member variables
WinEDA_DrawFrame * m_Parent; public:
wxString m_LibArchiveFileName; DIALOG_BUILD_BOM( WinEDA_DrawFrame* parent );
wxString m_ListFileName; ~DIALOG_BUILD_BOM() {};
}; };
#endif #endif
// _DIALOG_BUILD_BOM_H_ // _DIALOG_BUILD_BOM_H_
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#include "dialog_build_BOM_base.h"
///////////////////////////////////////////////////////////////////////////
DIALOG_BUILD_BOM_BASE::DIALOG_BUILD_BOM_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* bMainSizer;
bMainSizer = new wxBoxSizer( wxHORIZONTAL );
wxStaticBoxSizer* sbOptionsSizer;
sbOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Options:") ), wxVERTICAL );
wxStaticBoxSizer* sbListOptionsSizer;
sbListOptionsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("List items:") ), wxVERTICAL );
m_ListCmpbyRefItems = new wxCheckBox( this, wxID_ANY, _("Components by reference"), wxDefaultPosition, wxDefaultSize, 0 );
sbListOptionsSizer->Add( m_ListCmpbyRefItems, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_ListSubCmpItems = new wxCheckBox( this, wxID_ANY, _("Sub components (i.e. U2A, U2B ...)"), wxDefaultPosition, wxDefaultSize, 0 );
sbListOptionsSizer->Add( m_ListSubCmpItems, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_ListCmpbyValItems = new wxCheckBox( this, wxID_ANY, _("Components by value"), wxDefaultPosition, wxDefaultSize, 0 );
sbListOptionsSizer->Add( m_ListCmpbyValItems, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_GenListLabelsbyVal = new wxCheckBox( this, wxID_ANY, _("Hierachy pins by name"), wxDefaultPosition, wxDefaultSize, 0 );
sbListOptionsSizer->Add( m_GenListLabelsbyVal, 0, wxTOP|wxRIGHT|wxLEFT, 5 );
m_GenListLabelsbySheet = new wxCheckBox( this, wxID_ANY, _("Hierachy pins by sheets"), wxDefaultPosition, wxDefaultSize, 0 );
sbListOptionsSizer->Add( m_GenListLabelsbySheet, 0, wxALL, 5 );
sbOptionsSizer->Add( sbListOptionsSizer, 0, wxEXPAND, 5 );
wxString m_OutputFormCtrlChoices[] = { _("List"), _("Text for spreadsheet import") };
int m_OutputFormCtrlNChoices = sizeof( m_OutputFormCtrlChoices ) / sizeof( wxString );
m_OutputFormCtrl = new wxRadioBox( this, ID_RADIOBOX_SELECT_FORMAT, _("Output format:"), wxDefaultPosition, wxDefaultSize, m_OutputFormCtrlNChoices, m_OutputFormCtrlChoices, 1, wxRA_SPECIFY_COLS );
m_OutputFormCtrl->SetSelection( 0 );
sbOptionsSizer->Add( m_OutputFormCtrl, 0, wxALL|wxEXPAND, 5 );
wxString m_OutputSeparatorCtrlChoices[] = { _("Tab"), _(";"), _(",") };
int m_OutputSeparatorCtrlNChoices = sizeof( m_OutputSeparatorCtrlChoices ) / sizeof( wxString );
m_OutputSeparatorCtrl = new wxRadioBox( this, wxID_ANY, _("Field separator for spreadsheet import:"), wxDefaultPosition, wxDefaultSize, m_OutputSeparatorCtrlNChoices, m_OutputSeparatorCtrlChoices, 1, wxRA_SPECIFY_COLS|wxRA_SPECIFY_ROWS );
m_OutputSeparatorCtrl->SetSelection( 0 );
sbOptionsSizer->Add( m_OutputSeparatorCtrl, 1, wxALL, 5 );
wxStaticBoxSizer* sbBrowseOptSizer;
sbBrowseOptSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Options:") ), wxVERTICAL );
m_GetListBrowser = new wxCheckBox( this, wxID_ANY, _("Launch list browser"), wxDefaultPosition, wxDefaultSize, 0 );
sbBrowseOptSizer->Add( m_GetListBrowser, 0, wxALL|wxEXPAND, 5 );
sbOptionsSizer->Add( sbBrowseOptSizer, 0, wxEXPAND, 5 );
bMainSizer->Add( sbOptionsSizer, 0, 0, 5 );
wxBoxSizer* bRightSizer;
bRightSizer = new wxBoxSizer( wxVERTICAL );
wxStaticBoxSizer* sbFieldsSelectionSizer;
sbFieldsSelectionSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Fields to add:") ), wxVERTICAL );
wxStaticBoxSizer* sbFixedFieldsSizer;
sbFixedFieldsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("System Fields:") ), wxVERTICAL );
m_AddFootprintField = new wxCheckBox( this, wxID_ANY, _("Footprint"), wxDefaultPosition, wxDefaultSize, 0 );
sbFixedFieldsSizer->Add( m_AddFootprintField, 0, wxALL|wxEXPAND, 5 );
sbFieldsSelectionSizer->Add( sbFixedFieldsSizer, 0, wxEXPAND, 5 );
wxStaticBoxSizer* sbUsersFiledsSizer;
sbUsersFiledsSizer = new wxStaticBoxSizer( new wxStaticBox( this, wxID_ANY, _("Users Fields:") ), wxVERTICAL );
m_AddField1 = new wxCheckBox( this, wxID_ANY, _("Field 1"), wxDefaultPosition, wxDefaultSize, 0 );
sbUsersFiledsSizer->Add( m_AddField1, 0, wxEXPAND|wxALL, 5 );
m_AddField2 = new wxCheckBox( this, wxID_ANY, _("Field 2"), wxDefaultPosition, wxDefaultSize, 0 );
sbUsersFiledsSizer->Add( m_AddField2, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_AddField3 = new wxCheckBox( this, wxID_ANY, _("Field 3"), wxDefaultPosition, wxDefaultSize, 0 );
sbUsersFiledsSizer->Add( m_AddField3, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_AddField4 = new wxCheckBox( this, wxID_ANY, _("Field 4"), wxDefaultPosition, wxDefaultSize, 0 );
sbUsersFiledsSizer->Add( m_AddField4, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_AddField5 = new wxCheckBox( this, wxID_ANY, _("Field 5"), wxDefaultPosition, wxDefaultSize, 0 );
sbUsersFiledsSizer->Add( m_AddField5, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_AddField6 = new wxCheckBox( this, wxID_ANY, _("Field 6"), wxDefaultPosition, wxDefaultSize, 0 );
sbUsersFiledsSizer->Add( m_AddField6, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_AddField7 = new wxCheckBox( this, wxID_ANY, _("Field 7"), wxDefaultPosition, wxDefaultSize, 0 );
sbUsersFiledsSizer->Add( m_AddField7, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_AddField8 = new wxCheckBox( this, wxID_ANY, _("Field 8"), wxDefaultPosition, wxDefaultSize, 0 );
sbUsersFiledsSizer->Add( m_AddField8, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_AddAllFields = new wxCheckBox( this, wxID_ANY, _("All existing users fields"), wxDefaultPosition, wxDefaultSize, 0 );
sbUsersFiledsSizer->Add( m_AddAllFields, 0, wxALL, 5 );
sbFieldsSelectionSizer->Add( sbUsersFiledsSizer, 0, wxEXPAND, 5 );
bRightSizer->Add( sbFieldsSelectionSizer, 1, wxALIGN_CENTER_HORIZONTAL|wxBOTTOM, 5 );
bRightSizer->Add( 10, 10, 0, 0, 5 );
m_buttonOK = new wxButton( this, wxID_OK, _("Ok"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonOK->SetDefault();
m_buttonOK->SetForegroundColour( wxColour( 170, 0, 0 ) );
bRightSizer->Add( m_buttonOK, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 );
m_buttonCANCEL = new wxButton( this, wxID_CANCEL, _("Close"), wxDefaultPosition, wxDefaultSize, 0 );
m_buttonCANCEL->SetForegroundColour( wxColour( 11, 0, 202 ) );
bRightSizer->Add( m_buttonCANCEL, 0, wxALL|wxALIGN_CENTER_VERTICAL|wxALIGN_CENTER_HORIZONTAL, 5 );
bMainSizer->Add( bRightSizer, 1, wxRIGHT|wxLEFT, 5 );
this->SetSizer( bMainSizer );
this->Layout();
// Connect Events
m_OutputFormCtrl->Connect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_BUILD_BOM_BASE::OnRadioboxSelectFormatSelected ), NULL, this );
m_buttonOK->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BUILD_BOM_BASE::OnOkClick ), NULL, this );
m_buttonCANCEL->Connect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BUILD_BOM_BASE::OnCancelClick ), NULL, this );
}
DIALOG_BUILD_BOM_BASE::~DIALOG_BUILD_BOM_BASE()
{
// Disconnect Events
m_OutputFormCtrl->Disconnect( wxEVT_COMMAND_RADIOBOX_SELECTED, wxCommandEventHandler( DIALOG_BUILD_BOM_BASE::OnRadioboxSelectFormatSelected ), NULL, this );
m_buttonOK->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BUILD_BOM_BASE::OnOkClick ), NULL, this );
m_buttonCANCEL->Disconnect( wxEVT_COMMAND_BUTTON_CLICKED, wxCommandEventHandler( DIALOG_BUILD_BOM_BASE::OnCancelClick ), NULL, this );
}
This diff is collapsed.
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version Apr 16 2008)
// http://www.wxformbuilder.org/
//
// PLEASE DO "NOT" EDIT THIS FILE!
///////////////////////////////////////////////////////////////////////////
#ifndef __dialog_build_BOM_base__
#define __dialog_build_BOM_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/statbox.h>
#include <wx/radiobox.h>
#include <wx/button.h>
#include <wx/dialog.h>
///////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
/// Class DIALOG_BUILD_BOM_BASE
///////////////////////////////////////////////////////////////////////////////
class DIALOG_BUILD_BOM_BASE : public wxDialog
{
private:
protected:
enum
{
ID_RADIOBOX_SELECT_FORMAT = 1000,
};
wxCheckBox* m_ListCmpbyRefItems;
wxCheckBox* m_ListSubCmpItems;
wxCheckBox* m_ListCmpbyValItems;
wxCheckBox* m_GenListLabelsbyVal;
wxCheckBox* m_GenListLabelsbySheet;
wxRadioBox* m_OutputFormCtrl;
wxRadioBox* m_OutputSeparatorCtrl;
wxCheckBox* m_GetListBrowser;
wxCheckBox* m_AddFootprintField;
wxCheckBox* m_AddField1;
wxCheckBox* m_AddField2;
wxCheckBox* m_AddField3;
wxCheckBox* m_AddField4;
wxCheckBox* m_AddField5;
wxCheckBox* m_AddField6;
wxCheckBox* m_AddField7;
wxCheckBox* m_AddField8;
wxCheckBox* m_AddAllFields;
wxButton* m_buttonOK;
wxButton* m_buttonCANCEL;
// Virtual event handlers, overide them in your derived class
virtual void OnRadioboxSelectFormatSelected( wxCommandEvent& event ){ event.Skip(); }
virtual void OnOkClick( wxCommandEvent& event ){ event.Skip(); }
virtual void OnCancelClick( wxCommandEvent& event ){ event.Skip(); }
public:
DIALOG_BUILD_BOM_BASE( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = _("List of Material"), const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxSize( 415,382 ), long style = wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
~DIALOG_BUILD_BOM_BASE();
};
#endif //__dialog_build_BOM_base__
...@@ -89,6 +89,7 @@ OBJECTS = eeschema.o\ ...@@ -89,6 +89,7 @@ OBJECTS = eeschema.o\
delete.o\ delete.o\
build_BOM.o \ build_BOM.o \
dialog_build_BOM.o \ dialog_build_BOM.o \
dialog_build_BOM_base.o \
erc.o\ erc.o\
dialog_erc.o\ dialog_erc.o\
selpart.o \ selpart.o \
......
...@@ -539,7 +539,7 @@ void WinEDA_SchematicFrame::OnCreateNetlist( wxCommandEvent& event ) ...@@ -539,7 +539,7 @@ void WinEDA_SchematicFrame::OnCreateNetlist( wxCommandEvent& event )
void WinEDA_SchematicFrame::OnCreateBillOfMaterials( wxCommandEvent& ) void WinEDA_SchematicFrame::OnCreateBillOfMaterials( wxCommandEvent& )
/**********************************************************************/ /**********************************************************************/
{ {
WinEDA_Build_BOM_Frame* dlg = new WinEDA_Build_BOM_Frame( this ); DIALOG_BUILD_BOM* dlg = new DIALOG_BUILD_BOM( this );
dlg->ShowModal(); dlg->ShowModal();
dlg->Destroy(); dlg->Destroy();
......
...@@ -495,20 +495,38 @@ int ReturnValueFromString( int Units, const wxString& TextValue, int ...@@ -495,20 +495,38 @@ int ReturnValueFromString( int Units, const wxString& TextValue, int
*/ */
wxString ReturnStringFromValue( int aUnits, int aValue, int aInternal_Unit, bool aAdd_unit_symbol = false ); wxString ReturnStringFromValue( int aUnits, int aValue, int aInternal_Unit, bool aAdd_unit_symbol = false );
void AddUnitSymbol( wxStaticText& Stext, int Units = g_UnitMetric );
/* Add string " (mm):" or " ("):" to the static text Stext. /* Add string " (mm):" or " ("):" to the static text Stext.
* Used in dialog boxes for entering values depending on selected units */ * Used in dialog boxes for entering values depending on selected units */
void PutValueInLocalUnits( wxTextCtrl& TextCtr, int Value, int Internal_Unit ); void AddUnitSymbol( wxStaticText& Stext, int Units = g_UnitMetric );
/* Convert the number Value in a string according to the internal units /* Convert the number Value in a string according to the internal units
* and the selected unit (g_UnitMetric) and put it in the wxTextCtrl TextCtrl */ * and the selected unit (g_UnitMetric) and put it in the wxTextCtrl TextCtrl */
int ReturnValueFromTextCtrl( const wxTextCtrl& TextCtr, int Internal_Unit ); void PutValueInLocalUnits( wxTextCtrl& TextCtr, int Value, int Internal_Unit );
/* Convert the Value in the wxTextCtrl TextCtrl in an integer, /* Convert the Value in the wxTextCtrl TextCtrl in an integer,
* according to the internal units and the selected unit (g_UnitMetric) */ * according to the internal units and the selected unit (g_UnitMetric) */
int ReturnValueFromTextCtrl( const wxTextCtrl& TextCtr, int Internal_Unit );
/**
* Function To_User_Unit
* Convert in inch or mm the variable "val" (double)given in internal units
* @return the converted value, in double
* @param is_metric : true if the result must be returned in mm , false if inches
* @param val : double : the given value
* @param internal_unit_value = internal units per inch
*/
double To_User_Unit( bool is_metric, double val, int internal_unit_value );
/**
* Function To_User_Unit
* Convert in inch or mm the variable "val" (double)given in internal units
* @return the converted value, in double
* @param is_metric : true if the result must be returned in mm , false if inches
* @param val : integer : the given value
* @param internal_unit_value = internal units per inch
*/
double To_User_Unit( bool is_metric, int val, int internal_unit_value ); double To_User_Unit( bool is_metric, int val, int internal_unit_value );
int From_User_Unit( bool is_metric, double val, int internal_unit_value ); int From_User_Unit( bool is_metric, double val, int internal_unit_value );
wxString GenDate(); wxString GenDate();
void MyFree( void* pt_mem ); void MyFree( void* pt_mem );
......
...@@ -228,7 +228,7 @@ enum main_id { ...@@ -228,7 +228,7 @@ enum main_id {
ID_POPUP_GRID_PLUS, ID_POPUP_GRID_PLUS,
ID_POPUP_GRID_MOINS, ID_POPUP_GRID_MOINS,
ID_POPUP_GRID_SELECT, ID_POPUP_GRID_SELECT,
ID_POPUP_GRID_LEVEL_1000, ID_POPUP_GRID_LEVEL_1000, // id for first predefined grid in inches (1000 * 0.0001 inch)
ID_POPUP_GRID_LEVEL_500, ID_POPUP_GRID_LEVEL_500,
ID_POPUP_GRID_LEVEL_250, ID_POPUP_GRID_LEVEL_250,
ID_POPUP_GRID_LEVEL_200, ID_POPUP_GRID_LEVEL_200,
...@@ -239,7 +239,12 @@ enum main_id { ...@@ -239,7 +239,12 @@ enum main_id {
ID_POPUP_GRID_LEVEL_10, ID_POPUP_GRID_LEVEL_10,
ID_POPUP_GRID_LEVEL_5, ID_POPUP_GRID_LEVEL_5,
ID_POPUP_GRID_LEVEL_2, ID_POPUP_GRID_LEVEL_2,
ID_POPUP_GRID_LEVEL_1, ID_POPUP_GRID_LEVEL_1, // id for last predefined grid in inches ( 0.0001 inch)
ID_POPUP_GRID_LEVEL_1MM, // id for first predefined grid in mm (1mm)
ID_POPUP_GRID_LEVEL_0_5MM,
ID_POPUP_GRID_LEVEL_0_25MM,
ID_POPUP_GRID_LEVEL_0_2MM,
ID_POPUP_GRID_LEVEL_0_1MM,
ID_POPUP_GRID_USER, ID_POPUP_GRID_USER,
......
...@@ -351,7 +351,7 @@ void WinEDA_BasePcbFrame::Affiche_Status_Box() ...@@ -351,7 +351,7 @@ void WinEDA_BasePcbFrame::Affiche_Status_Box()
ro = sqrt( ( (double) dx * dx ) + ( (double) dy * dy ) ); ro = sqrt( ( (double) dx * dx ) + ( (double) dy * dy ) );
Line.Printf( g_UnitMetric ? wxT( "Ro %.3f Th %.1f" ) : wxT( "Ro %.4f Th %.1f" ), Line.Printf( g_UnitMetric ? wxT( "Ro %.3f Th %.1f" ) : wxT( "Ro %.4f Th %.1f" ),
To_User_Unit( g_UnitMetric, (int) round( ro ), m_InternalUnits ), To_User_Unit( g_UnitMetric, ro, m_InternalUnits ),
theta ); theta );
} }
......
...@@ -13,34 +13,45 @@ ...@@ -13,34 +13,45 @@
/* Default pcbnew zoom values. /* Default pcbnew zoom values.
* Limited to 19 values to keep a decent size to menus * Limited to 19 values to keep a decent size to menus
* 15 it better but does not allow a sufficient number of values * 15 it better but does not allow a sufficient number of values
* roughtly a 1.5 progression. * roughtly a 1.5 progression.
* The last 2 values is handy when somebody uses a library import of a module * The last 2 values is handy when somebody uses a library import of a module
* (or foreign data) which has a bad coordinate * (or foreign data) which has a bad coordinate
* Also useful in Gerbview for this reason. * Also useful in Gerbview for this reason.
* Zoom 5 and 10 can create artefacts when drawing (integer overflow in low level graphic functions ) * Zoom 5 and 10 can create artefacts when drawing (integer overflow in low level graphic functions )
*/ */
static const int PcbZoomList[] = { 5, 10, 15, 22, 30, 45, 70, 100, 150, 220, 350, 500, 800, 1200, static const int PcbZoomList[] = {
2000, 3500, 5000, 10000, 20000 }; 5, 10, 15, 22, 30, 45, 70, 100, 150, 220, 350, 500, 800, 1200,
2000, 3500, 5000, 10000, 20000
};
#define PCB_ZOOM_LIST_CNT ( sizeof( PcbZoomList ) / sizeof( int ) ) #define PCB_ZOOM_LIST_CNT ( sizeof( PcbZoomList ) / sizeof( int ) )
/* Default grid sizes for PCB editor screens. */ /* Default grid sizes for PCB editor screens. */
#define MM_TO_PCB_UNITS 10000.0 / 25.4
static GRID_TYPE PcbGridList[] = { static GRID_TYPE PcbGridList[] = {
{ ID_POPUP_GRID_LEVEL_1000, wxRealPoint( 1000, 1000 ) }, // predefined grid list in 0.0001 inches
{ ID_POPUP_GRID_LEVEL_500, wxRealPoint( 500, 500 ) }, { ID_POPUP_GRID_LEVEL_1000, wxRealPoint( 1000, 1000 ) },
{ ID_POPUP_GRID_LEVEL_250, wxRealPoint( 250, 250 ) }, { ID_POPUP_GRID_LEVEL_500, wxRealPoint( 500, 500 ) },
{ ID_POPUP_GRID_LEVEL_200, wxRealPoint( 200, 200 ) }, { ID_POPUP_GRID_LEVEL_250, wxRealPoint( 250, 250 ) },
{ ID_POPUP_GRID_LEVEL_100, wxRealPoint( 100, 100 ) }, { ID_POPUP_GRID_LEVEL_200, wxRealPoint( 200, 200 ) },
{ ID_POPUP_GRID_LEVEL_50, wxRealPoint( 50, 50 ) }, { ID_POPUP_GRID_LEVEL_100, wxRealPoint( 100, 100 ) },
{ ID_POPUP_GRID_LEVEL_25, wxRealPoint( 25, 25 ) }, { ID_POPUP_GRID_LEVEL_50, wxRealPoint( 50, 50 ) },
{ ID_POPUP_GRID_LEVEL_20, wxRealPoint( 20, 20 ) }, { ID_POPUP_GRID_LEVEL_25, wxRealPoint( 25, 25 ) },
{ ID_POPUP_GRID_LEVEL_10, wxRealPoint( 10, 10 ) }, { ID_POPUP_GRID_LEVEL_20, wxRealPoint( 20, 20 ) },
{ ID_POPUP_GRID_LEVEL_5, wxRealPoint( 5, 5 ) }, { ID_POPUP_GRID_LEVEL_10, wxRealPoint( 10, 10 ) },
{ ID_POPUP_GRID_LEVEL_2, wxRealPoint( 2, 2 ) }, { ID_POPUP_GRID_LEVEL_5, wxRealPoint( 5, 5 ) },
{ ID_POPUP_GRID_LEVEL_1, wxRealPoint( 1, 1 ) } { ID_POPUP_GRID_LEVEL_2, wxRealPoint( 2, 2 ) },
{ ID_POPUP_GRID_LEVEL_1, wxRealPoint( 1, 1 ) },
// predefined grid list in mm
{ ID_POPUP_GRID_LEVEL_1MM, wxRealPoint( MM_TO_PCB_UNITS, MM_TO_PCB_UNITS ) },
{ ID_POPUP_GRID_LEVEL_0_5MM, wxRealPoint( MM_TO_PCB_UNITS * 0.5, MM_TO_PCB_UNITS * 0.5 ) },
{ ID_POPUP_GRID_LEVEL_0_25MM, wxRealPoint( MM_TO_PCB_UNITS * 0.25, MM_TO_PCB_UNITS * 0.25 ) },
{ ID_POPUP_GRID_LEVEL_0_2MM, wxRealPoint( MM_TO_PCB_UNITS * 0.2, MM_TO_PCB_UNITS * 0.2 ) },
{ ID_POPUP_GRID_LEVEL_0_1MM, wxRealPoint( MM_TO_PCB_UNITS * 0.1, MM_TO_PCB_UNITS * 0.1 ) }
}; };
#define PCB_GRID_LIST_CNT ( sizeof( PcbGridList ) / sizeof( GRID_TYPE ) ) #define PCB_GRID_LIST_CNT ( sizeof( PcbGridList ) / sizeof( GRID_TYPE ) )
...@@ -128,8 +139,8 @@ DISPLAY_OPTIONS::DISPLAY_OPTIONS() ...@@ -128,8 +139,8 @@ DISPLAY_OPTIONS::DISPLAY_OPTIONS()
DisplayPadNoConn = TRUE; DisplayPadNoConn = TRUE;
DisplayPadIsol = TRUE; DisplayPadIsol = TRUE;
DisplayModEdge = TRUE; DisplayModEdge = TRUE;
DisplayModText = TRUE; DisplayModText = TRUE;
DisplayPcbTrackFill = TRUE; /* FALSE = sketch , TRUE = rempli */ DisplayPcbTrackFill = TRUE; /* FALSE = sketch , TRUE = rempli */
DisplayTrackIsol = FALSE; DisplayTrackIsol = FALSE;
m_DisplayViaMode = VIA_HOLE_NOT_SHOW; m_DisplayViaMode = VIA_HOLE_NOT_SHOW;
...@@ -175,9 +186,9 @@ EDA_BoardDesignSettings::EDA_BoardDesignSettings() ...@@ -175,9 +186,9 @@ EDA_BoardDesignSettings::EDA_BoardDesignSettings()
m_CopperLayerCount = 2; // Default design is a double sided board m_CopperLayerCount = 2; // Default design is a double sided board
m_ViaDrill = 250; // defualt via drill (for the entire board) m_ViaDrill = 250; // defualt via drill (for the entire board)
m_ViaDrillCustomValue = 250; // via drill for vias which must have a defined drill value m_ViaDrillCustomValue = 250; // via drill for vias which must have a defined drill value
m_CurrentViaSize = 450; // Current via size m_CurrentViaSize = 450; // Current via size
m_CurrentViaType = VIA_THROUGH; // via type (VIA_BLIND_BURIED, VIA_THROUGH VIA_MICROVIA) m_CurrentViaType = VIA_THROUGH; // via type (VIA_BLIND_BURIED, VIA_THROUGH VIA_MICROVIA)
m_CurrentTrackWidth = 170; // current track width m_CurrentTrackWidth = 170; // current track width
m_UseConnectedTrackWidth = false; // if true, when creating a new track starting on an existing track, use this track width m_UseConnectedTrackWidth = false; // if true, when creating a new track starting on an existing track, use this track width
m_MicroViaDrill = 50; // micro via drill (for the entire board) m_MicroViaDrill = 50; // micro via drill (for the entire board)
m_CurrentMicroViaSize = 150; // Current micro via size m_CurrentMicroViaSize = 150; // Current micro via size
...@@ -191,10 +202,10 @@ EDA_BoardDesignSettings::EDA_BoardDesignSettings() ...@@ -191,10 +202,10 @@ EDA_BoardDesignSettings::EDA_BoardDesignSettings()
m_DrawSegmentWidth = 100; // current graphic line width (not EDGE layer) m_DrawSegmentWidth = 100; // current graphic line width (not EDGE layer)
m_EdgeSegmentWidth = 100; // current graphic line width (EDGE layer only) m_EdgeSegmentWidth = 100; // current graphic line width (EDGE layer only)
m_PcbTextWidth = 100; // current Pcb (not module) Text width m_PcbTextWidth = 100; // current Pcb (not module) Text width
m_PcbTextSize = wxSize( 500, 500 ); // current Pcb (not module) Text size m_PcbTextSize = wxSize( 500, 500 ); // current Pcb (not module) Text size
m_TrackClearence = 100; // track to track and track to pads clearance m_TrackClearence = 100; // track to track and track to pads clearance
m_MaskMargin = 150; // Solder mask margin m_MaskMargin = 150; // Solder mask margin
/* Color options for screen display of the Printed Board: */ /* Color options for screen display of the Printed Board: */
m_PcbGridColor = DARKGRAY; // Grid color m_PcbGridColor = DARKGRAY; // Grid color
......
...@@ -240,7 +240,7 @@ void GenDrillMapFile( BOARD* aPcb, FILE* aFile, const wxString& aFullFileName, w ...@@ -240,7 +240,7 @@ void GenDrillMapFile( BOARD* aPcb, FILE* aFile, const wxString& aFullFileName, w
PlotGraphicText( format, wxPoint(x,y), BLACK, PlotGraphicText( format, wxPoint(x,y), BLACK,
Text, Text,
0, wxSize((int)(CharSize * CharScale), (int)(CharSize * CharScale)), 0, wxSize((int)(CharSize * CharScale), (int)(CharSize * CharScale)),
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
TextWidth ); TextWidth );
break; break;
} }
...@@ -344,7 +344,7 @@ void GenDrillMapFile( BOARD* aPcb, FILE* aFile, const wxString& aFullFileName, w ...@@ -344,7 +344,7 @@ void GenDrillMapFile( BOARD* aPcb, FILE* aFile, const wxString& aFullFileName, w
PlotGraphicText( format, wxPoint(x,y), BLACK, PlotGraphicText( format, wxPoint(x,y), BLACK,
msg, msg,
0, wxSize((int)(CharSize * CharScale), (int)(CharSize * CharScale)), 0, wxSize((int)(CharSize * CharScale), (int)(CharSize * CharScale)),
GR_TEXT_HJUSTIFY_CENTER, GR_TEXT_VJUSTIFY_CENTER, GR_TEXT_HJUSTIFY_LEFT, GR_TEXT_VJUSTIFY_CENTER,
TextWidth ); TextWidth );
break; break;
} }
......
...@@ -611,7 +611,7 @@ void WinEDA_PcbFrame::ReCreateAuxiliaryToolbar() ...@@ -611,7 +611,7 @@ void WinEDA_PcbFrame::ReCreateAuxiliaryToolbar()
// mise a jour des affichages // mise a jour des affichages
m_SelGridBox->Clear(); m_SelGridBox->Clear();
wxString format = _( "Grid" ); wxString format = _( "Grid");
if( g_UnitMetric == INCHES ) if( g_UnitMetric == INCHES )
format += wxT( " %.1f" ); format += wxT( " %.1f" );
else else
...@@ -620,9 +620,7 @@ void WinEDA_PcbFrame::ReCreateAuxiliaryToolbar() ...@@ -620,9 +620,7 @@ void WinEDA_PcbFrame::ReCreateAuxiliaryToolbar()
for( i = 0; i < GetScreen()->m_GridList.GetCount(); i++ ) for( i = 0; i < GetScreen()->m_GridList.GetCount(); i++ )
{ {
GRID_TYPE grid = GetScreen()->m_GridList[i]; GRID_TYPE grid = GetScreen()->m_GridList[i];
double value = To_User_Unit( g_UnitMetric, double value = To_User_Unit( g_UnitMetric, grid.m_Size.x, m_InternalUnits );
(int)grid.m_Size.x,
PCB_INTERNAL_UNIT );
if( grid.m_Id != ID_POPUP_GRID_USER ) if( grid.m_Id != ID_POPUP_GRID_USER )
{ {
if( g_UnitMetric == INCHES ) if( g_UnitMetric == INCHES )
......
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