]> rtime.felk.cvut.cz Git - eurobot/public.git/commitdiff
disp: final display layout
authorMartin Zidek <zidekm1@gmail.com>
Mon, 13 Apr 2009 15:30:27 +0000 (17:30 +0200)
committerMartin Zidek <zidekm1@gmail.com>
Mon, 13 Apr 2009 15:30:27 +0000 (17:30 +0200)
src/disp-4dgl/control_new.4dg

index b239091b45e06b7c4a9725c9398b27d905d10399..23f5c43103795624e5075dea69222db110c16610 100644 (file)
@@ -48,6 +48,9 @@ var fsm_state[20];
 var fsm_state_len;\r
 var move_fsm_state[20];\r
 var move_fsm_state_len;\r
+\r
+var lift_pos;\r
+var pucks_nr;\r
 
 func init()\r
     var idx;\r
@@ -79,6 +82,9 @@ func init()
         voltageBAT[idx]:=' ';\r
         idx++;\r
     until(idx == 5);\r
+    \r
+    lift_pos:=0;\r
+    pucks_nr:=0;\r
 endfunc\r
 \r
 
@@ -236,7 +242,7 @@ func update_fsm_state()
     repeat
         putch(fsm_state[idx]);
         idx++;
-    until(idx==fsm_state_len)
+    until(idx==20)
     return 0;
 endfunc
 
@@ -250,7 +256,7 @@ func update_move_fsm_state()
     repeat\r
         putch(move_fsm_state[idx]);\r
         idx++;\r
-    until(idx==move_fsm_state_len)\r
+    until(idx==20)\r
     return 0;\r
 endfunc\r
 \r
@@ -416,13 +422,48 @@ func draw_hw()
     draw_hw6a(HW_STATUS_OK);\r
     return 0;\r
 endfunc\r
-
+\r
+func update_pucks()\r
+    txt_Set(FONT_SIZE, FONT4);\r
+    txt_MoveCursor(9, 3);           // move the cursor to line 4, column 5\r
+    txt_Set(TEXT_COLOUR, LEMONCHIFFON);\r
+    print([DEC]pucks_nr);\r
+endfunc\r
+\r
+func draw_pucks()\r
+    txt_Set(FONT_SIZE, FONT3);\r
+    txt_MoveCursor(10, 1);           // move the cursor to line 4, column 5\r
+    txt_Set(TEXT_COLOUR, GRAY);\r
+    \r
+    putstr("PUCKS nr.");\r
+    update_pucks();\r
+endfunc\r
+\r
+func update_lift()\r
+    txt_Set(FONT_SIZE, FONT4);\r
+    txt_MoveCursor(9, 15);           // move the cursor to line 4, column 5\r
+    txt_Set(TEXT_COLOUR, LEMONCHIFFON);\r
+    print([DEC]lift_pos);\r
+endfunc\r
+\r
+func draw_lift()\r
+    txt_Set(FONT_SIZE, FONT3);\r
+    txt_MoveCursor(10, 20);           // move the cursor to line 4, column 5\r
+    txt_Set(TEXT_COLOUR, GRAY);\r
+    \r
+    putstr("LIFT pos.");\r
+    update_lift();\r
+endfunc\r
+    
 func draw_status() 
     clear_screen();
     txt_Set(FONT_SIZE, FONT3);
     txt_MoveCursor(0, 12);           // move the cursor to line 4, column 5
     txt_Set(TEXT_COLOUR, GRAY);
-    draw_voltage(); 
+    draw_voltage(); \r
+    draw_fsm_state(); \r
+    draw_pucks();\r
+    draw_lift();
     draw_position();\r
     draw_hw();
     return 0;
@@ -437,9 +478,12 @@ func process_msg()
         mem_Copy(msg_rcvd+10, voltage80, 8);\r
         mem_Copy(msg_rcvd+14, voltageBAT, 10);\r
         \r
-        mem_Copy(msg_rcvd+21, position, 14);\r
+        mem_Copy(msg_rcvd+21, position, 16);\r
+        \r
+        mem_Copy(msg_rcvd+35, fsm_state, 40);\r
+        mem_Copy(msg_rcvd+57, move_fsm_state, 40);\r
         \r
-        if(msg_rcvd[31]==0)\r
+        if(msg_rcvd[81]==0)\r
             game_color := LIGHTGREEN;\r
         else\r
             game_color := RED;\r
@@ -450,6 +494,8 @@ func process_msg()
         draw_voltage80();\r
         draw_voltageBAT();\r
         draw_position();\r
+        update_fsm_state();\r
+        update_move_fsm_state();\r
     endif\r
         
 endfunc
@@ -470,9 +516,9 @@ func get_msg()
             break;
         endif\r
     forever
-//    until((in==MSG_TERM)||(idx==MSG_BUFF_LEN))
+\r
     msg_len := idx;\r
-    com_Init(msg_buff, 40, ':');
+    com_Init(msg_buff, MSG_BUFF_LEN, ':');
 
     process_msg();
     return 0;