Skip to content

Commit 0665c7f

Browse files
committed
Added log command to scope program
1 parent 1402ff7 commit 0665c7f

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

Poll/source/scope.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ void Oscilloscope::ArgHelp(std::string prefix_){
177177
void Oscilloscope::CmdHelp(std::string prefix_){
178178
std::cout << prefix_ << "set [module] [channel] - Set the module and channel of signal of interest (default = 0, 0).\n";
179179
std::cout << prefix_ << "delay [time] - Set the delay between drawing traces (in seconds, default = 1 s).\n";
180+
std::cout << prefix_ << "log - Toggle log/linear mode on the y-axis.\n";
180181
}
181182

182183
/// Scan input arguments and set class variables.
@@ -228,6 +229,16 @@ bool Oscilloscope::CommandControl(std::string cmd_, const std::vector<std::strin
228229
std::cout << message_head << " -SYNTAX- delay [time]\n";
229230
}
230231
}
232+
else if(cmd_ == "log"){
233+
if(canvas->GetLogy()){
234+
canvas->SetLogy(0);
235+
std::cout << message_head << "y-axis set to linear.\n";
236+
}
237+
else{
238+
canvas->SetLogy(1);
239+
std::cout << message_head << "y-axis set to log.\n";
240+
}
241+
}
231242
else{ return false; }
232243

233244
return true;

0 commit comments

Comments
 (0)