add take_grad

This commit is contained in:
nazarchuk.as 2022-12-13 09:06:20 +03:00
parent 5e39c13edc
commit cfda4aaf92
12 changed files with 51 additions and 10 deletions

View File

@ -0,0 +1 @@
,anna,anna-HP-Laptop-15-bw0xx,14.11.2022 17:37,file:///home/anna/.config/libreoffice/4;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 403 KiB

After

Width:  |  Height:  |  Size: 403 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 148 KiB

After

Width:  |  Height:  |  Size: 148 KiB

View File

@ -183,7 +183,7 @@ def B(x, b, c, d):
def make_grad(): def make_grad():
data = make_dic('grad.csv') data = make_dic('grad.csv')
f_0 = 0.1 f_0 = 0.1
f = data['Ф']-f_0 f = data['F']-f_0
s = 75 * 10 ** -4 s = 75 * 10 ** -4
b = f * 10**-3 / s b = f * 10**-3 / s
x = data['I'] x = data['I']

View File

@ -1,4 +1,4 @@
Ô;I F;I
6;1.51 6;1.51
6.1;1.46 6.1;1.46
5.8;1.3 5.8;1.3

1 Ô F I
2 6 6 1.51
3 6.1 6.1 1.46
4 5.8 5.8 1.3

Binary file not shown.

Before

Width:  |  Height:  |  Size: 123 KiB

After

Width:  |  Height:  |  Size: 123 KiB

View File

@ -36,7 +36,7 @@ class ChartWindow(AbstractWindow):
(a, eps) = self.make_grad() (a, eps) = self.make_grad()
print(*a) print(*a)
self.make_main(a, eps) # self.make_main(a, eps)
self.setWindowTitle('Основной эксперимент. Обработка данных') self.setWindowTitle('Основной эксперимент. Обработка данных')
@ -69,7 +69,9 @@ class ChartWindow(AbstractWindow):
return x**2*b+x*c+d return x**2*b+x*c+d
def make_grad(self): def make_grad(self):
self.parent.flow_dataname = 'Induction_data.csv'
self.parent.grad_chartname = 'Graduation_chart.png' self.parent.grad_chartname = 'Graduation_chart.png'
self.parent.data_grad = Data(data_filename=os.path.join( self.parent.data_grad = Data(data_filename=os.path.join(
self.parent.folder, self.parent.flow_dataname)) self.parent.folder, self.parent.flow_dataname))

View File

@ -103,9 +103,6 @@ class GraduationWindow(AbstractWindow):
def take_data(self): def take_data(self):
t = (round(time.time()*1000)-self.start_time) t = (round(time.time()*1000)-self.start_time)
b = self.lineEdit.text() b = self.lineEdit.text()
msg = 'VOLTage '+str(self.volt)+'\n'
self.parent.ser.write(msg.encode('ascii'))
time.sleep(1)
f_amp = open(self.parent.I_M_name, 'w') f_amp = open(self.parent.I_M_name, 'w')
@ -114,7 +111,7 @@ class GraduationWindow(AbstractWindow):
f_amp = open(self.parent.I_M_name, 'r') f_amp = open(self.parent.I_M_name, 'r')
I_M = '{:.9f}'.format(float(f_amp.read(15))*10**3) I_M = '{:.9f}'.format(float(f_amp.read(15))*10**3)
f_amp.close() f_amp.close()
self.save_data([b, self.volt, I_M, t]) self.save_data([b, 0, I_M, t])
def closeEvent(self, event): def closeEvent(self, event):
self.parent.close() self.parent.close()

View File

