Commits

iorodeo committed daef54e

Modified how ir light value is updated via sijax.

  • Participants
  • Parent commits 2815afe

Comments (0)

Files changed (2)

File lia_web_interface/src/lia_web_interface/templates/capture.html

 </script>
 <script type="text/javascript">
     setTimeout(function() {
-        Sijax.request('update_recording_button');
+        var irLightInput = document.getElementById('ir_light_input');
+        Sijax.request('update_recording_button',[irLightInput.value]);
         setTimeout(arguments.callee,500);
     }, 500);
 </script>
     <br>
 
     <div style="text-align:left;"> 
-        IR Light (Ch B) <input name="ir_light_input" id="ir_light_input" size="3" value="{{ir_light_value}}" onKeyPress="return numbersonly(this,event)" onChange="handleChange(this)"\>
-        mA
+        IR Light (Ch B) 
+        <input name="ir_light_input" id="ir_light_input" size="3" value="{{ir_light_value}}" onKeyPress="return numbersonly(this,event)" onBlur="handleChange(this)" onChange="handleChange(this)"\>
+        &nbsp; &nbsp; <label id="ir_light_value"> </label> mA
         <br> <br> <br>
         <button  name="recording_button" id="recording_button" onclick="Sijax.request('start_stop_recording');">{{recording_button_text}} </button>
         &nbsp;
     </div>
 
 </div>
+
+<p id="develop"> </p>
 {% endblock %}

File lia_web_interface/src/lia_web_interface/web_interface.py

 
 # Sijax request handlers 
 # ----------------------------------------------------------------------------------
-def update_recording_button(obj_response):
+def update_recording_button(obj_response, ir_light_value_new):
     """
     Handles update request for the recording button text - keeps different clients in 
     sync.
     recording_flag = db_tools.get_bool(db,'recording_flag')
     trial_values = db_tools.get_dict(db,'trial_values')
     log_values = db_tools.get_dict(db,'log_values')
+    ir_light_value = db_tools.get_int(db,'ir_light_value')
 
     # Update recording button
     recording_button_text = display_tools.get_recording_button_text(recording_flag)
     obj_response.html("#recording_button",recording_button_text)
 
+    # Update ir light value
+    obj_response.html('#ir_light_value', ir_light_value)
+
     # Update trial and log values
     trial_display = display_tools.get_trial_display(trial_values)
     for item in trial_display: