Documentation Home Page HYPERSIM Home Page
Pour la documentation en FRANÇAIS, utilisez l'outil de traduction de votre navigateur Chrome, Edge ou Safari. Voir un exemple.

ScopeViewApi Commands

General

ScopeViewApiGRPC.close():

ScopeViewApiGRPC.close()

Close ScopeView

Returns:

error value

Return type:

int

Raises:

AssertionError – raises exception on error

Examples:

  • ScopeView.close()

ScopeViewApiGRPC.connectToScopeViewRemote():

ScopeViewApiGRPC.connectToScopeViewRemote()

Connect to the first instance of ScopeView

:param id : The unique identifier for the remote ScopeView :type id: int :return: error value :rtype: int :raises AssertionError: raises exception on error

ScopeViewApiGRPC.combineComtrade(inputs, output_file, parameters=None):

ScopeViewApiGRPC.combineComtrade(inputs, output_file, parameters=None)

combineComtrade method combines multiple COMTRADE files into a single output file.

Parameters:
  • inputs (list) – A list of file names or paths of the COMTRADE files to be combined

  • output_file (str) – The name or path of the output file

  • parameters (Dict[str, any]) – Optional parameters to combine comtrade files. See getCombineComtradeParameters to create the dict

  • selected_signals – A map representing the signal names for each comtrade files that will be added to the output

of the combined files. Other signals will be discarded :type selected_signals: Dict[str, List[str]] :raises OSError: If any of the input files cannot be found in the current directory.

scopeview.connectToScopeViewRemote()

files = [
    "L35460NT120L16UPC_A/20221114_173712506.cfg",
    "L35460NT120L16UPC_B/20221114_173712489.cfg",
]

parameters = scopeview.getCombineComtradeParameters(files)

# Modify the given parameters
parameters["interpolationMethod"] = "Spline"
parameters["unitConfig"][1] = "V"
parameters["sampleRate"] = 4000

# Combine the comtrade files with a custom parameters dictionary
scopeview.combineComtrade(
    files,
    "combined.cfg",
    parameters,
    None
)

Examples:

  • combineComtrade([“file1.cfg”, “file2.cfg”], “output.CFG”)

ScopeViewApiGRPC.disableScopeViewApiExceptions():

ScopeViewApiGRPC.disableScopeViewApiExceptions()

Disable ScopeViewApi from returning ScopeView exceptions through Python

ScopeViewApiGRPC.enableScopeViewApiExceptions():

ScopeViewApiGRPC.enableScopeViewApiExceptions()

Enable ScopeViewApi to return ScopeView exceptions through Python

ScopeViewApiGRPC.openScopeView():

ScopeViewApiGRPC.openScopeView()

Open ScopeView

Returns:

process ID

Return type:

int

When using HYPERSIM, or when forceUseHypersimDir is set to True with setEnv(), the ScopeView location is relative to the HYPERSIM_DIR variable. Otherwise, the ScopeView location is relative to the Scopeview API location.

Acquisition

ScopeViewApiGRPC.exportToPDF(filePath):

ScopeViewApiGRPC.exportToPDF(filePath)

Export ScopeView graphs to PDF at provided file location

Parameters:

file_name (str) – path to export PDF

Returns:

error value

Return type:

int

Raises:

AssertionError – raises exception on error

ScopeViewApiGRPC.exportToFile(filePath):

ScopeViewApiGRPC.exportToFile(filePath)

Export ScopeView data source to desired format at provided file location

Parameters:

file_name (str) – path to export file

Returns:

error value

Return type:

int

Raises:

AssertionError – raises exception on error

ScopeViewApiGRPC.evalAllExpressions():

ScopeViewApiGRPC.evalAllExpressions()

Evaluate all ScopeView expressions from template

Returns:

error value

Return type:

int

Raises:

AssertionError – raises exception on error

ScopeViewApiGRPC.getCont():

ScopeViewApiGRPC.getCont()

Get ScopeView cont state

Returns:

cont state

