Syntax help for SPICE functions.

This commit is contained in:
Jeff Young 2023-07-05 11:49:31 +01:00
parent 27072e52f7
commit 443a5dc3bb
4 changed files with 102 additions and 1 deletions

View File

@ -442,6 +442,23 @@ set_source_files_properties( sch_text.cpp
OBJECT_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/sch_text_help_md.h OBJECT_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/sch_text_help_md.h
) )
# Create a C++ compilable string initializer containing markdown text into a *.h file:
add_custom_command(
OUTPUT ${CMAKE_CURRENT_SOURCE_DIR}/sim/user_defined_signals_help_md.h
COMMAND ${CMAKE_COMMAND}
-DinputFile=${CMAKE_CURRENT_SOURCE_DIR}/sim/user_defined_signals_help.md
-DoutputFile=${CMAKE_CURRENT_SOURCE_DIR}/sim/user_defined_signals_help_md.h
-P ${KICAD_CMAKE_MODULE_PATH}/BuildSteps/markdown2C.cmake
DEPENDS ${KICAD_CMAKE_MODULE_PATH}/BuildSteps/markdown2C.cmake sim/user_defined_signals_help.md
COMMENT "creating ${CMAKE_CURRENT_SOURCE_DIR}/sim/user_defined_signals_help_md.h
from ${CMAKE_CURRENT_SOURCE_DIR}/sch_spice_fcn_help.md"
)
set_source_files_properties( dialogs/dialog_user_defined_signals.cpp
PROPERTIES
OBJECT_DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/sim/user_defined_signals_help_md.h
)
if( APPLE ) if( APPLE )
# setup bundle # setup bundle
set( EESCHEMA_RESOURCES eeschema.icns eeschema_doc.icns ) set( EESCHEMA_RESOURCES eeschema.icns eeschema_doc.icns )

View File

@ -28,6 +28,7 @@
#include <dialogs/html_message_box.h> #include <dialogs/html_message_box.h>
#include <../sim/simulator_frame.h> #include <../sim/simulator_frame.h>
#include <dialog_user_defined_signals.h> #include <dialog_user_defined_signals.h>
#include <string_utils.h>
DIALOG_USER_DEFINED_SIGNALS::DIALOG_USER_DEFINED_SIGNALS( SIMULATOR_FRAME* aParent, DIALOG_USER_DEFINED_SIGNALS::DIALOG_USER_DEFINED_SIGNALS( SIMULATOR_FRAME* aParent,
@ -245,7 +246,20 @@ bool DIALOG_USER_DEFINED_SIGNALS::TransferDataFromWindow()
void DIALOG_USER_DEFINED_SIGNALS::OnFormattingHelp( wxHyperlinkEvent& aEvent ) void DIALOG_USER_DEFINED_SIGNALS::OnFormattingHelp( wxHyperlinkEvent& aEvent )
{ {
m_helpWindow = SCH_TEXT::ShowSyntaxHelp( this ); wxString msg =
#include "../sim/user_defined_signals_help_md.h"
;
m_helpWindow = new HTML_MESSAGE_BOX( nullptr, _( "Syntax Help" ) );
wxSize sz( 320, 320 );
m_helpWindow->SetMinSize( m_helpWindow->ConvertDialogToPixels( sz ) );
m_helpWindow->SetDialogSizeInDU( sz.x, sz.y );
wxString html_txt;
ConvertMarkdown2Html( wxGetTranslation( msg ), html_txt );
m_helpWindow->AddHTML_Text( html_txt );
m_helpWindow->ShowModeless();
} }

View File

@ -0,0 +1,35 @@
SPICE functions:
sqrt(x)
sin(x)
cos(x)
tan(x)
sinh(x)
cosh(x)
tanh(x)
asin(x)
acos(x)
atan(x)
asinh(x)
acosh(x)
atanh(x)
arctan(x)
exp(x)
ln(x)
log(x)
abs(x)
nint(x)
int(x)
floor(x)
ceil(x)
pow(x, y)
pwr(x, y)
min(x, y)
max(x, y)
sgn(x)
ternary_fcn(x, y, z)
gauss(nom, rvar, sigma)
agauss(nom, avar, sigma)
unif(nom, rvar)
aunif(nom, avar)
limit(nom, avar)

View File

@ -0,0 +1,35 @@
// Do not edit this file, it is autogenerated by CMake from the .md file
_HKI( " sqrt(x)\n"
" sin(x)\n"
" cos(x)\n"
" tan(x)\n"
" sinh(x)\n"
" cosh(x)\n"
" tanh(x)\n"
" asin(x)\n"
" acos(x)\n"
" atan(x)\n"
" asinh(x)\n"
" acosh(x)\n"
" atanh(x)\n"
" arctan(x)\n"
" exp(x)\n"
" ln(x)\n"
" log(x)\n"
" abs(x)\n"
" nint(x)\n"
" int(x)\n"
" floor(x)\n"
" ceil(x)\n"
" pow(x, y)\n"
" pwr(x, y)\n"
" min(x, y)\n"
" max(x, y)\n"
" sgn(x)\n"
" ternary_fcn(x, y, z)\n"
" gauss(nom, rvar, sigma)\n"
" agauss(nom, avar, sigma)\n"
" unif(nom, rvar)\n"
" aunif(nom, avar)\n"
" limit(nom, avar)\n"
"" );