Fix minor bug #1429990 (3D viewer shows hidden footprint graphic texts ). Fix minor coverity warnings (not initialized members and dead code)

This commit is contained in:
jean-pierre charras 2015-03-11 14:59:43 +01:00
parent b6c5b291a2
commit f16e083ecf
20 changed files with 212 additions and 186 deletions

View File

@ -114,17 +114,18 @@ void S3D_MESH::openGL_Render()
perVertexNormalsVerify_and_Repair(); perVertexNormalsVerify_and_Repair();
else else
calcPerPointNormals(); calcPerPointNormals();
} }
for( unsigned int idx = 0; idx < m_CoordIndex.size(); idx++ ) for( unsigned int idx = 0; idx < m_CoordIndex.size(); idx++ )
{ {
if( m_MaterialIndex.size() == 0 ) if( m_Materials )
m_Materials->SetOpenGLMaterial( 0, useMaterial ); {
else if( m_MaterialIndex.size() == 0 )
if( m_Materials ) m_Materials->SetOpenGLMaterial( 0, useMaterial );
else
m_Materials->SetOpenGLMaterial( m_MaterialIndex[idx], useMaterial ); m_Materials->SetOpenGLMaterial( m_MaterialIndex[idx], useMaterial );
}
switch( m_CoordIndex[idx].size() ) switch( m_CoordIndex[idx].size() )
{ {
@ -465,7 +466,7 @@ void S3D_MESH::calcPerPointNormals()
if( each_face_A_idx != each_face_B_idx ) if( each_face_A_idx != each_face_B_idx )
{ {
bool addThisVertex = false; bool addThisVertex = false;
for( unsigned int ii = 0; ii < m_CoordIndex[each_face_B_idx].size(); ii++ ) for( unsigned int ii = 0; ii < m_CoordIndex[each_face_B_idx].size(); ii++ )
{ {
if( m_CoordIndex[each_face_B_idx][ii] == vertexIndex ) if( m_CoordIndex[each_face_B_idx][ii] == vertexIndex )
@ -474,7 +475,7 @@ void S3D_MESH::calcPerPointNormals()
break; break;
} }
} }
if( addThisVertex ) if( addThisVertex )
{ {
glm::vec3 vector_face_B = m_PerFaceNormalsNormalized[each_face_B_idx]; glm::vec3 vector_face_B = m_PerFaceNormalsNormalized[each_face_B_idx];

View File

@ -95,10 +95,7 @@ void CVPCB_MAINFRAME::SetNewPkg( const wxString& aFootprintName )
// it now has, so we decrement the count of components without // it now has, so we decrement the count of components without
// a footprint assigned. // a footprint assigned.
if( !hasFootprint ) if( !hasFootprint )
{
hasFootprint = true;
m_undefinedComponentCnt -= 1; m_undefinedComponentCnt -= 1;
}
// Set the new description and deselect the processed component // Set the new description and deselect the processed component
m_compListBox->SetString( componentIndex, description ); m_compListBox->SetString( componentIndex, description );

View File

@ -305,9 +305,6 @@ void SCH_EDIT_FRAME::OnSelectUnit( wxCommandEvent& aEvent )
if( unitCount <= 1 || component->GetUnit() == unit ) if( unitCount <= 1 || component->GetUnit() == unit )
return; return;
if( unit < 1 )
unit = 1;
if( unit > unitCount ) if( unit > unitCount )
unit = unitCount; unit = unitCount;

View File

@ -33,47 +33,21 @@
#include <dialog_helpers.h> #include <dialog_helpers.h>
#include <class_DCodeSelectionbox.h> #include <class_DCodeSelectionbox.h>
/* Process the command triggered by the left button of the mouse when a tool /* Process the command triggered by the left button of the mouse
* is already selected. * currently: just display info in the message panel.
*/ */
void GERBVIEW_FRAME::OnLeftClick( wxDC* DC, const wxPoint& aPosition ) void GERBVIEW_FRAME::OnLeftClick( wxDC* DC, const wxPoint& aPosition )
{ {
GERBER_DRAW_ITEM* DrawStruct = (GERBER_DRAW_ITEM*) GetScreen()->GetCurItem(); GERBER_DRAW_ITEM* DrawStruct = Locate( aPosition, CURSEUR_OFF_GRILLE );
wxString msg;
if( GetToolId() == ID_NO_TOOL_SELECTED ) GetScreen()->SetCurItem( DrawStruct );
if( DrawStruct == NULL )
{ {
if( DrawStruct && DrawStruct->GetFlags() ) GERBER_IMAGE* gerber = g_GERBER_List.GetGbrImage( getActiveLayer() );
{
msg.Printf( wxT( "GERBVIEW_FRAME::OnLeftClick err: Struct %u, m_Flags = %X" ),
(unsigned) DrawStruct->Type(),
(unsigned) DrawStruct->GetFlags() );
wxFAIL_MSG( msg );
}
else
{
DrawStruct = Locate( aPosition, CURSEUR_OFF_GRILLE );
GetScreen()->SetCurItem( DrawStruct );
if( DrawStruct == NULL )
{
GERBER_IMAGE* gerber = g_GERBER_List.GetGbrImage( getActiveLayer() );
if( gerber )
gerber->DisplayImageInfo( );
}
}
}
switch( GetToolId() ) if( gerber )
{ gerber->DisplayImageInfo( );
case ID_NO_TOOL_SELECTED:
break;
if( DrawStruct == NULL )
break;
default:
wxFAIL_MSG( wxT( "GERBVIEW_FRAME::ProcessCommand error" ) );
break;
} }
} }

View File

@ -42,6 +42,27 @@ C_MICROSTRIP::C_MICROSTRIP() : TRANSLINE()
aux_ms = NULL; aux_ms = NULL;
// Initialize these variables mainly to avoid warnings from a static analyzer // Initialize these variables mainly to avoid warnings from a static analyzer
h = 0.0; // height of substrate
ht = 0.0; // height to the top of box
t = 0.0; // thickness of top metal
rough = 0.0; // Roughness of top metal
w = 0.0; // width of lines
w_t_e = 0.0; // even-mode thickness-corrected line width
w_t_o = 0.0; // odd-mode thickness-corrected line width
l = 0.0; // length of lines
s = 0.0; // spacing of lines
Z0_e_0 = 0.0; // static even-mode impedance
Z0_o_0 = 0.0; // static odd-mode impedance
Z0e = 0.0; // even-mode impedance
Z0o = 0.0; // odd-mode impedance
c_e = 0.0; // even-mode capacitance
c_o = 0.0; // odd-mode capacitance
ang_l_e = 0.0; // even-mode electrical length in angle
ang_l_o = 0.0; // odd-mode electrical length in angle
er_eff_e = 0.0; // even-mode effective dielectric constant
er_eff_o = 0.0; // odd-mode effective dielectric constant
er_eff_e_0 = 0.0; // static even-mode effective dielectric constant
er_eff_o_0 = 0.0; // static odd-mode effective dielectric constant
er_eff = 0.0; // dummy er_eff = 0.0; // dummy
w_eff = 0.0; // Effective width of line w_eff = 0.0; // Effective width of line
atten_dielectric_e = 0.0; // even-mode dielectric losses (dB) atten_dielectric_e = 0.0; // even-mode dielectric losses (dB)

View File

@ -3,7 +3,7 @@
* *
* Copyright (C) 2002 Claudio Girardi <in3otd@qsl.net> * Copyright (C) 2002 Claudio Girardi <in3otd@qsl.net>
* Copyright (C) 2005 Stefan Jahn <stefan@lkcc.org> * Copyright (C) 2005 Stefan Jahn <stefan@lkcc.org>
* Modifications for Kicad: Jean-Pierre Charras * Modifications for Kicad: 2015 Jean-Pierre Charras
* *
* 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
@ -19,9 +19,9 @@
* along with this package; see the file COPYING. If not, write to * along with this package; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, * the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
* Boston, MA 02110-1301, USA. * Boston, MA 02110-1301, USA.
*
*/ */
#ifndef _C_MICROSTRIP_H_ #ifndef _C_MICROSTRIP_H_
#define _C_MICROSTRIP_H_ #define _C_MICROSTRIP_H_
@ -31,33 +31,33 @@ public: C_MICROSTRIP();
~C_MICROSTRIP(); ~C_MICROSTRIP();
private: private:
double h; /* height of substrate */ double h; // height of substrate
double ht; /* height to the top of box */ double ht; // height to the top of box
double t; /* thickness of top metal */ double t; // thickness of top metal
double rough; /* Roughness of top metal */ double rough; // Roughness of top metal
double w; /* width of lines */ double w; // width of lines
double w_t_e; /* even-mode thickness-corrected line width */ double w_t_e; // even-mode thickness-corrected line width
double w_t_o; /* odd-mode thickness-corrected line width */ double w_t_o; // odd-mode thickness-corrected line width
double l; /* length of lines */ double l; // length of lines
double s; /* spacing of lines */ double s; // spacing of lines
double Z0_e_0; /* static even-mode impedance */ double Z0_e_0; // static even-mode impedance
double Z0_o_0; /* static odd-mode impedance */ double Z0_o_0; // static odd-mode impedance
double Z0e; /* even-mode impedance */ double Z0e; // even-mode impedance
double Z0o; /* odd-mode impedance */ double Z0o; // odd-mode impedance
double c_e; /* even-mode capacitance */ double c_e; // even-mode capacitance
double c_o; /* odd-mode capacitance */ double c_o; // odd-mode capacitance
double ang_l_e; /* even-mode electrical length in angle */ double ang_l_e; // even-mode electrical length in angle
double ang_l_o; /* odd-mode electrical length in angle */ double ang_l_o; // odd-mode electrical length in angle
double er_eff_e; /* even-mode effective dielectric constant */ double er_eff_e; // even-mode effective dielectric constant
double er_eff_o; /* odd-mode effective dielectric constant */ double er_eff_o; // odd-mode effective dielectric constant
double er_eff_e_0; /* static even-mode effective dielectric constant */ double er_eff_e_0; // static even-mode effective dielectric constant
double er_eff_o_0; /* static odd-mode effective dielectric constant */ double er_eff_o_0; // static odd-mode effective dielectric constant
double er_eff; /* FIXME: dummy */ double er_eff; // FIXME: dummy
double w_eff; /* Effective width of line */ double w_eff; // Effective width of line
double atten_dielectric_e; /* even-mode dielectric losses (dB) */ double atten_dielectric_e; // even-mode dielectric losses (dB)
double atten_cond_e; /* even-mode conductors losses (dB) */ double atten_cond_e; // even-mode conductors losses (dB)
double atten_dielectric_o; /* odd-mode dielectric losses (dB) */ double atten_dielectric_o; // odd-mode dielectric losses (dB)
double atten_cond_o; /* odd-mode conductors losses (dB) */ double atten_cond_o; // odd-mode conductors losses (dB)
public: public:
void analyze(); void analyze();
@ -96,4 +96,4 @@ private:
MICROSTRIP* aux_ms; MICROSTRIP* aux_ms;
}; };
#endif /* _C_MICROSTRIP_H_ */ #endif // _C_MICROSTRIP_H_

View File

@ -43,6 +43,10 @@ COAX::COAX() : TRANSLINE()
m_name = "Coax"; m_name = "Coax";
// Initialize these variables mainly to avoid warnings from a static analyzer // Initialize these variables mainly to avoid warnings from a static analyzer
mur = 0.0; // magnetic permeability of substrate
din = 0.0; // Inner diameter of cable
dout = 0.0; // Outer diameter of cable
l = 0.0; // Length of cable
Z0 = 0.0; // characteristic impedance Z0 = 0.0; // characteristic impedance
ang_l = 0.0; // Electrical length in angle ang_l = 0.0; // Electrical length in angle
atten_dielectric = 0.0; // Loss in dielectric (dB) atten_dielectric = 0.0; // Loss in dielectric (dB)

View File

@ -3,6 +3,7 @@
* *
* Copyright (C) 2001 Gopal Narayanan <gopal@astro.umass.edu> * Copyright (C) 2001 Gopal Narayanan <gopal@astro.umass.edu>
* Copyright (C) 2005 Stefan Jahn <stefan@lkcc.org> * Copyright (C) 2005 Stefan Jahn <stefan@lkcc.org>
* Modifications for Kicad: 2015 Jean-Pierre Charras
* *
* 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
@ -18,9 +19,9 @@
* along with this package; see the file COPYING. If not, write to * along with this package; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, * the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
* Boston, MA 02110-1301, USA. * Boston, MA 02110-1301, USA.
*
*/ */
#ifndef __COAX_H #ifndef __COAX_H
#define __COAX_H #define __COAX_H
@ -29,15 +30,15 @@ class COAX : public TRANSLINE
public: COAX(); public: COAX();
private: private:
double mur; /* magnetic permeability of substrate */ double mur; // magnetic permeability of substrate
double din; /* Inner diameter of cable */ double din; // Inner diameter of cable
double dout; /* Outer diameter of cable */ double dout; // Outer diameter of cable
double l; /* Length of cable */ double l; // Length of cable
double Z0; /* characteristic impedance */ double Z0; // characteristic impedance
double ang_l; /* Electrical length in angle */ double ang_l; // Electrical length in angle
double atten_dielectric; /* Loss in dielectric (dB) */ double atten_dielectric; // Loss in dielectric (dB)
double atten_cond; /* Loss in conductors (dB) */ double atten_cond; // Loss in conductors (dB)
double fc; /* Cutoff frequency for higher order modes */ double fc; // Cutoff frequency for higher order modes
public: public:
void analyze(); void analyze();
@ -55,4 +56,4 @@ private:
void show_results(); void show_results();
}; };
#endif /* __COAX_H */ #endif // __COAX_H

View File

@ -38,11 +38,16 @@ COPLANAR::COPLANAR() : TRANSLINE()
backMetal = false; backMetal = false;
// Initialize these variables mainly to avoid warnings from a static analyzer // Initialize these variables mainly to avoid warnings from a static analyzer
Z0 = 0.0; // characteristic impedance h = 0.0; // height of substrate
ang_l = 0.0; // Electrical length in angle t = 0.0; // thickness of top metal
atten_dielectric = 0.0; // Loss in dielectric (dB) w = 0.0; // width of line
atten_cond = 0.0; // Loss in conductors (dB) s = 0.0; // width of gap between line and ground
er_eff = 1.0; // Effective dielectric constant len = 0.0; // length of line
Z0 = 0.0; // characteristic impedance
ang_l = 0.0; // Electrical length in angle
atten_dielectric = 0.0; // Loss in dielectric (dB)
atten_cond = 0.0; // Loss in conductors (dB)
er_eff = 1.0; // Effective dielectric constant
} }

