-
Notifications
You must be signed in to change notification settings - Fork 0
/
vending_machine_kernel.h
57 lines (43 loc) · 1.15 KB
/
vending_machine_kernel.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#ifndef VENDING_MACHINE_KERNEL_H
#define VENDING_MACHINE_KERNEL_H
#include <QThread>
#include <QStack>
#include <QString>
#include <map>
#include <QMetaType>
#include <QPair>
#include "station.h"
struct base_information {
double _sum_in_dispay = 0;
double _sum = 0;
QStack<QPair<QString,unsigned int>> vector_products[5];
};
class Vending_Machine_kernel : public QThread
{
Q_OBJECT
public:
Vending_Machine_kernel();
double print_sum();
void run();
public slots:
//Учёт суммы в автоматe
void get_sum (double sum);
//Загрузка товара
void get_product(QString& str,Station* station);
//Выдать продукт
void give_one_product(int num_lot);
signals:
void product_to_box(QPair<QString,unsigned int>,int,double,int);
//включить выдачу
void _take(int);
//включить сигнал пустаты лотка
void _signal(int,bool);
private:
const unsigned int max_size = 20;
base_information base_info;
char selector = -1;
QString _str;
Station* _station;
int _num_lot = -1;
};
#endif // VENDING_MACHINE_KERNEL_H