Update more places to properly display mils
This commit is contained in:
parent
b1bd1f2a97
commit
ad29a2f3b4
|
@ -357,12 +357,27 @@ void GERBER_FILE_IMAGE::DisplayImageInfo( GERBVIEW_FRAME* aMainFrame )
|
||||||
msg = m_ImageJustifyYCenter ? _("Center") : _("Normal");
|
msg = m_ImageJustifyYCenter ? _("Center") : _("Normal");
|
||||||
aMainFrame->AppendMsgPanel( _( "Y Justify" ), msg, DARKRED );
|
aMainFrame->AppendMsgPanel( _( "Y Justify" ), msg, DARKRED );
|
||||||
|
|
||||||
if( aMainFrame->GetUserUnits() == EDA_UNITS::INCHES )
|
switch( aMainFrame->GetUserUnits() )
|
||||||
|
{
|
||||||
|
case EDA_UNITS::MILS:
|
||||||
|
msg.Printf( wxT( "X=%f Y=%f" ), Iu2Mils( m_ImageJustifyOffset.x ),
|
||||||
|
Iu2Mils( m_ImageJustifyOffset.y ) );
|
||||||
|
break;
|
||||||
|
|
||||||
|
case EDA_UNITS::INCHES:
|
||||||
msg.Printf( wxT( "X=%f Y=%f" ), Iu2Mils( m_ImageJustifyOffset.x ) / 1000.0,
|
msg.Printf( wxT( "X=%f Y=%f" ), Iu2Mils( m_ImageJustifyOffset.x ) / 1000.0,
|
||||||
Iu2Mils( m_ImageJustifyOffset.y ) / 1000.0 );
|
Iu2Mils( m_ImageJustifyOffset.y ) / 1000.0 );
|
||||||
else
|
break;
|
||||||
|
|
||||||
|
case EDA_UNITS::MILLIMETRES:
|
||||||
msg.Printf( wxT( "X=%f Y=%f" ), Iu2Millimeter( m_ImageJustifyOffset.x ),
|
msg.Printf( wxT( "X=%f Y=%f" ), Iu2Millimeter( m_ImageJustifyOffset.x ),
|
||||||
Iu2Millimeter( m_ImageJustifyOffset.y ) );
|
Iu2Millimeter( m_ImageJustifyOffset.y ) );
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
wxASSERT_MSG( false, "Invalid unit" );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
aMainFrame->AppendMsgPanel( _( "Image Justify Offset" ), msg, DARKRED );
|
aMainFrame->AppendMsgPanel( _( "Image Justify Offset" ), msg, DARKRED );
|
||||||
}
|
}
|
||||||
|
|
|
@ -540,8 +540,31 @@ void GERBVIEW_FRAME::Liste_D_Codes()
|
||||||
int ii, jj;
|
int ii, jj;
|
||||||
wxString Line;
|
wxString Line;
|
||||||
wxArrayString list;
|
wxArrayString list;
|
||||||
double scale = GetUserUnits() == EDA_UNITS::INCHES ? IU_PER_MILS * 1000 : IU_PER_MM;
|
int curr_layer = GetActiveLayer();
|
||||||
int curr_layer = GetActiveLayer();
|
|
||||||
|
double scale = 1.0;
|
||||||
|
wxString units;
|
||||||
|
|
||||||
|
switch( GetUserUnits() )
|
||||||
|
{
|
||||||
|
case EDA_UNITS::MILLIMETRES:
|
||||||
|
scale = IU_PER_MM;
|
||||||
|
units = "mm";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case EDA_UNITS::INCHES:
|
||||||
|
scale = IU_PER_MILS * 1000;
|
||||||
|
units = "in";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case EDA_UNITS::MILS:
|
||||||
|
scale = IU_PER_MILS;
|
||||||
|
units = "mil";
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
wxASSERT_MSG( false, "Invalid units" );
|
||||||
|
}
|
||||||
|
|
||||||
for( int layer = 0; layer < (int)ImagesMaxCount(); ++layer )
|
for( int layer = 0; layer < (int)ImagesMaxCount(); ++layer )
|
||||||
{
|
{
|
||||||
|
@ -560,8 +583,6 @@ void GERBVIEW_FRAME::Liste_D_Codes()
|
||||||
|
|
||||||
list.Add( Line );
|
list.Add( Line );
|
||||||
|
|
||||||
const char* units = GetUserUnits() == EDA_UNITS::INCHES ? "\"" : "mm";
|
|
||||||
|
|
||||||
for( ii = 0, jj = 1; ii < TOOLS_MAX_COUNT; ii++ )
|
for( ii = 0, jj = 1; ii < TOOLS_MAX_COUNT; ii++ )
|
||||||
{
|
{
|
||||||
D_CODE* pt_D_code = gerber->GetDCODE( ii + FIRST_DCODE );
|
D_CODE* pt_D_code = gerber->GetDCODE( ii + FIRST_DCODE );
|
||||||
|
|
|
@ -299,8 +299,30 @@ void GERBVIEW_FRAME::updateDCodeSelectBox()
|
||||||
// Build the aperture list of the current layer, and add it to the combo box:
|
// Build the aperture list of the current layer, and add it to the combo box:
|
||||||
wxArrayString dcode_list;
|
wxArrayString dcode_list;
|
||||||
wxString msg;
|
wxString msg;
|
||||||
const char* units = GetUserUnits() == EDA_UNITS::INCHES ? "mils" : "mm";
|
|
||||||
double scale = GetUserUnits() == EDA_UNITS::INCHES ? IU_PER_MILS : IU_PER_MM;
|
double scale = 1.0;
|
||||||
|
wxString units;
|
||||||
|
|
||||||
|
switch( GetUserUnits() )
|
||||||
|
{
|
||||||
|
case EDA_UNITS::MILLIMETRES:
|
||||||
|
scale = IU_PER_MM;
|
||||||
|
units = "mm";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case EDA_UNITS::INCHES:
|
||||||
|
scale = IU_PER_MILS * 1000;
|
||||||
|
units = "in";
|
||||||
|
break;
|
||||||
|
|
||||||
|
case EDA_UNITS::MILS:
|
||||||
|
scale = IU_PER_MILS;
|
||||||
|
units = "mil";
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
wxASSERT_MSG( false, "Invalid units" );
|
||||||
|
}
|
||||||
|
|
||||||
for( int ii = 0; ii < TOOLS_MAX_COUNT; ii++ )
|
for( int ii = 0; ii < TOOLS_MAX_COUNT; ii++ )
|
||||||
{
|
{
|
||||||
|
|
|
@ -337,10 +337,23 @@ void DIALOG_BOARD_STATISTICS::getDataFromPCB()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if( GetUserUnits() == EDA_UNITS::INCHES )
|
switch( GetUserUnits() )
|
||||||
|
{
|
||||||
|
case EDA_UNITS::INCHES:
|
||||||
m_boardArea /= ( IU_PER_MILS * IU_PER_MILS * 1000000 );
|
m_boardArea /= ( IU_PER_MILS * IU_PER_MILS * 1000000 );
|
||||||
else
|
break;
|
||||||
|
|
||||||
|
case EDA_UNITS::MILS:
|
||||||
|
m_boardArea /= ( IU_PER_MILS * IU_PER_MILS );
|
||||||
|
break;
|
||||||
|
|
||||||
|
case EDA_UNITS::MILLIMETRES:
|
||||||
m_boardArea /= ( IU_PER_MM * IU_PER_MM );
|
m_boardArea /= ( IU_PER_MM * IU_PER_MM );
|
||||||
|
break;
|
||||||
|
|
||||||
|
default:
|
||||||
|
wxASSERT_MSG( false, "Invalid unit" );
|
||||||
|
}
|
||||||
|
|
||||||
m_boardWidth = bbox.GetWidth();
|
m_boardWidth = bbox.GetWidth();
|
||||||
m_boardHeight = bbox.GetHeight();
|
m_boardHeight = bbox.GetHeight();
|
||||||
|
|
|
@ -513,7 +513,7 @@ void PCB_EDIT_FRAME::GenFootprintsReport( wxCommandEvent& event )
|
||||||
fn.SetPath( dirDialog.GetPath() );
|
fn.SetPath( dirDialog.GetPath() );
|
||||||
fn.SetExt( wxT( "rpt" ) );
|
fn.SetExt( wxT( "rpt" ) );
|
||||||
|
|
||||||
bool unitMM = GetUserUnits() != EDA_UNITS::INCHES;
|
bool unitMM = GetUserUnits() == EDA_UNITS::MILLIMETRES;
|
||||||
bool success = DoGenFootprintsReport( fn.GetFullPath(), unitMM );
|
bool success = DoGenFootprintsReport( fn.GetFullPath(), unitMM );
|
||||||
|
|
||||||
wxString msg;
|
wxString msg;
|
||||||
|
|
Loading…
Reference in New Issue