Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

more fixes

  • Loading branch information...
commit 19bd37a530f4a31b5ebb16eb1247e40b66f13e5d 1 parent 1413db5
Pavol Rusnak authored May 04, 2011
205  _repo/moduleb-circuit-nobulb.svg
... ...
@@ -0,0 +1,205 @@
  1
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
  2
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
  3
+
  4
+<svg
  5
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
  6
+   xmlns:cc="http://creativecommons.org/ns#"
  7
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
  8
+   xmlns:svg="http://www.w3.org/2000/svg"
  9
+   xmlns="http://www.w3.org/2000/svg"
  10
+   xmlns:xlink="http://www.w3.org/1999/xlink"
  11
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
  12
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
  13
+   width="600"
  14
+   height="400"
  15
+   id="svg2"
  16
+   version="1.1"
  17
+   inkscape:version="0.48.1 r9760"
  18
+   sodipodi:docname="moduleb-circuit-nobulb.svg"
  19
+   inkscape:export-filename="/home/stick/work/scm/brmlab/edubrm/_repo/moduleb-circuit-on.png"
  20
+   inkscape:export-xdpi="90"
  21
+   inkscape:export-ydpi="90">
  22
+  <defs
  23
+     id="defs4">
  24
+    <linearGradient
  25
+       id="linearGradient3834">
  26
+      <stop
  27
+         style="stop-color:#ffff00;stop-opacity:1;"
  28
+         offset="0"
  29
+         id="stop3836" />
  30
+      <stop
  31
+         style="stop-color:#ffff00;stop-opacity:0;"
  32
+         offset="1"
  33
+         id="stop3838" />
  34
+    </linearGradient>
  35
+    <radialGradient
  36
+       inkscape:collect="always"
  37
+       xlink:href="#linearGradient3834"
  38
+       id="radialGradient3842"
  39
+       cx="531.84534"
  40
+       cy="216.78358"
  41
+       fx="531.84534"
  42
+       fy="216.78358"
  43
+       r="27.526657"
  44
+       gradientUnits="userSpaceOnUse" />
  45
+    <radialGradient
  46
+       inkscape:collect="always"
  47
+       xlink:href="#linearGradient3834"
  48
+       id="radialGradient3844"
  49
+       gradientUnits="userSpaceOnUse"
  50
+       cx="531.84534"
  51
+       cy="216.78358"
  52
+       fx="531.84534"
  53
+       fy="216.78358"
  54
+       r="27.526657" />
  55
+  </defs>
  56
+  <sodipodi:namedview
  57
+     id="base"
  58
+     pagecolor="#ffffff"
  59
+     bordercolor="#666666"
  60
+     borderopacity="1.0"
  61
+     inkscape:pageopacity="0.0"
  62
+     inkscape:pageshadow="2"
  63
+     inkscape:zoom="0.98994951"
  64
+     inkscape:cx="427.04704"
  65
+     inkscape:cy="140.78282"
  66
+     inkscape:document-units="px"
  67
+     inkscape:current-layer="layer1"
  68
+     showgrid="false"
  69
+     width="600px"
  70
+     inkscape:window-width="1024"
  71
+     inkscape:window-height="707"
  72
+     inkscape:window-x="0"
  73
+     inkscape:window-y="26"
  74
+     inkscape:window-maximized="1" />
  75
+  <metadata
  76
+     id="metadata7">
  77
+    <rdf:RDF>
  78
+      <cc:Work
  79
+         rdf:about="">
  80
+        <dc:format>image/svg+xml</dc:format>
  81
+        <dc:type
  82
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
  83
+        <dc:title />
  84
+      </cc:Work>
  85
+    </rdf:RDF>
  86
+  </metadata>
  87
+  <g
  88
+     inkscape:label="Layer 1"
  89
+     inkscape:groupmode="layer"
  90
+     id="layer1"
  91
+     transform="translate(0,-652.36218)">
  92
+    <flowRoot
  93
