winIDEA SDK
isys::CWorkspaceController Class Reference

Description

This class provides methods for handling current workspace in winIDEA.

Python example.

#include <CWorkspaceController.h>

Inheritance diagram for isys::CWorkspaceController:
isys::WrapperBase

Public Member Functions

 CWorkspaceController (std::shared_ptr< ConnectionMgr > connectionMgr)
 Instantiates object. More...
 
void newWS (const std::string &rstrWorkspaceFileName, const std::string &rstrIOPEN={})
 Creates a new workspace. More...
 
void create (const std::string &rstrWorkspaceFileName, const std::string &rstrIOPEN, const CCfg_debug_basic &rCfg)
 Creates a new workspace. More...
 
bool open (const std::string &workspaceFileName)
 Opens workspace in winIDEA. More...
 
void save ()
 Saves workspace. More...
 
void saveAs (const std::string &workspaceFileName)
 Saves workspace to a new file. More...
 
std::string path ()
 returns path of currently opened workspace More...
 
void close ()
 Closes workspace. More...
 
void closeDiscard ()
 Closes workspace and discards all changes. More...
 
CCfg_debug_basic get_cfg_debug ()
 Returns current debug configuration. More...
 
void set_cfg_debug (const CCfg_debug_basic &rCfg)
 Sets debug configuration. More...
 
iconnect::StrStrMap invoke (const std::string &funcUrl, const iconnect::StrStrMap &inParams)
 This method invokes functions within winIDEA process. More...
 
std::string invokej (const std::string &funcUrl, const std::string &inParams)
 This method invokes functions within winIDEA process. More...
 

Constructor & Destructor Documentation

◆ CWorkspaceController()

isys::CWorkspaceController::CWorkspaceController ( std::shared_ptr< ConnectionMgr connectionMgr)

Instantiates object.

Parameters
connectionMgrclass which maintains connection to winIDEA. Connection must be established before this call. Python example: test_workspace_save.py

Member Function Documentation

◆ close()

void isys::CWorkspaceController::close ( )

Closes workspace.

If there are some changes, winIDEA prompts user to save the changes.

Exceptions
IOExceptionin case of an error

Python example: test_close_open.py

◆ closeDiscard()

void isys::CWorkspaceController::closeDiscard ( )

Closes workspace and discards all changes.

Exceptions
IOExceptionin case of an error

Python example: test_close_open.py

◆ create()

void isys::CWorkspaceController::create ( const std::string &  rstrWorkspaceFileName,
const std::string &  rstrIOPEN,
const CCfg_debug_basic &  rCfg 
)

Creates a new workspace.

Parameters
rstrWorkspaceFileNamefile name of the workspace
rstrIOPENname of iOPEN server to use; if empty, the default iSYSTEM server is used
rCfginitial debug session configuration
Exceptions
IOExceptionin case of an error

Python example.

◆ get_cfg_debug()

CCfg_debug_basic isys::CWorkspaceController::get_cfg_debug ( )

Returns current debug configuration.

Returns
Basic Debug configuration
Exceptions
IOExceptionin case of an error, or if winIDEA is using Full Debug configuration which cannot be converted to Basic configuration

Python example.

◆ invoke()

iconnect::StrStrMap isys::CWorkspaceController::invoke ( const std::string &  funcUrl,
const iconnect::StrStrMap inParams 
)

This method invokes functions within winIDEA process.

Use this method only when instructed by iSYSTEM support. Example:

result = wsCtrl.invoke('/IDE/Divide', {'Dividend': '10', 'Divisor': '2'})
Parameters
funcUrlname of the winIDEA service function to call
inParamsinput parameters as mapping
Returns
mapping of output values.

Note: Python and Java support Python mapping and Java Map as input/output types in addition to isystem.connect.StrStrMap. Example for Java:

wsCtrl.invoke("/IDE/Divide", Map.of("Dividend", "10", "Divisor", "2"));

Python example: test_invoke.py

Note: This method is equivalent to CIDEController::invoke().

◆ invokej()

std::string isys::CWorkspaceController::invokej ( const std::string &  funcUrl,
const std::string &  inParams 
)

This method invokes functions within winIDEA process.

Use this method only when instructed by iSYSTEM support. Example:

result = wsCtrl.invoke('/IDE/Divide', '{"Dividend": 10, "Divisor": 2}')
Parameters
funcUrlname of the winIDEA service function to call
inParamsinput parameters as JSON string
Returns
string with JSON encoded output values

Python example: test_invokej.py

◆ newWS()

void isys::CWorkspaceController::newWS ( const std::string &  rstrWorkspaceFileName,
const std::string &  rstrIOPEN = {} 
)

Creates a new workspace.

Parameters
rstrWorkspaceFileNamefile name of the workspace
rstrIOPENname of iOPEN server to use; if empty, the default iSYSTEM server is used
Exceptions
IOExceptionin case of an error

◆ open()

bool isys::CWorkspaceController::open ( const std::string &  workspaceFileName)

Opens workspace in winIDEA.

Parameters
workspaceFileNamefile name of the workspace
Exceptions
IOExceptionin case of an error

Python example.

◆ path()

std::string isys::CWorkspaceController::path ( )

returns path of currently opened workspace

Exceptions
IOExceptionin case of an error

Python example.

◆ save()

void isys::CWorkspaceController::save ( )

Saves workspace.

Exceptions
IOExceptionin case of an error

Python example: test_workspace_save.py

◆ saveAs()

void isys::CWorkspaceController::saveAs ( const std::string &  workspaceFileName)

Saves workspace to a new file.

Parameters
workspaceFileNamefile name of the workspace
Exceptions
IOExceptionin case of an error

Python example: test_workspace_save.py

◆ set_cfg_debug()

void isys::CWorkspaceController::set_cfg_debug ( const CCfg_debug_basic &  rCfg)

Sets debug configuration.

Parameters
rCfgBasic Debug configuration
Exceptions
IOExceptionin case of an error, or the configuration is invalid (unsupported device etc.)

Python example.