-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIclient_opcua.h
264 lines (203 loc) · 6.92 KB
/
Iclient_opcua.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
#pragma once
#include <iostream>
#include <memory>
#include "Ijob_opcua.h"
namespace opcuac
{
/**
* Class ClientRIS - Reduced instruction set
* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
*/
class ClientRIS
{
public:
virtual
~ClientRIS() = default;
/**
* Basics
* ^^^^^^
*
* Each client must be initialized and connected. The user must decide how the
* connection is disconnected or how the processing of the tasks works.
*/
/* Init client, init member values and start basic configuration. */
virtual void
init(void) = 0;
/* Clean up and controlled shutdown of the client. */
virtual void
disconnect(void) = 0;
/* Client workbench. */
virtual int
run_iterate(void) = 0;
/**
* Printer services
* ^^^^^^^^^^^^^^^^
*
* These are not just methods that have been implemented exclusively for cab printers.
* These services can be used to read and write the structure tree.
*/
/* Monitors the node and reports if the status or value changes. */
virtual void
add_monitored_item(jobsptr) = 0;
/* Remove monitored item. */
virtual void
del_monitored_item(jobsptr) = 0;
/* Read node attributes. */
virtual void
read_node(jobsptr) = 0;
/* Write node attributes. */
virtual void
write_node(jobsptr) = 0;
/* Browse nodes structure. */
virtual void
browse(jobsptr) = 0;
/**
* Printer methods
* ^^^^^^^^^^^^^^^
*
* Only the pure virtual methods are currently implemented and usable. This interface
* gives you an overview of all methods that are available on the printer. feel free
* to implement additional methods.
* */
/* Upload e.g. a label format or image file to a printer's storage device. */
virtual void
file_upload(jobsptr) = 0;
/**
* Prints given JScript or ZPL data directly on the printer. The method expects UTF-8
* content encoding. */
virtual void
print_data(jobsptr) = 0;
/**
* Printer interpreter methods
* ^^^^^^^^^^^^^^^^^^^^^^^^^^^
*
* The methods in this area are only available if there is a label in the printer buffer.
*/
/* Make given number of copies from current label. */
virtual void
print_current_label(jobsptr) = 0;
};
/**
* Class ClientCIS - Complex instruction set
* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
*/
class ClientCIS
{
public:
virtual
~ClientCIS() = default;
/**
* Basics
* ^^^^^^
*
* Each client must be initialized and connected. The user must decide how the
* connection is disconnected or how the processing of the tasks works.
*/
/* Attempts to connect the client several times. */
virtual void
connect(void) = 0;
/**
* Printer methods
* ^^^^^^^^^^^^^^^
*
* Only the pure virtual methods are currently implemented and usable. This interface
* gives you an overview of all methods that are available on the printer. feel free
* to implement additional methods.
* */
/* Returns the last printed label in PNG format as processed by the printengine. */
virtual void
bitmap(jobsptr) = 0;
/* Cancels the current print job. */
virtual void
cancel_job(jobsptr) = 0;
/* Exports the printer's configuration in XML format. */
virtual void
export_settings(jobsptr) = 0;
/* Delete given file on a printer's storage device. */
virtual void
file_delete(jobsptr) = 0;
/* Download e.g. a label format or image file from a printer's storage device. */
virtual void
file_download(jobsptr) = 0;
/* List files on given storage device. */
virtual void
file_list(jobsptr) = 0;
/* Query for available fonts. */
virtual void
font_list(jobsptr) = 0;
/**
* Imports a custom TLS certificate in PEM format. This will override the supplied
* self-signed certificate. */
virtual void
import_certificateTLS(jobsptr) = 0;
/* Imports an XML printer configuration. */
virtual void
import_settings(jobsptr) = 0;
/* Returns the last printed label in PNG format with viewport adopted to job settings. */
virtual void
label_bitmap(jobsptr) = 0;
/* Loads a label from any attached printer storage device. */
virtual void
load_label(jobsptr) = 0;
/* Query for object availability. */
virtual void
query_object(jobsptr) = 0;
/* Resets passwords to factory defaults. */
virtual void
reset_passwords(jobsptr) = 0;
/* Resets to factory defaults. */
virtual void
reset_settings(jobsptr) = 0;
/* Returns a screenshot of the printer's display in PNG format. */
virtual void
screen(jobsptr) = 0;
/* Set or unset an I/O input, mostly adequate with PAUSE and LBLROT. */
virtual void
set_input(jobsptr) = 0;
/* Sets an OPC UA servers URL for data retrieval in standalone mode. */
virtual void
set_opcua_client_url(jobsptr) = 0;
/* Cancels all print jobs scheduled or currently printed by the printer. */
virtual void
total_cancel(jobsptr) = 0;
/**
* Triggers an I/O input, one of FSTLBL, REPRINT, START, LBLREM, JOBDEL, RSTERR,
* STOP or LBLFEED. PAUSE and LBLROT is not implemented as trigger, use SetInput
* instead. */
virtual void
trigger_input(jobsptr) = 0;
};
/**
* Class IClient - Implemented OPC UA client interface
* ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
*/
class IClient : public ClientRIS
{
public:
virtual
~IClient() = default;
virtual void
init(void) override = 0;
virtual void
disconnect(void) override = 0;
virtual int
run_iterate(void) override = 0;
virtual void
add_monitored_item(jobsptr) override = 0;
virtual void
del_monitored_item(jobsptr) override = 0;
virtual void
read_node(jobsptr) override = 0;
virtual void
write_node(jobsptr) override = 0;
virtual void
browse(jobsptr) override = 0;
virtual void
file_upload(jobsptr) override = 0;
virtual void
print_data(jobsptr) override = 0;
virtual void
print_current_label(jobsptr) override = 0;
};
} // namespace opcuac
/* Eof */