+       xml:space="preserve"
  94
+       id="flowRoot1894"
  95
+       transform="matrix(0.71631544,0,0,0.71631544,-138.46838,598.22977)"
  96
+       style="stroke:#0000ff"><flowRegion
  97
+         id="flowRegion1896"><rect
  98
+           id="rect1898"
  99
+           width="50.507626"
  100
+           height="29.294424"
  101
+           x="181.82745"
  102
+           y="94.737572"
  103
+           style="stroke:#0000ff" /></flowRegion><flowPara
  104
+         id="flowPara1900"
  105
+         style="font-size:20px;stroke:#0000ff">SRG8</flowPara></flowRoot>    <path
  106
+       inkscape:connector-curvature="0"
  107
+       style="fill:none;stroke:#0000ff;stroke-width:3.64284134;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:3.94970989;stroke-opacity:1;stroke-dasharray:none"
  108
+       d="m 96.915379,756.46939 50.142091,0 73.86796,-7.07823"
  109
+       id="path2246"
  110
+       sodipodi:nodetypes="ccc" />
  111
+    <path
  112
+       inkscape:connector-curvature="0"
  113
+       style="fill:none;stroke:#0000ff;stroke-width:3.64284134;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:3.94970989;stroke-opacity:1;stroke-dasharray:none"
  114
+       d="m 96.915379,756.46939 -50.142081,0 0,66.08799"
  115
+       id="path2250"
  116
+       sodipodi:nodetypes="ccc" />
  117
+    <path
  118
+       inkscape:connector-curvature="0"
  119
+       style="fill:none;stroke:#0000ff;stroke-width:3.64284134;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:3.94970989;stroke-opacity:1;stroke-dasharray:none"
  120
+       d="m 46.773298,903.76659 0,81.92375 444.115572,0 0,-77.52047"
  121
+       id="path2254"
  122
+       sodipodi:nodetypes="cccc" />
  123
+    <path
  124
+       inkscape:connector-curvature="0"
  125
+       style="fill:none;stroke:#0000ff;stroke-width:3.64284134;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:3.94970989;stroke-opacity:1;stroke-dasharray:none"
  126
+       d="m 218.75996,756.46939 272.12891,0 0,70.99442"
  127
+       id="path2256"
  128
+       sodipodi:nodetypes="ccc" />
  129
+    <g
  130
+       id="g3670"
  131
+       transform="matrix(1.2800233,0,0,1.2800241,-120.69619,-135.2493)"
  132
+       style="stroke:#0000ff">
  133
+      <path
  134
+         id="path9387"
  135
+         style="fill:none;stroke:#0000ff;stroke-width:0.80661353mm;stroke-linecap:butt;stroke-opacity:1;stroke-dasharray:4.8396813, 2.82314743;stroke-dashoffset:0"
  136
+         d="m 130.83182,765.8629 0,29.28007"
  137
+         inkscape:connector-curvature="0" />
  138
+      <path
  139
+         id="path9389"
  140
+         style="fill:none;stroke:#0000ff;stroke-width:0.80661353mm;stroke-linecap:square;stroke-opacity:1"
  141
+         d="m 130.83182,748.44004 0,11.45392"
  142
+         inkscape:connector-curvature="0" />
  143
+      <path
  144
+         id="path9391"
  145
+         style="fill:none;stroke:#0000ff;stroke-width:1.61322706mm;stroke-linecap:butt;stroke-opacity:1"
  146
+         d="m 142.20507,767.07282 -22.82716,0"
  147
+         inkscape:connector-curvature="0" />
  148
+      <path
  149
+         id="path9393"
  150
+         style="fill:none;stroke:#0000ff;stroke-width:0.80661353mm;stroke-linecap:butt;stroke-opacity:1"
  151
+         d="m 147.93203,759.89396 -34.28108,0"
  152
+         inkscape:connector-curvature="0" />
  153
+      <path
  154
+         id="path9395"
  155
