KiCad PCB EDA Suite
Loading...
Searching...
No Matches
transline_ident.h
Go to the documentation of this file.
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-2021 KiCad Developers, see AUTHORS.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 3
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 along
18 * with this program. If not, see <http://www.gnu.org/licenses/>.
19 */
20
25#ifndef TRANSLINE_IDENT_H
26#define TRANSLINE_IDENT_H
27
28#include <vector>
29
30#include "transline/transline.h"
31
32// Forward declare the bitmaps enum from bitmaps/bitmap_list.h
33enum class BITMAPS : unsigned int;
34
35// An enum to handle muwave shapes:
48};
49
50// A Class to handle parameters
56};
57
58
63{
64public:
71 TRANSLINE_PRM( PRM_TYPE aType, PRMS_ID aId, const char* aKeywordCfg = "",
72 const wxString& aDlgLabel = wxEmptyString,
73 const wxString& aToolTip = wxEmptyString,
74 double aValue = 0.0, bool aConvUnit = false );
75
76 double ToUserUnit();
77 double FromUserUnit();
78
79 PRM_TYPE m_Type; // Type of parameter: substr, physical, elect
80 PRMS_ID m_Id; // Id of parameter ( link to transline functions )
81 std::string m_KeyWord; // keyword for this parameter in json config file in ASCII7 only
82 wxString m_DlgLabel; // name for this parameter in dialog (usually translated
83 wxString m_ToolTip; // Tool tip for this parameter in dialog
84 double m_Value; // Value for this parameter in dialog
85 double m_DefaultValue; // Default value for this parameter from CTOR build
86 double m_NormalizedValue; // actual value for this parameter
87 bool m_ConvUnit; // true if an unit selector must be used
88 void* m_ValueCtrl; // The text ctrl containing the value in dialog
89 void* m_UnitCtrl; // The UNIT_SELECTOR containing the unit in dialog
90 int m_UnitSelection; // last selection for units
91};
92
93
103{
104public:
107
108 // Add a new param in list
109 void AddPrm( TRANSLINE_PRM* aParam )
110 {
111 m_prms_List.push_back( aParam );
112 }
113
114 TRANSLINE_PRM* GetPrm( unsigned aIdx ) const
115 {
116 if( aIdx < m_prms_List.size() )
117 return m_prms_List[aIdx];
118 else
119 return nullptr;
120 }
121
122 unsigned GetPrmsCount() const
123 {
124 return m_prms_List.size();
125 }
126
127 void ReadConfig();
128 void WriteConfig();
129
130public:
131 enum TRANSLINE_TYPE_ID m_Type; // The type of transline handled
132 BITMAPS m_BitmapName; // The name of the bitmap to display in dialogs
133 TRANSLINE* m_TLine; // The TRANSLINE itself
134 wxArrayString m_Messages; // messages for results
135
136 // true if selection of parameters must be enabled in dialog menu.
138
139private:
140 std::vector<TRANSLINE_PRM*> m_prms_List;
141};
142
143#endif // TRANSLINE_IDENT_H
BITMAPS
A list of all bitmap identifiers.
Definition: bitmaps_list.h:33
A class to handle a list of parameters of a given transline.
TRANSLINE * m_TLine
enum TRANSLINE_TYPE_ID m_Type
unsigned GetPrmsCount() const
TRANSLINE_PRM * GetPrm(unsigned aIdx) const
void AddPrm(TRANSLINE_PRM *aParam)
wxArrayString m_Messages
std::vector< TRANSLINE_PRM * > m_prms_List
A class to handle one parameter of transline.
double m_DefaultValue
double m_NormalizedValue
wxString m_ToolTip
wxString m_DlgLabel
std::string m_KeyWord
double FromUserUnit()
PRMS_ID
Definition: transline.h:37
PRM_TYPE
@ PRM_TYPE_FREQUENCY
@ PRM_TYPE_SUBS
@ PRM_TYPE_ELEC
@ PRM_TYPE_PHYS
TRANSLINE_TYPE_ID
@ RECTWAVEGUIDE_TYPE
@ MICROSTRIP_TYPE
@ CPW_TYPE
@ GROUNDED_CPW_TYPE
@ C_MICROSTRIP_TYPE
@ COAX_TYPE
@ TWISTEDPAIR_TYPE
@ END_OF_LIST_TYPE
@ STRIPLINE_TYPE
@ DEFAULT_TYPE
@ START_OF_LIST_TYPE