View File

@ -3,7 +3,7 @@
* *
* Copyright (C) 2008 Michael Margraf <michael.margraf@alumni.tu-berlin.de> * Copyright (C) 2008 Michael Margraf <michael.margraf@alumni.tu-berlin.de>
* Copyright (C) 2005 Stefan Jahn <stefan@lkcc.org> * Copyright (C) 2005 Stefan Jahn <stefan@lkcc.org>
* Modified for Kicad: 2011 jean-pierre.charras * Modified for Kicad: 2015 jean-pierre.charras
* *
* 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
@ -19,9 +19,9 @@
* along with this package; see the file COPYING. If not, write to * along with this package; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, * the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
* Boston, MA 02110-1301, USA. * Boston, MA 02110-1301, USA.
*
*/ */
#ifndef __COPLANAR_H #ifndef __COPLANAR_H
#define __COPLANAR_H #define __COPLANAR_H
@ -30,16 +30,16 @@ class COPLANAR : public TRANSLINE
public: COPLANAR(); public: COPLANAR();
private: private:
double h; /* height of substrate */ double h; // height of substrate
double t; /* thickness of top metal */ double t; // thickness of top metal
double w; /* width of line */ double w; // width of line
double s; /* width of gap between line and ground */ double s; // width of gap between line and ground
double len; /* length of line */ double len; // length of line
double Z0; /* characteristic impedance */ double Z0; // characteristic impedance
double er_eff; /* effective dielectric constant */ double er_eff; // effective dielectric constant
double ang_l; /* Electrical length in angle */ double ang_l; // Electrical length in angle
double atten_dielectric; /* Loss in dielectric (dB) */ double atten_dielectric; // Loss in dielectric (dB)
double atten_cond; /* Loss in conductors (dB) */ double atten_cond; // Loss in conductors (dB)
public: public:
void analyze(); void analyze();
@ -60,4 +60,4 @@ class GROUNDEDCOPLANAR : public COPLANAR
public: GROUNDEDCOPLANAR(); public: GROUNDEDCOPLANAR();
}; };
#endif /* __COPLANAR_H */ #endif // __COPLANAR_H

View File

@ -4,7 +4,7 @@
* Copyright (C) 2001 Gopal Narayanan <gopal@astro.umass.edu> * Copyright (C) 2001 Gopal Narayanan <gopal@astro.umass.edu>
* Copyright (C) 2002 Claudio Girardi <claudio.girardi@ieee.org> * Copyright (C) 2002 Claudio Girardi <claudio.girardi@ieee.org>
* Copyright (C) 2005, 2006 Stefan Jahn <stefan@lkcc.org> * Copyright (C) 2005, 2006 Stefan Jahn <stefan@lkcc.org>
* Modified for Kicad: 2011 jean-pierre.charras * Modified for Kicad: 2015 jean-pierre.charras
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -43,11 +43,23 @@ MICROSTRIP::MICROSTRIP() : TRANSLINE()
m_name = "MicroStrip"; m_name = "MicroStrip";
// Initialize these variables mainly to avoid warnings from a static analyzer // Initialize these variables mainly to avoid warnings from a static analyzer
mur_eff = 0.0; // Effective mag. permeability h = 0.0; // height of substrate
w_eff = 0.0; // Effective width of line ht = 0.0; // height to the top of box
atten_dielectric = 0.0; // Loss in dielectric (dB) t = 0.0; // thickness of top metal
atten_cond = 0.0; // Loss in conductors (dB) rough = 0.0; // Roughness of top metal
Z0_h_1 = 0.0; // homogeneous stripline impedance mur = 0.0; // magnetic permeability of substrate
w = 0.0; // width of line
l = 0.0; // length of line
Z0_0 = 0.0; // static characteristic impedance
Z0 = 0.0; // characteristic impedance
ang_l = 0.0; // Electrical length in angle
er_eff_0 = 0.0; // Static effective dielectric constant
er_eff = 0.0; // Effective dielectric constant
mur_eff = 0.0; // Effective mag. permeability
w_eff = 0.0; // Effective width of line
atten_dielectric = 0.0; // Loss in dielectric (dB)
atten_cond = 0.0; // Loss in conductors (dB)
Z0_h_1 = 0.0; // homogeneous stripline impedance
} }