+         style="fill:none;stroke:#0000ff;stroke-width:0.40330676mm;stroke-linecap:butt;stroke-opacity:1"
  156
+         d="m 138.65597,753.1184 9.27606,0 m -4.5977,-4.67836 0,9.35672"
  157
+         inkscape:connector-curvature="0" />
  158
+      <path
  159
+         id="path9404"
  160
+         style="fill:none;stroke:#0000ff;stroke-width:0.80661353mm;stroke-linecap:square;stroke-opacity:1"
  161
+         d="m 130.83182,802.8058 0,11.37325"
  162
+         inkscape:connector-curvature="0" />
  163
+      <path
  164
+         id="path9406"
  165
+         style="fill:none;stroke:#0000ff;stroke-width:1.61322706mm;stroke-linecap:butt;stroke-opacity:1"
  166
+         d="m 142.20507,801.35389 -22.82716,0"
  167
+         inkscape:connector-curvature="0" />
  168
+      <path
  169
+         id="path9408"
  170
+         style="fill:none;stroke:#0000ff;stroke-width:0.80661353mm;stroke-linecap:butt;stroke-opacity:1"
  171
+         d="m 147.93203,794.17503 -34.28108,0"
  172
+         inkscape:connector-curvature="0" />
  173
+    </g>
  174
+    <path
  175
+       sodipodi:type="arc"
  176
+       style="fill:#0000ff;fill-opacity:1;stroke:#0000ff;stroke-width:3;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
  177
+       id="path3761"
  178
+       sodipodi:cx="237.13332"
  179
+       sodipodi:cy="95.691544"
  180
+       sodipodi:rx="4.9244938"
  181
+       sodipodi:ry="4.9244938"
  182
+       d="m 242.05781,95.691544 c 0,2.719722 -2.20477,4.924496 -4.92449,4.924496 -2.71973,0 -4.9245,-2.204774 -4.9245,-4.924496 0,-2.719723 2.20477,-4.924494 4.9245,-4.924494 2.71972,0 4.92449,2.204771 4.92449,4.924494 z"
  183
+       transform="matrix(0.92,0,0,0.92,1.8360381,668.36218)" />
  184
+    <path
  185
+       transform="matrix(0.92,0,0,0.92,272.80202,741.45728)"
  186
+       d="m 242.05781,95.691544 a 4.9244938,4.9244938 0 1 1 -9.84899,0 4.9244938,4.9244938 0 1 1 9.84899,0 z"
  187
+       sodipodi:ry="4.9244938"
  188
+       sodipodi:rx="4.9244938"
  189
+       sodipodi:cy="95.691544"
  190
+       sodipodi:cx="237.13332"
  191
+       id="path3009"
  192
+       style="fill:#0000ff;fill-opacity:1;stroke:#0000ff;stroke-width:3;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
  193
+       sodipodi:type="arc" />
  194
+    <path
  195
+       sodipodi:type="arc"
  196
+       style="fill:#0000ff;fill-opacity:1;stroke:#0000ff;stroke-width:3;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
  197
+       id="path3011"
  198
+       sodipodi:cx="237.13332"
  199
+       sodipodi:cy="95.691544"
  200
+       sodipodi:rx="4.9244938"
  201
+       sodipodi:ry="4.9244938"
  202
+       d="m 242.05781,95.691544 a 4.9244938,4.9244938 0 1 1 -9.84899,0 4.9244938,4.9244938 0 1 1 9.84899,0 z"
  203
+       transform="matrix(0.92,0,0,0.92,272.48513,816.20157)" />
  204
+  </g>
  205
+</svg>
8  firmware/src/adc.c
@@ -160,21 +160,29 @@ void ADCInit( uint32_t ADC_Clk )
160 160
   to design team. */
161 161
   LPC_IOCON->PIO0_11 &= ~0x8F; /*  ADC I/O config */
162 162
   LPC_IOCON->PIO0_11 |= 0x02;  /* ADC IN0 */
  163