Return type:

str

ScopeViewApiGRPC.getExpressions():

ScopeViewApiGRPC.getExpressions()

Gets all ScopeView expressions from template

Returns:

a list of ScopeView expressions

Return type:

list[str]

ScopeViewApiGRPC.getNumAcq():

ScopeViewApiGRPC.getNumAcq()

Get number of ScopeView acquisitions

Returns:

number of acquisitions

Return type:

str

ScopeViewApiGRPC.getNumData():

ScopeViewApiGRPC.getNumData()

Get number of ScopeView data

Returns:

number of data

Return type:

str

ScopeViewApiGRPC.getSamplingRate():

ScopeViewApiGRPC.getSamplingRate()

Get ScopeView acquisition sample rate

Returns:

sample rate

Return type:

str

ScopeViewApiGRPC.getStartTime():

ScopeViewApiGRPC.getStartTime()

Get ScopeView acquisition start time

Returns:

start time

Return type:

str

ScopeViewApiGRPC.getTimeLength():

ScopeViewApiGRPC.getTimeLength()

Get ScopeView acquisition duration

Returns:

time length

Return type:

str

ScopeViewApiGRPC.startAcquisition():

ScopeViewApiGRPC.startAcquisition()

Start ScopeView acquisition

Returns:

error value

Return type:

int

Raises:

AssertionError – raises exception on error

ScopeViewApiGRPC.stopAcquisition():

ScopeViewApiGRPC.stopAcquisition()

Stop ScopeView acquisition

Returns:

error value

Return type:

int

Raises:

AssertionError – raises exception on error

ScopeViewApiGRPC.pauseAcquisition():

ScopeViewApiGRPC.pauseAcquisition()

Pause ScopeView acquisition

Returns:

error value

Return type:

int

Raises:

AssertionError – raises exception on error

ScopeViewApiGRPC.setCont(state):

ScopeViewApiGRPC.setCont(state)

Set ScopeView cont option

Parameters:

value (bool) – cont state

Returns:

error value

Return type:

int

Raises:

AssertionError – raises exception on error

ScopeViewApiGRPC.setNumAcq(numAcq):

ScopeViewApiGRPC.setNumAcq(numAcq)

Set number of ScopeView acquisitions

Parameters:

value (int) – number of acquisition

Returns:

error value

Return type:

int

Raises:

AssertionError – raises exception on error

ScopeViewApiGRPC.setSamplingRate(rate):

ScopeViewApiGRPC.setSamplingRate(rate)

Set ScopeView acquisition sample rate

Parameters:

value (float) – acquisition sample rate (seconds)

Returns:

error value

Return type:

int

Raises:

AssertionError – raises exception on error

ScopeViewApiGRPC.setStartTime(time):

ScopeViewApiGRPC.setStartTime(time)

Set ScopeView acquisition start time

Parameters:

value (float) – time to start acquisition (seconds)

Returns:

error value

Return type:

int

Raises:

AssertionError – raises exception on error

ScopeViewApiGRPC.setTimeLength(time):

ScopeViewApiGRPC.setTimeLength(time)

Set ScopeView acquisition duration

Parameters:

value (float) – acquisition duration (seconds)

Returns:

error value

Return type:

int

Raises:

AssertionError – raises exception on error

ScopeViewApiGRPC.setSync(state):

ScopeViewApiGRPC.setSync(state)

Set ScopeView sync option

Parameters:

value (bool) – sync state

Returns:

error value

Return type:

int

Raises:

AssertionError – raises exception on error

ScopeViewApiGRPC.setTrig(state):

ScopeViewApiGRPC.setTrig(state)

Set ScopeView trig option

Parameters:

value (bool) – trig state

Returns:

error value

Return type:

int

Raises:

AssertionError – raises exception on error

Data Source

ScopeViewApiGRPC.loadDataSource(strURI):

ScopeViewApiGRPC.loadDataSource(strURI)

Load data source from provided source

Parameters:

uri (str) – data source location

Returns:

