svghmi/svghmi.js
branchsvghmi
changeset 2802 64e6f73b9859
parent 2801 390acff12755
child 2803 f48121cf31b6
equal deleted inserted replaced
2801:390acff12755 2802:64e6f73b9859
   127                 new_period = 1000/maxfreq;
   127                 new_period = 1000/maxfreq;
   128         }
   128         }
   129 
   129 
   130         if(previous_period != new_period) {
   130         if(previous_period != new_period) {
   131             subscriptions[index] = new_period;
   131             subscriptions[index] = new_period;
   132             delta.push(new Blob([
   132             delta.push(
   133                 new Uint8Array([2]), /* subscribe = 2 */
   133                 new Uint8Array([2]), /* subscribe = 2 */
   134                 new Uint32Array([index]), 
   134                 new Uint32Array([index]), 
   135                 new Uint16Array([new_period])]));
   135                 new Uint16Array([new_period]));
   136         }
   136         }
   137         
   137         
   138     }
   138     }
   139     send_blob(delta);
   139     send_blob(delta);
   140 };
   140 };
   141 
   141 
   142 function send_hmi_value(index, value) {
   142 function send_hmi_value(index, value) {
   143     iectype = hmitree_types[index];
   143     let iectype = hmitree_types[index];
   144     jstype = typedarray_types[iectype];
   144     let jstype = typedarray_types[iectype];
   145     send_blob([
   145     send_blob([
   146         new Uint8Array([0]),  /* setval = 0 */
   146         new Uint8Array([0]),  /* setval = 0 */
   147         new jstype([value])
   147         new Uint32Array([index]), 
   148         ]);
   148         new jstype([value])]);
   149 
   149 
   150 };
   150 };
   151 
   151 
   152 function change_hmi_value(index, opstr) {
   152 function change_hmi_value(index, opstr) {
   153     let op = opstr[0];
   153     let op = opstr[0];