Exemple #1
0
/// Generates the truth table.
void MainWindow::generate()
{
    delete_columns();

    get_variables();

    FunctionParser p;
    switch(m_mode)
    {
    case Function:
        char func[128];
        Edit_GetText(m_hWndFunction, func, 128);

        try {
            p = FunctionParser(m_variables, func);
        } catch(FunctionParser::FunctionParserException& e) {
            MessageBox(e.what(), "Function Parser Error", MB_OK | MB_ICONERROR);
            return;
        }

        build_table(&p);
        break;
    case Minterm:
        break;
    case Maxterm:
        break;
    }
}
Exemple #2
0
void delete_screen(screen_t* s)
{
  assert(s);
  free(s->name);
  free(s->desc);
  delete_counters(s->counters, s->num_counters);
  delete_columns(s->columns, s->num_columns);
  free(s);
}
Exemple #3
0
/// Clears all control values
void MainWindow::clear_controls()
{
    SetWindowText(m_hWndVariables, "");
    SetWindowText(m_hWndFunction, "");
    SetWindowText(m_hWndMinterms, "");
    SetWindowText(m_hWndMaxterms, "");

    delete_columns();
}