diff --git a/config/config_MS2830A.json b/config/config_MS2830A.json index 471f60dd5091d23d88bbb0e095ef5bcb8f882938..c5a2a58e6193bd87e9a4965bd96a647e537dec82 100644 --- a/config/config_MS2830A.json +++ b/config/config_MS2830A.json @@ -1,6 +1,6 @@ { - "start_freq": 1000000000, - "stop_freq": 2000000000, + "start_freq": 1000000000.0, + "stop_freq": 2000000000.0, "sweep_trace_points": 5001, "resolution_bandwith": 10000000, "video_bandwith": 10, diff --git a/src/Anritsu_MS2830A.py b/src/Anritsu_MS2830A.py index 9187151f74149268ecada334d7446b328d38883c..1fd793b27cc2bde433c545bd1294453994dea3b7 100644 --- a/src/Anritsu_MS2830A.py +++ b/src/Anritsu_MS2830A.py @@ -72,7 +72,7 @@ class Anritsu_MS2830A(): """ sets the resolution bandwidth """ - self._visainstrument.write('RB %e'%(BW)) + self._visainstrument.write('RB %f'%(BW)) def do_get_resolutionBW(self): """ @@ -84,7 +84,7 @@ class Anritsu_MS2830A(): """ sets the video bandwidth """ - self._visainstrument.write('VB %e'%(BW)) + self._visainstrument.write('VB %f'%(BW)) def do_get_videoBW(self): """ @@ -141,7 +141,8 @@ class Anritsu_MS2830A(): """ sets the center frequency """ - self._visainstrument.write('CNF %e' % (centerfreq)) + self._visainstrument.write('CNF %f' % (centerfreq)) + def do_get_centerfreq(self): """ @@ -153,7 +154,7 @@ class Anritsu_MS2830A(): """ sets the frequency span """ - self._visainstrument.write('freq:span %e'%(freqspan)) + self._visainstrument.write('freq:span %f'%(freqspan)) def do_get_freqspan(self): """ @@ -167,7 +168,8 @@ class Anritsu_MS2830A(): sets the start frequency """ - self._visainstrument.write('STF %e'%(freq)) + + self._visainstrument.write('STF %f'%(freq)) def do_get_startfreq(self): """ @@ -181,7 +183,7 @@ class Anritsu_MS2830A(): sets the stop frequency """ - self._visainstrument.write('SOF %e'%(freq)) + self._visainstrument.write('SOF %f'%(freq)) def do_get_stopfreq(self): """ diff --git a/src/tabs/configuration_tab.py b/src/tabs/configuration_tab.py index a139e3304e7142f02b88cdbd75248060d470c0e6..5b8eb97bf307c1b986bf951a886ae21fc1dedfb4 100644 --- a/src/tabs/configuration_tab.py +++ b/src/tabs/configuration_tab.py @@ -2,6 +2,7 @@ from logging import disable from tkinter import Tk from tkinter.constants import DISABLED from tkinter.font import NORMAL +from tokenize import Double import Anritsu_MS2830A as SPA import Utils import logging @@ -125,11 +126,11 @@ def configuration(self, TNotebook1, config_interface, config_file): # function for button "Write configuration" def write_conf(): config_file = { - "start_freq": int(self.Entry1.get()), - "stop_freq": int(self.Entry2.get()), + "start_freq": float(self.Entry1.get()), + "stop_freq": float(self.Entry2.get()), "sweep_trace_points": int(self.Entry3.get()), - "resolution_bandwith": int(self.Entry4.get()), - "video_bandwith": int(self.Entry5.get()), + "resolution_bandwith": float(self.Entry4.get()), + "video_bandwith": float(self.Entry5.get()), "amplitude_log_scale": int(self.Entry6.get()), "reference_level": int(self.Entry7.get()), "zoom_spot_marker": [int(self.Entry8.get()), self.Entry9.get()]