70 lines
979 B
Markdown
70 lines
979 B
Markdown
|
# 概要设计书
|
||
|
|
||
|
## 1.自动机模型设计
|
||
|
|
||
|
## 2.高层数据信息设计
|
||
|
|
||
|
### 2.1 全局常量定义
|
||
|
|
||
|
```C
|
||
|
#define CLOCK_WISE 1
|
||
|
#define COUNTER_CLOCK_WISE 0
|
||
|
```
|
||
|
|
||
|
### 2.2 全局数据结构定义
|
||
|
|
||
|
```C
|
||
|
struct {
|
||
|
/**
|
||
|
* 站点的编号
|
||
|
*/
|
||
|
int id;
|
||
|
/**
|
||
|
* 距离上一个站点的距离
|
||
|
*/
|
||
|
int last_node_distance;
|
||
|
/**
|
||
|
* 距离下一个站点的距离
|
||
|
*/
|
||
|
int next_node_distance;
|
||
|
/**
|
||
|
* 指向上一个站点的指针
|
||
|
*/
|
||
|
struct rail_node* last_node;
|
||
|
/**
|
||
|
* 指向下一个站点的指针
|
||
|
*/
|
||
|
struct rail_node* next_node;
|
||
|
} rail_node;
|
||
|
```
|
||
|
|
||
|
```C
|
||
|
struct {
|
||
|
/**
|
||
|
* 指向站点的指针
|
||
|
*/
|
||
|
rail_node_t* rail_node_pos;
|
||
|
/**
|
||
|
* 当前行进的距离
|
||
|
*/
|
||
|
int distance;
|
||
|
} bus;
|
||
|
```
|
||
|
|
||
|
|
||
|
|
||
|
### 2.3 全局变量定义
|
||
|
|
||
|
## 3.系统模块划分
|
||
|
|
||
|
### 3.1 系统模块结构图
|
||
|
|
||
|
### 3.2 模块说明
|
||
|
|
||
|
### 3.3 函数说明
|
||
|
|
||
|
### 3.4 函数调用图示及说明
|
||
|
|
||
|
## 4.核心算法设计
|
||
|
|