+  LPC_IOCON->PIO0_11 |= 1<<3;  /* ADC IN0 -- pulldown */
163 164
 #if 1
164 165
   LPC_IOCON->PIO1_0  &= ~0x8F;
165 166
   LPC_IOCON->PIO1_0  |= 0x02;  /* ADC IN1 */
  167
+  LPC_IOCON->PIO1_0  |= 1<<3;  /* ADC IN1 -- pulldown */
166 168
   LPC_IOCON->PIO1_1  &= ~0x8F;
167 169
   LPC_IOCON->PIO1_1  |= 0x02;  /* ADC IN2 */
  170
+  LPC_IOCON->PIO1_1  |= 1<<3;  /* ADC IN2 -- pulldown */
168 171
   LPC_IOCON->PIO1_2  &= ~0x8F;
169 172
   LPC_IOCON->PIO1_2  |= 0x02;  /* ADC IN3 */
  173
+  LPC_IOCON->PIO1_2  |= 1<<3;  /* ADC IN3 -- pulldown */
170 174
   LPC_IOCON->PIO1_3   &= ~0x8F;
171 175
   LPC_IOCON->PIO1_3   |= 0x02;  /* ADC IN4 */
  176
+  LPC_IOCON->PIO1_3   |= 1<<3;  /* ADC IN4 -- pulldown */
172 177
   LPC_IOCON->PIO1_4    &= ~0x8F; /* Clear bit7, change to analog mode. */	
173 178
   LPC_IOCON->PIO1_4    |= 0x01;  /* ADC IN5 */
  179
+  LPC_IOCON->PIO1_4    |= 1<<3;  /* ADC IN5 -- pulldown */
174 180
   LPC_IOCON->PIO1_10   &= ~0x8F; /* Clear bit7, change to analog mode. */	
175 181
   LPC_IOCON->PIO1_10   |= 0x01;  /* ADC IN6 */
  182
+  LPC_IOCON->PIO1_10   |= 1<<3;  /* ADC IN6 -- pulldown */
176 183
   LPC_IOCON->PIO1_11   &= ~0x8F; /* Clear bit7, change to analog mode. */	
177 184
   LPC_IOCON->PIO1_11   |= 0x01;  /* ADC IN7 */
  185
+  LPC_IOCON->PIO1_11   |= 1<<3;  /* ADC IN7 -- pulldown */
178 186
 #endif
179 187
 
180 188
   LPC_ADC->CR = ( 0x01 << 0 ) |  /* SEL=1,select channel 0~7 on ADC0 */
9  software/modules/ModuleA.py
@@ -24,10 +24,8 @@ def __init__(self):
24 24
 
25 25
     def read_inputs(self):
26 26
         r = self.dev.read()
27  
-        u = r[1]/1023.0 * 3.3 - 0.19
28  
-        if u < 0:
29  
-            u = 0
30  
-        self.dev.pwm(1, int(u*65536/3))
  27
+        u = r[1]/1023.0 * 3.3
  28
+        self.dev.pwm(1, int(u*65536.0/3.3))
31 29
         self.ui.labelU.setText('%0.3f V' % u)
32 30
         self.ui.progressU.setValue(1000*u)
33 31
         self.data.pop(0)
@@ -53,7 +51,7 @@ def read_inputs(self):
53 51
         self.scene.addSimpleText('1.0').moveBy(-40, 300-10)
54 52
         self.scene.addSimpleText('0.5').moveBy(-40, 350-10)
55 53
         self.scene.addSimpleText('0.0').moveBy(-40, 400-10)
56  
-        self.scene.addSimpleText('[U]').moveBy(-39, 430-10)
  54
+        self.scene.addSimpleText('[U/V]').moveBy(-39, 430-10)
57 55
         path = QPainterPath()
58 56
         path.moveTo(0,400-self.data[0]*100)
59 57
         for i in xrange(1,200):
