调整了合成一个文件的顺序
修改了测试程序缺少缺省值的问题
This commit is contained in:
parent
d2e515902f
commit
837af37e9a
|
@ -174,12 +174,21 @@ rail_node_t *ReadChosenConfigFile(char *config_file_path)
|
|||
|
||||
}
|
||||
|
||||
if (distance != 0 && total_station != 0)
|
||||
// 处理参数去缺省值的情况
|
||||
if (distance == 0)
|
||||
{
|
||||
return CreateRails(distance, total_station);
|
||||
distance = 2;
|
||||
}
|
||||
else
|
||||
if (total_station == 0)
|
||||
{
|
||||
return NULL;
|
||||
total_station = 5;
|
||||
}
|
||||
if(chosen_strategy == -1)
|
||||
{
|
||||
chosen_strategy = BUS_FCFS;
|
||||
}
|
||||
|
||||
all_distance = distance * total_station;
|
||||
rail_node_t *head = CreateRails(distance, total_station);
|
||||
return head;
|
||||
}
|
2
main.py
2
main.py
|
@ -26,7 +26,7 @@ input_file.write(
|
|||
|
||||
# 读取include, src两个文件夹
|
||||
# include文件的顺序需要手动指定
|
||||
include_list: list = ["rail.h", "bus.h", "query.h", "bus_io.h", "controller.h", "define.h"]
|
||||
include_list: list = ["rail.h", "query.h", "bus.h", "bus_io.h", "controller.h", "define.h"]
|
||||
src_list: list = os.listdir(src_path)
|
||||
|
||||
for file_name in include_list:
|
||||
|
|
Loading…
Reference in New Issue
Block a user