auto_bus/include/busModel.h

72 lines
1.2 KiB
C
Raw Normal View History

2022-06-11 19:05:06 +08:00
//
// Created by ricardo on 2022/6/10.
//
#ifndef AUTO_BUS_GUI_BUS_MODEL_H
#define AUTO_BUS_GUI_BUS_MODEL_H
#include "railsModel.h"
#include "queryModel.h"
#include "define.h"
#include "cstdio"
2022-06-11 19:05:06 +08:00
#include "string"
#include "sstream"
2022-06-25 16:35:07 +08:00
#include "QObject"
2022-06-26 13:57:45 +08:00
#include "QDebug"
#include "QTimer"
2022-06-11 19:05:06 +08:00
2022-06-25 16:35:07 +08:00
/**
*
2022-06-25 16:35:07 +08:00
*/
class BusModel
2022-06-11 19:05:06 +08:00
{
public:
rail_node_t *rail_pos;
/**
*
2022-06-11 19:05:06 +08:00
*/
const int velocity = 1;
2022-06-11 19:05:06 +08:00
/**
*
*/
int direction;
QTimer *bus_timer;
2022-06-26 13:57:45 +08:00
explicit BusModel();
2022-06-25 16:35:07 +08:00
~BusModel();
2022-06-25 16:35:07 +08:00
2022-06-17 12:18:43 +08:00
/**
*
* @param head
2022-06-17 12:18:43 +08:00
*/
void ResetBus(rail_node_t *head);
2022-06-17 12:18:43 +08:00
double GetBusPosition();
/**
*
* @param query
* @param orientation BUS_CLOCK_WISE BUS_COUNTER_CLOCK_WISE
* @return
*/
int GetQueryDistance(bus_query_t *query, int orientation) const;
private:
/**
*
2022-06-17 12:18:43 +08:00
*/
rail_node_t *rail_head;
2022-06-17 12:18:43 +08:00
/**
*
2022-06-17 12:18:43 +08:00
*/
bus_query_t *target_query;
2022-06-11 19:05:06 +08:00
};
#endif //AUTO_BUS_GUI_BUS_MODEL_H