Добавлено время операций с панели
This commit is contained in:
parent
9624d91725
commit
65ae324803
19
emulator.cpp
19
emulator.cpp
@ -22,6 +22,25 @@ char button_unload = 0;
|
||||
char button_unload_end = 0;
|
||||
char button_unload_remove = 0;
|
||||
|
||||
// времена операций для барабанов, устанавливается индивидуально каждому барабану
|
||||
short hla_time_degreasing = 12;
|
||||
short hla_time_washing_1a = 4;
|
||||
short hla_time_washing_1b = 6;
|
||||
short hla_time_etching = 25;
|
||||
short hla_time_washing_2a = 6;
|
||||
short hla_time_washing_2b = 8;
|
||||
short hla_time_galvanizing = 60;
|
||||
short hla_time_washing_3a = 8;
|
||||
short hla_time_washing_3b = 10;
|
||||
short hla_time_passivation = 3;
|
||||
short hla_time_washing_4a = 12;
|
||||
short hla_time_washing_4b = 14;
|
||||
|
||||
// времена скапывания, одинаковые для всех барабанов
|
||||
short hla_time_digging = 8;
|
||||
short hla_time_reagent = 30;
|
||||
short hla_time_washing_1 = 3;
|
||||
short hla_time_washing_2 = 20;
|
||||
|
||||
static const int ROWS = 10;
|
||||
static const int COLS = 23 * 5 + 1;
|
||||
|
20
emulator.h
20
emulator.h
@ -44,6 +44,26 @@ extern char button_unload_remove;
|
||||
|
||||
// Переменные, которые надо добавить в C Global variables
|
||||
|
||||
// времена для барабанов, нужно копировать их только при создании барабанов
|
||||
extern short hla_time_degreasing;
|
||||
extern short hla_time_washing_1a;
|
||||
extern short hla_time_washing_1b;
|
||||
extern short hla_time_etching;
|
||||
extern short hla_time_washing_2a;
|
||||
extern short hla_time_washing_2b;
|
||||
extern short hla_time_galvanizing;
|
||||
extern short hla_time_washing_3a;
|
||||
extern short hla_time_washing_3b;
|
||||
extern short hla_time_passivation;
|
||||
extern short hla_time_washing_4a;
|
||||
extern short hla_time_washing_4b;
|
||||
|
||||
// времена скапывания, одинаковые для всех барабанов
|
||||
extern short hla_time_digging;
|
||||
extern short hla_time_reagent;
|
||||
extern short hla_time_washing_1;
|
||||
extern short hla_time_washing_2;
|
||||
|
||||
|
||||
// lock-зоны, нельзя двигаться за них и за робота
|
||||
extern short robot1_lock_zone;
|
||||
|
32
scheduler.c
32
scheduler.c
@ -243,18 +243,18 @@ struct barrel makeBarrel(short flags, short zone, short timer) {
|
||||
b.flags.raw_word = flags;
|
||||
b.zone = zone;
|
||||
b.software_timer = timer;
|
||||
b.time_degreasing = 12;
|
||||
b.time_washing_1a = 4;
|
||||
b.time_washing_1b = 6;
|
||||
b.time_etching = 25;
|
||||
b.time_washing_2a = 6;
|
||||
b.time_washing_2b = 8;
|
||||
b.time_galvanizing = 60;
|
||||
b.time_washing_3a = 8;
|
||||
b.time_washing_3b = 10;
|
||||
b.time_passivation = 3;
|
||||
b.time_washing_4a = 12;
|
||||
b.time_washing_4b = 14;
|
||||
b.time_degreasing = hla_time_degreasing;
|
||||
b.time_washing_1a = hla_time_washing_1a;
|
||||
b.time_washing_1b = hla_time_washing_1b;
|
||||
b.time_etching = hla_time_etching;
|
||||
b.time_washing_2a = hla_time_washing_2a;
|
||||
b.time_washing_2b = hla_time_washing_2b;
|
||||
b.time_galvanizing = hla_time_galvanizing;
|
||||
b.time_washing_3a = hla_time_washing_3a;
|
||||
b.time_washing_3b = hla_time_washing_3b;
|
||||
b.time_passivation = hla_time_passivation;
|
||||
b.time_washing_4a = hla_time_washing_4a;
|
||||
b.time_washing_4b = hla_time_washing_4b;
|
||||
return b;
|
||||
}
|
||||
|
||||
@ -426,6 +426,7 @@ void create_operation(const short target_task, const struct scheduler_task* task
|
||||
code->code[cmd_index++] = ROBOT_CMD_TMR_SET(barrels[target_task].time_passivation);
|
||||
|
||||
code->code[cmd_index++] = ROBOT_CMD_UP_WITH_BARREL();
|
||||
code->code[cmd_index++] = ROBOT_CMD_WAIT(hla_time_digging);
|
||||
code->code[cmd_index++] = ROBOT_CMD_MOVE_TO_ZONE_WITH_BARREL(ZONE_WASHING_4A);
|
||||
code->code[cmd_index++] = ROBOT_CMD_DOWN_WITH_BARREL();
|
||||
|
||||
@ -461,8 +462,7 @@ void create_operation(const short target_task, const struct scheduler_task* task
|
||||
case ZONE_GALVANIZING_7:
|
||||
case ZONE_GALVANIZING_8:
|
||||
// время скапывания реактивов
|
||||
// TODO добавить переменные времен скапывания
|
||||
code->code[cmd_index++] = ROBOT_CMD_WAIT(30);
|
||||
code->code[cmd_index++] = ROBOT_CMD_WAIT(hla_time_reagent);
|
||||
break;
|
||||
|
||||
case ZONE_WASHING_1A:
|
||||
@ -470,7 +470,7 @@ void create_operation(const short target_task, const struct scheduler_task* task
|
||||
case ZONE_WASHING_3A:
|
||||
case ZONE_WASHING_4A:
|
||||
// время скапывания 1-го каскада промывок
|
||||
code->code[cmd_index++] = ROBOT_CMD_WAIT(3);
|
||||
code->code[cmd_index++] = ROBOT_CMD_WAIT(hla_time_washing_1);
|
||||
break;
|
||||
|
||||
case ZONE_WASHING_1B:
|
||||
@ -478,7 +478,7 @@ void create_operation(const short target_task, const struct scheduler_task* task
|
||||
case ZONE_WASHING_3B:
|
||||
case ZONE_WASHING_4B:
|
||||
// время скапывания 2-го каскада промывок
|
||||
code->code[cmd_index++] = ROBOT_CMD_WAIT(20);
|
||||
code->code[cmd_index++] = ROBOT_CMD_WAIT(hla_time_washing_2);
|
||||
break;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user