datasource name

Return type:

string

Raises:

AssertionError – raises exception on error

ScopeViewApiGRPC.loadFileDataSource(filePath):

ScopeViewApiGRPC.loadFileDataSource(filePath)

Load ScopeView data source

Parameters:

file_name (str) – path to data source location

Returns:

datasource name

Return type:

string

Raises:

AssertionError – raises exception on error

ScopeViewApiGRPC.reloadAllDataSources():

ScopeViewApiGRPC.reloadAllDataSources()

Reload all ScopeView data sources

Returns:

error value

Return type:

int

Raises:

AssertionError – raises exception on error

ScopeViewApiGRPC.removeAllDataSources():

ScopeViewApiGRPC.removeAllDataSources()

Remove all ScopeView data sources

Returns:

error value

Return type:

int

Raises:

AssertionError – raises exception on error

ScopeViewApiGRPC.replaceDataSource(oldDataSourceLabel, newDataSourceLocation):

ScopeViewApiGRPC.replaceDataSource(oldDataSourceLabel, newDataSourceLocation)

Replace ScopeView data source with provided source

Parameters:
  • oldDataSourceLabel (str) – ScopeView data source label

  • newDataSourceLocation (str) – data source location

Returns:

datasource name

Return type:

string

Raises:

AssertionError – raises exception on error

ScopeViewApiGRPC.setDataSourceParameter(dataSourceLabel, parameter, value):

ScopeViewApiGRPC.setDataSourceParameter(dataSourceLabel, parameter, value)

Set an acquisition parameter for a custom data source which uses additional parameters

Parameters:
  • dataSourceLabel (str) – The data source label. It should contain the brackets

  • parameter (str) – The string parameter ID. The parameters are defined in the description of the relevant data sources.

  • value (str) – value

Returns:

error value

Return type:

int

Raises:

AssertionError – raises exception on error

Examples:

  • HyWorksApi.ScopeView.setDataSourceParameter(‘[REC1]’, ‘timeLength’, ‘0.4’)

  • HyWorksApi.ScopeView.setDataSourceParameter(‘[OPA1]’, ‘triggerFunction’, ‘Level’)

Template

ScopeViewApiGRPC.executeTemplate(filePath):

ScopeViewApiGRPC.executeTemplate(filePath)

Execute ScopeView template

Parameters:

file_name (str) – path to template location

Returns:

error value

Return type:

int

Raises:

AssertionError – raises exception on error

ScopeViewApiGRPC.importTemplate(filePath, appendNewPage):

ScopeViewApiGRPC.importTemplate(filePath, appendNewPage)

Import template to ScopeView

Parameters:
  • file_name (str) – path to template location

  • appendNewPage (bool) – append template to new page

Returns:

error value

Return type:

int

Raises:

AssertionError – raises exception on error

ScopeViewApiGRPC.loadTemplate(filePath):

ScopeViewApiGRPC.loadTemplate(filePath)

Load template to ScopeView

Parameters:

file_name (str) – path to template location

Returns:

error value

Return type:

int

Raises:

AssertionError – raises exception on error

ScopeViewApiGRPC.newTemplate():

ScopeViewApiGRPC.newTemplate()

Create new ScopeView template

Returns:

error value

Return type:

int

Raises:

AssertionError – raises exception on error

ScopeViewApiGRPC.removeAllPages():

ScopeViewApiGRPC.removeAllPages()

Removes all pages from ScopeView template

Returns:

error value

Return type:

int

Raises:

AssertionError – raises exception on error

ScopeViewApiGRPC.saveTemplate(filePath):

ScopeViewApiGRPC.saveTemplate(filePath)

Save ScopeView template

Parameters:

file_name (str) – path to template location

Returns:

error value

Return type:

int

Raises:

AssertionError – raises exception on error

OPAL-RT TECHNOLOGIES, Inc. | 1751, rue Richardson, bureau 1060 | Montréal, Québec Canada H3K 1G6 | opal-rt.com | +1 514-935-2323