<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>web/app/views/cooks/_adjustment.html.erb</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -1,6 +1,7 @@
 web/log/*.log
 web/db/*.db
 web/db/*.sqlite3
+web/db/*.sqlite3-journal
 tmp/**/*
 web/doc/api
 web/doc/app</diff>
      <filename>.gitignore</filename>
    </modified>
    <modified>
      <diff>@@ -12,6 +12,7 @@ class CooksController &lt; ApplicationController
   end
 
   def show
+    @adjustments = @cook.adjustments.find(:all, :order =&gt; &quot;created_at DESC&quot;)
     @refresh = true
     
     params[:range] ||= @cook.running? ? &quot;last&quot; : &quot;all&quot;</diff>
      <filename>web/app/controllers/cooks_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -8,6 +8,24 @@ class Adjustment &lt; ActiveRecord::Base
   
   before_create :update_sensor
   
+  def differences
+    differences = {}
+
+    last_adjustment = self.sensor.adjustments.find(:first, :conditions =&gt; [&quot;created_at &lt; ?&quot;, self.created_at], :order =&gt; &quot;created_at DESC&quot;)
+    
+    [:target, :alarm, :low, :high, :blower].each do |setting|
+      if last_adjustment
+        if self.send(setting) != last_adjustment.send(setting)
+          differences[setting] = {:old =&gt; last_adjustment.send(setting), :new =&gt; self.send(setting)}
+        end
+      else
+        differences[setting] = {:old =&gt; &quot;unknown&quot;, :new =&gt; self.send(setting)} unless self.send(setting) == nil
+      end
+    end
+
+    differences
+  end
+  
   private
   
   def update_sensor
@@ -22,5 +40,5 @@ class Adjustment &lt; ActiveRecord::Base
       errors.add_to_base &quot;Failed to update sensor&quot;
       false
     end
-  end
+  end  
 end</diff>
      <filename>web/app/models/adjustment.rb</filename>
    </modified>
    <modified>
      <diff>@@ -9,6 +9,10 @@ class Blower &lt; ActiveRecord::Base
 
   before_update :update_net_stoker
 
+  def to_s
+    self.name
+  end
+
   def update_net_stoker
     if !Stoker.skip_update and (self.changed &amp; [&quot;name&quot;, &quot;sensor_id&quot;]).size &gt; 0
       # spawn do</diff>
      <filename>web/app/models/blower.rb</filename>
    </modified>
    <modified>
      <diff>@@ -46,6 +46,7 @@ class Cook &lt; ActiveRecord::Base
     Stoker.no_update do
       Cook.transaction do
         begin
+          puts &quot;--------------&gt; #{self.sensors.size}&quot;
           self.sensors.each do |sensor|
             adjustment = self.adjustments.build(
               :sensor_id  =&gt; sensor.id,</diff>
      <filename>web/app/models/cook.rb</filename>
    </modified>
    <modified>
      <diff>@@ -22,10 +22,23 @@
 &lt;/p&gt;
 
 &lt;% if @cook.running? -%&gt;
-  &lt;%= render :partial =&gt; &quot;/sensors/list&quot;, :locals =&gt; {:sensors =&gt; @cook.sensors, :cook =&gt; @cook} %&gt;
-  &lt;br/&gt;
+  &lt;p&gt;&lt;%= render :partial =&gt; &quot;/sensors/list&quot;, :locals =&gt; {:sensors =&gt; @cook.sensors, :cook =&gt; @cook} %&gt;&lt;/p&gt;
 &lt;% end -%&gt;
 
+&lt;p id=&quot;show_adjustments&quot;&gt;
+  &lt;%= link_to_function &quot;Show Adjustments&quot;, &quot;$('adjustments').show();$('show_adjustments').hide();&quot; %&gt;
+&lt;/p&gt;
+
+&lt;div id=&quot;adjustments&quot; style=&quot;display:none&quot;&gt;
+  &lt;p id=&quot;hide_adjustments&quot;&gt;
+    &lt;%= link_to_function &quot;Hide Adjustments&quot;, &quot;$('adjustments').hide();$('show_adjustments').show();&quot; %&gt;
+  &lt;/p&gt;
+
+  &lt;hr/&gt;
+
+  &lt;%= render :partial =&gt; &quot;adjustment&quot;, :collection =&gt; @adjustments %&gt;
+&lt;/div&gt;
+
 &lt;% form_tag cook_path(@cook), :method =&gt; :get do %&gt;
   &lt;%= radio_button_tag :range, &quot;last&quot;, params[:range] == &quot;last&quot;, :onclick =&gt; &quot;$('range_select').hide();&quot; %&gt; Last &lt;%= text_field_tag :hours, params[:hours], :size =&gt; &quot;2&quot;, :maxlength =&gt; &quot;2&quot; %&gt; Hours
   &lt;%= radio_button_tag :range, &quot;all&quot;, params[:range] == &quot;all&quot;, :onclick =&gt; &quot;$('range_select').hide();&quot; %&gt; All</diff>
      <filename>web/app/views/cooks/show.html.erb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>45cca037d20c903e09c50304381a45a3d48aa22a</id>
    </parent>
  </parents>
  <author>
    <name>Tony Buser</name>
    <email>tbuser@gmail.com</email>
  </author>
  <url>http://github.com/tbuser/stoker/commit/e036d5df2b3d9b88bec26e6e7eb162296c3ecbcf</url>
  <id>e036d5df2b3d9b88bec26e6e7eb162296c3ecbcf</id>
  <committed-date>2008-07-07T11:47:04-07:00</committed-date>
  <authored-date>2008-07-07T11:47:04-07:00</authored-date>
  <message>more work on cook adjustments (something not working right as it doesn't create all the initial adjustments...)</message>
  <tree>7fbc4e2f63aa8266d7a03b0d7e4fde0414bcc4d8</tree>
  <committer>
    <name>Tony Buser</name>
    <email>tbuser@gmail.com</email>
  </committer>
</commit>