@ -32,7 +32,12 @@ class Start:
self.app = QApplication.instance() self.app = QApplication.instance()
self.current=0 self.current=0
self.window = StartWindow(self) self.window = StartWindow(self)
self.add_equip()
l = 'usbtmc'+str(1)
self.I_M_name = os.path.join('/dev', l)
# self.add_equip()
self.draw() self.draw()
self.app.exec() self.app.exec()
@ -143,8 +148,8 @@ class StartWindow(AbstractWindow):
self.chart = QPushButton('Обработка данных') self.chart = QPushButton('Обработка данных')
self.chart.clicked.connect(self.chart_click) self.chart.clicked.connect(self.chart_click)
if not self.parent.current==4: # if not self.parent.current==4:
self.chart.setEnabled(False) # self.chart.setEnabled(False)
self.chart_text = QLabel('Выполняется расчет всех констант образца и построение графиков', self) self.chart_text = QLabel('Выполняется расчет всех констант образца и построение графиков', self)
self.main = QPushButton('Определение ЭДС Холла') self.main = QPushButton('Определение ЭДС Холла')

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 KiB

View File

@ -0,0 +1,34 @@
"B,mTl","E,mV","I_M,mA","t,ms"
9.0,0,-0.017355649,4064
4.8,0,9.062551030,26903
14.4,0,35.657554500,50196
30.5,0,56.164741900,72561
47.5,0,77.052805300,127690
66.5,0,101.500865000,150179
81.9,0,121.485461000,166439
92.5,0,135.858421000,191578
111.0,0,162.262180000,215469
143.8,0,219.841182000,236841
188.1,0,294.176851000,256229
246.3,0,370.369039000,293209
280.0,0,415.483465000,311272
330.1,0,482.875030000,330588
382.6,0,555.197100000,354245
431.2,0,623.840762000,371740
468.1,0,677.716870000,388144
505.6,0,734.378744000,407822
542.4,0,792.846872000,437482
574.2,0,847.660556000,455654
595.2,0,886.906901000,477120
623.1,0,943.877306000,496339
655.2,0,1019.979630000,517558
668.5,0,1055.418760000,534419
681.3,0,1091.280250000,553488
693.7,0,1129.253530000,576919
701.8,0,1161.173020000,596092
715.6,0,1203.603520000,613596
720.9,0,1224.850230000,634934
727.6,0,1254.154680000,647760
739.2,0,1300.575130000,694432
759.0,0,1346.860770000,726900
770.8,0,1404.025880000,759661
1 B,mTl E,mV I_M,mA t,ms
2 9.0 0 -0.017355649 4064
3 4.8 0 9.062551030 26903
4 14.4 0 35.657554500 50196
5 30.5 0 56.164741900 72561
6 47.5 0 77.052805300 127690
7 66.5 0 101.500865000 150179
8 81.9 0 121.485461000 166439
9 92.5 0 135.858421000 191578
10 111.0 0 162.262180000 215469
11 143.8 0 219.841182000 236841
12 188.1 0 294.176851000 256229
13 246.3 0 370.369039000 293209
14 280.0 0 415.483465000 311272
15 330.1 0 482.875030000 330588
16 382.6 0 555.197100000 354245
17 431.2 0 623.840762000 371740
18 468.1 0 677.716870000 388144
19 505.6 0 734.378744000 407822
20 542.4 0 792.846872000 437482
21 574.2 0 847.660556000 455654
22 595.2 0 886.906901000 477120
23 623.1 0 943.877306000 496339
24 655.2 0 1019.979630000 517558
25 668.5 0 1055.418760000 534419
26 681.3 0 1091.280250000 553488
27 693.7 0 1129.253530000 576919
28 701.8 0 1161.173020000 596092
29 715.6 0 1203.603520000 613596
30 720.9 0 1224.850230000 634934
31 727.6 0 1254.154680000 647760
32 739.2 0 1300.575130000 694432
33 759.0 0 1346.860770000 726900
34 770.8 0 1404.025880000 759661

View File

@ -0,0 +1,2 @@
"B,mTl","E,mV","I_M,mA","t,ms"
3,0,-0.000180328,884
1 B,mTl E,mV I_M,mA t,ms
2 3 0 -0.000180328 884