-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmachine.h
49 lines (41 loc) · 1.54 KB
/
machine.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
/* Public domain */
#ifndef _CADTOOLS_MACHINE_H_
#define _CADTOOLS_MACHINE_H_
#include "begin_code.h"
#define CAM_HOSTNAME_MAX 128
#define CAM_PORT_MAX 16
#define CAM_USERNAME_MAX 64
#define CAM_PASSWORD_MAX 64
#define CAM_MACHINE_DESCR_MAX 256
typedef struct cam_machine {
struct ag_object obj;
char descr[CAM_MACHINE_DESCR_MAX];
char host[CAM_HOSTNAME_MAX]; /* Machine controller hostname */
char port[CAM_PORT_MAX]; /* machctld port */
char user[CAM_USERNAME_MAX]; /* machctld login name */
char pass[CAM_PASSWORD_MAX]; /* machctld password */
AG_Mutex lock;
Uint32 flags;
#define CAM_MACHINE_ENABLED 0x01 /* Try to contact machine */
#define CAM_MACHINE_BUSY 0x02 /* Machine offline or busy */
#define CAM_MACHINE_DETACHING 0x04 /* Machine being detached */
#define CAM_MACHINE_DETACHED1 0x08
#define CAM_MACHINE_DETACHED2 0x10
#define CAM_MACHINE_DETACHED (CAM_MACHINE_DETACHED1|CAM_MACHINE_DETACHED2)
SG *model; /* Simplified geometric model */
#ifdef NETWORK
NC_Session sess; /* Network session with controller */
#endif
AG_Thread thNet; /* Network I/O thread */
AG_Thread thInact; /* Inactivity timeout thread */
Uint32 tPong; /* Time of last ping */
AG_Console *cons; /* Status console (or NULL) */
AG_TAILQ_HEAD(,cam_program) upload; /* Program upload queue */
} CAM_Machine;
__BEGIN_DECLS
extern AG_ObjectClass camMachineClass;
void CAM_MachineLog(CAM_Machine *, const char *, ...);
int CAM_MachineUploadProgram(CAM_Machine *, CAM_Program *);
__END_DECLS
#include "close_code.h"
#endif /* _CADTOOLS_MACHINE_H_ */