files reorganized, measuring devices added
This commit is contained in:
parent
5483d72d42
commit
f660b77335
30
3.5.1 auto/amperemeter.py
Normal file
30
3.5.1 auto/amperemeter.py
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
import serial
|
||||||
|
|
||||||
|
|
||||||
|
class B7_78():
|
||||||
|
|
||||||
|
def __init__(self, folder):
|
||||||
|
self.folder = folder
|
||||||
|
self.instr = serial.Serial(
|
||||||
|
self.folder, timeout=1, inter_byte_timeout=1)
|
||||||
|
self.instr.write(b'SYST:REM\n')
|
||||||
|
self.instr.write(b'SYST:REM\n')
|
||||||
|
|
||||||
|
def getCurrentDC(self):
|
||||||
|
self.instr.write(b'MEAS:CURR:DC?\n')
|
||||||
|
return self.instr.read(100).decode().rstrip()
|
||||||
|
|
||||||
|
def getVoltageDC(self):
|
||||||
|
self.instr.write(b'MEAS:VOLT:DC?\n')
|
||||||
|
return float(self.instr.read(100).decode().rstrip())
|
||||||
|
|
||||||
|
def getCurrentAC(self):
|
||||||
|
self.instr.write(b'MEAS:CURR:AC?\n')
|
||||||
|
return float(self.instr.read(100).decode().rstrip())
|
||||||
|
|
||||||
|
def getVoltageAC(self):
|
||||||
|
self.instr.write(b'MEAS:VOLT:AC?\n')
|
||||||
|
return float(self.instr.read(100).decode().rstrip())
|
||||||
|
|
||||||
|
# for i in range(5):
|
||||||
|
# print(B7_78('/dev/ttyUSB0').getCurrentDC())
|
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 68 KiB |
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 68 KiB |
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 68 KiB |
@ -372,7 +372,7 @@ class Part2(QtWidgets.QWidget):
|
|||||||
k_0.append(params[1])
|
k_0.append(params[1])
|
||||||
A.append(params[2])
|
A.append(params[2])
|
||||||
for i in range(len(plots.vol[3]) - 1):
|
for i in range(len(plots.vol[3]) - 1):
|
||||||
mes = {'U_' + str(i+2) + ', В': plots.vol[3][i+1], 'I_' + str(i+2) + ', мкА': plots.cur[3][i+1]}
|
mes = {'U_' + str(i+2) + ', В': plots.vol[3][i + 1], 'I_' + str(i + 2) + ', мкА': plots.cur[3][i + 1]}
|
||||||
data.update(mes)
|
data.update(mes)
|
||||||
params = fitting.fit(plots.vol[3][i + 1], plots.cur[3][i + 1])
|
params = fitting.fit(plots.vol[3][i + 1], plots.cur[3][i + 1])
|
||||||
I_0.append(params[0])
|
I_0.append(params[0])
|
43
3.5.1 auto/voltmeter.py
Normal file
43
3.5.1 auto/voltmeter.py
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
class AKIP():
|
||||||
|
|
||||||
|
def __init__(self, folder):
|
||||||
|
self.folder = folder
|
||||||
|
|
||||||
|
def getVoltageDC(self):
|
||||||
|
self.instr = open(self.folder, 'w')
|
||||||
|
self.instr.write('MEAS:VOLT:DC?\n')
|
||||||
|
self.instr.flush()
|
||||||
|
self.instr = open(self.folder, 'r')
|
||||||
|
data = self.instr.readline()
|
||||||
|
self.instr.close()
|
||||||
|
return float(data)
|
||||||
|
|
||||||
|
def getCurrentDC(self):
|
||||||
|
self.instr = open(self.folder, 'w')
|
||||||
|
self.instr.write('MEAS:AMP:DC?\n')
|
||||||
|
self.instr.flush()
|
||||||
|
self.instr = open(self.folder, 'r')
|
||||||
|
data = self.instr.readline()
|
||||||
|
self.instr.close()
|
||||||
|
return float(data)
|
||||||
|
|
||||||
|
def getVoltageAC(self):
|
||||||
|
self.instr = open(self.folder, 'w')
|
||||||
|
self.instr.write('MEAS:VOLT:AC?\n')
|
||||||
|
self.instr.flush()
|
||||||
|
self.instr = open(self.folder, 'r')
|
||||||
|
data = self.instr.readline()
|
||||||
|
self.instr.close()
|
||||||
|
return float(data)
|
||||||
|
|
||||||
|
def getCurrentAC(self):
|
||||||
|
self.instr = open(self.folder, 'w')
|
||||||
|
self.instr.write('MEAS:AMP:AC?\n')
|
||||||
|
self.instr.flush()
|
||||||
|
self.instr = open(self.folder, 'r')
|
||||||
|
data = self.instr.readline()
|
||||||
|
self.instr.close()
|
||||||
|
return float(data)
|
||||||
|
|
||||||
|
# for i in range(5):
|
||||||
|
# print(AKIP('/dev/usbtmc0').getVoltageDC())
|
Loading…
Reference in New Issue
Block a user