KiCad PCB EDA Suite
transline.cpp File Reference
#include <cmath>
#include <limits>
#include <wx/colour.h>
#include <wx/settings.h>
#include "transline.h"
#include "units.h"
#include <cstdio>

Go to the source code of this file.

Macros

#define INFINITY   std::numeric_limits<double>::infinity()
 
#define M_PI_2   ( M_PI / 2 )
 
#define NR_EPSI   2.2204460492503131e-16
 
#define MAX_ERROR   0.000001
 

Functions

void SetPropertyInDialog (enum PRMS_ID aPrmId, double value)
 
void SetResultInDialog (int line, const char *text)
 
void SetResultInDialog (int aLineNumber, double aValue, const char *aText)
 
double GetPropertyInDialog (enum PRMS_ID aPrmId)
 
bool IsSelectedInDialog (enum PRMS_ID aPrmId)
 
void SetPropertyBgColorInDialog (enum PRMS_ID aPrmId, const KIGFX::COLOR4D *aCol)
 Function SetPropertyBgColorInDialog Set the background color of a parameter. More...
 

Macro Definition Documentation

◆ INFINITY

#define INFINITY   std::numeric_limits<double>::infinity()

Definition at line 35 of file transline.cpp.

◆ M_PI_2

#define M_PI_2   ( M_PI / 2 )

Definition at line 40 of file transline.cpp.

◆ MAX_ERROR

#define MAX_ERROR   0.000001

Definition at line 329 of file transline.cpp.

◆ NR_EPSI

#define NR_EPSI   2.2204460492503131e-16

Definition at line 250 of file transline.cpp.

Function Documentation

◆ GetPropertyInDialog()

double GetPropertyInDialog ( enum PRMS_ID  aPrmId)

Definition at line 123 of file params_read_write.cpp.

124{
125 return getTranslinePanel()->GetPrmValue( aPrmId );
126}
double GetPrmValue(enum PRMS_ID aPrmId) const
Return a param value.
PANEL_TRANSLINE * getTranslinePanel()

References PANEL_TRANSLINE::GetPrmValue(), and getTranslinePanel().

Referenced by TRANSLINE::getProperty().

◆ IsSelectedInDialog()

bool IsSelectedInDialog ( enum PRMS_ID  aPrmId)

Definition at line 130 of file params_read_write.cpp.

131{
132 return getTranslinePanel()->IsPrmSelected( aPrmId );
133}
bool IsPrmSelected(enum PRMS_ID aPrmId) const
Function IsPrmSelected.

References getTranslinePanel(), and PANEL_TRANSLINE::IsPrmSelected().

Referenced by TRANSLINE::isSelected().

◆ SetPropertyBgColorInDialog()

void SetPropertyBgColorInDialog ( enum PRMS_ID  aPrmId,
const KIGFX::COLOR4D aCol 
)

Function SetPropertyBgColorInDialog Set the background color of a parameter.

Parameters
aPrmId= param id to set
aCol= new color

Definition at line 98 of file params_read_write.cpp.

99{
100 getTranslinePanel()->SetPrmBgColor( aPrmId, aCol );
101}
void SetPrmBgColor(enum PRMS_ID aPrmId, const KIGFX::COLOR4D *aCol)
Set the background color of a parameter.

References getTranslinePanel(), and PANEL_TRANSLINE::SetPrmBgColor().

Referenced by TRANSLINE::setErrorLevel().

◆ SetPropertyInDialog()

void SetPropertyInDialog ( enum PRMS_ID  aPrmId,
double  value 
)

Definition at line 93 of file params_read_write.cpp.

94{
95 getTranslinePanel()->SetPrmValue( aPrmId, value );
96}
void SetPrmValue(enum PRMS_ID aPrmId, double aValue)
Read/write params values and results.

References getTranslinePanel(), and PANEL_TRANSLINE::SetPrmValue().

Referenced by TRANSLINE::setProperty().

◆ SetResultInDialog() [1/2]

void SetResultInDialog ( int  aLineNumber,
double  aValue,
const char *  aText 
)

Definition at line 113 of file params_read_write.cpp.

114{
115 wxString msg = wxString::FromUTF8( aText );
116 wxString fullmsg;
117 fullmsg.Printf( wxT( "%g " ), aValue );
118 fullmsg += msg;
119 getTranslinePanel()->SetResult( aLineNumber, fullmsg );
120}
void SetResult(int aLineNumber, const wxString &aText)
Put the text into the given result line.

References getTranslinePanel(), and PANEL_TRANSLINE::SetResult().

◆ SetResultInDialog() [2/2]

void SetResultInDialog ( int  line,
const char *  text 
)

Definition at line 105 of file params_read_write.cpp.

106{
107 wxString msg = wxString::FromUTF8( aText );
108 getTranslinePanel()->SetResult( line, msg );
109}

References getTranslinePanel(), and PANEL_TRANSLINE::SetResult().

Referenced by TRANSLINE::setResult().