added AD9833 and DS1809 support
This commit is contained in:
@ -107,6 +107,10 @@ def set_initial_params():
|
||||
params['RampTriangle'] = True
|
||||
params['RampSramMode'] = False
|
||||
params['RampSramSamples'] = ''
|
||||
params['RampSramAmp'] = ''
|
||||
params['Ad9833Freq'] = ''
|
||||
params['Ad9833Mclk'] = '25'
|
||||
params['Ad9833Triangle'] = True
|
||||
return params
|
||||
|
||||
def update_data_lists():
|
||||
@ -473,10 +477,30 @@ if __name__ == "__main__":
|
||||
triangle = values.get('-RampTriangle-', True)
|
||||
sram_mode = values.get('-RampSramMode-', False)
|
||||
sram_samples = parse_optional_int(values.get('-RampSramSamples-'))
|
||||
sram_amp_val = parse_optional_float(values.get('-RampSramAmp-'))
|
||||
sram_amplitude = None
|
||||
if sram_amp_val is not None:
|
||||
if sram_amp_val <= 1.0:
|
||||
sram_amplitude = int(round(sram_amp_val * 8191.0))
|
||||
elif sram_amp_val <= 100.0:
|
||||
sram_amplitude = int(round((sram_amp_val / 100.0) * 8191.0))
|
||||
else:
|
||||
sram_amplitude = int(round(sram_amp_val))
|
||||
dev.start_ramp_max(prt, freq_hz=freq_hz, duty=duty, saw_step=saw_step,
|
||||
pat_period=pat_period, pat_period_base=pat_period_base,
|
||||
dac_clk_hz=dac_clk_hz, triangle=triangle,
|
||||
sram_mode=sram_mode, sram_samples=sram_samples)
|
||||
sram_mode=sram_mode, sram_samples=sram_samples,
|
||||
sram_amplitude=sram_amplitude)
|
||||
elif event == '-StartRamp9833-':
|
||||
freq_hz = parse_optional_float(values.get('-AD9833Freq-'))
|
||||
mclk_mhz = parse_optional_float(values.get('-AD9833Mclk-'))
|
||||
mclk_hz = mclk_mhz * 1e6 if mclk_mhz is not None else None
|
||||
triangle = values.get('-AD9833Triangle-', True)
|
||||
dev.start_ad9833_ramp(prt, freq_hz=freq_hz, mclk_hz=mclk_hz, triangle=triangle, enable=True)
|
||||
elif event == '-DS1809UC-':
|
||||
dev.send_ds1809_pulse(prt, uc=True, dc=False)
|
||||
elif event == '-DS1809DC-':
|
||||
dev.send_ds1809_pulse(prt, uc=False, dc=True)
|
||||
elif event == '-StopCycle-':
|
||||
window['-StopCycle-'].update(disabled = True)
|
||||
current_and_temperature_settings_available = True
|
||||
@ -488,8 +512,8 @@ if __name__ == "__main__":
|
||||
|
||||
window['-TOUT_1-'].update(gui.READ_TEMPERATURE_TEXT+' 1: '+shorten(data['Temp_1'])+' C')
|
||||
window['-TOUT_2-'].update(gui.READ_TEMPERATURE_TEXT+' 2: '+shorten(data['Temp_2'])+' C')
|
||||
window['-IOUT_1-'].update(gui.READ_CURRENT_TEXT+' 1: '+shorten(data['I1'])+' мА')
|
||||
window['-IOUT_2-'].update(gui.READ_CURRENT_TEXT+' 2: '+shorten(data['I2'])+' мА')
|
||||
window['-IOUT_1-'].update(gui.READ_CURRENT_TEXT+' 1: '+shorten(data['I1'])+' мА (raw '+str(data.get('I1_raw', ''))+')')
|
||||
window['-IOUT_2-'].update(gui.READ_CURRENT_TEXT+' 2: '+shorten(data['I2'])+' мА (raw '+str(data.get('I2_raw', ''))+')')
|
||||
window['-DateTime-'].update(data['datetime'].strftime('%d-%m-%Y %H:%M:%S:%f')[:-3])
|
||||
window['-TTerm1-'].update('T терм 1: '+shorten(data['Temp_Ext_1'])+' C')
|
||||
window['-TTerm2-'].update('T терм 2: '+shorten(data['Temp_Ext_2'])+' C')
|
||||
@ -519,4 +543,3 @@ if __name__ == "__main__":
|
||||
window.close()
|
||||
|
||||
dev.close_connection(prt)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user