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 The 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:
37{
50};
51
52// A Class to handle parameters
58};
59
60
65{
66public:
73 TRANSLINE_PRM( PRM_TYPE aType, PRMS_ID aId, const char* aKeywordCfg = "", const wxString& aDlgLabel = wxEmptyString,
74 const wxString& aToolTip = wxEmptyString, double aValue = 0.0, bool aConvUnit = false,
75 int aDefaultUnit = 0 );
76
77 double ToUserUnit();
78 double FromUserUnit();
79
80 PRM_TYPE m_Type; // Type of parameter: substr, physical, elect
81 PRMS_ID m_Id; // Id of parameter ( link to transline functions )
82 std::string m_KeyWord; // keyword for this parameter in json config file in ASCII7 only
83 wxString m_DlgLabel; // name for this parameter in dialog (usually translated
84 wxString m_ToolTip; // Tool tip for this parameter in dialog
85 double m_Value; // Value for this parameter in dialog
86 double m_DefaultValue; // Default value for this parameter from CTOR build
87 int m_DefaultUnit; // Default unit selection for this parameter
88 double m_NormalizedValue; // actual value for this parameter
89 bool m_ConvUnit; // true if an unit selector must be used
90 void* m_ValueCtrl; // The text ctrl containing the value in dialog
91 void* m_UnitCtrl; // The UNIT_SELECTOR containing the unit in dialog
92 int m_UnitSelection; // last selection for units
93};
94
95
105{
106public:
109
110 // Add a new param in list
111 void AddPrm( TRANSLINE_PRM* aParam )
112 {
113 m_prms_List.push_back( aParam );
114 }
115
116 TRANSLINE_PRM* GetPrm( unsigned aIdx ) const
117 {
118 if( aIdx < m_prms_List.size() )
119 return m_prms_List[aIdx];
120 else
121 return nullptr;
122 }
123
124 unsigned GetPrmsCount() const
125 {
126 return m_prms_List.size();
127 }
128
129 void ReadConfig();
130 void WriteConfig();
131
132public:
133 enum TRANSLINE_TYPE_ID m_Type; // The type of transline handled
134 BITMAPS m_BitmapName; // The name of the bitmap to display in dialogs
135 TRANSLINE* m_TLine; // The TRANSLINE itself
136 wxArrayString m_Messages; // messages for results
137
138 // true if selection of parameters must be enabled in dialog menu.
140
141private:
142 std::vector<TRANSLINE_PRM*> m_prms_List;
143};
144
145#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:39
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
@ C_STRIPLINE_TYPE