@@ -70,6 +68,7 @@ def __init__(self):
70 68
     def start(self):
71 69
         self.widget.dev = Device()
72 70
         self.widget.timer.start(40)
  71
+        self.widget.data = 200*[0.0]
73 72
 
74 73
     def stop(self):
75 74
         self.widget.timer.stop()
BIN  software/modules/ModuleB-nobulb.png
14  software/modules/ModuleB.py
@@ -24,16 +24,14 @@ def __init__(self):
24 24
         self.scene_off.addPixmap(QPixmap('modules/ModuleB-off.png'))
25 25
         self.scene_on = QGraphicsScene()
26 26
         self.scene_on.addPixmap(QPixmap('modules/ModuleB-on.png'))
  27
+        self.scene_nobulb = QGraphicsScene()
  28
+        self.scene_nobulb.addPixmap(QPixmap('modules/ModuleB-nobulb.png'))
27 29
         self.ui.widgetImg.setScene(self.scene_nobat)
28 30
 
29 31
     def read_inputs(self):
30 32
         r = self.dev.read()
31  
-        us = r[1]/1023.0 * 3.3 - 0.095
32  
-        if us < 0.0:
33  
-            us = 0.0
34  
-        uc = r[2]/1023.0 * 3.3 - 0.04
35  
-        if uc < 0.0:
36  
-            uc = 0.0
  33
+        us = r[1]/1023.0 * 3.3
  34
+        uc = r[2]/1023.0 * 3.3
37 35
         i = (us-uc)/18*1000
38 36
         if i < 0.0 or uc == 0.0:
39 37
             i = 0.0
@@ -43,8 +41,10 @@ def read_inputs(self):
43 41
         if us < 1.5:
44 42
             self.ui.widgetImg.setScene(self.scene_nobat)
45 43
         else:
46  
-            if uc < 1:
  44
+            if uc < 0.9:
47 45
                 self.ui.widgetImg.setScene(self.scene_off)
  46
+            elif uc > 2.0:
  47
+                self.ui.widgetImg.setScene(self.scene_nobulb)
48 48
             else:
49 49
                 self.ui.widgetImg.setScene(self.scene_on)
50 50
 
71  software/modules/ModuleC.py
@@ -20,10 +20,11 @@ def __init__(self):
20 20
         self.timer = QTimer()
21 21
         QObject.connect(self.timer, SIGNAL("timeout()"), self.read_inputs)
22 22
 
23  
-        self.data1 = 200*[0.0]
24  
-        self.data2 = 200*[0.0]
  23
+        self.datau = 200*[0.0]
  24
+        self.datai = 200*[0.0]
  25
+        self.current = 0
25 26
 
26  
-        self.mode = ['DC', 'L']
  27
+        self.mode = ['DC', 'C']
27 28
 
28 29
     @pyqtSlot()
29 30
     def on_radioAC_clicked(self):
@@ -54,6 +55,7 @@ def on_radioLC_clicked(self):
54 55
     def on_btnStart_clicked(self):
55 56
         self.ui.btnStart.setEnabled(False)
56 57
         self.ui.btnStop.setEnabled(True)
  58
+        self.current = 3.3
57 59
         if self.mode == ['DC', 'L']:
58 60
             self.dev.setout(1, 1)
59 61
         if self.mode == ['DC', 'C']:
@@ -65,6 +67,7 @@ def on_btnStart_clicked(self):
65 67
     def on_btnStop_clicked(self):
66 68
         self.ui.btnStart.setEnabled(True)
67 69
         self.ui.btnStop.setEnabled(False)
  70
+        self.current = 0.0
68 71
         if self.mode == ['DC', 'L']:
69 72
             self.dev.setout(1, 0)
70 73
         if self.mode == ['DC', 'C']:
@@ -73,45 +76,55 @@ def on_btnStop_clicked(self):
73 76
             self.dev.setout(3, 0)
74 77
 
75 78
     def setup_hw(self):
76  
-        if self.mode == ['DC', 'L']:
77  
-            self.dev.switches(1<<0)
78  
-        if self.mode == ['DC', 'C']:
79  
-            self.dev.switches(1<<1)
80  
-        if self.mode == ['DC', 'LC']:
  79
+        if self.mode == ['DC', 'L']:  # AD6
  80
+            self.dev.switches(1<<5)
  81
+            self.dev.opamp(2, 5, 0)
  82
+        if self.mode == ['DC', 'C']:  # AD5
  83
+            self.dev.switches(1<<4)
  84
+            self.dev.opamp(2, 4, 0)
  85
+        if self.mode == ['DC', 'LC']:  # AD3
81 86
             self.dev.switches(1<<2)
  87
+            self.dev.opamp(2, 2, 0)
82 88
 
83 89
     def setup_scene(self, scene):
84  
-        scene.addLine(-5, 200-0, 610, 200-0)
  90
+        scene.addLine(-5, 100-0, 605, 100-0)
85 91
         scene.addLine(0, 200+5, 0, 200-205)
86  
-        scene.addLine(-5, 200- 50, 10, 200- 50)
87  
-        scene.addLine(-5, 200-100, 10, 200-100)
88  
-        scene.addLine(-5, 200-150, 10, 200-150)
89  
-        scene.addSimpleText('4.0').moveBy(-40,   0-10)
90  
-        scene.addSimpleText('3.0').moveBy(-40,  50-10)
91  
-        scene.addSimpleText('2.0').moveBy(-40, 100-10)
92  
-        scene.addSimpleText('1.0').moveBy(-40, 150-10)
93  
-        scene.addSimpleText('0.0').moveBy(-40, 200-10)
  92
+        scene.addLine(-5, 200-  0, 5, 200-  0)
  93
+        scene.addLine(-5, 200- 50, 5, 200- 50)
  94
+        scene.addLine(-5, 200-100, 5, 200-100)
  95
+        scene.addLine(-5, 200-150, 5, 200-150)
  96
+        scene.addLine(-5, 200-200, 5, 200-200)
94 97
 
95 98
     def tick_DC(self, u, i):
96  
-        self.data1.pop(0)
97  
-        self.data2.pop(0)
98  
-        self.data1.append(u)
99  
-        self.data2.append(i)
  99
+        self.datau.pop(0)
  100
+        self.datai.pop(0)
  101
+        self.datau.append(u)
  102
+        self.datai.append(i)
100 103
         self.scene1 = QGraphicsScene()
101 104
         self.scene2 = QGraphicsScene()
102 105
         self.setup_scene(self.scene1)
103 106
         self.setup_scene(self.scene2)
104  
-        self.scene1.addSimpleText('[U]').moveBy(-39, 220-10)
105  
-        self.scene2.addSimpleText('[I]').moveBy(-39, 220-10)
  107
+        self.scene1.addSimpleText('[U/V]').moveBy(-39, 220-10)
  108
+        self.scene2.addSimpleText('[I/mA]').moveBy(-39, 220-10)
  109
+        self.scene1.addSimpleText('+4.0').moveBy(-40,   0-10)
  110
+        self.scene1.addSimpleText('+2.0').moveBy(-40,  50-10)
  111
+        self.scene1.addSimpleText('  0.0').moveBy(-40, 100-10)
  112
+        self.scene1.addSimpleText('-2.0').moveBy(-40, 150-10)
  113
+        self.scene1.addSimpleText('-4.0').moveBy(-40, 200-10)
  114
+        self.scene2.addSimpleText('+0.4').moveBy(-40,   0-10)
  115
+        self.scene2.addSimpleText('+0.2').moveBy(-40,  50-10)
  116
+        self.scene2.addSimpleText('  0.0').moveBy(-40, 100-10)
  117
+        self.scene2.addSimpleText('-0.2').moveBy(-40, 150-10)
  118
+        self.scene2.addSimpleText('-0.4').moveBy(-40, 200-10)
106 119
         path = QPainterPath()
