Permalink
Browse files

split graphs.

  • Loading branch information...
1 parent cca0b47 commit a48ae3190facbae1a4543ebf1aa628fd9955d970 @eastein committed Sep 26, 2012
Showing with 31 additions and 13 deletions.
  1. +25 −13 chillmon
  2. +6 −0 interface.html
View
38 chillmon
@@ -57,16 +57,22 @@ class PID(object) :
@property
def state(self) :
return {
- 'kp' : nv(self.fKP),
- 'ki' : nv(self.fKI),
- 'kd' : nv(self.fKD),
- 'err' : nv(self.fError),
- 'ierr' : nv(self.fIError),
- 'derr' : nv(self.fDError),
- 'p' : nv(self.fP),
- 'i' : nv(self.fI),
- 'd' : nv(self.fD),
- 'pid' : nv(self.fPID)
+ 'constants' : {
+ 'kp' : nv(self.fKP),
+ 'ki' : nv(self.fKI),
+ 'kd' : nv(self.fKD),
+ },
+ 'errors' : {
+ 'err' : nv(self.fError),
+ 'ierr' : nv(self.fIError),
+ 'derr' : nv(self.fDError),
+ },
+ 'pidstate' : {
+ 'p' : nv(self.fP),
+ 'i' : nv(self.fI),
+ 'd' : nv(self.fD),
+ 'pid' : nv(self.fPID)
+ }
}
def step(self) :
@@ -151,10 +157,16 @@ class ChillmonBot(mediorc.IRC) :
def do_work(self) :
if self.zmqpub :
- self.zmqpub.send({
- 'temps' : dict([(k,v.read()) for k,v in self.temp_probes.items()] + [('run_avg', self.pid.fTemp), ('target', self.pid.target)]),
- 'pidstate' : self.pid.state
+ self.zmqpub.send(
+ ret = {
+ 'temps' : dict(
+ [(k,v.read()) for k,v in self.temp_probes.items()]
+ + [('run_avg', self.pid.fTemp), ('target', self.pid.target)]
+ )
})
+ ret.update(self.pid.state)
+ self.zmqpub.send(ret)
+
"""
self.fKP = 0.02
self.fKI = 0.002
View
6 interface.html
@@ -96,6 +96,12 @@
<h4>PID States</h4>
<canvas id="pidstate" width="900" height="200"></canvas>
+
+ <h4>Constants</h4>
+ <canvas id="constants" width="900" height="200"></canvas>
+
+ <h4>Errors</h4>
+ <canvas id="errors" width="900" height="200"></canvas>
</body>
</html>

0 comments on commit a48ae31

Please sign in to comment.