Class Reference schematic

The main widget class of the schematic. More...

Member

void addFunctionKey(int key,int function)
void addMacroKey(int key,string macroFileName, string title, string iconFileName)
void addMacroToolButton(string macroName,string parameter,string iconfilename)
schematicDisplay* drawing
string filename
string getToolbarState()
void hideToolBar(string name)
string macroToolbarName
bool resetShortcut(int function)
void setMenuEnabled(string name,bool b)
bool setShortcut(string function,string key)
bool setShortcut(int function,QString key)
void setToolbarEnabled(string name,bool b)
void setToolbarState(string)
void showToolBar(string name)
void toLayout(layout *l)
void toolBarAdd(string name,string buttons)
string generateNetList(string type)
void saveNetList(string filename, string type)

Detailed Description

graph LR classDef thisClas fill:#eaf5fc,stroke:#3c7faa,stroke-width:4px; classDef clas fill:#eaf5fc,stroke:#3c7faa,stroke-width:1px; la(schematic)==drawing==>dr(schematicDisplay) click dr "/layoutscript/api/schematicdisplay" click la "/layoutscript/api/schematic" class dr clas class la thisClas

The schematic object is the main window of the Schematic Editor, with menus and toolbars, just as layout is for the layout window. A C++ macro started from a schematic already has this name; you do not construct it. The sheets and symbols live in schematic->drawing, a schematicDisplay. File name, shortcuts and toolbar layout are members of schematic itself. Most choose / save style methods open a dialog; scripts that must not block the user should use drawing load and save instead. In in-process Python there is no global schematic; call project currentSchematic() or newSchematic().

Example:

schematic->filename = "/tmp/sample.les";
sheet *s = schematic->drawing->currentSheet;

Member Function Documentation


void schematic::addFunctionKey(int key,int function)

Set the feature of an extra keyboard. key is the number of the key. It is numbered from 0 to the amount of keys the keyboard has. function is the feature code of the featur you want to add. As toolbutton, modification of the extra keyboard are not store and it is recommended to set it with an autostart macro. (introduced with release 20210905)


void schematic::addMacroKey(int key,string macroFileName, string title, string iconFileName)

Assigns one key of an external keyboard to a macro. key is the key number. macroFileName is the full path of the macro, title the caption, and iconFileName the full path of the icon file. (introduced with release 20210910)

Parameter:
key key index on the extra keyboard
macroFileName full path of the macro file
title caption shown for the key
iconFileName full path of the icon file

void schematic::addMacroToolButton(string macroName,string parameter,string iconfilename)

Adds a button to the Macros toolbar (created if missing). macroName is the macro to run. iconfilename is the icon; a missing file uses the default. Macro buttons are not stored at shutdown. parameter should be an empty string.

Parameter:
macroName macro to execute
parameter reserved; pass an empty string
iconfilename path to the button icon

schematicDisplay* schematic::drawing

The schematic data: sheets and elements. See schematicDisplay.


string schematic::filename

This string hold the current filename.


string schematic::getToolbarState()

Returns: an encoded string containing all required information to restore the current toolbar and dock window setup. With setToolbarState the current setup can be restored.


void schematic::hideToolBar(string name)

Hides the named toolbar.


string schematic::macroToolbarName

Holds the name of the toolbar containing custom macros. The name must be set before the first macro is added to the toolbar. (introduced with release 20211216)


bool schematic::resetShortcut(int function)

Reset the shortcut with the feature code as parameter to its default value. (introduced with release 20231115)

Returns: true or false.


void schematic::setMenuEnabled(string name,bool b)

disabled or enabled a single menu entry or a hole menu.

Parameter:
name name
b b

bool schematic::setShortcut(string function,string key)

Use this function to modify any existing shortcut. It returns true, if the modification was successful.

{{{ layout->setShortcut("&Zoom Fit All","F"); // set 'F' to zoom fit layout->setShortcut("&Zoom Fit Selection","Shift+F"); // set 'Shift F' to zoom fit selection }}}

Shortcuts are not saved with program shutdown and the modifications will not affect new opened windows. So it should usualy placed in a autostart macros to have the modified shortcut available in all windows.(introduced with releease 20180523)

Parameter:
function function
key key index or code

Returns: true or false.


bool schematic::setShortcut(int function,QString key)

As the overloaded method, but with the feature code as parameter.(introduced with releease 20180523)

Parameter:
function function
key key index or code

Returns: true or false.


void schematic::setToolbarEnabled(string name,bool b)

disabled or enabled a toolbar.

 schematic->setToolbarEnabled("Edit",false);
Parameter:
name name
b b

void schematic::setToolbarState(string)

Sets the toolbar and dock window configuration. The string parameter needs to be created with the getToolbarState.


void schematic::showToolBar(string name)

Shows the named toolbar.


void schematic::toLayout(layout *l)

converts the current schematic sheet to a layout drawing.


void schematic::toolBarAdd(string name,string buttons)

Add a new tool bar, separate multipli buttons with a ';'.

layout->toolBarAdd("my toolbar","New Layout;Zoom Mouse;Code 39;Quit");

Obsolete Members

Parameter:
name name
buttons buttons

string schematic::generateNetList(string type)

the current sheet as netlist. Type had to be defined in the setup before.

OBSOLETE: Please use drawing->generateNetList() instead.

Returns: a string.


void schematic::saveNetList(string filename, string type)

exports the current sheet as netlist. Type had to be defined in the setup before.

OBSOLETE: Please use drawing->saveNetList() instead.

Parameter:
filename path of the file
type mode selector