void KSimExponentStep::setNewSteps(double step1, double step2, double step3,
                                   double step4, double step5, double step6,
                                   double step7, double step8, double step9,
                                   double step10)
{
	clearSteps();
	
	if(step1  != -1) appendStepInternal(step1 ); else return;
	if(step2  != -1) appendStepInternal(step2 ); else return;
	if(step3  != -1) appendStepInternal(step3 ); else return;
	if(step4  != -1) appendStepInternal(step4 ); else return;
	if(step5  != -1) appendStepInternal(step5 ); else return;
	if(step6  != -1) appendStepInternal(step6 ); else return;
	if(step7  != -1) appendStepInternal(step7 ); else return;
	if(step8  != -1) appendStepInternal(step8 ); else return;
	if(step9  != -1) appendStepInternal(step9 ); else return;
	if(step10 != -1) appendStepInternal(step10); else return;
}
Esempio n. 2
0
static void in_recv_handler(DictionaryIterator *iter, void *context) {
  // Read tuple for data
  Tuple *temp_tuple = dict_find(iter, KEY_TEMPERATURE);
  Tuple *jsr_tuple = dict_find(iter, KEY_JSREADY);

  if (temp_tuple) {
    weatherTemp = (int)temp_tuple->value->int32;
    hasWeather = true;
    layer_mark_dirty(s_canvas_layer);
  } else if (jsr_tuple) {
    // Send weather pref to js
    send_initial_js_message();
  } else {
    Tuple *t = dict_read_first(iter);
    while(t) {
      persist_write_bool(t->key, strcmp(t->value->cstring, "true") == 0 ? true : false);
      t = dict_read_next(iter);
    }
  
    // Refresh live store
    config_init();
    vibes_short_pulse();
  }
  
  
  /* Update display based on new config data */
  if (!config_get(PERSIST_KEY_DATE)) {
    clearDate();
  } else {
    update_time();
  }
  if (!config_get(PERSIST_KEY_STEPS)) {
    clearSteps();
  } else {
    updateStepsLabel();
  }
  
  send_initial_js_message();
  
  setLayerTextColors();
  setLayerFonts();
  layer_mark_dirty(s_canvas_layer);
}