Skip to content

Result Chart Query Set #16

@jorgevargasmor

Description

@jorgevargasmor

Hello,
I am using your package.

I am trying to reproduce the same configuration of ResultChartQuerySet.tcl by in python with your package it is prossible to sent this commands?

Create the ResultChartQuery

set hResultChart [stc::create ResultChartQuerySet -under project1 -name "My Chart"]

Create and configure it's ResultQuery objects.

stc::create ResultQuery -under $hResultChart
-ConfigClassId Generator
-ResultClassId GeneratorPortResults
-PropertyIdArray GeneratorPortResults.TotalBitRate
-ResultRootList $hPortTx

stc::create ResultQuery -under $hResultChart
-ConfigClassId Analyzer
-ResultClassId AnalyzerPortResults
-PropertyIdArray AnalyzerPortResults.TotalBitRate
-ResultRootList $hPortRx

Subscribe the ResultChartQuery to begin updating the data model.

stc::perform ResultDataSetSubscribe -ResultDataSet $hResultChart

Start Traffic

puts "Starting Traffic ..."
set hGenerator [stc::get $hPortTx -children-Generator]
stc::perform GeneratorStart -GeneratorList $hGenerator

after 5000

proc showBitRate {hResultChart} {
puts "ResultChartQuerySet: [ stc::get $hResultChart -name ]"
for { set i 0 } { $i < 50 } { incr i } {

    # Iterate Results ...
    set lstResults [stc::get $hResultChart -ResultHandleList]
    foreach hResult $lstResults {
        # Get the RealtimeChartSeries ...
        set hChartSeries [lindex [stc::get $hResult -children-RealtimeChartSeries] 0]
        
        set dstream [stc::get $hChartSeries -DataStream]
        # RealtimeChartSeries will have 0-n DataStreams
        if {[llength $dstream] != 0} {

            puts "[stc::get $hResult -PortUiName] [stc::get $hChartSeries -DataSourcePropertyId]"

            # Iterate the DataStreams which contains the x,y data pairs. x = timestamp, y = data value.
            foreach dstream [stc::get $hChartSeries -DataStream] {

                # Convert the raw timestamp to a display time for easier viewing ...
                set secs [lindex [ split $dstream , ] 0 ]
                puts "[string repeat \t 6][clock format [expr {round($secs)}] -format {%H:%M:%S}], [lindex [ split $dstream , ] 1 ]"
            }
        }
    }
    
    after 1000
}

}

showBitRate $hResultChart

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions