-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsendcommand.h
More file actions
62 lines (47 loc) · 1.21 KB
/
sendcommand.h
File metadata and controls
62 lines (47 loc) · 1.21 KB
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
58
59
60
61
62
#ifndef SENDCOMMAND_H
#define SENDCOMMAND_H
#include <QObject>
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/msg.h>
#include <stdio.h>
#include <string.h>
#define MSGSZ 128
class SendCommand : public QObject
{
Q_OBJECT
public:
/*
* Declare the message structure.
*/
typedef struct msgbuf {
/* Mandatory, must be a positive number. */
long mtype;
/* Data */
long update_period;
int32_t opCode[4];
int32_t data[4];
} message_buf;
static SendCommand* getInstance();
//todo convert int to u,,,
void SendJog(int drive_id, int data);
void SendData(message_buf msg);
void ClearAlarm(int dirve_id);
void SendPosition(int drive_id, int data);
void GoHome(int drive_id);
void SendPointTo4Drives(double p0 , double p1, double p2, double p3);
void SendPointTo3Drives(double p0, double p1, double p2);
int32_t degree_to_motor_position(double point);
signals:
public slots:
private:
static SendCommand* instance;
int msqid;
int msgflg;
int NUMBER_OF_motorpulse =524287;
int GEARBOX_RATIO=20;
// int NUMBER_OF_motorpuls =524288;
key_t key;
explicit SendCommand(QObject *parent = nullptr);
};
#endif // SENDCOMMAND_H