Some minor fixes and cleanup.
This commit is contained in:
parent
3907de0289
commit
10098b5c71
|
@ -5,9 +5,9 @@
|
||||||
/*
|
/*
|
||||||
* This program source code file is part of KiCad, a free EDA CAD application.
|
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||||
*
|
*
|
||||||
* Copyright (C) 1992-2010 Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
|
* Copyright (C) 1992-2015 Jean-Pierre Charras <jean-pierre.charras@gipsa-lab.inpg.fr>
|
||||||
* Copyright (C) 2010 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
* Copyright (C) 2010 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
|
||||||
* Copyright (C) 1992-2010 KiCad Developers, see change_log.txt for contributors.
|
* Copyright (C) 1992-2015 KiCad Developers, see change_log.txt for contributors.
|
||||||
*
|
*
|
||||||
* This program is free software; you can redistribute it and/or
|
* This program is free software; you can redistribute it and/or
|
||||||
* modify it under the terms of the GNU General Public License
|
* modify it under the terms of the GNU General Public License
|
||||||
|
@ -156,13 +156,13 @@ private:
|
||||||
int m_ivalue; // the integer value, for PUSHPARM type item
|
int m_ivalue; // the integer value, for PUSHPARM type item
|
||||||
|
|
||||||
public:
|
public:
|
||||||
AM_PARAM_ITEM( parm_item_type aType = NOP, double aValue = 0.0)
|
AM_PARAM_ITEM( parm_item_type aType, double aValue )
|
||||||
{
|
{
|
||||||
m_type = aType;
|
m_type = aType;
|
||||||
m_dvalue = aValue;
|
m_dvalue = aValue;
|
||||||
m_ivalue = 0;
|
m_ivalue = 0;
|
||||||
}
|
}
|
||||||
AM_PARAM_ITEM( parm_item_type aType = NOP, int aValue = 0)
|
AM_PARAM_ITEM( parm_item_type aType, int aValue )
|
||||||
{
|
{
|
||||||
m_type = aType;
|
m_type = aType;
|
||||||
m_dvalue = 0.0;
|
m_dvalue = 0.0;
|
||||||
|
|
|
@ -331,7 +331,7 @@ static void idf_export_module( BOARD* aPcb, MODULE* aModule,
|
||||||
if( dlength < drill )
|
if( dlength < drill )
|
||||||
{
|
{
|
||||||
std::swap( drill, dlength );
|
std::swap( drill, dlength );
|
||||||
angle += M_PI2;
|
angle += M_PI_2;
|
||||||
}
|
}
|
||||||
|
|
||||||
// NOTE: KiCad measures a slot's length from end to end
|
// NOTE: KiCad measures a slot's length from end to end
|
||||||
|
|
|
@ -1137,9 +1137,9 @@ void IDF_SEGMENT::CalcCenterAndRadius( void )
|
||||||
double h = sqrt( dh2 );
|
double h = sqrt( dh2 );
|
||||||
|
|
||||||
if( angle > 0.0 )
|
if( angle > 0.0 )
|
||||||
offAng += M_PI2;
|
offAng += M_PI_2;
|
||||||
else
|
else
|
||||||
offAng -= M_PI2;
|
offAng -= M_PI_2;
|
||||||
|
|
||||||
if( ( angle > 180.0 ) || ( angle < -180.0 ) )
|
if( ( angle > 180.0 ) || ( angle < -180.0 ) )
|
||||||
offAng += M_PI;
|
offAng += M_PI;
|
||||||
|
|
|
@ -32,18 +32,7 @@
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
#include <exception>
|
#include <exception>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
#include <cmath>
|
||||||
#ifndef M_PI
|
|
||||||
#define M_PI 3.1415926535897932384626433832795028841
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef M_PI2
|
|
||||||
#define M_PI2 ( M_PI / 2.0 )
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef M_PI4
|
|
||||||
#define M_PI4 ( M_PI / 4.0 )
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// differences in angle smaller than MIN_ANG are considered equal
|
// differences in angle smaller than MIN_ANG are considered equal
|
||||||
#define MIN_ANG (0.01)
|
#define MIN_ANG (0.01)
|
||||||
|
|
|
@ -3522,7 +3522,7 @@ bool IDF3_BOARD::AddSlot( double aWidth, double aLength, double aOrientation, do
|
||||||
}
|
}
|
||||||
|
|
||||||
double a1 = aOrientation / 180.0 * M_PI;
|
double a1 = aOrientation / 180.0 * M_PI;
|
||||||
double a2 = a1 + M_PI2;
|
double a2 = a1 + M_PI_2;
|
||||||
double d1 = aLength / 2.0;
|
double d1 = aLength / 2.0;
|
||||||
double d2 = aWidth / 2.0;
|
double d2 = aWidth / 2.0;
|
||||||
double sa1 = sin( a1 );
|
double sa1 = sin( a1 );
|
||||||
|
|
Loading…
Reference in New Issue