コード例 #1
0
void Display::showPour(float p, boolean isOz) {
  String s = String(p, 1);
  s.concat(isOz ? "oz" : "L");
  writeCenter(2, s, String("Enjoy!"));

  lastMessageTs = millis();
  lastMessageDelay = pourMessageDelay;
}
コード例 #2
0
ファイル: Terminal.cpp プロジェクト: arvidsson/Terminal
void Terminal::drawBoxWithTitle(int x0, int y0, int x1, int y1, Color const& boxColor, std::string const& title, Color const& titleColor)
{
    drawBox(x0, y0, x1, y1, boxColor);
    writeCenter(title, y0 + 1, titleColor);
    drawHLine(x0 + 1, x1 - 1, y0 + 2, boxColor);
    write(195, x0, y0 + 2);
    write(180, x1, y0 + 2);
}
コード例 #3
0
void Display::showTemp(float t, bool isF) {
  if (millis() - lastMessageTs < lastMessageDelay)
    return;

  String s = String(t, 0);
  s.concat(isF ? "F" : "C"); // TODO: add a degrees symbol (ascii 248)

  writeCenter(3, s);
}
コード例 #4
0
/*Defined as passValue !*/
void f_passValue(char* whatColumn, int* returnSuccess)
{
    WINDOW *pass_win;
    pass_win = newwin(HEIGHT_INT, WIDTH_WIN, 1, 1);
    bgchange(pass_win, COLOR_WHITE, COLOR_CYAN, 97);
    wattron(pass_win, COLOR_PAIR(97));
    char value[70];

    if (strcmp (whatColumn, "column1") == 0)
    {
        printCenter (pass_win, 4, "Enter the value for column 1", 1);
        if (writeCenter(pass_win, 6, value) == TRUE)
        {
            strcpy (v_column1, value);
            *returnSuccess = 1;
        }
    }
    else if (strcmp (whatColumn, "column2") == 0)
    {
        printCenter(pass_win, 4, "Enter the value for column 2", 1);
        if (writeCenter(pass_win, 6, value) == TRUE)
        {
            strcpy (v_column2, value);
            *returnSuccess = 2;
        }
    }
    else if (strcmp (whatColumn, "column3") == 0)
    {
        printCenter(pass_win, 4, "Enter the value for column 3", 1);
        if (writeCenter(pass_win, 6, value) == TRUE)
        {
            strcpy (v_column3, value);
            *returnSuccess = 3;
        }
    }
    else if (strcmp (whatColumn, "column4") == 0)
    {
        printCenter(pass_win, 4, "Enter the value for column 4", 1);
        if (writeCenter(pass_win, 6, value) == TRUE)
        {
            strcpy (v_column4, value);
            *returnSuccess = 4;
        }
    }
    else if (strcmp (whatColumn, "column5") == 0)
    {
        printCenter(pass_win, 4, "Enter the value for column 5", 1);
        if (writeCenter(pass_win, 6, value) == TRUE)
        {
            strcpy (v_column5, value);
            *returnSuccess = 5;
        }
    }
    else
        assert (!TRUE);
    /*Revert to previous window*/
    silenceOn();
    wattroff(pass_win, COLOR_PAIR(97));
    bgchange(pass_win, COLOR_CYAN, COLOR_WHITE, 96);
    delwin(pass_win);
    interactif_win = newwin(HEIGHT_INT, WIDTH_WIN, 1, 1);
    wattron(interactif_win, COLOR_PAIR(1));
    draw(board);
}
コード例 #5
0
void Display::showNoPour() {
  writeCenter(2, String("No Pour"));

  lastMessageTs = millis();
  lastMessageDelay = noPourMessageDelay;
}
コード例 #6
0
void Display::showPouring(float p, boolean isOz) {
  String s = String(p, 1);
  s.concat(isOz ? "oz" : "L");
  writeCenter(2, s);
}
コード例 #7
0
ファイル: Terminal.cpp プロジェクト: arvidsson/Terminal
void Terminal::writeCenter(std::string const& str, int y, Color fgColor)
{
    writeCenter(str, y, fgColor, backgroundColor);
}