Skip to content

Commit

Permalink
feat: compiler console
Browse files Browse the repository at this point in the history
Signed-off-by: rokamu623 <r.okamura.061@ms.saitama-u.ac.jp>
  • Loading branch information
rokamu623 committed Feb 26, 2023
1 parent d859526 commit cd7deda
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
11 changes: 6 additions & 5 deletions HowToDAGScheduling/Compiler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,25 +4,26 @@
Compiler::Compiler()
{
_console_field = Rect(LAYOUT::MERGIN * Point(2, 1) + LAYOUT::DAG_SPACE_SIZE * Point(1, 0), LAYOUT::CONSOLE_SPACE_SIZE);
_font = Font(16);
}

void Compiler::compile(DAG& dag, SchedGrid& grid)
{
ClearPrint();
CompileLog grid_log = grid.compile(dag);
CompileLog dag_log = dag.compile(grid);
if (grid_log._success != true || dag_log._success != true)
{
Print << U"Compile Failer";
_message.append(U"Compile Failer\n");
if (grid_log._success != true)
Print << grid_log._message;
_message.append(grid_log._message);
if (dag_log._success != true)
Print << dag_log._message;
_message.append(dag_log._message);
}
else
Print << U"Compile Success";
_message.append(U"Compile Success");
}

void Compiler::draw()
{
_font(_message).draw(_console_field);
}
3 changes: 2 additions & 1 deletion HowToDAGScheduling/Compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ class Compiler
{
private:
Rect _console_field;
Font _font;
String _message;
public:
Compiler();

void compile(DAG& dag, SchedGrid& grid);


void draw_field() { _console_field.draw(LAYOUT::FIELD_COLOR); };
void draw();
};
Expand Down

0 comments on commit cd7deda

Please sign in to comment.