Добавление поддержки функции повторного цинкования в планировщик
This commit is contained in:
parent
66c69f4e0f
commit
929a95504f
17
utils.c
17
utils.c
@ -90,8 +90,17 @@ short _get_dest_zone(struct barrel *bar, char robot_id) {
|
|||||||
|
|
||||||
switch (bar->zone) {
|
switch (bar->zone) {
|
||||||
case ZONE_LOAD_2:
|
case ZONE_LOAD_2:
|
||||||
// загрузка 2, только в нее можно грузить новые барабаны, нужно обезжиривание
|
// загрузка 2, только в нее можно грузить новые барабаны, по умолчанию следующая зона - обезжиривание
|
||||||
|
// при повторном цинковании это кислота
|
||||||
|
if (hla_zinc_again) {
|
||||||
|
if (etching_zone < 0) {
|
||||||
|
return -1;
|
||||||
|
} else {
|
||||||
|
return (short)(ZONE_ETCHING_1 + etching_zone);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
return ZONE_DEGREASING;
|
return ZONE_DEGREASING;
|
||||||
|
}
|
||||||
|
|
||||||
case ZONE_DEGREASING:
|
case ZONE_DEGREASING:
|
||||||
// обезжиривание, нужна промывка 1А
|
// обезжиривание, нужна промывка 1А
|
||||||
@ -404,7 +413,6 @@ char remove_barrel_from_zone(short zone) {
|
|||||||
|
|
||||||
#ifdef EMULATOR
|
#ifdef EMULATOR
|
||||||
void debug_print_robot_code(const struct robot_code *code, const short robot_id, int fd) {
|
void debug_print_robot_code(const struct robot_code *code, const short robot_id, int fd) {
|
||||||
// dprintf(fd, "INFO: code length is %d\n", cmd_index);
|
|
||||||
dprintf(fd, "Code for R%d, B%d:\n", robot_id, code->barrel_id);
|
dprintf(fd, "Code for R%d, B%d:\n", robot_id, code->barrel_id);
|
||||||
for (int i = 0; i < 16; i++) {
|
for (int i = 0; i < 16; i++) {
|
||||||
const short cmd_arg = (short)(code->code[i] & (short)(~ROBOT_CMD_MASK));
|
const short cmd_arg = (short)(code->code[i] & (short)(~ROBOT_CMD_MASK));
|
||||||
@ -500,6 +508,11 @@ void create_operation(struct robot_code *code, short barrel_id, const short star
|
|||||||
if (hla_night_mode && barrels[barrel_id].flags.is_empty && dest_zone == get_first_night_zone()) {
|
if (hla_night_mode && barrels[barrel_id].flags.is_empty && dest_zone == get_first_night_zone()) {
|
||||||
barrels[barrel_id].flags.is_night = -1;
|
barrels[barrel_id].flags.is_night = -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// сброс флага повторного цинкования во время создания задания
|
||||||
|
if (start_zone == ZONE_LOAD_2) {
|
||||||
|
hla_zinc_again = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
short cmd_index = 0;
|
short cmd_index = 0;
|
||||||
|
Reference in New Issue
Block a user