From cfdd105cdd738d8bab5d22660159901293533f24 Mon Sep 17 00:00:00 2001 From: Marek Roszko Date: Mon, 12 Oct 2020 21:55:32 -0400 Subject: [PATCH] Some more cleaning in pcb calculator --- pcb_calculator/CMakeLists.txt | 3 -- .../attenuators/attenuator_classes.cpp | 18 +++++----- .../attenuators/attenuator_classes.h | 3 +- pcb_calculator/params_read_write.cpp | 3 +- pcb_calculator/pcb_calculator_frame.h | 2 +- pcb_calculator/transline/c_microstrip.h | 4 +-- pcb_calculator/transline/coax.h | 2 +- pcb_calculator/transline/coplanar.h | 2 +- pcb_calculator/transline/microstrip.h | 2 +- pcb_calculator/transline/rectwaveguide.h | 2 +- pcb_calculator/transline/stripline.h | 2 +- pcb_calculator/transline/twistedpair.h | 2 +- pcb_calculator/transline_dlg_funct.cpp | 1 - pcb_calculator/transline_ident.cpp | 34 +++++++++---------- pcb_calculator/transline_ident.h | 2 +- pcb_calculator/widgets/unit_selector.h | 6 ++-- 16 files changed, 42 insertions(+), 46 deletions(-) diff --git a/pcb_calculator/CMakeLists.txt b/pcb_calculator/CMakeLists.txt index 8b13f0d76a..756a65805a 100644 --- a/pcb_calculator/CMakeLists.txt +++ b/pcb_calculator/CMakeLists.txt @@ -1,9 +1,6 @@ include_directories( BEFORE ${INC_BEFORE} ) include_directories( - bitmaps dialogs - transline - attenuators ${CMAKE_SOURCE_DIR}/common ${INC_AFTER} ) diff --git a/pcb_calculator/attenuators/attenuator_classes.cpp b/pcb_calculator/attenuators/attenuator_classes.cpp index ff026d0326..79cd018307 100644 --- a/pcb_calculator/attenuators/attenuator_classes.cpp +++ b/pcb_calculator/attenuators/attenuator_classes.cpp @@ -5,7 +5,7 @@ ** since 2006/6/14 ** *****************************************************************************/ -#include +#include #include #include @@ -14,27 +14,27 @@ #include "pcb_calculator_settings.h" // Bitmaps: -#include -#include -#include -#include +#include "bitmaps/att_bridge.xpm" +#include "bitmaps/att_pi.xpm" +#include "bitmaps/att_splitter.xpm" +#include "bitmaps/att_tee.xpm" // Html texts showing the formulas wxString pi_formula = -#include +#include "attenuators/pi_formula.h" wxString tee_formula = -#include +#include "attenuators/tee_formula.h" wxString bridget_tee_formula = -#include +#include "attenuators/bridget_tee_formula.h" wxString splitter_formula = -#include +#include "attenuators/splitter_formula.h" diff --git a/pcb_calculator/attenuators/attenuator_classes.h b/pcb_calculator/attenuators/attenuator_classes.h index f8078dcd89..1c459651fe 100644 --- a/pcb_calculator/attenuators/attenuator_classes.h +++ b/pcb_calculator/attenuators/attenuator_classes.h @@ -12,7 +12,8 @@ #ifndef ATTENUATORFUNC_H #define ATTENUATORFUNC_H -#include +class wxBitmap; +class wxString; enum ATTENUATORS_TYPE { PI_TYPE, diff --git a/pcb_calculator/params_read_write.cpp b/pcb_calculator/params_read_write.cpp index acd509c2d1..3a462c4c39 100644 --- a/pcb_calculator/params_read_write.cpp +++ b/pcb_calculator/params_read_write.cpp @@ -20,11 +20,10 @@ #include #include -#include #include #include "pcb_calculator_frame.h" -#include "transline.h" +#include "transline/transline.h" /* * Return the value from a string, diff --git a/pcb_calculator/pcb_calculator_frame.h b/pcb_calculator/pcb_calculator_frame.h index a079001087..bc79ed3ed7 100644 --- a/pcb_calculator/pcb_calculator_frame.h +++ b/pcb_calculator/pcb_calculator_frame.h @@ -24,7 +24,7 @@ #ifndef PCB_CALCULATOR_H #define PCB_CALCULATOR_H -#include "transline.h" // Included for SUBST_PRMS_ID definition. +#include "transline/transline.h" // Included for SUBST_PRMS_ID definition. #include "transline_ident.h" #include "pcb_calculator_frame_base.h" diff --git a/pcb_calculator/transline/c_microstrip.h b/pcb_calculator/transline/c_microstrip.h index 44eb04791a..85b4b07d4f 100644 --- a/pcb_calculator/transline/c_microstrip.h +++ b/pcb_calculator/transline/c_microstrip.h @@ -25,8 +25,8 @@ #ifndef _C_MICROSTRIP_H_ #define _C_MICROSTRIP_H_ -#include -#include +#include "transline/microstrip.h" +#include "transline/transline.h" class C_MICROSTRIP : public TRANSLINE { diff --git a/pcb_calculator/transline/coax.h b/pcb_calculator/transline/coax.h index e56c2551c8..56c51338ee 100644 --- a/pcb_calculator/transline/coax.h +++ b/pcb_calculator/transline/coax.h @@ -25,7 +25,7 @@ #ifndef __COAX_H #define __COAX_H -#include +#include "transline/transline.h" class COAX : public TRANSLINE { diff --git a/pcb_calculator/transline/coplanar.h b/pcb_calculator/transline/coplanar.h index e7a3c57b8e..7ceaffc7e7 100644 --- a/pcb_calculator/transline/coplanar.h +++ b/pcb_calculator/transline/coplanar.h @@ -25,7 +25,7 @@ #ifndef __COPLANAR_H #define __COPLANAR_H -#include +#include "transline/transline.h" class COPLANAR : public TRANSLINE { diff --git a/pcb_calculator/transline/microstrip.h b/pcb_calculator/transline/microstrip.h index 57eb922900..dbaec6573e 100644 --- a/pcb_calculator/transline/microstrip.h +++ b/pcb_calculator/transline/microstrip.h @@ -25,7 +25,7 @@ #ifndef __MICROSTRIP_H #define __MICROSTRIP_H -#include +#include "transline/transline.h" class MICROSTRIP : public TRANSLINE { diff --git a/pcb_calculator/transline/rectwaveguide.h b/pcb_calculator/transline/rectwaveguide.h index 6a38d3ff77..68ae5d2f90 100644 --- a/pcb_calculator/transline/rectwaveguide.h +++ b/pcb_calculator/transline/rectwaveguide.h @@ -25,7 +25,7 @@ #ifndef __RECTWAVEGUIDE_H #define __RECTWAVEGUIDE_H -#include +#include "transline/transline.h" #define PHYS_A_PRM PHYS_WIDTH_PRM #define PHYS_B_PRM PHYS_S_PRM diff --git a/pcb_calculator/transline/stripline.h b/pcb_calculator/transline/stripline.h index c033776565..1315c26ecd 100644 --- a/pcb_calculator/transline/stripline.h +++ b/pcb_calculator/transline/stripline.h @@ -25,7 +25,7 @@ #define __STRIPLINE_H -#include +#include "transline/transline.h" class STRIPLINE : public TRANSLINE { diff --git a/pcb_calculator/transline/twistedpair.h b/pcb_calculator/transline/twistedpair.h index 74e8eec844..26fb3dcfc6 100644 --- a/pcb_calculator/transline/twistedpair.h +++ b/pcb_calculator/transline/twistedpair.h @@ -24,7 +24,7 @@ #ifndef __TWISTEDPAIR_H #define __TWISTEDPAIR_H -#include +#include "transline/transline.h" class TWISTEDPAIR : public TRANSLINE { diff --git a/pcb_calculator/transline_dlg_funct.cpp b/pcb_calculator/transline_dlg_funct.cpp index 3c0b0f2f01..a90fe41b34 100644 --- a/pcb_calculator/transline_dlg_funct.cpp +++ b/pcb_calculator/transline_dlg_funct.cpp @@ -24,7 +24,6 @@ #include "common_data.h" #include "pcb_calculator_frame.h" -#include "widgets/unit_selector.h" extern double DoubleFromString( const wxString& TextValue ); diff --git a/pcb_calculator/transline_ident.cpp b/pcb_calculator/transline_ident.cpp index 0b1fe34207..8415d86e00 100644 --- a/pcb_calculator/transline_ident.cpp +++ b/pcb_calculator/transline_ident.cpp @@ -24,28 +24,28 @@ #include #include +#include // Bitmaps: -#include -#include -#include -#include -#include -#include -#include -#include +#include "bitmaps/c_microstrip.xpm" +#include "bitmaps/microstrip.xpm" +#include "bitmaps/twistedpair.xpm" +#include "bitmaps/coax.xpm" +#include "bitmaps/cpw.xpm" +#include "bitmaps/cpw_back.xpm" +#include "bitmaps/stripline.xpm" +#include "bitmaps/rectwaveguide.xpm" // transline specific functions: -#include -#include -#include -#include -#include -#include -#include -#include +#include "transline/transline.h" +#include "transline/microstrip.h" +#include "transline/coplanar.h" +#include "transline/rectwaveguide.h" +#include "transline/coax.h" +#include "transline/c_microstrip.h" +#include "transline/stripline.h" +#include "transline/twistedpair.h" -#include #include "pcb_calculator_settings.h" #include "widgets/unit_selector.h" #include "transline_ident.h" diff --git a/pcb_calculator/transline_ident.h b/pcb_calculator/transline_ident.h index 7d1695d7de..d0d93da62d 100644 --- a/pcb_calculator/transline_ident.h +++ b/pcb_calculator/transline_ident.h @@ -28,7 +28,7 @@ #include #include -#include "transline.h" +#include "transline/transline.h" // An enum to handle muwave shapes: enum TRANSLINE_TYPE_ID { diff --git a/pcb_calculator/widgets/unit_selector.h b/pcb_calculator/widgets/unit_selector.h index e6ede59c60..c0788af246 100644 --- a/pcb_calculator/widgets/unit_selector.h +++ b/pcb_calculator/widgets/unit_selector.h @@ -23,8 +23,8 @@ * a wxChoiceBox to select units in Pcb_Calculator */ -#ifndef _UnitSelector_h_ -#define _UnitSelector_h_ +#ifndef UNIT_SELECTOR_H +#define UNIT_SELECTOR_H #include @@ -129,5 +129,5 @@ public: virtual double GetUnitScale() override; }; -#endif // _UnitSelector_h_ +#endif // UNIT_SELECTOR_H