107  
-        path.moveTo(0,200-self.data1[0]*50)
  120
+        path.moveTo(0,100-self.datau[0]*25)
108 121
         for i in xrange(1,200):
109  
-            path.lineTo(3*(i+1), 200-self.data1[i]*50)
  122
+            path.lineTo(3*(i+1), 100-self.datau[i]*25)
110 123
         self.scene1.addPath(path, QPen(QColor(0,0,255), 3))
111 124
         path = QPainterPath()
112  
-        path.moveTo(0,200-self.data2[0]*50)
  125
+        path.moveTo(0,100-self.datai[0]*25)
113 126
         for i in xrange(1,200):
114  
-            path.lineTo(3*(i+1), 200-self.data2[i]*50)
  127
+            path.lineTo(3*(i+1), 100-self.datai[i]*25)
115 128
         self.scene2.addPath(path, QPen(QColor(0,0,255), 3))
116 129
         self.ui.graph1.setScene(self.scene1)
117 130
         self.ui.graph2.setScene(self.scene2)
@@ -121,7 +134,7 @@ def read_inputs(self):
121 134
 
122 135
         if self.mode[0] == 'DC':
123 136
             u = r[0]/1023.0 * 3.3 # TODO: change this if we change opamp
124  
-            i = 1                 # TODO: read real current
  137
+            i = self.current - r[0]/1023.0 * 3.3
125 138
             self.tick_DC(u, i)
126 139
 
127 140
 class ModuleC():
@@ -134,6 +147,8 @@ def start(self):
134 147
         self.widget.dev = Device()
135 148
         self.widget.setup_hw()
136 149
         self.widget.timer.start(25)
  150
+        self.widget.datau = 200*[0.0]
  151
+        self.widget.datai = 200*[0.0]
137 152
 
138 153
     def stop(self):
139 154
         self.widget.timer.stop()
16  software/modules/ModuleC.ui
@@ -87,7 +87,7 @@
87 87
    <property name="title">
88 88
     <string>Mode</string>
89 89
    </property>
90  
-   <widget class="QRadioButton" name="radioL">
  90
+   <widget class="QRadioButton" name="radioC">
91 91
     <property name="geometry">
92 92
      <rect>
93 93
       <x>10</x>
@@ -97,39 +97,39 @@
97 97
      </rect>
98 98
     </property>
99 99
     <property name="text">
100  
-     <string>L</string>
  100
+     <string>C</string>
101 101
     </property>
102 102
     <property name="checked">
103 103
      <bool>true</bool>
104 104
     </property>
105 105
    </widget>
106  
-   <widget class="QRadioButton" name="radioC">
  106
+   <widget class="QRadioButton" name="radioLC">
107 107
     <property name="geometry">
108 108
      <rect>
109 109
       <x>10</x>
110  
-      <y>60</y>
  110
+      <y>90</y>
111 111
       <width>51</width>
112 112
       <height>26</height>
113 113
      </rect>
114 114
     </property>
115 115
     <property name="text">
116  
-     <string>C</string>
  116
+     <string>LC</string>
117 117
     </property>
118 118
     <property name="checked">
119 119
      <bool>false</bool>
120 120
     </property>
121 121
    </widget>
122  
-   <widget class="QRadioButton" name="radioLC">
  122
+   <widget class="QRadioButton" name="radioL">
123 123
     <property name="geometry">
124 124
      <rect>
125 125
       <x>10</x>
126  
-      <y>90</y>
  126
+      <y>60</y>
127 127
       <width>51</width>
128 128
       <height>26</height>
129 129
      </rect>
130 130
     </property>
131 131
     <property name="text">
132  
-     <string>LC</string>
  132
+     <string>L</string>
133 133
     </property>
134 134
     <property name="checked">
135 135
      <bool>false</bool>

0 notes on commit 19bd37a

Please sign in to comment.
Something went wrong with that request. Please try again.