View File

@ -3,6 +3,7 @@
* *
* Copyright (C) 2001 Gopal Narayanan <gopal@astro.umass.edu> * Copyright (C) 2001 Gopal Narayanan <gopal@astro.umass.edu>
* Copyright (C) 2005 Stefan Jahn <stefan@lkcc.org> * Copyright (C) 2005 Stefan Jahn <stefan@lkcc.org>
* Modified for Kicad: 2015 jean-pierre.charras
* *
* 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
@ -18,9 +19,9 @@
* along with this package; see the file COPYING. If not, write to * along with this package; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, * the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
* Boston, MA 02110-1301, USA. * Boston, MA 02110-1301, USA.
*
*/ */
#ifndef __MICROSTRIP_H #ifndef __MICROSTRIP_H
#define __MICROSTRIP_H #define __MICROSTRIP_H
@ -31,25 +32,25 @@ public: MICROSTRIP();
friend class C_MICROSTRIP; friend class C_MICROSTRIP;
private: private:
double h; /* height of substrate */ double h; // height of substrate
double ht; /* height to the top of box */ double ht; // height to the top of box
double t; /* thickness of top metal */ double t; // thickness of top metal
double rough; /* Roughness of top metal */ double rough; // Roughness of top metal
double mur; /* magnetic permeability of substrate */ double mur; // magnetic permeability of substrate
double w; /* width of line */ double w; // width of line
double l; /* length of line */ double l; // length of line
double Z0_0; /* static characteristic impedance */ double Z0_0; // static characteristic impedance
double Z0; /* characteristic impedance */ double Z0; // characteristic impedance
double ang_l; /* Electrical length in angle */ double ang_l; // Electrical length in angle
double er_eff_0; /* Static effective dielectric constant */ double er_eff_0; // Static effective dielectric constant
double er_eff; /* Effective dielectric constant */ double er_eff; // Effective dielectric constant
double mur_eff; /* Effective mag. permeability */ double mur_eff; // Effective mag. permeability
double w_eff; /* Effective width of line */ double w_eff; // Effective width of line
double atten_dielectric; /* Loss in dielectric (dB) */ double atten_dielectric; // Loss in dielectric (dB)
double atten_cond; /* Loss in conductors (dB) */ double atten_cond; // Loss in conductors (dB)
/* private params */ // private params
double Z0_h_1; /* homogeneous stripline impedance */ double Z0_h_1; // homogeneous stripline impedance
public: public:
void analyze(); void analyze();
@ -88,4 +89,4 @@ private:
void show_results(); void show_results();
}; };
#endif /* __MICROSTRIP_H */ #endif // __MICROSTRIP_H

View File

@ -34,6 +34,14 @@ RECTWAVEGUIDE::RECTWAVEGUIDE() : TRANSLINE()
m_name = "RectWaveGuide"; m_name = "RectWaveGuide";
// Initialize these here variables mainly to avoid warnings from a static analyzer // Initialize these here variables mainly to avoid warnings from a static analyzer
mur = 0.0; // magnetic permeability of substrate
tanm = 0.0; // Magnetic Loss Tangent
a = 0.0; // width of waveguide
b = 0.0; // height of waveguide
l = 0.0; // length of waveguide
Z0 = 0.0; // characteristic impedance
Z0EH = 0.0; // characteristic impedance of field quantities*/
ang_l = 0.0; // Electrical length in angle
er_eff = 0.0; // Effective dielectric constant er_eff = 0.0; // Effective dielectric constant
mur_eff = 0.0; // Effective mag. permeability mur_eff = 0.0; // Effective mag. permeability
atten_dielectric = 0.0; // Loss in dielectric (dB) atten_dielectric = 0.0; // Loss in dielectric (dB)

View File

@ -3,6 +3,7 @@
* *
* Copyright (C) 2001 Gopal Narayanan <gopal@astro.umass.edu> * Copyright (C) 2001 Gopal Narayanan <gopal@astro.umass.edu>
* Copyright (C) 2005 Stefan Jahn <stefan@lkcc.org> * Copyright (C) 2005 Stefan Jahn <stefan@lkcc.org>
* Modified for Kicad: 2015 jean-pierre.charras
* *
* 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
@ -18,9 +19,9 @@
* along with this package; see the file COPYING. If not, write to * along with this package; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, * the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
* Boston, MA 02110-1301, USA. * Boston, MA 02110-1301, USA.
*
*/ */
#ifndef __RECTWAVEGUIDE_H #ifndef __RECTWAVEGUIDE_H
#define __RECTWAVEGUIDE_H #define __RECTWAVEGUIDE_H
@ -29,19 +30,19 @@ class RECTWAVEGUIDE : public TRANSLINE
public: RECTWAVEGUIDE(); public: RECTWAVEGUIDE();
private: private:
double mur; /* magnetic permeability of substrate */ double mur; // magnetic permeability of substrate
double tanm; /* Magnetic Loss Tangent */ double tanm; // Magnetic Loss Tangent
double a; /* width of waveguide */ double a; // width of waveguide
double b; /* height of waveguide */ double b; // height of waveguide
double l; /* length of waveguide */ double l; // length of waveguide
double Z0; /* characteristic impedance */ double Z0; // characteristic impedance
double Z0EH; /* characteristic impedance of field quantities*/ double Z0EH; // characteristic impedance of field quantities*/
double ang_l; /* Electrical length in angle */ double ang_l; // Electrical length in angle
double er_eff; /* Effective dielectric constant */ double er_eff; // Effective dielectric constant
double mur_eff; /* Effective mag. permeability */ double mur_eff; // Effective mag. permeability
double atten_dielectric; /* Loss in dielectric (dB) */ double atten_dielectric; // Loss in dielectric (dB)
double atten_cond; /* Loss in conductors (dB) */ double atten_cond; // Loss in conductors (dB)
double fc10; /* Cutoff frequency for TE10 mode */ double fc10; // Cutoff frequency for TE10 mode
public: public:
void analyze(); void analyze();
@ -61,4 +62,4 @@ private:
void show_results(); void show_results();
}; };
#endif /* __RECTWAVEGUIDE_H */ #endif // __RECTWAVEGUIDE_H

