You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

132 lines
4.0 KiB

* KIWAY Milestone A): Make major modules into DLL/DSOs. ! The initial testing of this commit should be done using a Debug build so that all the wxASSERT()s are enabled. Also, be sure and keep enabled the USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it off is senseless anyways. If you want stable code, go back to a prior version, the one tagged with "stable". * Relocate all functionality out of the wxApp derivative into more finely targeted purposes: a) DLL/DSO specific b) PROJECT specific c) EXE or process specific d) configuration file specific data e) configuration file manipulations functions. All of this functionality was blended into an extremely large wxApp derivative and that was incompatible with the desire to support multiple concurrently loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects. An amazing amount of organization come from simply sorting each bit of functionality into the proper box. * Switch to wxConfigBase from wxConfig everywhere except instantiation. * Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD, PGM_SINGLE_TOP, * Remove "Return" prefix on many function names. * Remove obvious comments from CMakeLists.txt files, and from else() and endif()s. * Fix building boost for use in a DSO on linux. * Remove some of the assumptions in the CMakeLists.txt files that windows had to be the host platform when building windows binaries. * Reduce the number of wxStrings being constructed at program load time via static construction. * Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that these functions are useful even when the wxConfigBase comes from another source, as is the case in the KICAD_MANAGER_FRAME. * Move the setting of the KIPRJMOD environment variable into class PROJECT, so that it can be moved into a project variable soon, and out of FP_LIB_TABLE. * Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all its child wxFrames and wxDialogs now have a Kiway() member function which returns a KIWAY& that that window tree branch is in support of. This is like wxWindows DNA in that child windows get this member with proper value at time of construction. * Anticipate some of the needs for milestones B) and C) and make code adjustments now in an effort to reduce work in those milestones. * No testing has been done for python scripting, since milestone C) has that being largely reworked and re-thought-out.
12 years ago
* KIWAY Milestone A): Make major modules into DLL/DSOs. ! The initial testing of this commit should be done using a Debug build so that all the wxASSERT()s are enabled. Also, be sure and keep enabled the USE_KIWAY_DLLs option. The tree won't likely build without it. Turning it off is senseless anyways. If you want stable code, go back to a prior version, the one tagged with "stable". * Relocate all functionality out of the wxApp derivative into more finely targeted purposes: a) DLL/DSO specific b) PROJECT specific c) EXE or process specific d) configuration file specific data e) configuration file manipulations functions. All of this functionality was blended into an extremely large wxApp derivative and that was incompatible with the desire to support multiple concurrently loaded DLL/DSO's ("KIFACE")s and multiple concurrently open projects. An amazing amount of organization come from simply sorting each bit of functionality into the proper box. * Switch to wxConfigBase from wxConfig everywhere except instantiation. * Add classes KIWAY, KIFACE, KIFACE_I, SEARCH_STACK, PGM_BASE, PGM_KICAD, PGM_SINGLE_TOP, * Remove "Return" prefix on many function names. * Remove obvious comments from CMakeLists.txt files, and from else() and endif()s. * Fix building boost for use in a DSO on linux. * Remove some of the assumptions in the CMakeLists.txt files that windows had to be the host platform when building windows binaries. * Reduce the number of wxStrings being constructed at program load time via static construction. * Pass wxConfigBase* to all SaveSettings() and LoadSettings() functions so that these functions are useful even when the wxConfigBase comes from another source, as is the case in the KICAD_MANAGER_FRAME. * Move the setting of the KIPRJMOD environment variable into class PROJECT, so that it can be moved into a project variable soon, and out of FP_LIB_TABLE. * Add the KIWAY_PLAYER which is associated with a particular PROJECT, and all its child wxFrames and wxDialogs now have a Kiway() member function which returns a KIWAY& that that window tree branch is in support of. This is like wxWindows DNA in that child windows get this member with proper value at time of construction. * Anticipate some of the needs for milestones B) and C) and make code adjustments now in an effort to reduce work in those milestones. * No testing has been done for python scripting, since milestone C) has that being largely reworked and re-thought-out.
12 years ago
  1. /*
  2. * This program source code file is part of KiCad, a free EDA CAD application.
  3. *
  4. * Copyright (C) 2011-2014 Jean-Pierre Charras
  5. * Copyright (C) 2004-2014 KiCad Developers, see change_log.txt for contributors.
  6. *
  7. * This program is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU General Public License
  9. * as published by the Free Software Foundation; either version 2
  10. * of the License, or (at your option) any later version.
  11. *
  12. * This program is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, you may find one here:
  19. * http://www.gnu.org/licenses/old-licenses/gpl-2.0.html
  20. * or you may search the http://www.gnu.org website for the version 2 license,
  21. * or you may write to the Free Software Foundation, Inc.,
  22. * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
  23. */
  24. /**
  25. * @file transline_ident.h
  26. */
  27. #ifndef TRANSLINE_IDENT_H
  28. #define TRANSLINE_IDENT_H
  29. #include <vector>
  30. #include <wx/config.h>
  31. #include <wx/bitmap.h>
  32. #include <transline.h>
  33. // An enum to handle muwave shapes:
  34. enum TRANSLINE_TYPE_ID {
  35. START_OF_LIST_TYPE = 0,
  36. DEFAULT_TYPE = START_OF_LIST_TYPE,
  37. MICROSTRIP_TYPE = DEFAULT_TYPE,
  38. CPW_TYPE,
  39. GROUNDED_CPW_TYPE,
  40. RECTWAVEGUIDE_TYPE,
  41. COAX_TYPE,
  42. C_MICROSTRIP_TYPE,
  43. STRIPLINE_TYPE,
  44. TWISTEDPAIR_TYPE,
  45. END_OF_LIST_TYPE
  46. };
  47. // A Class to handle parameters
  48. enum PRM_TYPE {
  49. PRM_TYPE_SUBS,
  50. PRM_TYPE_PHYS,
  51. PRM_TYPE_ELEC,
  52. PRM_TYPE_FREQUENCY
  53. };
  54. class TRANSLINE_PRM
  55. {
  56. public:
  57. PRM_TYPE m_Type; // Type of parameter: substr, physical, elect
  58. PRMS_ID m_Id; // Id of parameter ( link to transline functions )
  59. wxString m_Label; // name for this parameter in dialog
  60. wxString m_ToolTip; // Tool tip for this parameter in dialog
  61. double m_Value; // Value for this parameter in dialog
  62. double m_NormalizedValue; // actual value for this parameter
  63. bool m_ConvUnit; // true if an unit selector must be used
  64. void* m_ValueCtrl; // The text ctrl containing the value in dialog
  65. void* m_UnitCtrl; // The UNIT_SELECTOR containing the unit in dialog
  66. int m_UnitSelection; // last selection for units
  67. public: TRANSLINE_PRM( PRM_TYPE aType, PRMS_ID aId,
  68. const wxString& aLabel = wxEmptyString,
  69. const wxString& aToolTip = wxEmptyString,
  70. double aValue = 0.0,
  71. bool aConvUnit = false );
  72. void ReadConfig( wxConfigBase* aConfig );
  73. void WriteConfig( wxConfigBase* aConfig );
  74. double ToUserUnit();
  75. double FromUserUnit();
  76. };
  77. // A class to handle the list of availlable transm. lines
  78. // with messages, tooptips ...
  79. class TRANSLINE_IDENT
  80. {
  81. public:
  82. enum TRANSLINE_TYPE_ID m_Type; // The type of transline handled
  83. wxBitmap * m_Icon; // An icon to display in dialogs
  84. TRANSLINE* m_TLine; // The TRANSLINE itself
  85. wxArrayString m_Messages; // messages for results
  86. bool m_HasPrmSelection; // true if selection of parameters must be enabled in dialog menu
  87. private:
  88. std::vector <TRANSLINE_PRM*> m_prms_List;
  89. public:
  90. TRANSLINE_IDENT( enum TRANSLINE_TYPE_ID aType );
  91. ~TRANSLINE_IDENT();
  92. // Add a new param in list
  93. void AddPrm( TRANSLINE_PRM* aParam )
  94. {
  95. m_prms_List.push_back( aParam );
  96. }
  97. TRANSLINE_PRM* GetPrm( unsigned aIdx )
  98. {
  99. if( aIdx < m_prms_List.size() )
  100. return m_prms_List[aIdx];
  101. else
  102. return NULL;
  103. }
  104. unsigned GetPrmsCount()
  105. {
  106. return m_prms_List.size();
  107. }
  108. void ReadConfig( wxConfigBase* aConfig );
  109. void WriteConfig( wxConfigBase* aConfig );
  110. };
  111. #endif // TRANSLINE_IDENT_H