rohdeschwarz  0.2.0
TCPIP socket library for Rohde & Schwarz instrument control
display.cpp
Go to the documentation of this file.
1 
7 // rohdeschwarz
11 #include "rohdeschwarz/helpers.hpp"
12 using namespace rohdeschwarz::instruments::vna;
13 using namespace rohdeschwarz::scpi;
14 using namespace rohdeschwarz;
15 
16 
17 // std lib
18 
19 
21  _vna(znx)
22 {
23  // no operations
24 }
25 
26 
28 {
29  return toBool(updateSetting());
30 }
31 
32 
33 void Display::setOn(bool on)
34 {
35  setUpdateSetting(on? "1" : "0");
36 }
37 
38 
39 void Display::setOff(bool off)
40 {
41  setUpdateSetting(off? "0" : "1");
42 }
43 
44 
46 {
47  return updateSetting() == "ONCE";
48 }
49 
50 
51 void Display::setManualUpdate(bool manual)
52 {
53  setUpdateSetting("ONCE");
54 }
55 
56 
58 {
59  setUpdateSetting("ONCE");
60 }
61 
62 
64 {
65  _vna->write("@LOC");
66 }
67 
68 
70 {
71  _vna->write("@REM");
72 }
73 
74 
75 // helpers
76 
77 std::string Display::updateSetting()
78 {
79  return rightTrim(_vna->query(":SYST:DISP:UPD?"));
80 }
81 
82 
83 void Display::setUpdateSetting(const char* value)
84 {
85  const std::string value_str(value);
86  setUpdateSetting(value_str);
87 }
88 
89 
90 void Display::setUpdateSetting(const std::string& value)
91 {
92  _vna->write(":SYST:DISP:UPD %1%", value);
93 }
std::string query(std::string scpi_command, Args &&... args)
Definition: instrument.hpp:173
bool write(std::string scpi_command, Args &&... args)
Definition: instrument.hpp:142
bool isManualUpdate()
queries manual display update value
Definition: display.cpp:45
void local()
set instrument to local mode
Definition: display.cpp:63
void setManualUpdate(bool manual=true)
sets manual display update
Definition: display.cpp:51
void setOn(bool on=true)
sets display on value
Definition: display.cpp:33
bool isOn()
queries whether display is on
Definition: display.cpp:27
void setOff(bool off=true)
sets display off value
Definition: display.cpp:39
void remote()
set instrument to remote mode
Definition: display.cpp:69
void update()
manually updates the display
Definition: display.cpp:57
Object-oriented R&S ZNX-series VNA control.
Definition: vna.hpp:34
rohdeschwarz::instruments::vna::Display definition
rohdeschwarz helper function definition
bool toBool(std::string scpi)
Converts SCPI bool to C/C++ bool.
Definition: bool.cpp:18
std::string rightTrim(std::string text)
Trims whitespace from right (end) of string.
Definition: helpers.cpp:47
rohdeschwarz::instruments::vna::Vna definition