View File

@ -36,11 +36,16 @@ STRIPLINE::STRIPLINE() : TRANSLINE()
m_name = "StripLine"; m_name = "StripLine";
// Initialize these variables mainly to avoid warnings from a static analyzer // Initialize these variables mainly to avoid warnings from a static analyzer
Z0 = 0.0; // characteristic impedance h = 0.0; // height of substrate
ang_l = 0.0; // Electrical length in angle a = 0.0; // distance of strip to top metal
er_eff = 0.0; // effective dielectric constant t = 0.0; // thickness of top metal
atten_dielectric = 0.0; // Loss in dielectric (dB) w = 0.0; // width of line
atten_cond = 0.0; // Loss in conductors (dB) len = 0.0; // length of line
Z0 = 0.0; // characteristic impedance
ang_l = 0.0; // Electrical length in angle
er_eff = 0.0; // effective dielectric constant
atten_dielectric = 0.0; // Loss in dielectric (dB)
atten_cond = 0.0; // Loss in conductors (dB)
} }

View File

@ -36,11 +36,16 @@ TWISTEDPAIR::TWISTEDPAIR() : TRANSLINE()
m_name = "TwistedPair"; m_name = "TwistedPair";
// Initialize these variables mainly to avoid warnings from a static analyzer // Initialize these variables mainly to avoid warnings from a static analyzer
Z0 = 0.0; // characteristic impedance din = 0.0; // Inner diameter of conductor
ang_l = 0.0; // Electrical length in angle dout = 0.0; // Outer diameter of insulator
atten_dielectric = 0.0; // Loss in dielectric (dB) twists = 0.0; // Twists per length
atten_cond = 0.0; // Loss in conductors (dB) er_env = 0.0; // dielectric constant of environment*/
er_eff = 1.0; // Effective dielectric constant len = 0.0; // Length of cable
Z0 = 0.0; // characteristic impedance
ang_l = 0.0; // Electrical length in angle
atten_dielectric = 0.0; // Loss in dielectric (dB)
atten_cond = 0.0; // Loss in conductors (dB)
er_eff = 1.0; // Effective dielectric constant
} }

