Esempio n. 1
0
void WM_Paint(WM_HWIN hObj) {
  WM_MESSAGE Msg;
  WM_SelectWindow(hObj);
  WM_ValidateWindow(hObj);
  WM_SetDefault();
  Msg.MsgId  = WM_PAINT;
  Msg.Data.p = NULL;
  WM_SendMessage(hObj, &Msg);
}
Esempio n. 2
0
/*********************************************************************
*
*       GUIDEMO_HideInfoWin
*/
void GUIDEMO_HideInfoWin(void) {
  WM_HideWindow(_hDialogInfo);
  WM_ValidateWindow(WM_HBKWIN);
}
Esempio n. 3
0
/*********************************************************************
*
*       GUIDEMO_HideControlWin
*/
void GUIDEMO_HideControlWin(void) {
  WM_HideWindow(_hDialogControl);
  WM_ValidateWindow(WM_HBKWIN);
}
Esempio n. 4
0
static void _Show_Sensor_Graph(GRAPH_Handle hGraph, GRAPH_DATA_Handle hData[])
{
  int xSize      = LCD_GetXSize();
  int Data_xSize = xSize - (DIST_TO_BORDER << 1) - (BORDER_LEFT + BORDER_RIGHT);
  int Count      = 0;

  //
  // Attach data objects
  //
  GRAPH_AttachData(hGraph, hData[0]);
  GRAPH_AttachData(hGraph, hData[1]);
  GRAPH_AttachData(hGraph, hData[2]);
  //
  // Add values before GRAPH is displayed
  //
  while (Count < Data_xSize) {
    GRAPH_DATA_YT_AddValue(hData[0], (I16)0);
    GRAPH_DATA_YT_AddValue(hData[1], (I16)0);
    GRAPH_DATA_YT_AddValue(hData[2], (I16)0);
    Count++;
  }

  sensor_all_open();

  // uint32_t lux_senser;
  // get_als_data(&lux_senser);
  int32_t x,y,z;
  uint32_t setp;
  //
  // Add values depending on time
  //
  // int TimeStart, TimeDiff, TimeStep;
  // int NextState, Flag;
  // lighten GS LED
  hal_gpio_output_low(&brd_gpio_table[GPIO_LED_GS]);

  // TimeStart = GUIDEMO_GetTime();
  int Flag = 1;
  do {
    get_acc_data(&x,&y,&z,&setp);
    // TimeDiff = GUIDEMO_GetTime() - TimeStart;
    GRAPH_DATA_YT_AddValue(hData[0], ((I16)x >> 5) + 78);
    GRAPH_DATA_YT_AddValue(hData[1], ((I16)y >> 5) + 78);
    GRAPH_DATA_YT_AddValue(hData[2], ((I16)z >> 5) + 78);

    if (Flag) {
      Flag = 0;
      GUI_Exec();
      GRAPH_DetachScale(hGraph, _hScaleH_sensor);
      GRAPH_DetachScale(hGraph, _hScaleV_sensor);
      WM_ValidateWindow(hGraph);
    }
    /*
    NextState = GUIDEMO_CheckCancel();
    TimeStep  = GUIDEMO_GetTime() - TimeStart;
    if ((TimeStep - TimeDiff) < TIME_STEP) {
      GUI_Delay(TIME_STEP - (TimeStep - TimeDiff));
    }*/
    GUI_Delay(100);
  } while (key_flag == GUI_DEMO_PAGE_3);

  GRAPH_DetachData(hGraph, hData[0]);
  GRAPH_DetachData(hGraph, hData[1]);
  GRAPH_DetachData(hGraph, hData[2]);

  // GUIDEMO_NotifyStartNext();

  // shutdown GS LED
  hal_gpio_output_high(&brd_gpio_table[GPIO_LED_GS]);
}