1use chrono::{DateTime, Local};
2use open_protocol_codec_proc_macro::{OpenProtocolDecode, OpenProtocolEncode, OpenProtocolMessage};
3use crate::types::datafield::DataField;
4use crate::types::trace::TraceSample;
5
6#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode)]
7pub enum TraceType {
8 #[default]
9 #[open_protocol_value(number = 1)]
10 Angle,
11 #[open_protocol_value(number = 2)]
12 Torque,
13 #[open_protocol_value(number = 3)]
14 Current,
15 #[open_protocol_value(number = 4)]
16 Gradient,
17 #[open_protocol_value(number = 5)]
18 Stroke,
19 #[open_protocol_value(number = 6)]
20 Force
21}
22
23#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode)]
24pub enum ObjectType {
25 #[default]
26 #[open_protocol_value(number = 1)]
27 DualReading,
28 #[open_protocol_value(number = 2)]
29 TighteningProduction,
30 #[open_protocol_value(number = 3)]
31 TighteningSimulation,
32 #[open_protocol_value(number = 4)]
33 JointCheck,
34 #[open_protocol_value(number = 5)]
35 Dimensional,
36}
37
38#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
39#[open_protocol_message(MID = 0060, revision = 1)]
40pub struct MID0060rev1 {
41 }
44
45#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
47#[open_protocol_message(MID = 0061, revision = 1)]
48pub struct MID0061rev1 {
49 #[open_protocol_field(number = 1, length = 4)]
51 pub cell_id: u16,
52
53 #[open_protocol_field(number = 2, length = 2)]
55 pub channel_id: u8,
56
57 #[open_protocol_field(number = 3, length = 25)]
59 pub controller_name: String,
60
61 #[open_protocol_field(number = 4, length = 25)]
63 pub vin_number: String,
64
65 #[open_protocol_field(number = 5, length = 2)]
67 pub job_id: u8,
68
69 #[open_protocol_field(number = 6, length = 3)]
71 pub parameter_set_id: u16,
72
73 #[open_protocol_field(number = 7, length = 4)]
75 pub batch_size: u16,
76
77 #[open_protocol_field(number = 8, length = 4)]
79 pub batch_counter: u16,
80
81 #[open_protocol_field(number = 9, length = 1)]
83 pub tightening_status: u8,
84
85 #[open_protocol_field(number = 10, length = 1)]
87 pub torque_status: u8,
88
89 #[open_protocol_field(number = 11, length = 1)]
91 pub angle_status: u8,
92
93 #[open_protocol_field(number = 12, length = 6)]
95 pub torque_min_limit: u32,
96
97 #[open_protocol_field(number = 13, length = 6)]
99 pub torque_max_limit: u32,
100
101 #[open_protocol_field(number = 14, length = 6)]
103 pub torque_final_target: u32,
104
105 #[open_protocol_field(number = 15, length = 6)]
107 pub torque: u32,
108
109 #[open_protocol_field(number = 16, length = 5)]
111 pub angle_min_limit: u16,
112
113 #[open_protocol_field(number = 17, length = 5)]
115 pub angle_max_limit: u16,
116
117 #[open_protocol_field(number = 18, length = 5)]
119 pub angle_final_target: u16,
120
121 #[open_protocol_field(number = 19, length = 5)]
123 pub angle: u16,
124
125 #[open_protocol_field(number = 20, length = 19)]
127 pub timestamp: DateTime<Local>,
128
129 #[open_protocol_field(number = 21, length = 19)]
131 pub last_parameter_set_change: DateTime<Local>,
132
133 #[open_protocol_field(number = 22, length = 1)]
135 pub batch_status: u8,
136
137 #[open_protocol_field(number = 23, length = 10)]
139 pub tightening_id: u32,
140}
141
142#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
143#[open_protocol_message(MID = 0061, revision = 2)]
144pub struct MID0061rev2 {
145 #[open_protocol_field(number = 1, length = 4)]
147 pub cell_id: u16,
148
149 #[open_protocol_field(number = 2, length = 2)]
151 pub channel_id: u8,
152
153 #[open_protocol_field(number = 3, length = 25)]
155 pub controller_name: String,
156
157 #[open_protocol_field(number = 4, length = 25)]
159 pub vin_number: String,
160
161 #[open_protocol_field(number = 5, length = 4)]
163 pub job_id: u16,
164
165 #[open_protocol_field(number = 6, length = 3)]
167 pub parameter_set_id: u16,
168
169 #[open_protocol_field(number = 7, length = 2)]
171 pub strategy: u8,
172
173 #[open_protocol_field(number = 8, length = 5)]
175 pub strategy_options: u32,
176
177 #[open_protocol_field(number = 9, length = 4)]
179 pub batch_size: u16,
180
181 #[open_protocol_field(number = 10, length = 4)]
183 pub batch_counter: u16,
184
185 #[open_protocol_field(number = 11, length = 1)]
187 pub tightening_status: u8,
188
189 #[open_protocol_field(number = 12, length = 1)]
191 pub batch_status: u8,
192
193 #[open_protocol_field(number = 13, length = 1)]
195 pub torque_status: u8,
196
197 #[open_protocol_field(number = 14, length = 1)]
199 pub angle_status: u8,
200
201 #[open_protocol_field(number = 15, length = 1)]
203 pub rundown_angle_status: u8,
204
205 #[open_protocol_field(number = 16, length = 1)]
207 pub current_monitoring_status: u8,
208
209 #[open_protocol_field(number = 17, length = 1)]
211 pub self_tap_status: u8,
212
213 #[open_protocol_field(number = 18, length = 1)]
215 pub prevail_torque_monitoring_status: u8,
216
217 #[open_protocol_field(number = 19, length = 1)]
219 pub prevail_torque_compensate_status: u8,
220
221 #[open_protocol_field(number = 20, length = 10)]
223 pub tightening_error_status: String,
224
225 #[open_protocol_field(number = 21, length = 6)]
227 pub torque_min_limit: u32,
228
229 #[open_protocol_field(number = 22, length = 6)]
231 pub torque_max_limit: u32,
232
233 #[open_protocol_field(number = 23, length = 6)]
235 pub torque_final_target: u32,
236
237 #[open_protocol_field(number = 24, length = 6)]
239 pub torque: u32,
240
241 #[open_protocol_field(number = 25, length = 5)]
243 pub angle_min_limit: u16,
244
245 #[open_protocol_field(number = 26, length = 5)]
247 pub angle_max_limit: u16,
248
249 #[open_protocol_field(number = 27, length = 5)]
251 pub angle_final_target: u16,
252
253 #[open_protocol_field(number = 28, length = 5)]
255 pub angle: u16,
256
257 #[open_protocol_field(number = 29, length = 5)]
259 pub rundown_angle_min: u16,
260
261 #[open_protocol_field(number = 30, length = 5)]
263 pub rundown_angle_max: u16,
264
265 #[open_protocol_field(number = 31, length = 5)]
267 pub rundown_angle: u16,
268
269 #[open_protocol_field(number = 32, length = 3)]
271 pub current_monitoring_min: u16,
272
273 #[open_protocol_field(number = 33, length = 3)]
275 pub current_monitoring_max: u16,
276
277 #[open_protocol_field(number = 34, length = 3)]
279 pub current_monitoring_value: u16,
280
281 #[open_protocol_field(number = 35, length = 6)]
283 pub self_tap_torque_min: u32,
284
285 #[open_protocol_field(number = 36, length = 6)]
287 pub self_tap_torque_max: u32,
288
289 #[open_protocol_field(number = 37, length = 6)]
291 pub self_tap_torque: u32,
292
293 #[open_protocol_field(number = 38, length = 6)]
295 pub prevail_torque_min: u32,
296
297 #[open_protocol_field(number = 39, length = 6)]
299 pub prevail_torque_max: u32,
300
301 #[open_protocol_field(number = 40, length = 6)]
303 pub prevail_torque: u32,
304
305 #[open_protocol_field(number = 41, length = 10)]
307 pub tightening_id: u32,
308
309 #[open_protocol_field(number = 42, length = 5)]
311 pub job_sequence_number: u16,
312
313 #[open_protocol_field(number = 43, length = 5)]
315 pub sync_tightening_id: u16,
316
317 #[open_protocol_field(number = 44, length = 14)]
319 pub tool_serial_number: String,
320
321 #[open_protocol_field(number = 45, length = 19)]
323 pub timestamp: DateTime<Local>,
324
325 #[open_protocol_field(number = 46, length = 19)]
327 pub last_parameter_set_change: DateTime<Local>,
328}
329
330#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
331#[open_protocol_message(MID = 0061, revision = 3)]
332pub struct MID0061rev3 {
333 #[open_protocol_field(number = 47, length = 25)]
335 pub parameter_set_name: String,
336
337 #[open_protocol_field(number = 48, length = 1)]
339 pub torque_unit: u8,
340
341 #[open_protocol_field(number = 49, length = 2)]
343 pub result_type: u8,
344}
345
346#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
348#[open_protocol_message(MID = 0062, revision = 1)]
349pub struct MID0062rev1 {
350 }
353
354#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
356#[open_protocol_message(MID = 0063, revision = 1)]
357pub struct MID0063rev1 {
358 }
361
362#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
364#[open_protocol_message(MID = 0064, revision = 1)]
365pub struct MID0064rev1 {
366 #[open_protocol_field(number = 1, length = 10)]
368 pub tightening_id: u32,
369}
370
371#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
373#[open_protocol_message(MID = 0065, revision = 1)]
374pub struct MID0065rev1 {
375 }
378
379#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
381#[open_protocol_message(MID = 0066, revision = 1)]
382pub struct MID0066rev1 {
383 #[open_protocol_field(number = 1, length = 2)]
385 pub number_of_offline_results: u8,
386}
387
388#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
389#[open_protocol_message(MID = 0066, revision = 2)]
390pub struct MID0066rev2 {
391 #[open_protocol_field(number = 1, length = 3)]
393 pub number_of_offline_results: u16,
394
395 #[open_protocol_field(number = 2, length = 3)]
397 pub number_of_offline_curves: u16,
398}
399
400#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
402#[open_protocol_message(MID = 0067, revision = 1)]
403pub struct MID0067rev1 {
404 #[open_protocol_field(number = 1, length = 10)]
406 pub start_index: u32,
407
408 #[open_protocol_field(number = 2, length = 3)]
410 pub count: u16,
411}
412
413#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
415#[open_protocol_message(MID = 0900, revision = 1)]
416pub struct MID0900rev1 {
417 #[open_protocol_field(length = 10)]
419 pub result_data_id: u32,
420
421 #[open_protocol_field(length = 19)]
423 pub timestamp: DateTime<Local>,
424
425 #[open_protocol_field(length = 3)]
427 pub number_of_pids: u16,
428
429 #[open_protocol_field(list, amount = "number_of_pids")]
431 pub data_fields: Vec<DataField>,
432
433 #[open_protocol_field(length = 2)]
435 pub trace_type: TraceType,
436
437 #[open_protocol_field(length = 2)]
439 pub transducer_type: u8,
440
441 #[open_protocol_field(length = 3)]
443 pub unit: u16,
444
445 #[open_protocol_field(length = 3)]
447 pub number_of_parameter_fields: u16,
448
449 #[open_protocol_field(list, amount = "number_of_parameter_fields")]
451 pub parameter_fields: Vec<DataField>,
452
453 #[open_protocol_field(length = 3)]
455 pub number_of_resolution_fields: u16,
456
457 #[open_protocol_field(list, amount = "number_of_resolution_fields")]
459 pub resolution_fields: Vec<DataField>,
460
461 #[open_protocol_field(length = 5)]
463 pub number_of_trace_samples: u32,
464
465 #[open_protocol_field(length = 1)]
467 pub nul_character: u8,
468
469 #[open_protocol_field(list, amount = "number_of_trace_samples", length = 2)]
471 pub trace_samples: Vec<TraceSample>,
472}
473
474#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
475#[open_protocol_message(MID = 0900, revision = 2)]
476pub struct MID0900rev2 {
477 #[open_protocol_field(length = 10)]
479 pub result_data_id: u32,
480
481 #[open_protocol_field(length = 19)]
483 pub timestamp: DateTime<Local>,
484
485 #[open_protocol_field(length = 3)]
487 pub number_of_pids: u16,
488
489 #[open_protocol_field(list, amount = "number_of_pids")]
491 pub data_fields: Vec<DataField>,
492
493 #[open_protocol_field(length = 2)]
495 pub trace_type: TraceType,
496
497 #[open_protocol_field(length = 2)]
499 pub transducer_type: u8,
500
501 #[open_protocol_field(length = 3)]
503 pub unit: u16,
504
505 #[open_protocol_field(length = 4)]
508 pub request_mid: u16,
509
510 #[open_protocol_field(length = 3)]
512 pub number_of_parameter_fields: u16,
513
514 #[open_protocol_field(list, amount = "number_of_parameter_fields")]
516 pub parameter_fields: Vec<DataField>,
517
518 #[open_protocol_field(length = 3)]
520 pub number_of_resolution_fields: u16,
521
522 #[open_protocol_field(list, amount = "number_of_resolution_fields")]
524 pub resolution_fields: Vec<DataField>,
525
526 #[open_protocol_field(length = 5)]
528 pub number_of_trace_samples: u32,
529
530 #[open_protocol_field(length = 1)]
532 pub nul_character: u8,
533
534 #[open_protocol_field(list, amount = "number_of_trace_samples", length = 2)]
536 pub trace_samples: Vec<TraceSample>,
537}
538
539#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
540#[open_protocol_message(MID = 0900, revision = 3)]
541pub struct MID0900rev3 {
542 #[open_protocol_field(length = 10)]
544 pub result_data_id: u32,
545
546 #[open_protocol_field(length = 19)]
548 pub timestamp: DateTime<Local>,
549
550 #[open_protocol_field(length = 4)]
552 pub object_id: u16,
553
554 #[open_protocol_field(length = 1)]
556 pub object_type: ObjectType,
557
558 #[open_protocol_field(length = 4)]
560 pub reference_object_id: u16,
561
562 #[open_protocol_field(length = 3)]
564 pub number_of_pids: u16,
565
566 #[open_protocol_field(list, amount = "number_of_pids")]
568 pub data_fields: Vec<DataField>,
569
570 #[open_protocol_field(length = 2)]
572 pub trace_type: TraceType,
573
574 #[open_protocol_field(length = 2)]
576 pub transducer_type: u8,
577
578 #[open_protocol_field(length = 3)]
580 pub unit: u16,
581
582 #[open_protocol_field(length = 4)]
585 pub request_mid: u16,
586
587 #[open_protocol_field(length = 3)]
589 pub number_of_parameter_fields: u16,
590
591 #[open_protocol_field(list, amount = "number_of_parameter_fields")]
593 pub parameter_fields: Vec<DataField>,
594
595 #[open_protocol_field(length = 3)]
597 pub number_of_resolution_fields: u16,
598
599 #[open_protocol_field(list, amount = "number_of_resolution_fields")]
601 pub resolution_fields: Vec<DataField>,
602
603 #[open_protocol_field(length = 5)]
605 pub number_of_trace_samples: u32,
606
607 #[open_protocol_field(length = 1)]
609 pub nul_character: u8,
610
611 #[open_protocol_field(list, amount = "number_of_trace_samples", length = 2)]
613 pub trace_samples: Vec<TraceSample>,
614}
615
616#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode)]
617pub struct MID0900RequestExtraData {
618 #[open_protocol_field(length = 10)]
621 pub index: u64,
622
623 #[open_protocol_field(length = 3)]
625 pub trace_type: TraceType,
626
627 #[open_protocol_field(length = 4)]
629 pub tool_number: u16,
630}
631
632#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode)]
633pub struct MID0900SubscribeExtraData {
634 }
636
637#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode)]
638pub struct MID0900UnsubscribeExtraData {
639 }
641
642#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
644#[open_protocol_message(MID = 0901, revision = 1)]
645pub struct MID0901rev1 {
646 }
648
649#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
651#[open_protocol_message(MID = 0901, revision = 2)]
652pub struct MID0901rev2 {
653 }
655
656#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
658#[open_protocol_message(MID = 0901, revision = 3)]
659pub struct MID0901rev3 {
660 }
662
663#[derive(Debug, Default, Eq, PartialEq, OpenProtocolEncode, OpenProtocolDecode, OpenProtocolMessage)]
665#[open_protocol_message(MID = 0902, revision = 1)]
666pub struct MID0902rev1 {
667 #[open_protocol_field(length = 10)]
669 pub capacity: u64,
670
671 #[open_protocol_field(length = 10)]
673 pub oldest_sequence_number: u64,
674
675 #[open_protocol_field(length = 19)]
677 pub oldest_time: DateTime<Local>,
678
679 #[open_protocol_field(length = 10)]
681 pub newest_sequence_number: u64,
682
683 #[open_protocol_field(length = 19)]
685 pub newest_time: DateTime<Local>,
686
687 #[open_protocol_field(length = 3)]
689 pub number_of_pids: u16,
690
691 #[open_protocol_field(list, amount = "number_of_pids")]
693 pub data_fields: Vec<DataField>,
694}