View File

@ -2,7 +2,7 @@
* twistedpair.h - twisted pair class definition * twistedpair.h - twisted pair class definition
* *
* Copyright (C) 2011 Michael Margraf <michael.margraf@alumni.tu-berlin.de> * Copyright (C) 2011 Michael Margraf <michael.margraf@alumni.tu-berlin.de>
* Modifications 2011 for Kicad: Jean-Pierre Charras * Modified for Kicad: 2015 jean-pierre.charras
* *
* 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
@ -18,9 +18,9 @@
* along with this package; see the file COPYING. If not, write to * along with this package; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor, * the Free Software Foundation, Inc., 51 Franklin Street - Fifth Floor,
* Boston, MA 02110-1301, USA. * Boston, MA 02110-1301, USA.
*
*/ */
#ifndef __TWISTEDPAIR_H #ifndef __TWISTEDPAIR_H
#define __TWISTEDPAIR_H #define __TWISTEDPAIR_H
@ -29,16 +29,16 @@ class TWISTEDPAIR : public TRANSLINE
public: TWISTEDPAIR(); public: TWISTEDPAIR();
private: private:
double din; /* Inner diameter of conductor */ double din; // Inner diameter of conductor
double dout; /* Outer diameter of insulator */ double dout; // Outer diameter of insulator
double twists; /* Twists per length */ double twists; // Twists per length
double er_env; /* dielectric constant of environment*/ double er_env; // dielectric constant of environment*/
double len; /* Length of cable */ double len; // Length of cable
double Z0; /* characteristic impedance */ double Z0; // characteristic impedance
double ang_l; /* Electrical length in angle */ double ang_l; // Electrical length in angle
double er_eff; /* Effective dielectric constant */ double er_eff; // Effective dielectric constant
double atten_dielectric; /* Loss in dielectric (dB) */ double atten_dielectric; // Loss in dielectric (dB)
double atten_cond; /* Loss in conductors (dB) */ double atten_cond; // Loss in conductors (dB)
public: public:
void analyze(); void analyze();

View File

@ -194,8 +194,10 @@ void MODULE::TransformGraphicShapesWithClearanceToPolygonSet(
case PCB_MODULE_TEXT_T: case PCB_MODULE_TEXT_T:
{ {
TEXTE_MODULE* text = static_cast<TEXTE_MODULE*>( item ); TEXTE_MODULE* text = static_cast<TEXTE_MODULE*>( item );
if( text->GetLayer() == aLayer )
if( text->GetLayer() == aLayer && text->IsVisible() )
texts.push_back( text ); texts.push_back( text );
break; break;
} }

View File

@ -1,7 +1,7 @@
/* /*
* 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) 2015 Jean-Pierre Charras, jean-pierre.charras@ujf-grenoble.fr * Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2015 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com> * Copyright (C) 2015 SoftPLC Corporation, Dick Hollenbeck <dick@softplc.com>
* Copyright (C) 2015 Wayne Stambaugh <stambaughw@verizon.net> * Copyright (C) 2015 Wayne Stambaugh <stambaughw@verizon.net>
* Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors. * Copyright (C) 1992-2015 KiCad Developers, see AUTHORS.txt for contributors.
@ -545,20 +545,14 @@ const EDA_RECT MODULE::GetBoundingBox() const
void MODULE::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList ) void MODULE::GetMsgPanelInfo( std::vector< MSG_PANEL_ITEM >& aList )
{ {
int nbpad; int nbpad;
char bufcar[512], Line[512];
wxString msg; wxString msg;
aList.push_back( MSG_PANEL_ITEM( m_Reference->GetShownText(), m_Value->GetShownText(), DARKCYAN ) ); aList.push_back( MSG_PANEL_ITEM( m_Reference->GetShownText(), m_Value->GetShownText(), DARKCYAN ) );
// Display last date the component was edited (useful in Module Editor). // Display last date the component was edited (useful in Module Editor).
time_t edit_time = m_LastEditTime; wxDateTime date( m_LastEditTime );
strcpy( Line, ctime( &edit_time ) ); // Date format: see http://www.cplusplus.com/reference/ctime/strftime
strtok( Line, " \n\r" ); msg = date.Format( wxT( "%b %d, %Y" ) ); // Abbreviated_month_name Day, Year
strcpy( bufcar, strtok( NULL, " \n\r" ) ); strcat( bufcar, " " );
strcat( bufcar, strtok( NULL, " \n\r" ) ); strcat( bufcar, ", " );
strtok( NULL, " \n\r" );
strcat( bufcar, strtok( NULL, " \n\r" ) );
msg = FROM_UTF8( bufcar );
aList.push_back( MSG_PANEL_ITEM( _( "Last Change" ), msg, BROWN ) ); aList.push_back( MSG_PANEL_ITEM( _( "Last Change" ), msg, BROWN ) );
// display schematic path // display schematic path

View File

@ -273,10 +273,8 @@ void DIALOG_PRINT_USING_PRINTER::initValues( )
m_FineAdjustYscaleOpt->SetValue( msg ); m_FineAdjustYscaleOpt->SetValue( msg );
bool enable = (s_Parameters.m_PrintScale == 1.0); bool enable = (s_Parameters.m_PrintScale == 1.0);
if( m_FineAdjustXscaleOpt ) m_FineAdjustXscaleOpt->Enable(enable);
m_FineAdjustXscaleOpt->Enable(enable); m_FineAdjustYscaleOpt->Enable(enable);
if( m_FineAdjustYscaleOpt )
m_FineAdjustYscaleOpt->Enable(enable);
} }