Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jtcl cant handle this command #26

Open
Emil-Gustafsson opened this issue Oct 8, 2019 · 6 comments
Open

jtcl cant handle this command #26

Emil-Gustafsson opened this issue Oct 8, 2019 · 6 comments

Comments

@Emil-Gustafsson
Copy link

Emil-Gustafsson commented Oct 8, 2019

I have been using a different library called tcljava/tclblend but i wanted to upgrade to a more supported library and found this, problem i have now is that i have one command that doesnt work. The error i get is "extra characters after close-brace" and i cant see why, it is working on the old library. Here is the command i send:
set list {}; foreach portString {{1 12 14} {1 12 13} } { packetGroupStats get {*}$portString 0 57344; after 500;packetGroupStats get {*}$portString 0 57344; lappend list [regsub -all { } $portString {_}]; foreach {streamCounterName counterName} { STREAM_PACKETS_RX totalFrames STREAM_PACKETS_RX totalFrames } { lappend list $streamCounterName; set numGroups [ packetGroupStats cget -numGroups]; for {set groupId 0} {$groupId < $numGroups} {incr groupId} { packetGroupStats getGroup $groupId; set counter [packetGroupStats cget -$counterName]; lappend list $counter;};};}; return $list;

it fails on method eval2 in Parser.class row 1176 when the parseCommand have been run

@Emil-Gustafsson Emil-Gustafsson changed the title jtcl can handle this command jtcl cant handle this command Oct 8, 2019
@tpoindex
Copy link
Contributor

tpoindex commented Oct 8, 2019 via email

@Emil-Gustafsson
Copy link
Author

Emil-Gustafsson commented Oct 9, 2019

sorry, github seem to remove "*", i will edit the command

@Emil-Gustafsson
Copy link
Author

With the change you suggested i get a new error, invalid command name "packetGroupStats".
The new command:
set list {}; foreach portString {{1 12 14} {1 12 13}} { packetGroupStats get {*} $portString 0 57344; after 500; packetGroupStats get {*} $portString 0 57344; lappend list [ regsub -all { } $portString {_} ]; foreach {streamCounterName counterName} { STREAM_PACKETS_RX totalFrames STREAM_PACKETS_RX totalFrames } { lappend list $streamCounterName; set numGroups [ packetGroupStats cget -numGroups]; for {set groupId 0} {$groupId < $numGroups} {incr groupId} { packetGroupStats getGroup $groupId; set counter [packetGroupStats cget -$counterName]; lappend list $counter;};};}; return $list;

@tpoindex
Copy link
Contributor

tpoindex commented Oct 9, 2019 via email

@Emil-Gustafsson
Copy link
Author

Thanks for your answer, i will look into the alternative way you suggested.

@Emil-Gustafsson
Copy link
Author

I have tried to remove the usage of {*} but i get the next problem similar like before when it doesnt think "packetGroupStats" is a valid command. is it still a problem with my command or something else?
This is the command im running now:
"set list {}; foreach portString {{1 12 14} {1 12 13}} {set ixchassis [lindex $portString 0]; set ixcard [lindex $portString 1]; set ixport [lindex $portString 2]; packetGroupStats get $ixchassis $ixcard $ixport 0 57344; after 500; packetGroupStats get $ixchassis $ixcard $ixport 0 57344; lappend list [regsub -all { } $portString {_}]; foreach {streamCounterName counterName} { STREAM_PACKETS_RX totalFrames STREAM_PACKETS_RX totalFrames } { lappend list $streamCounterName; set numGroups [ packetGroupStats cget -numGroups]; for {set groupId 0} {$groupId < $numGroups} {incr groupId} { packetGroupStats getGroup $groupId; set counter [packetGroupStats cget -$counterName]; lappend list $counter;};};}; return $list;"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants