auto_bus/include/bus.h

55 lines
1.0 KiB
C
Raw Normal View History

#ifndef AUTO_PILOT_BUS_BUS_H
#define AUTO_PILOT_BUS_BUS_H
2022-05-06 11:55:30 +08:00
#include "define.h"
#include "rail.h"
2022-05-06 11:55:30 +08:00
#include "query.h"
2022-05-13 11:41:00 +08:00
struct bus {
/**
*
*/
rail_node_t* rail_node_pos;
/**
*
*/
int distance;
2022-05-13 11:41:00 +08:00
};
/**
*
*/
typedef struct bus bus_t;
/**
*
*/
extern bus_t *the_bus;
2022-05-06 11:55:30 +08:00
/**
* 使
* @param direction
*/
2022-05-20 13:55:48 +08:00
void RunBus(int direction);
2022-05-06 11:55:30 +08:00
2022-05-20 13:55:48 +08:00
/**
*
* @return BUS_TRUE为到站BUS_FALSE为未到站
2022-05-20 13:55:48 +08:00
*/
int JudgeOnStation();
/**
*
* @return
*/
int GetBusPosition();
/**
*
* @param query
* @param orientation BUS_CLOCK_WISE BUS_COUNTER_CLOCK_WISE
* @return
*/
int GetQueryDistance(bus_query_t *query, int orientation);
#endif //AUTO_PILOT_BUS_BUS_H