diff options
| author | Roy <roy.mail.net@gmail.com> | 2018-03-03 00:52:22 +0200 |
|---|---|---|
| committer | Roy <roy.mail.net@gmail.com> | 2018-03-03 00:52:22 +0200 |
| commit | 79ffa1774217400bd750f6a85df9f969429580c3 (patch) | |
| tree | 1d093fcaa82c2f1940a330a6a5852d879ffe5409 | |
| parent | 65d7f918b273a572d2d9a1d08a2797ea76b10850 (diff) | |
| download | Tango-79ffa1774217400bd750f6a85df9f969429580c3.tar.gz Tango-79ffa1774217400bd750f6a85df9f969429580c3.zip | |
Added Delta Resolution for Hive Color Picker.
Implemented Embroidery PMR.
Implemented Embroidery Native Adapter.
180 files changed, 19930 insertions, 205 deletions
diff --git a/Software/DB/Tango.mdf b/Software/DB/Tango.mdf Binary files differindex 5db7e45f4..233ecf023 100644 --- a/Software/DB/Tango.mdf +++ b/Software/DB/Tango.mdf diff --git a/Software/DB/Tango_log.ldf b/Software/DB/Tango_log.ldf Binary files differindex 646891a9f..5da6f393d 100644 --- a/Software/DB/Tango_log.ldf +++ b/Software/DB/Tango_log.ldf diff --git a/Software/PMR/Messages/.settings/com.google.eclipse.protobuf.Protobuf.prefs b/Software/PMR/Messages/.settings/com.google.eclipse.protobuf.Protobuf.prefs index 3defca656..11a912adc 100644 --- a/Software/PMR/Messages/.settings/com.google.eclipse.protobuf.Protobuf.prefs +++ b/Software/PMR/Messages/.settings/com.google.eclipse.protobuf.Protobuf.prefs @@ -1,4 +1,4 @@ eclipse.preferences.version=1 -paths.directoryPaths=${workspace_loc\:/${project}/Common},${workspace_loc\:/${project}/Jobs},${workspace_loc\:/${project}/Printing},${workspace_loc\:/${project}/ColorLab},${workspace_loc\:/${project}/Diagnostics},${workspace_loc\:/${project}/Debugging},${workspace_loc\:/${project}/Hardware} +paths.directoryPaths=${workspace_loc\:/${project}/Common},${workspace_loc\:/${project}/Jobs},${workspace_loc\:/${project}/Printing},${workspace_loc\:/${project}/ColorLab},${workspace_loc\:/${project}/Diagnostics},${workspace_loc\:/${project}/Debugging},${workspace_loc\:/${project}/Hardware},${workspace_loc\:/${project}/Embroidery} paths.filesInMultipleDirectories=true paths.filesInOneDirectoryOnly=false diff --git a/Software/PMR/Messages/Embroidery/AnalyzeInput.proto b/Software/PMR/Messages/Embroidery/AnalyzeInput.proto new file mode 100644 index 000000000..1828691f4 --- /dev/null +++ b/Software/PMR/Messages/Embroidery/AnalyzeInput.proto @@ -0,0 +1,9 @@ +syntax = "proto3"; + +package Tango.PMR.Embroidery; +option java_package = "com.twine.tango.pmr.embroidery"; + +message AnalyzeInput +{ + string FilePath = 1; +} diff --git a/Software/PMR/Messages/Embroidery/AnalyzeOutput.proto b/Software/PMR/Messages/Embroidery/AnalyzeOutput.proto new file mode 100644 index 000000000..98820cc60 --- /dev/null +++ b/Software/PMR/Messages/Embroidery/AnalyzeOutput.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; + +import "EmbroideryFile.proto"; + +package Tango.PMR.Embroidery; +option java_package = "com.twine.tango.pmr.embroidery"; + +message AnalyzeOutput +{ + EmbroideryFile EmbroideryFile = 1; +} diff --git a/Software/PMR/Messages/Embroidery/EmbroideryFile.proto b/Software/PMR/Messages/Embroidery/EmbroideryFile.proto new file mode 100644 index 000000000..e0775cd32 --- /dev/null +++ b/Software/PMR/Messages/Embroidery/EmbroideryFile.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; + +import "Extents.proto"; +import "Stitch.proto"; +import "StitchColor.proto"; + +package Tango.PMR.Embroidery; +option java_package = "com.twine.tango.pmr.embroidery"; + +message EmbroideryFile +{ + string DesignName = 1; + string FileName = 2; + int32 StitchCount = 3; + int32 ColorCount = 4; + Extents Extents = 5; + repeated StitchColor Colors = 6; + repeated Stitch Stitches = 7; +} diff --git a/Software/PMR/Messages/Embroidery/Extents.proto b/Software/PMR/Messages/Embroidery/Extents.proto new file mode 100644 index 000000000..33829e753 --- /dev/null +++ b/Software/PMR/Messages/Embroidery/Extents.proto @@ -0,0 +1,13 @@ +syntax = "proto3"; + + +package Tango.PMR.Embroidery; +option java_package = "com.twine.tango.pmr.embroidery"; + +message Extents +{ + int32 X1 = 1; + int32 Y1 = 2; + int32 X2 = 3; + int32 Y2 = 4; +} diff --git a/Software/PMR/Messages/Embroidery/Stitch.proto b/Software/PMR/Messages/Embroidery/Stitch.proto new file mode 100644 index 000000000..9af232997 --- /dev/null +++ b/Software/PMR/Messages/Embroidery/Stitch.proto @@ -0,0 +1,19 @@ +syntax = "proto3"; + +import "StitchFlag.proto"; + +package Tango.PMR.Embroidery; +option java_package = "com.twine.tango.pmr.embroidery"; + +message Stitch +{ + StitchFlag Flag = 1; + double XX = 2; + double YY = 3; + double DX = 4; + double DY = 5; + double Length = 6; + double Angle = 7; + double DAngle = 8; + int32 ColorIndex = 9; +} diff --git a/Software/PMR/Messages/Embroidery/StitchColor.proto b/Software/PMR/Messages/Embroidery/StitchColor.proto new file mode 100644 index 000000000..56e45045a --- /dev/null +++ b/Software/PMR/Messages/Embroidery/StitchColor.proto @@ -0,0 +1,11 @@ +syntax = "proto3"; + +package Tango.PMR.Embroidery; +option java_package = "com.twine.tango.pmr.embroidery"; + +message StitchColor +{ + int32 Red = 1; + int32 Green = 2; + int32 Blue = 3; +} diff --git a/Software/PMR/Messages/Embroidery/StitchFlag.proto b/Software/PMR/Messages/Embroidery/StitchFlag.proto new file mode 100644 index 000000000..67194a05a --- /dev/null +++ b/Software/PMR/Messages/Embroidery/StitchFlag.proto @@ -0,0 +1,14 @@ +syntax = "proto3"; + +package Tango.PMR.Embroidery; +option java_package = "com.twine.tango.pmr.embroidery"; + +enum StitchFlag +{ + NORMAL = 0; + JUMP = 1; + TRIM = 2; + STOP = 4; + SEQUIN = 8; + END = 16; +} diff --git a/Software/Visual_Studio/Embroidery/Tango.Embroidery/Adapter.cpp b/Software/Visual_Studio/Embroidery/Tango.Embroidery/Adapter.cpp new file mode 100644 index 000000000..779e73b1d --- /dev/null +++ b/Software/Visual_Studio/Embroidery/Tango.Embroidery/Adapter.cpp @@ -0,0 +1,77 @@ +#include "Adapter.h" +#include "emb-pattern.h" +#include "PMR\Embroidery\AnalyzeInput.pb-c.h" +#include "PMR\Embroidery\AnalyzeOutput.pb-c.h" +#include "PMR\Embroidery\EmbroideryFile.pb-c.h" +#include "PMR\Embroidery\Stitch.pb-c.h" +#include "PMR\Embroidery\StitchFlag.pb-c.h" +#include "PMR\Embroidery\StitchColor.pb-c.h" +#include "PMR\Embroidery\Extents.pb-c.h" + + + +Adapter::Adapter() +{ +} + + +Adapter::~Adapter() +{ +} + +size_t Adapter::AnalyzeEmbroideryFile(uint8_t * input_buffer, size_t input_buffer_size, uint8_t *& output_buffer) +{ + //Unpack input... + AnalyzeInput *input = analyze_input__unpack(NULL, input_buffer_size, input_buffer); + + //Initialize Output... + AnalyzeOutput output = ANALYZE_OUTPUT__INIT; + + EmbPattern* p = embPattern_create(); + + int ok = embPattern_read(p, input->filepath); + + if (ok) + { + int stitchCount = embStitchList_count(p->stitchList); + int colorCount = embThreadList_count(p->threadList); + + EmbroideryFile embroideryFile; + + embroideryFile.colorcount = colorCount; + embroideryFile.stitchcount = stitchCount; + + embroideryFile.colors = (StitchColor**)malloc(sizeof(StitchColor*) * colorCount); + embroideryFile.stitches = (Stitch**)malloc(sizeof(Stitch*) * stitchCount); + + for (size_t i = 0; i < colorCount; i++) + { + StitchColor color; + color.red = (int)p->threadList[i].thread.color.r; + color.green = (int)p->threadList[i].thread.color.g; + color.blue = (int)p->threadList[i].thread.color.b; + + embroideryFile.colors[i] = &color; + } + + for (size_t i = 0; i < stitchCount; i++) + { + EmbStitch intStitch = p->stitchList[i].stitch; + + Stitch outStitch; + outStitch.xx = intStitch.xx; + outStitch.yy = intStitch.yy; + outStitch.flag = (StitchFlag)intStitch.flags; + outStitch.colorindex = intStitch.color; + + embroideryFile.stitches[i] = &outStitch; + } + + output.embroideryfile = &embroideryFile; + } + + //Pack output... + output_buffer = (uint8_t*)malloc(analyze_output__get_packed_size(&output)); + + return analyze_output__pack(&output, output_buffer); +} diff --git a/Software/Visual_Studio/Embroidery/Tango.Embroidery/Adapter.h b/Software/Visual_Studio/Embroidery/Tango.Embroidery/Adapter.h new file mode 100644 index 000000000..9b4de128a --- /dev/null +++ b/Software/Visual_Studio/Embroidery/Tango.Embroidery/Adapter.h @@ -0,0 +1,12 @@ +#include <cstdlib> +#include <cstdint> + +#pragma once +class Adapter +{ +public: + Adapter(); + ~Adapter(); + size_t AnalyzeEmbroideryFile(uint8_t * input_buffer, size_t input_buffer_size, uint8_t *& output_buffer); +}; + diff --git a/Software/Visual_Studio/Embroidery/Tango.Embroidery/Exports.cpp b/Software/Visual_Studio/Embroidery/Tango.Embroidery/Exports.cpp new file mode 100644 index 000000000..ba4ed6cbb --- /dev/null +++ b/Software/Visual_Studio/Embroidery/Tango.Embroidery/Exports.cpp @@ -0,0 +1,15 @@ +#include <cstdlib> +#include "Adapter.h" + +#pragma once + +#define EXPORT_API __declspec(dllexport) + +using namespace std; + +extern "C" EXPORT_API size_t __cdecl AnalyzeEmbroideryFile(uint8_t* input_buffer, size_t input_buffer_size, uint8_t*& output_buffer) +{ + Adapter adapter; + return adapter.AnalyzeEmbroideryFile(input_buffer, input_buffer_size, output_buffer); +} + diff --git a/Software/Visual_Studio/Embroidery/Tango.Embroidery/PMR/Embroidery/AnalyzeInput.pb-c.c b/Software/Visual_Studio/Embroidery/Tango.Embroidery/PMR/Embroidery/AnalyzeInput.pb-c.c new file mode 100644 index 000000000..8cab316aa --- /dev/null +++ b/Software/Visual_Studio/Embroidery/Tango.Embroidery/PMR/Embroidery/AnalyzeInput.pb-c.c @@ -0,0 +1,92 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: AnalyzeInput.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "AnalyzeInput.pb-c.h" +void analyze_input__init + (AnalyzeInput *message) +{ + static const AnalyzeInput init_value = ANALYZE_INPUT__INIT; + *message = init_value; +} +size_t analyze_input__get_packed_size + (const AnalyzeInput *message) +{ + assert(message->base.descriptor == &analyze_input__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t analyze_input__pack + (const AnalyzeInput *message, + uint8_t *out) +{ + assert(message->base.descriptor == &analyze_input__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t analyze_input__pack_to_buffer + (const AnalyzeInput *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &analyze_input__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +AnalyzeInput * + analyze_input__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (AnalyzeInput *) + protobuf_c_message_unpack (&analyze_input__descriptor, + allocator, len, data); +} +void analyze_input__free_unpacked + (AnalyzeInput *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &analyze_input__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor analyze_input__field_descriptors[1] = +{ + { + "FilePath", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(AnalyzeInput, filepath), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned analyze_input__field_indices_by_name[] = { + 0, /* field[0] = FilePath */ +}; +static const ProtobufCIntRange analyze_input__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor analyze_input__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "AnalyzeInput", + "AnalyzeInput", + "AnalyzeInput", + "", + sizeof(AnalyzeInput), + 1, + analyze_input__field_descriptors, + analyze_input__field_indices_by_name, + 1, analyze_input__number_ranges, + (ProtobufCMessageInit) analyze_input__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Embroidery/Tango.Embroidery/PMR/Embroidery/AnalyzeInput.pb-c.h b/Software/Visual_Studio/Embroidery/Tango.Embroidery/PMR/Embroidery/AnalyzeInput.pb-c.h new file mode 100644 index 000000000..15d124132 --- /dev/null +++ b/Software/Visual_Studio/Embroidery/Tango.Embroidery/PMR/Embroidery/AnalyzeInput.pb-c.h @@ -0,0 +1,71 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: AnalyzeInput.proto */ + +#ifndef PROTOBUF_C_AnalyzeInput_2eproto__INCLUDED +#define PROTOBUF_C_AnalyzeInput_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _AnalyzeInput AnalyzeInput; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _AnalyzeInput +{ + ProtobufCMessage base; + char *filepath; +}; +#define ANALYZE_INPUT__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&analyze_input__descriptor) \ + , NULL } + + +/* AnalyzeInput methods */ +void analyze_input__init + (AnalyzeInput *message); +size_t analyze_input__get_packed_size + (const AnalyzeInput *message); +size_t analyze_input__pack + (const AnalyzeInput *message, + uint8_t *out); +size_t analyze_input__pack_to_buffer + (const AnalyzeInput *message, + ProtobufCBuffer *buffer); +AnalyzeInput * + analyze_input__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void analyze_input__free_unpacked + (AnalyzeInput *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*AnalyzeInput_Closure) + (const AnalyzeInput *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor analyze_input__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_AnalyzeInput_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Embroidery/Tango.Embroidery/PMR/Embroidery/AnalyzeOutput.pb-c.c b/Software/Visual_Studio/Embroidery/Tango.Embroidery/PMR/Embroidery/AnalyzeOutput.pb-c.c new file mode 100644 index 000000000..9739abc10 --- /dev/null +++ b/Software/Visual_Studio/Embroidery/Tango.Embroidery/PMR/Embroidery/AnalyzeOutput.pb-c.c @@ -0,0 +1,92 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: AnalyzeOutput.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "AnalyzeOutput.pb-c.h" +void analyze_output__init + (AnalyzeOutput *message) +{ + static const AnalyzeOutput init_value = ANALYZE_OUTPUT__INIT; + *message = init_value; +} +size_t analyze_output__get_packed_size + (const AnalyzeOutput *message) +{ + assert(message->base.descriptor == &analyze_output__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t analyze_output__pack + (const AnalyzeOutput *message, + uint8_t *out) +{ + assert(message->base.descriptor == &analyze_output__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t analyze_output__pack_to_buffer + (const AnalyzeOutput *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &analyze_output__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +AnalyzeOutput * + analyze_output__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (AnalyzeOutput *) + protobuf_c_message_unpack (&analyze_output__descriptor, + allocator, len, data); +} +void analyze_output__free_unpacked + (AnalyzeOutput *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &analyze_output__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor analyze_output__field_descriptors[1] = +{ + { + "EmbroideryFile", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_MESSAGE, + 0, /* quantifier_offset */ + offsetof(AnalyzeOutput, embroideryfile), + &embroidery_file__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned analyze_output__field_indices_by_name[] = { + 0, /* field[0] = EmbroideryFile */ +}; +static const ProtobufCIntRange analyze_output__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor analyze_output__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "AnalyzeOutput", + "AnalyzeOutput", + "AnalyzeOutput", + "", + sizeof(AnalyzeOutput), + 1, + analyze_output__field_descriptors, + analyze_output__field_indices_by_name, + 1, analyze_output__number_ranges, + (ProtobufCMessageInit) analyze_output__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Embroidery/Tango.Embroidery/PMR/Embroidery/AnalyzeOutput.pb-c.h b/Software/Visual_Studio/Embroidery/Tango.Embroidery/PMR/Embroidery/AnalyzeOutput.pb-c.h new file mode 100644 index 000000000..6e0812aa2 --- /dev/null +++ b/Software/Visual_Studio/Embroidery/Tango.Embroidery/PMR/Embroidery/AnalyzeOutput.pb-c.h @@ -0,0 +1,72 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: AnalyzeOutput.proto */ + +#ifndef PROTOBUF_C_AnalyzeOutput_2eproto__INCLUDED +#define PROTOBUF_C_AnalyzeOutput_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + +#include "EmbroideryFile.pb-c.h" + +typedef struct _AnalyzeOutput AnalyzeOutput; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _AnalyzeOutput +{ + ProtobufCMessage base; + EmbroideryFile *embroideryfile; +}; +#define ANALYZE_OUTPUT__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&analyze_output__descriptor) \ + , NULL } + + +/* AnalyzeOutput methods */ +void analyze_output__init + (AnalyzeOutput *message); +size_t analyze_output__get_packed_size + (const AnalyzeOutput *message); +size_t analyze_output__pack + (const AnalyzeOutput *message, + uint8_t *out); +size_t analyze_output__pack_to_buffer + (const AnalyzeOutput *message, + ProtobufCBuffer *buffer); +AnalyzeOutput * + analyze_output__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void analyze_output__free_unpacked + (AnalyzeOutput *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*AnalyzeOutput_Closure) + (const AnalyzeOutput *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor analyze_output__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_AnalyzeOutput_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Embroidery/Tango.Embroidery/PMR/Embroidery/EmbroideryFile.pb-c.c b/Software/Visual_Studio/Embroidery/Tango.Embroidery/PMR/Embroidery/EmbroideryFile.pb-c.c new file mode 100644 index 000000000..3d07907e9 --- /dev/null +++ b/Software/Visual_Studio/Embroidery/Tango.Embroidery/PMR/Embroidery/EmbroideryFile.pb-c.c @@ -0,0 +1,170 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: EmbroideryFile.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "EmbroideryFile.pb-c.h" +void embroidery_file__init + (EmbroideryFile *message) +{ + static const EmbroideryFile init_value = EMBROIDERY_FILE__INIT; + *message = init_value; +} +size_t embroidery_file__get_packed_size + (const EmbroideryFile *message) +{ + assert(message->base.descriptor == &embroidery_file__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t embroidery_file__pack + (const EmbroideryFile *message, + uint8_t *out) +{ + assert(message->base.descriptor == &embroidery_file__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t embroidery_file__pack_to_buffer + (const EmbroideryFile *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &embroidery_file__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +EmbroideryFile * + embroidery_file__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (EmbroideryFile *) + protobuf_c_message_unpack (&embroidery_file__descriptor, + allocator, len, data); +} +void embroidery_file__free_unpacked + (EmbroideryFile *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &embroidery_file__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor embroidery_file__field_descriptors[7] = +{ + { + "DesignName", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(EmbroideryFile, designname), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "FileName", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(EmbroideryFile, filename), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "StitchCount", + 3, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(EmbroideryFile, has_stitchcount), + offsetof(EmbroideryFile, stitchcount), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "ColorCount", + 4, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(EmbroideryFile, has_colorcount), + offsetof(EmbroideryFile, colorcount), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Extents", + 5, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_MESSAGE, + 0, /* quantifier_offset */ + offsetof(EmbroideryFile, extents), + &extents__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Colors", + 6, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(EmbroideryFile, n_colors), + offsetof(EmbroideryFile, colors), + &stitch_color__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Stitches", + 7, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(EmbroideryFile, n_stitches), + offsetof(EmbroideryFile, stitches), + &stitch__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned embroidery_file__field_indices_by_name[] = { + 3, /* field[3] = ColorCount */ + 5, /* field[5] = Colors */ + 0, /* field[0] = DesignName */ + 4, /* field[4] = Extents */ + 1, /* field[1] = FileName */ + 2, /* field[2] = StitchCount */ + 6, /* field[6] = Stitches */ +}; +static const ProtobufCIntRange embroidery_file__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 7 } +}; +const ProtobufCMessageDescriptor embroidery_file__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "EmbroideryFile", + "EmbroideryFile", + "EmbroideryFile", + "", + sizeof(EmbroideryFile), + 7, + embroidery_file__field_descriptors, + embroidery_file__field_indices_by_name, + 1, embroidery_file__number_ranges, + (ProtobufCMessageInit) embroidery_file__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Embroidery/Tango.Embroidery/PMR/Embroidery/EmbroideryFile.pb-c.h b/Software/Visual_Studio/Embroidery/Tango.Embroidery/PMR/Embroidery/EmbroideryFile.pb-c.h new file mode 100644 index 000000000..2ffee6518 --- /dev/null +++ b/Software/Visual_Studio/Embroidery/Tango.Embroidery/PMR/Embroidery/EmbroideryFile.pb-c.h @@ -0,0 +1,84 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: EmbroideryFile.proto */ + +#ifndef PROTOBUF_C_EmbroideryFile_2eproto__INCLUDED +#define PROTOBUF_C_EmbroideryFile_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + +#include "Extents.pb-c.h" +#include "Stitch.pb-c.h" +#include "StitchColor.pb-c.h" + +typedef struct _EmbroideryFile EmbroideryFile; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _EmbroideryFile +{ + ProtobufCMessage base; + char *designname; + char *filename; + protobuf_c_boolean has_stitchcount; + int32_t stitchcount; + protobuf_c_boolean has_colorcount; + int32_t colorcount; + Extents *extents; + size_t n_colors; + StitchColor **colors; + size_t n_stitches; + Stitch **stitches; +}; +#define EMBROIDERY_FILE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&embroidery_file__descriptor) \ + , NULL, NULL, 0, 0, 0, 0, NULL, 0,NULL, 0,NULL } + + +/* EmbroideryFile methods */ +void embroidery_file__init + (EmbroideryFile *message); +size_t embroidery_file__get_packed_size + (const EmbroideryFile *message); +size_t embroidery_file__pack + (const EmbroideryFile *message, + uint8_t *out); +size_t embroidery_file__pack_to_buffer + (const EmbroideryFile *message, + ProtobufCBuffer *buffer); +EmbroideryFile * + embroidery_file__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void embroidery_file__free_unpacked + (EmbroideryFile *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*EmbroideryFile_Closure) + (const EmbroideryFile *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor embroidery_file__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_EmbroideryFile_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Embroidery/Tango.Embroidery/PMR/Embroidery/Extents.pb-c.c b/Software/Visual_Studio/Embroidery/Tango.Embroidery/PMR/Embroidery/Extents.pb-c.c new file mode 100644 index 000000000..69cba25cf --- /dev/null +++ b/Software/Visual_Studio/Embroidery/Tango.Embroidery/PMR/Embroidery/Extents.pb-c.c @@ -0,0 +1,131 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: Extents.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "Extents.pb-c.h" +void extents__init + (Extents *message) +{ + static const Extents init_value = EXTENTS__INIT; + *message = init_value; +} +size_t extents__get_packed_size + (const Extents *message) +{ + assert(message->base.descriptor == &extents__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t extents__pack + (const Extents *message, + uint8_t *out) +{ + assert(message->base.descriptor == &extents__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t extents__pack_to_buffer + (const Extents *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &extents__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +Extents * + extents__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (Extents *) + protobuf_c_message_unpack (&extents__descriptor, + allocator, len, data); +} +void extents__free_unpacked + (Extents *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &extents__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor extents__field_descriptors[4] = +{ + { + "X1", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(Extents, has_x1), + offsetof(Extents, x1), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Y1", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(Extents, has_y1), + offsetof(Extents, y1), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "X2", + 3, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(Extents, has_x2), + offsetof(Extents, x2), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Y2", + 4, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(Extents, has_y2), + offsetof(Extents, y2), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned extents__field_indices_by_name[] = { + 0, /* field[0] = X1 */ + 2, /* field[2] = X2 */ + 1, /* field[1] = Y1 */ + 3, /* field[3] = Y2 */ +}; +static const ProtobufCIntRange extents__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 4 } +}; +const ProtobufCMessageDescriptor extents__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Extents", + "Extents", + "Extents", + "", + sizeof(Extents), + 4, + extents__field_descriptors, + extents__field_indices_by_name, + 1, extents__number_ranges, + (ProtobufCMessageInit) extents__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Embroidery/Tango.Embroidery/PMR/Embroidery/Extents.pb-c.h b/Software/Visual_Studio/Embroidery/Tango.Embroidery/PMR/Embroidery/Extents.pb-c.h new file mode 100644 index 000000000..a7d867bab --- /dev/null +++ b/Software/Visual_Studio/Embroidery/Tango.Embroidery/PMR/Embroidery/Extents.pb-c.h @@ -0,0 +1,78 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: Extents.proto */ + +#ifndef PROTOBUF_C_Extents_2eproto__INCLUDED +#define PROTOBUF_C_Extents_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _Extents Extents; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _Extents +{ + ProtobufCMessage base; + protobuf_c_boolean has_x1; + int32_t x1; + protobuf_c_boolean has_y1; + int32_t y1; + protobuf_c_boolean has_x2; + int32_t x2; + protobuf_c_boolean has_y2; + int32_t y2; +}; +#define EXTENTS__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&extents__descriptor) \ + , 0, 0, 0, 0, 0, 0, 0, 0 } + + +/* Extents methods */ +void extents__init + (Extents *message); +size_t extents__get_packed_size + (const Extents *message); +size_t extents__pack + (const Extents *message, + uint8_t *out); +size_t extents__pack_to_buffer + (const Extents *message, + ProtobufCBuffer *buffer); +Extents * + extents__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void extents__free_unpacked + (Extents *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*Extents_Closure) + (const Extents *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor extents__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_Extents_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Embroidery/Tango.Embroidery/PMR/Embroidery/Stitch.pb-c.c b/Software/Visual_Studio/Embroidery/Tango.Embroidery/PMR/Embroidery/Stitch.pb-c.c new file mode 100644 index 000000000..3d0e895bf --- /dev/null +++ b/Software/Visual_Studio/Embroidery/Tango.Embroidery/PMR/Embroidery/Stitch.pb-c.c @@ -0,0 +1,196 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: Stitch.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "Stitch.pb-c.h" +void stitch__init + (Stitch *message) +{ + static const Stitch init_value = STITCH__INIT; + *message = init_value; +} +size_t stitch__get_packed_size + (const Stitch *message) +{ + assert(message->base.descriptor == &stitch__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t stitch__pack + (const Stitch *message, + uint8_t *out) +{ + assert(message->base.descriptor == &stitch__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t stitch__pack_to_buffer + (const Stitch *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &stitch__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +Stitch * + stitch__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (Stitch *) + protobuf_c_message_unpack (&stitch__descriptor, + allocator, len, data); +} +void stitch__free_unpacked + (Stitch *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &stitch__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor stitch__field_descriptors[9] = +{ + { + "Flag", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_ENUM, + offsetof(Stitch, has_flag), + offsetof(Stitch, flag), + &stitch_flag__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "XX", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(Stitch, has_xx), + offsetof(Stitch, xx), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "YY", + 3, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(Stitch, has_yy), + offsetof(Stitch, yy), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "DX", + 4, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(Stitch, has_dx), + offsetof(Stitch, dx), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "DY", + 5, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(Stitch, has_dy), + offsetof(Stitch, dy), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Length", + 6, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(Stitch, has_length), + offsetof(Stitch, length), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Angle", + 7, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(Stitch, has_angle), + offsetof(Stitch, angle), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "DAngle", + 8, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(Stitch, has_dangle), + offsetof(Stitch, dangle), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "ColorIndex", + 9, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(Stitch, has_colorindex), + offsetof(Stitch, colorindex), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned stitch__field_indices_by_name[] = { + 6, /* field[6] = Angle */ + 8, /* field[8] = ColorIndex */ + 7, /* field[7] = DAngle */ + 3, /* field[3] = DX */ + 4, /* field[4] = DY */ + 0, /* field[0] = Flag */ + 5, /* field[5] = Length */ + 1, /* field[1] = XX */ + 2, /* field[2] = YY */ +}; +static const ProtobufCIntRange stitch__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 9 } +}; +const ProtobufCMessageDescriptor stitch__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Stitch", + "Stitch", + "Stitch", + "", + sizeof(Stitch), + 9, + stitch__field_descriptors, + stitch__field_indices_by_name, + 1, stitch__number_ranges, + (ProtobufCMessageInit) stitch__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Embroidery/Tango.Embroidery/PMR/Embroidery/Stitch.pb-c.h b/Software/Visual_Studio/Embroidery/Tango.Embroidery/PMR/Embroidery/Stitch.pb-c.h new file mode 100644 index 000000000..157dbce02 --- /dev/null +++ b/Software/Visual_Studio/Embroidery/Tango.Embroidery/PMR/Embroidery/Stitch.pb-c.h @@ -0,0 +1,89 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: Stitch.proto */ + +#ifndef PROTOBUF_C_Stitch_2eproto__INCLUDED +#define PROTOBUF_C_Stitch_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + +#include "StitchFlag.pb-c.h" + +typedef struct _Stitch Stitch; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _Stitch +{ + ProtobufCMessage base; + protobuf_c_boolean has_flag; + StitchFlag flag; + protobuf_c_boolean has_xx; + double xx; + protobuf_c_boolean has_yy; + double yy; + protobuf_c_boolean has_dx; + double dx; + protobuf_c_boolean has_dy; + double dy; + protobuf_c_boolean has_length; + double length; + protobuf_c_boolean has_angle; + double angle; + protobuf_c_boolean has_dangle; + double dangle; + protobuf_c_boolean has_colorindex; + int32_t colorindex; +}; +#define STITCH__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&stitch__descriptor) \ + , 0, STITCH_FLAG__NORMAL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } + + +/* Stitch methods */ +void stitch__init + (Stitch *message); +size_t stitch__get_packed_size + (const Stitch *message); +size_t stitch__pack + (const Stitch *message, + uint8_t *out); +size_t stitch__pack_to_buffer + (const Stitch *message, + ProtobufCBuffer *buffer); +Stitch * + stitch__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void stitch__free_unpacked + (Stitch *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*Stitch_Closure) + (const Stitch *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor stitch__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_Stitch_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Embroidery/Tango.Embroidery/PMR/Embroidery/StitchColor.pb-c.c b/Software/Visual_Studio/Embroidery/Tango.Embroidery/PMR/Embroidery/StitchColor.pb-c.c new file mode 100644 index 000000000..a33e76d5a --- /dev/null +++ b/Software/Visual_Studio/Embroidery/Tango.Embroidery/PMR/Embroidery/StitchColor.pb-c.c @@ -0,0 +1,118 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StitchColor.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StitchColor.pb-c.h" +void stitch_color__init + (StitchColor *message) +{ + static const StitchColor init_value = STITCH_COLOR__INIT; + *message = init_value; +} +size_t stitch_color__get_packed_size + (const StitchColor *message) +{ + assert(message->base.descriptor == &stitch_color__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t stitch_color__pack + (const StitchColor *message, + uint8_t *out) +{ + assert(message->base.descriptor == &stitch_color__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t stitch_color__pack_to_buffer + (const StitchColor *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &stitch_color__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +StitchColor * + stitch_color__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (StitchColor *) + protobuf_c_message_unpack (&stitch_color__descriptor, + allocator, len, data); +} +void stitch_color__free_unpacked + (StitchColor *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &stitch_color__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor stitch_color__field_descriptors[3] = +{ + { + "Red", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(StitchColor, has_red), + offsetof(StitchColor, red), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Green", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(StitchColor, has_green), + offsetof(StitchColor, green), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Blue", + 3, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(StitchColor, has_blue), + offsetof(StitchColor, blue), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned stitch_color__field_indices_by_name[] = { + 2, /* field[2] = Blue */ + 1, /* field[1] = Green */ + 0, /* field[0] = Red */ +}; +static const ProtobufCIntRange stitch_color__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 3 } +}; +const ProtobufCMessageDescriptor stitch_color__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "StitchColor", + "StitchColor", + "StitchColor", + "", + sizeof(StitchColor), + 3, + stitch_color__field_descriptors, + stitch_color__field_indices_by_name, + 1, stitch_color__number_ranges, + (ProtobufCMessageInit) stitch_color__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Embroidery/Tango.Embroidery/PMR/Embroidery/StitchColor.pb-c.h b/Software/Visual_Studio/Embroidery/Tango.Embroidery/PMR/Embroidery/StitchColor.pb-c.h new file mode 100644 index 000000000..38ad23dca --- /dev/null +++ b/Software/Visual_Studio/Embroidery/Tango.Embroidery/PMR/Embroidery/StitchColor.pb-c.h @@ -0,0 +1,76 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StitchColor.proto */ + +#ifndef PROTOBUF_C_StitchColor_2eproto__INCLUDED +#define PROTOBUF_C_StitchColor_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _StitchColor StitchColor; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _StitchColor +{ + ProtobufCMessage base; + protobuf_c_boolean has_red; + int32_t red; + protobuf_c_boolean has_green; + int32_t green; + protobuf_c_boolean has_blue; + int32_t blue; +}; +#define STITCH_COLOR__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&stitch_color__descriptor) \ + , 0, 0, 0, 0, 0, 0 } + + +/* StitchColor methods */ +void stitch_color__init + (StitchColor *message); +size_t stitch_color__get_packed_size + (const StitchColor *message); +size_t stitch_color__pack + (const StitchColor *message, + uint8_t *out); +size_t stitch_color__pack_to_buffer + (const StitchColor *message, + ProtobufCBuffer *buffer); +StitchColor * + stitch_color__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void stitch_color__free_unpacked + (StitchColor *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*StitchColor_Closure) + (const StitchColor *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor stitch_color__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StitchColor_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Embroidery/Tango.Embroidery/PMR/Embroidery/StitchFlag.pb-c.c b/Software/Visual_Studio/Embroidery/Tango.Embroidery/PMR/Embroidery/StitchFlag.pb-c.c new file mode 100644 index 000000000..1936a5436 --- /dev/null +++ b/Software/Visual_Studio/Embroidery/Tango.Embroidery/PMR/Embroidery/StitchFlag.pb-c.c @@ -0,0 +1,45 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StitchFlag.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StitchFlag.pb-c.h" +static const ProtobufCEnumValue stitch_flag__enum_values_by_number[6] = +{ + { "NORMAL", "STITCH_FLAG__NORMAL", 0 }, + { "JUMP", "STITCH_FLAG__JUMP", 1 }, + { "TRIM", "STITCH_FLAG__TRIM", 2 }, + { "STOP", "STITCH_FLAG__STOP", 4 }, + { "SEQUIN", "STITCH_FLAG__SEQUIN", 8 }, + { "END", "STITCH_FLAG__END", 16 }, +}; +static const ProtobufCIntRange stitch_flag__value_ranges[] = { +{0, 0},{4, 3},{8, 4},{16, 5},{0, 6} +}; +static const ProtobufCEnumValueIndex stitch_flag__enum_values_by_name[6] = +{ + { "END", 5 }, + { "JUMP", 1 }, + { "NORMAL", 0 }, + { "SEQUIN", 4 }, + { "STOP", 3 }, + { "TRIM", 2 }, +}; +const ProtobufCEnumDescriptor stitch_flag__descriptor = +{ + PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC, + "StitchFlag", + "StitchFlag", + "StitchFlag", + "", + 6, + stitch_flag__enum_values_by_number, + 6, + stitch_flag__enum_values_by_name, + 4, + stitch_flag__value_ranges, + NULL,NULL,NULL,NULL /* reserved[1234] */ +}; diff --git a/Software/Visual_Studio/Embroidery/Tango.Embroidery/PMR/Embroidery/StitchFlag.pb-c.h b/Software/Visual_Studio/Embroidery/Tango.Embroidery/PMR/Embroidery/StitchFlag.pb-c.h new file mode 100644 index 000000000..81c090e35 --- /dev/null +++ b/Software/Visual_Studio/Embroidery/Tango.Embroidery/PMR/Embroidery/StitchFlag.pb-c.h @@ -0,0 +1,47 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StitchFlag.proto */ + +#ifndef PROTOBUF_C_StitchFlag_2eproto__INCLUDED +#define PROTOBUF_C_StitchFlag_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + + + +/* --- enums --- */ + +typedef enum _StitchFlag { + STITCH_FLAG__NORMAL = 0, + STITCH_FLAG__JUMP = 1, + STITCH_FLAG__TRIM = 2, + STITCH_FLAG__STOP = 4, + STITCH_FLAG__SEQUIN = 8, + STITCH_FLAG__END = 16 + PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(STITCH_FLAG) +} StitchFlag; + +/* --- messages --- */ + +/* --- per-message closures --- */ + + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCEnumDescriptor stitch_flag__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StitchFlag_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Embroidery/Tango.Embroidery/ReadMe.txt b/Software/Visual_Studio/Embroidery/Tango.Embroidery/ReadMe.txt new file mode 100644 index 000000000..3b4457a2e --- /dev/null +++ b/Software/Visual_Studio/Embroidery/Tango.Embroidery/ReadMe.txt @@ -0,0 +1,48 @@ +======================================================================== + DYNAMIC LINK LIBRARY : Tango.Embroidery Project Overview +======================================================================== + +AppWizard has created this Tango.Embroidery DLL for you. + +This file contains a summary of what you will find in each of the files that +make up your Tango.Embroidery application. + + +Tango.Embroidery.vcxproj + This is the main project file for VC++ projects generated using an Application Wizard. + It contains information about the version of Visual C++ that generated the file, and + information about the platforms, configurations, and project features selected with the + Application Wizard. + +Tango.Embroidery.vcxproj.filters + This is the filters file for VC++ projects generated using an Application Wizard. + It contains information about the association between the files in your project + and the filters. This association is used in the IDE to show grouping of files with + similar extensions under a specific node (for e.g. ".cpp" files are associated with the + "Source Files" filter). + +Tango.Embroidery.cpp + This is the main DLL source file. + + When created, this DLL does not export any symbols. As a result, it + will not produce a .lib file when it is built. If you wish this project + to be a project dependency of some other project, you will either need to + add code to export some symbols from the DLL so that an export library + will be produced, or you can set the Ignore Input Library property to Yes + on the General propert page of the Linker folder in the project's Property + Pages dialog box. + +///////////////////////////////////////////////////////////////////////////// +Other standard files: + +StdAfx.h, StdAfx.cpp + These files are used to build a precompiled header (PCH) file + named Tango.Embroidery.pch and a precompiled types file named StdAfx.obj. + +///////////////////////////////////////////////////////////////////////////// +Other notes: + +AppWizard uses "TODO:" comments to indicate parts of the source code you +should add to or customize. + +///////////////////////////////////////////////////////////////////////////// diff --git a/Software/Visual_Studio/Embroidery/Tango.Embroidery/Tango.Embroidery.cpp b/Software/Visual_Studio/Embroidery/Tango.Embroidery/Tango.Embroidery.cpp new file mode 100644 index 000000000..52849029e --- /dev/null +++ b/Software/Visual_Studio/Embroidery/Tango.Embroidery/Tango.Embroidery.cpp @@ -0,0 +1,6 @@ +// Tango.Embroidery.cpp : Defines the exported functions for the DLL application. +// + +#include "stdafx.h" + + diff --git a/Software/Visual_Studio/Embroidery/Tango.Embroidery/Tango.Embroidery.vcxproj b/Software/Visual_Studio/Embroidery/Tango.Embroidery/Tango.Embroidery.vcxproj new file mode 100644 index 000000000..a1b46dae7 --- /dev/null +++ b/Software/Visual_Studio/Embroidery/Tango.Embroidery/Tango.Embroidery.vcxproj @@ -0,0 +1,179 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <PropertyGroup Label="Globals"> + <VCProjectVersion>15.0</VCProjectVersion> + <ProjectGuid>{A37247ED-B26B-42EE-9F3B-EF0FDEB381F1}</ProjectGuid> + <Keyword>Win32Proj</Keyword> + <RootNamespace>TangoEmbroidery</RootNamespace> + <WindowsTargetPlatformVersion>10.0.15063.0</WindowsTargetPlatformVersion> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v141</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v141</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v141</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> + <ConfigurationType>DynamicLibrary</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v141</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="Shared"> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <LinkIncremental>true</LinkIncremental> + <OutDir>$(SolutionDir)Build\Debug</OutDir> + <IncludePath>$(ProjectDir);$(IncludePath)</IncludePath> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <LinkIncremental>true</LinkIncremental> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <LinkIncremental>false</LinkIncremental> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <LinkIncremental>false</LinkIncremental> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <PreprocessorDefinitions>WIN32;_DEBUG;_WINDOWS;_USRDLL;TANGOEMBROIDERY_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AdditionalIncludeDirectories>..\libembroidery;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + </ClCompile> + <Link> + <SubSystem>Windows</SubSystem> + </Link> + <PreBuildEvent> + <Command>"$(TargetDir)proto-tc.exe" -i "$(SolutionDir)..\PMR\Messages" -o "$(SolutionDir)Embroidery\Tango.Embroidery\PMR" -l C -c "Embroidery"</Command> + </PreBuildEvent> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ClCompile> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <Optimization>Disabled</Optimization> + <PreprocessorDefinitions>_DEBUG;_WINDOWS;_USRDLL;TANGOEMBROIDERY_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ClCompile> + <Link> + <SubSystem>Windows</SubSystem> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <PrecompiledHeader> + </PrecompiledHeader> + <Optimization>MaxSpeed</Optimization> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;_USRDLL;TANGOEMBROIDERY_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ClCompile> + <Link> + <SubSystem>Windows</SubSystem> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <PrecompiledHeader> + </PrecompiledHeader> + <Optimization>MaxSpeed</Optimization> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <PreprocessorDefinitions>NDEBUG;_WINDOWS;_USRDLL;TANGOEMBROIDERY_EXPORTS;%(PreprocessorDefinitions)</PreprocessorDefinitions> + </ClCompile> + <Link> + <SubSystem>Windows</SubSystem> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + </ItemDefinitionGroup> + <ItemGroup> + <ClInclude Include="Adapter.h" /> + <ClInclude Include="PMR\Embroidery\AnalyzeInput.pb-c.h" /> + <ClInclude Include="PMR\Embroidery\AnalyzeOutput.pb-c.h" /> + <ClInclude Include="PMR\Embroidery\EmbroideryFile.pb-c.h" /> + <ClInclude Include="PMR\Embroidery\Extents.pb-c.h" /> + <ClInclude Include="PMR\Embroidery\Stitch.pb-c.h" /> + <ClInclude Include="PMR\Embroidery\StitchColor.pb-c.h" /> + <ClInclude Include="PMR\Embroidery\StitchFlag.pb-c.h" /> + <ClInclude Include="protobuf-c\protobuf-c.h" /> + <ClInclude Include="targetver.h" /> + </ItemGroup> + <ItemGroup> + <ClCompile Include="Adapter.cpp" /> + <ClCompile Include="Exports.cpp" /> + <ClCompile Include="PMR\Embroidery\AnalyzeInput.pb-c.c" /> + <ClCompile Include="PMR\Embroidery\AnalyzeOutput.pb-c.c" /> + <ClCompile Include="PMR\Embroidery\EmbroideryFile.pb-c.c" /> + <ClCompile Include="PMR\Embroidery\Extents.pb-c.c" /> + <ClCompile Include="PMR\Embroidery\Stitch.pb-c.c" /> + <ClCompile Include="PMR\Embroidery\StitchColor.pb-c.c" /> + <ClCompile Include="PMR\Embroidery\StitchFlag.pb-c.c" /> + <ClCompile Include="protobuf-c\protobuf-c.c" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="..\project-files\visualstudio\libEmbroideryVS2008.vcxproj"> + <Project>{bd30c7bd-9230-4ed7-b581-11f14041909d}</Project> + </ProjectReference> + </ItemGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/Embroidery/Tango.Embroidery/Tango.Embroidery.vcxproj.filters b/Software/Visual_Studio/Embroidery/Tango.Embroidery/Tango.Embroidery.vcxproj.filters new file mode 100644 index 000000000..22880e107 --- /dev/null +++ b/Software/Visual_Studio/Embroidery/Tango.Embroidery/Tango.Embroidery.vcxproj.filters @@ -0,0 +1,87 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <Filter Include="Source Files"> + <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> + <Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions> + </Filter> + <Filter Include="Header Files"> + <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> + <Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions> + </Filter> + <Filter Include="Resource Files"> + <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> + <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions> + </Filter> + <Filter Include="PMR"> + <UniqueIdentifier>{c6ccb6e7-0a29-4791-be2f-a93d4c529f6c}</UniqueIdentifier> + </Filter> + <Filter Include="Protobuf"> + <UniqueIdentifier>{d2d240d9-7f2b-4414-a875-b0990a75740b}</UniqueIdentifier> + </Filter> + </ItemGroup> + <ItemGroup> + <ClInclude Include="targetver.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="Adapter.h"> + <Filter>Header Files</Filter> + </ClInclude> + <ClInclude Include="PMR\Embroidery\Extents.pb-c.h"> + <Filter>PMR</Filter> + </ClInclude> + <ClInclude Include="PMR\Embroidery\Stitch.pb-c.h"> + <Filter>PMR</Filter> + </ClInclude> + <ClInclude Include="PMR\Embroidery\StitchColor.pb-c.h"> + <Filter>PMR</Filter> + </ClInclude> + <ClInclude Include="PMR\Embroidery\StitchFlag.pb-c.h"> + <Filter>PMR</Filter> + </ClInclude> + <ClInclude Include="PMR\Embroidery\EmbroideryFile.pb-c.h"> + <Filter>PMR</Filter> + </ClInclude> + <ClInclude Include="protobuf-c\protobuf-c.h"> + <Filter>Protobuf</Filter> + </ClInclude> + <ClInclude Include="PMR\Embroidery\AnalyzeInput.pb-c.h"> + <Filter>PMR</Filter> + </ClInclude> + <ClInclude Include="PMR\Embroidery\AnalyzeOutput.pb-c.h"> + <Filter>PMR</Filter> + </ClInclude> + </ItemGroup> + <ItemGroup> + <ClCompile Include="Adapter.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="PMR\Embroidery\Extents.pb-c.c"> + <Filter>PMR</Filter> + </ClCompile> + <ClCompile Include="PMR\Embroidery\Stitch.pb-c.c"> + <Filter>PMR</Filter> + </ClCompile> + <ClCompile Include="PMR\Embroidery\StitchColor.pb-c.c"> + <Filter>PMR</Filter> + </ClCompile> + <ClCompile Include="PMR\Embroidery\StitchFlag.pb-c.c"> + <Filter>PMR</Filter> + </ClCompile> + <ClCompile Include="PMR\Embroidery\EmbroideryFile.pb-c.c"> + <Filter>PMR</Filter> + </ClCompile> + <ClCompile Include="protobuf-c\protobuf-c.c"> + <Filter>Protobuf</Filter> + </ClCompile> + <ClCompile Include="PMR\Embroidery\AnalyzeOutput.pb-c.c"> + <Filter>PMR</Filter> + </ClCompile> + <ClCompile Include="PMR\Embroidery\AnalyzeInput.pb-c.c"> + <Filter>PMR</Filter> + </ClCompile> + <ClCompile Include="Exports.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + </ItemGroup> +</Project>
\ No newline at end of file diff --git a/Software/Visual_Studio/Embroidery/Tango.Embroidery/dllmain.cpp b/Software/Visual_Studio/Embroidery/Tango.Embroidery/dllmain.cpp new file mode 100644 index 000000000..69b58914b --- /dev/null +++ b/Software/Visual_Studio/Embroidery/Tango.Embroidery/dllmain.cpp @@ -0,0 +1,19 @@ +// dllmain.cpp : Defines the entry point for the DLL application. +#include "stdafx.h" + +BOOL APIENTRY DllMain( HMODULE hModule, + DWORD ul_reason_for_call, + LPVOID lpReserved + ) +{ + switch (ul_reason_for_call) + { + case DLL_PROCESS_ATTACH: + case DLL_THREAD_ATTACH: + case DLL_THREAD_DETACH: + case DLL_PROCESS_DETACH: + break; + } + return TRUE; +} + diff --git a/Software/Visual_Studio/Embroidery/Tango.Embroidery/protobuf-c/protobuf-c.c b/Software/Visual_Studio/Embroidery/Tango.Embroidery/protobuf-c/protobuf-c.c new file mode 100644 index 000000000..5debac820 --- /dev/null +++ b/Software/Visual_Studio/Embroidery/Tango.Embroidery/protobuf-c/protobuf-c.c @@ -0,0 +1,3642 @@ +/* + * Copyright (c) 2008-2015, Dave Benson and the protobuf-c authors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/*! \file + * Support library for `protoc-c` generated code. + * + * This file implements the public API used by the code generated + * by `protoc-c`. + * + * \authors Dave Benson and the protobuf-c authors + * + * \copyright 2008-2014. Licensed under the terms of the [BSD-2-Clause] license. + */ + +/** + * \todo 64-BIT OPTIMIZATION: certain implementations use 32-bit math + * even on 64-bit platforms (uint64_size, uint64_pack, parse_uint64). + * + * \todo Use size_t consistently. + */ + +#include <stdlib.h> /* for malloc, free */ +#include <string.h> /* for strcmp, strlen, memcpy, memmove, memset */ + +#include "protobuf-c.h" + +#define TRUE 1 +#define FALSE 0 + +#define PROTOBUF_C__ASSERT_NOT_REACHED() assert(0) + +/* Workaround for Microsoft compilers. */ +#ifdef _MSC_VER +# define inline __inline +#endif + +/** + * \defgroup internal Internal functions and macros + * + * These are not exported by the library but are useful to developers working + * on `libprotobuf-c` itself. + */ + +/** + * \defgroup macros Utility macros for manipulating structures + * + * Macros and constants used to manipulate the base "classes" generated by + * `protobuf-c`. They also define limits and check correctness. + * + * \ingroup internal + * @{ + */ + +/** The maximum length of a 64-bit integer in varint encoding. */ +#define MAX_UINT64_ENCODED_SIZE 10 + +#ifndef PROTOBUF_C_UNPACK_ERROR +# define PROTOBUF_C_UNPACK_ERROR(...) +#endif + +const char protobuf_c_empty_string[] = ""; + +/** + * Internal `ProtobufCMessage` manipulation macro. + * + * Base macro for manipulating a `ProtobufCMessage`. Used by STRUCT_MEMBER() and + * STRUCT_MEMBER_PTR(). + */ +#define STRUCT_MEMBER_P(struct_p, struct_offset) \ + ((void *) ((uint8_t *) (struct_p) + (struct_offset))) + +/** + * Return field in a `ProtobufCMessage` based on offset. + * + * Take a pointer to a `ProtobufCMessage` and find the field at the offset. + * Cast it to the passed type. + */ +#define STRUCT_MEMBER(member_type, struct_p, struct_offset) \ + (*(member_type *) STRUCT_MEMBER_P((struct_p), (struct_offset))) + +/** + * Return field in a `ProtobufCMessage` based on offset. + * + * Take a pointer to a `ProtobufCMessage` and find the field at the offset. Cast + * it to a pointer to the passed type. + */ +#define STRUCT_MEMBER_PTR(member_type, struct_p, struct_offset) \ + ((member_type *) STRUCT_MEMBER_P((struct_p), (struct_offset))) + +/* Assertions for magic numbers. */ + +#define ASSERT_IS_ENUM_DESCRIPTOR(desc) \ + assert((desc)->magic == PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC) + +#define ASSERT_IS_MESSAGE_DESCRIPTOR(desc) \ + assert((desc)->magic == PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC) + +#define ASSERT_IS_MESSAGE(message) \ + ASSERT_IS_MESSAGE_DESCRIPTOR((message)->descriptor) + +#define ASSERT_IS_SERVICE_DESCRIPTOR(desc) \ + assert((desc)->magic == PROTOBUF_C__SERVICE_DESCRIPTOR_MAGIC) + +/**@}*/ + +/* --- version --- */ + +const char * +protobuf_c_version(void) +{ + return PROTOBUF_C_VERSION; +} + +uint32_t +protobuf_c_version_number(void) +{ + return PROTOBUF_C_VERSION_NUMBER; +} + +/* --- allocator --- */ + +static void * +system_alloc(void *allocator_data, size_t size) +{ + return malloc(size); +} + +static void +system_free(void *allocator_data, void *data) +{ + free(data); +} + +static inline void * +do_alloc(ProtobufCAllocator *allocator, size_t size) +{ + return allocator->alloc(allocator->allocator_data, size); +} + +static inline void +do_free(ProtobufCAllocator *allocator, void *data) +{ + if (data != NULL) + allocator->free(allocator->allocator_data, data); +} + +/* + * This allocator uses the system's malloc() and free(). It is the default + * allocator used if NULL is passed as the ProtobufCAllocator to an exported + * function. + */ +static ProtobufCAllocator protobuf_c__allocator = { + .alloc = &system_alloc, + .free = &system_free, + .allocator_data = NULL, +}; + +/* === buffer-simple === */ + +void +protobuf_c_buffer_simple_append(ProtobufCBuffer *buffer, + size_t len, const uint8_t *data) +{ + ProtobufCBufferSimple *simp = (ProtobufCBufferSimple *) buffer; + size_t new_len = simp->len + len; + + if (new_len > simp->alloced) { + ProtobufCAllocator *allocator = simp->allocator; + size_t new_alloced = simp->alloced * 2; + uint8_t *new_data; + + if (allocator == NULL) + allocator = &protobuf_c__allocator; + while (new_alloced < new_len) + new_alloced += new_alloced; + new_data = do_alloc(allocator, new_alloced); + if (!new_data) + return; + memcpy(new_data, simp->data, simp->len); + if (simp->must_free_data) + do_free(allocator, simp->data); + else + simp->must_free_data = TRUE; + simp->data = new_data; + simp->alloced = new_alloced; + } + memcpy(simp->data + simp->len, data, len); + simp->len = new_len; +} + +/** + * \defgroup packedsz protobuf_c_message_get_packed_size() implementation + * + * Routines mainly used by protobuf_c_message_get_packed_size(). + * + * \ingroup internal + * @{ + */ + +/** + * Return the number of bytes required to store the tag for the field. Includes + * 3 bits for the wire-type, and a single bit that denotes the end-of-tag. + * + * \param number + * Field tag to encode. + * \return + * Number of bytes required. + */ +static inline size_t +get_tag_size(uint32_t number) +{ + if (number < (1UL << 4)) { + return 1; + } else if (number < (1UL << 11)) { + return 2; + } else if (number < (1UL << 18)) { + return 3; + } else if (number < (1UL << 25)) { + return 4; + } else { + return 5; + } +} + +/** + * Return the number of bytes required to store a variable-length unsigned + * 32-bit integer in base-128 varint encoding. + * + * \param v + * Value to encode. + * \return + * Number of bytes required. + */ +static inline size_t +uint32_size(uint32_t v) +{ + if (v < (1UL << 7)) { + return 1; + } else if (v < (1UL << 14)) { + return 2; + } else if (v < (1UL << 21)) { + return 3; + } else if (v < (1UL << 28)) { + return 4; + } else { + return 5; + } +} + +/** + * Return the number of bytes required to store a variable-length signed 32-bit + * integer in base-128 varint encoding. + * + * \param v + * Value to encode. + * \return + * Number of bytes required. + */ +static inline size_t +int32_size(int32_t v) +{ + if (v < 0) { + return 10; + } else if (v < (1L << 7)) { + return 1; + } else if (v < (1L << 14)) { + return 2; + } else if (v < (1L << 21)) { + return 3; + } else if (v < (1L << 28)) { + return 4; + } else { + return 5; + } +} + +/** + * Return the ZigZag-encoded 32-bit unsigned integer form of a 32-bit signed + * integer. + * + * \param v + * Value to encode. + * \return + * ZigZag encoded integer. + */ +static inline uint32_t +zigzag32(int32_t v) +{ + if (v < 0) + return (-(uint32_t)v) * 2 - 1; + else + return (uint32_t)(v) * 2; +} + +/** + * Return the number of bytes required to store a signed 32-bit integer, + * converted to an unsigned 32-bit integer with ZigZag encoding, using base-128 + * varint encoding. + * + * \param v + * Value to encode. + * \return + * Number of bytes required. + */ +static inline size_t +sint32_size(int32_t v) +{ + return uint32_size(zigzag32(v)); +} + +/** + * Return the number of bytes required to store a 64-bit unsigned integer in + * base-128 varint encoding. + * + * \param v + * Value to encode. + * \return + * Number of bytes required. + */ +static inline size_t +uint64_size(uint64_t v) +{ + uint32_t upper_v = (uint32_t) (v >> 32); + + if (upper_v == 0) { + return uint32_size((uint32_t) v); + } else if (upper_v < (1UL << 3)) { + return 5; + } else if (upper_v < (1UL << 10)) { + return 6; + } else if (upper_v < (1UL << 17)) { + return 7; + } else if (upper_v < (1UL << 24)) { + return 8; + } else if (upper_v < (1UL << 31)) { + return 9; + } else { + return 10; + } +} + +/** + * Return the ZigZag-encoded 64-bit unsigned integer form of a 64-bit signed + * integer. + * + * \param v + * Value to encode. + * \return + * ZigZag encoded integer. + */ +static inline uint64_t +zigzag64(int64_t v) +{ + if (v < 0) + return (-(uint64_t)v) * 2 - 1; + else + return (uint64_t)(v) * 2; +} + +/** + * Return the number of bytes required to store a signed 64-bit integer, + * converted to an unsigned 64-bit integer with ZigZag encoding, using base-128 + * varint encoding. + * + * \param v + * Value to encode. + * \return + * Number of bytes required. + */ +static inline size_t +sint64_size(int64_t v) +{ + return uint64_size(zigzag64(v)); +} + +/** + * Calculate the serialized size of a single required message field, including + * the space needed by the preceding tag. + * + * \param field + * Field descriptor for member. + * \param member + * Field to encode. + * \return + * Number of bytes required. + */ +static size_t +required_field_get_packed_size(const ProtobufCFieldDescriptor *field, + const void *member) +{ + size_t rv = get_tag_size(field->id); + + switch (field->type) { + case PROTOBUF_C_TYPE_SINT32: + return rv + sint32_size(*(const int32_t *) member); + case PROTOBUF_C_TYPE_ENUM: + case PROTOBUF_C_TYPE_INT32: + return rv + int32_size(*(const int32_t *) member); + case PROTOBUF_C_TYPE_UINT32: + return rv + uint32_size(*(const uint32_t *) member); + case PROTOBUF_C_TYPE_SINT64: + return rv + sint64_size(*(const int64_t *) member); + case PROTOBUF_C_TYPE_INT64: + case PROTOBUF_C_TYPE_UINT64: + return rv + uint64_size(*(const uint64_t *) member); + case PROTOBUF_C_TYPE_SFIXED32: + case PROTOBUF_C_TYPE_FIXED32: + return rv + 4; + case PROTOBUF_C_TYPE_SFIXED64: + case PROTOBUF_C_TYPE_FIXED64: + return rv + 8; + case PROTOBUF_C_TYPE_BOOL: + return rv + 1; + case PROTOBUF_C_TYPE_FLOAT: + return rv + 4; + case PROTOBUF_C_TYPE_DOUBLE: + return rv + 8; + case PROTOBUF_C_TYPE_STRING: { + const char *str = *(char * const *) member; + size_t len = str ? strlen(str) : 0; + return rv + uint32_size(len) + len; + } + case PROTOBUF_C_TYPE_BYTES: { + size_t len = ((const ProtobufCBinaryData *) member)->len; + return rv + uint32_size(len) + len; + } + case PROTOBUF_C_TYPE_MESSAGE: { + const ProtobufCMessage *msg = *(ProtobufCMessage * const *) member; + size_t subrv = msg ? protobuf_c_message_get_packed_size(msg) : 0; + return rv + uint32_size(subrv) + subrv; + } + } + PROTOBUF_C__ASSERT_NOT_REACHED(); + return 0; +} + +/** + * Calculate the serialized size of a single oneof message field, including + * the space needed by the preceding tag. Returns 0 if the oneof field isn't + * selected or is not set. + * + * \param field + * Field descriptor for member. + * \param oneof_case + * Enum value that selects the field in the oneof. + * \param member + * Field to encode. + * \return + * Number of bytes required. + */ +static size_t +oneof_field_get_packed_size(const ProtobufCFieldDescriptor *field, + uint32_t oneof_case, + const void *member) +{ + if (oneof_case != field->id) { + return 0; + } + if (field->type == PROTOBUF_C_TYPE_MESSAGE || + field->type == PROTOBUF_C_TYPE_STRING) + { + const void *ptr = *(const void * const *) member; + if (ptr == NULL || ptr == field->default_value) + return 0; + } + return required_field_get_packed_size(field, member); +} + +/** + * Calculate the serialized size of a single optional message field, including + * the space needed by the preceding tag. Returns 0 if the optional field isn't + * set. + * + * \param field + * Field descriptor for member. + * \param has + * True if the field exists, false if not. + * \param member + * Field to encode. + * \return + * Number of bytes required. + */ +static size_t +optional_field_get_packed_size(const ProtobufCFieldDescriptor *field, + const protobuf_c_boolean has, + const void *member) +{ + if (field->type == PROTOBUF_C_TYPE_MESSAGE || + field->type == PROTOBUF_C_TYPE_STRING) + { + const void *ptr = *(const void * const *) member; + if (ptr == NULL || ptr == field->default_value) + return 0; + } else { + if (!has) + return 0; + } + return required_field_get_packed_size(field, member); +} + +static protobuf_c_boolean +field_is_zeroish(const ProtobufCFieldDescriptor *field, + const void *member) +{ + protobuf_c_boolean ret = FALSE; + + switch (field->type) { + case PROTOBUF_C_TYPE_BOOL: + ret = (0 == *(const protobuf_c_boolean *) member); + break; + case PROTOBUF_C_TYPE_ENUM: + case PROTOBUF_C_TYPE_SINT32: + case PROTOBUF_C_TYPE_INT32: + case PROTOBUF_C_TYPE_UINT32: + case PROTOBUF_C_TYPE_SFIXED32: + case PROTOBUF_C_TYPE_FIXED32: + ret = (0 == *(const uint32_t *) member); + break; + case PROTOBUF_C_TYPE_SINT64: + case PROTOBUF_C_TYPE_INT64: + case PROTOBUF_C_TYPE_UINT64: + case PROTOBUF_C_TYPE_SFIXED64: + case PROTOBUF_C_TYPE_FIXED64: + ret = (0 == *(const uint64_t *) member); + break; + case PROTOBUF_C_TYPE_FLOAT: + ret = (0 == *(const float *) member); + break; + case PROTOBUF_C_TYPE_DOUBLE: + ret = (0 == *(const double *) member); + break; + case PROTOBUF_C_TYPE_STRING: + ret = (NULL == *(const char * const *) member) || + ('\0' == **(const char * const *) member); + break; + case PROTOBUF_C_TYPE_BYTES: + case PROTOBUF_C_TYPE_MESSAGE: + ret = (NULL == *(const void * const *) member); + break; + default: + ret = TRUE; + break; + } + + return ret; +} + +/** + * Calculate the serialized size of a single unlabeled message field, including + * the space needed by the preceding tag. Returns 0 if the field isn't set or + * if it is set to a "zeroish" value (null pointer or 0 for numerical values). + * Unlabeled fields are supported only in proto3. + * + * \param field + * Field descriptor for member. + * \param member + * Field to encode. + * \return + * Number of bytes required. + */ +static size_t +unlabeled_field_get_packed_size(const ProtobufCFieldDescriptor *field, + const void *member) +{ + if (field_is_zeroish(field, member)) + return 0; + return required_field_get_packed_size(field, member); +} + +/** + * Calculate the serialized size of repeated message fields, which may consist + * of any number of values (including 0). Includes the space needed by the + * preceding tags (as needed). + * + * \param field + * Field descriptor for member. + * \param count + * Number of repeated field members. + * \param member + * Field to encode. + * \return + * Number of bytes required. + */ +static size_t +repeated_field_get_packed_size(const ProtobufCFieldDescriptor *field, + size_t count, const void *member) +{ + size_t header_size; + size_t rv = 0; + unsigned i; + void *array = *(void * const *) member; + + if (count == 0) + return 0; + header_size = get_tag_size(field->id); + if (0 == (field->flags & PROTOBUF_C_FIELD_FLAG_PACKED)) + header_size *= count; + + switch (field->type) { + case PROTOBUF_C_TYPE_SINT32: + for (i = 0; i < count; i++) + rv += sint32_size(((int32_t *) array)[i]); + break; + case PROTOBUF_C_TYPE_ENUM: + case PROTOBUF_C_TYPE_INT32: + for (i = 0; i < count; i++) + rv += int32_size(((int32_t *) array)[i]); + break; + case PROTOBUF_C_TYPE_UINT32: + for (i = 0; i < count; i++) + rv += uint32_size(((uint32_t *) array)[i]); + break; + case PROTOBUF_C_TYPE_SINT64: + for (i = 0; i < count; i++) + rv += sint64_size(((int64_t *) array)[i]); + break; + case PROTOBUF_C_TYPE_INT64: + case PROTOBUF_C_TYPE_UINT64: + for (i = 0; i < count; i++) + rv += uint64_size(((uint64_t *) array)[i]); + break; + case PROTOBUF_C_TYPE_SFIXED32: + case PROTOBUF_C_TYPE_FIXED32: + case PROTOBUF_C_TYPE_FLOAT: + rv += 4 * count; + break; + case PROTOBUF_C_TYPE_SFIXED64: + case PROTOBUF_C_TYPE_FIXED64: + case PROTOBUF_C_TYPE_DOUBLE: + rv += 8 * count; + break; + case PROTOBUF_C_TYPE_BOOL: + rv += count; + break; + case PROTOBUF_C_TYPE_STRING: + for (i = 0; i < count; i++) { + size_t len = strlen(((char **) array)[i]); + rv += uint32_size(len) + len; + } + break; + case PROTOBUF_C_TYPE_BYTES: + for (i = 0; i < count; i++) { + size_t len = ((ProtobufCBinaryData *) array)[i].len; + rv += uint32_size(len) + len; + } + break; + case PROTOBUF_C_TYPE_MESSAGE: + for (i = 0; i < count; i++) { + size_t len = protobuf_c_message_get_packed_size( + ((ProtobufCMessage **) array)[i]); + rv += uint32_size(len) + len; + } + break; + } + + if (0 != (field->flags & PROTOBUF_C_FIELD_FLAG_PACKED)) + header_size += uint32_size(rv); + return header_size + rv; +} + +/** + * Calculate the serialized size of an unknown field, i.e. one that is passed + * through mostly uninterpreted. This is required for forward compatibility if + * new fields are added to the message descriptor. + * + * \param field + * Unknown field type. + * \return + * Number of bytes required. + */ +static inline size_t +unknown_field_get_packed_size(const ProtobufCMessageUnknownField *field) +{ + return get_tag_size(field->tag) + field->len; +} + +/**@}*/ + +/* + * Calculate the serialized size of the message. + */ +size_t protobuf_c_message_get_packed_size(const ProtobufCMessage *message) +{ + unsigned i; + size_t rv = 0; + + ASSERT_IS_MESSAGE(message); + for (i = 0; i < message->descriptor->n_fields; i++) { + const ProtobufCFieldDescriptor *field = + message->descriptor->fields + i; + const void *member = + ((const char *) message) + field->offset; + const void *qmember = + ((const char *) message) + field->quantifier_offset; + + if (field->label == PROTOBUF_C_LABEL_REQUIRED) { + rv += required_field_get_packed_size(field, member); + } else if ((field->label == PROTOBUF_C_LABEL_OPTIONAL || + field->label == PROTOBUF_C_LABEL_NONE) && + (0 != (field->flags & PROTOBUF_C_FIELD_FLAG_ONEOF))) { + rv += oneof_field_get_packed_size( + field, + *(const uint32_t *) qmember, + member + ); + } else if (field->label == PROTOBUF_C_LABEL_OPTIONAL) { + rv += optional_field_get_packed_size( + field, + *(protobuf_c_boolean *) qmember, + member + ); + } else if (field->label == PROTOBUF_C_LABEL_NONE) { + rv += unlabeled_field_get_packed_size( + field, + member + ); + } else { + rv += repeated_field_get_packed_size( + field, + *(const size_t *) qmember, + member + ); + } + } + for (i = 0; i < message->n_unknown_fields; i++) + rv += unknown_field_get_packed_size(&message->unknown_fields[i]); + return rv; +} + +/** + * \defgroup pack protobuf_c_message_pack() implementation + * + * Routines mainly used by protobuf_c_message_pack(). + * + * \ingroup internal + * @{ + */ + +/** + * Pack an unsigned 32-bit integer in base-128 varint encoding and return the + * number of bytes written, which must be 5 or less. + * + * \param value + * Value to encode. + * \param[out] out + * Packed value. + * \return + * Number of bytes written to `out`. + */ +static inline size_t +uint32_pack(uint32_t value, uint8_t *out) +{ + unsigned rv = 0; + + if (value >= 0x80) { + out[rv++] = value | 0x80; + value >>= 7; + if (value >= 0x80) { + out[rv++] = value | 0x80; + value >>= 7; + if (value >= 0x80) { + out[rv++] = value | 0x80; + value >>= 7; + if (value >= 0x80) { + out[rv++] = value | 0x80; + value >>= 7; + } + } + } + } + /* assert: value<128 */ + out[rv++] = value; + return rv; +} + +/** + * Pack a signed 32-bit integer and return the number of bytes written. + * Negative numbers are encoded as two's complement 64-bit integers. + * + * \param value + * Value to encode. + * \param[out] out + * Packed value. + * \return + * Number of bytes written to `out`. + */ +static inline size_t +int32_pack(int32_t value, uint8_t *out) +{ + if (value < 0) { + out[0] = value | 0x80; + out[1] = (value >> 7) | 0x80; + out[2] = (value >> 14) | 0x80; + out[3] = (value >> 21) | 0x80; + out[4] = (value >> 28) | 0x80; + out[5] = out[6] = out[7] = out[8] = 0xff; + out[9] = 0x01; + return 10; + } else { + return uint32_pack(value, out); + } +} + +/** + * Pack a signed 32-bit integer using ZigZag encoding and return the number of + * bytes written. + * + * \param value + * Value to encode. + * \param[out] out + * Packed value. + * \return + * Number of bytes written to `out`. + */ +static inline size_t +sint32_pack(int32_t value, uint8_t *out) +{ + return uint32_pack(zigzag32(value), out); +} + +/** + * Pack a 64-bit unsigned integer using base-128 varint encoding and return the + * number of bytes written. + * + * \param value + * Value to encode. + * \param[out] out + * Packed value. + * \return + * Number of bytes written to `out`. + */ +static size_t +uint64_pack(uint64_t value, uint8_t *out) +{ + uint32_t hi = (uint32_t) (value >> 32); + uint32_t lo = (uint32_t) value; + unsigned rv; + + if (hi == 0) + return uint32_pack((uint32_t) lo, out); + out[0] = (lo) | 0x80; + out[1] = (lo >> 7) | 0x80; + out[2] = (lo >> 14) | 0x80; + out[3] = (lo >> 21) | 0x80; + if (hi < 8) { + out[4] = (hi << 4) | (lo >> 28); + return 5; + } else { + out[4] = ((hi & 7) << 4) | (lo >> 28) | 0x80; + hi >>= 3; + } + rv = 5; + while (hi >= 128) { + out[rv++] = hi | 0x80; + hi >>= 7; + } + out[rv++] = hi; + return rv; +} + +/** + * Pack a 64-bit signed integer in ZigZag encoding and return the number of + * bytes written. + * + * \param value + * Value to encode. + * \param[out] out + * Packed value. + * \return + * Number of bytes written to `out`. + */ +static inline size_t +sint64_pack(int64_t value, uint8_t *out) +{ + return uint64_pack(zigzag64(value), out); +} + +/** + * Pack a 32-bit quantity in little-endian byte order. Used for protobuf wire + * types fixed32, sfixed32, float. Similar to "htole32". + * + * \param value + * Value to encode. + * \param[out] out + * Packed value. + * \return + * Number of bytes written to `out`. + */ +static inline size_t +fixed32_pack(uint32_t value, void *out) +{ +#if !defined(WORDS_BIGENDIAN) + memcpy(out, &value, 4); +#else + uint8_t *buf = out; + + buf[0] = value; + buf[1] = value >> 8; + buf[2] = value >> 16; + buf[3] = value >> 24; +#endif + return 4; +} + +/** + * Pack a 64-bit quantity in little-endian byte order. Used for protobuf wire + * types fixed64, sfixed64, double. Similar to "htole64". + * + * \todo The big-endian impl is really only good for 32-bit machines, a 64-bit + * version would be appreciated, plus a way to decide to use 64-bit math where + * convenient. + * + * \param value + * Value to encode. + * \param[out] out + * Packed value. + * \return + * Number of bytes written to `out`. + */ +static inline size_t +fixed64_pack(uint64_t value, void *out) +{ +#if !defined(WORDS_BIGENDIAN) + memcpy(out, &value, 8); +#else + fixed32_pack(value, out); + fixed32_pack(value >> 32, ((char *) out) + 4); +#endif + return 8; +} + +/** + * Pack a boolean value as an integer and return the number of bytes written. + * + * \todo Perhaps on some platforms *out = !!value would be a better impl, b/c + * that is idiomatic C++ in some STL implementations. + * + * \param value + * Value to encode. + * \param[out] out + * Packed value. + * \return + * Number of bytes written to `out`. + */ +static inline size_t +boolean_pack(protobuf_c_boolean value, uint8_t *out) +{ + *out = value ? TRUE : FALSE; + return 1; +} + +/** + * Pack a NUL-terminated C string and return the number of bytes written. The + * output includes a length delimiter. + * + * The NULL pointer is treated as an empty string. This isn't really necessary, + * but it allows people to leave required strings blank. (See Issue #13 in the + * bug tracker for a little more explanation). + * + * \param str + * String to encode. + * \param[out] out + * Packed value. + * \return + * Number of bytes written to `out`. + */ +static inline size_t +string_pack(const char *str, uint8_t *out) +{ + if (str == NULL) { + out[0] = 0; + return 1; + } else { + size_t len = strlen(str); + size_t rv = uint32_pack(len, out); + memcpy(out + rv, str, len); + return rv + len; + } +} + +/** + * Pack a ProtobufCBinaryData and return the number of bytes written. The output + * includes a length delimiter. + * + * \param bd + * ProtobufCBinaryData to encode. + * \param[out] out + * Packed value. + * \return + * Number of bytes written to `out`. + */ +static inline size_t +binary_data_pack(const ProtobufCBinaryData *bd, uint8_t *out) +{ + size_t len = bd->len; + size_t rv = uint32_pack(len, out); + memcpy(out + rv, bd->data, len); + return rv + len; +} + +/** + * Pack a ProtobufCMessage and return the number of bytes written. The output + * includes a length delimiter. + * + * \param message + * ProtobufCMessage object to pack. + * \param[out] out + * Packed message. + * \return + * Number of bytes written to `out`. + */ +static inline size_t +prefixed_message_pack(const ProtobufCMessage *message, uint8_t *out) +{ + if (message == NULL) { + out[0] = 0; + return 1; + } else { + size_t rv = protobuf_c_message_pack(message, out + 1); + uint32_t rv_packed_size = uint32_size(rv); + if (rv_packed_size != 1) + memmove(out + rv_packed_size, out + 1, rv); + return uint32_pack(rv, out) + rv; + } +} + +/** + * Pack a field tag. + * + * Wire-type will be added in required_field_pack(). + * + * \todo Just call uint64_pack on 64-bit platforms. + * + * \param id + * Tag value to encode. + * \param[out] out + * Packed value. + * \return + * Number of bytes written to `out`. + */ +static size_t +tag_pack(uint32_t id, uint8_t *out) +{ + if (id < (1UL << (32 - 3))) + return uint32_pack(id << 3, out); + else + return uint64_pack(((uint64_t) id) << 3, out); +} + +/** + * Pack a required field and return the number of bytes written. + * + * \param field + * Field descriptor. + * \param member + * The field member. + * \param[out] out + * Packed value. + * \return + * Number of bytes written to `out`. + */ +static size_t +required_field_pack(const ProtobufCFieldDescriptor *field, + const void *member, uint8_t *out) +{ + size_t rv = tag_pack(field->id, out); + + switch (field->type) { + case PROTOBUF_C_TYPE_SINT32: + out[0] |= PROTOBUF_C_WIRE_TYPE_VARINT; + return rv + sint32_pack(*(const int32_t *) member, out + rv); + case PROTOBUF_C_TYPE_ENUM: + case PROTOBUF_C_TYPE_INT32: + out[0] |= PROTOBUF_C_WIRE_TYPE_VARINT; + return rv + int32_pack(*(const int32_t *) member, out + rv); + case PROTOBUF_C_TYPE_UINT32: + out[0] |= PROTOBUF_C_WIRE_TYPE_VARINT; + return rv + uint32_pack(*(const uint32_t *) member, out + rv); + case PROTOBUF_C_TYPE_SINT64: + out[0] |= PROTOBUF_C_WIRE_TYPE_VARINT; + return rv + sint64_pack(*(const int64_t *) member, out + rv); + case PROTOBUF_C_TYPE_INT64: + case PROTOBUF_C_TYPE_UINT64: + out[0] |= PROTOBUF_C_WIRE_TYPE_VARINT; + return rv + uint64_pack(*(const uint64_t *) member, out + rv); + case PROTOBUF_C_TYPE_SFIXED32: + case PROTOBUF_C_TYPE_FIXED32: + case PROTOBUF_C_TYPE_FLOAT: + out[0] |= PROTOBUF_C_WIRE_TYPE_32BIT; + return rv + fixed32_pack(*(const uint32_t *) member, out + rv); + case PROTOBUF_C_TYPE_SFIXED64: + case PROTOBUF_C_TYPE_FIXED64: + case PROTOBUF_C_TYPE_DOUBLE: + out[0] |= PROTOBUF_C_WIRE_TYPE_64BIT; + return rv + fixed64_pack(*(const uint64_t *) member, out + rv); + case PROTOBUF_C_TYPE_BOOL: + out[0] |= PROTOBUF_C_WIRE_TYPE_VARINT; + return rv + boolean_pack(*(const protobuf_c_boolean *) member, out + rv); + case PROTOBUF_C_TYPE_STRING: + out[0] |= PROTOBUF_C_WIRE_TYPE_LENGTH_PREFIXED; + return rv + string_pack(*(char *const *) member, out + rv); + case PROTOBUF_C_TYPE_BYTES: + out[0] |= PROTOBUF_C_WIRE_TYPE_LENGTH_PREFIXED; + return rv + binary_data_pack((const ProtobufCBinaryData *) member, out + rv); + case PROTOBUF_C_TYPE_MESSAGE: + out[0] |= PROTOBUF_C_WIRE_TYPE_LENGTH_PREFIXED; + return rv + prefixed_message_pack(*(ProtobufCMessage * const *) member, out + rv); + } + PROTOBUF_C__ASSERT_NOT_REACHED(); + return 0; +} + +/** + * Pack a oneof field and return the number of bytes written. Only packs the + * field that is selected by the case enum. + * + * \param field + * Field descriptor. + * \param oneof_case + * Enum value that selects the field in the oneof. + * \param member + * The field member. + * \param[out] out + * Packed value. + * \return + * Number of bytes written to `out`. + */ +static size_t +oneof_field_pack(const ProtobufCFieldDescriptor *field, + uint32_t oneof_case, + const void *member, uint8_t *out) +{ + if (oneof_case != field->id) { + return 0; + } + if (field->type == PROTOBUF_C_TYPE_MESSAGE || + field->type == PROTOBUF_C_TYPE_STRING) + { + const void *ptr = *(const void * const *) member; + if (ptr == NULL || ptr == field->default_value) + return 0; + } + return required_field_pack(field, member, out); +} + +/** + * Pack an optional field and return the number of bytes written. + * + * \param field + * Field descriptor. + * \param has + * Whether the field is set. + * \param member + * The field member. + * \param[out] out + * Packed value. + * \return + * Number of bytes written to `out`. + */ +static size_t +optional_field_pack(const ProtobufCFieldDescriptor *field, + const protobuf_c_boolean has, + const void *member, uint8_t *out) +{ + if (field->type == PROTOBUF_C_TYPE_MESSAGE || + field->type == PROTOBUF_C_TYPE_STRING) + { + const void *ptr = *(const void * const *) member; + if (ptr == NULL || ptr == field->default_value) + return 0; + } else { + if (!has) + return 0; + } + return required_field_pack(field, member, out); +} + +/** + * Pack an unlabeled field and return the number of bytes written. + * + * \param field + * Field descriptor. + * \param member + * The field member. + * \param[out] out + * Packed value. + * \return + * Number of bytes written to `out`. + */ +static size_t +unlabeled_field_pack(const ProtobufCFieldDescriptor *field, + const void *member, uint8_t *out) +{ + if (field_is_zeroish(field, member)) + return 0; + return required_field_pack(field, member, out); +} + +/** + * Given a field type, return the in-memory size. + * + * \todo Implement as a table lookup. + * + * \param type + * Field type. + * \return + * Size of the field. + */ +static inline size_t +sizeof_elt_in_repeated_array(ProtobufCType type) +{ + switch (type) { + case PROTOBUF_C_TYPE_SINT32: + case PROTOBUF_C_TYPE_INT32: + case PROTOBUF_C_TYPE_UINT32: + case PROTOBUF_C_TYPE_SFIXED32: + case PROTOBUF_C_TYPE_FIXED32: + case PROTOBUF_C_TYPE_FLOAT: + case PROTOBUF_C_TYPE_ENUM: + return 4; + case PROTOBUF_C_TYPE_SINT64: + case PROTOBUF_C_TYPE_INT64: + case PROTOBUF_C_TYPE_UINT64: + case PROTOBUF_C_TYPE_SFIXED64: + case PROTOBUF_C_TYPE_FIXED64: + case PROTOBUF_C_TYPE_DOUBLE: + return 8; + case PROTOBUF_C_TYPE_BOOL: + return sizeof(protobuf_c_boolean); + case PROTOBUF_C_TYPE_STRING: + case PROTOBUF_C_TYPE_MESSAGE: + return sizeof(void *); + case PROTOBUF_C_TYPE_BYTES: + return sizeof(ProtobufCBinaryData); + } + PROTOBUF_C__ASSERT_NOT_REACHED(); + return 0; +} + +/** + * Pack an array of 32-bit quantities. + * + * \param[out] out + * Destination. + * \param[in] in + * Source. + * \param[in] n + * Number of elements in the source array. + */ +static void +copy_to_little_endian_32(void *out, const void *in, const unsigned n) +{ +#if !defined(WORDS_BIGENDIAN) + memcpy(out, in, n * 4); +#else + unsigned i; + const uint32_t *ini = in; + for (i = 0; i < n; i++) + fixed32_pack(ini[i], (uint32_t *) out + i); +#endif +} + +/** + * Pack an array of 64-bit quantities. + * + * \param[out] out + * Destination. + * \param[in] in + * Source. + * \param[in] n + * Number of elements in the source array. + */ +static void +copy_to_little_endian_64(void *out, const void *in, const unsigned n) +{ +#if !defined(WORDS_BIGENDIAN) + memcpy(out, in, n * 8); +#else + unsigned i; + const uint64_t *ini = in; + for (i = 0; i < n; i++) + fixed64_pack(ini[i], (uint64_t *) out + i); +#endif +} + +/** + * Get the minimum number of bytes required to pack a field value of a + * particular type. + * + * \param type + * Field type. + * \return + * Number of bytes. + */ +static unsigned +get_type_min_size(ProtobufCType type) +{ + if (type == PROTOBUF_C_TYPE_SFIXED32 || + type == PROTOBUF_C_TYPE_FIXED32 || + type == PROTOBUF_C_TYPE_FLOAT) + { + return 4; + } + if (type == PROTOBUF_C_TYPE_SFIXED64 || + type == PROTOBUF_C_TYPE_FIXED64 || + type == PROTOBUF_C_TYPE_DOUBLE) + { + return 8; + } + return 1; +} + +/** + * Packs the elements of a repeated field and returns the serialised field and + * its length. + * + * \param field + * Field descriptor. + * \param count + * Number of elements in the repeated field array. + * \param member + * Pointer to the elements for this repeated field. + * \param[out] out + * Serialised representation of the repeated field. + * \return + * Number of bytes serialised to `out`. + */ +static size_t +repeated_field_pack(const ProtobufCFieldDescriptor *field, + size_t count, const void *member, uint8_t *out) +{ + void *array = *(void * const *) member; + unsigned i; + + if (0 != (field->flags & PROTOBUF_C_FIELD_FLAG_PACKED)) { + unsigned header_len; + unsigned len_start; + unsigned min_length; + unsigned payload_len; + unsigned length_size_min; + unsigned actual_length_size; + uint8_t *payload_at; + + if (count == 0) + return 0; + header_len = tag_pack(field->id, out); + out[0] |= PROTOBUF_C_WIRE_TYPE_LENGTH_PREFIXED; + len_start = header_len; + min_length = get_type_min_size(field->type) * count; + length_size_min = uint32_size(min_length); + header_len += length_size_min; + payload_at = out + header_len; + + switch (field->type) { + case PROTOBUF_C_TYPE_SFIXED32: + case PROTOBUF_C_TYPE_FIXED32: + case PROTOBUF_C_TYPE_FLOAT: + copy_to_little_endian_32(payload_at, array, count); + payload_at += count * 4; + break; + case PROTOBUF_C_TYPE_SFIXED64: + case PROTOBUF_C_TYPE_FIXED64: + case PROTOBUF_C_TYPE_DOUBLE: + copy_to_little_endian_64(payload_at, array, count); + payload_at += count * 8; + break; + case PROTOBUF_C_TYPE_ENUM: + case PROTOBUF_C_TYPE_INT32: { + const int32_t *arr = (const int32_t *) array; + for (i = 0; i < count; i++) + payload_at += int32_pack(arr[i], payload_at); + break; + } + case PROTOBUF_C_TYPE_SINT32: { + const int32_t *arr = (const int32_t *) array; + for (i = 0; i < count; i++) + payload_at += sint32_pack(arr[i], payload_at); + break; + } + case PROTOBUF_C_TYPE_SINT64: { + const int64_t *arr = (const int64_t *) array; + for (i = 0; i < count; i++) + payload_at += sint64_pack(arr[i], payload_at); + break; + } + case PROTOBUF_C_TYPE_UINT32: { + const uint32_t *arr = (const uint32_t *) array; + for (i = 0; i < count; i++) + payload_at += uint32_pack(arr[i], payload_at); + break; + } + case PROTOBUF_C_TYPE_INT64: + case PROTOBUF_C_TYPE_UINT64: { + const uint64_t *arr = (const uint64_t *) array; + for (i = 0; i < count; i++) + payload_at += uint64_pack(arr[i], payload_at); + break; + } + case PROTOBUF_C_TYPE_BOOL: { + const protobuf_c_boolean *arr = (const protobuf_c_boolean *) array; + for (i = 0; i < count; i++) + payload_at += boolean_pack(arr[i], payload_at); + break; + } + default: + PROTOBUF_C__ASSERT_NOT_REACHED(); + } + + payload_len = payload_at - (out + header_len); + actual_length_size = uint32_size(payload_len); + if (length_size_min != actual_length_size) { + assert(actual_length_size == length_size_min + 1); + memmove(out + header_len + 1, out + header_len, + payload_len); + header_len++; + } + uint32_pack(payload_len, out + len_start); + return header_len + payload_len; + } else { + /* not "packed" cased */ + /* CONSIDER: optimize this case a bit (by putting the loop inside the switch) */ + size_t rv = 0; + unsigned siz = sizeof_elt_in_repeated_array(field->type); + + for (i = 0; i < count; i++) { + rv += required_field_pack(field, array, out + rv); + array = (char *)array + siz; + } + return rv; + } +} + +static size_t +unknown_field_pack(const ProtobufCMessageUnknownField *field, uint8_t *out) +{ + size_t rv = tag_pack(field->tag, out); + out[0] |= field->wire_type; + memcpy(out + rv, field->data, field->len); + return rv + field->len; +} + +/**@}*/ + +size_t +protobuf_c_message_pack(const ProtobufCMessage *message, uint8_t *out) +{ + unsigned i; + size_t rv = 0; + + ASSERT_IS_MESSAGE(message); + for (i = 0; i < message->descriptor->n_fields; i++) { + const ProtobufCFieldDescriptor *field = + message->descriptor->fields + i; + const void *member = ((const char *) message) + field->offset; + + /* + * It doesn't hurt to compute qmember (a pointer to the + * quantifier field of the structure), but the pointer is only + * valid if the field is: + * - a repeated field, or + * - a field that is part of a oneof + * - an optional field that isn't a pointer type + * (Meaning: not a message or a string). + */ + const void *qmember = + ((const char *) message) + field->quantifier_offset; + + if (field->label == PROTOBUF_C_LABEL_REQUIRED) { + rv += required_field_pack(field, member, out + rv); + } else if ((field->label == PROTOBUF_C_LABEL_OPTIONAL || + field->label == PROTOBUF_C_LABEL_NONE) && + (0 != (field->flags & PROTOBUF_C_FIELD_FLAG_ONEOF))) { + rv += oneof_field_pack( + field, + *(const uint32_t *) qmember, + member, + out + rv + ); + } else if (field->label == PROTOBUF_C_LABEL_OPTIONAL) { + rv += optional_field_pack( + field, + *(const protobuf_c_boolean *) qmember, + member, + out + rv + ); + } else if (field->label == PROTOBUF_C_LABEL_NONE) { + rv += unlabeled_field_pack(field, member, out + rv); + } else { + rv += repeated_field_pack(field, *(const size_t *) qmember, + member, out + rv); + } + } + for (i = 0; i < message->n_unknown_fields; i++) + rv += unknown_field_pack(&message->unknown_fields[i], out + rv); + return rv; +} + +/** + * \defgroup packbuf protobuf_c_message_pack_to_buffer() implementation + * + * Routines mainly used by protobuf_c_message_pack_to_buffer(). + * + * \ingroup internal + * @{ + */ + +/** + * Pack a required field to a virtual buffer. + * + * \param field + * Field descriptor. + * \param member + * The element to be packed. + * \param[out] buffer + * Virtual buffer to append data to. + * \return + * Number of bytes packed. + */ +static size_t +required_field_pack_to_buffer(const ProtobufCFieldDescriptor *field, + const void *member, ProtobufCBuffer *buffer) +{ + size_t rv; + uint8_t scratch[MAX_UINT64_ENCODED_SIZE * 2]; + + rv = tag_pack(field->id, scratch); + switch (field->type) { + case PROTOBUF_C_TYPE_SINT32: + scratch[0] |= PROTOBUF_C_WIRE_TYPE_VARINT; + rv += sint32_pack(*(const int32_t *) member, scratch + rv); + buffer->append(buffer, rv, scratch); + break; + case PROTOBUF_C_TYPE_ENUM: + case PROTOBUF_C_TYPE_INT32: + scratch[0] |= PROTOBUF_C_WIRE_TYPE_VARINT; + rv += int32_pack(*(const int32_t *) member, scratch + rv); + buffer->append(buffer, rv, scratch); + break; + case PROTOBUF_C_TYPE_UINT32: + scratch[0] |= PROTOBUF_C_WIRE_TYPE_VARINT; + rv += uint32_pack(*(const uint32_t *) member, scratch + rv); + buffer->append(buffer, rv, scratch); + break; + case PROTOBUF_C_TYPE_SINT64: + scratch[0] |= PROTOBUF_C_WIRE_TYPE_VARINT; + rv += sint64_pack(*(const int64_t *) member, scratch + rv); + buffer->append(buffer, rv, scratch); + break; + case PROTOBUF_C_TYPE_INT64: + case PROTOBUF_C_TYPE_UINT64: + scratch[0] |= PROTOBUF_C_WIRE_TYPE_VARINT; + rv += uint64_pack(*(const uint64_t *) member, scratch + rv); + buffer->append(buffer, rv, scratch); + break; + case PROTOBUF_C_TYPE_SFIXED32: + case PROTOBUF_C_TYPE_FIXED32: + case PROTOBUF_C_TYPE_FLOAT: + scratch[0] |= PROTOBUF_C_WIRE_TYPE_32BIT; + rv += fixed32_pack(*(const uint32_t *) member, scratch + rv); + buffer->append(buffer, rv, scratch); + break; + case PROTOBUF_C_TYPE_SFIXED64: + case PROTOBUF_C_TYPE_FIXED64: + case PROTOBUF_C_TYPE_DOUBLE: + scratch[0] |= PROTOBUF_C_WIRE_TYPE_64BIT; + rv += fixed64_pack(*(const uint64_t *) member, scratch + rv); + buffer->append(buffer, rv, scratch); + break; + case PROTOBUF_C_TYPE_BOOL: + scratch[0] |= PROTOBUF_C_WIRE_TYPE_VARINT; + rv += boolean_pack(*(const protobuf_c_boolean *) member, scratch + rv); + buffer->append(buffer, rv, scratch); + break; + case PROTOBUF_C_TYPE_STRING: { + const char *str = *(char *const *) member; + size_t sublen = str ? strlen(str) : 0; + + scratch[0] |= PROTOBUF_C_WIRE_TYPE_LENGTH_PREFIXED; + rv += uint32_pack(sublen, scratch + rv); + buffer->append(buffer, rv, scratch); + buffer->append(buffer, sublen, (const uint8_t *) str); + rv += sublen; + break; + } + case PROTOBUF_C_TYPE_BYTES: { + const ProtobufCBinaryData *bd = ((const ProtobufCBinaryData *) member); + size_t sublen = bd->len; + + scratch[0] |= PROTOBUF_C_WIRE_TYPE_LENGTH_PREFIXED; + rv += uint32_pack(sublen, scratch + rv); + buffer->append(buffer, rv, scratch); + buffer->append(buffer, sublen, bd->data); + rv += sublen; + break; + } + case PROTOBUF_C_TYPE_MESSAGE: { + uint8_t simple_buffer_scratch[256]; + size_t sublen; + const ProtobufCMessage *msg = *(ProtobufCMessage * const *) member; + ProtobufCBufferSimple simple_buffer = + PROTOBUF_C_BUFFER_SIMPLE_INIT(simple_buffer_scratch); + + scratch[0] |= PROTOBUF_C_WIRE_TYPE_LENGTH_PREFIXED; + if (msg == NULL) + sublen = 0; + else + sublen = protobuf_c_message_pack_to_buffer(msg, &simple_buffer.base); + rv += uint32_pack(sublen, scratch + rv); + buffer->append(buffer, rv, scratch); + buffer->append(buffer, sublen, simple_buffer.data); + rv += sublen; + PROTOBUF_C_BUFFER_SIMPLE_CLEAR(&simple_buffer); + break; + } + default: + PROTOBUF_C__ASSERT_NOT_REACHED(); + } + return rv; +} + +/** + * Pack a oneof field to a buffer. Only packs the field that is selected by the case enum. + * + * \param field + * Field descriptor. + * \param oneof_case + * Enum value that selects the field in the oneof. + * \param member + * The element to be packed. + * \param[out] buffer + * Virtual buffer to append data to. + * \return + * Number of bytes serialised to `buffer`. + */ +static size_t +oneof_field_pack_to_buffer(const ProtobufCFieldDescriptor *field, + uint32_t oneof_case, + const void *member, ProtobufCBuffer *buffer) +{ + if (oneof_case != field->id) { + return 0; + } + if (field->type == PROTOBUF_C_TYPE_MESSAGE || + field->type == PROTOBUF_C_TYPE_STRING) + { + const void *ptr = *(const void *const *) member; + if (ptr == NULL || ptr == field->default_value) + return 0; + } + return required_field_pack_to_buffer(field, member, buffer); +} + +/** + * Pack an optional field to a buffer. + * + * \param field + * Field descriptor. + * \param has + * Whether the field is set. + * \param member + * The element to be packed. + * \param[out] buffer + * Virtual buffer to append data to. + * \return + * Number of bytes serialised to `buffer`. + */ +static size_t +optional_field_pack_to_buffer(const ProtobufCFieldDescriptor *field, + const protobuf_c_boolean has, + const void *member, ProtobufCBuffer *buffer) +{ + if (field->type == PROTOBUF_C_TYPE_MESSAGE || + field->type == PROTOBUF_C_TYPE_STRING) + { + const void *ptr = *(const void *const *) member; + if (ptr == NULL || ptr == field->default_value) + return 0; + } else { + if (!has) + return 0; + } + return required_field_pack_to_buffer(field, member, buffer); +} + +/** + * Pack an unlabeled field to a buffer. + * + * \param field + * Field descriptor. + * \param member + * The element to be packed. + * \param[out] buffer + * Virtual buffer to append data to. + * \return + * Number of bytes serialised to `buffer`. + */ +static size_t +unlabeled_field_pack_to_buffer(const ProtobufCFieldDescriptor *field, + const void *member, ProtobufCBuffer *buffer) +{ + if (field_is_zeroish(field, member)) + return 0; + return required_field_pack_to_buffer(field, member, buffer); +} + +/** + * Get the packed size of an array of same field type. + * + * \param field + * Field descriptor. + * \param count + * Number of elements of this type. + * \param array + * The elements to get the size of. + * \return + * Number of bytes required. + */ +static size_t +get_packed_payload_length(const ProtobufCFieldDescriptor *field, + unsigned count, const void *array) +{ + unsigned rv = 0; + unsigned i; + + switch (field->type) { + case PROTOBUF_C_TYPE_SFIXED32: + case PROTOBUF_C_TYPE_FIXED32: + case PROTOBUF_C_TYPE_FLOAT: + return count * 4; + case PROTOBUF_C_TYPE_SFIXED64: + case PROTOBUF_C_TYPE_FIXED64: + case PROTOBUF_C_TYPE_DOUBLE: + return count * 8; + case PROTOBUF_C_TYPE_ENUM: + case PROTOBUF_C_TYPE_INT32: { + const int32_t *arr = (const int32_t *) array; + for (i = 0; i < count; i++) + rv += int32_size(arr[i]); + break; + } + case PROTOBUF_C_TYPE_SINT32: { + const int32_t *arr = (const int32_t *) array; + for (i = 0; i < count; i++) + rv += sint32_size(arr[i]); + break; + } + case PROTOBUF_C_TYPE_UINT32: { + const uint32_t *arr = (const uint32_t *) array; + for (i = 0; i < count; i++) + rv += uint32_size(arr[i]); + break; + } + case PROTOBUF_C_TYPE_SINT64: { + const int64_t *arr = (const int64_t *) array; + for (i = 0; i < count; i++) + rv += sint64_size(arr[i]); + break; + } + case PROTOBUF_C_TYPE_INT64: + case PROTOBUF_C_TYPE_UINT64: { + const uint64_t *arr = (const uint64_t *) array; + for (i = 0; i < count; i++) + rv += uint64_size(arr[i]); + break; + } + case PROTOBUF_C_TYPE_BOOL: + return count; + default: + PROTOBUF_C__ASSERT_NOT_REACHED(); + } + return rv; +} + +/** + * Pack an array of same field type to a virtual buffer. + * + * \param field + * Field descriptor. + * \param count + * Number of elements of this type. + * \param array + * The elements to get the size of. + * \param[out] buffer + * Virtual buffer to append data to. + * \return + * Number of bytes packed. + */ +static size_t +pack_buffer_packed_payload(const ProtobufCFieldDescriptor *field, + unsigned count, const void *array, + ProtobufCBuffer *buffer) +{ + uint8_t scratch[16]; + size_t rv = 0; + unsigned i; + + switch (field->type) { + case PROTOBUF_C_TYPE_SFIXED32: + case PROTOBUF_C_TYPE_FIXED32: + case PROTOBUF_C_TYPE_FLOAT: +#if !defined(WORDS_BIGENDIAN) + rv = count * 4; + goto no_packing_needed; +#else + for (i = 0; i < count; i++) { + unsigned len = fixed32_pack(((uint32_t *) array)[i], scratch); + buffer->append(buffer, len, scratch); + rv += len; + } + break; +#endif + case PROTOBUF_C_TYPE_SFIXED64: + case PROTOBUF_C_TYPE_FIXED64: + case PROTOBUF_C_TYPE_DOUBLE: +#if !defined(WORDS_BIGENDIAN) + rv = count * 8; + goto no_packing_needed; +#else + for (i = 0; i < count; i++) { + unsigned len = fixed64_pack(((uint64_t *) array)[i], scratch); + buffer->append(buffer, len, scratch); + rv += len; + } + break; +#endif + case PROTOBUF_C_TYPE_ENUM: + case PROTOBUF_C_TYPE_INT32: + for (i = 0; i < count; i++) { + unsigned len = int32_pack(((int32_t *) array)[i], scratch); + buffer->append(buffer, len, scratch); + rv += len; + } + break; + case PROTOBUF_C_TYPE_SINT32: + for (i = 0; i < count; i++) { + unsigned len = sint32_pack(((int32_t *) array)[i], scratch); + buffer->append(buffer, len, scratch); + rv += len; + } + break; + case PROTOBUF_C_TYPE_UINT32: + for (i = 0; i < count; i++) { + unsigned len = uint32_pack(((uint32_t *) array)[i], scratch); + buffer->append(buffer, len, scratch); + rv += len; + } + break; + case PROTOBUF_C_TYPE_SINT64: + for (i = 0; i < count; i++) { + unsigned len = sint64_pack(((int64_t *) array)[i], scratch); + buffer->append(buffer, len, scratch); + rv += len; + } + break; + case PROTOBUF_C_TYPE_INT64: + case PROTOBUF_C_TYPE_UINT64: + for (i = 0; i < count; i++) { + unsigned len = uint64_pack(((uint64_t *) array)[i], scratch); + buffer->append(buffer, len, scratch); + rv += len; + } + break; + case PROTOBUF_C_TYPE_BOOL: + for (i = 0; i < count; i++) { + unsigned len = boolean_pack(((protobuf_c_boolean *) array)[i], scratch); + buffer->append(buffer, len, scratch); + rv += len; + } + return count; + default: + PROTOBUF_C__ASSERT_NOT_REACHED(); + } + return rv; + +#if !defined(WORDS_BIGENDIAN) +no_packing_needed: + buffer->append(buffer, rv, array); + return rv; +#endif +} + +static size_t +repeated_field_pack_to_buffer(const ProtobufCFieldDescriptor *field, + unsigned count, const void *member, + ProtobufCBuffer *buffer) +{ + char *array = *(char * const *) member; + + if (count == 0) + return 0; + if (0 != (field->flags & PROTOBUF_C_FIELD_FLAG_PACKED)) { + uint8_t scratch[MAX_UINT64_ENCODED_SIZE * 2]; + size_t rv = tag_pack(field->id, scratch); + size_t payload_len = get_packed_payload_length(field, count, array); + size_t tmp; + + scratch[0] |= PROTOBUF_C_WIRE_TYPE_LENGTH_PREFIXED; + rv += uint32_pack(payload_len, scratch + rv); + buffer->append(buffer, rv, scratch); + tmp = pack_buffer_packed_payload(field, count, array, buffer); + assert(tmp == payload_len); + return rv + payload_len; + } else { + size_t siz; + unsigned i; + /* CONSIDER: optimize this case a bit (by putting the loop inside the switch) */ + unsigned rv = 0; + + siz = sizeof_elt_in_repeated_array(field->type); + for (i = 0; i < count; i++) { + rv += required_field_pack_to_buffer(field, array, buffer); + array += siz; + } + return rv; + } +} + +static size_t +unknown_field_pack_to_buffer(const ProtobufCMessageUnknownField *field, + ProtobufCBuffer *buffer) +{ + uint8_t header[MAX_UINT64_ENCODED_SIZE]; + size_t rv = tag_pack(field->tag, header); + + header[0] |= field->wire_type; + buffer->append(buffer, rv, header); + buffer->append(buffer, field->len, field->data); + return rv + field->len; +} + +/**@}*/ + +size_t +protobuf_c_message_pack_to_buffer(const ProtobufCMessage *message, + ProtobufCBuffer *buffer) +{ + unsigned i; + size_t rv = 0; + + ASSERT_IS_MESSAGE(message); + for (i = 0; i < message->descriptor->n_fields; i++) { + const ProtobufCFieldDescriptor *field = + message->descriptor->fields + i; + const void *member = + ((const char *) message) + field->offset; + const void *qmember = + ((const char *) message) + field->quantifier_offset; + + if (field->label == PROTOBUF_C_LABEL_REQUIRED) { + rv += required_field_pack_to_buffer(field, member, buffer); + } else if ((field->label == PROTOBUF_C_LABEL_OPTIONAL || + field->label == PROTOBUF_C_LABEL_NONE) && + (0 != (field->flags & PROTOBUF_C_FIELD_FLAG_ONEOF))) { + rv += oneof_field_pack_to_buffer( + field, + *(const uint32_t *) qmember, + member, + buffer + ); + } else if (field->label == PROTOBUF_C_LABEL_OPTIONAL) { + rv += optional_field_pack_to_buffer( + field, + *(const protobuf_c_boolean *) qmember, + member, + buffer + ); + } else if (field->label == PROTOBUF_C_LABEL_NONE) { + rv += unlabeled_field_pack_to_buffer( + field, + member, + buffer + ); + } else { + rv += repeated_field_pack_to_buffer( + field, + *(const size_t *) qmember, + member, + buffer + ); + } + } + for (i = 0; i < message->n_unknown_fields; i++) + rv += unknown_field_pack_to_buffer(&message->unknown_fields[i], buffer); + + return rv; +} + +/** + * \defgroup unpack unpacking implementation + * + * Routines mainly used by the unpacking functions. + * + * \ingroup internal + * @{ + */ + +static inline int +int_range_lookup(unsigned n_ranges, const ProtobufCIntRange *ranges, int value) +{ + unsigned n; + unsigned start; + + if (n_ranges == 0) + return -1; + start = 0; + n = n_ranges; + while (n > 1) { + unsigned mid = start + n / 2; + + if (value < ranges[mid].start_value) { + n = mid - start; + } else if (value >= ranges[mid].start_value + + (int) (ranges[mid + 1].orig_index - + ranges[mid].orig_index)) + { + unsigned new_start = mid + 1; + n = start + n - new_start; + start = new_start; + } else + return (value - ranges[mid].start_value) + + ranges[mid].orig_index; + } + if (n > 0) { + unsigned start_orig_index = ranges[start].orig_index; + unsigned range_size = + ranges[start + 1].orig_index - start_orig_index; + + if (ranges[start].start_value <= value && + value < (int) (ranges[start].start_value + range_size)) + { + return (value - ranges[start].start_value) + + start_orig_index; + } + } + return -1; +} + +static size_t +parse_tag_and_wiretype(size_t len, + const uint8_t *data, + uint32_t *tag_out, + ProtobufCWireType *wiretype_out) +{ + unsigned max_rv = len > 5 ? 5 : len; + uint32_t tag = (data[0] & 0x7f) >> 3; + unsigned shift = 4; + unsigned rv; + + *wiretype_out = data[0] & 7; + if ((data[0] & 0x80) == 0) { + *tag_out = tag; + return 1; + } + for (rv = 1; rv < max_rv; rv++) { + if (data[rv] & 0x80) { + tag |= (data[rv] & 0x7f) << shift; + shift += 7; + } else { + tag |= data[rv] << shift; + *tag_out = tag; + return rv + 1; + } + } + return 0; /* error: bad header */ +} + +/* sizeof(ScannedMember) must be <= (1UL<<BOUND_SIZEOF_SCANNED_MEMBER_LOG2) */ +#define BOUND_SIZEOF_SCANNED_MEMBER_LOG2 5 +typedef struct _ScannedMember ScannedMember; +/** Field as it's being read. */ +struct _ScannedMember { + uint32_t tag; /**< Field tag. */ + uint8_t wire_type; /**< Field type. */ + uint8_t length_prefix_len; /**< Prefix length. */ + const ProtobufCFieldDescriptor *field; /**< Field descriptor. */ + size_t len; /**< Field length. */ + const uint8_t *data; /**< Pointer to field data. */ +}; + +static inline uint32_t +scan_length_prefixed_data(size_t len, const uint8_t *data, + size_t *prefix_len_out) +{ + unsigned hdr_max = len < 5 ? len : 5; + unsigned hdr_len; + uint32_t val = 0; + unsigned i; + unsigned shift = 0; + + for (i = 0; i < hdr_max; i++) { + val |= (data[i] & 0x7f) << shift; + shift += 7; + if ((data[i] & 0x80) == 0) + break; + } + if (i == hdr_max) { + PROTOBUF_C_UNPACK_ERROR("error parsing length for length-prefixed data"); + return 0; + } + hdr_len = i + 1; + *prefix_len_out = hdr_len; + if (hdr_len + val > len) { + PROTOBUF_C_UNPACK_ERROR("data too short after length-prefix of %u", val); + return 0; + } + return hdr_len + val; +} + +static size_t +max_b128_numbers(size_t len, const uint8_t *data) +{ + size_t rv = 0; + while (len--) + if ((*data++ & 0x80) == 0) + ++rv; + return rv; +} + +/**@}*/ + +/** + * Merge earlier message into a latter message. + * + * For numeric types and strings, if the same value appears multiple + * times, the parser accepts the last value it sees. For embedded + * message fields, the parser merges multiple instances of the same + * field. That is, all singular scalar fields in the latter instance + * replace those in the former, singular embedded messages are merged, + * and repeated fields are concatenated. + * + * The earlier message should be freed after calling this function, as + * some of its fields may have been reused and changed to their default + * values during the merge. + */ +static protobuf_c_boolean +merge_messages(ProtobufCMessage *earlier_msg, + ProtobufCMessage *latter_msg, + ProtobufCAllocator *allocator) +{ + unsigned i; + const ProtobufCFieldDescriptor *fields = + latter_msg->descriptor->fields; + for (i = 0; i < latter_msg->descriptor->n_fields; i++) { + if (fields[i].label == PROTOBUF_C_LABEL_REPEATED) { + size_t *n_earlier = + STRUCT_MEMBER_PTR(size_t, earlier_msg, + fields[i].quantifier_offset); + uint8_t **p_earlier = + STRUCT_MEMBER_PTR(uint8_t *, earlier_msg, + fields[i].offset); + size_t *n_latter = + STRUCT_MEMBER_PTR(size_t, latter_msg, + fields[i].quantifier_offset); + uint8_t **p_latter = + STRUCT_MEMBER_PTR(uint8_t *, latter_msg, + fields[i].offset); + + if (*n_earlier > 0) { + if (*n_latter > 0) { + /* Concatenate the repeated field */ + size_t el_size = + sizeof_elt_in_repeated_array(fields[i].type); + uint8_t *new_field; + + new_field = do_alloc(allocator, + (*n_earlier + *n_latter) * el_size); + if (!new_field) + return FALSE; + + memcpy(new_field, *p_earlier, + *n_earlier * el_size); + memcpy(new_field + + *n_earlier * el_size, + *p_latter, + *n_latter * el_size); + + do_free(allocator, *p_latter); + do_free(allocator, *p_earlier); + *p_latter = new_field; + *n_latter = *n_earlier + *n_latter; + } else { + /* Zero copy the repeated field from the earlier message */ + *n_latter = *n_earlier; + *p_latter = *p_earlier; + } + /* Make sure the field does not get double freed */ + *n_earlier = 0; + *p_earlier = 0; + } + } else if (fields[i].label == PROTOBUF_C_LABEL_OPTIONAL || + fields[i].label == PROTOBUF_C_LABEL_NONE) { + const ProtobufCFieldDescriptor *field; + uint32_t *earlier_case_p = STRUCT_MEMBER_PTR(uint32_t, + earlier_msg, + fields[i]. + quantifier_offset); + uint32_t *latter_case_p = STRUCT_MEMBER_PTR(uint32_t, + latter_msg, + fields[i]. + quantifier_offset); + protobuf_c_boolean need_to_merge = FALSE; + void *earlier_elem; + void *latter_elem; + const void *def_val; + + if (fields[i].flags & PROTOBUF_C_FIELD_FLAG_ONEOF) { + if (*latter_case_p == 0) { + /* lookup correct oneof field */ + int field_index = + int_range_lookup( + latter_msg->descriptor + ->n_field_ranges, + latter_msg->descriptor + ->field_ranges, + *earlier_case_p); + field = latter_msg->descriptor->fields + + field_index; + } else { + /* Oneof is present in the latter message, move on */ + continue; + } + } else { + field = &fields[i]; + } + + earlier_elem = STRUCT_MEMBER_P(earlier_msg, field->offset); + latter_elem = STRUCT_MEMBER_P(latter_msg, field->offset); + def_val = field->default_value; + + switch (field->type) { + case PROTOBUF_C_TYPE_MESSAGE: { + ProtobufCMessage *em = *(ProtobufCMessage **) earlier_elem; + ProtobufCMessage *lm = *(ProtobufCMessage **) latter_elem; + if (em != NULL) { + if (lm != NULL) { + if (!merge_messages(em, lm, allocator)) + return FALSE; + /* Already merged */ + need_to_merge = FALSE; + } else { + /* Zero copy the message */ + need_to_merge = TRUE; + } + } + break; + } + case PROTOBUF_C_TYPE_BYTES: { + uint8_t *e_data = + ((ProtobufCBinaryData *) earlier_elem)->data; + uint8_t *l_data = + ((ProtobufCBinaryData *) latter_elem)->data; + const ProtobufCBinaryData *d_bd = + (ProtobufCBinaryData *) def_val; + + need_to_merge = + (e_data != NULL && + (d_bd == NULL || + e_data != d_bd->data)) && + (l_data == NULL || + (d_bd != NULL && + l_data == d_bd->data)); + break; + } + case PROTOBUF_C_TYPE_STRING: { + char *e_str = *(char **) earlier_elem; + char *l_str = *(char **) latter_elem; + const char *d_str = def_val; + + need_to_merge = e_str != d_str && l_str == d_str; + break; + } + default: { + /* Could be has field or case enum, the logic is + * equivalent, since 0 (FALSE) means not set for + * oneof */ + need_to_merge = (*earlier_case_p != 0) && + (*latter_case_p == 0); + break; + } + } + + if (need_to_merge) { + size_t el_size = + sizeof_elt_in_repeated_array(field->type); + memcpy(latter_elem, earlier_elem, el_size); + /* + * Reset the element from the old message to 0 + * to make sure earlier message deallocation + * doesn't corrupt zero-copied data in the new + * message, earlier message will be freed after + * this function is called anyway + */ + memset(earlier_elem, 0, el_size); + + if (field->quantifier_offset != 0) { + /* Set the has field or the case enum, + * if applicable */ + *latter_case_p = *earlier_case_p; + *earlier_case_p = 0; + } + } + } + } + return TRUE; +} + +/** + * Count packed elements. + * + * Given a raw slab of packed-repeated values, determine the number of + * elements. This function detects certain kinds of errors but not + * others; the remaining error checking is done by + * parse_packed_repeated_member(). + */ +static protobuf_c_boolean +count_packed_elements(ProtobufCType type, + size_t len, const uint8_t *data, size_t *count_out) +{ + switch (type) { + case PROTOBUF_C_TYPE_SFIXED32: + case PROTOBUF_C_TYPE_FIXED32: + case PROTOBUF_C_TYPE_FLOAT: + if (len % 4 != 0) { + PROTOBUF_C_UNPACK_ERROR("length must be a multiple of 4 for fixed-length 32-bit types"); + return FALSE; + } + *count_out = len / 4; + return TRUE; + case PROTOBUF_C_TYPE_SFIXED64: + case PROTOBUF_C_TYPE_FIXED64: + case PROTOBUF_C_TYPE_DOUBLE: + if (len % 8 != 0) { + PROTOBUF_C_UNPACK_ERROR("length must be a multiple of 8 for fixed-length 64-bit types"); + return FALSE; + } + *count_out = len / 8; + return TRUE; + case PROTOBUF_C_TYPE_ENUM: + case PROTOBUF_C_TYPE_INT32: + case PROTOBUF_C_TYPE_SINT32: + case PROTOBUF_C_TYPE_UINT32: + case PROTOBUF_C_TYPE_INT64: + case PROTOBUF_C_TYPE_SINT64: + case PROTOBUF_C_TYPE_UINT64: + *count_out = max_b128_numbers(len, data); + return TRUE; + case PROTOBUF_C_TYPE_BOOL: + *count_out = len; + return TRUE; + case PROTOBUF_C_TYPE_STRING: + case PROTOBUF_C_TYPE_BYTES: + case PROTOBUF_C_TYPE_MESSAGE: + default: + PROTOBUF_C_UNPACK_ERROR("bad protobuf-c type %u for packed-repeated", type); + return FALSE; + } +} + +static inline uint32_t +parse_uint32(unsigned len, const uint8_t *data) +{ + uint32_t rv = data[0] & 0x7f; + if (len > 1) { + rv |= ((uint32_t) (data[1] & 0x7f) << 7); + if (len > 2) { + rv |= ((uint32_t) (data[2] & 0x7f) << 14); + if (len > 3) { + rv |= ((uint32_t) (data[3] & 0x7f) << 21); + if (len > 4) + rv |= ((uint32_t) (data[4]) << 28); + } + } + } + return rv; +} + +static inline uint32_t +parse_int32(unsigned len, const uint8_t *data) +{ + return parse_uint32(len, data); +} + +static inline int32_t +unzigzag32(uint32_t v) +{ + if (v & 1) + return -(v >> 1) - 1; + else + return v >> 1; +} + +static inline uint32_t +parse_fixed_uint32(const uint8_t *data) +{ +#if !defined(WORDS_BIGENDIAN) + uint32_t t; + memcpy(&t, data, 4); + return t; +#else + return data[0] | + ((uint32_t) (data[1]) << 8) | + ((uint32_t) (data[2]) << 16) | + ((uint32_t) (data[3]) << 24); +#endif +} + +static uint64_t +parse_uint64(unsigned len, const uint8_t *data) +{ + unsigned shift, i; + uint64_t rv; + + if (len < 5) + return parse_uint32(len, data); + rv = ((uint64_t) (data[0] & 0x7f)) | + ((uint64_t) (data[1] & 0x7f) << 7) | + ((uint64_t) (data[2] & 0x7f) << 14) | + ((uint64_t) (data[3] & 0x7f) << 21); + shift = 28; + for (i = 4; i < len; i++) { + rv |= (((uint64_t) (data[i] & 0x7f)) << shift); + shift += 7; + } + return rv; +} + +static inline int64_t +unzigzag64(uint64_t v) +{ + if (v & 1) + return -(v >> 1) - 1; + else + return v >> 1; +} + +static inline uint64_t +parse_fixed_uint64(const uint8_t *data) +{ +#if !defined(WORDS_BIGENDIAN) + uint64_t t; + memcpy(&t, data, 8); + return t; +#else + return (uint64_t) parse_fixed_uint32(data) | + (((uint64_t) parse_fixed_uint32(data + 4)) << 32); +#endif +} + +static protobuf_c_boolean +parse_boolean(unsigned len, const uint8_t *data) +{ + unsigned i; + for (i = 0; i < len; i++) + if (data[i] & 0x7f) + return TRUE; + return FALSE; +} + +static protobuf_c_boolean +parse_required_member(ScannedMember *scanned_member, + void *member, + ProtobufCAllocator *allocator, + protobuf_c_boolean maybe_clear) +{ + unsigned len = scanned_member->len; + const uint8_t *data = scanned_member->data; + ProtobufCWireType wire_type = scanned_member->wire_type; + + switch (scanned_member->field->type) { + case PROTOBUF_C_TYPE_ENUM: + case PROTOBUF_C_TYPE_INT32: + if (wire_type != PROTOBUF_C_WIRE_TYPE_VARINT) + return FALSE; + *(int32_t *) member = parse_int32(len, data); + return TRUE; + case PROTOBUF_C_TYPE_UINT32: + if (wire_type != PROTOBUF_C_WIRE_TYPE_VARINT) + return FALSE; + *(uint32_t *) member = parse_uint32(len, data); + return TRUE; + case PROTOBUF_C_TYPE_SINT32: + if (wire_type != PROTOBUF_C_WIRE_TYPE_VARINT) + return FALSE; + *(int32_t *) member = unzigzag32(parse_uint32(len, data)); + return TRUE; + case PROTOBUF_C_TYPE_SFIXED32: + case PROTOBUF_C_TYPE_FIXED32: + case PROTOBUF_C_TYPE_FLOAT: + if (wire_type != PROTOBUF_C_WIRE_TYPE_32BIT) + return FALSE; + *(uint32_t *) member = parse_fixed_uint32(data); + return TRUE; + case PROTOBUF_C_TYPE_INT64: + case PROTOBUF_C_TYPE_UINT64: + if (wire_type != PROTOBUF_C_WIRE_TYPE_VARINT) + return FALSE; + *(uint64_t *) member = parse_uint64(len, data); + return TRUE; + case PROTOBUF_C_TYPE_SINT64: + if (wire_type != PROTOBUF_C_WIRE_TYPE_VARINT) + return FALSE; + *(int64_t *) member = unzigzag64(parse_uint64(len, data)); + return TRUE; + case PROTOBUF_C_TYPE_SFIXED64: + case PROTOBUF_C_TYPE_FIXED64: + case PROTOBUF_C_TYPE_DOUBLE: + if (wire_type != PROTOBUF_C_WIRE_TYPE_64BIT) + return FALSE; + *(uint64_t *) member = parse_fixed_uint64(data); + return TRUE; + case PROTOBUF_C_TYPE_BOOL: + *(protobuf_c_boolean *) member = parse_boolean(len, data); + return TRUE; + case PROTOBUF_C_TYPE_STRING: { + char **pstr = member; + unsigned pref_len = scanned_member->length_prefix_len; + + if (wire_type != PROTOBUF_C_WIRE_TYPE_LENGTH_PREFIXED) + return FALSE; + + if (maybe_clear && *pstr != NULL) { + const char *def = scanned_member->field->default_value; + if (*pstr != NULL && *pstr != def) + do_free(allocator, *pstr); + } + *pstr = do_alloc(allocator, len - pref_len + 1); + if (*pstr == NULL) + return FALSE; + memcpy(*pstr, data + pref_len, len - pref_len); + (*pstr)[len - pref_len] = 0; + return TRUE; + } + case PROTOBUF_C_TYPE_BYTES: { + ProtobufCBinaryData *bd = member; + const ProtobufCBinaryData *def_bd; + unsigned pref_len = scanned_member->length_prefix_len; + + if (wire_type != PROTOBUF_C_WIRE_TYPE_LENGTH_PREFIXED) + return FALSE; + + def_bd = scanned_member->field->default_value; + if (maybe_clear && + bd->data != NULL && + (def_bd == NULL || bd->data != def_bd->data)) + { + do_free(allocator, bd->data); + } + if (len - pref_len > 0) { + bd->data = do_alloc(allocator, len - pref_len); + if (bd->data == NULL) + return FALSE; + memcpy(bd->data, data + pref_len, len - pref_len); + } else { + bd->data = NULL; + } + bd->len = len - pref_len; + return TRUE; + } + case PROTOBUF_C_TYPE_MESSAGE: { + ProtobufCMessage **pmessage = member; + ProtobufCMessage *subm; + const ProtobufCMessage *def_mess; + protobuf_c_boolean merge_successful = TRUE; + unsigned pref_len = scanned_member->length_prefix_len; + + if (wire_type != PROTOBUF_C_WIRE_TYPE_LENGTH_PREFIXED) + return FALSE; + + def_mess = scanned_member->field->default_value; + subm = protobuf_c_message_unpack(scanned_member->field->descriptor, + allocator, + len - pref_len, + data + pref_len); + + if (maybe_clear && + *pmessage != NULL && + *pmessage != def_mess) + { + if (subm != NULL) + merge_successful = merge_messages(*pmessage, subm, allocator); + /* Delete the previous message */ + protobuf_c_message_free_unpacked(*pmessage, allocator); + } + *pmessage = subm; + if (subm == NULL || !merge_successful) + return FALSE; + return TRUE; + } + } + return FALSE; +} + +static protobuf_c_boolean +parse_oneof_member (ScannedMember *scanned_member, + void *member, + ProtobufCMessage *message, + ProtobufCAllocator *allocator) +{ + uint32_t *oneof_case = STRUCT_MEMBER_PTR(uint32_t, message, + scanned_member->field->quantifier_offset); + + /* If we have already parsed a member of this oneof, free it. */ + if (*oneof_case != 0) { + /* lookup field */ + int field_index = + int_range_lookup(message->descriptor->n_field_ranges, + message->descriptor->field_ranges, + *oneof_case); + const ProtobufCFieldDescriptor *old_field = + message->descriptor->fields + field_index; + size_t el_size = sizeof_elt_in_repeated_array(old_field->type); + + switch (old_field->type) { + case PROTOBUF_C_TYPE_STRING: { + char **pstr = member; + const char *def = old_field->default_value; + if (*pstr != NULL && *pstr != def) + do_free(allocator, *pstr); + break; + } + case PROTOBUF_C_TYPE_BYTES: { + ProtobufCBinaryData *bd = member; + const ProtobufCBinaryData *def_bd = old_field->default_value; + if (bd->data != NULL && + (def_bd == NULL || bd->data != def_bd->data)) + { + do_free(allocator, bd->data); + } + break; + } + case PROTOBUF_C_TYPE_MESSAGE: { + ProtobufCMessage **pmessage = member; + const ProtobufCMessage *def_mess = old_field->default_value; + if (*pmessage != NULL && *pmessage != def_mess) + protobuf_c_message_free_unpacked(*pmessage, allocator); + break; + } + default: + break; + } + + memset (member, 0, el_size); + } + if (!parse_required_member (scanned_member, member, allocator, TRUE)) + return FALSE; + + *oneof_case = scanned_member->tag; + return TRUE; +} + + +static protobuf_c_boolean +parse_optional_member(ScannedMember *scanned_member, + void *member, + ProtobufCMessage *message, + ProtobufCAllocator *allocator) +{ + if (!parse_required_member(scanned_member, member, allocator, TRUE)) + return FALSE; + if (scanned_member->field->quantifier_offset != 0) + STRUCT_MEMBER(protobuf_c_boolean, + message, + scanned_member->field->quantifier_offset) = TRUE; + return TRUE; +} + +static protobuf_c_boolean +parse_repeated_member(ScannedMember *scanned_member, + void *member, + ProtobufCMessage *message, + ProtobufCAllocator *allocator) +{ + const ProtobufCFieldDescriptor *field = scanned_member->field; + size_t *p_n = STRUCT_MEMBER_PTR(size_t, message, field->quantifier_offset); + size_t siz = sizeof_elt_in_repeated_array(field->type); + char *array = *(char **) member; + + if (!parse_required_member(scanned_member, array + siz * (*p_n), + allocator, FALSE)) + { + return FALSE; + } + *p_n += 1; + return TRUE; +} + +static unsigned +scan_varint(unsigned len, const uint8_t *data) +{ + unsigned i; + if (len > 10) + len = 10; + for (i = 0; i < len; i++) + if ((data[i] & 0x80) == 0) + break; + if (i == len) + return 0; + return i + 1; +} + +static protobuf_c_boolean +parse_packed_repeated_member(ScannedMember *scanned_member, + void *member, + ProtobufCMessage *message) +{ + const ProtobufCFieldDescriptor *field = scanned_member->field; + size_t *p_n = STRUCT_MEMBER_PTR(size_t, message, field->quantifier_offset); + size_t siz = sizeof_elt_in_repeated_array(field->type); + void *array = *(char **) member + siz * (*p_n); + const uint8_t *at = scanned_member->data + scanned_member->length_prefix_len; + size_t rem = scanned_member->len - scanned_member->length_prefix_len; + size_t count = 0; + unsigned i; + + switch (field->type) { + case PROTOBUF_C_TYPE_SFIXED32: + case PROTOBUF_C_TYPE_FIXED32: + case PROTOBUF_C_TYPE_FLOAT: + count = (scanned_member->len - scanned_member->length_prefix_len) / 4; +#if !defined(WORDS_BIGENDIAN) + goto no_unpacking_needed; +#else + for (i = 0; i < count; i++) { + ((uint32_t *) array)[i] = parse_fixed_uint32(at); + at += 4; + } + break; +#endif + case PROTOBUF_C_TYPE_SFIXED64: + case PROTOBUF_C_TYPE_FIXED64: + case PROTOBUF_C_TYPE_DOUBLE: + count = (scanned_member->len - scanned_member->length_prefix_len) / 8; +#if !defined(WORDS_BIGENDIAN) + goto no_unpacking_needed; +#else + for (i = 0; i < count; i++) { + ((uint64_t *) array)[i] = parse_fixed_uint64(at); + at += 8; + } + break; +#endif + case PROTOBUF_C_TYPE_ENUM: + case PROTOBUF_C_TYPE_INT32: + while (rem > 0) { + unsigned s = scan_varint(rem, at); + if (s == 0) { + PROTOBUF_C_UNPACK_ERROR("bad packed-repeated int32 value"); + return FALSE; + } + ((int32_t *) array)[count++] = parse_int32(s, at); + at += s; + rem -= s; + } + break; + case PROTOBUF_C_TYPE_SINT32: + while (rem > 0) { + unsigned s = scan_varint(rem, at); + if (s == 0) { + PROTOBUF_C_UNPACK_ERROR("bad packed-repeated sint32 value"); + return FALSE; + } + ((int32_t *) array)[count++] = unzigzag32(parse_uint32(s, at)); + at += s; + rem -= s; + } + break; + case PROTOBUF_C_TYPE_UINT32: + while (rem > 0) { + unsigned s = scan_varint(rem, at); + if (s == 0) { + PROTOBUF_C_UNPACK_ERROR("bad packed-repeated enum or uint32 value"); + return FALSE; + } + ((uint32_t *) array)[count++] = parse_uint32(s, at); + at += s; + rem -= s; + } + break; + + case PROTOBUF_C_TYPE_SINT64: + while (rem > 0) { + unsigned s = scan_varint(rem, at); + if (s == 0) { + PROTOBUF_C_UNPACK_ERROR("bad packed-repeated sint64 value"); + return FALSE; + } + ((int64_t *) array)[count++] = unzigzag64(parse_uint64(s, at)); + at += s; + rem -= s; + } + break; + case PROTOBUF_C_TYPE_INT64: + case PROTOBUF_C_TYPE_UINT64: + while (rem > 0) { + unsigned s = scan_varint(rem, at); + if (s == 0) { + PROTOBUF_C_UNPACK_ERROR("bad packed-repeated int64/uint64 value"); + return FALSE; + } + ((int64_t *) array)[count++] = parse_uint64(s, at); + at += s; + rem -= s; + } + break; + case PROTOBUF_C_TYPE_BOOL: + count = rem; + for (i = 0; i < count; i++) { + if (at[i] > 1) { + PROTOBUF_C_UNPACK_ERROR("bad packed-repeated boolean value"); + return FALSE; + } + ((protobuf_c_boolean *) array)[i] = at[i]; + } + break; + default: + PROTOBUF_C__ASSERT_NOT_REACHED(); + } + *p_n += count; + return TRUE; + +#if !defined(WORDS_BIGENDIAN) +no_unpacking_needed: + memcpy(array, at, count * siz); + *p_n += count; + return TRUE; +#endif +} + +static protobuf_c_boolean +is_packable_type(ProtobufCType type) +{ + return + type != PROTOBUF_C_TYPE_STRING && + type != PROTOBUF_C_TYPE_BYTES && + type != PROTOBUF_C_TYPE_MESSAGE; +} + +static protobuf_c_boolean +parse_member(ScannedMember *scanned_member, + ProtobufCMessage *message, + ProtobufCAllocator *allocator) +{ + const ProtobufCFieldDescriptor *field = scanned_member->field; + void *member; + + if (field == NULL) { + ProtobufCMessageUnknownField *ufield = + message->unknown_fields + + (message->n_unknown_fields++); + ufield->tag = scanned_member->tag; + ufield->wire_type = scanned_member->wire_type; + ufield->len = scanned_member->len; + ufield->data = do_alloc(allocator, scanned_member->len); + if (ufield->data == NULL) + return FALSE; + memcpy(ufield->data, scanned_member->data, ufield->len); + return TRUE; + } + member = (char *) message + field->offset; + switch (field->label) { + case PROTOBUF_C_LABEL_REQUIRED: + return parse_required_member(scanned_member, member, + allocator, TRUE); + case PROTOBUF_C_LABEL_OPTIONAL: + case PROTOBUF_C_LABEL_NONE: + if (0 != (field->flags & PROTOBUF_C_FIELD_FLAG_ONEOF)) { + return parse_oneof_member(scanned_member, member, + message, allocator); + } else { + return parse_optional_member(scanned_member, member, + message, allocator); + } + case PROTOBUF_C_LABEL_REPEATED: + if (scanned_member->wire_type == + PROTOBUF_C_WIRE_TYPE_LENGTH_PREFIXED && + (0 != (field->flags & PROTOBUF_C_FIELD_FLAG_PACKED) || + is_packable_type(field->type))) + { + return parse_packed_repeated_member(scanned_member, + member, message); + } else { + return parse_repeated_member(scanned_member, + member, message, + allocator); + } + } + PROTOBUF_C__ASSERT_NOT_REACHED(); + return 0; +} + +/** + * Initialise messages generated by old code. + * + * This function is used if desc->message_init == NULL (which occurs + * for old code, and which would be useful to support allocating + * descriptors dynamically). + */ +static void +message_init_generic(const ProtobufCMessageDescriptor *desc, + ProtobufCMessage *message) +{ + unsigned i; + + memset(message, 0, desc->sizeof_message); + message->descriptor = desc; + for (i = 0; i < desc->n_fields; i++) { + if (desc->fields[i].default_value != NULL && + desc->fields[i].label != PROTOBUF_C_LABEL_REPEATED) + { + void *field = + STRUCT_MEMBER_P(message, desc->fields[i].offset); + const void *dv = desc->fields[i].default_value; + + switch (desc->fields[i].type) { + case PROTOBUF_C_TYPE_INT32: + case PROTOBUF_C_TYPE_SINT32: + case PROTOBUF_C_TYPE_SFIXED32: + case PROTOBUF_C_TYPE_UINT32: + case PROTOBUF_C_TYPE_FIXED32: + case PROTOBUF_C_TYPE_FLOAT: + case PROTOBUF_C_TYPE_ENUM: + memcpy(field, dv, 4); + break; + case PROTOBUF_C_TYPE_INT64: + case PROTOBUF_C_TYPE_SINT64: + case PROTOBUF_C_TYPE_SFIXED64: + case PROTOBUF_C_TYPE_UINT64: + case PROTOBUF_C_TYPE_FIXED64: + case PROTOBUF_C_TYPE_DOUBLE: + memcpy(field, dv, 8); + break; + case PROTOBUF_C_TYPE_BOOL: + memcpy(field, dv, sizeof(protobuf_c_boolean)); + break; + case PROTOBUF_C_TYPE_BYTES: + memcpy(field, dv, sizeof(ProtobufCBinaryData)); + break; + + case PROTOBUF_C_TYPE_STRING: + case PROTOBUF_C_TYPE_MESSAGE: + /* + * The next line essentially implements a cast + * from const, which is totally unavoidable. + */ + *(const void **) field = dv; + break; + } + } + } +} + +/**@}*/ + +/* + * ScannedMember slabs (an unpacking implementation detail). Before doing real + * unpacking, we first scan through the elements to see how many there are (for + * repeated fields), and which field to use (for non-repeated fields given + * twice). + * + * In order to avoid allocations for small messages, we keep a stack-allocated + * slab of ScannedMembers of size FIRST_SCANNED_MEMBER_SLAB_SIZE (16). After we + * fill that up, we allocate each slab twice as large as the previous one. + */ +#define FIRST_SCANNED_MEMBER_SLAB_SIZE_LOG2 4 + +/* + * The number of slabs, including the stack-allocated ones; choose the number so + * that we would overflow if we needed a slab larger than provided. + */ +#define MAX_SCANNED_MEMBER_SLAB \ + (sizeof(unsigned int)*8 - 1 \ + - BOUND_SIZEOF_SCANNED_MEMBER_LOG2 \ + - FIRST_SCANNED_MEMBER_SLAB_SIZE_LOG2) + +#define REQUIRED_FIELD_BITMAP_SET(index) \ + (required_fields_bitmap[(index)/8] |= (1UL<<((index)%8))) + +#define REQUIRED_FIELD_BITMAP_IS_SET(index) \ + (required_fields_bitmap[(index)/8] & (1UL<<((index)%8))) + +ProtobufCMessage * +protobuf_c_message_unpack(const ProtobufCMessageDescriptor *desc, + ProtobufCAllocator *allocator, + size_t len, const uint8_t *data) +{ + ProtobufCMessage *rv; + size_t rem = len; + const uint8_t *at = data; + const ProtobufCFieldDescriptor *last_field = desc->fields + 0; + ScannedMember first_member_slab[1UL << + FIRST_SCANNED_MEMBER_SLAB_SIZE_LOG2]; + + /* + * scanned_member_slabs[i] is an array of arrays of ScannedMember. + * The first slab (scanned_member_slabs[0] is just a pointer to + * first_member_slab), above. All subsequent slabs will be allocated + * using the allocator. + */ + ScannedMember *scanned_member_slabs[MAX_SCANNED_MEMBER_SLAB + 1]; + unsigned which_slab = 0; /* the slab we are currently populating */ + unsigned in_slab_index = 0; /* number of members in the slab */ + size_t n_unknown = 0; + unsigned f; + unsigned j; + unsigned i_slab; + unsigned last_field_index = 0; + unsigned required_fields_bitmap_len; + unsigned char required_fields_bitmap_stack[16]; + unsigned char *required_fields_bitmap = required_fields_bitmap_stack; + protobuf_c_boolean required_fields_bitmap_alloced = FALSE; + + ASSERT_IS_MESSAGE_DESCRIPTOR(desc); + + if (allocator == NULL) + allocator = &protobuf_c__allocator; + + rv = do_alloc(allocator, desc->sizeof_message); + if (!rv) + return (NULL); + scanned_member_slabs[0] = first_member_slab; + + required_fields_bitmap_len = (desc->n_fields + 7) / 8; + if (required_fields_bitmap_len > sizeof(required_fields_bitmap_stack)) { + required_fields_bitmap = do_alloc(allocator, required_fields_bitmap_len); + if (!required_fields_bitmap) { + do_free(allocator, rv); + return (NULL); + } + required_fields_bitmap_alloced = TRUE; + } + memset(required_fields_bitmap, 0, required_fields_bitmap_len); + + /* + * Generated code always defines "message_init". However, we provide a + * fallback for (1) users of old protobuf-c generated-code that do not + * provide the function, and (2) descriptors constructed from some other + * source (most likely, direct construction from the .proto file). + */ + if (desc->message_init != NULL) + protobuf_c_message_init(desc, rv); + else + message_init_generic(desc, rv); + + while (rem > 0) { + uint32_t tag; + ProtobufCWireType wire_type; + size_t used = parse_tag_and_wiretype(rem, at, &tag, &wire_type); + const ProtobufCFieldDescriptor *field; + ScannedMember tmp; + + if (used == 0) { + PROTOBUF_C_UNPACK_ERROR("error parsing tag/wiretype at offset %u", + (unsigned) (at - data)); + goto error_cleanup_during_scan; + } + /* + * \todo Consider optimizing for field[1].id == tag, if field[1] + * exists! + */ + if (last_field == NULL || last_field->id != tag) { + /* lookup field */ + int field_index = + int_range_lookup(desc->n_field_ranges, + desc->field_ranges, + tag); + if (field_index < 0) { + field = NULL; + n_unknown++; + } else { + field = desc->fields + field_index; + last_field = field; + last_field_index = field_index; + } + } else { + field = last_field; + } + + if (field != NULL && field->label == PROTOBUF_C_LABEL_REQUIRED) + REQUIRED_FIELD_BITMAP_SET(last_field_index); + + at += used; + rem -= used; + tmp.tag = tag; + tmp.wire_type = wire_type; + tmp.field = field; + tmp.data = at; + tmp.length_prefix_len = 0; + + switch (wire_type) { + case PROTOBUF_C_WIRE_TYPE_VARINT: { + unsigned max_len = rem < 10 ? rem : 10; + unsigned i; + + for (i = 0; i < max_len; i++) + if ((at[i] & 0x80) == 0) + break; + if (i == max_len) { + PROTOBUF_C_UNPACK_ERROR("unterminated varint at offset %u", + (unsigned) (at - data)); + goto error_cleanup_during_scan; + } + tmp.len = i + 1; + break; + } + case PROTOBUF_C_WIRE_TYPE_64BIT: + if (rem < 8) { + PROTOBUF_C_UNPACK_ERROR("too short after 64bit wiretype at offset %u", + (unsigned) (at - data)); + goto error_cleanup_during_scan; + } + tmp.len = 8; + break; + case PROTOBUF_C_WIRE_TYPE_LENGTH_PREFIXED: { + size_t pref_len; + + tmp.len = scan_length_prefixed_data(rem, at, &pref_len); + if (tmp.len == 0) { + /* NOTE: scan_length_prefixed_data calls UNPACK_ERROR */ + goto error_cleanup_during_scan; + } + tmp.length_prefix_len = pref_len; + break; + } + case PROTOBUF_C_WIRE_TYPE_32BIT: + if (rem < 4) { + PROTOBUF_C_UNPACK_ERROR("too short after 32bit wiretype at offset %u", + (unsigned) (at - data)); + goto error_cleanup_during_scan; + } + tmp.len = 4; + break; + default: + PROTOBUF_C_UNPACK_ERROR("unsupported tag %u at offset %u", + wire_type, (unsigned) (at - data)); + goto error_cleanup_during_scan; + } + + if (in_slab_index == (1UL << + (which_slab + FIRST_SCANNED_MEMBER_SLAB_SIZE_LOG2))) + { + size_t size; + + in_slab_index = 0; + if (which_slab == MAX_SCANNED_MEMBER_SLAB) { + PROTOBUF_C_UNPACK_ERROR("too many fields"); + goto error_cleanup_during_scan; + } + which_slab++; + size = sizeof(ScannedMember) + << (which_slab + FIRST_SCANNED_MEMBER_SLAB_SIZE_LOG2); + scanned_member_slabs[which_slab] = do_alloc(allocator, size); + if (scanned_member_slabs[which_slab] == NULL) + goto error_cleanup_during_scan; + } + scanned_member_slabs[which_slab][in_slab_index++] = tmp; + + if (field != NULL && field->label == PROTOBUF_C_LABEL_REPEATED) { + size_t *n = STRUCT_MEMBER_PTR(size_t, rv, + field->quantifier_offset); + if (wire_type == PROTOBUF_C_WIRE_TYPE_LENGTH_PREFIXED && + (0 != (field->flags & PROTOBUF_C_FIELD_FLAG_PACKED) || + is_packable_type(field->type))) + { + size_t count; + if (!count_packed_elements(field->type, + tmp.len - + tmp.length_prefix_len, + tmp.data + + tmp.length_prefix_len, + &count)) + { + PROTOBUF_C_UNPACK_ERROR("counting packed elements"); + goto error_cleanup_during_scan; + } + *n += count; + } else { + *n += 1; + } + } + + at += tmp.len; + rem -= tmp.len; + } + + /* allocate space for repeated fields, also check that all required fields have been set */ + for (f = 0; f < desc->n_fields; f++) { + const ProtobufCFieldDescriptor *field = desc->fields + f; + if (field->label == PROTOBUF_C_LABEL_REPEATED) { + size_t siz = + sizeof_elt_in_repeated_array(field->type); + size_t *n_ptr = + STRUCT_MEMBER_PTR(size_t, rv, + field->quantifier_offset); + if (*n_ptr != 0) { + unsigned n = *n_ptr; + void *a; + *n_ptr = 0; + assert(rv->descriptor != NULL); +#define CLEAR_REMAINING_N_PTRS() \ + for(f++;f < desc->n_fields; f++) \ + { \ + field = desc->fields + f; \ + if (field->label == PROTOBUF_C_LABEL_REPEATED) \ + STRUCT_MEMBER (size_t, rv, field->quantifier_offset) = 0; \ + } + a = do_alloc(allocator, siz * n); + if (!a) { + CLEAR_REMAINING_N_PTRS(); + goto error_cleanup; + } + STRUCT_MEMBER(void *, rv, field->offset) = a; + } + } else if (field->label == PROTOBUF_C_LABEL_REQUIRED) { + if (field->default_value == NULL && + !REQUIRED_FIELD_BITMAP_IS_SET(f)) + { + CLEAR_REMAINING_N_PTRS(); + PROTOBUF_C_UNPACK_ERROR("message '%s': missing required field '%s'", + desc->name, field->name); + goto error_cleanup; + } + } + } +#undef CLEAR_REMAINING_N_PTRS + + /* allocate space for unknown fields */ + if (n_unknown) { + rv->unknown_fields = do_alloc(allocator, + n_unknown * sizeof(ProtobufCMessageUnknownField)); + if (rv->unknown_fields == NULL) + goto error_cleanup; + } + + /* do real parsing */ + for (i_slab = 0; i_slab <= which_slab; i_slab++) { + unsigned max = (i_slab == which_slab) ? + in_slab_index : (1UL << (i_slab + 4)); + ScannedMember *slab = scanned_member_slabs[i_slab]; + + for (j = 0; j < max; j++) { + if (!parse_member(slab + j, rv, allocator)) { + PROTOBUF_C_UNPACK_ERROR("error parsing member %s of %s", + slab->field ? slab->field->name : "*unknown-field*", + desc->name); + goto error_cleanup; + } + } + } + + /* cleanup */ + for (j = 1; j <= which_slab; j++) + do_free(allocator, scanned_member_slabs[j]); + if (required_fields_bitmap_alloced) + do_free(allocator, required_fields_bitmap); + return rv; + +error_cleanup: + protobuf_c_message_free_unpacked(rv, allocator); + for (j = 1; j <= which_slab; j++) + do_free(allocator, scanned_member_slabs[j]); + if (required_fields_bitmap_alloced) + do_free(allocator, required_fields_bitmap); + return NULL; + +error_cleanup_during_scan: + do_free(allocator, rv); + for (j = 1; j <= which_slab; j++) + do_free(allocator, scanned_member_slabs[j]); + if (required_fields_bitmap_alloced) + do_free(allocator, required_fields_bitmap); + return NULL; +} + +void +protobuf_c_message_free_unpacked(ProtobufCMessage *message, + ProtobufCAllocator *allocator) +{ + const ProtobufCMessageDescriptor *desc; + unsigned f; + + if (message == NULL) + return; + + desc = message->descriptor; + + ASSERT_IS_MESSAGE(message); + + if (allocator == NULL) + allocator = &protobuf_c__allocator; + message->descriptor = NULL; + for (f = 0; f < desc->n_fields; f++) { + if (0 != (desc->fields[f].flags & PROTOBUF_C_FIELD_FLAG_ONEOF) && + desc->fields[f].id != + STRUCT_MEMBER(uint32_t, message, desc->fields[f].quantifier_offset)) + { + /* This is not the selected oneof, skip it */ + continue; + } + + if (desc->fields[f].label == PROTOBUF_C_LABEL_REPEATED) { + size_t n = STRUCT_MEMBER(size_t, + message, + desc->fields[f].quantifier_offset); + void *arr = STRUCT_MEMBER(void *, + message, + desc->fields[f].offset); + + if (arr != NULL) { + if (desc->fields[f].type == PROTOBUF_C_TYPE_STRING) { + unsigned i; + for (i = 0; i < n; i++) + do_free(allocator, ((char **) arr)[i]); + } else if (desc->fields[f].type == PROTOBUF_C_TYPE_BYTES) { + unsigned i; + for (i = 0; i < n; i++) + do_free(allocator, ((ProtobufCBinaryData *) arr)[i].data); + } else if (desc->fields[f].type == PROTOBUF_C_TYPE_MESSAGE) { + unsigned i; + for (i = 0; i < n; i++) + protobuf_c_message_free_unpacked( + ((ProtobufCMessage **) arr)[i], + allocator + ); + } + do_free(allocator, arr); + } + } else if (desc->fields[f].type == PROTOBUF_C_TYPE_STRING) { + char *str = STRUCT_MEMBER(char *, message, + desc->fields[f].offset); + + if (str && str != desc->fields[f].default_value) + do_free(allocator, str); + } else if (desc->fields[f].type == PROTOBUF_C_TYPE_BYTES) { + void *data = STRUCT_MEMBER(ProtobufCBinaryData, message, + desc->fields[f].offset).data; + const ProtobufCBinaryData *default_bd; + + default_bd = desc->fields[f].default_value; + if (data != NULL && + (default_bd == NULL || + default_bd->data != data)) + { + do_free(allocator, data); + } + } else if (desc->fields[f].type == PROTOBUF_C_TYPE_MESSAGE) { + ProtobufCMessage *sm; + + sm = STRUCT_MEMBER(ProtobufCMessage *, message, + desc->fields[f].offset); + if (sm && sm != desc->fields[f].default_value) + protobuf_c_message_free_unpacked(sm, allocator); + } + } + + for (f = 0; f < message->n_unknown_fields; f++) + do_free(allocator, message->unknown_fields[f].data); + if (message->unknown_fields != NULL) + do_free(allocator, message->unknown_fields); + + do_free(allocator, message); +} + +void +protobuf_c_message_init(const ProtobufCMessageDescriptor * descriptor, + void *message) +{ + descriptor->message_init((ProtobufCMessage *) (message)); +} + +protobuf_c_boolean +protobuf_c_message_check(const ProtobufCMessage *message) +{ + unsigned i; + + if (!message || + !message->descriptor || + message->descriptor->magic != PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC) + { + return FALSE; + } + + for (i = 0; i < message->descriptor->n_fields; i++) { + const ProtobufCFieldDescriptor *f = message->descriptor->fields + i; + ProtobufCType type = f->type; + ProtobufCLabel label = f->label; + void *field = STRUCT_MEMBER_P (message, f->offset); + + if (label == PROTOBUF_C_LABEL_REPEATED) { + size_t *quantity = STRUCT_MEMBER_P (message, f->quantifier_offset); + + if (*quantity > 0 && *(void **) field == NULL) { + return FALSE; + } + + if (type == PROTOBUF_C_TYPE_MESSAGE) { + ProtobufCMessage **submessage = *(ProtobufCMessage ***) field; + unsigned j; + for (j = 0; j < *quantity; j++) { + if (!protobuf_c_message_check(submessage[j])) + return FALSE; + } + } else if (type == PROTOBUF_C_TYPE_STRING) { + char **string = *(char ***) field; + unsigned j; + for (j = 0; j < *quantity; j++) { + if (!string[j]) + return FALSE; + } + } else if (type == PROTOBUF_C_TYPE_BYTES) { + ProtobufCBinaryData *bd = *(ProtobufCBinaryData **) field; + unsigned j; + for (j = 0; j < *quantity; j++) { + if (bd[j].len > 0 && bd[j].data == NULL) + return FALSE; + } + } + + } else { /* PROTOBUF_C_LABEL_REQUIRED or PROTOBUF_C_LABEL_OPTIONAL */ + + if (type == PROTOBUF_C_TYPE_MESSAGE) { + ProtobufCMessage *submessage = *(ProtobufCMessage **) field; + if (label == PROTOBUF_C_LABEL_REQUIRED || submessage != NULL) { + if (!protobuf_c_message_check(submessage)) + return FALSE; + } + } else if (type == PROTOBUF_C_TYPE_STRING) { + char *string = *(char **) field; + if (label == PROTOBUF_C_LABEL_REQUIRED && string == NULL) + return FALSE; + } else if (type == PROTOBUF_C_TYPE_BYTES) { + protobuf_c_boolean *has = STRUCT_MEMBER_P (message, f->quantifier_offset); + ProtobufCBinaryData *bd = field; + if (label == PROTOBUF_C_LABEL_REQUIRED || *has == TRUE) { + if (bd->len > 0 && bd->data == NULL) + return FALSE; + } + } + } + } + + return TRUE; +} + +/* === services === */ + +typedef void (*GenericHandler) (void *service, + const ProtobufCMessage *input, + ProtobufCClosure closure, + void *closure_data); +void +protobuf_c_service_invoke_internal(ProtobufCService *service, + unsigned method_index, + const ProtobufCMessage *input, + ProtobufCClosure closure, + void *closure_data) +{ + GenericHandler *handlers; + GenericHandler handler; + + /* + * Verify that method_index is within range. If this fails, you are + * likely invoking a newly added method on an old service. (Although + * other memory corruption bugs can cause this assertion too.) + */ + assert(method_index < service->descriptor->n_methods); + + /* + * Get the array of virtual methods (which are enumerated by the + * generated code). + */ + handlers = (GenericHandler *) (service + 1); + + /* + * Get our method and invoke it. + * \todo Seems like handler == NULL is a situation that needs handling. + */ + handler = handlers[method_index]; + (*handler)(service, input, closure, closure_data); +} + +void +protobuf_c_service_generated_init(ProtobufCService *service, + const ProtobufCServiceDescriptor *descriptor, + ProtobufCServiceDestroy destroy) +{ + ASSERT_IS_SERVICE_DESCRIPTOR(descriptor); + service->descriptor = descriptor; + service->destroy = destroy; + service->invoke = protobuf_c_service_invoke_internal; + memset(service + 1, 0, descriptor->n_methods * sizeof(GenericHandler)); +} + +void protobuf_c_service_destroy(ProtobufCService *service) +{ + service->destroy(service); +} + +/* --- querying the descriptors --- */ + +const ProtobufCEnumValue * +protobuf_c_enum_descriptor_get_value_by_name(const ProtobufCEnumDescriptor *desc, + const char *name) +{ + unsigned start = 0; + unsigned count; + + if (desc == NULL || desc->values_by_name == NULL) + return NULL; + + count = desc->n_value_names; + + while (count > 1) { + unsigned mid = start + count / 2; + int rv = strcmp(desc->values_by_name[mid].name, name); + if (rv == 0) + return desc->values + desc->values_by_name[mid].index; + else if (rv < 0) { + count = start + count - (mid + 1); + start = mid + 1; + } else + count = mid - start; + } + if (count == 0) + return NULL; + if (strcmp(desc->values_by_name[start].name, name) == 0) + return desc->values + desc->values_by_name[start].index; + return NULL; +} + +const ProtobufCEnumValue * +protobuf_c_enum_descriptor_get_value(const ProtobufCEnumDescriptor *desc, + int value) +{ + int rv = int_range_lookup(desc->n_value_ranges, desc->value_ranges, value); + if (rv < 0) + return NULL; + return desc->values + rv; +} + +const ProtobufCFieldDescriptor * +protobuf_c_message_descriptor_get_field_by_name(const ProtobufCMessageDescriptor *desc, + const char *name) +{ + unsigned start = 0; + unsigned count; + const ProtobufCFieldDescriptor *field; + + if (desc == NULL || desc->fields_sorted_by_name == NULL) + return NULL; + + count = desc->n_fields; + + while (count > 1) { + unsigned mid = start + count / 2; + int rv; + field = desc->fields + desc->fields_sorted_by_name[mid]; + rv = strcmp(field->name, name); + if (rv == 0) + return field; + else if (rv < 0) { + count = start + count - (mid + 1); + start = mid + 1; + } else + count = mid - start; + } + if (count == 0) + return NULL; + field = desc->fields + desc->fields_sorted_by_name[start]; + if (strcmp(field->name, name) == 0) + return field; + return NULL; +} + +const ProtobufCFieldDescriptor * +protobuf_c_message_descriptor_get_field(const ProtobufCMessageDescriptor *desc, + unsigned value) +{ + int rv = int_range_lookup(desc->n_field_ranges,desc->field_ranges, value); + if (rv < 0) + return NULL; + return desc->fields + rv; +} + +const ProtobufCMethodDescriptor * +protobuf_c_service_descriptor_get_method_by_name(const ProtobufCServiceDescriptor *desc, + const char *name) +{ + unsigned start = 0; + unsigned count; + + if (desc == NULL || desc->method_indices_by_name == NULL) + return NULL; + + count = desc->n_methods; + + while (count > 1) { + unsigned mid = start + count / 2; + unsigned mid_index = desc->method_indices_by_name[mid]; + const char *mid_name = desc->methods[mid_index].name; + int rv = strcmp(mid_name, name); + + if (rv == 0) + return desc->methods + desc->method_indices_by_name[mid]; + if (rv < 0) { + count = start + count - (mid + 1); + start = mid + 1; + } else { + count = mid - start; + } + } + if (count == 0) + return NULL; + if (strcmp(desc->methods[desc->method_indices_by_name[start]].name, name) == 0) + return desc->methods + desc->method_indices_by_name[start]; + return NULL; +} diff --git a/Software/Visual_Studio/Embroidery/Tango.Embroidery/protobuf-c/protobuf-c.h b/Software/Visual_Studio/Embroidery/Tango.Embroidery/protobuf-c/protobuf-c.h new file mode 100644 index 000000000..c8fa4fc2a --- /dev/null +++ b/Software/Visual_Studio/Embroidery/Tango.Embroidery/protobuf-c/protobuf-c.h @@ -0,0 +1,1106 @@ +/* + * Copyright (c) 2008-2017, Dave Benson and the protobuf-c authors. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/*! \file + * \mainpage Introduction + * + * This is [protobuf-c], a C implementation of [Protocol Buffers]. + * + * This file defines the public API for the `libprotobuf-c` support library. + * This API includes interfaces that can be used directly by client code as well + * as the interfaces used by the code generated by the `protoc-c` compiler. + * + * The `libprotobuf-c` support library performs the actual serialization and + * deserialization of Protocol Buffers messages. It interacts with structures, + * definitions, and metadata generated by the `protoc-c` compiler from .proto + * files. + * + * \authors Dave Benson and the `protobuf-c` authors. + * + * \copyright 2008-2014. Licensed under the terms of the [BSD-2-Clause] license. + * + * [protobuf-c]: https://github.com/protobuf-c/protobuf-c + * [Protocol Buffers]: https://developers.google.com/protocol-buffers/ + * [BSD-2-Clause]: http://opensource.org/licenses/BSD-2-Clause + * + * \page gencode Generated Code + * + * For each enum, we generate a C enum. For each message, we generate a C + * structure which can be cast to a `ProtobufCMessage`. + * + * For each enum and message, we generate a descriptor object that allows us to + * implement a kind of reflection on the structures. + * + * First, some naming conventions: + * + * - The name of the type for enums and messages and services is camel case + * (meaning WordsAreCrammedTogether) except that double underscores are used + * to delimit scopes. For example, the following `.proto` file: + * +~~~{.proto} + package foo.bar; + message BazBah { + optional int32 val = 1; + } +~~~ + * + * would generate a C type `Foo__Bar__BazBah`. + * + * - Identifiers for functions and globals are all lowercase, with camel case + * words separated by single underscores. For example, one of the function + * prototypes generated by `protoc-c` for the above example: + * +~~~{.c} +Foo__Bar__BazBah * + foo__bar__baz_bah__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +~~~ + * + * - Identifiers for enum values contain an uppercase prefix which embeds the + * package name and the enum type name. + * + * - A double underscore is used to separate further components of identifier + * names. + * + * For example, in the name of the unpack function above, the package name + * `foo.bar` has become `foo__bar`, the message name BazBah has become + * `baz_bah`, and the method name is `unpack`. These are all joined with double + * underscores to form the C identifier `foo__bar__baz_bah__unpack`. + * + * We also generate descriptor objects for messages and enums. These are + * declared in the `.pb-c.h` files: + * +~~~{.c} +extern const ProtobufCMessageDescriptor foo__bar__baz_bah__descriptor; +~~~ + * + * The message structures all begin with `ProtobufCMessageDescriptor *` which is + * sufficient to allow them to be cast to `ProtobufCMessage`. + * + * For each message defined in a `.proto` file, we generate a number of + * functions and macros. Each function name contains a prefix based on the + * package name and message name in order to make it a unique C identifier. + * + * - `INIT`. Statically initializes a message object, initializing its + * descriptor and setting its fields to default values. Uninitialized + * messages cannot be processed by the protobuf-c library. + * +~~~{.c} +#define FOO__BAR__BAZ_BAH__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&foo__bar__baz_bah__descriptor), 0 } +~~~ + * - `init()`. Initializes a message object, initializing its descriptor and + * setting its fields to default values. Uninitialized messages cannot be + * processed by the protobuf-c library. + * +~~~{.c} +void foo__bar__baz_bah__init + (Foo__Bar__BazBah *message); +~~~ + * - `unpack()`. Unpacks data for a particular message format. Note that the + * `allocator` parameter is usually `NULL` to indicate that the system's + * `malloc()` and `free()` functions should be used for dynamically allocating + * memory. + * +~~~{.c} +Foo__Bar__BazBah * + foo__bar__baz_bah__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +~~~ + * + * - `free_unpacked()`. Frees a message object obtained with the `unpack()` + * method. Freeing `NULL` is allowed (the same as with `free()`). + * +~~~{.c} +void foo__bar__baz_bah__free_unpacked + (Foo__Bar__BazBah *message, + ProtobufCAllocator *allocator); +~~~ + * + * - `get_packed_size()`. Calculates the length in bytes of the serialized + * representation of the message object. + * +~~~{.c} +size_t foo__bar__baz_bah__get_packed_size + (const Foo__Bar__BazBah *message); +~~~ + * + * - `pack()`. Pack a message object into a preallocated buffer. Assumes that + * the buffer is large enough. (Use `get_packed_size()` first.) + * +~~~{.c} +size_t foo__bar__baz_bah__pack + (const Foo__Bar__BazBah *message, + uint8_t *out); +~~~ + * + * - `pack_to_buffer()`. Packs a message into a "virtual buffer". This is an + * object which defines an "append bytes" callback to consume data as it is + * serialized. + * +~~~{.c} +size_t foo__bar__baz_bah__pack_to_buffer + (const Foo__Bar__BazBah *message, + ProtobufCBuffer *buffer); +~~~ + * + * \page pack Packing and unpacking messages + * + * To pack a message, first compute the packed size of the message with + * protobuf_c_message_get_packed_size(), then allocate a buffer of at least + * that size, then call protobuf_c_message_pack(). + * + * Alternatively, a message can be serialized without calculating the final size + * first. Use the protobuf_c_message_pack_to_buffer() function and provide a + * ProtobufCBuffer object which implements an "append" method that consumes + * data. + * + * To unpack a message, call the protobuf_c_message_unpack() function. The + * result can be cast to an object of the type that matches the descriptor for + * the message. + * + * The result of unpacking a message should be freed with + * protobuf_c_message_free_unpacked(). + */ + +#ifndef PROTOBUF_C_H +#define PROTOBUF_C_H + +#include <assert.h> +#include <limits.h> +#include <stddef.h> +#include <stdint.h> + +#ifdef __cplusplus +# define PROTOBUF_C__BEGIN_DECLS extern "C" { +# define PROTOBUF_C__END_DECLS } +#else +# define PROTOBUF_C__BEGIN_DECLS +# define PROTOBUF_C__END_DECLS +#endif + +PROTOBUF_C__BEGIN_DECLS + +#if defined(_WIN32) && defined(PROTOBUF_C_USE_SHARED_LIB) +# ifdef PROTOBUF_C_EXPORT +# define PROTOBUF_C__API __declspec(dllexport) +# else +# define PROTOBUF_C__API __declspec(dllimport) +# endif +#else +# define PROTOBUF_C__API +#endif + +#if !defined(PROTOBUF_C__NO_DEPRECATED) && \ + ((__GNUC__ > 3) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) +# define PROTOBUF_C__DEPRECATED __attribute__((__deprecated__)) +#else +# define PROTOBUF_C__DEPRECATED +#endif + +#ifndef PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE + #define PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(enum_name) \ + , _##enum_name##_IS_INT_SIZE = INT_MAX +#endif + +#define PROTOBUF_C__SERVICE_DESCRIPTOR_MAGIC 0x14159bc3 +#define PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC 0x28aaeef9 +#define PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC 0x114315af + +/* Empty string used for initializers */ +extern const char protobuf_c_empty_string[]; + +/** + * \defgroup api Public API + * + * This is the public API for `libprotobuf-c`. These interfaces are stable and + * subject to Semantic Versioning guarantees. + * + * @{ + */ + +/** + * Values for the `flags` word in `ProtobufCFieldDescriptor`. + */ +typedef enum { + /** Set if the field is repeated and marked with the `packed` option. */ + PROTOBUF_C_FIELD_FLAG_PACKED = (1 << 0), + + /** Set if the field is marked with the `deprecated` option. */ + PROTOBUF_C_FIELD_FLAG_DEPRECATED = (1 << 1), + + /** Set if the field is a member of a oneof (union). */ + PROTOBUF_C_FIELD_FLAG_ONEOF = (1 << 2), +} ProtobufCFieldFlag; + +/** + * Message field rules. + * + * \see [Defining A Message Type] in the Protocol Buffers documentation. + * + * [Defining A Message Type]: + * https://developers.google.com/protocol-buffers/docs/proto#simple + */ +typedef enum { + /** A well-formed message must have exactly one of this field. */ + PROTOBUF_C_LABEL_REQUIRED, + + /** + * A well-formed message can have zero or one of this field (but not + * more than one). + */ + PROTOBUF_C_LABEL_OPTIONAL, + + /** + * This field can be repeated any number of times (including zero) in a + * well-formed message. The order of the repeated values will be + * preserved. + */ + PROTOBUF_C_LABEL_REPEATED, + + /** + * This field has no label. This is valid only in proto3 and is + * equivalent to OPTIONAL but no "has" quantifier will be consulted. + */ + PROTOBUF_C_LABEL_NONE, +} ProtobufCLabel; + +/** + * Field value types. + * + * \see [Scalar Value Types] in the Protocol Buffers documentation. + * + * [Scalar Value Types]: + * https://developers.google.com/protocol-buffers/docs/proto#scalar + */ +typedef enum { + PROTOBUF_C_TYPE_INT32, /**< int32 */ + PROTOBUF_C_TYPE_SINT32, /**< signed int32 */ + PROTOBUF_C_TYPE_SFIXED32, /**< signed int32 (4 bytes) */ + PROTOBUF_C_TYPE_INT64, /**< int64 */ + PROTOBUF_C_TYPE_SINT64, /**< signed int64 */ + PROTOBUF_C_TYPE_SFIXED64, /**< signed int64 (8 bytes) */ + PROTOBUF_C_TYPE_UINT32, /**< unsigned int32 */ + PROTOBUF_C_TYPE_FIXED32, /**< unsigned int32 (4 bytes) */ + PROTOBUF_C_TYPE_UINT64, /**< unsigned int64 */ + PROTOBUF_C_TYPE_FIXED64, /**< unsigned int64 (8 bytes) */ + PROTOBUF_C_TYPE_FLOAT, /**< float */ + PROTOBUF_C_TYPE_DOUBLE, /**< double */ + PROTOBUF_C_TYPE_BOOL, /**< boolean */ + PROTOBUF_C_TYPE_ENUM, /**< enumerated type */ + PROTOBUF_C_TYPE_STRING, /**< UTF-8 or ASCII string */ + PROTOBUF_C_TYPE_BYTES, /**< arbitrary byte sequence */ + PROTOBUF_C_TYPE_MESSAGE, /**< nested message */ +} ProtobufCType; + +/** + * Field wire types. + * + * \see [Message Structure] in the Protocol Buffers documentation. + * + * [Message Structure]: + * https://developers.google.com/protocol-buffers/docs/encoding#structure + */ +typedef enum { + PROTOBUF_C_WIRE_TYPE_VARINT = 0, + PROTOBUF_C_WIRE_TYPE_64BIT = 1, + PROTOBUF_C_WIRE_TYPE_LENGTH_PREFIXED = 2, + /* "Start group" and "end group" wire types are unsupported. */ + PROTOBUF_C_WIRE_TYPE_32BIT = 5, +} ProtobufCWireType; + +struct ProtobufCAllocator; +struct ProtobufCBinaryData; +struct ProtobufCBuffer; +struct ProtobufCBufferSimple; +struct ProtobufCEnumDescriptor; +struct ProtobufCEnumValue; +struct ProtobufCEnumValueIndex; +struct ProtobufCFieldDescriptor; +struct ProtobufCIntRange; +struct ProtobufCMessage; +struct ProtobufCMessageDescriptor; +struct ProtobufCMessageUnknownField; +struct ProtobufCMethodDescriptor; +struct ProtobufCService; +struct ProtobufCServiceDescriptor; + +typedef struct ProtobufCAllocator ProtobufCAllocator; +typedef struct ProtobufCBinaryData ProtobufCBinaryData; +typedef struct ProtobufCBuffer ProtobufCBuffer; +typedef struct ProtobufCBufferSimple ProtobufCBufferSimple; +typedef struct ProtobufCEnumDescriptor ProtobufCEnumDescriptor; +typedef struct ProtobufCEnumValue ProtobufCEnumValue; +typedef struct ProtobufCEnumValueIndex ProtobufCEnumValueIndex; +typedef struct ProtobufCFieldDescriptor ProtobufCFieldDescriptor; +typedef struct ProtobufCIntRange ProtobufCIntRange; +typedef struct ProtobufCMessage ProtobufCMessage; +typedef struct ProtobufCMessageDescriptor ProtobufCMessageDescriptor; +typedef struct ProtobufCMessageUnknownField ProtobufCMessageUnknownField; +typedef struct ProtobufCMethodDescriptor ProtobufCMethodDescriptor; +typedef struct ProtobufCService ProtobufCService; +typedef struct ProtobufCServiceDescriptor ProtobufCServiceDescriptor; + +/** Boolean type. */ +typedef int protobuf_c_boolean; + +typedef void (*ProtobufCClosure)(const ProtobufCMessage *, void *closure_data); +typedef void (*ProtobufCMessageInit)(ProtobufCMessage *); +typedef void (*ProtobufCServiceDestroy)(ProtobufCService *); + +/** + * Structure for defining a custom memory allocator. + */ +struct ProtobufCAllocator { + /** Function to allocate memory. */ + void *(*alloc)(void *allocator_data, size_t size); + + /** Function to free memory. */ + void (*free)(void *allocator_data, void *pointer); + + /** Opaque pointer passed to `alloc` and `free` functions. */ + void *allocator_data; +}; + +/** + * Structure for the protobuf `bytes` scalar type. + * + * The data contained in a `ProtobufCBinaryData` is an arbitrary sequence of + * bytes. It may contain embedded `NUL` characters and is not required to be + * `NUL`-terminated. + */ +struct ProtobufCBinaryData { + size_t len; /**< Number of bytes in the `data` field. */ + uint8_t *data; /**< Data bytes. */ +}; + +/** + * Structure for defining a virtual append-only buffer. Used by + * protobuf_c_message_pack_to_buffer() to abstract the consumption of serialized + * bytes. + * + * `ProtobufCBuffer` "subclasses" may be defined on the stack. For example, to + * write to a `FILE` object: + * +~~~{.c} +typedef struct { + ProtobufCBuffer base; + FILE *fp; +} BufferAppendToFile; + +static void +my_buffer_file_append(ProtobufCBuffer *buffer, + size_t len, + const uint8_t *data) +{ + BufferAppendToFile *file_buf = (BufferAppendToFile *) buffer; + fwrite(data, len, 1, file_buf->fp); // XXX: No error handling! +} +~~~ + * + * To use this new type of ProtobufCBuffer, it could be called as follows: + * +~~~{.c} +... +BufferAppendToFile tmp = {0}; +tmp.base.append = my_buffer_file_append; +tmp.fp = fp; +protobuf_c_message_pack_to_buffer(&message, &tmp); +... +~~~ + */ +struct ProtobufCBuffer { + /** Append function. Consumes the `len` bytes stored at `data`. */ + void (*append)(ProtobufCBuffer *buffer, + size_t len, + const uint8_t *data); +}; + +/** + * Simple buffer "subclass" of `ProtobufCBuffer`. + * + * A `ProtobufCBufferSimple` object is declared on the stack and uses a + * scratch buffer provided by the user for the initial allocation. It performs + * exponential resizing, using dynamically allocated memory. A + * `ProtobufCBufferSimple` object can be created and used as follows: + * +~~~{.c} +uint8_t pad[128]; +ProtobufCBufferSimple simple = PROTOBUF_C_BUFFER_SIMPLE_INIT(pad); +ProtobufCBuffer *buffer = (ProtobufCBuffer *) &simple; +~~~ + * + * `buffer` can now be used with `protobuf_c_message_pack_to_buffer()`. Once a + * message has been serialized to a `ProtobufCBufferSimple` object, the + * serialized data bytes can be accessed from the `.data` field. + * + * To free the memory allocated by a `ProtobufCBufferSimple` object, if any, + * call PROTOBUF_C_BUFFER_SIMPLE_CLEAR() on the object, for example: + * +~~~{.c} +PROTOBUF_C_BUFFER_SIMPLE_CLEAR(&simple); +~~~ + * + * \see PROTOBUF_C_BUFFER_SIMPLE_INIT + * \see PROTOBUF_C_BUFFER_SIMPLE_CLEAR + */ +struct ProtobufCBufferSimple { + /** "Base class". */ + ProtobufCBuffer base; + /** Number of bytes allocated in `data`. */ + size_t alloced; + /** Number of bytes currently stored in `data`. */ + size_t len; + /** Data bytes. */ + uint8_t *data; + /** Whether `data` must be freed. */ + protobuf_c_boolean must_free_data; + /** Allocator to use. May be NULL to indicate the system allocator. */ + ProtobufCAllocator *allocator; +}; + +/** + * Describes an enumeration as a whole, with all of its values. + */ +struct ProtobufCEnumDescriptor { + /** Magic value checked to ensure that the API is used correctly. */ + uint32_t magic; + + /** The qualified name (e.g., "namespace.Type"). */ + const char *name; + /** The unqualified name as given in the .proto file (e.g., "Type"). */ + const char *short_name; + /** Identifier used in generated C code. */ + const char *c_name; + /** The dot-separated namespace. */ + const char *package_name; + + /** Number elements in `values`. */ + unsigned n_values; + /** Array of distinct values, sorted by numeric value. */ + const ProtobufCEnumValue *values; + + /** Number of elements in `values_by_name`. */ + unsigned n_value_names; + /** Array of named values, including aliases, sorted by name. */ + const ProtobufCEnumValueIndex *values_by_name; + + /** Number of elements in `value_ranges`. */ + unsigned n_value_ranges; + /** Value ranges, for faster lookups by numeric value. */ + const ProtobufCIntRange *value_ranges; + + /** Reserved for future use. */ + void *reserved1; + /** Reserved for future use. */ + void *reserved2; + /** Reserved for future use. */ + void *reserved3; + /** Reserved for future use. */ + void *reserved4; +}; + +/** + * Represents a single value of an enumeration. + */ +struct ProtobufCEnumValue { + /** The string identifying this value in the .proto file. */ + const char *name; + + /** The string identifying this value in generated C code. */ + const char *c_name; + + /** The numeric value assigned in the .proto file. */ + int value; +}; + +/** + * Used by `ProtobufCEnumDescriptor` to look up enum values. + */ +struct ProtobufCEnumValueIndex { + /** Name of the enum value. */ + const char *name; + /** Index into values[] array. */ + unsigned index; +}; + +/** + * Describes a single field in a message. + */ +struct ProtobufCFieldDescriptor { + /** Name of the field as given in the .proto file. */ + const char *name; + + /** Tag value of the field as given in the .proto file. */ + uint32_t id; + + /** Whether the field is `REQUIRED`, `OPTIONAL`, or `REPEATED`. */ + ProtobufCLabel label; + + /** The type of the field. */ + ProtobufCType type; + + /** + * The offset in bytes of the message's C structure's quantifier field + * (the `has_MEMBER` field for optional members or the `n_MEMBER` field + * for repeated members or the case enum for oneofs). + */ + unsigned quantifier_offset; + + /** + * The offset in bytes into the message's C structure for the member + * itself. + */ + unsigned offset; + + /** + * A type-specific descriptor. + * + * If `type` is `PROTOBUF_C_TYPE_ENUM`, then `descriptor` points to the + * corresponding `ProtobufCEnumDescriptor`. + * + * If `type` is `PROTOBUF_C_TYPE_MESSAGE`, then `descriptor` points to + * the corresponding `ProtobufCMessageDescriptor`. + * + * Otherwise this field is NULL. + */ + const void *descriptor; /* for MESSAGE and ENUM types */ + + /** The default value for this field, if defined. May be NULL. */ + const void *default_value; + + /** + * A flag word. Zero or more of the bits defined in the + * `ProtobufCFieldFlag` enum may be set. + */ + uint32_t flags; + + /** Reserved for future use. */ + unsigned reserved_flags; + /** Reserved for future use. */ + void *reserved2; + /** Reserved for future use. */ + void *reserved3; +}; + +/** + * Helper structure for optimizing int => index lookups in the case + * where the keys are mostly consecutive values, as they presumably are for + * enums and fields. + * + * The data structures requires that the values in the original array are + * sorted. + */ +struct ProtobufCIntRange { + int start_value; + unsigned orig_index; + /* + * NOTE: the number of values in the range can be inferred by looking + * at the next element's orig_index. A dummy element is added to make + * this simple. + */ +}; + +/** + * An instance of a message. + * + * `ProtobufCMessage` is a light-weight "base class" for all messages. + * + * In particular, `ProtobufCMessage` doesn't have any allocation policy + * associated with it. That's because it's common to create `ProtobufCMessage` + * objects on the stack. In fact, that's what we recommend for sending messages. + * If the object is allocated from the stack, you can't really have a memory + * leak. + * + * This means that calls to functions like protobuf_c_message_unpack() which + * return a `ProtobufCMessage` must be paired with a call to a free function, + * like protobuf_c_message_free_unpacked(). + */ +struct ProtobufCMessage { + /** The descriptor for this message type. */ + const ProtobufCMessageDescriptor *descriptor; + /** The number of elements in `unknown_fields`. */ + unsigned n_unknown_fields; + /** The fields that weren't recognized by the parser. */ + ProtobufCMessageUnknownField *unknown_fields; +}; + +/** + * Describes a message. + */ +struct ProtobufCMessageDescriptor { + /** Magic value checked to ensure that the API is used correctly. */ + uint32_t magic; + + /** The qualified name (e.g., "namespace.Type"). */ + const char *name; + /** The unqualified name as given in the .proto file (e.g., "Type"). */ + const char *short_name; + /** Identifier used in generated C code. */ + const char *c_name; + /** The dot-separated namespace. */ + const char *package_name; + + /** + * Size in bytes of the C structure representing an instance of this + * type of message. + */ + size_t sizeof_message; + + /** Number of elements in `fields`. */ + unsigned n_fields; + /** Field descriptors, sorted by tag number. */ + const ProtobufCFieldDescriptor *fields; + /** Used for looking up fields by name. */ + const unsigned *fields_sorted_by_name; + + /** Number of elements in `field_ranges`. */ + unsigned n_field_ranges; + /** Used for looking up fields by id. */ + const ProtobufCIntRange *field_ranges; + + /** Message initialisation function. */ + ProtobufCMessageInit message_init; + + /** Reserved for future use. */ + void *reserved1; + /** Reserved for future use. */ + void *reserved2; + /** Reserved for future use. */ + void *reserved3; +}; + +/** + * An unknown message field. + */ +struct ProtobufCMessageUnknownField { + /** The tag number. */ + uint32_t tag; + /** The wire type of the field. */ + ProtobufCWireType wire_type; + /** Number of bytes in `data`. */ + size_t len; + /** Field data. */ + uint8_t *data; +}; + +/** + * Method descriptor. + */ +struct ProtobufCMethodDescriptor { + /** Method name. */ + const char *name; + /** Input message descriptor. */ + const ProtobufCMessageDescriptor *input; + /** Output message descriptor. */ + const ProtobufCMessageDescriptor *output; +}; + +/** + * Service. + */ +struct ProtobufCService { + /** Service descriptor. */ + const ProtobufCServiceDescriptor *descriptor; + /** Function to invoke the service. */ + void (*invoke)(ProtobufCService *service, + unsigned method_index, + const ProtobufCMessage *input, + ProtobufCClosure closure, + void *closure_data); + /** Function to destroy the service. */ + void (*destroy)(ProtobufCService *service); +}; + +/** + * Service descriptor. + */ +struct ProtobufCServiceDescriptor { + /** Magic value checked to ensure that the API is used correctly. */ + uint32_t magic; + + /** Service name. */ + const char *name; + /** Short version of service name. */ + const char *short_name; + /** C identifier for the service name. */ + const char *c_name; + /** Package name. */ + const char *package; + /** Number of elements in `methods`. */ + unsigned n_methods; + /** Method descriptors, in the order defined in the .proto file. */ + const ProtobufCMethodDescriptor *methods; + /** Sort index of methods. */ + const unsigned *method_indices_by_name; +}; + +/** + * Get the version of the protobuf-c library. Note that this is the version of + * the library linked against, not the version of the headers compiled against. + * + * \return A string containing the version number of protobuf-c. + */ +PROTOBUF_C__API +const char * +protobuf_c_version(void); + +/** + * Get the version of the protobuf-c library. Note that this is the version of + * the library linked against, not the version of the headers compiled against. + * + * \return A 32 bit unsigned integer containing the version number of + * protobuf-c, represented in base-10 as (MAJOR*1E6) + (MINOR*1E3) + PATCH. + */ +PROTOBUF_C__API +uint32_t +protobuf_c_version_number(void); + +/** + * The version of the protobuf-c headers, represented as a string using the same + * format as protobuf_c_version(). + */ +#define PROTOBUF_C_VERSION "1.3.0" + +/** + * The version of the protobuf-c headers, represented as an integer using the + * same format as protobuf_c_version_number(). + */ +#define PROTOBUF_C_VERSION_NUMBER 1003000 + +/** + * The minimum protoc-c version which works with the current version of the + * protobuf-c headers. + */ +#define PROTOBUF_C_MIN_COMPILER_VERSION 1000000 + +/** + * Look up a `ProtobufCEnumValue` from a `ProtobufCEnumDescriptor` by name. + * + * \param desc + * The `ProtobufCEnumDescriptor` object. + * \param name + * The `name` field from the corresponding `ProtobufCEnumValue` object to + * match. + * \return + * A `ProtobufCEnumValue` object. + * \retval NULL + * If not found or if the optimize_for = CODE_SIZE option was set. + */ +PROTOBUF_C__API +const ProtobufCEnumValue * +protobuf_c_enum_descriptor_get_value_by_name( + const ProtobufCEnumDescriptor *desc, + const char *name); + +/** + * Look up a `ProtobufCEnumValue` from a `ProtobufCEnumDescriptor` by numeric + * value. + * + * \param desc + * The `ProtobufCEnumDescriptor` object. + * \param value + * The `value` field from the corresponding `ProtobufCEnumValue` object to + * match. + * + * \return + * A `ProtobufCEnumValue` object. + * \retval NULL + * If not found. + */ +PROTOBUF_C__API +const ProtobufCEnumValue * +protobuf_c_enum_descriptor_get_value( + const ProtobufCEnumDescriptor *desc, + int value); + +/** + * Look up a `ProtobufCFieldDescriptor` from a `ProtobufCMessageDescriptor` by + * the name of the field. + * + * \param desc + * The `ProtobufCMessageDescriptor` object. + * \param name + * The name of the field. + * \return + * A `ProtobufCFieldDescriptor` object. + * \retval NULL + * If not found or if the optimize_for = CODE_SIZE option was set. + */ +PROTOBUF_C__API +const ProtobufCFieldDescriptor * +protobuf_c_message_descriptor_get_field_by_name( + const ProtobufCMessageDescriptor *desc, + const char *name); + +/** + * Look up a `ProtobufCFieldDescriptor` from a `ProtobufCMessageDescriptor` by + * the tag value of the field. + * + * \param desc + * The `ProtobufCMessageDescriptor` object. + * \param value + * The tag value of the field. + * \return + * A `ProtobufCFieldDescriptor` object. + * \retval NULL + * If not found. + */ +PROTOBUF_C__API +const ProtobufCFieldDescriptor * +protobuf_c_message_descriptor_get_field( + const ProtobufCMessageDescriptor *desc, + unsigned value); + +/** + * Determine the number of bytes required to store the serialised message. + * + * \param message + * The message object to serialise. + * \return + * Number of bytes. + */ +PROTOBUF_C__API +size_t +protobuf_c_message_get_packed_size(const ProtobufCMessage *message); + +/** + * Serialise a message from its in-memory representation. + * + * This function stores the serialised bytes of the message in a pre-allocated + * buffer. + * + * \param message + * The message object to serialise. + * \param[out] out + * Buffer to store the bytes of the serialised message. This buffer must + * have enough space to store the packed message. Use + * protobuf_c_message_get_packed_size() to determine the number of bytes + * required. + * \return + * Number of bytes stored in `out`. + */ +PROTOBUF_C__API +size_t +protobuf_c_message_pack(const ProtobufCMessage *message, uint8_t *out); + +/** + * Serialise a message from its in-memory representation to a virtual buffer. + * + * This function calls the `append` method of a `ProtobufCBuffer` object to + * consume the bytes generated by the serialiser. + * + * \param message + * The message object to serialise. + * \param buffer + * The virtual buffer object. + * \return + * Number of bytes passed to the virtual buffer. + */ +PROTOBUF_C__API +size_t +protobuf_c_message_pack_to_buffer( + const ProtobufCMessage *message, + ProtobufCBuffer *buffer); + +/** + * Unpack a serialised message into an in-memory representation. + * + * \param descriptor + * The message descriptor. + * \param allocator + * `ProtobufCAllocator` to use for memory allocation. May be NULL to + * specify the default allocator. + * \param len + * Length in bytes of the serialised message. + * \param data + * Pointer to the serialised message. + * \return + * An unpacked message object. + * \retval NULL + * If an error occurred during unpacking. + */ +PROTOBUF_C__API +ProtobufCMessage * +protobuf_c_message_unpack( + const ProtobufCMessageDescriptor *descriptor, + ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); + +/** + * Free an unpacked message object. + * + * This function should be used to deallocate the memory used by a call to + * protobuf_c_message_unpack(). + * + * \param message + * The message object to free. May be NULL. + * \param allocator + * `ProtobufCAllocator` to use for memory deallocation. May be NULL to + * specify the default allocator. + */ +PROTOBUF_C__API +void +protobuf_c_message_free_unpacked( + ProtobufCMessage *message, + ProtobufCAllocator *allocator); + +/** + * Check the validity of a message object. + * + * Makes sure all required fields (`PROTOBUF_C_LABEL_REQUIRED`) are present. + * Recursively checks nested messages. + * + * \retval TRUE + * Message is valid. + * \retval FALSE + * Message is invalid. + */ +PROTOBUF_C__API +protobuf_c_boolean +protobuf_c_message_check(const ProtobufCMessage *); + +/** Message initialiser. */ +#define PROTOBUF_C_MESSAGE_INIT(descriptor) { descriptor, 0, NULL } + +/** + * Initialise a message object from a message descriptor. + * + * \param descriptor + * Message descriptor. + * \param message + * Allocated block of memory of size `descriptor->sizeof_message`. + */ +PROTOBUF_C__API +void +protobuf_c_message_init( + const ProtobufCMessageDescriptor *descriptor, + void *message); + +/** + * Free a service. + * + * \param service + * The service object to free. + */ +PROTOBUF_C__API +void +protobuf_c_service_destroy(ProtobufCService *service); + +/** + * Look up a `ProtobufCMethodDescriptor` by name. + * + * \param desc + * Service descriptor. + * \param name + * Name of the method. + * + * \return + * A `ProtobufCMethodDescriptor` object. + * \retval NULL + * If not found or if the optimize_for = CODE_SIZE option was set. + */ +PROTOBUF_C__API +const ProtobufCMethodDescriptor * +protobuf_c_service_descriptor_get_method_by_name( + const ProtobufCServiceDescriptor *desc, + const char *name); + +/** + * Initialise a `ProtobufCBufferSimple` object. + */ +#define PROTOBUF_C_BUFFER_SIMPLE_INIT(array_of_bytes) \ +{ \ + { protobuf_c_buffer_simple_append }, \ + sizeof(array_of_bytes), \ + 0, \ + (array_of_bytes), \ + 0, \ + NULL \ +} + +/** + * Clear a `ProtobufCBufferSimple` object, freeing any allocated memory. + */ +#define PROTOBUF_C_BUFFER_SIMPLE_CLEAR(simp_buf) \ +do { \ + if ((simp_buf)->must_free_data) { \ + if ((simp_buf)->allocator != NULL) \ + (simp_buf)->allocator->free( \ + (simp_buf)->allocator, \ + (simp_buf)->data); \ + else \ + free((simp_buf)->data); \ + } \ +} while (0) + +/** + * The `append` method for `ProtobufCBufferSimple`. + * + * \param buffer + * The buffer object to append to. Must actually be a + * `ProtobufCBufferSimple` object. + * \param len + * Number of bytes in `data`. + * \param data + * Data to append. + */ +PROTOBUF_C__API +void +protobuf_c_buffer_simple_append( + ProtobufCBuffer *buffer, + size_t len, + const unsigned char *data); + +PROTOBUF_C__API +void +protobuf_c_service_generated_init( + ProtobufCService *service, + const ProtobufCServiceDescriptor *descriptor, + ProtobufCServiceDestroy destroy); + +PROTOBUF_C__API +void +protobuf_c_service_invoke_internal( + ProtobufCService *service, + unsigned method_index, + const ProtobufCMessage *input, + ProtobufCClosure closure, + void *closure_data); + +/**@}*/ + +PROTOBUF_C__END_DECLS + +#endif /* PROTOBUF_C_H */ diff --git a/Software/Visual_Studio/Embroidery/Tango.Embroidery/stdafx.cpp b/Software/Visual_Studio/Embroidery/Tango.Embroidery/stdafx.cpp new file mode 100644 index 000000000..c5d4b7b06 --- /dev/null +++ b/Software/Visual_Studio/Embroidery/Tango.Embroidery/stdafx.cpp @@ -0,0 +1,8 @@ +// stdafx.cpp : source file that includes just the standard includes +// Tango.Embroidery.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + +// TODO: reference any additional headers you need in STDAFX.H +// and not in this file diff --git a/Software/Visual_Studio/Embroidery/Tango.Embroidery/targetver.h b/Software/Visual_Studio/Embroidery/Tango.Embroidery/targetver.h new file mode 100644 index 000000000..87c0086de --- /dev/null +++ b/Software/Visual_Studio/Embroidery/Tango.Embroidery/targetver.h @@ -0,0 +1,8 @@ +#pragma once + +// Including SDKDDKVer.h defines the highest available Windows platform. + +// If you wish to build your application for a previous Windows platform, include WinSDKVer.h and +// set the _WIN32_WINNT macro to the platform you wish to support before including SDKDDKVer.h. + +#include <SDKDDKVer.h> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml index 64d20a62c..49444750f 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.Developer/Views/JobView.xaml @@ -157,7 +157,7 @@ </StackPanel> </ToggleButton> <Popup x:Name="Popup" MouseDown="Popup_MouseDown" PopupAnimation="Fade" StaysOpen="False" PlacementTarget="{Binding ElementName=PopupButton}" Placement="Bottom" AllowsTransparency="True"> - <Border Background="#E6FFFFFF" Height="250" Width="500" CornerRadius="5" Margin="10"> + <Border Background="#E6FFFFFF" Height="250" Width="550" CornerRadius="5" Margin="10"> <Border.Effect> <DropShadowEffect ShadowDepth="0" BlurRadius="10" /> </Border.Effect> @@ -737,12 +737,7 @@ </mahapps:NumericUpDown> </ContentControl> - <Rectangle Margin="30 0 0 0" Width="50" Height="50" StrokeThickness="1" Stroke="Gray"> - <Rectangle.Fill> - <SolidColorBrush Color="{Binding Color}"> - </SolidColorBrush> - </Rectangle.Fill> - </Rectangle> + <ContentControl Style="{StaticResource colorPicker}"></ContentControl> </StackPanel> </Setter.Value> </Setter> @@ -775,12 +770,7 @@ </mahapps:NumericUpDown> </ContentControl> - <Rectangle Margin="30 0 0 0" Width="50" Height="50" StrokeThickness="1" Stroke="Gray"> - <Rectangle.Fill> - <SolidColorBrush Color="{Binding Color}"> - </SolidColorBrush> - </Rectangle.Fill> - </Rectangle> + <ContentControl Style="{StaticResource colorPicker}"></ContentControl> </StackPanel> </Setter.Value> </Setter> diff --git a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/ViewModels/MainViewVM.cs b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/ViewModels/MainViewVM.cs index 64fc359ea..a2c7e4460 100644 --- a/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/ViewModels/MainViewVM.cs +++ b/Software/Visual_Studio/MachineStudio/Modules/Tango.MachineStudio.HardwareDesigner/ViewModels/MainViewVM.cs @@ -186,10 +186,12 @@ namespace Tango.MachineStudio.HardwareDesigner.ViewModels realVersion.HardwareDancers.ToList().ForEach(x => x.DefferedDelete(Adapter.Context)); realVersion.HardwareMotors.ToList().ForEach(x => x.DefferedDelete(Adapter.Context)); realVersion.HardwarePidControls.ToList().ForEach(x => x.DefferedDelete(Adapter.Context)); + realVersion.HardwareWinders.ToList().ForEach(x => x.DefferedDelete(Adapter.Context)); realVersion.HardwareDancers.Clear(); realVersion.HardwareMotors.Clear(); realVersion.HardwarePidControls.Clear(); + realVersion.HardwareWinders.Clear(); foreach (var item in CurrentVersion.HardwareDancers.ToList().Select(x => x.Clone())) @@ -209,6 +211,11 @@ namespace Tango.MachineStudio.HardwareDesigner.ViewModels item.HardwareVersionGuid = realVersion.Guid; realVersion.HardwarePidControls.Add(item); } + foreach (var item in CurrentVersion.HardwareWinders.ToList().Select(x => x.Clone())) + { + item.HardwareVersionGuid = realVersion.Guid; + realVersion.HardwareWinders.Add(item); + } } diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/HiveColorPickerControl.xaml b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/HiveColorPickerControl.xaml index 6a9bf9cc9..2aa11c63c 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/HiveColorPickerControl.xaml +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/HiveColorPickerControl.xaml @@ -4,14 +4,17 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:colorPicker="clr-namespace:Tango;assembly=Tango.ColorPicker" + xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes" xmlns:controls="clr-namespace:Tango.SharedUI.Controls;assembly=Tango.SharedUI" + xmlns:shapes="clr-namespace:Tango.SharedUI.Shapes;assembly=Tango.SharedUI" xmlns:local="clr-namespace:Tango.MachineStudio.Common.Controls" mc:Ignorable="d" - d:DesignHeight="250" d:DesignWidth="500" > + d:DesignHeight="250" d:DesignWidth="550" Background="White"> <Grid> <Grid.ColumnDefinitions> <ColumnDefinition Width="235"/> - <ColumnDefinition Width="43*"/> + <ColumnDefinition Width="1*"/> + <ColumnDefinition Width="50"/> </Grid.ColumnDefinitions> <colorPicker:ColorCanvas SelectedColor="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=SelectedColor,Mode=TwoWay}" Background="Transparent" BorderThickness="0" UsingAlphaChannel="False" /> @@ -19,5 +22,30 @@ <Viewbox Stretch="Uniform" Grid.Column="1" Margin="5"> <controls:HiveControl x:Name="hive" Height="250" HexagonSelected="hive_HexagonSelected" MaxSelections="1" Width="250" BorderThickness="1" /> </Viewbox> + + <Grid Grid.Column="2"> + <Grid> + <Grid.RowDefinitions> + <RowDefinition Height="1*"/> + <RowDefinition Height="45"/> + <RowDefinition Height="1*"/> + </Grid.RowDefinitions> + <Button ToolTip="Increase Delta Resolution" Click="OnResolutionUpClicked" Style="{StaticResource MaterialDesignFlatButton}" Height="50" Padding="0" Foreground="#202020" VerticalAlignment="Bottom"> + <materialDesign:PackIcon Kind="ArrowUp" Width="24" Height="24" /> + </Button> + + <Grid Grid.Row="1"> + <shapes:Hexagon Stroke="#202020" StrokeThickness="1" Margin="5" /> + <TextBlock TextAlignment="Center" HorizontalAlignment="Center" VerticalAlignment="Center" FontWeight="Bold" FontStyle="Italic" FontSize="10"> + <Run Text="Δ"></Run> + <Run Text="{Binding RelativeSource={RelativeSource AncestorType=UserControl},Path=Resolution,FallbackValue=1}"></Run> + </TextBlock> + </Grid> + + <Button ToolTip="Decrease Delta Resolution" Click="OnResolutionDownClicked" Grid.Row="2" Style="{StaticResource MaterialDesignFlatButton}" Height="50" Padding="0" Foreground="#202020" VerticalAlignment="Top"> + <materialDesign:PackIcon Kind="ArrowDown" Width="24" Height="24" /> + </Button> + </Grid> + </Grid> </Grid> </UserControl> diff --git a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/HiveColorPickerControl.xaml.cs b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/HiveColorPickerControl.xaml.cs index 9432ae9ef..7d1a1dc81 100644 --- a/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/HiveColorPickerControl.xaml.cs +++ b/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.Common/Controls/HiveColorPickerControl.xaml.cs @@ -31,6 +31,14 @@ namespace Tango.MachineStudio.Common.Controls public static readonly DependencyProperty DemoModeProperty = DependencyProperty.Register("DemoMode", typeof(bool), typeof(HiveColorPickerControl), new PropertyMetadata(false)); + public int Resolution + { + get { return (int)GetValue(ResolutionProperty); } + set { SetValue(ResolutionProperty, value); } + } + public static readonly DependencyProperty ResolutionProperty = + DependencyProperty.Register("Resolution", typeof(int), typeof(HiveColorPickerControl), new PropertyMetadata(1, (d, e) => (d as HiveColorPickerControl).OnResolutionChanged())); + public Color SelectedColor { get { return (Color)GetValue(SelectedColorProperty); } @@ -80,6 +88,11 @@ namespace Tango.MachineStudio.Common.Controls _preventHiveSelectedColorChange = false; } + private void OnResolutionChanged() + { + GenerateDemoModeHiveColors(); + } + private void GenerateDemoModeHiveColors() { if (hive.CenterHexagon != null) @@ -94,9 +107,25 @@ namespace Tango.MachineStudio.Common.Controls { (hexagon.Fill as SolidColorBrush).Color = Color.FromRgb((byte)Math.Min(SelectedColor.R + counter++, 255), (byte)Math.Min((SelectedColor.G + counter++), 255), (byte)Math.Min((SelectedColor.B + counter++), 255)); - counter += 4; + counter += (int)(4d * ((double)Resolution / 4d)); } } } + + private void OnResolutionUpClicked(object sender, RoutedEventArgs e) + { + if (Resolution < 10) + { + Resolution++; + } + } + + private void OnResolutionDownClicked(object sender, RoutedEventArgs e) + { + if (Resolution > 1) + { + Resolution--; + } + } } } diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/Exports.cpp b/Software/Visual_Studio/Native/Tango.ColorLib/Exports.cpp index db94a6609..eced78115 100644 --- a/Software/Visual_Studio/Native/Tango.ColorLib/Exports.cpp +++ b/Software/Visual_Studio/Native/Tango.ColorLib/Exports.cpp @@ -16,7 +16,7 @@ extern "C" EXPORT_API size_t __cdecl Calculate(uint8_t* request_buffer, size_t r return tester.Calculate(request_buffer, request_buffer_size, response_buffer); } -extern "C" EXPORT_API size_t __cdecl ForwardConvert(uint8_t* input_buffer, size_t input_buffer_size, uint8_t*& output_buffer) +extern "C" EXPORT_API size_t __cdecl Convert(uint8_t* input_buffer, size_t input_buffer_size, uint8_t*& output_buffer) { ColorConverter converter; return converter.Convert(input_buffer, input_buffer_size, output_buffer); diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Common/MessageType.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Common/MessageType.pb-c.c index fb5ce4755..b193ae3e1 100644 --- a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Common/MessageType.pb-c.c +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Common/MessageType.pb-c.c @@ -7,7 +7,7 @@ #endif #include "MessageType.pb-c.h" -static const ProtobufCEnumValue message_type__enum_values_by_number[72] = +static const ProtobufCEnumValue message_type__enum_values_by_number[102] = { { "None", "MESSAGE_TYPE__None", 0 }, { "CalculateRequest", "MESSAGE_TYPE__CalculateRequest", 3 }, @@ -44,6 +44,30 @@ static const ProtobufCEnumValue message_type__enum_values_by_number[72] = { "StubExtFlashReadResponse", "MESSAGE_TYPE__StubExtFlashReadResponse", 34 }, { "StubExtFlashWriteRequest", "MESSAGE_TYPE__StubExtFlashWriteRequest", 35 }, { "StubExtFlashWriteResponse", "MESSAGE_TYPE__StubExtFlashWriteResponse", 36 }, + { "StubFPGAReadBackRegRequest", "MESSAGE_TYPE__StubFPGAReadBackRegRequest", 37 }, + { "StubFPGAReadBackRegResponse", "MESSAGE_TYPE__StubFPGAReadBackRegResponse", 38 }, + { "StubFPGAReadVersionRequest", "MESSAGE_TYPE__StubFPGAReadVersionRequest", 39 }, + { "StubFPGAReadVersionResponse", "MESSAGE_TYPE__StubFPGAReadVersionResponse", 40 }, + { "StubL6470DriverRequest", "MESSAGE_TYPE__StubL6470DriverRequest", 41 }, + { "StubL6470DriverResponse", "MESSAGE_TYPE__StubL6470DriverResponse", 42 }, + { "StubMotorInitRequest", "MESSAGE_TYPE__StubMotorInitRequest", 43 }, + { "StubMotorInitResponse", "MESSAGE_TYPE__StubMotorInitResponse", 44 }, + { "StubMotorRunRequest", "MESSAGE_TYPE__StubMotorRunRequest", 45 }, + { "StubMotorRunResponse", "MESSAGE_TYPE__StubMotorRunResponse", 46 }, + { "StubMotorStopRequest", "MESSAGE_TYPE__StubMotorStopRequest", 47 }, + { "StubMotorStopResponse", "MESSAGE_TYPE__StubMotorStopResponse", 48 }, + { "StubMotorStatusRequest", "MESSAGE_TYPE__StubMotorStatusRequest", 49 }, + { "StubMotorStatusResponse", "MESSAGE_TYPE__StubMotorStatusResponse", 50 }, + { "StubMotorMovRequest", "MESSAGE_TYPE__StubMotorMovRequest", 51 }, + { "StubMotorMovResponse", "MESSAGE_TYPE__StubMotorMovResponse", 52 }, + { "StubMotorSpeedRequest", "MESSAGE_TYPE__StubMotorSpeedRequest", 53 }, + { "StubMotorSpeedResponse", "MESSAGE_TYPE__StubMotorSpeedResponse", 54 }, + { "StubMotorPositionRequest", "MESSAGE_TYPE__StubMotorPositionRequest", 55 }, + { "StubMotorPositionResponse", "MESSAGE_TYPE__StubMotorPositionResponse", 56 }, + { "StubHWVersionRequest", "MESSAGE_TYPE__StubHWVersionRequest", 57 }, + { "StubHWVersionResponse", "MESSAGE_TYPE__StubHWVersionResponse", 58 }, + { "StubF3Gpo01WriteRequest", "MESSAGE_TYPE__StubF3Gpo01WriteRequest", 59 }, + { "StubF3Gpo01WriteResponse", "MESSAGE_TYPE__StubF3Gpo01WriteResponse", 60 }, { "ExternalBridgeUdpDiscoveryPacket", "MESSAGE_TYPE__ExternalBridgeUdpDiscoveryPacket", 1000 }, { "ExternalClientLoginRequest", "MESSAGE_TYPE__ExternalClientLoginRequest", 1001 }, { "ExternalClientLoginResponse", "MESSAGE_TYPE__ExternalClientLoginResponse", 1002 }, @@ -81,50 +105,58 @@ static const ProtobufCEnumValue message_type__enum_values_by_number[72] = { "JobResponse", "MESSAGE_TYPE__JobResponse", 3001 }, { "AbortJobRequest", "MESSAGE_TYPE__AbortJobRequest", 3002 }, { "AbortJobResponse", "MESSAGE_TYPE__AbortJobResponse", 3003 }, + { "UploadProcessParametersRequest", "MESSAGE_TYPE__UploadProcessParametersRequest", 3004 }, + { "UploadProcessParametersResponse", "MESSAGE_TYPE__UploadProcessParametersResponse", 3005 }, + { "DebugLogRequest", "MESSAGE_TYPE__DebugLogRequest", 4000 }, + { "DebugLogResponse", "MESSAGE_TYPE__DebugLogResponse", 4001 }, + { "UploadHardwareConfigurationRequest", "MESSAGE_TYPE__UploadHardwareConfigurationRequest", 5000 }, + { "UploadHardwareConfigurationResponse", "MESSAGE_TYPE__UploadHardwareConfigurationResponse", 5001 }, }; static const ProtobufCIntRange message_type__value_ranges[] = { -{0, 0},{3, 1},{1000, 35},{2000, 44},{3000, 68},{0, 72} +{0, 0},{3, 1},{1000, 59},{2000, 68},{3000, 92},{4000, 98},{5000, 100},{0, 102} }; -static const ProtobufCEnumValueIndex message_type__enum_values_by_name[72] = +static const ProtobufCEnumValueIndex message_type__enum_values_by_name[102] = { - { "AbortJobRequest", 70 }, - { "AbortJobResponse", 71 }, + { "AbortJobRequest", 94 }, + { "AbortJobResponse", 95 }, { "CalculateRequest", 1 }, { "CalculateResponse", 2 }, - { "DirectSynchronizationRequest", 38 }, - { "DirectSynchronizationResponse", 39 }, - { "DispenserAbortHomingRequest", 54 }, - { "DispenserAbortHomingResponse", 55 }, - { "DispenserAbortJoggingRequest", 60 }, - { "DispenserAbortJoggingResponse", 61 }, - { "DispenserHomingRequest", 56 }, - { "DispenserHomingResponse", 57 }, - { "DispenserJoggingRequest", 58 }, - { "DispenserJoggingResponse", 59 }, - { "ExternalBridgeUdpDiscoveryPacket", 35 }, - { "ExternalClientLoginRequest", 36 }, - { "ExternalClientLoginResponse", 37 }, - { "JobRequest", 68 }, - { "JobResponse", 69 }, - { "KeepAliveRequest", 42 }, - { "KeepAliveResponse", 43 }, - { "MotorAbortHomingRequest", 46 }, - { "MotorAbortHomingResponse", 47 }, - { "MotorAbortJoggingRequest", 52 }, - { "MotorAbortJoggingResponse", 53 }, - { "MotorHomingRequest", 48 }, - { "MotorHomingResponse", 49 }, - { "MotorJoggingRequest", 50 }, - { "MotorJoggingResponse", 51 }, + { "DebugLogRequest", 98 }, + { "DebugLogResponse", 99 }, + { "DirectSynchronizationRequest", 62 }, + { "DirectSynchronizationResponse", 63 }, + { "DispenserAbortHomingRequest", 78 }, + { "DispenserAbortHomingResponse", 79 }, + { "DispenserAbortJoggingRequest", 84 }, + { "DispenserAbortJoggingResponse", 85 }, + { "DispenserHomingRequest", 80 }, + { "DispenserHomingResponse", 81 }, + { "DispenserJoggingRequest", 82 }, + { "DispenserJoggingResponse", 83 }, + { "ExternalBridgeUdpDiscoveryPacket", 59 }, + { "ExternalClientLoginRequest", 60 }, + { "ExternalClientLoginResponse", 61 }, + { "JobRequest", 92 }, + { "JobResponse", 93 }, + { "KeepAliveRequest", 66 }, + { "KeepAliveResponse", 67 }, + { "MotorAbortHomingRequest", 70 }, + { "MotorAbortHomingResponse", 71 }, + { "MotorAbortJoggingRequest", 76 }, + { "MotorAbortJoggingResponse", 77 }, + { "MotorHomingRequest", 72 }, + { "MotorHomingResponse", 73 }, + { "MotorJoggingRequest", 74 }, + { "MotorJoggingResponse", 75 }, { "None", 0 }, - { "OverrideDataBaseRequest", 40 }, - { "OverrideDataBaseResponse", 41 }, + { "OverrideDataBaseRequest", 64 }, + { "OverrideDataBaseResponse", 65 }, { "ProgressRequest", 3 }, { "ProgressResponse", 4 }, - { "PushDiagnosticsRequest", 44 }, - { "PushDiagnosticsResponse", 45 }, - { "SetDigitalOutRequest", 62 }, - { "SetDigitalOutResponse", 63 }, + { "PushDiagnosticsRequest", 68 }, + { "PushDiagnosticsResponse", 69 }, + { "SetDigitalOutRequest", 86 }, + { "SetDigitalOutResponse", 87 }, { "StubCartridgeReadRequest", 5 }, { "StubCartridgeReadResponse", 6 }, { "StubCartridgeWriteRequest", 7 }, @@ -135,6 +167,12 @@ static const ProtobufCEnumValueIndex message_type__enum_values_by_name[72] = { "StubExtFlashReadResponse", 32 }, { "StubExtFlashWriteRequest", 33 }, { "StubExtFlashWriteResponse", 34 }, + { "StubF3Gpo01WriteRequest", 57 }, + { "StubF3Gpo01WriteResponse", 58 }, + { "StubFPGAReadBackRegRequest", 35 }, + { "StubFPGAReadBackRegResponse", 36 }, + { "StubFPGAReadVersionRequest", 37 }, + { "StubFPGAReadVersionResponse", 38 }, { "StubGPIOInputSetupRequest", 11 }, { "StubGPIOInputSetupResponse", 12 }, { "StubGPIOReadBitRequest", 13 }, @@ -145,20 +183,42 @@ static const ProtobufCEnumValueIndex message_type__enum_values_by_name[72] = { "StubGPIOWriteBitResponse", 18 }, { "StubGPIOWriteByteRequest", 19 }, { "StubGPIOWriteByteResponse", 20 }, + { "StubHWVersionRequest", 55 }, + { "StubHWVersionResponse", 56 }, { "StubHeaterRequest", 21 }, { "StubHeaterResponse", 22 }, + { "StubL6470DriverRequest", 39 }, + { "StubL6470DriverResponse", 40 }, { "StubMotorEncoderRequest", 23 }, { "StubMotorEncoderResponse", 24 }, + { "StubMotorInitRequest", 41 }, + { "StubMotorInitResponse", 42 }, + { "StubMotorMovRequest", 49 }, + { "StubMotorMovResponse", 50 }, + { "StubMotorPositionRequest", 53 }, + { "StubMotorPositionResponse", 54 }, + { "StubMotorRunRequest", 43 }, + { "StubMotorRunResponse", 44 }, + { "StubMotorSpeedRequest", 51 }, + { "StubMotorSpeedResponse", 52 }, + { "StubMotorStatusRequest", 47 }, + { "StubMotorStatusResponse", 48 }, + { "StubMotorStopRequest", 45 }, + { "StubMotorStopResponse", 46 }, { "StubOptLimitSwitchRequest", 25 }, { "StubOptLimitSwitchResponse", 26 }, { "StubSteperMotorRequest", 27 }, { "StubSteperMotorResponse", 28 }, { "StubValveRequest", 29 }, { "StubValveResponse", 30 }, - { "ThreadAbortJoggingRequest", 66 }, - { "ThreadAbortJoggingResponse", 67 }, - { "ThreadJoggingRequest", 64 }, - { "ThreadJoggingResponse", 65 }, + { "ThreadAbortJoggingRequest", 90 }, + { "ThreadAbortJoggingResponse", 91 }, + { "ThreadJoggingRequest", 88 }, + { "ThreadJoggingResponse", 89 }, + { "UploadHardwareConfigurationRequest", 100 }, + { "UploadHardwareConfigurationResponse", 101 }, + { "UploadProcessParametersRequest", 96 }, + { "UploadProcessParametersResponse", 97 }, }; const ProtobufCEnumDescriptor message_type__descriptor = { @@ -167,11 +227,11 @@ const ProtobufCEnumDescriptor message_type__descriptor = "MessageType", "MessageType", "", - 72, + 102, message_type__enum_values_by_number, - 72, + 102, message_type__enum_values_by_name, - 5, + 7, message_type__value_ranges, NULL,NULL,NULL,NULL /* reserved[1234] */ }; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Common/MessageType.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Common/MessageType.pb-c.h index b465f2fe2..f5e6eb785 100644 --- a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Common/MessageType.pb-c.h +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Common/MessageType.pb-c.h @@ -55,6 +55,30 @@ typedef enum _MessageType { MESSAGE_TYPE__StubExtFlashReadResponse = 34, MESSAGE_TYPE__StubExtFlashWriteRequest = 35, MESSAGE_TYPE__StubExtFlashWriteResponse = 36, + MESSAGE_TYPE__StubFPGAReadBackRegRequest = 37, + MESSAGE_TYPE__StubFPGAReadBackRegResponse = 38, + MESSAGE_TYPE__StubFPGAReadVersionRequest = 39, + MESSAGE_TYPE__StubFPGAReadVersionResponse = 40, + MESSAGE_TYPE__StubL6470DriverRequest = 41, + MESSAGE_TYPE__StubL6470DriverResponse = 42, + MESSAGE_TYPE__StubMotorInitRequest = 43, + MESSAGE_TYPE__StubMotorInitResponse = 44, + MESSAGE_TYPE__StubMotorRunRequest = 45, + MESSAGE_TYPE__StubMotorRunResponse = 46, + MESSAGE_TYPE__StubMotorStopRequest = 47, + MESSAGE_TYPE__StubMotorStopResponse = 48, + MESSAGE_TYPE__StubMotorStatusRequest = 49, + MESSAGE_TYPE__StubMotorStatusResponse = 50, + MESSAGE_TYPE__StubMotorMovRequest = 51, + MESSAGE_TYPE__StubMotorMovResponse = 52, + MESSAGE_TYPE__StubMotorSpeedRequest = 53, + MESSAGE_TYPE__StubMotorSpeedResponse = 54, + MESSAGE_TYPE__StubMotorPositionRequest = 55, + MESSAGE_TYPE__StubMotorPositionResponse = 56, + MESSAGE_TYPE__StubHWVersionRequest = 57, + MESSAGE_TYPE__StubHWVersionResponse = 58, + MESSAGE_TYPE__StubF3Gpo01WriteRequest = 59, + MESSAGE_TYPE__StubF3Gpo01WriteResponse = 60, MESSAGE_TYPE__ExternalBridgeUdpDiscoveryPacket = 1000, MESSAGE_TYPE__ExternalClientLoginRequest = 1001, MESSAGE_TYPE__ExternalClientLoginResponse = 1002, @@ -91,7 +115,13 @@ typedef enum _MessageType { MESSAGE_TYPE__JobRequest = 3000, MESSAGE_TYPE__JobResponse = 3001, MESSAGE_TYPE__AbortJobRequest = 3002, - MESSAGE_TYPE__AbortJobResponse = 3003 + MESSAGE_TYPE__AbortJobResponse = 3003, + MESSAGE_TYPE__UploadProcessParametersRequest = 3004, + MESSAGE_TYPE__UploadProcessParametersResponse = 3005, + MESSAGE_TYPE__DebugLogRequest = 4000, + MESSAGE_TYPE__DebugLogResponse = 4001, + MESSAGE_TYPE__UploadHardwareConfigurationRequest = 5000, + MESSAGE_TYPE__UploadHardwareConfigurationResponse = 5001 PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(MESSAGE_TYPE) } MessageType; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Debugging/DebugLogCategory.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Debugging/DebugLogCategory.pb-c.c new file mode 100644 index 000000000..ebb901ba8 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Debugging/DebugLogCategory.pb-c.c @@ -0,0 +1,43 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: DebugLogCategory.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "DebugLogCategory.pb-c.h" +static const ProtobufCEnumValue debug_log_category__enum_values_by_number[5] = +{ + { "Info", "DEBUG_LOG_CATEGORY__Info", 0 }, + { "Warning", "DEBUG_LOG_CATEGORY__Warning", 1 }, + { "Error", "DEBUG_LOG_CATEGORY__Error", 2 }, + { "Critical", "DEBUG_LOG_CATEGORY__Critical", 3 }, + { "Debug", "DEBUG_LOG_CATEGORY__Debug", 4 }, +}; +static const ProtobufCIntRange debug_log_category__value_ranges[] = { +{0, 0},{0, 5} +}; +static const ProtobufCEnumValueIndex debug_log_category__enum_values_by_name[5] = +{ + { "Critical", 3 }, + { "Debug", 4 }, + { "Error", 2 }, + { "Info", 0 }, + { "Warning", 1 }, +}; +const ProtobufCEnumDescriptor debug_log_category__descriptor = +{ + PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC, + "DebugLogCategory", + "DebugLogCategory", + "DebugLogCategory", + "", + 5, + debug_log_category__enum_values_by_number, + 5, + debug_log_category__enum_values_by_name, + 1, + debug_log_category__value_ranges, + NULL,NULL,NULL,NULL /* reserved[1234] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Debugging/DebugLogCategory.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Debugging/DebugLogCategory.pb-c.h new file mode 100644 index 000000000..d97b42d33 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Debugging/DebugLogCategory.pb-c.h @@ -0,0 +1,46 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: DebugLogCategory.proto */ + +#ifndef PROTOBUF_C_DebugLogCategory_2eproto__INCLUDED +#define PROTOBUF_C_DebugLogCategory_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + + + +/* --- enums --- */ + +typedef enum _DebugLogCategory { + DEBUG_LOG_CATEGORY__Info = 0, + DEBUG_LOG_CATEGORY__Warning = 1, + DEBUG_LOG_CATEGORY__Error = 2, + DEBUG_LOG_CATEGORY__Critical = 3, + DEBUG_LOG_CATEGORY__Debug = 4 + PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(DEBUG_LOG_CATEGORY) +} DebugLogCategory; + +/* --- messages --- */ + +/* --- per-message closures --- */ + + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCEnumDescriptor debug_log_category__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_DebugLogCategory_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Debugging/DebugLogRequest.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Debugging/DebugLogRequest.pb-c.c new file mode 100644 index 000000000..e8faeddcb --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Debugging/DebugLogRequest.pb-c.c @@ -0,0 +1,72 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: DebugLogRequest.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "DebugLogRequest.pb-c.h" +void debug_log_request__init + (DebugLogRequest *message) +{ + static const DebugLogRequest init_value = DEBUG_LOG_REQUEST__INIT; + *message = init_value; +} +size_t debug_log_request__get_packed_size + (const DebugLogRequest *message) +{ + assert(message->base.descriptor == &debug_log_request__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t debug_log_request__pack + (const DebugLogRequest *message, + uint8_t *out) +{ + assert(message->base.descriptor == &debug_log_request__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t debug_log_request__pack_to_buffer + (const DebugLogRequest *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &debug_log_request__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +DebugLogRequest * + debug_log_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (DebugLogRequest *) + protobuf_c_message_unpack (&debug_log_request__descriptor, + allocator, len, data); +} +void debug_log_request__free_unpacked + (DebugLogRequest *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &debug_log_request__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +#define debug_log_request__field_descriptors NULL +#define debug_log_request__field_indices_by_name NULL +#define debug_log_request__number_ranges NULL +const ProtobufCMessageDescriptor debug_log_request__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "DebugLogRequest", + "DebugLogRequest", + "DebugLogRequest", + "", + sizeof(DebugLogRequest), + 0, + debug_log_request__field_descriptors, + debug_log_request__field_indices_by_name, + 0, debug_log_request__number_ranges, + (ProtobufCMessageInit) debug_log_request__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Debugging/DebugLogRequest.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Debugging/DebugLogRequest.pb-c.h new file mode 100644 index 000000000..2507b3068 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Debugging/DebugLogRequest.pb-c.h @@ -0,0 +1,70 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: DebugLogRequest.proto */ + +#ifndef PROTOBUF_C_DebugLogRequest_2eproto__INCLUDED +#define PROTOBUF_C_DebugLogRequest_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _DebugLogRequest DebugLogRequest; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _DebugLogRequest +{ + ProtobufCMessage base; +}; +#define DEBUG_LOG_REQUEST__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&debug_log_request__descriptor) \ + } + + +/* DebugLogRequest methods */ +void debug_log_request__init + (DebugLogRequest *message); +size_t debug_log_request__get_packed_size + (const DebugLogRequest *message); +size_t debug_log_request__pack + (const DebugLogRequest *message, + uint8_t *out); +size_t debug_log_request__pack_to_buffer + (const DebugLogRequest *message, + ProtobufCBuffer *buffer); +DebugLogRequest * + debug_log_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void debug_log_request__free_unpacked + (DebugLogRequest *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*DebugLogRequest_Closure) + (const DebugLogRequest *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor debug_log_request__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_DebugLogRequest_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Debugging/DebugLogResponse.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Debugging/DebugLogResponse.pb-c.c new file mode 100644 index 000000000..36e08e981 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Debugging/DebugLogResponse.pb-c.c @@ -0,0 +1,157 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: DebugLogResponse.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "DebugLogResponse.pb-c.h" +void debug_log_response__init + (DebugLogResponse *message) +{ + static const DebugLogResponse init_value = DEBUG_LOG_RESPONSE__INIT; + *message = init_value; +} +size_t debug_log_response__get_packed_size + (const DebugLogResponse *message) +{ + assert(message->base.descriptor == &debug_log_response__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t debug_log_response__pack + (const DebugLogResponse *message, + uint8_t *out) +{ + assert(message->base.descriptor == &debug_log_response__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t debug_log_response__pack_to_buffer + (const DebugLogResponse *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &debug_log_response__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +DebugLogResponse * + debug_log_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (DebugLogResponse *) + protobuf_c_message_unpack (&debug_log_response__descriptor, + allocator, len, data); +} +void debug_log_response__free_unpacked + (DebugLogResponse *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &debug_log_response__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor debug_log_response__field_descriptors[6] = +{ + { + "Category", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_ENUM, + offsetof(DebugLogResponse, has_category), + offsetof(DebugLogResponse, category), + &debug_log_category__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "FileName", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(DebugLogResponse, filename), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "LineNumber", + 3, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(DebugLogResponse, has_linenumber), + offsetof(DebugLogResponse, linenumber), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Filter", + 4, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(DebugLogResponse, has_filter), + offsetof(DebugLogResponse, filter), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Message", + 5, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(DebugLogResponse, message), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "ModuleId", + 6, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(DebugLogResponse, has_moduleid), + offsetof(DebugLogResponse, moduleid), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned debug_log_response__field_indices_by_name[] = { + 0, /* field[0] = Category */ + 1, /* field[1] = FileName */ + 3, /* field[3] = Filter */ + 2, /* field[2] = LineNumber */ + 4, /* field[4] = Message */ + 5, /* field[5] = ModuleId */ +}; +static const ProtobufCIntRange debug_log_response__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 6 } +}; +const ProtobufCMessageDescriptor debug_log_response__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "DebugLogResponse", + "DebugLogResponse", + "DebugLogResponse", + "", + sizeof(DebugLogResponse), + 6, + debug_log_response__field_descriptors, + debug_log_response__field_indices_by_name, + 1, debug_log_response__number_ranges, + (ProtobufCMessageInit) debug_log_response__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Debugging/DebugLogResponse.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Debugging/DebugLogResponse.pb-c.h new file mode 100644 index 000000000..414c07188 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Debugging/DebugLogResponse.pb-c.h @@ -0,0 +1,81 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: DebugLogResponse.proto */ + +#ifndef PROTOBUF_C_DebugLogResponse_2eproto__INCLUDED +#define PROTOBUF_C_DebugLogResponse_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + +#include "DebugLogCategory.pb-c.h" + +typedef struct _DebugLogResponse DebugLogResponse; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _DebugLogResponse +{ + ProtobufCMessage base; + protobuf_c_boolean has_category; + DebugLogCategory category; + char *filename; + protobuf_c_boolean has_linenumber; + uint32_t linenumber; + protobuf_c_boolean has_filter; + uint32_t filter; + char *message; + protobuf_c_boolean has_moduleid; + uint32_t moduleid; +}; +#define DEBUG_LOG_RESPONSE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&debug_log_response__descriptor) \ + , 0, DEBUG_LOG_CATEGORY__Info, NULL, 0, 0, 0, 0, NULL, 0, 0 } + + +/* DebugLogResponse methods */ +void debug_log_response__init + (DebugLogResponse *message); +size_t debug_log_response__get_packed_size + (const DebugLogResponse *message); +size_t debug_log_response__pack + (const DebugLogResponse *message, + uint8_t *out); +size_t debug_log_response__pack_to_buffer + (const DebugLogResponse *message, + ProtobufCBuffer *buffer); +DebugLogResponse * + debug_log_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void debug_log_response__free_unpacked + (DebugLogResponse *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*DebugLogResponse_Closure) + (const DebugLogResponse *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor debug_log_response__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_DebugLogResponse_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Embroidery/AnalyzeInput.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Embroidery/AnalyzeInput.pb-c.c new file mode 100644 index 000000000..8cab316aa --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Embroidery/AnalyzeInput.pb-c.c @@ -0,0 +1,92 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: AnalyzeInput.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "AnalyzeInput.pb-c.h" +void analyze_input__init + (AnalyzeInput *message) +{ + static const AnalyzeInput init_value = ANALYZE_INPUT__INIT; + *message = init_value; +} +size_t analyze_input__get_packed_size + (const AnalyzeInput *message) +{ + assert(message->base.descriptor == &analyze_input__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t analyze_input__pack + (const AnalyzeInput *message, + uint8_t *out) +{ + assert(message->base.descriptor == &analyze_input__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t analyze_input__pack_to_buffer + (const AnalyzeInput *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &analyze_input__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +AnalyzeInput * + analyze_input__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (AnalyzeInput *) + protobuf_c_message_unpack (&analyze_input__descriptor, + allocator, len, data); +} +void analyze_input__free_unpacked + (AnalyzeInput *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &analyze_input__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor analyze_input__field_descriptors[1] = +{ + { + "FilePath", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(AnalyzeInput, filepath), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned analyze_input__field_indices_by_name[] = { + 0, /* field[0] = FilePath */ +}; +static const ProtobufCIntRange analyze_input__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor analyze_input__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "AnalyzeInput", + "AnalyzeInput", + "AnalyzeInput", + "", + sizeof(AnalyzeInput), + 1, + analyze_input__field_descriptors, + analyze_input__field_indices_by_name, + 1, analyze_input__number_ranges, + (ProtobufCMessageInit) analyze_input__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Embroidery/AnalyzeInput.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Embroidery/AnalyzeInput.pb-c.h new file mode 100644 index 000000000..15d124132 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Embroidery/AnalyzeInput.pb-c.h @@ -0,0 +1,71 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: AnalyzeInput.proto */ + +#ifndef PROTOBUF_C_AnalyzeInput_2eproto__INCLUDED +#define PROTOBUF_C_AnalyzeInput_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _AnalyzeInput AnalyzeInput; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _AnalyzeInput +{ + ProtobufCMessage base; + char *filepath; +}; +#define ANALYZE_INPUT__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&analyze_input__descriptor) \ + , NULL } + + +/* AnalyzeInput methods */ +void analyze_input__init + (AnalyzeInput *message); +size_t analyze_input__get_packed_size + (const AnalyzeInput *message); +size_t analyze_input__pack + (const AnalyzeInput *message, + uint8_t *out); +size_t analyze_input__pack_to_buffer + (const AnalyzeInput *message, + ProtobufCBuffer *buffer); +AnalyzeInput * + analyze_input__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void analyze_input__free_unpacked + (AnalyzeInput *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*AnalyzeInput_Closure) + (const AnalyzeInput *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor analyze_input__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_AnalyzeInput_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Embroidery/AnalyzeOutput.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Embroidery/AnalyzeOutput.pb-c.c new file mode 100644 index 000000000..9739abc10 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Embroidery/AnalyzeOutput.pb-c.c @@ -0,0 +1,92 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: AnalyzeOutput.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "AnalyzeOutput.pb-c.h" +void analyze_output__init + (AnalyzeOutput *message) +{ + static const AnalyzeOutput init_value = ANALYZE_OUTPUT__INIT; + *message = init_value; +} +size_t analyze_output__get_packed_size + (const AnalyzeOutput *message) +{ + assert(message->base.descriptor == &analyze_output__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t analyze_output__pack + (const AnalyzeOutput *message, + uint8_t *out) +{ + assert(message->base.descriptor == &analyze_output__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t analyze_output__pack_to_buffer + (const AnalyzeOutput *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &analyze_output__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +AnalyzeOutput * + analyze_output__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (AnalyzeOutput *) + protobuf_c_message_unpack (&analyze_output__descriptor, + allocator, len, data); +} +void analyze_output__free_unpacked + (AnalyzeOutput *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &analyze_output__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor analyze_output__field_descriptors[1] = +{ + { + "EmbroideryFile", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_MESSAGE, + 0, /* quantifier_offset */ + offsetof(AnalyzeOutput, embroideryfile), + &embroidery_file__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned analyze_output__field_indices_by_name[] = { + 0, /* field[0] = EmbroideryFile */ +}; +static const ProtobufCIntRange analyze_output__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor analyze_output__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "AnalyzeOutput", + "AnalyzeOutput", + "AnalyzeOutput", + "", + sizeof(AnalyzeOutput), + 1, + analyze_output__field_descriptors, + analyze_output__field_indices_by_name, + 1, analyze_output__number_ranges, + (ProtobufCMessageInit) analyze_output__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Embroidery/AnalyzeOutput.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Embroidery/AnalyzeOutput.pb-c.h new file mode 100644 index 000000000..6e0812aa2 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Embroidery/AnalyzeOutput.pb-c.h @@ -0,0 +1,72 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: AnalyzeOutput.proto */ + +#ifndef PROTOBUF_C_AnalyzeOutput_2eproto__INCLUDED +#define PROTOBUF_C_AnalyzeOutput_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + +#include "EmbroideryFile.pb-c.h" + +typedef struct _AnalyzeOutput AnalyzeOutput; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _AnalyzeOutput +{ + ProtobufCMessage base; + EmbroideryFile *embroideryfile; +}; +#define ANALYZE_OUTPUT__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&analyze_output__descriptor) \ + , NULL } + + +/* AnalyzeOutput methods */ +void analyze_output__init + (AnalyzeOutput *message); +size_t analyze_output__get_packed_size + (const AnalyzeOutput *message); +size_t analyze_output__pack + (const AnalyzeOutput *message, + uint8_t *out); +size_t analyze_output__pack_to_buffer + (const AnalyzeOutput *message, + ProtobufCBuffer *buffer); +AnalyzeOutput * + analyze_output__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void analyze_output__free_unpacked + (AnalyzeOutput *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*AnalyzeOutput_Closure) + (const AnalyzeOutput *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor analyze_output__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_AnalyzeOutput_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Embroidery/EmbroideryFile.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Embroidery/EmbroideryFile.pb-c.c new file mode 100644 index 000000000..3d07907e9 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Embroidery/EmbroideryFile.pb-c.c @@ -0,0 +1,170 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: EmbroideryFile.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "EmbroideryFile.pb-c.h" +void embroidery_file__init + (EmbroideryFile *message) +{ + static const EmbroideryFile init_value = EMBROIDERY_FILE__INIT; + *message = init_value; +} +size_t embroidery_file__get_packed_size + (const EmbroideryFile *message) +{ + assert(message->base.descriptor == &embroidery_file__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t embroidery_file__pack + (const EmbroideryFile *message, + uint8_t *out) +{ + assert(message->base.descriptor == &embroidery_file__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t embroidery_file__pack_to_buffer + (const EmbroideryFile *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &embroidery_file__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +EmbroideryFile * + embroidery_file__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (EmbroideryFile *) + protobuf_c_message_unpack (&embroidery_file__descriptor, + allocator, len, data); +} +void embroidery_file__free_unpacked + (EmbroideryFile *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &embroidery_file__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor embroidery_file__field_descriptors[7] = +{ + { + "DesignName", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(EmbroideryFile, designname), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "FileName", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(EmbroideryFile, filename), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "StitchCount", + 3, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(EmbroideryFile, has_stitchcount), + offsetof(EmbroideryFile, stitchcount), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "ColorCount", + 4, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(EmbroideryFile, has_colorcount), + offsetof(EmbroideryFile, colorcount), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Extents", + 5, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_MESSAGE, + 0, /* quantifier_offset */ + offsetof(EmbroideryFile, extents), + &extents__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Colors", + 6, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(EmbroideryFile, n_colors), + offsetof(EmbroideryFile, colors), + &stitch_color__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Stitches", + 7, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(EmbroideryFile, n_stitches), + offsetof(EmbroideryFile, stitches), + &stitch__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned embroidery_file__field_indices_by_name[] = { + 3, /* field[3] = ColorCount */ + 5, /* field[5] = Colors */ + 0, /* field[0] = DesignName */ + 4, /* field[4] = Extents */ + 1, /* field[1] = FileName */ + 2, /* field[2] = StitchCount */ + 6, /* field[6] = Stitches */ +}; +static const ProtobufCIntRange embroidery_file__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 7 } +}; +const ProtobufCMessageDescriptor embroidery_file__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "EmbroideryFile", + "EmbroideryFile", + "EmbroideryFile", + "", + sizeof(EmbroideryFile), + 7, + embroidery_file__field_descriptors, + embroidery_file__field_indices_by_name, + 1, embroidery_file__number_ranges, + (ProtobufCMessageInit) embroidery_file__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Embroidery/EmbroideryFile.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Embroidery/EmbroideryFile.pb-c.h new file mode 100644 index 000000000..2ffee6518 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Embroidery/EmbroideryFile.pb-c.h @@ -0,0 +1,84 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: EmbroideryFile.proto */ + +#ifndef PROTOBUF_C_EmbroideryFile_2eproto__INCLUDED +#define PROTOBUF_C_EmbroideryFile_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + +#include "Extents.pb-c.h" +#include "Stitch.pb-c.h" +#include "StitchColor.pb-c.h" + +typedef struct _EmbroideryFile EmbroideryFile; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _EmbroideryFile +{ + ProtobufCMessage base; + char *designname; + char *filename; + protobuf_c_boolean has_stitchcount; + int32_t stitchcount; + protobuf_c_boolean has_colorcount; + int32_t colorcount; + Extents *extents; + size_t n_colors; + StitchColor **colors; + size_t n_stitches; + Stitch **stitches; +}; +#define EMBROIDERY_FILE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&embroidery_file__descriptor) \ + , NULL, NULL, 0, 0, 0, 0, NULL, 0,NULL, 0,NULL } + + +/* EmbroideryFile methods */ +void embroidery_file__init + (EmbroideryFile *message); +size_t embroidery_file__get_packed_size + (const EmbroideryFile *message); +size_t embroidery_file__pack + (const EmbroideryFile *message, + uint8_t *out); +size_t embroidery_file__pack_to_buffer + (const EmbroideryFile *message, + ProtobufCBuffer *buffer); +EmbroideryFile * + embroidery_file__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void embroidery_file__free_unpacked + (EmbroideryFile *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*EmbroideryFile_Closure) + (const EmbroideryFile *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor embroidery_file__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_EmbroideryFile_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Embroidery/Extents.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Embroidery/Extents.pb-c.c new file mode 100644 index 000000000..69cba25cf --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Embroidery/Extents.pb-c.c @@ -0,0 +1,131 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: Extents.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "Extents.pb-c.h" +void extents__init + (Extents *message) +{ + static const Extents init_value = EXTENTS__INIT; + *message = init_value; +} +size_t extents__get_packed_size + (const Extents *message) +{ + assert(message->base.descriptor == &extents__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t extents__pack + (const Extents *message, + uint8_t *out) +{ + assert(message->base.descriptor == &extents__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t extents__pack_to_buffer + (const Extents *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &extents__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +Extents * + extents__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (Extents *) + protobuf_c_message_unpack (&extents__descriptor, + allocator, len, data); +} +void extents__free_unpacked + (Extents *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &extents__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor extents__field_descriptors[4] = +{ + { + "X1", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(Extents, has_x1), + offsetof(Extents, x1), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Y1", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(Extents, has_y1), + offsetof(Extents, y1), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "X2", + 3, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(Extents, has_x2), + offsetof(Extents, x2), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Y2", + 4, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(Extents, has_y2), + offsetof(Extents, y2), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned extents__field_indices_by_name[] = { + 0, /* field[0] = X1 */ + 2, /* field[2] = X2 */ + 1, /* field[1] = Y1 */ + 3, /* field[3] = Y2 */ +}; +static const ProtobufCIntRange extents__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 4 } +}; +const ProtobufCMessageDescriptor extents__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Extents", + "Extents", + "Extents", + "", + sizeof(Extents), + 4, + extents__field_descriptors, + extents__field_indices_by_name, + 1, extents__number_ranges, + (ProtobufCMessageInit) extents__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Embroidery/Extents.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Embroidery/Extents.pb-c.h new file mode 100644 index 000000000..a7d867bab --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Embroidery/Extents.pb-c.h @@ -0,0 +1,78 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: Extents.proto */ + +#ifndef PROTOBUF_C_Extents_2eproto__INCLUDED +#define PROTOBUF_C_Extents_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _Extents Extents; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _Extents +{ + ProtobufCMessage base; + protobuf_c_boolean has_x1; + int32_t x1; + protobuf_c_boolean has_y1; + int32_t y1; + protobuf_c_boolean has_x2; + int32_t x2; + protobuf_c_boolean has_y2; + int32_t y2; +}; +#define EXTENTS__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&extents__descriptor) \ + , 0, 0, 0, 0, 0, 0, 0, 0 } + + +/* Extents methods */ +void extents__init + (Extents *message); +size_t extents__get_packed_size + (const Extents *message); +size_t extents__pack + (const Extents *message, + uint8_t *out); +size_t extents__pack_to_buffer + (const Extents *message, + ProtobufCBuffer *buffer); +Extents * + extents__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void extents__free_unpacked + (Extents *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*Extents_Closure) + (const Extents *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor extents__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_Extents_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Embroidery/Stitch.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Embroidery/Stitch.pb-c.c new file mode 100644 index 000000000..3d0e895bf --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Embroidery/Stitch.pb-c.c @@ -0,0 +1,196 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: Stitch.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "Stitch.pb-c.h" +void stitch__init + (Stitch *message) +{ + static const Stitch init_value = STITCH__INIT; + *message = init_value; +} +size_t stitch__get_packed_size + (const Stitch *message) +{ + assert(message->base.descriptor == &stitch__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t stitch__pack + (const Stitch *message, + uint8_t *out) +{ + assert(message->base.descriptor == &stitch__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t stitch__pack_to_buffer + (const Stitch *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &stitch__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +Stitch * + stitch__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (Stitch *) + protobuf_c_message_unpack (&stitch__descriptor, + allocator, len, data); +} +void stitch__free_unpacked + (Stitch *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &stitch__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor stitch__field_descriptors[9] = +{ + { + "Flag", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_ENUM, + offsetof(Stitch, has_flag), + offsetof(Stitch, flag), + &stitch_flag__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "XX", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(Stitch, has_xx), + offsetof(Stitch, xx), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "YY", + 3, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(Stitch, has_yy), + offsetof(Stitch, yy), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "DX", + 4, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(Stitch, has_dx), + offsetof(Stitch, dx), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "DY", + 5, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(Stitch, has_dy), + offsetof(Stitch, dy), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Length", + 6, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(Stitch, has_length), + offsetof(Stitch, length), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Angle", + 7, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(Stitch, has_angle), + offsetof(Stitch, angle), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "DAngle", + 8, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(Stitch, has_dangle), + offsetof(Stitch, dangle), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "ColorIndex", + 9, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(Stitch, has_colorindex), + offsetof(Stitch, colorindex), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned stitch__field_indices_by_name[] = { + 6, /* field[6] = Angle */ + 8, /* field[8] = ColorIndex */ + 7, /* field[7] = DAngle */ + 3, /* field[3] = DX */ + 4, /* field[4] = DY */ + 0, /* field[0] = Flag */ + 5, /* field[5] = Length */ + 1, /* field[1] = XX */ + 2, /* field[2] = YY */ +}; +static const ProtobufCIntRange stitch__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 9 } +}; +const ProtobufCMessageDescriptor stitch__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "Stitch", + "Stitch", + "Stitch", + "", + sizeof(Stitch), + 9, + stitch__field_descriptors, + stitch__field_indices_by_name, + 1, stitch__number_ranges, + (ProtobufCMessageInit) stitch__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Embroidery/Stitch.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Embroidery/Stitch.pb-c.h new file mode 100644 index 000000000..157dbce02 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Embroidery/Stitch.pb-c.h @@ -0,0 +1,89 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: Stitch.proto */ + +#ifndef PROTOBUF_C_Stitch_2eproto__INCLUDED +#define PROTOBUF_C_Stitch_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + +#include "StitchFlag.pb-c.h" + +typedef struct _Stitch Stitch; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _Stitch +{ + ProtobufCMessage base; + protobuf_c_boolean has_flag; + StitchFlag flag; + protobuf_c_boolean has_xx; + double xx; + protobuf_c_boolean has_yy; + double yy; + protobuf_c_boolean has_dx; + double dx; + protobuf_c_boolean has_dy; + double dy; + protobuf_c_boolean has_length; + double length; + protobuf_c_boolean has_angle; + double angle; + protobuf_c_boolean has_dangle; + double dangle; + protobuf_c_boolean has_colorindex; + int32_t colorindex; +}; +#define STITCH__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&stitch__descriptor) \ + , 0, STITCH_FLAG__NORMAL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } + + +/* Stitch methods */ +void stitch__init + (Stitch *message); +size_t stitch__get_packed_size + (const Stitch *message); +size_t stitch__pack + (const Stitch *message, + uint8_t *out); +size_t stitch__pack_to_buffer + (const Stitch *message, + ProtobufCBuffer *buffer); +Stitch * + stitch__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void stitch__free_unpacked + (Stitch *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*Stitch_Closure) + (const Stitch *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor stitch__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_Stitch_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Embroidery/StitchColor.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Embroidery/StitchColor.pb-c.c new file mode 100644 index 000000000..a33e76d5a --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Embroidery/StitchColor.pb-c.c @@ -0,0 +1,118 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StitchColor.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StitchColor.pb-c.h" +void stitch_color__init + (StitchColor *message) +{ + static const StitchColor init_value = STITCH_COLOR__INIT; + *message = init_value; +} +size_t stitch_color__get_packed_size + (const StitchColor *message) +{ + assert(message->base.descriptor == &stitch_color__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t stitch_color__pack + (const StitchColor *message, + uint8_t *out) +{ + assert(message->base.descriptor == &stitch_color__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t stitch_color__pack_to_buffer + (const StitchColor *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &stitch_color__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +StitchColor * + stitch_color__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (StitchColor *) + protobuf_c_message_unpack (&stitch_color__descriptor, + allocator, len, data); +} +void stitch_color__free_unpacked + (StitchColor *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &stitch_color__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor stitch_color__field_descriptors[3] = +{ + { + "Red", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(StitchColor, has_red), + offsetof(StitchColor, red), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Green", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(StitchColor, has_green), + offsetof(StitchColor, green), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Blue", + 3, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(StitchColor, has_blue), + offsetof(StitchColor, blue), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned stitch_color__field_indices_by_name[] = { + 2, /* field[2] = Blue */ + 1, /* field[1] = Green */ + 0, /* field[0] = Red */ +}; +static const ProtobufCIntRange stitch_color__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 3 } +}; +const ProtobufCMessageDescriptor stitch_color__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "StitchColor", + "StitchColor", + "StitchColor", + "", + sizeof(StitchColor), + 3, + stitch_color__field_descriptors, + stitch_color__field_indices_by_name, + 1, stitch_color__number_ranges, + (ProtobufCMessageInit) stitch_color__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Embroidery/StitchColor.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Embroidery/StitchColor.pb-c.h new file mode 100644 index 000000000..38ad23dca --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Embroidery/StitchColor.pb-c.h @@ -0,0 +1,76 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StitchColor.proto */ + +#ifndef PROTOBUF_C_StitchColor_2eproto__INCLUDED +#define PROTOBUF_C_StitchColor_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _StitchColor StitchColor; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _StitchColor +{ + ProtobufCMessage base; + protobuf_c_boolean has_red; + int32_t red; + protobuf_c_boolean has_green; + int32_t green; + protobuf_c_boolean has_blue; + int32_t blue; +}; +#define STITCH_COLOR__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&stitch_color__descriptor) \ + , 0, 0, 0, 0, 0, 0 } + + +/* StitchColor methods */ +void stitch_color__init + (StitchColor *message); +size_t stitch_color__get_packed_size + (const StitchColor *message); +size_t stitch_color__pack + (const StitchColor *message, + uint8_t *out); +size_t stitch_color__pack_to_buffer + (const StitchColor *message, + ProtobufCBuffer *buffer); +StitchColor * + stitch_color__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void stitch_color__free_unpacked + (StitchColor *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*StitchColor_Closure) + (const StitchColor *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor stitch_color__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StitchColor_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Embroidery/StitchFlag.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Embroidery/StitchFlag.pb-c.c new file mode 100644 index 000000000..1936a5436 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Embroidery/StitchFlag.pb-c.c @@ -0,0 +1,45 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StitchFlag.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StitchFlag.pb-c.h" +static const ProtobufCEnumValue stitch_flag__enum_values_by_number[6] = +{ + { "NORMAL", "STITCH_FLAG__NORMAL", 0 }, + { "JUMP", "STITCH_FLAG__JUMP", 1 }, + { "TRIM", "STITCH_FLAG__TRIM", 2 }, + { "STOP", "STITCH_FLAG__STOP", 4 }, + { "SEQUIN", "STITCH_FLAG__SEQUIN", 8 }, + { "END", "STITCH_FLAG__END", 16 }, +}; +static const ProtobufCIntRange stitch_flag__value_ranges[] = { +{0, 0},{4, 3},{8, 4},{16, 5},{0, 6} +}; +static const ProtobufCEnumValueIndex stitch_flag__enum_values_by_name[6] = +{ + { "END", 5 }, + { "JUMP", 1 }, + { "NORMAL", 0 }, + { "SEQUIN", 4 }, + { "STOP", 3 }, + { "TRIM", 2 }, +}; +const ProtobufCEnumDescriptor stitch_flag__descriptor = +{ + PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC, + "StitchFlag", + "StitchFlag", + "StitchFlag", + "", + 6, + stitch_flag__enum_values_by_number, + 6, + stitch_flag__enum_values_by_name, + 4, + stitch_flag__value_ranges, + NULL,NULL,NULL,NULL /* reserved[1234] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Embroidery/StitchFlag.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Embroidery/StitchFlag.pb-c.h new file mode 100644 index 000000000..81c090e35 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Embroidery/StitchFlag.pb-c.h @@ -0,0 +1,47 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StitchFlag.proto */ + +#ifndef PROTOBUF_C_StitchFlag_2eproto__INCLUDED +#define PROTOBUF_C_StitchFlag_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + + + +/* --- enums --- */ + +typedef enum _StitchFlag { + STITCH_FLAG__NORMAL = 0, + STITCH_FLAG__JUMP = 1, + STITCH_FLAG__TRIM = 2, + STITCH_FLAG__STOP = 4, + STITCH_FLAG__SEQUIN = 8, + STITCH_FLAG__END = 16 + PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(STITCH_FLAG) +} StitchFlag; + +/* --- messages --- */ + +/* --- per-message closures --- */ + + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCEnumDescriptor stitch_flag__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StitchFlag_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwareConfiguration.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwareConfiguration.pb-c.c new file mode 100644 index 000000000..6ba4d7fc9 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwareConfiguration.pb-c.c @@ -0,0 +1,144 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: HardwareConfiguration.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "HardwareConfiguration.pb-c.h" +void hardware_configuration__init + (HardwareConfiguration *message) +{ + static const HardwareConfiguration init_value = HARDWARE_CONFIGURATION__INIT; + *message = init_value; +} +size_t hardware_configuration__get_packed_size + (const HardwareConfiguration *message) +{ + assert(message->base.descriptor == &hardware_configuration__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t hardware_configuration__pack + (const HardwareConfiguration *message, + uint8_t *out) +{ + assert(message->base.descriptor == &hardware_configuration__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t hardware_configuration__pack_to_buffer + (const HardwareConfiguration *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &hardware_configuration__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +HardwareConfiguration * + hardware_configuration__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (HardwareConfiguration *) + protobuf_c_message_unpack (&hardware_configuration__descriptor, + allocator, len, data); +} +void hardware_configuration__free_unpacked + (HardwareConfiguration *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &hardware_configuration__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor hardware_configuration__field_descriptors[5] = +{ + { + "Dancers", + 1, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(HardwareConfiguration, n_dancers), + offsetof(HardwareConfiguration, dancers), + &hardware_dancer__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Dispensers", + 2, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(HardwareConfiguration, n_dispensers), + offsetof(HardwareConfiguration, dispensers), + &hardware_dispenser__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Motors", + 3, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(HardwareConfiguration, n_motors), + offsetof(HardwareConfiguration, motors), + &hardware_motor__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "PidControls", + 4, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(HardwareConfiguration, n_pidcontrols), + offsetof(HardwareConfiguration, pidcontrols), + &hardware_pid_control__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Winders", + 5, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(HardwareConfiguration, n_winders), + offsetof(HardwareConfiguration, winders), + &hardware_winder__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned hardware_configuration__field_indices_by_name[] = { + 0, /* field[0] = Dancers */ + 1, /* field[1] = Dispensers */ + 2, /* field[2] = Motors */ + 3, /* field[3] = PidControls */ + 4, /* field[4] = Winders */ +}; +static const ProtobufCIntRange hardware_configuration__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 5 } +}; +const ProtobufCMessageDescriptor hardware_configuration__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "HardwareConfiguration", + "HardwareConfiguration", + "HardwareConfiguration", + "", + sizeof(HardwareConfiguration), + 5, + hardware_configuration__field_descriptors, + hardware_configuration__field_indices_by_name, + 1, hardware_configuration__number_ranges, + (ProtobufCMessageInit) hardware_configuration__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwareConfiguration.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwareConfiguration.pb-c.h new file mode 100644 index 000000000..d9818c891 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwareConfiguration.pb-c.h @@ -0,0 +1,85 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: HardwareConfiguration.proto */ + +#ifndef PROTOBUF_C_HardwareConfiguration_2eproto__INCLUDED +#define PROTOBUF_C_HardwareConfiguration_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + +#include "HardwareDancer.pb-c.h" +#include "HardwareDispenser.pb-c.h" +#include "HardwareMotor.pb-c.h" +#include "HardwarePidControl.pb-c.h" +#include "HardwareWinder.pb-c.h" + +typedef struct _HardwareConfiguration HardwareConfiguration; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _HardwareConfiguration +{ + ProtobufCMessage base; + size_t n_dancers; + HardwareDancer **dancers; + size_t n_dispensers; + HardwareDispenser **dispensers; + size_t n_motors; + HardwareMotor **motors; + size_t n_pidcontrols; + HardwarePidControl **pidcontrols; + size_t n_winders; + HardwareWinder **winders; +}; +#define HARDWARE_CONFIGURATION__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&hardware_configuration__descriptor) \ + , 0,NULL, 0,NULL, 0,NULL, 0,NULL, 0,NULL } + + +/* HardwareConfiguration methods */ +void hardware_configuration__init + (HardwareConfiguration *message); +size_t hardware_configuration__get_packed_size + (const HardwareConfiguration *message); +size_t hardware_configuration__pack + (const HardwareConfiguration *message, + uint8_t *out); +size_t hardware_configuration__pack_to_buffer + (const HardwareConfiguration *message, + ProtobufCBuffer *buffer); +HardwareConfiguration * + hardware_configuration__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void hardware_configuration__free_unpacked + (HardwareConfiguration *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*HardwareConfiguration_Closure) + (const HardwareConfiguration *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor hardware_configuration__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_HardwareConfiguration_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwareDancer.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwareDancer.pb-c.c new file mode 100644 index 000000000..b838e1382 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwareDancer.pb-c.c @@ -0,0 +1,144 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: HardwareDancer.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "HardwareDancer.pb-c.h" +void hardware_dancer__init + (HardwareDancer *message) +{ + static const HardwareDancer init_value = HARDWARE_DANCER__INIT; + *message = init_value; +} +size_t hardware_dancer__get_packed_size + (const HardwareDancer *message) +{ + assert(message->base.descriptor == &hardware_dancer__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t hardware_dancer__pack + (const HardwareDancer *message, + uint8_t *out) +{ + assert(message->base.descriptor == &hardware_dancer__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t hardware_dancer__pack_to_buffer + (const HardwareDancer *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &hardware_dancer__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +HardwareDancer * + hardware_dancer__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (HardwareDancer *) + protobuf_c_message_unpack (&hardware_dancer__descriptor, + allocator, len, data); +} +void hardware_dancer__free_unpacked + (HardwareDancer *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &hardware_dancer__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor hardware_dancer__field_descriptors[5] = +{ + { + "HardwareDancerType", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_ENUM, + offsetof(HardwareDancer, has_hardwaredancertype), + offsetof(HardwareDancer, hardwaredancertype), + &hardware_dancer_type__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Gradual", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(HardwareDancer, has_gradual), + offsetof(HardwareDancer, gradual), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "K", + 3, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(HardwareDancer, has_k), + offsetof(HardwareDancer, k), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "X", + 4, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(HardwareDancer, has_x), + offsetof(HardwareDancer, x), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "PulsePerMmSpring", + 5, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(HardwareDancer, has_pulsepermmspring), + offsetof(HardwareDancer, pulsepermmspring), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned hardware_dancer__field_indices_by_name[] = { + 1, /* field[1] = Gradual */ + 0, /* field[0] = HardwareDancerType */ + 2, /* field[2] = K */ + 4, /* field[4] = PulsePerMmSpring */ + 3, /* field[3] = X */ +}; +static const ProtobufCIntRange hardware_dancer__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 5 } +}; +const ProtobufCMessageDescriptor hardware_dancer__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "HardwareDancer", + "HardwareDancer", + "HardwareDancer", + "", + sizeof(HardwareDancer), + 5, + hardware_dancer__field_descriptors, + hardware_dancer__field_indices_by_name, + 1, hardware_dancer__number_ranges, + (ProtobufCMessageInit) hardware_dancer__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwareDancer.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwareDancer.pb-c.h new file mode 100644 index 000000000..8e6e74cde --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwareDancer.pb-c.h @@ -0,0 +1,81 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: HardwareDancer.proto */ + +#ifndef PROTOBUF_C_HardwareDancer_2eproto__INCLUDED +#define PROTOBUF_C_HardwareDancer_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + +#include "HardwareDancerType.pb-c.h" + +typedef struct _HardwareDancer HardwareDancer; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _HardwareDancer +{ + ProtobufCMessage base; + protobuf_c_boolean has_hardwaredancertype; + HardwareDancerType hardwaredancertype; + protobuf_c_boolean has_gradual; + protobuf_c_boolean gradual; + protobuf_c_boolean has_k; + double k; + protobuf_c_boolean has_x; + double x; + protobuf_c_boolean has_pulsepermmspring; + int32_t pulsepermmspring; +}; +#define HARDWARE_DANCER__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&hardware_dancer__descriptor) \ + , 0, HARDWARE_DANCER_TYPE__LeftDancer, 0, 0, 0, 0, 0, 0, 0, 0 } + + +/* HardwareDancer methods */ +void hardware_dancer__init + (HardwareDancer *message); +size_t hardware_dancer__get_packed_size + (const HardwareDancer *message); +size_t hardware_dancer__pack + (const HardwareDancer *message, + uint8_t *out); +size_t hardware_dancer__pack_to_buffer + (const HardwareDancer *message, + ProtobufCBuffer *buffer); +HardwareDancer * + hardware_dancer__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void hardware_dancer__free_unpacked + (HardwareDancer *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*HardwareDancer_Closure) + (const HardwareDancer *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor hardware_dancer__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_HardwareDancer_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwareDancerType.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwareDancerType.pb-c.c new file mode 100644 index 000000000..d1ad051e9 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwareDancerType.pb-c.c @@ -0,0 +1,39 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: HardwareDancerType.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "HardwareDancerType.pb-c.h" +static const ProtobufCEnumValue hardware_dancer_type__enum_values_by_number[3] = +{ + { "LeftDancer", "HARDWARE_DANCER_TYPE__LeftDancer", 0 }, + { "MiddleDancer", "HARDWARE_DANCER_TYPE__MiddleDancer", 1 }, + { "RightDancer", "HARDWARE_DANCER_TYPE__RightDancer", 2 }, +}; +static const ProtobufCIntRange hardware_dancer_type__value_ranges[] = { +{0, 0},{0, 3} +}; +static const ProtobufCEnumValueIndex hardware_dancer_type__enum_values_by_name[3] = +{ + { "LeftDancer", 0 }, + { "MiddleDancer", 1 }, + { "RightDancer", 2 }, +}; +const ProtobufCEnumDescriptor hardware_dancer_type__descriptor = +{ + PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC, + "HardwareDancerType", + "HardwareDancerType", + "HardwareDancerType", + "", + 3, + hardware_dancer_type__enum_values_by_number, + 3, + hardware_dancer_type__enum_values_by_name, + 1, + hardware_dancer_type__value_ranges, + NULL,NULL,NULL,NULL /* reserved[1234] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwareDancerType.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwareDancerType.pb-c.h new file mode 100644 index 000000000..fed2b0108 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwareDancerType.pb-c.h @@ -0,0 +1,44 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: HardwareDancerType.proto */ + +#ifndef PROTOBUF_C_HardwareDancerType_2eproto__INCLUDED +#define PROTOBUF_C_HardwareDancerType_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + + + +/* --- enums --- */ + +typedef enum _HardwareDancerType { + HARDWARE_DANCER_TYPE__LeftDancer = 0, + HARDWARE_DANCER_TYPE__MiddleDancer = 1, + HARDWARE_DANCER_TYPE__RightDancer = 2 + PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(HARDWARE_DANCER_TYPE) +} HardwareDancerType; + +/* --- messages --- */ + +/* --- per-message closures --- */ + + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCEnumDescriptor hardware_dancer_type__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_HardwareDancerType_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwareDispenser.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwareDispenser.pb-c.c new file mode 100644 index 000000000..1691150ab --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwareDispenser.pb-c.c @@ -0,0 +1,274 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: HardwareDispenser.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "HardwareDispenser.pb-c.h" +void hardware_dispenser__init + (HardwareDispenser *message) +{ + static const HardwareDispenser init_value = HARDWARE_DISPENSER__INIT; + *message = init_value; +} +size_t hardware_dispenser__get_packed_size + (const HardwareDispenser *message) +{ + assert(message->base.descriptor == &hardware_dispenser__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t hardware_dispenser__pack + (const HardwareDispenser *message, + uint8_t *out) +{ + assert(message->base.descriptor == &hardware_dispenser__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t hardware_dispenser__pack_to_buffer + (const HardwareDispenser *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &hardware_dispenser__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +HardwareDispenser * + hardware_dispenser__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (HardwareDispenser *) + protobuf_c_message_unpack (&hardware_dispenser__descriptor, + allocator, len, data); +} +void hardware_dispenser__free_unpacked + (HardwareDispenser *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &hardware_dispenser__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor hardware_dispenser__field_descriptors[15] = +{ + { + "HardwareDispenserType", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_ENUM, + offsetof(HardwareDispenser, has_hardwaredispensertype), + offsetof(HardwareDispenser, hardwaredispensertype), + &hardware_dispenser_type__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "NlPerPulse", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(HardwareDispenser, has_nlperpulse), + offsetof(HardwareDispenser, nlperpulse), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Capacity", + 3, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(HardwareDispenser, has_capacity), + offsetof(HardwareDispenser, capacity), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "MinFrequency", + 4, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(HardwareDispenser, has_minfrequency), + offsetof(HardwareDispenser, minfrequency), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "MaxFrequency", + 5, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(HardwareDispenser, has_maxfrequency), + offsetof(HardwareDispenser, maxfrequency), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "MinMicroStep", + 6, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(HardwareDispenser, has_minmicrostep), + offsetof(HardwareDispenser, minmicrostep), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "MaxMicroStep", + 7, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(HardwareDispenser, has_maxmicrostep), + offsetof(HardwareDispenser, maxmicrostep), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "CorrectionGain", + 8, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(HardwareDispenser, has_correctiongain), + offsetof(HardwareDispenser, correctiongain), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "RatioToDryerSpeed", + 9, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(HardwareDispenser, has_ratiotodryerspeed), + offsetof(HardwareDispenser, ratiotodryerspeed), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Kp", + 10, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(HardwareDispenser, has_kp), + offsetof(HardwareDispenser, kp), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Ki", + 11, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(HardwareDispenser, has_ki), + offsetof(HardwareDispenser, ki), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Kd", + 12, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(HardwareDispenser, has_kd), + offsetof(HardwareDispenser, kd), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "ChangeSlope", + 13, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(HardwareDispenser, has_changeslope), + offsetof(HardwareDispenser, changeslope), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "HighLengthMicroSecond", + 14, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(HardwareDispenser, has_highlengthmicrosecond), + offsetof(HardwareDispenser, highlengthmicrosecond), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "ControlTiming", + 15, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(HardwareDispenser, has_controltiming), + offsetof(HardwareDispenser, controltiming), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned hardware_dispenser__field_indices_by_name[] = { + 2, /* field[2] = Capacity */ + 12, /* field[12] = ChangeSlope */ + 14, /* field[14] = ControlTiming */ + 7, /* field[7] = CorrectionGain */ + 0, /* field[0] = HardwareDispenserType */ + 13, /* field[13] = HighLengthMicroSecond */ + 11, /* field[11] = Kd */ + 10, /* field[10] = Ki */ + 9, /* field[9] = Kp */ + 4, /* field[4] = MaxFrequency */ + 6, /* field[6] = MaxMicroStep */ + 3, /* field[3] = MinFrequency */ + 5, /* field[5] = MinMicroStep */ + 1, /* field[1] = NlPerPulse */ + 8, /* field[8] = RatioToDryerSpeed */ +}; +static const ProtobufCIntRange hardware_dispenser__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 15 } +}; +const ProtobufCMessageDescriptor hardware_dispenser__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "HardwareDispenser", + "HardwareDispenser", + "HardwareDispenser", + "", + sizeof(HardwareDispenser), + 15, + hardware_dispenser__field_descriptors, + hardware_dispenser__field_indices_by_name, + 1, hardware_dispenser__number_ranges, + (ProtobufCMessageInit) hardware_dispenser__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwareDispenser.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwareDispenser.pb-c.h new file mode 100644 index 000000000..bde6bad40 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwareDispenser.pb-c.h @@ -0,0 +1,101 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: HardwareDispenser.proto */ + +#ifndef PROTOBUF_C_HardwareDispenser_2eproto__INCLUDED +#define PROTOBUF_C_HardwareDispenser_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + +#include "HardwareDispenserType.pb-c.h" + +typedef struct _HardwareDispenser HardwareDispenser; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _HardwareDispenser +{ + ProtobufCMessage base; + protobuf_c_boolean has_hardwaredispensertype; + HardwareDispenserType hardwaredispensertype; + protobuf_c_boolean has_nlperpulse; + double nlperpulse; + protobuf_c_boolean has_capacity; + double capacity; + protobuf_c_boolean has_minfrequency; + int32_t minfrequency; + protobuf_c_boolean has_maxfrequency; + int32_t maxfrequency; + protobuf_c_boolean has_minmicrostep; + int32_t minmicrostep; + protobuf_c_boolean has_maxmicrostep; + int32_t maxmicrostep; + protobuf_c_boolean has_correctiongain; + double correctiongain; + protobuf_c_boolean has_ratiotodryerspeed; + double ratiotodryerspeed; + protobuf_c_boolean has_kp; + double kp; + protobuf_c_boolean has_ki; + double ki; + protobuf_c_boolean has_kd; + double kd; + protobuf_c_boolean has_changeslope; + double changeslope; + protobuf_c_boolean has_highlengthmicrosecond; + double highlengthmicrosecond; + protobuf_c_boolean has_controltiming; + int32_t controltiming; +}; +#define HARDWARE_DISPENSER__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&hardware_dispenser__descriptor) \ + , 0, HARDWARE_DISPENSER_TYPE__StandardDispenser, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } + + +/* HardwareDispenser methods */ +void hardware_dispenser__init + (HardwareDispenser *message); +size_t hardware_dispenser__get_packed_size + (const HardwareDispenser *message); +size_t hardware_dispenser__pack + (const HardwareDispenser *message, + uint8_t *out); +size_t hardware_dispenser__pack_to_buffer + (const HardwareDispenser *message, + ProtobufCBuffer *buffer); +HardwareDispenser * + hardware_dispenser__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void hardware_dispenser__free_unpacked + (HardwareDispenser *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*HardwareDispenser_Closure) + (const HardwareDispenser *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor hardware_dispenser__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_HardwareDispenser_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwareDispenserType.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwareDispenserType.pb-c.c new file mode 100644 index 000000000..723d41bc3 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwareDispenserType.pb-c.c @@ -0,0 +1,35 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: HardwareDispenserType.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "HardwareDispenserType.pb-c.h" +static const ProtobufCEnumValue hardware_dispenser_type__enum_values_by_number[1] = +{ + { "StandardDispenser", "HARDWARE_DISPENSER_TYPE__StandardDispenser", 0 }, +}; +static const ProtobufCIntRange hardware_dispenser_type__value_ranges[] = { +{0, 0},{0, 1} +}; +static const ProtobufCEnumValueIndex hardware_dispenser_type__enum_values_by_name[1] = +{ + { "StandardDispenser", 0 }, +}; +const ProtobufCEnumDescriptor hardware_dispenser_type__descriptor = +{ + PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC, + "HardwareDispenserType", + "HardwareDispenserType", + "HardwareDispenserType", + "", + 1, + hardware_dispenser_type__enum_values_by_number, + 1, + hardware_dispenser_type__enum_values_by_name, + 1, + hardware_dispenser_type__value_ranges, + NULL,NULL,NULL,NULL /* reserved[1234] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwareDispenserType.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwareDispenserType.pb-c.h new file mode 100644 index 000000000..cd6319f60 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwareDispenserType.pb-c.h @@ -0,0 +1,42 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: HardwareDispenserType.proto */ + +#ifndef PROTOBUF_C_HardwareDispenserType_2eproto__INCLUDED +#define PROTOBUF_C_HardwareDispenserType_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + + + +/* --- enums --- */ + +typedef enum _HardwareDispenserType { + HARDWARE_DISPENSER_TYPE__StandardDispenser = 0 + PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(HARDWARE_DISPENSER_TYPE) +} HardwareDispenserType; + +/* --- messages --- */ + +/* --- per-message closures --- */ + + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCEnumDescriptor hardware_dispenser_type__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_HardwareDispenserType_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwareMotor.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwareMotor.pb-c.c new file mode 100644 index 000000000..68b02ae76 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwareMotor.pb-c.c @@ -0,0 +1,274 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: HardwareMotor.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "HardwareMotor.pb-c.h" +void hardware_motor__init + (HardwareMotor *message) +{ + static const HardwareMotor init_value = HARDWARE_MOTOR__INIT; + *message = init_value; +} +size_t hardware_motor__get_packed_size + (const HardwareMotor *message) +{ + assert(message->base.descriptor == &hardware_motor__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t hardware_motor__pack + (const HardwareMotor *message, + uint8_t *out) +{ + assert(message->base.descriptor == &hardware_motor__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t hardware_motor__pack_to_buffer + (const HardwareMotor *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &hardware_motor__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +HardwareMotor * + hardware_motor__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (HardwareMotor *) + protobuf_c_message_unpack (&hardware_motor__descriptor, + allocator, len, data); +} +void hardware_motor__free_unpacked + (HardwareMotor *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &hardware_motor__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor hardware_motor__field_descriptors[15] = +{ + { + "HardwareMotorType", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_ENUM, + offsetof(HardwareMotor, has_hardwaremotortype), + offsetof(HardwareMotor, hardwaremotortype), + &hardware_motor_type__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "MinFrequency", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(HardwareMotor, has_minfrequency), + offsetof(HardwareMotor, minfrequency), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "MaxFrequency", + 3, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(HardwareMotor, has_maxfrequency), + offsetof(HardwareMotor, maxfrequency), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "MinMicroStep", + 4, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(HardwareMotor, has_minmicrostep), + offsetof(HardwareMotor, minmicrostep), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "MaxMicroStep", + 5, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(HardwareMotor, has_maxmicrostep), + offsetof(HardwareMotor, maxmicrostep), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "LinearRatio", + 6, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(HardwareMotor, has_linearratio), + offsetof(HardwareMotor, linearratio), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "MedianPosition", + 7, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(HardwareMotor, has_medianposition), + offsetof(HardwareMotor, medianposition), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "CorrectionGain", + 8, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(HardwareMotor, has_correctiongain), + offsetof(HardwareMotor, correctiongain), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "RatioToDryerSpeed", + 9, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(HardwareMotor, has_ratiotodryerspeed), + offsetof(HardwareMotor, ratiotodryerspeed), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Kp", + 10, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(HardwareMotor, has_kp), + offsetof(HardwareMotor, kp), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Ki", + 11, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(HardwareMotor, has_ki), + offsetof(HardwareMotor, ki), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Kd", + 12, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(HardwareMotor, has_kd), + offsetof(HardwareMotor, kd), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "ChangeSlope", + 13, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(HardwareMotor, has_changeslope), + offsetof(HardwareMotor, changeslope), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "HighLengthMicroSecond", + 14, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(HardwareMotor, has_highlengthmicrosecond), + offsetof(HardwareMotor, highlengthmicrosecond), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "SpeedMaster", + 15, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(HardwareMotor, has_speedmaster), + offsetof(HardwareMotor, speedmaster), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned hardware_motor__field_indices_by_name[] = { + 12, /* field[12] = ChangeSlope */ + 7, /* field[7] = CorrectionGain */ + 0, /* field[0] = HardwareMotorType */ + 13, /* field[13] = HighLengthMicroSecond */ + 11, /* field[11] = Kd */ + 10, /* field[10] = Ki */ + 9, /* field[9] = Kp */ + 5, /* field[5] = LinearRatio */ + 2, /* field[2] = MaxFrequency */ + 4, /* field[4] = MaxMicroStep */ + 6, /* field[6] = MedianPosition */ + 1, /* field[1] = MinFrequency */ + 3, /* field[3] = MinMicroStep */ + 8, /* field[8] = RatioToDryerSpeed */ + 14, /* field[14] = SpeedMaster */ +}; +static const ProtobufCIntRange hardware_motor__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 15 } +}; +const ProtobufCMessageDescriptor hardware_motor__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "HardwareMotor", + "HardwareMotor", + "HardwareMotor", + "", + sizeof(HardwareMotor), + 15, + hardware_motor__field_descriptors, + hardware_motor__field_indices_by_name, + 1, hardware_motor__number_ranges, + (ProtobufCMessageInit) hardware_motor__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwareMotor.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwareMotor.pb-c.h new file mode 100644 index 000000000..334ae0969 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwareMotor.pb-c.h @@ -0,0 +1,101 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: HardwareMotor.proto */ + +#ifndef PROTOBUF_C_HardwareMotor_2eproto__INCLUDED +#define PROTOBUF_C_HardwareMotor_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + +#include "HardwareMotorType.pb-c.h" + +typedef struct _HardwareMotor HardwareMotor; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _HardwareMotor +{ + ProtobufCMessage base; + protobuf_c_boolean has_hardwaremotortype; + HardwareMotorType hardwaremotortype; + protobuf_c_boolean has_minfrequency; + int32_t minfrequency; + protobuf_c_boolean has_maxfrequency; + int32_t maxfrequency; + protobuf_c_boolean has_minmicrostep; + int32_t minmicrostep; + protobuf_c_boolean has_maxmicrostep; + int32_t maxmicrostep; + protobuf_c_boolean has_linearratio; + double linearratio; + protobuf_c_boolean has_medianposition; + int32_t medianposition; + protobuf_c_boolean has_correctiongain; + double correctiongain; + protobuf_c_boolean has_ratiotodryerspeed; + double ratiotodryerspeed; + protobuf_c_boolean has_kp; + double kp; + protobuf_c_boolean has_ki; + double ki; + protobuf_c_boolean has_kd; + double kd; + protobuf_c_boolean has_changeslope; + double changeslope; + protobuf_c_boolean has_highlengthmicrosecond; + double highlengthmicrosecond; + protobuf_c_boolean has_speedmaster; + protobuf_c_boolean speedmaster; +}; +#define HARDWARE_MOTOR__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&hardware_motor__descriptor) \ + , 0, HARDWARE_MOTOR_TYPE__WinderMotor, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } + + +/* HardwareMotor methods */ +void hardware_motor__init + (HardwareMotor *message); +size_t hardware_motor__get_packed_size + (const HardwareMotor *message); +size_t hardware_motor__pack + (const HardwareMotor *message, + uint8_t *out); +size_t hardware_motor__pack_to_buffer + (const HardwareMotor *message, + ProtobufCBuffer *buffer); +HardwareMotor * + hardware_motor__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void hardware_motor__free_unpacked + (HardwareMotor *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*HardwareMotor_Closure) + (const HardwareMotor *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor hardware_motor__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_HardwareMotor_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwareMotorType.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwareMotorType.pb-c.c new file mode 100644 index 000000000..6aa83f948 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwareMotorType.pb-c.c @@ -0,0 +1,41 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: HardwareMotorType.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "HardwareMotorType.pb-c.h" +static const ProtobufCEnumValue hardware_motor_type__enum_values_by_number[4] = +{ + { "WinderMotor", "HARDWARE_MOTOR_TYPE__WinderMotor", 0 }, + { "FeederMotor", "HARDWARE_MOTOR_TYPE__FeederMotor", 1 }, + { "DryerMotor", "HARDWARE_MOTOR_TYPE__DryerMotor", 2 }, + { "PoolerMotor", "HARDWARE_MOTOR_TYPE__PoolerMotor", 3 }, +}; +static const ProtobufCIntRange hardware_motor_type__value_ranges[] = { +{0, 0},{0, 4} +}; +static const ProtobufCEnumValueIndex hardware_motor_type__enum_values_by_name[4] = +{ + { "DryerMotor", 2 }, + { "FeederMotor", 1 }, + { "PoolerMotor", 3 }, + { "WinderMotor", 0 }, +}; +const ProtobufCEnumDescriptor hardware_motor_type__descriptor = +{ + PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC, + "HardwareMotorType", + "HardwareMotorType", + "HardwareMotorType", + "", + 4, + hardware_motor_type__enum_values_by_number, + 4, + hardware_motor_type__enum_values_by_name, + 1, + hardware_motor_type__value_ranges, + NULL,NULL,NULL,NULL /* reserved[1234] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwareMotorType.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwareMotorType.pb-c.h new file mode 100644 index 000000000..66d5f4e1e --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwareMotorType.pb-c.h @@ -0,0 +1,45 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: HardwareMotorType.proto */ + +#ifndef PROTOBUF_C_HardwareMotorType_2eproto__INCLUDED +#define PROTOBUF_C_HardwareMotorType_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + + + +/* --- enums --- */ + +typedef enum _HardwareMotorType { + HARDWARE_MOTOR_TYPE__WinderMotor = 0, + HARDWARE_MOTOR_TYPE__FeederMotor = 1, + HARDWARE_MOTOR_TYPE__DryerMotor = 2, + HARDWARE_MOTOR_TYPE__PoolerMotor = 3 + PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(HARDWARE_MOTOR_TYPE) +} HardwareMotorType; + +/* --- messages --- */ + +/* --- per-message closures --- */ + + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCEnumDescriptor hardware_motor_type__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_HardwareMotorType_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwarePidControl.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwarePidControl.pb-c.c new file mode 100644 index 000000000..8eb96d16d --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwarePidControl.pb-c.c @@ -0,0 +1,274 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: HardwarePidControl.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "HardwarePidControl.pb-c.h" +void hardware_pid_control__init + (HardwarePidControl *message) +{ + static const HardwarePidControl init_value = HARDWARE_PID_CONTROL__INIT; + *message = init_value; +} +size_t hardware_pid_control__get_packed_size + (const HardwarePidControl *message) +{ + assert(message->base.descriptor == &hardware_pid_control__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t hardware_pid_control__pack + (const HardwarePidControl *message, + uint8_t *out) +{ + assert(message->base.descriptor == &hardware_pid_control__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t hardware_pid_control__pack_to_buffer + (const HardwarePidControl *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &hardware_pid_control__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +HardwarePidControl * + hardware_pid_control__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (HardwarePidControl *) + protobuf_c_message_unpack (&hardware_pid_control__descriptor, + allocator, len, data); +} +void hardware_pid_control__free_unpacked + (HardwarePidControl *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &hardware_pid_control__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor hardware_pid_control__field_descriptors[15] = +{ + { + "HardwarePidControlType", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_ENUM, + offsetof(HardwarePidControl, has_hardwarepidcontroltype), + offsetof(HardwarePidControl, hardwarepidcontroltype), + &hardware_pid_control_type__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "OutputProportionalPowerLimit", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(HardwarePidControl, has_outputproportionalpowerlimit), + offsetof(HardwarePidControl, outputproportionalpowerlimit), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "OutputProportionalBand", + 3, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(HardwarePidControl, has_outputproportionalband), + offsetof(HardwarePidControl, outputproportionalband), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "IntegralTime", + 4, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(HardwarePidControl, has_integraltime), + offsetof(HardwarePidControl, integraltime), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "DerivativeTime", + 5, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(HardwarePidControl, has_derivativetime), + offsetof(HardwarePidControl, derivativetime), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "SensorCorrectionAdjustment", + 6, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(HardwarePidControl, has_sensorcorrectionadjustment), + offsetof(HardwarePidControl, sensorcorrectionadjustment), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "SensorMinValue", + 7, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(HardwarePidControl, has_sensorminvalue), + offsetof(HardwarePidControl, sensorminvalue), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "SensorMaxValue", + 8, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(HardwarePidControl, has_sensormaxvalue), + offsetof(HardwarePidControl, sensormaxvalue), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "SetPointRampRateorSoftStartRamp", + 9, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(HardwarePidControl, has_setpointramprateorsoftstartramp), + offsetof(HardwarePidControl, setpointramprateorsoftstartramp), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "SetPointControlOutputRate", + 10, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(HardwarePidControl, has_setpointcontroloutputrate), + offsetof(HardwarePidControl, setpointcontroloutputrate), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "ControlOutputType", + 11, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(HardwarePidControl, has_controloutputtype), + offsetof(HardwarePidControl, controloutputtype), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "SsrControlOutputType", + 12, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(HardwarePidControl, has_ssrcontroloutputtype), + offsetof(HardwarePidControl, ssrcontroloutputtype), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "OutputOnOffHysteresisValue", + 13, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(HardwarePidControl, has_outputonoffhysteresisvalue), + offsetof(HardwarePidControl, outputonoffhysteresisvalue), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "ProcessVariableSamplingRate", + 14, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(HardwarePidControl, has_processvariablesamplingrate), + offsetof(HardwarePidControl, processvariablesamplingrate), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "PvInputFilterFactorMode", + 15, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(HardwarePidControl, has_pvinputfilterfactormode), + offsetof(HardwarePidControl, pvinputfilterfactormode), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned hardware_pid_control__field_indices_by_name[] = { + 10, /* field[10] = ControlOutputType */ + 4, /* field[4] = DerivativeTime */ + 0, /* field[0] = HardwarePidControlType */ + 3, /* field[3] = IntegralTime */ + 12, /* field[12] = OutputOnOffHysteresisValue */ + 2, /* field[2] = OutputProportionalBand */ + 1, /* field[1] = OutputProportionalPowerLimit */ + 13, /* field[13] = ProcessVariableSamplingRate */ + 14, /* field[14] = PvInputFilterFactorMode */ + 5, /* field[5] = SensorCorrectionAdjustment */ + 7, /* field[7] = SensorMaxValue */ + 6, /* field[6] = SensorMinValue */ + 9, /* field[9] = SetPointControlOutputRate */ + 8, /* field[8] = SetPointRampRateorSoftStartRamp */ + 11, /* field[11] = SsrControlOutputType */ +}; +static const ProtobufCIntRange hardware_pid_control__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 15 } +}; +const ProtobufCMessageDescriptor hardware_pid_control__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "HardwarePidControl", + "HardwarePidControl", + "HardwarePidControl", + "", + sizeof(HardwarePidControl), + 15, + hardware_pid_control__field_descriptors, + hardware_pid_control__field_indices_by_name, + 1, hardware_pid_control__number_ranges, + (ProtobufCMessageInit) hardware_pid_control__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwarePidControl.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwarePidControl.pb-c.h new file mode 100644 index 000000000..2a316b5ab --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwarePidControl.pb-c.h @@ -0,0 +1,101 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: HardwarePidControl.proto */ + +#ifndef PROTOBUF_C_HardwarePidControl_2eproto__INCLUDED +#define PROTOBUF_C_HardwarePidControl_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + +#include "HardwarePidControlType.pb-c.h" + +typedef struct _HardwarePidControl HardwarePidControl; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _HardwarePidControl +{ + ProtobufCMessage base; + protobuf_c_boolean has_hardwarepidcontroltype; + HardwarePidControlType hardwarepidcontroltype; + protobuf_c_boolean has_outputproportionalpowerlimit; + int32_t outputproportionalpowerlimit; + protobuf_c_boolean has_outputproportionalband; + int32_t outputproportionalband; + protobuf_c_boolean has_integraltime; + int32_t integraltime; + protobuf_c_boolean has_derivativetime; + int32_t derivativetime; + protobuf_c_boolean has_sensorcorrectionadjustment; + int32_t sensorcorrectionadjustment; + protobuf_c_boolean has_sensorminvalue; + int32_t sensorminvalue; + protobuf_c_boolean has_sensormaxvalue; + int32_t sensormaxvalue; + protobuf_c_boolean has_setpointramprateorsoftstartramp; + int32_t setpointramprateorsoftstartramp; + protobuf_c_boolean has_setpointcontroloutputrate; + int32_t setpointcontroloutputrate; + protobuf_c_boolean has_controloutputtype; + int32_t controloutputtype; + protobuf_c_boolean has_ssrcontroloutputtype; + int32_t ssrcontroloutputtype; + protobuf_c_boolean has_outputonoffhysteresisvalue; + int32_t outputonoffhysteresisvalue; + protobuf_c_boolean has_processvariablesamplingrate; + int32_t processvariablesamplingrate; + protobuf_c_boolean has_pvinputfilterfactormode; + int32_t pvinputfilterfactormode; +}; +#define HARDWARE_PID_CONTROL__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&hardware_pid_control__descriptor) \ + , 0, HARDWARE_PID_CONTROL_TYPE__DryerHeater1000w, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } + + +/* HardwarePidControl methods */ +void hardware_pid_control__init + (HardwarePidControl *message); +size_t hardware_pid_control__get_packed_size + (const HardwarePidControl *message); +size_t hardware_pid_control__pack + (const HardwarePidControl *message, + uint8_t *out); +size_t hardware_pid_control__pack_to_buffer + (const HardwarePidControl *message, + ProtobufCBuffer *buffer); +HardwarePidControl * + hardware_pid_control__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void hardware_pid_control__free_unpacked + (HardwarePidControl *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*HardwarePidControl_Closure) + (const HardwarePidControl *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor hardware_pid_control__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_HardwarePidControl_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwarePidControlType.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwarePidControlType.pb-c.c new file mode 100644 index 000000000..a64913666 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwarePidControlType.pb-c.c @@ -0,0 +1,61 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: HardwarePidControlType.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "HardwarePidControlType.pb-c.h" +static const ProtobufCEnumValue hardware_pid_control_type__enum_values_by_number[14] = +{ + { "DryerHeater1000w", "HARDWARE_PID_CONTROL_TYPE__DryerHeater1000w", 0 }, + { "DryerHeater200w1", "HARDWARE_PID_CONTROL_TYPE__DryerHeater200w1", 1 }, + { "DryerHeater200w2", "HARDWARE_PID_CONTROL_TYPE__DryerHeater200w2", 2 }, + { "HeadHeaterZ1", "HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ1", 3 }, + { "HeadHeaterZ2", "HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ2", 4 }, + { "HeadHeaterZ3", "HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ3", 5 }, + { "HeadHeaterZ4", "HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ4", 6 }, + { "MixerHeater", "HARDWARE_PID_CONTROL_TYPE__MixerHeater", 7 }, + { "WasteControl", "HARDWARE_PID_CONTROL_TYPE__WasteControl", 8 }, + { "MotorDryer", "HARDWARE_PID_CONTROL_TYPE__MotorDryer", 9 }, + { "MotorFeeder", "HARDWARE_PID_CONTROL_TYPE__MotorFeeder", 10 }, + { "MotorPooler", "HARDWARE_PID_CONTROL_TYPE__MotorPooler", 11 }, + { "MotorWinder", "HARDWARE_PID_CONTROL_TYPE__MotorWinder", 12 }, + { "DryerHeater400", "HARDWARE_PID_CONTROL_TYPE__DryerHeater400", 13 }, +}; +static const ProtobufCIntRange hardware_pid_control_type__value_ranges[] = { +{0, 0},{0, 14} +}; +static const ProtobufCEnumValueIndex hardware_pid_control_type__enum_values_by_name[14] = +{ + { "DryerHeater1000w", 0 }, + { "DryerHeater200w1", 1 }, + { "DryerHeater200w2", 2 }, + { "DryerHeater400", 13 }, + { "HeadHeaterZ1", 3 }, + { "HeadHeaterZ2", 4 }, + { "HeadHeaterZ3", 5 }, + { "HeadHeaterZ4", 6 }, + { "MixerHeater", 7 }, + { "MotorDryer", 9 }, + { "MotorFeeder", 10 }, + { "MotorPooler", 11 }, + { "MotorWinder", 12 }, + { "WasteControl", 8 }, +}; +const ProtobufCEnumDescriptor hardware_pid_control_type__descriptor = +{ + PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC, + "HardwarePidControlType", + "HardwarePidControlType", + "HardwarePidControlType", + "", + 14, + hardware_pid_control_type__enum_values_by_number, + 14, + hardware_pid_control_type__enum_values_by_name, + 1, + hardware_pid_control_type__value_ranges, + NULL,NULL,NULL,NULL /* reserved[1234] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwarePidControlType.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwarePidControlType.pb-c.h new file mode 100644 index 000000000..8bcea3bd0 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwarePidControlType.pb-c.h @@ -0,0 +1,55 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: HardwarePidControlType.proto */ + +#ifndef PROTOBUF_C_HardwarePidControlType_2eproto__INCLUDED +#define PROTOBUF_C_HardwarePidControlType_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + + + +/* --- enums --- */ + +typedef enum _HardwarePidControlType { + HARDWARE_PID_CONTROL_TYPE__DryerHeater1000w = 0, + HARDWARE_PID_CONTROL_TYPE__DryerHeater200w1 = 1, + HARDWARE_PID_CONTROL_TYPE__DryerHeater200w2 = 2, + HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ1 = 3, + HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ2 = 4, + HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ3 = 5, + HARDWARE_PID_CONTROL_TYPE__HeadHeaterZ4 = 6, + HARDWARE_PID_CONTROL_TYPE__MixerHeater = 7, + HARDWARE_PID_CONTROL_TYPE__WasteControl = 8, + HARDWARE_PID_CONTROL_TYPE__MotorDryer = 9, + HARDWARE_PID_CONTROL_TYPE__MotorFeeder = 10, + HARDWARE_PID_CONTROL_TYPE__MotorPooler = 11, + HARDWARE_PID_CONTROL_TYPE__MotorWinder = 12, + HARDWARE_PID_CONTROL_TYPE__DryerHeater400 = 13 + PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(HARDWARE_PID_CONTROL_TYPE) +} HardwarePidControlType; + +/* --- messages --- */ + +/* --- per-message closures --- */ + + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCEnumDescriptor hardware_pid_control_type__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_HardwarePidControlType_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwareWinder.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwareWinder.pb-c.c new file mode 100644 index 000000000..2ed95d9a5 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwareWinder.pb-c.c @@ -0,0 +1,105 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: HardwareWinder.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "HardwareWinder.pb-c.h" +void hardware_winder__init + (HardwareWinder *message) +{ + static const HardwareWinder init_value = HARDWARE_WINDER__INIT; + *message = init_value; +} +size_t hardware_winder__get_packed_size + (const HardwareWinder *message) +{ + assert(message->base.descriptor == &hardware_winder__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t hardware_winder__pack + (const HardwareWinder *message, + uint8_t *out) +{ + assert(message->base.descriptor == &hardware_winder__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t hardware_winder__pack_to_buffer + (const HardwareWinder *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &hardware_winder__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +HardwareWinder * + hardware_winder__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (HardwareWinder *) + protobuf_c_message_unpack (&hardware_winder__descriptor, + allocator, len, data); +} +void hardware_winder__free_unpacked + (HardwareWinder *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &hardware_winder__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor hardware_winder__field_descriptors[2] = +{ + { + "HardwareWinderType", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_ENUM, + offsetof(HardwareWinder, has_hardwarewindertype), + offsetof(HardwareWinder, hardwarewindertype), + &hardware_winder_type__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "MillimeterPerRotation", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(HardwareWinder, has_millimeterperrotation), + offsetof(HardwareWinder, millimeterperrotation), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned hardware_winder__field_indices_by_name[] = { + 0, /* field[0] = HardwareWinderType */ + 1, /* field[1] = MillimeterPerRotation */ +}; +static const ProtobufCIntRange hardware_winder__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor hardware_winder__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "HardwareWinder", + "HardwareWinder", + "HardwareWinder", + "", + sizeof(HardwareWinder), + 2, + hardware_winder__field_descriptors, + hardware_winder__field_indices_by_name, + 1, hardware_winder__number_ranges, + (ProtobufCMessageInit) hardware_winder__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwareWinder.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwareWinder.pb-c.h new file mode 100644 index 000000000..1595e4313 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwareWinder.pb-c.h @@ -0,0 +1,75 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: HardwareWinder.proto */ + +#ifndef PROTOBUF_C_HardwareWinder_2eproto__INCLUDED +#define PROTOBUF_C_HardwareWinder_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + +#include "HardwareWinderType.pb-c.h" + +typedef struct _HardwareWinder HardwareWinder; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _HardwareWinder +{ + ProtobufCMessage base; + protobuf_c_boolean has_hardwarewindertype; + HardwareWinderType hardwarewindertype; + protobuf_c_boolean has_millimeterperrotation; + int32_t millimeterperrotation; +}; +#define HARDWARE_WINDER__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&hardware_winder__descriptor) \ + , 0, HARDWARE_WINDER_TYPE__InternalWinder, 0, 0 } + + +/* HardwareWinder methods */ +void hardware_winder__init + (HardwareWinder *message); +size_t hardware_winder__get_packed_size + (const HardwareWinder *message); +size_t hardware_winder__pack + (const HardwareWinder *message, + uint8_t *out); +size_t hardware_winder__pack_to_buffer + (const HardwareWinder *message, + ProtobufCBuffer *buffer); +HardwareWinder * + hardware_winder__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void hardware_winder__free_unpacked + (HardwareWinder *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*HardwareWinder_Closure) + (const HardwareWinder *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor hardware_winder__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_HardwareWinder_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwareWinderType.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwareWinderType.pb-c.c new file mode 100644 index 000000000..ed168e14d --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwareWinderType.pb-c.c @@ -0,0 +1,35 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: HardwareWinderType.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "HardwareWinderType.pb-c.h" +static const ProtobufCEnumValue hardware_winder_type__enum_values_by_number[1] = +{ + { "InternalWinder", "HARDWARE_WINDER_TYPE__InternalWinder", 0 }, +}; +static const ProtobufCIntRange hardware_winder_type__value_ranges[] = { +{0, 0},{0, 1} +}; +static const ProtobufCEnumValueIndex hardware_winder_type__enum_values_by_name[1] = +{ + { "InternalWinder", 0 }, +}; +const ProtobufCEnumDescriptor hardware_winder_type__descriptor = +{ + PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC, + "HardwareWinderType", + "HardwareWinderType", + "HardwareWinderType", + "", + 1, + hardware_winder_type__enum_values_by_number, + 1, + hardware_winder_type__enum_values_by_name, + 1, + hardware_winder_type__value_ranges, + NULL,NULL,NULL,NULL /* reserved[1234] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwareWinderType.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwareWinderType.pb-c.h new file mode 100644 index 000000000..952c9ea12 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/HardwareWinderType.pb-c.h @@ -0,0 +1,42 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: HardwareWinderType.proto */ + +#ifndef PROTOBUF_C_HardwareWinderType_2eproto__INCLUDED +#define PROTOBUF_C_HardwareWinderType_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + + + +/* --- enums --- */ + +typedef enum _HardwareWinderType { + HARDWARE_WINDER_TYPE__InternalWinder = 0 + PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(HARDWARE_WINDER_TYPE) +} HardwareWinderType; + +/* --- messages --- */ + +/* --- per-message closures --- */ + + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCEnumDescriptor hardware_winder_type__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_HardwareWinderType_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/UploadHardwareConfigurationRequest.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/UploadHardwareConfigurationRequest.pb-c.c new file mode 100644 index 000000000..160c02c0b --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/UploadHardwareConfigurationRequest.pb-c.c @@ -0,0 +1,92 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: UploadHardwareConfigurationRequest.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "UploadHardwareConfigurationRequest.pb-c.h" +void upload_hardware_configuration_request__init + (UploadHardwareConfigurationRequest *message) +{ + static const UploadHardwareConfigurationRequest init_value = UPLOAD_HARDWARE_CONFIGURATION_REQUEST__INIT; + *message = init_value; +} +size_t upload_hardware_configuration_request__get_packed_size + (const UploadHardwareConfigurationRequest *message) +{ + assert(message->base.descriptor == &upload_hardware_configuration_request__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t upload_hardware_configuration_request__pack + (const UploadHardwareConfigurationRequest *message, + uint8_t *out) +{ + assert(message->base.descriptor == &upload_hardware_configuration_request__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t upload_hardware_configuration_request__pack_to_buffer + (const UploadHardwareConfigurationRequest *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &upload_hardware_configuration_request__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +UploadHardwareConfigurationRequest * + upload_hardware_configuration_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (UploadHardwareConfigurationRequest *) + protobuf_c_message_unpack (&upload_hardware_configuration_request__descriptor, + allocator, len, data); +} +void upload_hardware_configuration_request__free_unpacked + (UploadHardwareConfigurationRequest *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &upload_hardware_configuration_request__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor upload_hardware_configuration_request__field_descriptors[1] = +{ + { + "HardwareConfiguration", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_MESSAGE, + 0, /* quantifier_offset */ + offsetof(UploadHardwareConfigurationRequest, hardwareconfiguration), + &hardware_configuration__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned upload_hardware_configuration_request__field_indices_by_name[] = { + 0, /* field[0] = HardwareConfiguration */ +}; +static const ProtobufCIntRange upload_hardware_configuration_request__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor upload_hardware_configuration_request__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "UploadHardwareConfigurationRequest", + "UploadHardwareConfigurationRequest", + "UploadHardwareConfigurationRequest", + "", + sizeof(UploadHardwareConfigurationRequest), + 1, + upload_hardware_configuration_request__field_descriptors, + upload_hardware_configuration_request__field_indices_by_name, + 1, upload_hardware_configuration_request__number_ranges, + (ProtobufCMessageInit) upload_hardware_configuration_request__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/UploadHardwareConfigurationRequest.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/UploadHardwareConfigurationRequest.pb-c.h new file mode 100644 index 000000000..6e715a378 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/UploadHardwareConfigurationRequest.pb-c.h @@ -0,0 +1,72 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: UploadHardwareConfigurationRequest.proto */ + +#ifndef PROTOBUF_C_UploadHardwareConfigurationRequest_2eproto__INCLUDED +#define PROTOBUF_C_UploadHardwareConfigurationRequest_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + +#include "HardwareConfiguration.pb-c.h" + +typedef struct _UploadHardwareConfigurationRequest UploadHardwareConfigurationRequest; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _UploadHardwareConfigurationRequest +{ + ProtobufCMessage base; + HardwareConfiguration *hardwareconfiguration; +}; +#define UPLOAD_HARDWARE_CONFIGURATION_REQUEST__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&upload_hardware_configuration_request__descriptor) \ + , NULL } + + +/* UploadHardwareConfigurationRequest methods */ +void upload_hardware_configuration_request__init + (UploadHardwareConfigurationRequest *message); +size_t upload_hardware_configuration_request__get_packed_size + (const UploadHardwareConfigurationRequest *message); +size_t upload_hardware_configuration_request__pack + (const UploadHardwareConfigurationRequest *message, + uint8_t *out); +size_t upload_hardware_configuration_request__pack_to_buffer + (const UploadHardwareConfigurationRequest *message, + ProtobufCBuffer *buffer); +UploadHardwareConfigurationRequest * + upload_hardware_configuration_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void upload_hardware_configuration_request__free_unpacked + (UploadHardwareConfigurationRequest *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*UploadHardwareConfigurationRequest_Closure) + (const UploadHardwareConfigurationRequest *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor upload_hardware_configuration_request__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_UploadHardwareConfigurationRequest_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/UploadHardwareConfigurationResponse.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/UploadHardwareConfigurationResponse.pb-c.c new file mode 100644 index 000000000..56aff3176 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/UploadHardwareConfigurationResponse.pb-c.c @@ -0,0 +1,72 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: UploadHardwareConfigurationResponse.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "UploadHardwareConfigurationResponse.pb-c.h" +void upload_hardware_configuration_response__init + (UploadHardwareConfigurationResponse *message) +{ + static const UploadHardwareConfigurationResponse init_value = UPLOAD_HARDWARE_CONFIGURATION_RESPONSE__INIT; + *message = init_value; +} +size_t upload_hardware_configuration_response__get_packed_size + (const UploadHardwareConfigurationResponse *message) +{ + assert(message->base.descriptor == &upload_hardware_configuration_response__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t upload_hardware_configuration_response__pack + (const UploadHardwareConfigurationResponse *message, + uint8_t *out) +{ + assert(message->base.descriptor == &upload_hardware_configuration_response__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t upload_hardware_configuration_response__pack_to_buffer + (const UploadHardwareConfigurationResponse *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &upload_hardware_configuration_response__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +UploadHardwareConfigurationResponse * + upload_hardware_configuration_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (UploadHardwareConfigurationResponse *) + protobuf_c_message_unpack (&upload_hardware_configuration_response__descriptor, + allocator, len, data); +} +void upload_hardware_configuration_response__free_unpacked + (UploadHardwareConfigurationResponse *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &upload_hardware_configuration_response__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +#define upload_hardware_configuration_response__field_descriptors NULL +#define upload_hardware_configuration_response__field_indices_by_name NULL +#define upload_hardware_configuration_response__number_ranges NULL +const ProtobufCMessageDescriptor upload_hardware_configuration_response__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "UploadHardwareConfigurationResponse", + "UploadHardwareConfigurationResponse", + "UploadHardwareConfigurationResponse", + "", + sizeof(UploadHardwareConfigurationResponse), + 0, + upload_hardware_configuration_response__field_descriptors, + upload_hardware_configuration_response__field_indices_by_name, + 0, upload_hardware_configuration_response__number_ranges, + (ProtobufCMessageInit) upload_hardware_configuration_response__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/UploadHardwareConfigurationResponse.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/UploadHardwareConfigurationResponse.pb-c.h new file mode 100644 index 000000000..7f754f3bf --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Hardware/UploadHardwareConfigurationResponse.pb-c.h @@ -0,0 +1,70 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: UploadHardwareConfigurationResponse.proto */ + +#ifndef PROTOBUF_C_UploadHardwareConfigurationResponse_2eproto__INCLUDED +#define PROTOBUF_C_UploadHardwareConfigurationResponse_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _UploadHardwareConfigurationResponse UploadHardwareConfigurationResponse; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _UploadHardwareConfigurationResponse +{ + ProtobufCMessage base; +}; +#define UPLOAD_HARDWARE_CONFIGURATION_RESPONSE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&upload_hardware_configuration_response__descriptor) \ + } + + +/* UploadHardwareConfigurationResponse methods */ +void upload_hardware_configuration_response__init + (UploadHardwareConfigurationResponse *message); +size_t upload_hardware_configuration_response__get_packed_size + (const UploadHardwareConfigurationResponse *message); +size_t upload_hardware_configuration_response__pack + (const UploadHardwareConfigurationResponse *message, + uint8_t *out); +size_t upload_hardware_configuration_response__pack_to_buffer + (const UploadHardwareConfigurationResponse *message, + ProtobufCBuffer *buffer); +UploadHardwareConfigurationResponse * + upload_hardware_configuration_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void upload_hardware_configuration_response__free_unpacked + (UploadHardwareConfigurationResponse *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*UploadHardwareConfigurationResponse_Closure) + (const UploadHardwareConfigurationResponse *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor upload_hardware_configuration_response__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_UploadHardwareConfigurationResponse_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/DispenserLiquidType.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/DispenserLiquidType.pb-c.c new file mode 100644 index 000000000..15fe539f2 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/DispenserLiquidType.pb-c.c @@ -0,0 +1,47 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: DispenserLiquidType.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "DispenserLiquidType.pb-c.h" +static const ProtobufCEnumValue dispenser_liquid_type__enum_values_by_number[7] = +{ + { "Cyan", "DISPENSER_LIQUID_TYPE__Cyan", 0 }, + { "Magenta", "DISPENSER_LIQUID_TYPE__Magenta", 1 }, + { "Yellow", "DISPENSER_LIQUID_TYPE__Yellow", 2 }, + { "Black", "DISPENSER_LIQUID_TYPE__Black", 3 }, + { "TransparentInk", "DISPENSER_LIQUID_TYPE__TransparentInk", 4 }, + { "Lubricant", "DISPENSER_LIQUID_TYPE__Lubricant", 5 }, + { "Red", "DISPENSER_LIQUID_TYPE__Red", 7 }, +}; +static const ProtobufCIntRange dispenser_liquid_type__value_ranges[] = { +{0, 0},{7, 6},{0, 7} +}; +static const ProtobufCEnumValueIndex dispenser_liquid_type__enum_values_by_name[7] = +{ + { "Black", 3 }, + { "Cyan", 0 }, + { "Lubricant", 5 }, + { "Magenta", 1 }, + { "Red", 6 }, + { "TransparentInk", 4 }, + { "Yellow", 2 }, +}; +const ProtobufCEnumDescriptor dispenser_liquid_type__descriptor = +{ + PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC, + "DispenserLiquidType", + "DispenserLiquidType", + "DispenserLiquidType", + "", + 7, + dispenser_liquid_type__enum_values_by_number, + 7, + dispenser_liquid_type__enum_values_by_name, + 2, + dispenser_liquid_type__value_ranges, + NULL,NULL,NULL,NULL /* reserved[1234] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/DispenserLiquidType.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/DispenserLiquidType.pb-c.h new file mode 100644 index 000000000..a6ae3e867 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/DispenserLiquidType.pb-c.h @@ -0,0 +1,48 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: DispenserLiquidType.proto */ + +#ifndef PROTOBUF_C_DispenserLiquidType_2eproto__INCLUDED +#define PROTOBUF_C_DispenserLiquidType_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + + + +/* --- enums --- */ + +typedef enum _DispenserLiquidType { + DISPENSER_LIQUID_TYPE__Cyan = 0, + DISPENSER_LIQUID_TYPE__Magenta = 1, + DISPENSER_LIQUID_TYPE__Yellow = 2, + DISPENSER_LIQUID_TYPE__Black = 3, + DISPENSER_LIQUID_TYPE__TransparentInk = 4, + DISPENSER_LIQUID_TYPE__Lubricant = 5, + DISPENSER_LIQUID_TYPE__Red = 7 + PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(DISPENSER_LIQUID_TYPE) +} DispenserLiquidType; + +/* --- messages --- */ + +/* --- per-message closures --- */ + + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCEnumDescriptor dispenser_liquid_type__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_DispenserLiquidType_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/DispenserStepDivision.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/DispenserStepDivision.pb-c.c new file mode 100644 index 000000000..38da8a46b --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/DispenserStepDivision.pb-c.c @@ -0,0 +1,51 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: DispenserStepDivision.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "DispenserStepDivision.pb-c.h" +static const ProtobufCEnumValue dispenser_step_division__enum_values_by_number[9] = +{ + { "Auto", "DISPENSER_STEP_DIVISION__Auto", 0 }, + { "D1", "DISPENSER_STEP_DIVISION__D1", 1 }, + { "D2", "DISPENSER_STEP_DIVISION__D2", 2 }, + { "D4", "DISPENSER_STEP_DIVISION__D4", 4 }, + { "D8", "DISPENSER_STEP_DIVISION__D8", 8 }, + { "D16", "DISPENSER_STEP_DIVISION__D16", 16 }, + { "D32", "DISPENSER_STEP_DIVISION__D32", 32 }, + { "D64", "DISPENSER_STEP_DIVISION__D64", 64 }, + { "D128", "DISPENSER_STEP_DIVISION__D128", 128 }, +}; +static const ProtobufCIntRange dispenser_step_division__value_ranges[] = { +{0, 0},{4, 3},{8, 4},{16, 5},{32, 6},{64, 7},{128, 8},{0, 9} +}; +static const ProtobufCEnumValueIndex dispenser_step_division__enum_values_by_name[9] = +{ + { "Auto", 0 }, + { "D1", 1 }, + { "D128", 8 }, + { "D16", 5 }, + { "D2", 2 }, + { "D32", 6 }, + { "D4", 3 }, + { "D64", 7 }, + { "D8", 4 }, +}; +const ProtobufCEnumDescriptor dispenser_step_division__descriptor = +{ + PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC, + "DispenserStepDivision", + "DispenserStepDivision", + "DispenserStepDivision", + "", + 9, + dispenser_step_division__enum_values_by_number, + 9, + dispenser_step_division__enum_values_by_name, + 7, + dispenser_step_division__value_ranges, + NULL,NULL,NULL,NULL /* reserved[1234] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/DispenserStepDivision.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/DispenserStepDivision.pb-c.h new file mode 100644 index 000000000..42e340daa --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/DispenserStepDivision.pb-c.h @@ -0,0 +1,50 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: DispenserStepDivision.proto */ + +#ifndef PROTOBUF_C_DispenserStepDivision_2eproto__INCLUDED +#define PROTOBUF_C_DispenserStepDivision_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + + + +/* --- enums --- */ + +typedef enum _DispenserStepDivision { + DISPENSER_STEP_DIVISION__Auto = 0, + DISPENSER_STEP_DIVISION__D1 = 1, + DISPENSER_STEP_DIVISION__D2 = 2, + DISPENSER_STEP_DIVISION__D4 = 4, + DISPENSER_STEP_DIVISION__D8 = 8, + DISPENSER_STEP_DIVISION__D16 = 16, + DISPENSER_STEP_DIVISION__D32 = 32, + DISPENSER_STEP_DIVISION__D64 = 64, + DISPENSER_STEP_DIVISION__D128 = 128 + PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(DISPENSER_STEP_DIVISION) +} DispenserStepDivision; + +/* --- messages --- */ + +/* --- per-message closures --- */ + + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCEnumDescriptor dispenser_step_division__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_DispenserStepDivision_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/JobBrushStop.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/JobBrushStop.pb-c.c new file mode 100644 index 000000000..45e10394b --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/JobBrushStop.pb-c.c @@ -0,0 +1,131 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: JobBrushStop.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "JobBrushStop.pb-c.h" +void job_brush_stop__init + (JobBrushStop *message) +{ + static const JobBrushStop init_value = JOB_BRUSH_STOP__INIT; + *message = init_value; +} +size_t job_brush_stop__get_packed_size + (const JobBrushStop *message) +{ + assert(message->base.descriptor == &job_brush_stop__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t job_brush_stop__pack + (const JobBrushStop *message, + uint8_t *out) +{ + assert(message->base.descriptor == &job_brush_stop__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t job_brush_stop__pack_to_buffer + (const JobBrushStop *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &job_brush_stop__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +JobBrushStop * + job_brush_stop__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (JobBrushStop *) + protobuf_c_message_unpack (&job_brush_stop__descriptor, + allocator, len, data); +} +void job_brush_stop__free_unpacked + (JobBrushStop *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &job_brush_stop__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor job_brush_stop__field_descriptors[4] = +{ + { + "Index", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(JobBrushStop, has_index), + offsetof(JobBrushStop, index), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "OffsetPercent", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(JobBrushStop, has_offsetpercent), + offsetof(JobBrushStop, offsetpercent), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "OffsetMeters", + 3, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(JobBrushStop, has_offsetmeters), + offsetof(JobBrushStop, offsetmeters), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Dispensers", + 4, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(JobBrushStop, n_dispensers), + offsetof(JobBrushStop, dispensers), + &job_dispenser__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned job_brush_stop__field_indices_by_name[] = { + 3, /* field[3] = Dispensers */ + 0, /* field[0] = Index */ + 2, /* field[2] = OffsetMeters */ + 1, /* field[1] = OffsetPercent */ +}; +static const ProtobufCIntRange job_brush_stop__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 4 } +}; +const ProtobufCMessageDescriptor job_brush_stop__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "JobBrushStop", + "JobBrushStop", + "JobBrushStop", + "", + sizeof(JobBrushStop), + 4, + job_brush_stop__field_descriptors, + job_brush_stop__field_indices_by_name, + 1, job_brush_stop__number_ranges, + (ProtobufCMessageInit) job_brush_stop__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/JobBrushStop.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/JobBrushStop.pb-c.h new file mode 100644 index 000000000..6e887a448 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/JobBrushStop.pb-c.h @@ -0,0 +1,79 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: JobBrushStop.proto */ + +#ifndef PROTOBUF_C_JobBrushStop_2eproto__INCLUDED +#define PROTOBUF_C_JobBrushStop_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + +#include "JobDispenser.pb-c.h" + +typedef struct _JobBrushStop JobBrushStop; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _JobBrushStop +{ + ProtobufCMessage base; + protobuf_c_boolean has_index; + int32_t index; + protobuf_c_boolean has_offsetpercent; + double offsetpercent; + protobuf_c_boolean has_offsetmeters; + double offsetmeters; + size_t n_dispensers; + JobDispenser **dispensers; +}; +#define JOB_BRUSH_STOP__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&job_brush_stop__descriptor) \ + , 0, 0, 0, 0, 0, 0, 0,NULL } + + +/* JobBrushStop methods */ +void job_brush_stop__init + (JobBrushStop *message); +size_t job_brush_stop__get_packed_size + (const JobBrushStop *message); +size_t job_brush_stop__pack + (const JobBrushStop *message, + uint8_t *out); +size_t job_brush_stop__pack_to_buffer + (const JobBrushStop *message, + ProtobufCBuffer *buffer); +JobBrushStop * + job_brush_stop__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void job_brush_stop__free_unpacked + (JobBrushStop *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*JobBrushStop_Closure) + (const JobBrushStop *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor job_brush_stop__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_JobBrushStop_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/JobDispenser.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/JobDispenser.pb-c.c new file mode 100644 index 000000000..f868d121e --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/JobDispenser.pb-c.c @@ -0,0 +1,196 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: JobDispenser.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "JobDispenser.pb-c.h" +void job_dispenser__init + (JobDispenser *message) +{ + static const JobDispenser init_value = JOB_DISPENSER__INIT; + *message = init_value; +} +size_t job_dispenser__get_packed_size + (const JobDispenser *message) +{ + assert(message->base.descriptor == &job_dispenser__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t job_dispenser__pack + (const JobDispenser *message, + uint8_t *out) +{ + assert(message->base.descriptor == &job_dispenser__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t job_dispenser__pack_to_buffer + (const JobDispenser *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &job_dispenser__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +JobDispenser * + job_dispenser__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (JobDispenser *) + protobuf_c_message_unpack (&job_dispenser__descriptor, + allocator, len, data); +} +void job_dispenser__free_unpacked + (JobDispenser *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &job_dispenser__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor job_dispenser__field_descriptors[9] = +{ + { + "Index", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(JobDispenser, has_index), + offsetof(JobDispenser, index), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Volume", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(JobDispenser, has_volume), + offsetof(JobDispenser, volume), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "DispenserStepDivision", + 3, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_ENUM, + offsetof(JobDispenser, has_dispenserstepdivision), + offsetof(JobDispenser, dispenserstepdivision), + &dispenser_step_division__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "NanolitterPerSecond", + 4, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(JobDispenser, has_nanolitterpersecond), + offsetof(JobDispenser, nanolitterpersecond), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "NanoliterPerCentimeter", + 5, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(JobDispenser, has_nanoliterpercentimeter), + offsetof(JobDispenser, nanoliterpercentimeter), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "PulsePerSecond", + 6, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(JobDispenser, has_pulsepersecond), + offsetof(JobDispenser, pulsepersecond), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "DispenserLiquidType", + 7, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_ENUM, + offsetof(JobDispenser, has_dispenserliquidtype), + offsetof(JobDispenser, dispenserliquidtype), + &dispenser_liquid_type__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "LiquidMaxNanoliterPerCentimeter", + 8, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(JobDispenser, has_liquidmaxnanoliterpercentimeter), + offsetof(JobDispenser, liquidmaxnanoliterpercentimeter), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "NanoliterPerPulse", + 9, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(JobDispenser, has_nanoliterperpulse), + offsetof(JobDispenser, nanoliterperpulse), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned job_dispenser__field_indices_by_name[] = { + 6, /* field[6] = DispenserLiquidType */ + 2, /* field[2] = DispenserStepDivision */ + 0, /* field[0] = Index */ + 7, /* field[7] = LiquidMaxNanoliterPerCentimeter */ + 4, /* field[4] = NanoliterPerCentimeter */ + 8, /* field[8] = NanoliterPerPulse */ + 3, /* field[3] = NanolitterPerSecond */ + 5, /* field[5] = PulsePerSecond */ + 1, /* field[1] = Volume */ +}; +static const ProtobufCIntRange job_dispenser__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 9 } +}; +const ProtobufCMessageDescriptor job_dispenser__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "JobDispenser", + "JobDispenser", + "JobDispenser", + "", + sizeof(JobDispenser), + 9, + job_dispenser__field_descriptors, + job_dispenser__field_indices_by_name, + 1, job_dispenser__number_ranges, + (ProtobufCMessageInit) job_dispenser__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/JobDispenser.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/JobDispenser.pb-c.h new file mode 100644 index 000000000..2b21e265c --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/JobDispenser.pb-c.h @@ -0,0 +1,90 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: JobDispenser.proto */ + +#ifndef PROTOBUF_C_JobDispenser_2eproto__INCLUDED +#define PROTOBUF_C_JobDispenser_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + +#include "DispenserStepDivision.pb-c.h" +#include "DispenserLiquidType.pb-c.h" + +typedef struct _JobDispenser JobDispenser; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _JobDispenser +{ + ProtobufCMessage base; + protobuf_c_boolean has_index; + int32_t index; + protobuf_c_boolean has_volume; + double volume; + protobuf_c_boolean has_dispenserstepdivision; + DispenserStepDivision dispenserstepdivision; + protobuf_c_boolean has_nanolitterpersecond; + double nanolitterpersecond; + protobuf_c_boolean has_nanoliterpercentimeter; + double nanoliterpercentimeter; + protobuf_c_boolean has_pulsepersecond; + double pulsepersecond; + protobuf_c_boolean has_dispenserliquidtype; + DispenserLiquidType dispenserliquidtype; + protobuf_c_boolean has_liquidmaxnanoliterpercentimeter; + double liquidmaxnanoliterpercentimeter; + protobuf_c_boolean has_nanoliterperpulse; + double nanoliterperpulse; +}; +#define JOB_DISPENSER__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&job_dispenser__descriptor) \ + , 0, 0, 0, 0, 0, DISPENSER_STEP_DIVISION__Auto, 0, 0, 0, 0, 0, 0, 0, DISPENSER_LIQUID_TYPE__Cyan, 0, 0, 0, 0 } + + +/* JobDispenser methods */ +void job_dispenser__init + (JobDispenser *message); +size_t job_dispenser__get_packed_size + (const JobDispenser *message); +size_t job_dispenser__pack + (const JobDispenser *message, + uint8_t *out); +size_t job_dispenser__pack_to_buffer + (const JobDispenser *message, + ProtobufCBuffer *buffer); +JobDispenser * + job_dispenser__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void job_dispenser__free_unpacked + (JobDispenser *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*JobDispenser_Closure) + (const JobDispenser *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor job_dispenser__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_JobDispenser_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/JobRequest.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/JobRequest.pb-c.c index d282c0e56..d1e101dfd 100644 --- a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/JobRequest.pb-c.c +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/JobRequest.pb-c.c @@ -52,23 +52,11 @@ void job_request__free_unpacked assert(message->base.descriptor == &job_request__descriptor); protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); } -static const ProtobufCFieldDescriptor job_request__field_descriptors[2] = +static const ProtobufCFieldDescriptor job_request__field_descriptors[1] = { { - "Name", - 1, - PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(JobRequest, name), - NULL, - NULL, - 0, /* flags */ - 0,NULL,NULL /* reserved1,reserved2, etc */ - }, - { "JobTicket", - 2, + 1, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_MESSAGE, 0, /* quantifier_offset */ @@ -80,13 +68,12 @@ static const ProtobufCFieldDescriptor job_request__field_descriptors[2] = }, }; static const unsigned job_request__field_indices_by_name[] = { - 1, /* field[1] = JobTicket */ - 0, /* field[0] = Name */ + 0, /* field[0] = JobTicket */ }; static const ProtobufCIntRange job_request__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 2 } + { 0, 1 } }; const ProtobufCMessageDescriptor job_request__descriptor = { @@ -96,7 +83,7 @@ const ProtobufCMessageDescriptor job_request__descriptor = "JobRequest", "", sizeof(JobRequest), - 2, + 1, job_request__field_descriptors, job_request__field_indices_by_name, 1, job_request__number_ranges, diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/JobRequest.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/JobRequest.pb-c.h index 2019c859b..224db64af 100644 --- a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/JobRequest.pb-c.h +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/JobRequest.pb-c.h @@ -28,11 +28,10 @@ struct _JobRequest { ProtobufCMessage base; JobTicket *jobticket; - char *name; }; #define JOB_REQUEST__INIT \ { PROTOBUF_C_MESSAGE_INIT (&job_request__descriptor) \ - , NULL, NULL } + , NULL } /* JobRequest methods */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/JobSegment.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/JobSegment.pb-c.c index 94042855d..8b1710079 100644 --- a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/JobSegment.pb-c.c +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/JobSegment.pb-c.c @@ -52,7 +52,7 @@ void job_segment__free_unpacked assert(message->base.descriptor == &job_segment__descriptor); protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); } -static const ProtobufCFieldDescriptor job_segment__field_descriptors[2] = +static const ProtobufCFieldDescriptor job_segment__field_descriptors[3] = { { "Name", @@ -78,15 +78,28 @@ static const ProtobufCFieldDescriptor job_segment__field_descriptors[2] = 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, + { + "BrushStops", + 3, + PROTOBUF_C_LABEL_REPEATED, + PROTOBUF_C_TYPE_MESSAGE, + offsetof(JobSegment, n_brushstops), + offsetof(JobSegment, brushstops), + &job_brush_stop__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, }; static const unsigned job_segment__field_indices_by_name[] = { + 2, /* field[2] = BrushStops */ 1, /* field[1] = Length */ 0, /* field[0] = Name */ }; static const ProtobufCIntRange job_segment__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 2 } + { 0, 3 } }; const ProtobufCMessageDescriptor job_segment__descriptor = { @@ -96,7 +109,7 @@ const ProtobufCMessageDescriptor job_segment__descriptor = "JobSegment", "", sizeof(JobSegment), - 2, + 3, job_segment__field_descriptors, job_segment__field_indices_by_name, 1, job_segment__number_ranges, diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/JobSegment.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/JobSegment.pb-c.h index df8fb21e5..2c077abaa 100644 --- a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/JobSegment.pb-c.h +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/JobSegment.pb-c.h @@ -14,6 +14,7 @@ PROTOBUF_C__BEGIN_DECLS # error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. #endif +#include "JobBrushStop.pb-c.h" typedef struct _JobSegment JobSegment; @@ -29,10 +30,12 @@ struct _JobSegment char *name; protobuf_c_boolean has_length; double length; + size_t n_brushstops; + JobBrushStop **brushstops; }; #define JOB_SEGMENT__INIT \ { PROTOBUF_C_MESSAGE_INIT (&job_segment__descriptor) \ - , NULL, 0, 0 } + , NULL, 0, 0, 0,NULL } /* JobSegment methods */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/JobSpool.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/JobSpool.pb-c.c new file mode 100644 index 000000000..329c9e701 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/JobSpool.pb-c.c @@ -0,0 +1,170 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: JobSpool.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "JobSpool.pb-c.h" +void job_spool__init + (JobSpool *message) +{ + static const JobSpool init_value = JOB_SPOOL__INIT; + *message = init_value; +} +size_t job_spool__get_packed_size + (const JobSpool *message) +{ + assert(message->base.descriptor == &job_spool__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t job_spool__pack + (const JobSpool *message, + uint8_t *out) +{ + assert(message->base.descriptor == &job_spool__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t job_spool__pack_to_buffer + (const JobSpool *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &job_spool__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +JobSpool * + job_spool__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (JobSpool *) + protobuf_c_message_unpack (&job_spool__descriptor, + allocator, len, data); +} +void job_spool__free_unpacked + (JobSpool *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &job_spool__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor job_spool__field_descriptors[7] = +{ + { + "JobSpoolType", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_ENUM, + offsetof(JobSpool, has_jobspooltype), + offsetof(JobSpool, jobspooltype), + &job_spool_type__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Length", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(JobSpool, has_length), + offsetof(JobSpool, length), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Weight", + 3, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(JobSpool, has_weight), + offsetof(JobSpool, weight), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Diameter", + 4, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(JobSpool, has_diameter), + offsetof(JobSpool, diameter), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "StartOffsetPulses", + 5, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(JobSpool, has_startoffsetpulses), + offsetof(JobSpool, startoffsetpulses), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "BackingRate", + 6, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(JobSpool, has_backingrate), + offsetof(JobSpool, backingrate), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "SegmentOffsetPulses", + 7, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_INT32, + offsetof(JobSpool, has_segmentoffsetpulses), + offsetof(JobSpool, segmentoffsetpulses), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned job_spool__field_indices_by_name[] = { + 5, /* field[5] = BackingRate */ + 3, /* field[3] = Diameter */ + 0, /* field[0] = JobSpoolType */ + 1, /* field[1] = Length */ + 6, /* field[6] = SegmentOffsetPulses */ + 4, /* field[4] = StartOffsetPulses */ + 2, /* field[2] = Weight */ +}; +static const ProtobufCIntRange job_spool__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 7 } +}; +const ProtobufCMessageDescriptor job_spool__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "JobSpool", + "JobSpool", + "JobSpool", + "", + sizeof(JobSpool), + 7, + job_spool__field_descriptors, + job_spool__field_indices_by_name, + 1, job_spool__number_ranges, + (ProtobufCMessageInit) job_spool__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/JobSpool.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/JobSpool.pb-c.h new file mode 100644 index 000000000..38e9236ce --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/JobSpool.pb-c.h @@ -0,0 +1,85 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: JobSpool.proto */ + +#ifndef PROTOBUF_C_JobSpool_2eproto__INCLUDED +#define PROTOBUF_C_JobSpool_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + +#include "JobSpoolType.pb-c.h" + +typedef struct _JobSpool JobSpool; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _JobSpool +{ + ProtobufCMessage base; + protobuf_c_boolean has_jobspooltype; + JobSpoolType jobspooltype; + protobuf_c_boolean has_length; + double length; + protobuf_c_boolean has_weight; + double weight; + protobuf_c_boolean has_diameter; + double diameter; + protobuf_c_boolean has_startoffsetpulses; + int32_t startoffsetpulses; + protobuf_c_boolean has_backingrate; + int32_t backingrate; + protobuf_c_boolean has_segmentoffsetpulses; + int32_t segmentoffsetpulses; +}; +#define JOB_SPOOL__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&job_spool__descriptor) \ + , 0, JOB_SPOOL_TYPE__StandardSpool, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } + + +/* JobSpool methods */ +void job_spool__init + (JobSpool *message); +size_t job_spool__get_packed_size + (const JobSpool *message); +size_t job_spool__pack + (const JobSpool *message, + uint8_t *out); +size_t job_spool__pack_to_buffer + (const JobSpool *message, + ProtobufCBuffer *buffer); +JobSpool * + job_spool__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void job_spool__free_unpacked + (JobSpool *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*JobSpool_Closure) + (const JobSpool *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor job_spool__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_JobSpool_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/JobSpoolType.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/JobSpoolType.pb-c.c new file mode 100644 index 000000000..aa72dc2c9 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/JobSpoolType.pb-c.c @@ -0,0 +1,35 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: JobSpoolType.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "JobSpoolType.pb-c.h" +static const ProtobufCEnumValue job_spool_type__enum_values_by_number[1] = +{ + { "StandardSpool", "JOB_SPOOL_TYPE__StandardSpool", 0 }, +}; +static const ProtobufCIntRange job_spool_type__value_ranges[] = { +{0, 0},{0, 1} +}; +static const ProtobufCEnumValueIndex job_spool_type__enum_values_by_name[1] = +{ + { "StandardSpool", 0 }, +}; +const ProtobufCEnumDescriptor job_spool_type__descriptor = +{ + PROTOBUF_C__ENUM_DESCRIPTOR_MAGIC, + "JobSpoolType", + "JobSpoolType", + "JobSpoolType", + "", + 1, + job_spool_type__enum_values_by_number, + 1, + job_spool_type__enum_values_by_name, + 1, + job_spool_type__value_ranges, + NULL,NULL,NULL,NULL /* reserved[1234] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/JobSpoolType.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/JobSpoolType.pb-c.h new file mode 100644 index 000000000..2cfab4ae8 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/JobSpoolType.pb-c.h @@ -0,0 +1,42 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: JobSpoolType.proto */ + +#ifndef PROTOBUF_C_JobSpoolType_2eproto__INCLUDED +#define PROTOBUF_C_JobSpoolType_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + + + +/* --- enums --- */ + +typedef enum _JobSpoolType { + JOB_SPOOL_TYPE__StandardSpool = 0 + PROTOBUF_C__FORCE_ENUM_TO_BE_INT_SIZE(JOB_SPOOL_TYPE) +} JobSpoolType; + +/* --- messages --- */ + +/* --- per-message closures --- */ + + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCEnumDescriptor job_spool_type__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_JobSpoolType_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/JobTicket.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/JobTicket.pb-c.c index 765494fce..c9f1e859f 100644 --- a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/JobTicket.pb-c.c +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/JobTicket.pb-c.c @@ -52,7 +52,7 @@ void job_ticket__free_unpacked assert(message->base.descriptor == &job_ticket__descriptor); protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); } -static const ProtobufCFieldDescriptor job_ticket__field_descriptors[7] = +static const ProtobufCFieldDescriptor job_ticket__field_descriptors[8] = { { "Name", @@ -127,8 +127,20 @@ static const ProtobufCFieldDescriptor job_ticket__field_descriptors[7] = 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "Segments", + "Spool", 7, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_MESSAGE, + 0, /* quantifier_offset */ + offsetof(JobTicket, spool), + &job_spool__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Segments", + 8, PROTOBUF_C_LABEL_REPEATED, PROTOBUF_C_TYPE_MESSAGE, offsetof(JobTicket, n_segments), @@ -145,13 +157,14 @@ static const unsigned job_ticket__field_indices_by_name[] = { 3, /* field[3] = Length */ 0, /* field[0] = Name */ 4, /* field[4] = ProcessParameters */ - 6, /* field[6] = Segments */ + 7, /* field[7] = Segments */ + 6, /* field[6] = Spool */ 5, /* field[5] = WindingMethod */ }; static const ProtobufCIntRange job_ticket__number_ranges[1 + 1] = { { 1, 0 }, - { 0, 7 } + { 0, 8 } }; const ProtobufCMessageDescriptor job_ticket__descriptor = { @@ -161,7 +174,7 @@ const ProtobufCMessageDescriptor job_ticket__descriptor = "JobTicket", "", sizeof(JobTicket), - 7, + 8, job_ticket__field_descriptors, job_ticket__field_indices_by_name, 1, job_ticket__number_ranges, diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/JobTicket.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/JobTicket.pb-c.h index b64ee6292..b20d1db3c 100644 --- a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/JobTicket.pb-c.h +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/JobTicket.pb-c.h @@ -17,6 +17,7 @@ PROTOBUF_C__BEGIN_DECLS #include "JobSegment.pb-c.h" #include "ProcessParameters.pb-c.h" #include "JobWindingMethod.pb-c.h" +#include "JobSpool.pb-c.h" typedef struct _JobTicket JobTicket; @@ -39,12 +40,13 @@ struct _JobTicket ProcessParameters *processparameters; protobuf_c_boolean has_windingmethod; JobWindingMethod windingmethod; + JobSpool *spool; size_t n_segments; JobSegment **segments; }; #define JOB_TICKET__INIT \ { PROTOBUF_C_MESSAGE_INIT (&job_ticket__descriptor) \ - , NULL, 0, 0, 0, 0, 0, 0, NULL, 0, JOB_WINDING_METHOD__Embroidery, 0,NULL } + , NULL, 0, 0, 0, 0, 0, 0, NULL, 0, JOB_WINDING_METHOD__Embroidery, NULL, 0,NULL } /* JobTicket methods */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/ProcessParameters.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/ProcessParameters.pb-c.c index f1d45c351..a6c9b8f08 100644 --- a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/ProcessParameters.pb-c.c +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/ProcessParameters.pb-c.c @@ -55,48 +55,48 @@ void process_parameters__free_unpacked static const ProtobufCFieldDescriptor process_parameters__field_descriptors[16] = { { - "Name", + "DyeingSpeed", 1, PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_STRING, - 0, /* quantifier_offset */ - offsetof(ProcessParameters, name), + PROTOBUF_C_TYPE_DOUBLE, + offsetof(ProcessParameters, has_dyeingspeed), + offsetof(ProcessParameters, dyeingspeed), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "DyeingSpeed", + "MixerTemp", 2, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_DOUBLE, - offsetof(ProcessParameters, has_dyeingspeed), - offsetof(ProcessParameters, dyeingspeed), + offsetof(ProcessParameters, has_mixertemp), + offsetof(ProcessParameters, mixertemp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "MinInkUptake", + "DryerBufferLength", 3, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_DOUBLE, - offsetof(ProcessParameters, has_mininkuptake), - offsetof(ProcessParameters, mininkuptake), + offsetof(ProcessParameters, has_dryerbufferlength), + offsetof(ProcessParameters, dryerbufferlength), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "MixerTemp", + "MinInkUptake", 4, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_DOUBLE, - offsetof(ProcessParameters, has_mixertemp), - offsetof(ProcessParameters, mixertemp), + offsetof(ProcessParameters, has_mininkuptake), + offsetof(ProcessParameters, mininkuptake), NULL, NULL, 0, /* flags */ @@ -115,48 +115,48 @@ static const ProtobufCFieldDescriptor process_parameters__field_descriptors[16] 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "HeadZone2Temp", + "DryerZone1Temp", 6, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_DOUBLE, - offsetof(ProcessParameters, has_headzone2temp), - offsetof(ProcessParameters, headzone2temp), + offsetof(ProcessParameters, has_dryerzone1temp), + offsetof(ProcessParameters, dryerzone1temp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "HeadZone3Temp", + "FeederTension", 7, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_DOUBLE, - offsetof(ProcessParameters, has_headzone3temp), - offsetof(ProcessParameters, headzone3temp), + offsetof(ProcessParameters, has_feedertension), + offsetof(ProcessParameters, feedertension), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "HeadAirFlow", + "DryerZone2Temp", 8, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_DOUBLE, - offsetof(ProcessParameters, has_headairflow), - offsetof(ProcessParameters, headairflow), + offsetof(ProcessParameters, has_dryerzone2temp), + offsetof(ProcessParameters, dryerzone2temp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "FeederTension", + "HeadZone2Temp", 9, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_DOUBLE, - offsetof(ProcessParameters, has_feedertension), - offsetof(ProcessParameters, feedertension), + offsetof(ProcessParameters, has_headzone2temp), + offsetof(ProcessParameters, headzone2temp), NULL, NULL, 0, /* flags */ @@ -175,48 +175,48 @@ static const ProtobufCFieldDescriptor process_parameters__field_descriptors[16] 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "DryerBufferLength", + "HeadZone3Temp", 11, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_DOUBLE, - offsetof(ProcessParameters, has_dryerbufferlength), - offsetof(ProcessParameters, dryerbufferlength), + offsetof(ProcessParameters, has_headzone3temp), + offsetof(ProcessParameters, headzone3temp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "DryerZone1Temp", + "DryerZone3Temp", 12, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_DOUBLE, - offsetof(ProcessParameters, has_dryerzone1temp), - offsetof(ProcessParameters, dryerzone1temp), + offsetof(ProcessParameters, has_dryerzone3temp), + offsetof(ProcessParameters, dryerzone3temp), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "DryerZone2Temp", + "WinderTension", 13, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_DOUBLE, - offsetof(ProcessParameters, has_dryerzone2temp), - offsetof(ProcessParameters, dryerzone2temp), + offsetof(ProcessParameters, has_windertension), + offsetof(ProcessParameters, windertension), NULL, NULL, 0, /* flags */ 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "DryerZone3Temp", + "HeadAirFlow", 14, PROTOBUF_C_LABEL_OPTIONAL, PROTOBUF_C_TYPE_DOUBLE, - offsetof(ProcessParameters, has_dryerzone3temp), - offsetof(ProcessParameters, dryerzone3temp), + offsetof(ProcessParameters, has_headairflow), + offsetof(ProcessParameters, headairflow), NULL, NULL, 0, /* flags */ @@ -235,12 +235,12 @@ static const ProtobufCFieldDescriptor process_parameters__field_descriptors[16] 0,NULL,NULL /* reserved1,reserved2, etc */ }, { - "WinderTension", + "TableIndex", 16, PROTOBUF_C_LABEL_OPTIONAL, - PROTOBUF_C_TYPE_DOUBLE, - offsetof(ProcessParameters, has_windertension), - offsetof(ProcessParameters, windertension), + PROTOBUF_C_TYPE_INT32, + offsetof(ProcessParameters, has_tableindex), + offsetof(ProcessParameters, tableindex), NULL, NULL, 0, /* flags */ @@ -249,21 +249,21 @@ static const ProtobufCFieldDescriptor process_parameters__field_descriptors[16] }; static const unsigned process_parameters__field_indices_by_name[] = { 14, /* field[14] = DryerAirFlow */ - 10, /* field[10] = DryerBufferLength */ - 11, /* field[11] = DryerZone1Temp */ - 12, /* field[12] = DryerZone2Temp */ - 13, /* field[13] = DryerZone3Temp */ - 1, /* field[1] = DyeingSpeed */ - 8, /* field[8] = FeederTension */ - 7, /* field[7] = HeadAirFlow */ + 2, /* field[2] = DryerBufferLength */ + 5, /* field[5] = DryerZone1Temp */ + 7, /* field[7] = DryerZone2Temp */ + 11, /* field[11] = DryerZone3Temp */ + 0, /* field[0] = DyeingSpeed */ + 6, /* field[6] = FeederTension */ + 13, /* field[13] = HeadAirFlow */ 4, /* field[4] = HeadZone1Temp */ - 5, /* field[5] = HeadZone2Temp */ - 6, /* field[6] = HeadZone3Temp */ - 2, /* field[2] = MinInkUptake */ - 3, /* field[3] = MixerTemp */ - 0, /* field[0] = Name */ + 8, /* field[8] = HeadZone2Temp */ + 10, /* field[10] = HeadZone3Temp */ + 3, /* field[3] = MinInkUptake */ + 1, /* field[1] = MixerTemp */ 9, /* field[9] = PullerTension */ - 15, /* field[15] = WinderTension */ + 15, /* field[15] = TableIndex */ + 12, /* field[12] = WinderTension */ }; static const ProtobufCIntRange process_parameters__number_ranges[1 + 1] = { diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/ProcessParameters.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/ProcessParameters.pb-c.h index a658f6b5b..00be2df93 100644 --- a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/ProcessParameters.pb-c.h +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/ProcessParameters.pb-c.h @@ -26,41 +26,42 @@ typedef struct _ProcessParameters ProcessParameters; struct _ProcessParameters { ProtobufCMessage base; - char *name; protobuf_c_boolean has_dyeingspeed; double dyeingspeed; - protobuf_c_boolean has_mininkuptake; - double mininkuptake; protobuf_c_boolean has_mixertemp; double mixertemp; - protobuf_c_boolean has_headzone1temp; - double headzone1temp; - protobuf_c_boolean has_headzone2temp; - double headzone2temp; - protobuf_c_boolean has_headzone3temp; - double headzone3temp; - protobuf_c_boolean has_headairflow; - double headairflow; - protobuf_c_boolean has_feedertension; - double feedertension; - protobuf_c_boolean has_pullertension; - double pullertension; protobuf_c_boolean has_dryerbufferlength; double dryerbufferlength; + protobuf_c_boolean has_mininkuptake; + double mininkuptake; + protobuf_c_boolean has_headzone1temp; + double headzone1temp; protobuf_c_boolean has_dryerzone1temp; double dryerzone1temp; + protobuf_c_boolean has_feedertension; + double feedertension; protobuf_c_boolean has_dryerzone2temp; double dryerzone2temp; + protobuf_c_boolean has_headzone2temp; + double headzone2temp; + protobuf_c_boolean has_pullertension; + double pullertension; + protobuf_c_boolean has_headzone3temp; + double headzone3temp; protobuf_c_boolean has_dryerzone3temp; double dryerzone3temp; - protobuf_c_boolean has_dryerairflow; - double dryerairflow; protobuf_c_boolean has_windertension; double windertension; + protobuf_c_boolean has_headairflow; + double headairflow; + protobuf_c_boolean has_dryerairflow; + double dryerairflow; + protobuf_c_boolean has_tableindex; + int32_t tableindex; }; #define PROCESS_PARAMETERS__INIT \ { PROTOBUF_C_MESSAGE_INIT (&process_parameters__descriptor) \ - , NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } + , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } /* ProcessParameters methods */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/UploadProcessParametersRequest.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/UploadProcessParametersRequest.pb-c.c new file mode 100644 index 000000000..bae09c741 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/UploadProcessParametersRequest.pb-c.c @@ -0,0 +1,92 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: UploadProcessParametersRequest.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "UploadProcessParametersRequest.pb-c.h" +void upload_process_parameters_request__init + (UploadProcessParametersRequest *message) +{ + static const UploadProcessParametersRequest init_value = UPLOAD_PROCESS_PARAMETERS_REQUEST__INIT; + *message = init_value; +} +size_t upload_process_parameters_request__get_packed_size + (const UploadProcessParametersRequest *message) +{ + assert(message->base.descriptor == &upload_process_parameters_request__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t upload_process_parameters_request__pack + (const UploadProcessParametersRequest *message, + uint8_t *out) +{ + assert(message->base.descriptor == &upload_process_parameters_request__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t upload_process_parameters_request__pack_to_buffer + (const UploadProcessParametersRequest *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &upload_process_parameters_request__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +UploadProcessParametersRequest * + upload_process_parameters_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (UploadProcessParametersRequest *) + protobuf_c_message_unpack (&upload_process_parameters_request__descriptor, + allocator, len, data); +} +void upload_process_parameters_request__free_unpacked + (UploadProcessParametersRequest *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &upload_process_parameters_request__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor upload_process_parameters_request__field_descriptors[1] = +{ + { + "ProcessParameters", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_MESSAGE, + 0, /* quantifier_offset */ + offsetof(UploadProcessParametersRequest, processparameters), + &process_parameters__descriptor, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned upload_process_parameters_request__field_indices_by_name[] = { + 0, /* field[0] = ProcessParameters */ +}; +static const ProtobufCIntRange upload_process_parameters_request__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor upload_process_parameters_request__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "UploadProcessParametersRequest", + "UploadProcessParametersRequest", + "UploadProcessParametersRequest", + "", + sizeof(UploadProcessParametersRequest), + 1, + upload_process_parameters_request__field_descriptors, + upload_process_parameters_request__field_indices_by_name, + 1, upload_process_parameters_request__number_ranges, + (ProtobufCMessageInit) upload_process_parameters_request__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/UploadProcessParametersRequest.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/UploadProcessParametersRequest.pb-c.h new file mode 100644 index 000000000..c39ee4174 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/UploadProcessParametersRequest.pb-c.h @@ -0,0 +1,72 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: UploadProcessParametersRequest.proto */ + +#ifndef PROTOBUF_C_UploadProcessParametersRequest_2eproto__INCLUDED +#define PROTOBUF_C_UploadProcessParametersRequest_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + +#include "ProcessParameters.pb-c.h" + +typedef struct _UploadProcessParametersRequest UploadProcessParametersRequest; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _UploadProcessParametersRequest +{ + ProtobufCMessage base; + ProcessParameters *processparameters; +}; +#define UPLOAD_PROCESS_PARAMETERS_REQUEST__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&upload_process_parameters_request__descriptor) \ + , NULL } + + +/* UploadProcessParametersRequest methods */ +void upload_process_parameters_request__init + (UploadProcessParametersRequest *message); +size_t upload_process_parameters_request__get_packed_size + (const UploadProcessParametersRequest *message); +size_t upload_process_parameters_request__pack + (const UploadProcessParametersRequest *message, + uint8_t *out); +size_t upload_process_parameters_request__pack_to_buffer + (const UploadProcessParametersRequest *message, + ProtobufCBuffer *buffer); +UploadProcessParametersRequest * + upload_process_parameters_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void upload_process_parameters_request__free_unpacked + (UploadProcessParametersRequest *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*UploadProcessParametersRequest_Closure) + (const UploadProcessParametersRequest *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor upload_process_parameters_request__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_UploadProcessParametersRequest_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/UploadProcessParametersResponse.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/UploadProcessParametersResponse.pb-c.c new file mode 100644 index 000000000..2503df80d --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/UploadProcessParametersResponse.pb-c.c @@ -0,0 +1,72 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: UploadProcessParametersResponse.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "UploadProcessParametersResponse.pb-c.h" +void upload_process_parameters_response__init + (UploadProcessParametersResponse *message) +{ + static const UploadProcessParametersResponse init_value = UPLOAD_PROCESS_PARAMETERS_RESPONSE__INIT; + *message = init_value; +} +size_t upload_process_parameters_response__get_packed_size + (const UploadProcessParametersResponse *message) +{ + assert(message->base.descriptor == &upload_process_parameters_response__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t upload_process_parameters_response__pack + (const UploadProcessParametersResponse *message, + uint8_t *out) +{ + assert(message->base.descriptor == &upload_process_parameters_response__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t upload_process_parameters_response__pack_to_buffer + (const UploadProcessParametersResponse *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &upload_process_parameters_response__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +UploadProcessParametersResponse * + upload_process_parameters_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (UploadProcessParametersResponse *) + protobuf_c_message_unpack (&upload_process_parameters_response__descriptor, + allocator, len, data); +} +void upload_process_parameters_response__free_unpacked + (UploadProcessParametersResponse *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &upload_process_parameters_response__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +#define upload_process_parameters_response__field_descriptors NULL +#define upload_process_parameters_response__field_indices_by_name NULL +#define upload_process_parameters_response__number_ranges NULL +const ProtobufCMessageDescriptor upload_process_parameters_response__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "UploadProcessParametersResponse", + "UploadProcessParametersResponse", + "UploadProcessParametersResponse", + "", + sizeof(UploadProcessParametersResponse), + 0, + upload_process_parameters_response__field_descriptors, + upload_process_parameters_response__field_indices_by_name, + 0, upload_process_parameters_response__number_ranges, + (ProtobufCMessageInit) upload_process_parameters_response__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/UploadProcessParametersResponse.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/UploadProcessParametersResponse.pb-c.h new file mode 100644 index 000000000..4089217d2 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Printing/UploadProcessParametersResponse.pb-c.h @@ -0,0 +1,70 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: UploadProcessParametersResponse.proto */ + +#ifndef PROTOBUF_C_UploadProcessParametersResponse_2eproto__INCLUDED +#define PROTOBUF_C_UploadProcessParametersResponse_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _UploadProcessParametersResponse UploadProcessParametersResponse; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _UploadProcessParametersResponse +{ + ProtobufCMessage base; +}; +#define UPLOAD_PROCESS_PARAMETERS_RESPONSE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&upload_process_parameters_response__descriptor) \ + } + + +/* UploadProcessParametersResponse methods */ +void upload_process_parameters_response__init + (UploadProcessParametersResponse *message); +size_t upload_process_parameters_response__get_packed_size + (const UploadProcessParametersResponse *message); +size_t upload_process_parameters_response__pack + (const UploadProcessParametersResponse *message, + uint8_t *out); +size_t upload_process_parameters_response__pack_to_buffer + (const UploadProcessParametersResponse *message, + ProtobufCBuffer *buffer); +UploadProcessParametersResponse * + upload_process_parameters_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void upload_process_parameters_response__free_unpacked + (UploadProcessParametersResponse *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*UploadProcessParametersResponse_Closure) + (const UploadProcessParametersResponse *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor upload_process_parameters_response__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_UploadProcessParametersResponse_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubF3Gpo01WriteRequest.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubF3Gpo01WriteRequest.pb-c.c new file mode 100644 index 000000000..69466269b --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubF3Gpo01WriteRequest.pb-c.c @@ -0,0 +1,235 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubF3Gpo01WriteRequest.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StubF3Gpo01WriteRequest.pb-c.h" +void stub_f3_gpo01_write_request__init + (StubF3Gpo01WriteRequest *message) +{ + static const StubF3Gpo01WriteRequest init_value = STUB_F3_GPO01_WRITE_REQUEST__INIT; + *message = init_value; +} +size_t stub_f3_gpo01_write_request__get_packed_size + (const StubF3Gpo01WriteRequest *message) +{ + assert(message->base.descriptor == &stub_f3_gpo01_write_request__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t stub_f3_gpo01_write_request__pack + (const StubF3Gpo01WriteRequest *message, + uint8_t *out) +{ + assert(message->base.descriptor == &stub_f3_gpo01_write_request__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t stub_f3_gpo01_write_request__pack_to_buffer + (const StubF3Gpo01WriteRequest *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &stub_f3_gpo01_write_request__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +StubF3Gpo01WriteRequest * + stub_f3_gpo01_write_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (StubF3Gpo01WriteRequest *) + protobuf_c_message_unpack (&stub_f3_gpo01_write_request__descriptor, + allocator, len, data); +} +void stub_f3_gpo01_write_request__free_unpacked + (StubF3Gpo01WriteRequest *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &stub_f3_gpo01_write_request__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor stub_f3_gpo01_write_request__field_descriptors[12] = +{ + { + "F3_GPO_LED4", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubF3Gpo01WriteRequest, has_f3_gpo_led4), + offsetof(StubF3Gpo01WriteRequest, f3_gpo_led4), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Write_F3_GPO_LED4", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubF3Gpo01WriteRequest, has_write_f3_gpo_led4), + offsetof(StubF3Gpo01WriteRequest, write_f3_gpo_led4), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "F3_GPO_LED3", + 3, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubF3Gpo01WriteRequest, has_f3_gpo_led3), + offsetof(StubF3Gpo01WriteRequest, f3_gpo_led3), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Write_F3_GPO_LED3", + 4, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubF3Gpo01WriteRequest, has_write_f3_gpo_led3), + offsetof(StubF3Gpo01WriteRequest, write_f3_gpo_led3), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "F3_GPO_LED2", + 5, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubF3Gpo01WriteRequest, has_f3_gpo_led2), + offsetof(StubF3Gpo01WriteRequest, f3_gpo_led2), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Write_F3_GPO_LED2", + 6, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubF3Gpo01WriteRequest, has_write_f3_gpo_led2), + offsetof(StubF3Gpo01WriteRequest, write_f3_gpo_led2), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "F3_GPO_LED1", + 7, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubF3Gpo01WriteRequest, has_f3_gpo_led1), + offsetof(StubF3Gpo01WriteRequest, f3_gpo_led1), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Write_F3_GPO_LED1", + 8, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubF3Gpo01WriteRequest, has_write_f3_gpo_led1), + offsetof(StubF3Gpo01WriteRequest, write_f3_gpo_led1), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "F3_GPO_EXTWINDER_SSR11_CTRL", + 9, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubF3Gpo01WriteRequest, has_f3_gpo_extwinder_ssr11_ctrl), + offsetof(StubF3Gpo01WriteRequest, f3_gpo_extwinder_ssr11_ctrl), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Write_F3_GPO_EXTWINDER_SSR11_CTRL", + 10, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubF3Gpo01WriteRequest, has_write_f3_gpo_extwinder_ssr11_ctrl), + offsetof(StubF3Gpo01WriteRequest, write_f3_gpo_extwinder_ssr11_ctrl), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "F3_GPO_BUZZER", + 11, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubF3Gpo01WriteRequest, has_f3_gpo_buzzer), + offsetof(StubF3Gpo01WriteRequest, f3_gpo_buzzer), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Write_F3_GPO_BUZZER", + 12, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubF3Gpo01WriteRequest, has_write_f3_gpo_buzzer), + offsetof(StubF3Gpo01WriteRequest, write_f3_gpo_buzzer), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned stub_f3_gpo01_write_request__field_indices_by_name[] = { + 10, /* field[10] = F3_GPO_BUZZER */ + 8, /* field[8] = F3_GPO_EXTWINDER_SSR11_CTRL */ + 6, /* field[6] = F3_GPO_LED1 */ + 4, /* field[4] = F3_GPO_LED2 */ + 2, /* field[2] = F3_GPO_LED3 */ + 0, /* field[0] = F3_GPO_LED4 */ + 11, /* field[11] = Write_F3_GPO_BUZZER */ + 9, /* field[9] = Write_F3_GPO_EXTWINDER_SSR11_CTRL */ + 7, /* field[7] = Write_F3_GPO_LED1 */ + 5, /* field[5] = Write_F3_GPO_LED2 */ + 3, /* field[3] = Write_F3_GPO_LED3 */ + 1, /* field[1] = Write_F3_GPO_LED4 */ +}; +static const ProtobufCIntRange stub_f3_gpo01_write_request__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 12 } +}; +const ProtobufCMessageDescriptor stub_f3_gpo01_write_request__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "StubF3Gpo01WriteRequest", + "StubF3Gpo01WriteRequest", + "StubF3Gpo01WriteRequest", + "", + sizeof(StubF3Gpo01WriteRequest), + 12, + stub_f3_gpo01_write_request__field_descriptors, + stub_f3_gpo01_write_request__field_indices_by_name, + 1, stub_f3_gpo01_write_request__number_ranges, + (ProtobufCMessageInit) stub_f3_gpo01_write_request__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubF3Gpo01WriteRequest.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubF3Gpo01WriteRequest.pb-c.h new file mode 100644 index 000000000..1dec7e478 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubF3Gpo01WriteRequest.pb-c.h @@ -0,0 +1,100 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubF3Gpo01WriteRequest.proto */ + +#ifndef PROTOBUF_C_StubF3Gpo01WriteRequest_2eproto__INCLUDED +#define PROTOBUF_C_StubF3Gpo01WriteRequest_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _StubF3Gpo01WriteRequest StubF3Gpo01WriteRequest; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _StubF3Gpo01WriteRequest +{ + ProtobufCMessage base; + /* + *value + */ + protobuf_c_boolean has_f3_gpo_led4; + protobuf_c_boolean f3_gpo_led4; + /* + *write + */ + protobuf_c_boolean has_write_f3_gpo_led4; + protobuf_c_boolean write_f3_gpo_led4; + protobuf_c_boolean has_f3_gpo_led3; + protobuf_c_boolean f3_gpo_led3; + protobuf_c_boolean has_write_f3_gpo_led3; + protobuf_c_boolean write_f3_gpo_led3; + protobuf_c_boolean has_f3_gpo_led2; + protobuf_c_boolean f3_gpo_led2; + protobuf_c_boolean has_write_f3_gpo_led2; + protobuf_c_boolean write_f3_gpo_led2; + protobuf_c_boolean has_f3_gpo_led1; + protobuf_c_boolean f3_gpo_led1; + protobuf_c_boolean has_write_f3_gpo_led1; + protobuf_c_boolean write_f3_gpo_led1; + protobuf_c_boolean has_f3_gpo_extwinder_ssr11_ctrl; + protobuf_c_boolean f3_gpo_extwinder_ssr11_ctrl; + protobuf_c_boolean has_write_f3_gpo_extwinder_ssr11_ctrl; + protobuf_c_boolean write_f3_gpo_extwinder_ssr11_ctrl; + protobuf_c_boolean has_f3_gpo_buzzer; + protobuf_c_boolean f3_gpo_buzzer; + protobuf_c_boolean has_write_f3_gpo_buzzer; + protobuf_c_boolean write_f3_gpo_buzzer; +}; +#define STUB_F3_GPO01_WRITE_REQUEST__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&stub_f3_gpo01_write_request__descriptor) \ + , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } + + +/* StubF3Gpo01WriteRequest methods */ +void stub_f3_gpo01_write_request__init + (StubF3Gpo01WriteRequest *message); +size_t stub_f3_gpo01_write_request__get_packed_size + (const StubF3Gpo01WriteRequest *message); +size_t stub_f3_gpo01_write_request__pack + (const StubF3Gpo01WriteRequest *message, + uint8_t *out); +size_t stub_f3_gpo01_write_request__pack_to_buffer + (const StubF3Gpo01WriteRequest *message, + ProtobufCBuffer *buffer); +StubF3Gpo01WriteRequest * + stub_f3_gpo01_write_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void stub_f3_gpo01_write_request__free_unpacked + (StubF3Gpo01WriteRequest *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*StubF3Gpo01WriteRequest_Closure) + (const StubF3Gpo01WriteRequest *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor stub_f3_gpo01_write_request__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StubF3Gpo01WriteRequest_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubF3Gpo01WriteResponse.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubF3Gpo01WriteResponse.pb-c.c new file mode 100644 index 000000000..4b852987e --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubF3Gpo01WriteResponse.pb-c.c @@ -0,0 +1,105 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubF3Gpo01WriteResponse.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StubF3Gpo01WriteResponse.pb-c.h" +void stub_f3_gpo01_write_response__init + (StubF3Gpo01WriteResponse *message) +{ + static const StubF3Gpo01WriteResponse init_value = STUB_F3_GPO01_WRITE_RESPONSE__INIT; + *message = init_value; +} +size_t stub_f3_gpo01_write_response__get_packed_size + (const StubF3Gpo01WriteResponse *message) +{ + assert(message->base.descriptor == &stub_f3_gpo01_write_response__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t stub_f3_gpo01_write_response__pack + (const StubF3Gpo01WriteResponse *message, + uint8_t *out) +{ + assert(message->base.descriptor == &stub_f3_gpo01_write_response__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t stub_f3_gpo01_write_response__pack_to_buffer + (const StubF3Gpo01WriteResponse *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &stub_f3_gpo01_write_response__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +StubF3Gpo01WriteResponse * + stub_f3_gpo01_write_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (StubF3Gpo01WriteResponse *) + protobuf_c_message_unpack (&stub_f3_gpo01_write_response__descriptor, + allocator, len, data); +} +void stub_f3_gpo01_write_response__free_unpacked + (StubF3Gpo01WriteResponse *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &stub_f3_gpo01_write_response__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor stub_f3_gpo01_write_response__field_descriptors[2] = +{ + { + "Status", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(StubF3Gpo01WriteResponse, status), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "StatusWord", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubF3Gpo01WriteResponse, has_statusword), + offsetof(StubF3Gpo01WriteResponse, statusword), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned stub_f3_gpo01_write_response__field_indices_by_name[] = { + 0, /* field[0] = Status */ + 1, /* field[1] = StatusWord */ +}; +static const ProtobufCIntRange stub_f3_gpo01_write_response__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor stub_f3_gpo01_write_response__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "StubF3Gpo01WriteResponse", + "StubF3Gpo01WriteResponse", + "StubF3Gpo01WriteResponse", + "", + sizeof(StubF3Gpo01WriteResponse), + 2, + stub_f3_gpo01_write_response__field_descriptors, + stub_f3_gpo01_write_response__field_indices_by_name, + 1, stub_f3_gpo01_write_response__number_ranges, + (ProtobufCMessageInit) stub_f3_gpo01_write_response__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubF3Gpo01WriteResponse.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubF3Gpo01WriteResponse.pb-c.h new file mode 100644 index 000000000..c245016a4 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubF3Gpo01WriteResponse.pb-c.h @@ -0,0 +1,79 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubF3Gpo01WriteResponse.proto */ + +#ifndef PROTOBUF_C_StubF3Gpo01WriteResponse_2eproto__INCLUDED +#define PROTOBUF_C_StubF3Gpo01WriteResponse_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _StubF3Gpo01WriteResponse StubF3Gpo01WriteResponse; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _StubF3Gpo01WriteResponse +{ + ProtobufCMessage base; + /* + * Passed/Failed + */ + char *status; + /* + * Error number/bit when the status is Failed + */ + protobuf_c_boolean has_statusword; + uint32_t statusword; +}; +#define STUB_F3_GPO01_WRITE_RESPONSE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&stub_f3_gpo01_write_response__descriptor) \ + , NULL, 0, 0 } + + +/* StubF3Gpo01WriteResponse methods */ +void stub_f3_gpo01_write_response__init + (StubF3Gpo01WriteResponse *message); +size_t stub_f3_gpo01_write_response__get_packed_size + (const StubF3Gpo01WriteResponse *message); +size_t stub_f3_gpo01_write_response__pack + (const StubF3Gpo01WriteResponse *message, + uint8_t *out); +size_t stub_f3_gpo01_write_response__pack_to_buffer + (const StubF3Gpo01WriteResponse *message, + ProtobufCBuffer *buffer); +StubF3Gpo01WriteResponse * + stub_f3_gpo01_write_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void stub_f3_gpo01_write_response__free_unpacked + (StubF3Gpo01WriteResponse *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*StubF3Gpo01WriteResponse_Closure) + (const StubF3Gpo01WriteResponse *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor stub_f3_gpo01_write_response__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StubF3Gpo01WriteResponse_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubFPGAReadBackRegRequest.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubFPGAReadBackRegRequest.pb-c.c new file mode 100644 index 000000000..60519632e --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubFPGAReadBackRegRequest.pb-c.c @@ -0,0 +1,105 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubFPGAReadBackRegRequest.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StubFPGAReadBackRegRequest.pb-c.h" +void stub_fpgaread_back_reg_request__init + (StubFPGAReadBackRegRequest *message) +{ + static const StubFPGAReadBackRegRequest init_value = STUB_FPGAREAD_BACK_REG_REQUEST__INIT; + *message = init_value; +} +size_t stub_fpgaread_back_reg_request__get_packed_size + (const StubFPGAReadBackRegRequest *message) +{ + assert(message->base.descriptor == &stub_fpgaread_back_reg_request__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t stub_fpgaread_back_reg_request__pack + (const StubFPGAReadBackRegRequest *message, + uint8_t *out) +{ + assert(message->base.descriptor == &stub_fpgaread_back_reg_request__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t stub_fpgaread_back_reg_request__pack_to_buffer + (const StubFPGAReadBackRegRequest *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &stub_fpgaread_back_reg_request__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +StubFPGAReadBackRegRequest * + stub_fpgaread_back_reg_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (StubFPGAReadBackRegRequest *) + protobuf_c_message_unpack (&stub_fpgaread_back_reg_request__descriptor, + allocator, len, data); +} +void stub_fpgaread_back_reg_request__free_unpacked + (StubFPGAReadBackRegRequest *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &stub_fpgaread_back_reg_request__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor stub_fpgaread_back_reg_request__field_descriptors[2] = +{ + { + "FPGAId", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubFPGAReadBackRegRequest, has_fpgaid), + offsetof(StubFPGAReadBackRegRequest, fpgaid), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Value", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubFPGAReadBackRegRequest, has_value), + offsetof(StubFPGAReadBackRegRequest, value), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned stub_fpgaread_back_reg_request__field_indices_by_name[] = { + 0, /* field[0] = FPGAId */ + 1, /* field[1] = Value */ +}; +static const ProtobufCIntRange stub_fpgaread_back_reg_request__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor stub_fpgaread_back_reg_request__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "StubFPGAReadBackRegRequest", + "StubFPGAReadBackRegRequest", + "StubFPGAReadBackRegRequest", + "", + sizeof(StubFPGAReadBackRegRequest), + 2, + stub_fpgaread_back_reg_request__field_descriptors, + stub_fpgaread_back_reg_request__field_indices_by_name, + 1, stub_fpgaread_back_reg_request__number_ranges, + (ProtobufCMessageInit) stub_fpgaread_back_reg_request__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubFPGAReadBackRegRequest.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubFPGAReadBackRegRequest.pb-c.h new file mode 100644 index 000000000..e4ae69f1f --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubFPGAReadBackRegRequest.pb-c.h @@ -0,0 +1,80 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubFPGAReadBackRegRequest.proto */ + +#ifndef PROTOBUF_C_StubFPGAReadBackRegRequest_2eproto__INCLUDED +#define PROTOBUF_C_StubFPGAReadBackRegRequest_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _StubFPGAReadBackRegRequest StubFPGAReadBackRegRequest; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _StubFPGAReadBackRegRequest +{ + ProtobufCMessage base; + /* + * 0..2 + */ + protobuf_c_boolean has_fpgaid; + uint32_t fpgaid; + /* + * 16 bit + */ + protobuf_c_boolean has_value; + uint32_t value; +}; +#define STUB_FPGAREAD_BACK_REG_REQUEST__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&stub_fpgaread_back_reg_request__descriptor) \ + , 0, 0, 0, 0 } + + +/* StubFPGAReadBackRegRequest methods */ +void stub_fpgaread_back_reg_request__init + (StubFPGAReadBackRegRequest *message); +size_t stub_fpgaread_back_reg_request__get_packed_size + (const StubFPGAReadBackRegRequest *message); +size_t stub_fpgaread_back_reg_request__pack + (const StubFPGAReadBackRegRequest *message, + uint8_t *out); +size_t stub_fpgaread_back_reg_request__pack_to_buffer + (const StubFPGAReadBackRegRequest *message, + ProtobufCBuffer *buffer); +StubFPGAReadBackRegRequest * + stub_fpgaread_back_reg_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void stub_fpgaread_back_reg_request__free_unpacked + (StubFPGAReadBackRegRequest *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*StubFPGAReadBackRegRequest_Closure) + (const StubFPGAReadBackRegRequest *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor stub_fpgaread_back_reg_request__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StubFPGAReadBackRegRequest_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubFPGAReadBackRegResponse.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubFPGAReadBackRegResponse.pb-c.c new file mode 100644 index 000000000..e222b3b24 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubFPGAReadBackRegResponse.pb-c.c @@ -0,0 +1,132 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubFPGAReadBackRegResponse.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StubFPGAReadBackRegResponse.pb-c.h" +void stub_fpgaread_back_reg_response__init + (StubFPGAReadBackRegResponse *message) +{ + static const StubFPGAReadBackRegResponse init_value = STUB_FPGAREAD_BACK_REG_RESPONSE__INIT; + *message = init_value; +} +size_t stub_fpgaread_back_reg_response__get_packed_size + (const StubFPGAReadBackRegResponse *message) +{ + assert(message->base.descriptor == &stub_fpgaread_back_reg_response__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t stub_fpgaread_back_reg_response__pack + (const StubFPGAReadBackRegResponse *message, + uint8_t *out) +{ + assert(message->base.descriptor == &stub_fpgaread_back_reg_response__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t stub_fpgaread_back_reg_response__pack_to_buffer + (const StubFPGAReadBackRegResponse *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &stub_fpgaread_back_reg_response__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +StubFPGAReadBackRegResponse * + stub_fpgaread_back_reg_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (StubFPGAReadBackRegResponse *) + protobuf_c_message_unpack (&stub_fpgaread_back_reg_response__descriptor, + allocator, len, data); +} +void stub_fpgaread_back_reg_response__free_unpacked + (StubFPGAReadBackRegResponse *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &stub_fpgaread_back_reg_response__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor stub_fpgaread_back_reg_response__field_descriptors[4] = +{ + { + "FPGAId", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubFPGAReadBackRegResponse, has_fpgaid), + offsetof(StubFPGAReadBackRegResponse, fpgaid), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "ReadBackValue", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubFPGAReadBackRegResponse, has_readbackvalue), + offsetof(StubFPGAReadBackRegResponse, readbackvalue), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Status", + 4, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(StubFPGAReadBackRegResponse, status), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "StatusWord", + 5, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubFPGAReadBackRegResponse, has_statusword), + offsetof(StubFPGAReadBackRegResponse, statusword), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned stub_fpgaread_back_reg_response__field_indices_by_name[] = { + 0, /* field[0] = FPGAId */ + 1, /* field[1] = ReadBackValue */ + 2, /* field[2] = Status */ + 3, /* field[3] = StatusWord */ +}; +static const ProtobufCIntRange stub_fpgaread_back_reg_response__number_ranges[2 + 1] = +{ + { 1, 0 }, + { 4, 2 }, + { 0, 4 } +}; +const ProtobufCMessageDescriptor stub_fpgaread_back_reg_response__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "StubFPGAReadBackRegResponse", + "StubFPGAReadBackRegResponse", + "StubFPGAReadBackRegResponse", + "", + sizeof(StubFPGAReadBackRegResponse), + 4, + stub_fpgaread_back_reg_response__field_descriptors, + stub_fpgaread_back_reg_response__field_indices_by_name, + 2, stub_fpgaread_back_reg_response__number_ranges, + (ProtobufCMessageInit) stub_fpgaread_back_reg_response__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubFPGAReadBackRegResponse.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubFPGAReadBackRegResponse.pb-c.h new file mode 100644 index 000000000..234017433 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubFPGAReadBackRegResponse.pb-c.h @@ -0,0 +1,89 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubFPGAReadBackRegResponse.proto */ + +#ifndef PROTOBUF_C_StubFPGAReadBackRegResponse_2eproto__INCLUDED +#define PROTOBUF_C_StubFPGAReadBackRegResponse_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _StubFPGAReadBackRegResponse StubFPGAReadBackRegResponse; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _StubFPGAReadBackRegResponse +{ + ProtobufCMessage base; + /* + * 0..2 + */ + protobuf_c_boolean has_fpgaid; + uint32_t fpgaid; + /* + * 16 bit + */ + protobuf_c_boolean has_readbackvalue; + uint32_t readbackvalue; + /* + * Passed/Failed + */ + char *status; + /* + * Error number/bit when the status is Failed + */ + protobuf_c_boolean has_statusword; + uint32_t statusword; +}; +#define STUB_FPGAREAD_BACK_REG_RESPONSE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&stub_fpgaread_back_reg_response__descriptor) \ + , 0, 0, 0, 0, NULL, 0, 0 } + + +/* StubFPGAReadBackRegResponse methods */ +void stub_fpgaread_back_reg_response__init + (StubFPGAReadBackRegResponse *message); +size_t stub_fpgaread_back_reg_response__get_packed_size + (const StubFPGAReadBackRegResponse *message); +size_t stub_fpgaread_back_reg_response__pack + (const StubFPGAReadBackRegResponse *message, + uint8_t *out); +size_t stub_fpgaread_back_reg_response__pack_to_buffer + (const StubFPGAReadBackRegResponse *message, + ProtobufCBuffer *buffer); +StubFPGAReadBackRegResponse * + stub_fpgaread_back_reg_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void stub_fpgaread_back_reg_response__free_unpacked + (StubFPGAReadBackRegResponse *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*StubFPGAReadBackRegResponse_Closure) + (const StubFPGAReadBackRegResponse *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor stub_fpgaread_back_reg_response__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StubFPGAReadBackRegResponse_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubFPGAReadVersionRequest.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubFPGAReadVersionRequest.pb-c.c new file mode 100644 index 000000000..5381c462a --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubFPGAReadVersionRequest.pb-c.c @@ -0,0 +1,92 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubFPGAReadVersionRequest.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StubFPGAReadVersionRequest.pb-c.h" +void stub_fpgaread_version_request__init + (StubFPGAReadVersionRequest *message) +{ + static const StubFPGAReadVersionRequest init_value = STUB_FPGAREAD_VERSION_REQUEST__INIT; + *message = init_value; +} +size_t stub_fpgaread_version_request__get_packed_size + (const StubFPGAReadVersionRequest *message) +{ + assert(message->base.descriptor == &stub_fpgaread_version_request__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t stub_fpgaread_version_request__pack + (const StubFPGAReadVersionRequest *message, + uint8_t *out) +{ + assert(message->base.descriptor == &stub_fpgaread_version_request__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t stub_fpgaread_version_request__pack_to_buffer + (const StubFPGAReadVersionRequest *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &stub_fpgaread_version_request__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +StubFPGAReadVersionRequest * + stub_fpgaread_version_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (StubFPGAReadVersionRequest *) + protobuf_c_message_unpack (&stub_fpgaread_version_request__descriptor, + allocator, len, data); +} +void stub_fpgaread_version_request__free_unpacked + (StubFPGAReadVersionRequest *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &stub_fpgaread_version_request__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor stub_fpgaread_version_request__field_descriptors[1] = +{ + { + "FPGAId", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubFPGAReadVersionRequest, has_fpgaid), + offsetof(StubFPGAReadVersionRequest, fpgaid), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned stub_fpgaread_version_request__field_indices_by_name[] = { + 0, /* field[0] = FPGAId */ +}; +static const ProtobufCIntRange stub_fpgaread_version_request__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor stub_fpgaread_version_request__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "StubFPGAReadVersionRequest", + "StubFPGAReadVersionRequest", + "StubFPGAReadVersionRequest", + "", + sizeof(StubFPGAReadVersionRequest), + 1, + stub_fpgaread_version_request__field_descriptors, + stub_fpgaread_version_request__field_indices_by_name, + 1, stub_fpgaread_version_request__number_ranges, + (ProtobufCMessageInit) stub_fpgaread_version_request__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubFPGAReadVersionRequest.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubFPGAReadVersionRequest.pb-c.h new file mode 100644 index 000000000..54db77bad --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubFPGAReadVersionRequest.pb-c.h @@ -0,0 +1,75 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubFPGAReadVersionRequest.proto */ + +#ifndef PROTOBUF_C_StubFPGAReadVersionRequest_2eproto__INCLUDED +#define PROTOBUF_C_StubFPGAReadVersionRequest_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _StubFPGAReadVersionRequest StubFPGAReadVersionRequest; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _StubFPGAReadVersionRequest +{ + ProtobufCMessage base; + /* + * 0..2 + */ + protobuf_c_boolean has_fpgaid; + uint32_t fpgaid; +}; +#define STUB_FPGAREAD_VERSION_REQUEST__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&stub_fpgaread_version_request__descriptor) \ + , 0, 0 } + + +/* StubFPGAReadVersionRequest methods */ +void stub_fpgaread_version_request__init + (StubFPGAReadVersionRequest *message); +size_t stub_fpgaread_version_request__get_packed_size + (const StubFPGAReadVersionRequest *message); +size_t stub_fpgaread_version_request__pack + (const StubFPGAReadVersionRequest *message, + uint8_t *out); +size_t stub_fpgaread_version_request__pack_to_buffer + (const StubFPGAReadVersionRequest *message, + ProtobufCBuffer *buffer); +StubFPGAReadVersionRequest * + stub_fpgaread_version_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void stub_fpgaread_version_request__free_unpacked + (StubFPGAReadVersionRequest *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*StubFPGAReadVersionRequest_Closure) + (const StubFPGAReadVersionRequest *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor stub_fpgaread_version_request__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StubFPGAReadVersionRequest_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubFPGAReadVersionResponse.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubFPGAReadVersionResponse.pb-c.c new file mode 100644 index 000000000..79c25d9a5 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubFPGAReadVersionResponse.pb-c.c @@ -0,0 +1,170 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubFPGAReadVersionResponse.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StubFPGAReadVersionResponse.pb-c.h" +void stub_fpgaread_version_response__init + (StubFPGAReadVersionResponse *message) +{ + static const StubFPGAReadVersionResponse init_value = STUB_FPGAREAD_VERSION_RESPONSE__INIT; + *message = init_value; +} +size_t stub_fpgaread_version_response__get_packed_size + (const StubFPGAReadVersionResponse *message) +{ + assert(message->base.descriptor == &stub_fpgaread_version_response__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t stub_fpgaread_version_response__pack + (const StubFPGAReadVersionResponse *message, + uint8_t *out) +{ + assert(message->base.descriptor == &stub_fpgaread_version_response__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t stub_fpgaread_version_response__pack_to_buffer + (const StubFPGAReadVersionResponse *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &stub_fpgaread_version_response__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +StubFPGAReadVersionResponse * + stub_fpgaread_version_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (StubFPGAReadVersionResponse *) + protobuf_c_message_unpack (&stub_fpgaread_version_response__descriptor, + allocator, len, data); +} +void stub_fpgaread_version_response__free_unpacked + (StubFPGAReadVersionResponse *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &stub_fpgaread_version_response__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor stub_fpgaread_version_response__field_descriptors[7] = +{ + { + "FPGAId", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubFPGAReadVersionResponse, has_fpgaid), + offsetof(StubFPGAReadVersionResponse, fpgaid), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Day", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubFPGAReadVersionResponse, has_day), + offsetof(StubFPGAReadVersionResponse, day), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Month", + 3, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubFPGAReadVersionResponse, has_month), + offsetof(StubFPGAReadVersionResponse, month), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Year", + 4, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubFPGAReadVersionResponse, has_year), + offsetof(StubFPGAReadVersionResponse, year), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Ver_num", + 5, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubFPGAReadVersionResponse, has_ver_num), + offsetof(StubFPGAReadVersionResponse, ver_num), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Status", + 6, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(StubFPGAReadVersionResponse, status), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "StatusWord", + 7, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubFPGAReadVersionResponse, has_statusword), + offsetof(StubFPGAReadVersionResponse, statusword), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned stub_fpgaread_version_response__field_indices_by_name[] = { + 1, /* field[1] = Day */ + 0, /* field[0] = FPGAId */ + 2, /* field[2] = Month */ + 5, /* field[5] = Status */ + 6, /* field[6] = StatusWord */ + 4, /* field[4] = Ver_num */ + 3, /* field[3] = Year */ +}; +static const ProtobufCIntRange stub_fpgaread_version_response__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 7 } +}; +const ProtobufCMessageDescriptor stub_fpgaread_version_response__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "StubFPGAReadVersionResponse", + "StubFPGAReadVersionResponse", + "StubFPGAReadVersionResponse", + "", + sizeof(StubFPGAReadVersionResponse), + 7, + stub_fpgaread_version_response__field_descriptors, + stub_fpgaread_version_response__field_indices_by_name, + 1, stub_fpgaread_version_response__number_ranges, + (ProtobufCMessageInit) stub_fpgaread_version_response__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubFPGAReadVersionResponse.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubFPGAReadVersionResponse.pb-c.h new file mode 100644 index 000000000..360f7faac --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubFPGAReadVersionResponse.pb-c.h @@ -0,0 +1,92 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubFPGAReadVersionResponse.proto */ + +#ifndef PROTOBUF_C_StubFPGAReadVersionResponse_2eproto__INCLUDED +#define PROTOBUF_C_StubFPGAReadVersionResponse_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _StubFPGAReadVersionResponse StubFPGAReadVersionResponse; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _StubFPGAReadVersionResponse +{ + ProtobufCMessage base; + /* + * 0..2 + */ + protobuf_c_boolean has_fpgaid; + uint32_t fpgaid; + protobuf_c_boolean has_day; + uint32_t day; + protobuf_c_boolean has_month; + uint32_t month; + protobuf_c_boolean has_year; + uint32_t year; + protobuf_c_boolean has_ver_num; + uint32_t ver_num; + /* + * Passed/Failed + */ + char *status; + /* + * Error number/bit when the status is Failed + */ + protobuf_c_boolean has_statusword; + uint32_t statusword; +}; +#define STUB_FPGAREAD_VERSION_RESPONSE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&stub_fpgaread_version_response__descriptor) \ + , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, 0, 0 } + + +/* StubFPGAReadVersionResponse methods */ +void stub_fpgaread_version_response__init + (StubFPGAReadVersionResponse *message); +size_t stub_fpgaread_version_response__get_packed_size + (const StubFPGAReadVersionResponse *message); +size_t stub_fpgaread_version_response__pack + (const StubFPGAReadVersionResponse *message, + uint8_t *out); +size_t stub_fpgaread_version_response__pack_to_buffer + (const StubFPGAReadVersionResponse *message, + ProtobufCBuffer *buffer); +StubFPGAReadVersionResponse * + stub_fpgaread_version_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void stub_fpgaread_version_response__free_unpacked + (StubFPGAReadVersionResponse *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*StubFPGAReadVersionResponse_Closure) + (const StubFPGAReadVersionResponse *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor stub_fpgaread_version_response__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StubFPGAReadVersionResponse_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubHWVersionRequest.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubHWVersionRequest.pb-c.c new file mode 100644 index 000000000..fba567238 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubHWVersionRequest.pb-c.c @@ -0,0 +1,72 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubHWVersionRequest.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StubHWVersionRequest.pb-c.h" +void stub_hwversion_request__init + (StubHWVersionRequest *message) +{ + static const StubHWVersionRequest init_value = STUB_HWVERSION_REQUEST__INIT; + *message = init_value; +} +size_t stub_hwversion_request__get_packed_size + (const StubHWVersionRequest *message) +{ + assert(message->base.descriptor == &stub_hwversion_request__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t stub_hwversion_request__pack + (const StubHWVersionRequest *message, + uint8_t *out) +{ + assert(message->base.descriptor == &stub_hwversion_request__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t stub_hwversion_request__pack_to_buffer + (const StubHWVersionRequest *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &stub_hwversion_request__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +StubHWVersionRequest * + stub_hwversion_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (StubHWVersionRequest *) + protobuf_c_message_unpack (&stub_hwversion_request__descriptor, + allocator, len, data); +} +void stub_hwversion_request__free_unpacked + (StubHWVersionRequest *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &stub_hwversion_request__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +#define stub_hwversion_request__field_descriptors NULL +#define stub_hwversion_request__field_indices_by_name NULL +#define stub_hwversion_request__number_ranges NULL +const ProtobufCMessageDescriptor stub_hwversion_request__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "StubHWVersionRequest", + "StubHWVersionRequest", + "StubHWVersionRequest", + "", + sizeof(StubHWVersionRequest), + 0, + stub_hwversion_request__field_descriptors, + stub_hwversion_request__field_indices_by_name, + 0, stub_hwversion_request__number_ranges, + (ProtobufCMessageInit) stub_hwversion_request__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubHWVersionRequest.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubHWVersionRequest.pb-c.h new file mode 100644 index 000000000..017aa8cd2 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubHWVersionRequest.pb-c.h @@ -0,0 +1,70 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubHWVersionRequest.proto */ + +#ifndef PROTOBUF_C_StubHWVersionRequest_2eproto__INCLUDED +#define PROTOBUF_C_StubHWVersionRequest_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _StubHWVersionRequest StubHWVersionRequest; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _StubHWVersionRequest +{ + ProtobufCMessage base; +}; +#define STUB_HWVERSION_REQUEST__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&stub_hwversion_request__descriptor) \ + } + + +/* StubHWVersionRequest methods */ +void stub_hwversion_request__init + (StubHWVersionRequest *message); +size_t stub_hwversion_request__get_packed_size + (const StubHWVersionRequest *message); +size_t stub_hwversion_request__pack + (const StubHWVersionRequest *message, + uint8_t *out); +size_t stub_hwversion_request__pack_to_buffer + (const StubHWVersionRequest *message, + ProtobufCBuffer *buffer); +StubHWVersionRequest * + stub_hwversion_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void stub_hwversion_request__free_unpacked + (StubHWVersionRequest *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*StubHWVersionRequest_Closure) + (const StubHWVersionRequest *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor stub_hwversion_request__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StubHWVersionRequest_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubHWVersionResponse.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubHWVersionResponse.pb-c.c new file mode 100644 index 000000000..4aec291a0 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubHWVersionResponse.pb-c.c @@ -0,0 +1,131 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubHWVersionResponse.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StubHWVersionResponse.pb-c.h" +void stub_hwversion_response__init + (StubHWVersionResponse *message) +{ + static const StubHWVersionResponse init_value = STUB_HWVERSION_RESPONSE__INIT; + *message = init_value; +} +size_t stub_hwversion_response__get_packed_size + (const StubHWVersionResponse *message) +{ + assert(message->base.descriptor == &stub_hwversion_response__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t stub_hwversion_response__pack + (const StubHWVersionResponse *message, + uint8_t *out) +{ + assert(message->base.descriptor == &stub_hwversion_response__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t stub_hwversion_response__pack_to_buffer + (const StubHWVersionResponse *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &stub_hwversion_response__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +StubHWVersionResponse * + stub_hwversion_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (StubHWVersionResponse *) + protobuf_c_message_unpack (&stub_hwversion_response__descriptor, + allocator, len, data); +} +void stub_hwversion_response__free_unpacked + (StubHWVersionResponse *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &stub_hwversion_response__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor stub_hwversion_response__field_descriptors[4] = +{ + { + "BRD_ID", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubHWVersionResponse, has_brd_id), + offsetof(StubHWVersionResponse, brd_id), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "ASSY_ID", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubHWVersionResponse, has_assy_id), + offsetof(StubHWVersionResponse, assy_id), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Status", + 3, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(StubHWVersionResponse, status), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "StatusWord", + 4, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubHWVersionResponse, has_statusword), + offsetof(StubHWVersionResponse, statusword), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned stub_hwversion_response__field_indices_by_name[] = { + 1, /* field[1] = ASSY_ID */ + 0, /* field[0] = BRD_ID */ + 2, /* field[2] = Status */ + 3, /* field[3] = StatusWord */ +}; +static const ProtobufCIntRange stub_hwversion_response__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 4 } +}; +const ProtobufCMessageDescriptor stub_hwversion_response__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "StubHWVersionResponse", + "StubHWVersionResponse", + "StubHWVersionResponse", + "", + sizeof(StubHWVersionResponse), + 4, + stub_hwversion_response__field_descriptors, + stub_hwversion_response__field_indices_by_name, + 1, stub_hwversion_response__number_ranges, + (ProtobufCMessageInit) stub_hwversion_response__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubHWVersionResponse.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubHWVersionResponse.pb-c.h new file mode 100644 index 000000000..349ff1452 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubHWVersionResponse.pb-c.h @@ -0,0 +1,83 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubHWVersionResponse.proto */ + +#ifndef PROTOBUF_C_StubHWVersionResponse_2eproto__INCLUDED +#define PROTOBUF_C_StubHWVersionResponse_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _StubHWVersionResponse StubHWVersionResponse; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _StubHWVersionResponse +{ + ProtobufCMessage base; + protobuf_c_boolean has_brd_id; + uint32_t brd_id; + protobuf_c_boolean has_assy_id; + uint32_t assy_id; + /* + * Passed/Failed + */ + char *status; + /* + * Error number/bit when the status is Failed + */ + protobuf_c_boolean has_statusword; + uint32_t statusword; +}; +#define STUB_HWVERSION_RESPONSE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&stub_hwversion_response__descriptor) \ + , 0, 0, 0, 0, NULL, 0, 0 } + + +/* StubHWVersionResponse methods */ +void stub_hwversion_response__init + (StubHWVersionResponse *message); +size_t stub_hwversion_response__get_packed_size + (const StubHWVersionResponse *message); +size_t stub_hwversion_response__pack + (const StubHWVersionResponse *message, + uint8_t *out); +size_t stub_hwversion_response__pack_to_buffer + (const StubHWVersionResponse *message, + ProtobufCBuffer *buffer); +StubHWVersionResponse * + stub_hwversion_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void stub_hwversion_response__free_unpacked + (StubHWVersionResponse *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*StubHWVersionResponse_Closure) + (const StubHWVersionResponse *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor stub_hwversion_response__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StubHWVersionResponse_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubL6470DriverRequest.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubL6470DriverRequest.pb-c.c new file mode 100644 index 000000000..3771b60a9 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubL6470DriverRequest.pb-c.c @@ -0,0 +1,339 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubL6470DriverRequest.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StubL6470DriverRequest.pb-c.h" +void stub_l6470_driver_request__init + (StubL6470DriverRequest *message) +{ + static const StubL6470DriverRequest init_value = STUB_L6470_DRIVER_REQUEST__INIT; + *message = init_value; +} +size_t stub_l6470_driver_request__get_packed_size + (const StubL6470DriverRequest *message) +{ + assert(message->base.descriptor == &stub_l6470_driver_request__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t stub_l6470_driver_request__pack + (const StubL6470DriverRequest *message, + uint8_t *out) +{ + assert(message->base.descriptor == &stub_l6470_driver_request__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t stub_l6470_driver_request__pack_to_buffer + (const StubL6470DriverRequest *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &stub_l6470_driver_request__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +StubL6470DriverRequest * + stub_l6470_driver_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (StubL6470DriverRequest *) + protobuf_c_message_unpack (&stub_l6470_driver_request__descriptor, + allocator, len, data); +} +void stub_l6470_driver_request__free_unpacked + (StubL6470DriverRequest *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &stub_l6470_driver_request__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor stub_l6470_driver_request__field_descriptors[20] = +{ + { + "Run_Value", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubL6470DriverRequest, has_run_value), + offsetof(StubL6470DriverRequest, run_value), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Mov_Value", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubL6470DriverRequest, has_mov_value), + offsetof(StubL6470DriverRequest, mov_value), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Direction", + 3, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubL6470DriverRequest, has_direction), + offsetof(StubL6470DriverRequest, direction), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Time_2_Change_Direction", + 4, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubL6470DriverRequest, has_time_2_change_direction), + offsetof(StubL6470DriverRequest, time_2_change_direction), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Display_Tx_ON_LCD", + 5, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubL6470DriverRequest, has_display_tx_on_lcd), + offsetof(StubL6470DriverRequest, display_tx_on_lcd), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Display_Rx_on_LCD", + 6, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubL6470DriverRequest, has_display_rx_on_lcd), + offsetof(StubL6470DriverRequest, display_rx_on_lcd), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Init_MicroStep", + 7, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubL6470DriverRequest, has_init_microstep), + offsetof(StubL6470DriverRequest, init_microstep), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Init_Acc", + 8, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubL6470DriverRequest, has_init_acc), + offsetof(StubL6470DriverRequest, init_acc), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Init_Dec", + 9, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubL6470DriverRequest, has_init_dec), + offsetof(StubL6470DriverRequest, init_dec), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "TestBool_1", + 10, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubL6470DriverRequest, has_testbool_1), + offsetof(StubL6470DriverRequest, testbool_1), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "TestBool_2", + 11, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubL6470DriverRequest, has_testbool_2), + offsetof(StubL6470DriverRequest, testbool_2), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "TestBool_3", + 12, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubL6470DriverRequest, has_testbool_3), + offsetof(StubL6470DriverRequest, testbool_3), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "TestBool_4", + 13, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubL6470DriverRequest, has_testbool_4), + offsetof(StubL6470DriverRequest, testbool_4), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "TestBool_5", + 14, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubL6470DriverRequest, has_testbool_5), + offsetof(StubL6470DriverRequest, testbool_5), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "TestUint32_1", + 15, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubL6470DriverRequest, has_testuint32_1), + offsetof(StubL6470DriverRequest, testuint32_1), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "TestUint32_2", + 16, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubL6470DriverRequest, has_testuint32_2), + offsetof(StubL6470DriverRequest, testuint32_2), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "TestUint32_3", + 17, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubL6470DriverRequest, has_testuint32_3), + offsetof(StubL6470DriverRequest, testuint32_3), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "TestUint32_4", + 18, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubL6470DriverRequest, has_testuint32_4), + offsetof(StubL6470DriverRequest, testuint32_4), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "TestUint32_5", + 19, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubL6470DriverRequest, has_testuint32_5), + offsetof(StubL6470DriverRequest, testuint32_5), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "TestUint32_6", + 20, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubL6470DriverRequest, has_testuint32_6), + offsetof(StubL6470DriverRequest, testuint32_6), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned stub_l6470_driver_request__field_indices_by_name[] = { + 2, /* field[2] = Direction */ + 5, /* field[5] = Display_Rx_on_LCD */ + 4, /* field[4] = Display_Tx_ON_LCD */ + 7, /* field[7] = Init_Acc */ + 8, /* field[8] = Init_Dec */ + 6, /* field[6] = Init_MicroStep */ + 1, /* field[1] = Mov_Value */ + 0, /* field[0] = Run_Value */ + 9, /* field[9] = TestBool_1 */ + 10, /* field[10] = TestBool_2 */ + 11, /* field[11] = TestBool_3 */ + 12, /* field[12] = TestBool_4 */ + 13, /* field[13] = TestBool_5 */ + 14, /* field[14] = TestUint32_1 */ + 15, /* field[15] = TestUint32_2 */ + 16, /* field[16] = TestUint32_3 */ + 17, /* field[17] = TestUint32_4 */ + 18, /* field[18] = TestUint32_5 */ + 19, /* field[19] = TestUint32_6 */ + 3, /* field[3] = Time_2_Change_Direction */ +}; +static const ProtobufCIntRange stub_l6470_driver_request__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 20 } +}; +const ProtobufCMessageDescriptor stub_l6470_driver_request__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "StubL6470DriverRequest", + "StubL6470DriverRequest", + "StubL6470DriverRequest", + "", + sizeof(StubL6470DriverRequest), + 20, + stub_l6470_driver_request__field_descriptors, + stub_l6470_driver_request__field_indices_by_name, + 1, stub_l6470_driver_request__number_ranges, + (ProtobufCMessageInit) stub_l6470_driver_request__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubL6470DriverRequest.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubL6470DriverRequest.pb-c.h new file mode 100644 index 000000000..ee4e261c9 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubL6470DriverRequest.pb-c.h @@ -0,0 +1,110 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubL6470DriverRequest.proto */ + +#ifndef PROTOBUF_C_StubL6470DriverRequest_2eproto__INCLUDED +#define PROTOBUF_C_StubL6470DriverRequest_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _StubL6470DriverRequest StubL6470DriverRequest; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _StubL6470DriverRequest +{ + ProtobufCMessage base; + protobuf_c_boolean has_run_value; + uint32_t run_value; + protobuf_c_boolean has_mov_value; + uint32_t mov_value; + protobuf_c_boolean has_direction; + protobuf_c_boolean direction; + protobuf_c_boolean has_time_2_change_direction; + uint32_t time_2_change_direction; + protobuf_c_boolean has_display_tx_on_lcd; + protobuf_c_boolean display_tx_on_lcd; + protobuf_c_boolean has_display_rx_on_lcd; + protobuf_c_boolean display_rx_on_lcd; + protobuf_c_boolean has_init_microstep; + uint32_t init_microstep; + protobuf_c_boolean has_init_acc; + uint32_t init_acc; + protobuf_c_boolean has_init_dec; + uint32_t init_dec; + protobuf_c_boolean has_testbool_1; + protobuf_c_boolean testbool_1; + protobuf_c_boolean has_testbool_2; + protobuf_c_boolean testbool_2; + protobuf_c_boolean has_testbool_3; + protobuf_c_boolean testbool_3; + protobuf_c_boolean has_testbool_4; + protobuf_c_boolean testbool_4; + protobuf_c_boolean has_testbool_5; + protobuf_c_boolean testbool_5; + protobuf_c_boolean has_testuint32_1; + uint32_t testuint32_1; + protobuf_c_boolean has_testuint32_2; + uint32_t testuint32_2; + protobuf_c_boolean has_testuint32_3; + uint32_t testuint32_3; + protobuf_c_boolean has_testuint32_4; + uint32_t testuint32_4; + protobuf_c_boolean has_testuint32_5; + uint32_t testuint32_5; + protobuf_c_boolean has_testuint32_6; + uint32_t testuint32_6; +}; +#define STUB_L6470_DRIVER_REQUEST__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&stub_l6470_driver_request__descriptor) \ + , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } + + +/* StubL6470DriverRequest methods */ +void stub_l6470_driver_request__init + (StubL6470DriverRequest *message); +size_t stub_l6470_driver_request__get_packed_size + (const StubL6470DriverRequest *message); +size_t stub_l6470_driver_request__pack + (const StubL6470DriverRequest *message, + uint8_t *out); +size_t stub_l6470_driver_request__pack_to_buffer + (const StubL6470DriverRequest *message, + ProtobufCBuffer *buffer); +StubL6470DriverRequest * + stub_l6470_driver_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void stub_l6470_driver_request__free_unpacked + (StubL6470DriverRequest *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*StubL6470DriverRequest_Closure) + (const StubL6470DriverRequest *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor stub_l6470_driver_request__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StubL6470DriverRequest_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubL6470DriverResponse.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubL6470DriverResponse.pb-c.c new file mode 100644 index 000000000..b129bb930 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubL6470DriverResponse.pb-c.c @@ -0,0 +1,274 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubL6470DriverResponse.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StubL6470DriverResponse.pb-c.h" +void stub_l6470_driver_response__init + (StubL6470DriverResponse *message) +{ + static const StubL6470DriverResponse init_value = STUB_L6470_DRIVER_RESPONSE__INIT; + *message = init_value; +} +size_t stub_l6470_driver_response__get_packed_size + (const StubL6470DriverResponse *message) +{ + assert(message->base.descriptor == &stub_l6470_driver_response__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t stub_l6470_driver_response__pack + (const StubL6470DriverResponse *message, + uint8_t *out) +{ + assert(message->base.descriptor == &stub_l6470_driver_response__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t stub_l6470_driver_response__pack_to_buffer + (const StubL6470DriverResponse *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &stub_l6470_driver_response__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +StubL6470DriverResponse * + stub_l6470_driver_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (StubL6470DriverResponse *) + protobuf_c_message_unpack (&stub_l6470_driver_response__descriptor, + allocator, len, data); +} +void stub_l6470_driver_response__free_unpacked + (StubL6470DriverResponse *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &stub_l6470_driver_response__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor stub_l6470_driver_response__field_descriptors[15] = +{ + { + "Run_Value", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubL6470DriverResponse, has_run_value), + offsetof(StubL6470DriverResponse, run_value), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Mov_Value", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubL6470DriverResponse, has_mov_value), + offsetof(StubL6470DriverResponse, mov_value), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "TestBool_1", + 3, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubL6470DriverResponse, has_testbool_1), + offsetof(StubL6470DriverResponse, testbool_1), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "TestBool_2", + 4, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubL6470DriverResponse, has_testbool_2), + offsetof(StubL6470DriverResponse, testbool_2), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "TestBool_3", + 5, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubL6470DriverResponse, has_testbool_3), + offsetof(StubL6470DriverResponse, testbool_3), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "TestBool_4", + 6, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubL6470DriverResponse, has_testbool_4), + offsetof(StubL6470DriverResponse, testbool_4), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "TestBool_5", + 7, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubL6470DriverResponse, has_testbool_5), + offsetof(StubL6470DriverResponse, testbool_5), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "TestUint32_1", + 8, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubL6470DriverResponse, has_testuint32_1), + offsetof(StubL6470DriverResponse, testuint32_1), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "TestUint32_2", + 9, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubL6470DriverResponse, has_testuint32_2), + offsetof(StubL6470DriverResponse, testuint32_2), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "TestUint32_3", + 10, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubL6470DriverResponse, has_testuint32_3), + offsetof(StubL6470DriverResponse, testuint32_3), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "TestUint32_4", + 11, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubL6470DriverResponse, has_testuint32_4), + offsetof(StubL6470DriverResponse, testuint32_4), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "TestUint32_5", + 12, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubL6470DriverResponse, has_testuint32_5), + offsetof(StubL6470DriverResponse, testuint32_5), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "TestUint32_6", + 13, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubL6470DriverResponse, has_testuint32_6), + offsetof(StubL6470DriverResponse, testuint32_6), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Status", + 14, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_STRING, + 0, /* quantifier_offset */ + offsetof(StubL6470DriverResponse, status), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "StatusWord", + 15, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubL6470DriverResponse, has_statusword), + offsetof(StubL6470DriverResponse, statusword), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned stub_l6470_driver_response__field_indices_by_name[] = { + 1, /* field[1] = Mov_Value */ + 0, /* field[0] = Run_Value */ + 13, /* field[13] = Status */ + 14, /* field[14] = StatusWord */ + 2, /* field[2] = TestBool_1 */ + 3, /* field[3] = TestBool_2 */ + 4, /* field[4] = TestBool_3 */ + 5, /* field[5] = TestBool_4 */ + 6, /* field[6] = TestBool_5 */ + 7, /* field[7] = TestUint32_1 */ + 8, /* field[8] = TestUint32_2 */ + 9, /* field[9] = TestUint32_3 */ + 10, /* field[10] = TestUint32_4 */ + 11, /* field[11] = TestUint32_5 */ + 12, /* field[12] = TestUint32_6 */ +}; +static const ProtobufCIntRange stub_l6470_driver_response__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 15 } +}; +const ProtobufCMessageDescriptor stub_l6470_driver_response__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "StubL6470DriverResponse", + "StubL6470DriverResponse", + "StubL6470DriverResponse", + "", + sizeof(StubL6470DriverResponse), + 15, + stub_l6470_driver_response__field_descriptors, + stub_l6470_driver_response__field_indices_by_name, + 1, stub_l6470_driver_response__number_ranges, + (ProtobufCMessageInit) stub_l6470_driver_response__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubL6470DriverResponse.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubL6470DriverResponse.pb-c.h new file mode 100644 index 000000000..ca18da2a9 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubL6470DriverResponse.pb-c.h @@ -0,0 +1,105 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubL6470DriverResponse.proto */ + +#ifndef PROTOBUF_C_StubL6470DriverResponse_2eproto__INCLUDED +#define PROTOBUF_C_StubL6470DriverResponse_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _StubL6470DriverResponse StubL6470DriverResponse; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _StubL6470DriverResponse +{ + ProtobufCMessage base; + protobuf_c_boolean has_run_value; + uint32_t run_value; + protobuf_c_boolean has_mov_value; + uint32_t mov_value; + protobuf_c_boolean has_testbool_1; + protobuf_c_boolean testbool_1; + protobuf_c_boolean has_testbool_2; + protobuf_c_boolean testbool_2; + protobuf_c_boolean has_testbool_3; + protobuf_c_boolean testbool_3; + protobuf_c_boolean has_testbool_4; + protobuf_c_boolean testbool_4; + protobuf_c_boolean has_testbool_5; + protobuf_c_boolean testbool_5; + protobuf_c_boolean has_testuint32_1; + uint32_t testuint32_1; + protobuf_c_boolean has_testuint32_2; + uint32_t testuint32_2; + protobuf_c_boolean has_testuint32_3; + uint32_t testuint32_3; + protobuf_c_boolean has_testuint32_4; + uint32_t testuint32_4; + protobuf_c_boolean has_testuint32_5; + uint32_t testuint32_5; + protobuf_c_boolean has_testuint32_6; + uint32_t testuint32_6; + /* + * Passed/Failed + */ + char *status; + /* + * Error number/bit when the status is Failed + */ + protobuf_c_boolean has_statusword; + uint32_t statusword; +}; +#define STUB_L6470_DRIVER_RESPONSE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&stub_l6470_driver_response__descriptor) \ + , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, 0, 0 } + + +/* StubL6470DriverResponse methods */ +void stub_l6470_driver_response__init + (StubL6470DriverResponse *message); +size_t stub_l6470_driver_response__get_packed_size + (const StubL6470DriverResponse *message); +size_t stub_l6470_driver_response__pack + (const StubL6470DriverResponse *message, + uint8_t *out); +size_t stub_l6470_driver_response__pack_to_buffer + (const StubL6470DriverResponse *message, + ProtobufCBuffer *buffer); +StubL6470DriverResponse * + stub_l6470_driver_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void stub_l6470_driver_response__free_unpacked + (StubL6470DriverResponse *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*StubL6470DriverResponse_Closure) + (const StubL6470DriverResponse *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor stub_l6470_driver_response__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StubL6470DriverResponse_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorInitRequest.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorInitRequest.pb-c.c new file mode 100644 index 000000000..0f01b16d4 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorInitRequest.pb-c.c @@ -0,0 +1,196 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubMotorInitRequest.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StubMotorInitRequest.pb-c.h" +void stub_motor_init_request__init + (StubMotorInitRequest *message) +{ + static const StubMotorInitRequest init_value = STUB_MOTOR_INIT_REQUEST__INIT; + *message = init_value; +} +size_t stub_motor_init_request__get_packed_size + (const StubMotorInitRequest *message) +{ + assert(message->base.descriptor == &stub_motor_init_request__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t stub_motor_init_request__pack + (const StubMotorInitRequest *message, + uint8_t *out) +{ + assert(message->base.descriptor == &stub_motor_init_request__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t stub_motor_init_request__pack_to_buffer + (const StubMotorInitRequest *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &stub_motor_init_request__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +StubMotorInitRequest * + stub_motor_init_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (StubMotorInitRequest *) + protobuf_c_message_unpack (&stub_motor_init_request__descriptor, + allocator, len, data); +} +void stub_motor_init_request__free_unpacked + (StubMotorInitRequest *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &stub_motor_init_request__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor stub_motor_init_request__field_descriptors[9] = +{ + { + "Motor_ID", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubMotorInitRequest, has_motor_id), + offsetof(StubMotorInitRequest, motor_id), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Micro_Steps", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubMotorInitRequest, has_micro_steps), + offsetof(StubMotorInitRequest, micro_steps), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Set_Micro_Steps", + 3, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubMotorInitRequest, has_set_micro_steps), + offsetof(StubMotorInitRequest, set_micro_steps), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "ACC", + 4, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubMotorInitRequest, has_acc), + offsetof(StubMotorInitRequest, acc), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Set_ACC", + 5, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubMotorInitRequest, has_set_acc), + offsetof(StubMotorInitRequest, set_acc), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "DEC", + 6, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubMotorInitRequest, has_dec), + offsetof(StubMotorInitRequest, dec), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Set_Dec", + 7, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubMotorInitRequest, has_set_dec), + offsetof(StubMotorInitRequest, set_dec), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Max_Speed", + 8, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubMotorInitRequest, has_max_speed), + offsetof(StubMotorInitRequest, max_speed), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Set_Max_Speed", + 9, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubMotorInitRequest, has_set_max_speed), + offsetof(StubMotorInitRequest, set_max_speed), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned stub_motor_init_request__field_indices_by_name[] = { + 3, /* field[3] = ACC */ + 5, /* field[5] = DEC */ + 7, /* field[7] = Max_Speed */ + 1, /* field[1] = Micro_Steps */ + 0, /* field[0] = Motor_ID */ + 4, /* field[4] = Set_ACC */ + 6, /* field[6] = Set_Dec */ + 8, /* field[8] = Set_Max_Speed */ + 2, /* field[2] = Set_Micro_Steps */ +}; +static const ProtobufCIntRange stub_motor_init_request__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 9 } +}; +const ProtobufCMessageDescriptor stub_motor_init_request__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "StubMotorInitRequest", + "StubMotorInitRequest", + "StubMotorInitRequest", + "", + sizeof(StubMotorInitRequest), + 9, + stub_motor_init_request__field_descriptors, + stub_motor_init_request__field_indices_by_name, + 1, stub_motor_init_request__number_ranges, + (ProtobufCMessageInit) stub_motor_init_request__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorInitRequest.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorInitRequest.pb-c.h new file mode 100644 index 000000000..29b1f6036 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorInitRequest.pb-c.h @@ -0,0 +1,91 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubMotorInitRequest.proto */ + +#ifndef PROTOBUF_C_StubMotorInitRequest_2eproto__INCLUDED +#define PROTOBUF_C_StubMotorInitRequest_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _StubMotorInitRequest StubMotorInitRequest; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _StubMotorInitRequest +{ + ProtobufCMessage base; + protobuf_c_boolean has_motor_id; + uint32_t motor_id; + /* + * 1/2/4/8/16/32/64/128 + */ + protobuf_c_boolean has_micro_steps; + uint32_t micro_steps; + protobuf_c_boolean has_set_micro_steps; + protobuf_c_boolean set_micro_steps; + protobuf_c_boolean has_acc; + uint32_t acc; + protobuf_c_boolean has_set_acc; + protobuf_c_boolean set_acc; + protobuf_c_boolean has_dec; + uint32_t dec; + protobuf_c_boolean has_set_dec; + protobuf_c_boolean set_dec; + protobuf_c_boolean has_max_speed; + uint32_t max_speed; + protobuf_c_boolean has_set_max_speed; + protobuf_c_boolean set_max_speed; +}; +#define STUB_MOTOR_INIT_REQUEST__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&stub_motor_init_request__descriptor) \ + , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } + + +/* StubMotorInitRequest methods */ +void stub_motor_init_request__init + (StubMotorInitRequest *message); +size_t stub_motor_init_request__get_packed_size + (const StubMotorInitRequest *message); +size_t stub_motor_init_request__pack + (const StubMotorInitRequest *message, + uint8_t *out); +size_t stub_motor_init_request__pack_to_buffer + (const StubMotorInitRequest *message, + ProtobufCBuffer *buffer); +StubMotorInitRequest * + stub_motor_init_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void stub_motor_init_request__free_unpacked + (StubMotorInitRequest *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*StubMotorInitRequest_Closure) + (const StubMotorInitRequest *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor stub_motor_init_request__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StubMotorInitRequest_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorInitResponse.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorInitResponse.pb-c.c new file mode 100644 index 000000000..17c436fa3 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorInitResponse.pb-c.c @@ -0,0 +1,105 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubMotorInitResponse.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StubMotorInitResponse.pb-c.h" +void stub_motor_init_response__init + (StubMotorInitResponse *message) +{ + static const StubMotorInitResponse init_value = STUB_MOTOR_INIT_RESPONSE__INIT; + *message = init_value; +} +size_t stub_motor_init_response__get_packed_size + (const StubMotorInitResponse *message) +{ + assert(message->base.descriptor == &stub_motor_init_response__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t stub_motor_init_response__pack + (const StubMotorInitResponse *message, + uint8_t *out) +{ + assert(message->base.descriptor == &stub_motor_init_response__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t stub_motor_init_response__pack_to_buffer + (const StubMotorInitResponse *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &stub_motor_init_response__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +StubMotorInitResponse * + stub_motor_init_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (StubMotorInitResponse *) + protobuf_c_message_unpack (&stub_motor_init_response__descriptor, + allocator, len, data); +} +void stub_motor_init_response__free_unpacked + (StubMotorInitResponse *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &stub_motor_init_response__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor stub_motor_init_response__field_descriptors[2] = +{ + { + "Motor_ID", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubMotorInitResponse, has_motor_id), + offsetof(StubMotorInitResponse, motor_id), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Status", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubMotorInitResponse, has_status), + offsetof(StubMotorInitResponse, status), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned stub_motor_init_response__field_indices_by_name[] = { + 0, /* field[0] = Motor_ID */ + 1, /* field[1] = Status */ +}; +static const ProtobufCIntRange stub_motor_init_response__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor stub_motor_init_response__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "StubMotorInitResponse", + "StubMotorInitResponse", + "StubMotorInitResponse", + "", + sizeof(StubMotorInitResponse), + 2, + stub_motor_init_response__field_descriptors, + stub_motor_init_response__field_indices_by_name, + 1, stub_motor_init_response__number_ranges, + (ProtobufCMessageInit) stub_motor_init_response__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorInitResponse.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorInitResponse.pb-c.h new file mode 100644 index 000000000..c4f825818 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorInitResponse.pb-c.h @@ -0,0 +1,74 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubMotorInitResponse.proto */ + +#ifndef PROTOBUF_C_StubMotorInitResponse_2eproto__INCLUDED +#define PROTOBUF_C_StubMotorInitResponse_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _StubMotorInitResponse StubMotorInitResponse; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _StubMotorInitResponse +{ + ProtobufCMessage base; + protobuf_c_boolean has_motor_id; + uint32_t motor_id; + protobuf_c_boolean has_status; + uint32_t status; +}; +#define STUB_MOTOR_INIT_RESPONSE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&stub_motor_init_response__descriptor) \ + , 0, 0, 0, 0 } + + +/* StubMotorInitResponse methods */ +void stub_motor_init_response__init + (StubMotorInitResponse *message); +size_t stub_motor_init_response__get_packed_size + (const StubMotorInitResponse *message); +size_t stub_motor_init_response__pack + (const StubMotorInitResponse *message, + uint8_t *out); +size_t stub_motor_init_response__pack_to_buffer + (const StubMotorInitResponse *message, + ProtobufCBuffer *buffer); +StubMotorInitResponse * + stub_motor_init_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void stub_motor_init_response__free_unpacked + (StubMotorInitResponse *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*StubMotorInitResponse_Closure) + (const StubMotorInitResponse *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor stub_motor_init_response__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StubMotorInitResponse_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorMovRequest.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorMovRequest.pb-c.c new file mode 100644 index 000000000..ed5152830 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorMovRequest.pb-c.c @@ -0,0 +1,118 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubMotorMovRequest.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StubMotorMovRequest.pb-c.h" +void stub_motor_mov_request__init + (StubMotorMovRequest *message) +{ + static const StubMotorMovRequest init_value = STUB_MOTOR_MOV_REQUEST__INIT; + *message = init_value; +} +size_t stub_motor_mov_request__get_packed_size + (const StubMotorMovRequest *message) +{ + assert(message->base.descriptor == &stub_motor_mov_request__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t stub_motor_mov_request__pack + (const StubMotorMovRequest *message, + uint8_t *out) +{ + assert(message->base.descriptor == &stub_motor_mov_request__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t stub_motor_mov_request__pack_to_buffer + (const StubMotorMovRequest *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &stub_motor_mov_request__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +StubMotorMovRequest * + stub_motor_mov_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (StubMotorMovRequest *) + protobuf_c_message_unpack (&stub_motor_mov_request__descriptor, + allocator, len, data); +} +void stub_motor_mov_request__free_unpacked + (StubMotorMovRequest *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &stub_motor_mov_request__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor stub_motor_mov_request__field_descriptors[3] = +{ + { + "Motor_ID", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubMotorMovRequest, has_motor_id), + offsetof(StubMotorMovRequest, motor_id), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Direction", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubMotorMovRequest, has_direction), + offsetof(StubMotorMovRequest, direction), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Position", + 3, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubMotorMovRequest, has_position), + offsetof(StubMotorMovRequest, position), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned stub_motor_mov_request__field_indices_by_name[] = { + 1, /* field[1] = Direction */ + 0, /* field[0] = Motor_ID */ + 2, /* field[2] = Position */ +}; +static const ProtobufCIntRange stub_motor_mov_request__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 3 } +}; +const ProtobufCMessageDescriptor stub_motor_mov_request__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "StubMotorMovRequest", + "StubMotorMovRequest", + "StubMotorMovRequest", + "", + sizeof(StubMotorMovRequest), + 3, + stub_motor_mov_request__field_descriptors, + stub_motor_mov_request__field_indices_by_name, + 1, stub_motor_mov_request__number_ranges, + (ProtobufCMessageInit) stub_motor_mov_request__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorMovRequest.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorMovRequest.pb-c.h new file mode 100644 index 000000000..8957b336a --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorMovRequest.pb-c.h @@ -0,0 +1,76 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubMotorMovRequest.proto */ + +#ifndef PROTOBUF_C_StubMotorMovRequest_2eproto__INCLUDED +#define PROTOBUF_C_StubMotorMovRequest_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _StubMotorMovRequest StubMotorMovRequest; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _StubMotorMovRequest +{ + ProtobufCMessage base; + protobuf_c_boolean has_motor_id; + uint32_t motor_id; + protobuf_c_boolean has_direction; + protobuf_c_boolean direction; + protobuf_c_boolean has_position; + uint32_t position; +}; +#define STUB_MOTOR_MOV_REQUEST__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&stub_motor_mov_request__descriptor) \ + , 0, 0, 0, 0, 0, 0 } + + +/* StubMotorMovRequest methods */ +void stub_motor_mov_request__init + (StubMotorMovRequest *message); +size_t stub_motor_mov_request__get_packed_size + (const StubMotorMovRequest *message); +size_t stub_motor_mov_request__pack + (const StubMotorMovRequest *message, + uint8_t *out); +size_t stub_motor_mov_request__pack_to_buffer + (const StubMotorMovRequest *message, + ProtobufCBuffer *buffer); +StubMotorMovRequest * + stub_motor_mov_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void stub_motor_mov_request__free_unpacked + (StubMotorMovRequest *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*StubMotorMovRequest_Closure) + (const StubMotorMovRequest *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor stub_motor_mov_request__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StubMotorMovRequest_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorMovResponse.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorMovResponse.pb-c.c new file mode 100644 index 000000000..e0da6c0b3 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorMovResponse.pb-c.c @@ -0,0 +1,170 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubMotorMovResponse.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StubMotorMovResponse.pb-c.h" +void stub_motor_mov_response__init + (StubMotorMovResponse *message) +{ + static const StubMotorMovResponse init_value = STUB_MOTOR_MOV_RESPONSE__INIT; + *message = init_value; +} +size_t stub_motor_mov_response__get_packed_size + (const StubMotorMovResponse *message) +{ + assert(message->base.descriptor == &stub_motor_mov_response__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t stub_motor_mov_response__pack + (const StubMotorMovResponse *message, + uint8_t *out) +{ + assert(message->base.descriptor == &stub_motor_mov_response__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t stub_motor_mov_response__pack_to_buffer + (const StubMotorMovResponse *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &stub_motor_mov_response__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +StubMotorMovResponse * + stub_motor_mov_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (StubMotorMovResponse *) + protobuf_c_message_unpack (&stub_motor_mov_response__descriptor, + allocator, len, data); +} +void stub_motor_mov_response__free_unpacked + (StubMotorMovResponse *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &stub_motor_mov_response__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor stub_motor_mov_response__field_descriptors[7] = +{ + { + "Motor_ID", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubMotorMovResponse, has_motor_id), + offsetof(StubMotorMovResponse, motor_id), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Position", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubMotorMovResponse, has_position), + offsetof(StubMotorMovResponse, position), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Status_Reg", + 3, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubMotorMovResponse, has_status_reg), + offsetof(StubMotorMovResponse, status_reg), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Direction", + 4, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubMotorMovResponse, has_direction), + offsetof(StubMotorMovResponse, direction), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Mot_Status", + 5, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubMotorMovResponse, has_mot_status), + offsetof(StubMotorMovResponse, mot_status), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "STEP_LOSS_A", + 6, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubMotorMovResponse, has_step_loss_a), + offsetof(StubMotorMovResponse, step_loss_a), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "STEP_LOSS_B", + 7, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubMotorMovResponse, has_step_loss_b), + offsetof(StubMotorMovResponse, step_loss_b), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned stub_motor_mov_response__field_indices_by_name[] = { + 3, /* field[3] = Direction */ + 4, /* field[4] = Mot_Status */ + 0, /* field[0] = Motor_ID */ + 1, /* field[1] = Position */ + 5, /* field[5] = STEP_LOSS_A */ + 6, /* field[6] = STEP_LOSS_B */ + 2, /* field[2] = Status_Reg */ +}; +static const ProtobufCIntRange stub_motor_mov_response__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 7 } +}; +const ProtobufCMessageDescriptor stub_motor_mov_response__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "StubMotorMovResponse", + "StubMotorMovResponse", + "StubMotorMovResponse", + "", + sizeof(StubMotorMovResponse), + 7, + stub_motor_mov_response__field_descriptors, + stub_motor_mov_response__field_indices_by_name, + 1, stub_motor_mov_response__number_ranges, + (ProtobufCMessageInit) stub_motor_mov_response__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorMovResponse.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorMovResponse.pb-c.h new file mode 100644 index 000000000..cd80996ed --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorMovResponse.pb-c.h @@ -0,0 +1,90 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubMotorMovResponse.proto */ + +#ifndef PROTOBUF_C_StubMotorMovResponse_2eproto__INCLUDED +#define PROTOBUF_C_StubMotorMovResponse_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _StubMotorMovResponse StubMotorMovResponse; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _StubMotorMovResponse +{ + ProtobufCMessage base; + protobuf_c_boolean has_motor_id; + uint32_t motor_id; + protobuf_c_boolean has_position; + uint32_t position; + protobuf_c_boolean has_status_reg; + uint32_t status_reg; + /* + * Reverse / Forward + */ + protobuf_c_boolean has_direction; + protobuf_c_boolean direction; + /* + *Stopped / Acceleration / Deceleration / Constant speed + */ + protobuf_c_boolean has_mot_status; + uint32_t mot_status; + protobuf_c_boolean has_step_loss_a; + protobuf_c_boolean step_loss_a; + protobuf_c_boolean has_step_loss_b; + protobuf_c_boolean step_loss_b; +}; +#define STUB_MOTOR_MOV_RESPONSE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&stub_motor_mov_response__descriptor) \ + , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } + + +/* StubMotorMovResponse methods */ +void stub_motor_mov_response__init + (StubMotorMovResponse *message); +size_t stub_motor_mov_response__get_packed_size + (const StubMotorMovResponse *message); +size_t stub_motor_mov_response__pack + (const StubMotorMovResponse *message, + uint8_t *out); +size_t stub_motor_mov_response__pack_to_buffer + (const StubMotorMovResponse *message, + ProtobufCBuffer *buffer); +StubMotorMovResponse * + stub_motor_mov_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void stub_motor_mov_response__free_unpacked + (StubMotorMovResponse *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*StubMotorMovResponse_Closure) + (const StubMotorMovResponse *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor stub_motor_mov_response__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StubMotorMovResponse_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorPositionRequest.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorPositionRequest.pb-c.c new file mode 100644 index 000000000..08f43e778 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorPositionRequest.pb-c.c @@ -0,0 +1,92 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubMotorPositionRequest.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StubMotorPositionRequest.pb-c.h" +void stub_motor_position_request__init + (StubMotorPositionRequest *message) +{ + static const StubMotorPositionRequest init_value = STUB_MOTOR_POSITION_REQUEST__INIT; + *message = init_value; +} +size_t stub_motor_position_request__get_packed_size + (const StubMotorPositionRequest *message) +{ + assert(message->base.descriptor == &stub_motor_position_request__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t stub_motor_position_request__pack + (const StubMotorPositionRequest *message, + uint8_t *out) +{ + assert(message->base.descriptor == &stub_motor_position_request__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t stub_motor_position_request__pack_to_buffer + (const StubMotorPositionRequest *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &stub_motor_position_request__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +StubMotorPositionRequest * + stub_motor_position_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (StubMotorPositionRequest *) + protobuf_c_message_unpack (&stub_motor_position_request__descriptor, + allocator, len, data); +} +void stub_motor_position_request__free_unpacked + (StubMotorPositionRequest *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &stub_motor_position_request__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor stub_motor_position_request__field_descriptors[1] = +{ + { + "Motor_ID", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubMotorPositionRequest, has_motor_id), + offsetof(StubMotorPositionRequest, motor_id), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned stub_motor_position_request__field_indices_by_name[] = { + 0, /* field[0] = Motor_ID */ +}; +static const ProtobufCIntRange stub_motor_position_request__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor stub_motor_position_request__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "StubMotorPositionRequest", + "StubMotorPositionRequest", + "StubMotorPositionRequest", + "", + sizeof(StubMotorPositionRequest), + 1, + stub_motor_position_request__field_descriptors, + stub_motor_position_request__field_indices_by_name, + 1, stub_motor_position_request__number_ranges, + (ProtobufCMessageInit) stub_motor_position_request__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorPositionRequest.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorPositionRequest.pb-c.h new file mode 100644 index 000000000..439a0f31d --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorPositionRequest.pb-c.h @@ -0,0 +1,72 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubMotorPositionRequest.proto */ + +#ifndef PROTOBUF_C_StubMotorPositionRequest_2eproto__INCLUDED +#define PROTOBUF_C_StubMotorPositionRequest_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _StubMotorPositionRequest StubMotorPositionRequest; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _StubMotorPositionRequest +{ + ProtobufCMessage base; + protobuf_c_boolean has_motor_id; + uint32_t motor_id; +}; +#define STUB_MOTOR_POSITION_REQUEST__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&stub_motor_position_request__descriptor) \ + , 0, 0 } + + +/* StubMotorPositionRequest methods */ +void stub_motor_position_request__init + (StubMotorPositionRequest *message); +size_t stub_motor_position_request__get_packed_size + (const StubMotorPositionRequest *message); +size_t stub_motor_position_request__pack + (const StubMotorPositionRequest *message, + uint8_t *out); +size_t stub_motor_position_request__pack_to_buffer + (const StubMotorPositionRequest *message, + ProtobufCBuffer *buffer); +StubMotorPositionRequest * + stub_motor_position_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void stub_motor_position_request__free_unpacked + (StubMotorPositionRequest *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*StubMotorPositionRequest_Closure) + (const StubMotorPositionRequest *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor stub_motor_position_request__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StubMotorPositionRequest_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorPositionResponse.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorPositionResponse.pb-c.c new file mode 100644 index 000000000..4354eb2da --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorPositionResponse.pb-c.c @@ -0,0 +1,105 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubMotorPositionResponse.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StubMotorPositionResponse.pb-c.h" +void stub_motor_position_response__init + (StubMotorPositionResponse *message) +{ + static const StubMotorPositionResponse init_value = STUB_MOTOR_POSITION_RESPONSE__INIT; + *message = init_value; +} +size_t stub_motor_position_response__get_packed_size + (const StubMotorPositionResponse *message) +{ + assert(message->base.descriptor == &stub_motor_position_response__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t stub_motor_position_response__pack + (const StubMotorPositionResponse *message, + uint8_t *out) +{ + assert(message->base.descriptor == &stub_motor_position_response__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t stub_motor_position_response__pack_to_buffer + (const StubMotorPositionResponse *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &stub_motor_position_response__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +StubMotorPositionResponse * + stub_motor_position_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (StubMotorPositionResponse *) + protobuf_c_message_unpack (&stub_motor_position_response__descriptor, + allocator, len, data); +} +void stub_motor_position_response__free_unpacked + (StubMotorPositionResponse *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &stub_motor_position_response__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor stub_motor_position_response__field_descriptors[2] = +{ + { + "Motor_ID", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubMotorPositionResponse, has_motor_id), + offsetof(StubMotorPositionResponse, motor_id), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Position", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubMotorPositionResponse, has_position), + offsetof(StubMotorPositionResponse, position), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned stub_motor_position_response__field_indices_by_name[] = { + 0, /* field[0] = Motor_ID */ + 1, /* field[1] = Position */ +}; +static const ProtobufCIntRange stub_motor_position_response__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor stub_motor_position_response__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "StubMotorPositionResponse", + "StubMotorPositionResponse", + "StubMotorPositionResponse", + "", + sizeof(StubMotorPositionResponse), + 2, + stub_motor_position_response__field_descriptors, + stub_motor_position_response__field_indices_by_name, + 1, stub_motor_position_response__number_ranges, + (ProtobufCMessageInit) stub_motor_position_response__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorPositionResponse.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorPositionResponse.pb-c.h new file mode 100644 index 000000000..13c7c3c95 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorPositionResponse.pb-c.h @@ -0,0 +1,74 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubMotorPositionResponse.proto */ + +#ifndef PROTOBUF_C_StubMotorPositionResponse_2eproto__INCLUDED +#define PROTOBUF_C_StubMotorPositionResponse_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _StubMotorPositionResponse StubMotorPositionResponse; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _StubMotorPositionResponse +{ + ProtobufCMessage base; + protobuf_c_boolean has_motor_id; + uint32_t motor_id; + protobuf_c_boolean has_position; + uint32_t position; +}; +#define STUB_MOTOR_POSITION_RESPONSE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&stub_motor_position_response__descriptor) \ + , 0, 0, 0, 0 } + + +/* StubMotorPositionResponse methods */ +void stub_motor_position_response__init + (StubMotorPositionResponse *message); +size_t stub_motor_position_response__get_packed_size + (const StubMotorPositionResponse *message); +size_t stub_motor_position_response__pack + (const StubMotorPositionResponse *message, + uint8_t *out); +size_t stub_motor_position_response__pack_to_buffer + (const StubMotorPositionResponse *message, + ProtobufCBuffer *buffer); +StubMotorPositionResponse * + stub_motor_position_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void stub_motor_position_response__free_unpacked + (StubMotorPositionResponse *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*StubMotorPositionResponse_Closure) + (const StubMotorPositionResponse *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor stub_motor_position_response__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StubMotorPositionResponse_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorRunRequest.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorRunRequest.pb-c.c new file mode 100644 index 000000000..30cf9ccf2 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorRunRequest.pb-c.c @@ -0,0 +1,118 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubMotorRunRequest.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StubMotorRunRequest.pb-c.h" +void stub_motor_run_request__init + (StubMotorRunRequest *message) +{ + static const StubMotorRunRequest init_value = STUB_MOTOR_RUN_REQUEST__INIT; + *message = init_value; +} +size_t stub_motor_run_request__get_packed_size + (const StubMotorRunRequest *message) +{ + assert(message->base.descriptor == &stub_motor_run_request__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t stub_motor_run_request__pack + (const StubMotorRunRequest *message, + uint8_t *out) +{ + assert(message->base.descriptor == &stub_motor_run_request__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t stub_motor_run_request__pack_to_buffer + (const StubMotorRunRequest *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &stub_motor_run_request__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +StubMotorRunRequest * + stub_motor_run_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (StubMotorRunRequest *) + protobuf_c_message_unpack (&stub_motor_run_request__descriptor, + allocator, len, data); +} +void stub_motor_run_request__free_unpacked + (StubMotorRunRequest *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &stub_motor_run_request__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor stub_motor_run_request__field_descriptors[3] = +{ + { + "Motor_ID", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubMotorRunRequest, has_motor_id), + offsetof(StubMotorRunRequest, motor_id), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Direction", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubMotorRunRequest, has_direction), + offsetof(StubMotorRunRequest, direction), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Speed", + 3, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(StubMotorRunRequest, has_speed), + offsetof(StubMotorRunRequest, speed), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned stub_motor_run_request__field_indices_by_name[] = { + 1, /* field[1] = Direction */ + 0, /* field[0] = Motor_ID */ + 2, /* field[2] = Speed */ +}; +static const ProtobufCIntRange stub_motor_run_request__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 3 } +}; +const ProtobufCMessageDescriptor stub_motor_run_request__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "StubMotorRunRequest", + "StubMotorRunRequest", + "StubMotorRunRequest", + "", + sizeof(StubMotorRunRequest), + 3, + stub_motor_run_request__field_descriptors, + stub_motor_run_request__field_indices_by_name, + 1, stub_motor_run_request__number_ranges, + (ProtobufCMessageInit) stub_motor_run_request__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorRunRequest.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorRunRequest.pb-c.h new file mode 100644 index 000000000..5c4ce2efd --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorRunRequest.pb-c.h @@ -0,0 +1,76 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubMotorRunRequest.proto */ + +#ifndef PROTOBUF_C_StubMotorRunRequest_2eproto__INCLUDED +#define PROTOBUF_C_StubMotorRunRequest_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _StubMotorRunRequest StubMotorRunRequest; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _StubMotorRunRequest +{ + ProtobufCMessage base; + protobuf_c_boolean has_motor_id; + uint32_t motor_id; + protobuf_c_boolean has_direction; + protobuf_c_boolean direction; + protobuf_c_boolean has_speed; + double speed; +}; +#define STUB_MOTOR_RUN_REQUEST__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&stub_motor_run_request__descriptor) \ + , 0, 0, 0, 0, 0, 0 } + + +/* StubMotorRunRequest methods */ +void stub_motor_run_request__init + (StubMotorRunRequest *message); +size_t stub_motor_run_request__get_packed_size + (const StubMotorRunRequest *message); +size_t stub_motor_run_request__pack + (const StubMotorRunRequest *message, + uint8_t *out); +size_t stub_motor_run_request__pack_to_buffer + (const StubMotorRunRequest *message, + ProtobufCBuffer *buffer); +StubMotorRunRequest * + stub_motor_run_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void stub_motor_run_request__free_unpacked + (StubMotorRunRequest *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*StubMotorRunRequest_Closure) + (const StubMotorRunRequest *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor stub_motor_run_request__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StubMotorRunRequest_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorRunResponse.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorRunResponse.pb-c.c new file mode 100644 index 000000000..4d437ab7e --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorRunResponse.pb-c.c @@ -0,0 +1,183 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubMotorRunResponse.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StubMotorRunResponse.pb-c.h" +void stub_motor_run_response__init + (StubMotorRunResponse *message) +{ + static const StubMotorRunResponse init_value = STUB_MOTOR_RUN_RESPONSE__INIT; + *message = init_value; +} +size_t stub_motor_run_response__get_packed_size + (const StubMotorRunResponse *message) +{ + assert(message->base.descriptor == &stub_motor_run_response__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t stub_motor_run_response__pack + (const StubMotorRunResponse *message, + uint8_t *out) +{ + assert(message->base.descriptor == &stub_motor_run_response__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t stub_motor_run_response__pack_to_buffer + (const StubMotorRunResponse *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &stub_motor_run_response__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +StubMotorRunResponse * + stub_motor_run_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (StubMotorRunResponse *) + protobuf_c_message_unpack (&stub_motor_run_response__descriptor, + allocator, len, data); +} +void stub_motor_run_response__free_unpacked + (StubMotorRunResponse *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &stub_motor_run_response__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor stub_motor_run_response__field_descriptors[8] = +{ + { + "Motor_ID", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubMotorRunResponse, has_motor_id), + offsetof(StubMotorRunResponse, motor_id), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Speed", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(StubMotorRunResponse, has_speed), + offsetof(StubMotorRunResponse, speed), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Status_Reg", + 3, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubMotorRunResponse, has_status_reg), + offsetof(StubMotorRunResponse, status_reg), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Direction", + 4, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubMotorRunResponse, has_direction), + offsetof(StubMotorRunResponse, direction), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Mot_Status", + 5, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubMotorRunResponse, has_mot_status), + offsetof(StubMotorRunResponse, mot_status), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "STEP_LOSS_A", + 6, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubMotorRunResponse, has_step_loss_a), + offsetof(StubMotorRunResponse, step_loss_a), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "STEP_LOSS_B", + 7, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubMotorRunResponse, has_step_loss_b), + offsetof(StubMotorRunResponse, step_loss_b), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "BUSY", + 8, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubMotorRunResponse, has_busy), + offsetof(StubMotorRunResponse, busy), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned stub_motor_run_response__field_indices_by_name[] = { + 7, /* field[7] = BUSY */ + 3, /* field[3] = Direction */ + 4, /* field[4] = Mot_Status */ + 0, /* field[0] = Motor_ID */ + 5, /* field[5] = STEP_LOSS_A */ + 6, /* field[6] = STEP_LOSS_B */ + 1, /* field[1] = Speed */ + 2, /* field[2] = Status_Reg */ +}; +static const ProtobufCIntRange stub_motor_run_response__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 8 } +}; +const ProtobufCMessageDescriptor stub_motor_run_response__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "StubMotorRunResponse", + "StubMotorRunResponse", + "StubMotorRunResponse", + "", + sizeof(StubMotorRunResponse), + 8, + stub_motor_run_response__field_descriptors, + stub_motor_run_response__field_indices_by_name, + 1, stub_motor_run_response__number_ranges, + (ProtobufCMessageInit) stub_motor_run_response__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorRunResponse.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorRunResponse.pb-c.h new file mode 100644 index 000000000..9c80cd28d --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorRunResponse.pb-c.h @@ -0,0 +1,92 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubMotorRunResponse.proto */ + +#ifndef PROTOBUF_C_StubMotorRunResponse_2eproto__INCLUDED +#define PROTOBUF_C_StubMotorRunResponse_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _StubMotorRunResponse StubMotorRunResponse; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _StubMotorRunResponse +{ + ProtobufCMessage base; + protobuf_c_boolean has_motor_id; + uint32_t motor_id; + protobuf_c_boolean has_speed; + double speed; + protobuf_c_boolean has_status_reg; + uint32_t status_reg; + /* + * Reverse / Forward + */ + protobuf_c_boolean has_direction; + protobuf_c_boolean direction; + /* + *Stopped / Acceleration / Deceleration / Constant speed + */ + protobuf_c_boolean has_mot_status; + uint32_t mot_status; + protobuf_c_boolean has_step_loss_a; + protobuf_c_boolean step_loss_a; + protobuf_c_boolean has_step_loss_b; + protobuf_c_boolean step_loss_b; + protobuf_c_boolean has_busy; + protobuf_c_boolean busy; +}; +#define STUB_MOTOR_RUN_RESPONSE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&stub_motor_run_response__descriptor) \ + , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } + + +/* StubMotorRunResponse methods */ +void stub_motor_run_response__init + (StubMotorRunResponse *message); +size_t stub_motor_run_response__get_packed_size + (const StubMotorRunResponse *message); +size_t stub_motor_run_response__pack + (const StubMotorRunResponse *message, + uint8_t *out); +size_t stub_motor_run_response__pack_to_buffer + (const StubMotorRunResponse *message, + ProtobufCBuffer *buffer); +StubMotorRunResponse * + stub_motor_run_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void stub_motor_run_response__free_unpacked + (StubMotorRunResponse *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*StubMotorRunResponse_Closure) + (const StubMotorRunResponse *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor stub_motor_run_response__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StubMotorRunResponse_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorSpeedRequest.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorSpeedRequest.pb-c.c new file mode 100644 index 000000000..c8acbfdfd --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorSpeedRequest.pb-c.c @@ -0,0 +1,92 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubMotorSpeedRequest.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StubMotorSpeedRequest.pb-c.h" +void stub_motor_speed_request__init + (StubMotorSpeedRequest *message) +{ + static const StubMotorSpeedRequest init_value = STUB_MOTOR_SPEED_REQUEST__INIT; + *message = init_value; +} +size_t stub_motor_speed_request__get_packed_size + (const StubMotorSpeedRequest *message) +{ + assert(message->base.descriptor == &stub_motor_speed_request__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t stub_motor_speed_request__pack + (const StubMotorSpeedRequest *message, + uint8_t *out) +{ + assert(message->base.descriptor == &stub_motor_speed_request__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t stub_motor_speed_request__pack_to_buffer + (const StubMotorSpeedRequest *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &stub_motor_speed_request__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +StubMotorSpeedRequest * + stub_motor_speed_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (StubMotorSpeedRequest *) + protobuf_c_message_unpack (&stub_motor_speed_request__descriptor, + allocator, len, data); +} +void stub_motor_speed_request__free_unpacked + (StubMotorSpeedRequest *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &stub_motor_speed_request__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor stub_motor_speed_request__field_descriptors[1] = +{ + { + "Motor_ID", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubMotorSpeedRequest, has_motor_id), + offsetof(StubMotorSpeedRequest, motor_id), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned stub_motor_speed_request__field_indices_by_name[] = { + 0, /* field[0] = Motor_ID */ +}; +static const ProtobufCIntRange stub_motor_speed_request__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 1 } +}; +const ProtobufCMessageDescriptor stub_motor_speed_request__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "StubMotorSpeedRequest", + "StubMotorSpeedRequest", + "StubMotorSpeedRequest", + "", + sizeof(StubMotorSpeedRequest), + 1, + stub_motor_speed_request__field_descriptors, + stub_motor_speed_request__field_indices_by_name, + 1, stub_motor_speed_request__number_ranges, + (ProtobufCMessageInit) stub_motor_speed_request__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorSpeedRequest.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorSpeedRequest.pb-c.h new file mode 100644 index 000000000..537ca4da6 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorSpeedRequest.pb-c.h @@ -0,0 +1,72 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubMotorSpeedRequest.proto */ + +#ifndef PROTOBUF_C_StubMotorSpeedRequest_2eproto__INCLUDED +#define PROTOBUF_C_StubMotorSpeedRequest_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _StubMotorSpeedRequest StubMotorSpeedRequest; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _StubMotorSpeedRequest +{ + ProtobufCMessage base; + protobuf_c_boolean has_motor_id; + uint32_t motor_id; +}; +#define STUB_MOTOR_SPEED_REQUEST__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&stub_motor_speed_request__descriptor) \ + , 0, 0 } + + +/* StubMotorSpeedRequest methods */ +void stub_motor_speed_request__init + (StubMotorSpeedRequest *message); +size_t stub_motor_speed_request__get_packed_size + (const StubMotorSpeedRequest *message); +size_t stub_motor_speed_request__pack + (const StubMotorSpeedRequest *message, + uint8_t *out); +size_t stub_motor_speed_request__pack_to_buffer + (const StubMotorSpeedRequest *message, + ProtobufCBuffer *buffer); +StubMotorSpeedRequest * + stub_motor_speed_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void stub_motor_speed_request__free_unpacked + (StubMotorSpeedRequest *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*StubMotorSpeedRequest_Closure) + (const StubMotorSpeedRequest *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor stub_motor_speed_request__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StubMotorSpeedRequest_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorSpeedResponse.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorSpeedResponse.pb-c.c new file mode 100644 index 000000000..34d826880 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorSpeedResponse.pb-c.c @@ -0,0 +1,105 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubMotorSpeedResponse.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StubMotorSpeedResponse.pb-c.h" +void stub_motor_speed_response__init + (StubMotorSpeedResponse *message) +{ + static const StubMotorSpeedResponse init_value = STUB_MOTOR_SPEED_RESPONSE__INIT; + *message = init_value; +} +size_t stub_motor_speed_response__get_packed_size + (const StubMotorSpeedResponse *message) +{ + assert(message->base.descriptor == &stub_motor_speed_response__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t stub_motor_speed_response__pack + (const StubMotorSpeedResponse *message, + uint8_t *out) +{ + assert(message->base.descriptor == &stub_motor_speed_response__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t stub_motor_speed_response__pack_to_buffer + (const StubMotorSpeedResponse *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &stub_motor_speed_response__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +StubMotorSpeedResponse * + stub_motor_speed_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (StubMotorSpeedResponse *) + protobuf_c_message_unpack (&stub_motor_speed_response__descriptor, + allocator, len, data); +} +void stub_motor_speed_response__free_unpacked + (StubMotorSpeedResponse *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &stub_motor_speed_response__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor stub_motor_speed_response__field_descriptors[2] = +{ + { + "Motor_ID", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubMotorSpeedResponse, has_motor_id), + offsetof(StubMotorSpeedResponse, motor_id), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Speed", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_DOUBLE, + offsetof(StubMotorSpeedResponse, has_speed), + offsetof(StubMotorSpeedResponse, speed), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned stub_motor_speed_response__field_indices_by_name[] = { + 0, /* field[0] = Motor_ID */ + 1, /* field[1] = Speed */ +}; +static const ProtobufCIntRange stub_motor_speed_response__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor stub_motor_speed_response__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "StubMotorSpeedResponse", + "StubMotorSpeedResponse", + "StubMotorSpeedResponse", + "", + sizeof(StubMotorSpeedResponse), + 2, + stub_motor_speed_response__field_descriptors, + stub_motor_speed_response__field_indices_by_name, + 1, stub_motor_speed_response__number_ranges, + (ProtobufCMessageInit) stub_motor_speed_response__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorSpeedResponse.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorSpeedResponse.pb-c.h new file mode 100644 index 000000000..d113e02d9 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorSpeedResponse.pb-c.h @@ -0,0 +1,74 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubMotorSpeedResponse.proto */ + +#ifndef PROTOBUF_C_StubMotorSpeedResponse_2eproto__INCLUDED +#define PROTOBUF_C_StubMotorSpeedResponse_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _StubMotorSpeedResponse StubMotorSpeedResponse; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _StubMotorSpeedResponse +{ + ProtobufCMessage base; + protobuf_c_boolean has_motor_id; + uint32_t motor_id; + protobuf_c_boolean has_speed; + double speed; +}; +#define STUB_MOTOR_SPEED_RESPONSE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&stub_motor_speed_response__descriptor) \ + , 0, 0, 0, 0 } + + +/* StubMotorSpeedResponse methods */ +void stub_motor_speed_response__init + (StubMotorSpeedResponse *message); +size_t stub_motor_speed_response__get_packed_size + (const StubMotorSpeedResponse *message); +size_t stub_motor_speed_response__pack + (const StubMotorSpeedResponse *message, + uint8_t *out); +size_t stub_motor_speed_response__pack_to_buffer + (const StubMotorSpeedResponse *message, + ProtobufCBuffer *buffer); +StubMotorSpeedResponse * + stub_motor_speed_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void stub_motor_speed_response__free_unpacked + (StubMotorSpeedResponse *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*StubMotorSpeedResponse_Closure) + (const StubMotorSpeedResponse *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor stub_motor_speed_response__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StubMotorSpeedResponse_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorStatusRequest.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorStatusRequest.pb-c.c new file mode 100644 index 000000000..21ff45bab --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorStatusRequest.pb-c.c @@ -0,0 +1,105 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubMotorStatusRequest.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StubMotorStatusRequest.pb-c.h" +void stub_motor_status_request__init + (StubMotorStatusRequest *message) +{ + static const StubMotorStatusRequest init_value = STUB_MOTOR_STATUS_REQUEST__INIT; + *message = init_value; +} +size_t stub_motor_status_request__get_packed_size + (const StubMotorStatusRequest *message) +{ + assert(message->base.descriptor == &stub_motor_status_request__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t stub_motor_status_request__pack + (const StubMotorStatusRequest *message, + uint8_t *out) +{ + assert(message->base.descriptor == &stub_motor_status_request__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t stub_motor_status_request__pack_to_buffer + (const StubMotorStatusRequest *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &stub_motor_status_request__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +StubMotorStatusRequest * + stub_motor_status_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (StubMotorStatusRequest *) + protobuf_c_message_unpack (&stub_motor_status_request__descriptor, + allocator, len, data); +} +void stub_motor_status_request__free_unpacked + (StubMotorStatusRequest *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &stub_motor_status_request__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor stub_motor_status_request__field_descriptors[2] = +{ + { + "Motor_ID", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubMotorStatusRequest, has_motor_id), + offsetof(StubMotorStatusRequest, motor_id), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "ClearStatus", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubMotorStatusRequest, has_clearstatus), + offsetof(StubMotorStatusRequest, clearstatus), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned stub_motor_status_request__field_indices_by_name[] = { + 1, /* field[1] = ClearStatus */ + 0, /* field[0] = Motor_ID */ +}; +static const ProtobufCIntRange stub_motor_status_request__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor stub_motor_status_request__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "StubMotorStatusRequest", + "StubMotorStatusRequest", + "StubMotorStatusRequest", + "", + sizeof(StubMotorStatusRequest), + 2, + stub_motor_status_request__field_descriptors, + stub_motor_status_request__field_indices_by_name, + 1, stub_motor_status_request__number_ranges, + (ProtobufCMessageInit) stub_motor_status_request__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorStatusRequest.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorStatusRequest.pb-c.h new file mode 100644 index 000000000..84fbd6080 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorStatusRequest.pb-c.h @@ -0,0 +1,74 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubMotorStatusRequest.proto */ + +#ifndef PROTOBUF_C_StubMotorStatusRequest_2eproto__INCLUDED +#define PROTOBUF_C_StubMotorStatusRequest_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _StubMotorStatusRequest StubMotorStatusRequest; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _StubMotorStatusRequest +{ + ProtobufCMessage base; + protobuf_c_boolean has_motor_id; + uint32_t motor_id; + protobuf_c_boolean has_clearstatus; + protobuf_c_boolean clearstatus; +}; +#define STUB_MOTOR_STATUS_REQUEST__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&stub_motor_status_request__descriptor) \ + , 0, 0, 0, 0 } + + +/* StubMotorStatusRequest methods */ +void stub_motor_status_request__init + (StubMotorStatusRequest *message); +size_t stub_motor_status_request__get_packed_size + (const StubMotorStatusRequest *message); +size_t stub_motor_status_request__pack + (const StubMotorStatusRequest *message, + uint8_t *out); +size_t stub_motor_status_request__pack_to_buffer + (const StubMotorStatusRequest *message, + ProtobufCBuffer *buffer); +StubMotorStatusRequest * + stub_motor_status_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void stub_motor_status_request__free_unpacked + (StubMotorStatusRequest *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*StubMotorStatusRequest_Closure) + (const StubMotorStatusRequest *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor stub_motor_status_request__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StubMotorStatusRequest_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorStatusResponse.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorStatusResponse.pb-c.c new file mode 100644 index 000000000..9236abdea --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorStatusResponse.pb-c.c @@ -0,0 +1,287 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubMotorStatusResponse.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StubMotorStatusResponse.pb-c.h" +void stub_motor_status_response__init + (StubMotorStatusResponse *message) +{ + static const StubMotorStatusResponse init_value = STUB_MOTOR_STATUS_RESPONSE__INIT; + *message = init_value; +} +size_t stub_motor_status_response__get_packed_size + (const StubMotorStatusResponse *message) +{ + assert(message->base.descriptor == &stub_motor_status_response__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t stub_motor_status_response__pack + (const StubMotorStatusResponse *message, + uint8_t *out) +{ + assert(message->base.descriptor == &stub_motor_status_response__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t stub_motor_status_response__pack_to_buffer + (const StubMotorStatusResponse *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &stub_motor_status_response__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +StubMotorStatusResponse * + stub_motor_status_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (StubMotorStatusResponse *) + protobuf_c_message_unpack (&stub_motor_status_response__descriptor, + allocator, len, data); +} +void stub_motor_status_response__free_unpacked + (StubMotorStatusResponse *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &stub_motor_status_response__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor stub_motor_status_response__field_descriptors[16] = +{ + { + "Motor_ID", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubMotorStatusResponse, has_motor_id), + offsetof(StubMotorStatusResponse, motor_id), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "SCK_MOD", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubMotorStatusResponse, has_sck_mod), + offsetof(StubMotorStatusResponse, sck_mod), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "STEP_LOSS_B", + 3, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubMotorStatusResponse, has_step_loss_b), + offsetof(StubMotorStatusResponse, step_loss_b), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "STEP_LOSS_A", + 4, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubMotorStatusResponse, has_step_loss_a), + offsetof(StubMotorStatusResponse, step_loss_a), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "OCD", + 5, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubMotorStatusResponse, has_ocd), + offsetof(StubMotorStatusResponse, ocd), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "TH_SD", + 6, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubMotorStatusResponse, has_th_sd), + offsetof(StubMotorStatusResponse, th_sd), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "TH_WRN", + 7, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubMotorStatusResponse, has_th_wrn), + offsetof(StubMotorStatusResponse, th_wrn), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "UVLO", + 8, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubMotorStatusResponse, has_uvlo), + offsetof(StubMotorStatusResponse, uvlo), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "WRONG_CMD", + 9, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubMotorStatusResponse, has_wrong_cmd), + offsetof(StubMotorStatusResponse, wrong_cmd), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "NOTPERF_CMD", + 10, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubMotorStatusResponse, has_notperf_cmd), + offsetof(StubMotorStatusResponse, notperf_cmd), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "MOT_STATUS", + 11, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubMotorStatusResponse, has_mot_status), + offsetof(StubMotorStatusResponse, mot_status), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "DIR", + 12, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubMotorStatusResponse, has_dir), + offsetof(StubMotorStatusResponse, dir), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "SW_EVN", + 13, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubMotorStatusResponse, has_sw_evn), + offsetof(StubMotorStatusResponse, sw_evn), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "SW_F", + 14, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubMotorStatusResponse, has_sw_f), + offsetof(StubMotorStatusResponse, sw_f), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "BUSY", + 15, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubMotorStatusResponse, has_busy), + offsetof(StubMotorStatusResponse, busy), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "HiZ", + 16, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubMotorStatusResponse, has_hiz), + offsetof(StubMotorStatusResponse, hiz), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned stub_motor_status_response__field_indices_by_name[] = { + 14, /* field[14] = BUSY */ + 11, /* field[11] = DIR */ + 15, /* field[15] = HiZ */ + 10, /* field[10] = MOT_STATUS */ + 0, /* field[0] = Motor_ID */ + 9, /* field[9] = NOTPERF_CMD */ + 4, /* field[4] = OCD */ + 1, /* field[1] = SCK_MOD */ + 3, /* field[3] = STEP_LOSS_A */ + 2, /* field[2] = STEP_LOSS_B */ + 12, /* field[12] = SW_EVN */ + 13, /* field[13] = SW_F */ + 5, /* field[5] = TH_SD */ + 6, /* field[6] = TH_WRN */ + 7, /* field[7] = UVLO */ + 8, /* field[8] = WRONG_CMD */ +}; +static const ProtobufCIntRange stub_motor_status_response__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 16 } +}; +const ProtobufCMessageDescriptor stub_motor_status_response__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "StubMotorStatusResponse", + "StubMotorStatusResponse", + "StubMotorStatusResponse", + "", + sizeof(StubMotorStatusResponse), + 16, + stub_motor_status_response__field_descriptors, + stub_motor_status_response__field_indices_by_name, + 1, stub_motor_status_response__number_ranges, + (ProtobufCMessageInit) stub_motor_status_response__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorStatusResponse.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorStatusResponse.pb-c.h new file mode 100644 index 000000000..440830b3b --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorStatusResponse.pb-c.h @@ -0,0 +1,102 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubMotorStatusResponse.proto */ + +#ifndef PROTOBUF_C_StubMotorStatusResponse_2eproto__INCLUDED +#define PROTOBUF_C_StubMotorStatusResponse_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _StubMotorStatusResponse StubMotorStatusResponse; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _StubMotorStatusResponse +{ + ProtobufCMessage base; + protobuf_c_boolean has_motor_id; + uint32_t motor_id; + protobuf_c_boolean has_sck_mod; + protobuf_c_boolean sck_mod; + protobuf_c_boolean has_step_loss_b; + protobuf_c_boolean step_loss_b; + protobuf_c_boolean has_step_loss_a; + protobuf_c_boolean step_loss_a; + protobuf_c_boolean has_ocd; + protobuf_c_boolean ocd; + protobuf_c_boolean has_th_sd; + protobuf_c_boolean th_sd; + protobuf_c_boolean has_th_wrn; + protobuf_c_boolean th_wrn; + protobuf_c_boolean has_uvlo; + protobuf_c_boolean uvlo; + protobuf_c_boolean has_wrong_cmd; + protobuf_c_boolean wrong_cmd; + protobuf_c_boolean has_notperf_cmd; + protobuf_c_boolean notperf_cmd; + protobuf_c_boolean has_mot_status; + uint32_t mot_status; + protobuf_c_boolean has_dir; + protobuf_c_boolean dir; + protobuf_c_boolean has_sw_evn; + protobuf_c_boolean sw_evn; + protobuf_c_boolean has_sw_f; + protobuf_c_boolean sw_f; + protobuf_c_boolean has_busy; + protobuf_c_boolean busy; + protobuf_c_boolean has_hiz; + protobuf_c_boolean hiz; +}; +#define STUB_MOTOR_STATUS_RESPONSE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&stub_motor_status_response__descriptor) \ + , 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 } + + +/* StubMotorStatusResponse methods */ +void stub_motor_status_response__init + (StubMotorStatusResponse *message); +size_t stub_motor_status_response__get_packed_size + (const StubMotorStatusResponse *message); +size_t stub_motor_status_response__pack + (const StubMotorStatusResponse *message, + uint8_t *out); +size_t stub_motor_status_response__pack_to_buffer + (const StubMotorStatusResponse *message, + ProtobufCBuffer *buffer); +StubMotorStatusResponse * + stub_motor_status_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void stub_motor_status_response__free_unpacked + (StubMotorStatusResponse *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*StubMotorStatusResponse_Closure) + (const StubMotorStatusResponse *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor stub_motor_status_response__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StubMotorStatusResponse_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorStopRequest.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorStopRequest.pb-c.c new file mode 100644 index 000000000..1bcdca7be --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorStopRequest.pb-c.c @@ -0,0 +1,105 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubMotorStopRequest.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StubMotorStopRequest.pb-c.h" +void stub_motor_stop_request__init + (StubMotorStopRequest *message) +{ + static const StubMotorStopRequest init_value = STUB_MOTOR_STOP_REQUEST__INIT; + *message = init_value; +} +size_t stub_motor_stop_request__get_packed_size + (const StubMotorStopRequest *message) +{ + assert(message->base.descriptor == &stub_motor_stop_request__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t stub_motor_stop_request__pack + (const StubMotorStopRequest *message, + uint8_t *out) +{ + assert(message->base.descriptor == &stub_motor_stop_request__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t stub_motor_stop_request__pack_to_buffer + (const StubMotorStopRequest *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &stub_motor_stop_request__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +StubMotorStopRequest * + stub_motor_stop_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (StubMotorStopRequest *) + protobuf_c_message_unpack (&stub_motor_stop_request__descriptor, + allocator, len, data); +} +void stub_motor_stop_request__free_unpacked + (StubMotorStopRequest *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &stub_motor_stop_request__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor stub_motor_stop_request__field_descriptors[2] = +{ + { + "Motor_ID", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubMotorStopRequest, has_motor_id), + offsetof(StubMotorStopRequest, motor_id), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Stop_CMD", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubMotorStopRequest, has_stop_cmd), + offsetof(StubMotorStopRequest, stop_cmd), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned stub_motor_stop_request__field_indices_by_name[] = { + 0, /* field[0] = Motor_ID */ + 1, /* field[1] = Stop_CMD */ +}; +static const ProtobufCIntRange stub_motor_stop_request__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 2 } +}; +const ProtobufCMessageDescriptor stub_motor_stop_request__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "StubMotorStopRequest", + "StubMotorStopRequest", + "StubMotorStopRequest", + "", + sizeof(StubMotorStopRequest), + 2, + stub_motor_stop_request__field_descriptors, + stub_motor_stop_request__field_indices_by_name, + 1, stub_motor_stop_request__number_ranges, + (ProtobufCMessageInit) stub_motor_stop_request__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorStopRequest.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorStopRequest.pb-c.h new file mode 100644 index 000000000..2c89fc185 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorStopRequest.pb-c.h @@ -0,0 +1,77 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubMotorStopRequest.proto */ + +#ifndef PROTOBUF_C_StubMotorStopRequest_2eproto__INCLUDED +#define PROTOBUF_C_StubMotorStopRequest_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _StubMotorStopRequest StubMotorStopRequest; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _StubMotorStopRequest +{ + ProtobufCMessage base; + protobuf_c_boolean has_motor_id; + uint32_t motor_id; + /* + * 1 - Hard_Stop/ 2 - Soft_Stop/ 3 - Hard_Hiz/ 4 - Soft_Hiz + */ + protobuf_c_boolean has_stop_cmd; + uint32_t stop_cmd; +}; +#define STUB_MOTOR_STOP_REQUEST__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&stub_motor_stop_request__descriptor) \ + , 0, 0, 0, 0 } + + +/* StubMotorStopRequest methods */ +void stub_motor_stop_request__init + (StubMotorStopRequest *message); +size_t stub_motor_stop_request__get_packed_size + (const StubMotorStopRequest *message); +size_t stub_motor_stop_request__pack + (const StubMotorStopRequest *message, + uint8_t *out); +size_t stub_motor_stop_request__pack_to_buffer + (const StubMotorStopRequest *message, + ProtobufCBuffer *buffer); +StubMotorStopRequest * + stub_motor_stop_request__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void stub_motor_stop_request__free_unpacked + (StubMotorStopRequest *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*StubMotorStopRequest_Closure) + (const StubMotorStopRequest *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor stub_motor_stop_request__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StubMotorStopRequest_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorStopResponse.pb-c.c b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorStopResponse.pb-c.c new file mode 100644 index 000000000..60cacfcb7 --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorStopResponse.pb-c.c @@ -0,0 +1,131 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubMotorStopResponse.proto */ + +/* Do not generate deprecated warnings for self */ +#ifndef PROTOBUF_C__NO_DEPRECATED +#define PROTOBUF_C__NO_DEPRECATED +#endif + +#include "StubMotorStopResponse.pb-c.h" +void stub_motor_stop_response__init + (StubMotorStopResponse *message) +{ + static const StubMotorStopResponse init_value = STUB_MOTOR_STOP_RESPONSE__INIT; + *message = init_value; +} +size_t stub_motor_stop_response__get_packed_size + (const StubMotorStopResponse *message) +{ + assert(message->base.descriptor == &stub_motor_stop_response__descriptor); + return protobuf_c_message_get_packed_size ((const ProtobufCMessage*)(message)); +} +size_t stub_motor_stop_response__pack + (const StubMotorStopResponse *message, + uint8_t *out) +{ + assert(message->base.descriptor == &stub_motor_stop_response__descriptor); + return protobuf_c_message_pack ((const ProtobufCMessage*)message, out); +} +size_t stub_motor_stop_response__pack_to_buffer + (const StubMotorStopResponse *message, + ProtobufCBuffer *buffer) +{ + assert(message->base.descriptor == &stub_motor_stop_response__descriptor); + return protobuf_c_message_pack_to_buffer ((const ProtobufCMessage*)message, buffer); +} +StubMotorStopResponse * + stub_motor_stop_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data) +{ + return (StubMotorStopResponse *) + protobuf_c_message_unpack (&stub_motor_stop_response__descriptor, + allocator, len, data); +} +void stub_motor_stop_response__free_unpacked + (StubMotorStopResponse *message, + ProtobufCAllocator *allocator) +{ + if(!message) + return; + assert(message->base.descriptor == &stub_motor_stop_response__descriptor); + protobuf_c_message_free_unpacked ((ProtobufCMessage*)message, allocator); +} +static const ProtobufCFieldDescriptor stub_motor_stop_response__field_descriptors[4] = +{ + { + "Motor_ID", + 1, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubMotorStopResponse, has_motor_id), + offsetof(StubMotorStopResponse, motor_id), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "Mot_Status", + 2, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_UINT32, + offsetof(StubMotorStopResponse, has_mot_status), + offsetof(StubMotorStopResponse, mot_status), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "HiZ", + 3, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubMotorStopResponse, has_hiz), + offsetof(StubMotorStopResponse, hiz), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, + { + "BUSY", + 4, + PROTOBUF_C_LABEL_OPTIONAL, + PROTOBUF_C_TYPE_BOOL, + offsetof(StubMotorStopResponse, has_busy), + offsetof(StubMotorStopResponse, busy), + NULL, + NULL, + 0, /* flags */ + 0,NULL,NULL /* reserved1,reserved2, etc */ + }, +}; +static const unsigned stub_motor_stop_response__field_indices_by_name[] = { + 3, /* field[3] = BUSY */ + 2, /* field[2] = HiZ */ + 1, /* field[1] = Mot_Status */ + 0, /* field[0] = Motor_ID */ +}; +static const ProtobufCIntRange stub_motor_stop_response__number_ranges[1 + 1] = +{ + { 1, 0 }, + { 0, 4 } +}; +const ProtobufCMessageDescriptor stub_motor_stop_response__descriptor = +{ + PROTOBUF_C__MESSAGE_DESCRIPTOR_MAGIC, + "StubMotorStopResponse", + "StubMotorStopResponse", + "StubMotorStopResponse", + "", + sizeof(StubMotorStopResponse), + 4, + stub_motor_stop_response__field_descriptors, + stub_motor_stop_response__field_indices_by_name, + 1, stub_motor_stop_response__number_ranges, + (ProtobufCMessageInit) stub_motor_stop_response__init, + NULL,NULL,NULL /* reserved[123] */ +}; diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorStopResponse.pb-c.h b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorStopResponse.pb-c.h new file mode 100644 index 000000000..1a41f11ef --- /dev/null +++ b/Software/Visual_Studio/Native/Tango.ColorLib/PMR/Stubs/StubMotorStopResponse.pb-c.h @@ -0,0 +1,84 @@ +/* Generated by the protocol buffer compiler. DO NOT EDIT! */ +/* Generated from: StubMotorStopResponse.proto */ + +#ifndef PROTOBUF_C_StubMotorStopResponse_2eproto__INCLUDED +#define PROTOBUF_C_StubMotorStopResponse_2eproto__INCLUDED + +#include <protobuf-c/protobuf-c.h> + +PROTOBUF_C__BEGIN_DECLS + +#if PROTOBUF_C_VERSION_NUMBER < 1003000 +# error This file was generated by a newer version of protoc-c which is incompatible with your libprotobuf-c headers. Please update your headers. +#elif 1003000 < PROTOBUF_C_MIN_COMPILER_VERSION +# error This file was generated by an older version of protoc-c which is incompatible with your libprotobuf-c headers. Please regenerate this file with a newer version of protoc-c. +#endif + + +typedef struct _StubMotorStopResponse StubMotorStopResponse; + + +/* --- enums --- */ + + +/* --- messages --- */ + +struct _StubMotorStopResponse +{ + ProtobufCMessage base; + protobuf_c_boolean has_motor_id; + uint32_t motor_id; + /* + * Stopped / Acceleration / Deceleration / Constant speed + */ + protobuf_c_boolean has_mot_status; + uint32_t mot_status; + /* + * 1 - high impedance state. + */ + protobuf_c_boolean has_hiz; + protobuf_c_boolean hiz; + protobuf_c_boolean has_busy; + protobuf_c_boolean busy; +}; +#define STUB_MOTOR_STOP_RESPONSE__INIT \ + { PROTOBUF_C_MESSAGE_INIT (&stub_motor_stop_response__descriptor) \ + , 0, 0, 0, 0, 0, 0, 0, 0 } + + +/* StubMotorStopResponse methods */ +void stub_motor_stop_response__init + (StubMotorStopResponse *message); +size_t stub_motor_stop_response__get_packed_size + (const StubMotorStopResponse *message); +size_t stub_motor_stop_response__pack + (const StubMotorStopResponse *message, + uint8_t *out); +size_t stub_motor_stop_response__pack_to_buffer + (const StubMotorStopResponse *message, + ProtobufCBuffer *buffer); +StubMotorStopResponse * + stub_motor_stop_response__unpack + (ProtobufCAllocator *allocator, + size_t len, + const uint8_t *data); +void stub_motor_stop_response__free_unpacked + (StubMotorStopResponse *message, + ProtobufCAllocator *allocator); +/* --- per-message closures --- */ + +typedef void (*StubMotorStopResponse_Closure) + (const StubMotorStopResponse *message, + void *closure_data); + +/* --- services --- */ + + +/* --- descriptors --- */ + +extern const ProtobufCMessageDescriptor stub_motor_stop_response__descriptor; + +PROTOBUF_C__END_DECLS + + +#endif /* PROTOBUF_C_StubMotorStopResponse_2eproto__INCLUDED */ diff --git a/Software/Visual_Studio/Native/Tango.ColorLib/Tango.ColorLib.vcxproj b/Software/Visual_Studio/Native/Tango.ColorLib/Tango.ColorLib.vcxproj index 4b6946228..071c0a4bc 100644 --- a/Software/Visual_Studio/Native/Tango.ColorLib/Tango.ColorLib.vcxproj +++ b/Software/Visual_Studio/Native/Tango.ColorLib/Tango.ColorLib.vcxproj @@ -97,7 +97,7 @@ <SubSystem>Windows</SubSystem> </Link> <PreBuildEvent> - <Command>"$(TargetDir)proto-tc.exe" -i "$(SolutionDir)..\PMR\Messages" -o "$(SolutionDir)Native\Tango.ColorLib\PMR" -l C</Command> + <Command>"$(TargetDir)proto-tc.exe" -i "$(SolutionDir)..\PMR\Messages" -o "$(SolutionDir)Native\Tango.ColorLib\PMR" -l C -c "ColorLab"</Command> </PreBuildEvent> </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> diff --git a/Software/Visual_Studio/Tango.BL/ObservablesExtensions/BrushStop.cs b/Software/Visual_Studio/Tango.BL/ObservablesExtensions/BrushStop.cs index a101701f8..0f65f32d5 100644 --- a/Software/Visual_Studio/Tango.BL/ObservablesExtensions/BrushStop.cs +++ b/Software/Visual_Studio/Tango.BL/ObservablesExtensions/BrushStop.cs @@ -37,6 +37,8 @@ namespace Tango.BL.Entities set { _liquidVolumes = value; RaisePropertyChangedAuto(); } } + + private Color _color; /// <summary> /// Gets or sets the brush stop color. /// </summary> @@ -44,13 +46,37 @@ namespace Tango.BL.Entities [JsonIgnore] public Color Color { - get { return Color.FromRgb((byte)_red, (byte)_green,(byte)_blue); } + get { return Color.FromRgb((byte)_red, (byte)_green, (byte)_blue); } set { - _red = value.R; - _green = value.G; - _blue = value.B; - RaisePropertyChanged(nameof(Color)); + if (ColorSpace != null) + { + Rgb rgb = new Rgb(value.R, value.G, value.B); + + switch ((ColorSpaces)ColorSpace.Code) + { + case ColorSpaces.RGB: + _red = (byte)rgb.R; + _green = (byte)rgb.G; + _blue = (byte)rgb.B; + break; + case ColorSpaces.CMYK: + Cmyk cmyk = rgb.To<Cmyk>(); + _cyan = cmyk.C; + _magenta = cmyk.M; + _yellow = cmyk.Y; + _black = cmyk.K; + break; + case ColorSpaces.LAB: + Lab lab = rgb.To<Lab>(); + _l = lab.L; + _a = lab.A; + _b = lab.B; + break; + } + + RaisePropertyChanged(nameof(Color)); + } } } diff --git a/Software/Visual_Studio/Tango.PMR/Embroidery/AnalyzeInput.cs b/Software/Visual_Studio/Tango.PMR/Embroidery/AnalyzeInput.cs new file mode 100644 index 000000000..d77df3e6b --- /dev/null +++ b/Software/Visual_Studio/Tango.PMR/Embroidery/AnalyzeInput.cs @@ -0,0 +1,159 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: AnalyzeInput.proto +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Tango.PMR.Embroidery { + + /// <summary>Holder for reflection information generated from AnalyzeInput.proto</summary> + public static partial class AnalyzeInputReflection { + + #region Descriptor + /// <summary>File descriptor for AnalyzeInput.proto</summary> + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static AnalyzeInputReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "ChJBbmFseXplSW5wdXQucHJvdG8SFFRhbmdvLlBNUi5FbWJyb2lkZXJ5IiAK", + "DEFuYWx5emVJbnB1dBIQCghGaWxlUGF0aBgBIAEoCUIgCh5jb20udHdpbmUu", + "dGFuZ28ucG1yLmVtYnJvaWRlcnliBnByb3RvMw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Embroidery.AnalyzeInput), global::Tango.PMR.Embroidery.AnalyzeInput.Parser, new[]{ "FilePath" }, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class AnalyzeInput : pb::IMessage<AnalyzeInput> { + private static readonly pb::MessageParser<AnalyzeInput> _parser = new pb::MessageParser<AnalyzeInput>(() => new AnalyzeInput()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser<AnalyzeInput> Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tango.PMR.Embroidery.AnalyzeInputReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public AnalyzeInput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public AnalyzeInput(AnalyzeInput other) : this() { + filePath_ = other.filePath_; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public AnalyzeInput Clone() { + return new AnalyzeInput(this); + } + + /// <summary>Field number for the "FilePath" field.</summary> + public const int FilePathFieldNumber = 1; + private string filePath_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string FilePath { + get { return filePath_; } + set { + filePath_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as AnalyzeInput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(AnalyzeInput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (FilePath != other.FilePath) return false; + return true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (FilePath.Length != 0) hash ^= FilePath.GetHashCode(); + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (FilePath.Length != 0) { + output.WriteRawTag(10); + output.WriteString(FilePath); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (FilePath.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(FilePath); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(AnalyzeInput other) { + if (other == null) { + return; + } + if (other.FilePath.Length != 0) { + FilePath = other.FilePath; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + input.SkipLastField(); + break; + case 10: { + FilePath = input.ReadString(); + break; + } + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Software/Visual_Studio/Tango.PMR/Embroidery/AnalyzeOutput.cs b/Software/Visual_Studio/Tango.PMR/Embroidery/AnalyzeOutput.cs new file mode 100644 index 000000000..3628489e3 --- /dev/null +++ b/Software/Visual_Studio/Tango.PMR/Embroidery/AnalyzeOutput.cs @@ -0,0 +1,167 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: AnalyzeOutput.proto +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Tango.PMR.Embroidery { + + /// <summary>Holder for reflection information generated from AnalyzeOutput.proto</summary> + public static partial class AnalyzeOutputReflection { + + #region Descriptor + /// <summary>File descriptor for AnalyzeOutput.proto</summary> + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static AnalyzeOutputReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "ChNBbmFseXplT3V0cHV0LnByb3RvEhRUYW5nby5QTVIuRW1icm9pZGVyeRoU", + "RW1icm9pZGVyeUZpbGUucHJvdG8iTQoNQW5hbHl6ZU91dHB1dBI8Cg5FbWJy", + "b2lkZXJ5RmlsZRgBIAEoCzIkLlRhbmdvLlBNUi5FbWJyb2lkZXJ5LkVtYnJv", + "aWRlcnlGaWxlQiAKHmNvbS50d2luZS50YW5nby5wbXIuZW1icm9pZGVyeWIG", + "cHJvdG8z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Tango.PMR.Embroidery.EmbroideryFileReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Embroidery.AnalyzeOutput), global::Tango.PMR.Embroidery.AnalyzeOutput.Parser, new[]{ "EmbroideryFile" }, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class AnalyzeOutput : pb::IMessage<AnalyzeOutput> { + private static readonly pb::MessageParser<AnalyzeOutput> _parser = new pb::MessageParser<AnalyzeOutput>(() => new AnalyzeOutput()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser<AnalyzeOutput> Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tango.PMR.Embroidery.AnalyzeOutputReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public AnalyzeOutput() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public AnalyzeOutput(AnalyzeOutput other) : this() { + EmbroideryFile = other.embroideryFile_ != null ? other.EmbroideryFile.Clone() : null; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public AnalyzeOutput Clone() { + return new AnalyzeOutput(this); + } + + /// <summary>Field number for the "EmbroideryFile" field.</summary> + public const int EmbroideryFileFieldNumber = 1; + private global::Tango.PMR.Embroidery.EmbroideryFile embroideryFile_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tango.PMR.Embroidery.EmbroideryFile EmbroideryFile { + get { return embroideryFile_; } + set { + embroideryFile_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as AnalyzeOutput); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(AnalyzeOutput other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (!object.Equals(EmbroideryFile, other.EmbroideryFile)) return false; + return true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (embroideryFile_ != null) hash ^= EmbroideryFile.GetHashCode(); + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (embroideryFile_ != null) { + output.WriteRawTag(10); + output.WriteMessage(EmbroideryFile); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (embroideryFile_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(EmbroideryFile); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(AnalyzeOutput other) { + if (other == null) { + return; + } + if (other.embroideryFile_ != null) { + if (embroideryFile_ == null) { + embroideryFile_ = new global::Tango.PMR.Embroidery.EmbroideryFile(); + } + EmbroideryFile.MergeFrom(other.EmbroideryFile); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + input.SkipLastField(); + break; + case 10: { + if (embroideryFile_ == null) { + embroideryFile_ = new global::Tango.PMR.Embroidery.EmbroideryFile(); + } + input.ReadMessage(embroideryFile_); + break; + } + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Software/Visual_Studio/Tango.PMR/Embroidery/EmbroideryFile.cs b/Software/Visual_Studio/Tango.PMR/Embroidery/EmbroideryFile.cs new file mode 100644 index 000000000..21b6e8824 --- /dev/null +++ b/Software/Visual_Studio/Tango.PMR/Embroidery/EmbroideryFile.cs @@ -0,0 +1,323 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: EmbroideryFile.proto +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Tango.PMR.Embroidery { + + /// <summary>Holder for reflection information generated from EmbroideryFile.proto</summary> + public static partial class EmbroideryFileReflection { + + #region Descriptor + /// <summary>File descriptor for EmbroideryFile.proto</summary> + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static EmbroideryFileReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "ChRFbWJyb2lkZXJ5RmlsZS5wcm90bxIUVGFuZ28uUE1SLkVtYnJvaWRlcnka", + "DUV4dGVudHMucHJvdG8aDFN0aXRjaC5wcm90bxoRU3RpdGNoQ29sb3IucHJv", + "dG8i8gEKDkVtYnJvaWRlcnlGaWxlEhIKCkRlc2lnbk5hbWUYASABKAkSEAoI", + "RmlsZU5hbWUYAiABKAkSEwoLU3RpdGNoQ291bnQYAyABKAUSEgoKQ29sb3JD", + "b3VudBgEIAEoBRIuCgdFeHRlbnRzGAUgASgLMh0uVGFuZ28uUE1SLkVtYnJv", + "aWRlcnkuRXh0ZW50cxIxCgZDb2xvcnMYBiADKAsyIS5UYW5nby5QTVIuRW1i", + "cm9pZGVyeS5TdGl0Y2hDb2xvchIuCghTdGl0Y2hlcxgHIAMoCzIcLlRhbmdv", + "LlBNUi5FbWJyb2lkZXJ5LlN0aXRjaEIgCh5jb20udHdpbmUudGFuZ28ucG1y", + "LmVtYnJvaWRlcnliBnByb3RvMw==")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Tango.PMR.Embroidery.ExtentsReflection.Descriptor, global::Tango.PMR.Embroidery.StitchReflection.Descriptor, global::Tango.PMR.Embroidery.StitchColorReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Embroidery.EmbroideryFile), global::Tango.PMR.Embroidery.EmbroideryFile.Parser, new[]{ "DesignName", "FileName", "StitchCount", "ColorCount", "Extents", "Colors", "Stitches" }, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class EmbroideryFile : pb::IMessage<EmbroideryFile> { + private static readonly pb::MessageParser<EmbroideryFile> _parser = new pb::MessageParser<EmbroideryFile>(() => new EmbroideryFile()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser<EmbroideryFile> Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tango.PMR.Embroidery.EmbroideryFileReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public EmbroideryFile() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public EmbroideryFile(EmbroideryFile other) : this() { + designName_ = other.designName_; + fileName_ = other.fileName_; + stitchCount_ = other.stitchCount_; + colorCount_ = other.colorCount_; + Extents = other.extents_ != null ? other.Extents.Clone() : null; + colors_ = other.colors_.Clone(); + stitches_ = other.stitches_.Clone(); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public EmbroideryFile Clone() { + return new EmbroideryFile(this); + } + + /// <summary>Field number for the "DesignName" field.</summary> + public const int DesignNameFieldNumber = 1; + private string designName_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string DesignName { + get { return designName_; } + set { + designName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// <summary>Field number for the "FileName" field.</summary> + public const int FileNameFieldNumber = 2; + private string fileName_ = ""; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string FileName { + get { return fileName_; } + set { + fileName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// <summary>Field number for the "StitchCount" field.</summary> + public const int StitchCountFieldNumber = 3; + private int stitchCount_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int StitchCount { + get { return stitchCount_; } + set { + stitchCount_ = value; + } + } + + /// <summary>Field number for the "ColorCount" field.</summary> + public const int ColorCountFieldNumber = 4; + private int colorCount_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int ColorCount { + get { return colorCount_; } + set { + colorCount_ = value; + } + } + + /// <summary>Field number for the "Extents" field.</summary> + public const int ExtentsFieldNumber = 5; + private global::Tango.PMR.Embroidery.Extents extents_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tango.PMR.Embroidery.Extents Extents { + get { return extents_; } + set { + extents_ = value; + } + } + + /// <summary>Field number for the "Colors" field.</summary> + public const int ColorsFieldNumber = 6; + private static readonly pb::FieldCodec<global::Tango.PMR.Embroidery.StitchColor> _repeated_colors_codec + = pb::FieldCodec.ForMessage(50, global::Tango.PMR.Embroidery.StitchColor.Parser); + private readonly pbc::RepeatedField<global::Tango.PMR.Embroidery.StitchColor> colors_ = new pbc::RepeatedField<global::Tango.PMR.Embroidery.StitchColor>(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField<global::Tango.PMR.Embroidery.StitchColor> Colors { + get { return colors_; } + } + + /// <summary>Field number for the "Stitches" field.</summary> + public const int StitchesFieldNumber = 7; + private static readonly pb::FieldCodec<global::Tango.PMR.Embroidery.Stitch> _repeated_stitches_codec + = pb::FieldCodec.ForMessage(58, global::Tango.PMR.Embroidery.Stitch.Parser); + private readonly pbc::RepeatedField<global::Tango.PMR.Embroidery.Stitch> stitches_ = new pbc::RepeatedField<global::Tango.PMR.Embroidery.Stitch>(); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pbc::RepeatedField<global::Tango.PMR.Embroidery.Stitch> Stitches { + get { return stitches_; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as EmbroideryFile); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(EmbroideryFile other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (DesignName != other.DesignName) return false; + if (FileName != other.FileName) return false; + if (StitchCount != other.StitchCount) return false; + if (ColorCount != other.ColorCount) return false; + if (!object.Equals(Extents, other.Extents)) return false; + if(!colors_.Equals(other.colors_)) return false; + if(!stitches_.Equals(other.stitches_)) return false; + return true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (DesignName.Length != 0) hash ^= DesignName.GetHashCode(); + if (FileName.Length != 0) hash ^= FileName.GetHashCode(); + if (StitchCount != 0) hash ^= StitchCount.GetHashCode(); + if (ColorCount != 0) hash ^= ColorCount.GetHashCode(); + if (extents_ != null) hash ^= Extents.GetHashCode(); + hash ^= colors_.GetHashCode(); + hash ^= stitches_.GetHashCode(); + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (DesignName.Length != 0) { + output.WriteRawTag(10); + output.WriteString(DesignName); + } + if (FileName.Length != 0) { + output.WriteRawTag(18); + output.WriteString(FileName); + } + if (StitchCount != 0) { + output.WriteRawTag(24); + output.WriteInt32(StitchCount); + } + if (ColorCount != 0) { + output.WriteRawTag(32); + output.WriteInt32(ColorCount); + } + if (extents_ != null) { + output.WriteRawTag(42); + output.WriteMessage(Extents); + } + colors_.WriteTo(output, _repeated_colors_codec); + stitches_.WriteTo(output, _repeated_stitches_codec); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (DesignName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(DesignName); + } + if (FileName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(FileName); + } + if (StitchCount != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(StitchCount); + } + if (ColorCount != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(ColorCount); + } + if (extents_ != null) { + size += 1 + pb::CodedOutputStream.ComputeMessageSize(Extents); + } + size += colors_.CalculateSize(_repeated_colors_codec); + size += stitches_.CalculateSize(_repeated_stitches_codec); + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(EmbroideryFile other) { + if (other == null) { + return; + } + if (other.DesignName.Length != 0) { + DesignName = other.DesignName; + } + if (other.FileName.Length != 0) { + FileName = other.FileName; + } + if (other.StitchCount != 0) { + StitchCount = other.StitchCount; + } + if (other.ColorCount != 0) { + ColorCount = other.ColorCount; + } + if (other.extents_ != null) { + if (extents_ == null) { + extents_ = new global::Tango.PMR.Embroidery.Extents(); + } + Extents.MergeFrom(other.Extents); + } + colors_.Add(other.colors_); + stitches_.Add(other.stitches_); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + input.SkipLastField(); + break; + case 10: { + DesignName = input.ReadString(); + break; + } + case 18: { + FileName = input.ReadString(); + break; + } + case 24: { + StitchCount = input.ReadInt32(); + break; + } + case 32: { + ColorCount = input.ReadInt32(); + break; + } + case 42: { + if (extents_ == null) { + extents_ = new global::Tango.PMR.Embroidery.Extents(); + } + input.ReadMessage(extents_); + break; + } + case 50: { + colors_.AddEntriesFrom(input, _repeated_colors_codec); + break; + } + case 58: { + stitches_.AddEntriesFrom(input, _repeated_stitches_codec); + break; + } + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Software/Visual_Studio/Tango.PMR/Embroidery/Extents.cs b/Software/Visual_Studio/Tango.PMR/Embroidery/Extents.cs new file mode 100644 index 000000000..18f219e43 --- /dev/null +++ b/Software/Visual_Studio/Tango.PMR/Embroidery/Extents.cs @@ -0,0 +1,244 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: Extents.proto +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Tango.PMR.Embroidery { + + /// <summary>Holder for reflection information generated from Extents.proto</summary> + public static partial class ExtentsReflection { + + #region Descriptor + /// <summary>File descriptor for Extents.proto</summary> + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static ExtentsReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "Cg1FeHRlbnRzLnByb3RvEhRUYW5nby5QTVIuRW1icm9pZGVyeSI5CgdFeHRl", + "bnRzEgoKAlgxGAEgASgFEgoKAlkxGAIgASgFEgoKAlgyGAMgASgFEgoKAlky", + "GAQgASgFQiAKHmNvbS50d2luZS50YW5nby5wbXIuZW1icm9pZGVyeWIGcHJv", + "dG8z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Embroidery.Extents), global::Tango.PMR.Embroidery.Extents.Parser, new[]{ "X1", "Y1", "X2", "Y2" }, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class Extents : pb::IMessage<Extents> { + private static readonly pb::MessageParser<Extents> _parser = new pb::MessageParser<Extents>(() => new Extents()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser<Extents> Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tango.PMR.Embroidery.ExtentsReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Extents() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Extents(Extents other) : this() { + x1_ = other.x1_; + y1_ = other.y1_; + x2_ = other.x2_; + y2_ = other.y2_; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Extents Clone() { + return new Extents(this); + } + + /// <summary>Field number for the "X1" field.</summary> + public const int X1FieldNumber = 1; + private int x1_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int X1 { + get { return x1_; } + set { + x1_ = value; + } + } + + /// <summary>Field number for the "Y1" field.</summary> + public const int Y1FieldNumber = 2; + private int y1_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Y1 { + get { return y1_; } + set { + y1_ = value; + } + } + + /// <summary>Field number for the "X2" field.</summary> + public const int X2FieldNumber = 3; + private int x2_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int X2 { + get { return x2_; } + set { + x2_ = value; + } + } + + /// <summary>Field number for the "Y2" field.</summary> + public const int Y2FieldNumber = 4; + private int y2_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Y2 { + get { return y2_; } + set { + y2_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as Extents); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(Extents other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (X1 != other.X1) return false; + if (Y1 != other.Y1) return false; + if (X2 != other.X2) return false; + if (Y2 != other.Y2) return false; + return true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (X1 != 0) hash ^= X1.GetHashCode(); + if (Y1 != 0) hash ^= Y1.GetHashCode(); + if (X2 != 0) hash ^= X2.GetHashCode(); + if (Y2 != 0) hash ^= Y2.GetHashCode(); + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (X1 != 0) { + output.WriteRawTag(8); + output.WriteInt32(X1); + } + if (Y1 != 0) { + output.WriteRawTag(16); + output.WriteInt32(Y1); + } + if (X2 != 0) { + output.WriteRawTag(24); + output.WriteInt32(X2); + } + if (Y2 != 0) { + output.WriteRawTag(32); + output.WriteInt32(Y2); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (X1 != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(X1); + } + if (Y1 != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Y1); + } + if (X2 != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(X2); + } + if (Y2 != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Y2); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(Extents other) { + if (other == null) { + return; + } + if (other.X1 != 0) { + X1 = other.X1; + } + if (other.Y1 != 0) { + Y1 = other.Y1; + } + if (other.X2 != 0) { + X2 = other.X2; + } + if (other.Y2 != 0) { + Y2 = other.Y2; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + input.SkipLastField(); + break; + case 8: { + X1 = input.ReadInt32(); + break; + } + case 16: { + Y1 = input.ReadInt32(); + break; + } + case 24: { + X2 = input.ReadInt32(); + break; + } + case 32: { + Y2 = input.ReadInt32(); + break; + } + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Software/Visual_Studio/Tango.PMR/Embroidery/Stitch.cs b/Software/Visual_Studio/Tango.PMR/Embroidery/Stitch.cs new file mode 100644 index 000000000..3c69da5cd --- /dev/null +++ b/Software/Visual_Studio/Tango.PMR/Embroidery/Stitch.cs @@ -0,0 +1,386 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: Stitch.proto +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Tango.PMR.Embroidery { + + /// <summary>Holder for reflection information generated from Stitch.proto</summary> + public static partial class StitchReflection { + + #region Descriptor + /// <summary>File descriptor for Stitch.proto</summary> + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static StitchReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "CgxTdGl0Y2gucHJvdG8SFFRhbmdvLlBNUi5FbWJyb2lkZXJ5GhBTdGl0Y2hG", + "bGFnLnByb3RvIqsBCgZTdGl0Y2gSLgoERmxhZxgBIAEoDjIgLlRhbmdvLlBN", + "Ui5FbWJyb2lkZXJ5LlN0aXRjaEZsYWcSCgoCWFgYAiABKAESCgoCWVkYAyAB", + "KAESCgoCRFgYBCABKAESCgoCRFkYBSABKAESDgoGTGVuZ3RoGAYgASgBEg0K", + "BUFuZ2xlGAcgASgBEg4KBkRBbmdsZRgIIAEoARISCgpDb2xvckluZGV4GAkg", + "ASgFQiAKHmNvbS50d2luZS50YW5nby5wbXIuZW1icm9pZGVyeWIGcHJvdG8z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { global::Tango.PMR.Embroidery.StitchFlagReflection.Descriptor, }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Embroidery.Stitch), global::Tango.PMR.Embroidery.Stitch.Parser, new[]{ "Flag", "XX", "YY", "DX", "DY", "Length", "Angle", "DAngle", "ColorIndex" }, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class Stitch : pb::IMessage<Stitch> { + private static readonly pb::MessageParser<Stitch> _parser = new pb::MessageParser<Stitch>(() => new Stitch()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser<Stitch> Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tango.PMR.Embroidery.StitchReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Stitch() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Stitch(Stitch other) : this() { + flag_ = other.flag_; + xX_ = other.xX_; + yY_ = other.yY_; + dX_ = other.dX_; + dY_ = other.dY_; + length_ = other.length_; + angle_ = other.angle_; + dAngle_ = other.dAngle_; + colorIndex_ = other.colorIndex_; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Stitch Clone() { + return new Stitch(this); + } + + /// <summary>Field number for the "Flag" field.</summary> + public const int FlagFieldNumber = 1; + private global::Tango.PMR.Embroidery.StitchFlag flag_ = 0; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public global::Tango.PMR.Embroidery.StitchFlag Flag { + get { return flag_; } + set { + flag_ = value; + } + } + + /// <summary>Field number for the "XX" field.</summary> + public const int XXFieldNumber = 2; + private double xX_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double XX { + get { return xX_; } + set { + xX_ = value; + } + } + + /// <summary>Field number for the "YY" field.</summary> + public const int YYFieldNumber = 3; + private double yY_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double YY { + get { return yY_; } + set { + yY_ = value; + } + } + + /// <summary>Field number for the "DX" field.</summary> + public const int DXFieldNumber = 4; + private double dX_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DX { + get { return dX_; } + set { + dX_ = value; + } + } + + /// <summary>Field number for the "DY" field.</summary> + public const int DYFieldNumber = 5; + private double dY_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DY { + get { return dY_; } + set { + dY_ = value; + } + } + + /// <summary>Field number for the "Length" field.</summary> + public const int LengthFieldNumber = 6; + private double length_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double Length { + get { return length_; } + set { + length_ = value; + } + } + + /// <summary>Field number for the "Angle" field.</summary> + public const int AngleFieldNumber = 7; + private double angle_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double Angle { + get { return angle_; } + set { + angle_ = value; + } + } + + /// <summary>Field number for the "DAngle" field.</summary> + public const int DAngleFieldNumber = 8; + private double dAngle_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public double DAngle { + get { return dAngle_; } + set { + dAngle_ = value; + } + } + + /// <summary>Field number for the "ColorIndex" field.</summary> + public const int ColorIndexFieldNumber = 9; + private int colorIndex_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int ColorIndex { + get { return colorIndex_; } + set { + colorIndex_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as Stitch); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(Stitch other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Flag != other.Flag) return false; + if (XX != other.XX) return false; + if (YY != other.YY) return false; + if (DX != other.DX) return false; + if (DY != other.DY) return false; + if (Length != other.Length) return false; + if (Angle != other.Angle) return false; + if (DAngle != other.DAngle) return false; + if (ColorIndex != other.ColorIndex) return false; + return true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Flag != 0) hash ^= Flag.GetHashCode(); + if (XX != 0D) hash ^= XX.GetHashCode(); + if (YY != 0D) hash ^= YY.GetHashCode(); + if (DX != 0D) hash ^= DX.GetHashCode(); + if (DY != 0D) hash ^= DY.GetHashCode(); + if (Length != 0D) hash ^= Length.GetHashCode(); + if (Angle != 0D) hash ^= Angle.GetHashCode(); + if (DAngle != 0D) hash ^= DAngle.GetHashCode(); + if (ColorIndex != 0) hash ^= ColorIndex.GetHashCode(); + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Flag != 0) { + output.WriteRawTag(8); + output.WriteEnum((int) Flag); + } + if (XX != 0D) { + output.WriteRawTag(17); + output.WriteDouble(XX); + } + if (YY != 0D) { + output.WriteRawTag(25); + output.WriteDouble(YY); + } + if (DX != 0D) { + output.WriteRawTag(33); + output.WriteDouble(DX); + } + if (DY != 0D) { + output.WriteRawTag(41); + output.WriteDouble(DY); + } + if (Length != 0D) { + output.WriteRawTag(49); + output.WriteDouble(Length); + } + if (Angle != 0D) { + output.WriteRawTag(57); + output.WriteDouble(Angle); + } + if (DAngle != 0D) { + output.WriteRawTag(65); + output.WriteDouble(DAngle); + } + if (ColorIndex != 0) { + output.WriteRawTag(72); + output.WriteInt32(ColorIndex); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Flag != 0) { + size += 1 + pb::CodedOutputStream.ComputeEnumSize((int) Flag); + } + if (XX != 0D) { + size += 1 + 8; + } + if (YY != 0D) { + size += 1 + 8; + } + if (DX != 0D) { + size += 1 + 8; + } + if (DY != 0D) { + size += 1 + 8; + } + if (Length != 0D) { + size += 1 + 8; + } + if (Angle != 0D) { + size += 1 + 8; + } + if (DAngle != 0D) { + size += 1 + 8; + } + if (ColorIndex != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(ColorIndex); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(Stitch other) { + if (other == null) { + return; + } + if (other.Flag != 0) { + Flag = other.Flag; + } + if (other.XX != 0D) { + XX = other.XX; + } + if (other.YY != 0D) { + YY = other.YY; + } + if (other.DX != 0D) { + DX = other.DX; + } + if (other.DY != 0D) { + DY = other.DY; + } + if (other.Length != 0D) { + Length = other.Length; + } + if (other.Angle != 0D) { + Angle = other.Angle; + } + if (other.DAngle != 0D) { + DAngle = other.DAngle; + } + if (other.ColorIndex != 0) { + ColorIndex = other.ColorIndex; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + input.SkipLastField(); + break; + case 8: { + flag_ = (global::Tango.PMR.Embroidery.StitchFlag) input.ReadEnum(); + break; + } + case 17: { + XX = input.ReadDouble(); + break; + } + case 25: { + YY = input.ReadDouble(); + break; + } + case 33: { + DX = input.ReadDouble(); + break; + } + case 41: { + DY = input.ReadDouble(); + break; + } + case 49: { + Length = input.ReadDouble(); + break; + } + case 57: { + Angle = input.ReadDouble(); + break; + } + case 65: { + DAngle = input.ReadDouble(); + break; + } + case 72: { + ColorIndex = input.ReadInt32(); + break; + } + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Software/Visual_Studio/Tango.PMR/Embroidery/StitchColor.cs b/Software/Visual_Studio/Tango.PMR/Embroidery/StitchColor.cs new file mode 100644 index 000000000..7bcfe8256 --- /dev/null +++ b/Software/Visual_Studio/Tango.PMR/Embroidery/StitchColor.cs @@ -0,0 +1,216 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: StitchColor.proto +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Tango.PMR.Embroidery { + + /// <summary>Holder for reflection information generated from StitchColor.proto</summary> + public static partial class StitchColorReflection { + + #region Descriptor + /// <summary>File descriptor for StitchColor.proto</summary> + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static StitchColorReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "ChFTdGl0Y2hDb2xvci5wcm90bxIUVGFuZ28uUE1SLkVtYnJvaWRlcnkiNwoL", + "U3RpdGNoQ29sb3ISCwoDUmVkGAEgASgFEg0KBUdyZWVuGAIgASgFEgwKBEJs", + "dWUYAyABKAVCIAoeY29tLnR3aW5lLnRhbmdvLnBtci5lbWJyb2lkZXJ5YgZw", + "cm90bzM=")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] { + new pbr::GeneratedClrTypeInfo(typeof(global::Tango.PMR.Embroidery.StitchColor), global::Tango.PMR.Embroidery.StitchColor.Parser, new[]{ "Red", "Green", "Blue" }, null, null, null) + })); + } + #endregion + + } + #region Messages + public sealed partial class StitchColor : pb::IMessage<StitchColor> { + private static readonly pb::MessageParser<StitchColor> _parser = new pb::MessageParser<StitchColor>(() => new StitchColor()); + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser<StitchColor> Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::Tango.PMR.Embroidery.StitchColorReflection.Descriptor.MessageTypes[0]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public StitchColor() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public StitchColor(StitchColor other) : this() { + red_ = other.red_; + green_ = other.green_; + blue_ = other.blue_; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public StitchColor Clone() { + return new StitchColor(this); + } + + /// <summary>Field number for the "Red" field.</summary> + public const int RedFieldNumber = 1; + private int red_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Red { + get { return red_; } + set { + red_ = value; + } + } + + /// <summary>Field number for the "Green" field.</summary> + public const int GreenFieldNumber = 2; + private int green_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Green { + get { return green_; } + set { + green_ = value; + } + } + + /// <summary>Field number for the "Blue" field.</summary> + public const int BlueFieldNumber = 3; + private int blue_; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Blue { + get { return blue_; } + set { + blue_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as StitchColor); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(StitchColor other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (Red != other.Red) return false; + if (Green != other.Green) return false; + if (Blue != other.Blue) return false; + return true; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (Red != 0) hash ^= Red.GetHashCode(); + if (Green != 0) hash ^= Green.GetHashCode(); + if (Blue != 0) hash ^= Blue.GetHashCode(); + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + if (Red != 0) { + output.WriteRawTag(8); + output.WriteInt32(Red); + } + if (Green != 0) { + output.WriteRawTag(16); + output.WriteInt32(Green); + } + if (Blue != 0) { + output.WriteRawTag(24); + output.WriteInt32(Blue); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (Red != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Red); + } + if (Green != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Green); + } + if (Blue != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Blue); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(StitchColor other) { + if (other == null) { + return; + } + if (other.Red != 0) { + Red = other.Red; + } + if (other.Green != 0) { + Green = other.Green; + } + if (other.Blue != 0) { + Blue = other.Blue; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + input.SkipLastField(); + break; + case 8: { + Red = input.ReadInt32(); + break; + } + case 16: { + Green = input.ReadInt32(); + break; + } + case 24: { + Blue = input.ReadInt32(); + break; + } + } + } + } + + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Software/Visual_Studio/Tango.PMR/Embroidery/StitchFlag.cs b/Software/Visual_Studio/Tango.PMR/Embroidery/StitchFlag.cs new file mode 100644 index 000000000..b044b6fc9 --- /dev/null +++ b/Software/Visual_Studio/Tango.PMR/Embroidery/StitchFlag.cs @@ -0,0 +1,50 @@ +// Generated by the protocol buffer compiler. DO NOT EDIT! +// source: StitchFlag.proto +#pragma warning disable 1591, 0612, 3021 +#region Designer generated code + +using pb = global::Google.Protobuf; +using pbc = global::Google.Protobuf.Collections; +using pbr = global::Google.Protobuf.Reflection; +using scg = global::System.Collections.Generic; +namespace Tango.PMR.Embroidery { + + /// <summary>Holder for reflection information generated from StitchFlag.proto</summary> + public static partial class StitchFlagReflection { + + #region Descriptor + /// <summary>File descriptor for StitchFlag.proto</summary> + public static pbr::FileDescriptor Descriptor { + get { return descriptor; } + } + private static pbr::FileDescriptor descriptor; + + static StitchFlagReflection() { + byte[] descriptorData = global::System.Convert.FromBase64String( + string.Concat( + "ChBTdGl0Y2hGbGFnLnByb3RvEhRUYW5nby5QTVIuRW1icm9pZGVyeSpLCgpT", + "dGl0Y2hGbGFnEgoKBk5PUk1BTBAAEggKBEpVTVAQARIICgRUUklNEAISCAoE", + "U1RPUBAEEgoKBlNFUVVJThAIEgcKA0VORBAQQiAKHmNvbS50d2luZS50YW5n", + "by5wbXIuZW1icm9pZGVyeWIGcHJvdG8z")); + descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, + new pbr::FileDescriptor[] { }, + new pbr::GeneratedClrTypeInfo(new[] {typeof(global::Tango.PMR.Embroidery.StitchFlag), }, null)); + } + #endregion + + } + #region Enums + public enum StitchFlag { + [pbr::OriginalName("NORMAL")] Normal = 0, + [pbr::OriginalName("JUMP")] Jump = 1, + [pbr::OriginalName("TRIM")] Trim = 2, + [pbr::OriginalName("STOP")] Stop = 4, + [pbr::OriginalName("SEQUIN")] Sequin = 8, + [pbr::OriginalName("END")] End = 16, + } + + #endregion + +} + +#endregion Designer generated code diff --git a/Software/Visual_Studio/Tango.PMR/ExtensionMethods.cs b/Software/Visual_Studio/Tango.PMR/ExtensionMethods.cs index a4f89cd09..0f8c24626 100644 --- a/Software/Visual_Studio/Tango.PMR/ExtensionMethods.cs +++ b/Software/Visual_Studio/Tango.PMR/ExtensionMethods.cs @@ -20,7 +20,7 @@ namespace Tango.PMR /// </summary> /// <param name="value">The value.</param> /// <returns></returns> - public static String ToOriginalName(this MessageType value) + public static String ToOriginalName(this MessageType value) { FieldInfo fi = value.GetType().GetField(value.ToString()); diff --git a/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj b/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj index b0deca3a0..be276c242 100644 --- a/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj +++ b/Software/Visual_Studio/Tango.PMR/Tango.PMR.csproj @@ -88,6 +88,13 @@ <Compile Include="Diagnostics\ThreadAbortJoggingResponse.cs" /> <Compile Include="Diagnostics\ThreadJoggingRequest.cs" /> <Compile Include="Diagnostics\ThreadJoggingResponse.cs" /> + <Compile Include="Embroidery\AnalyzeInput.cs" /> + <Compile Include="Embroidery\AnalyzeOutput.cs" /> + <Compile Include="Embroidery\EmbroideryFile.cs" /> + <Compile Include="Embroidery\Extents.cs" /> + <Compile Include="Embroidery\Stitch.cs" /> + <Compile Include="Embroidery\StitchColor.cs" /> + <Compile Include="Embroidery\StitchFlag.cs" /> <Compile Include="ExtensionMethods.cs" /> <Compile Include="Hardware\HardwareConfiguration.cs" /> <Compile Include="Hardware\HardwareDancer.cs" /> diff --git a/Software/Visual_Studio/Tango.Protobuf/Compilers/CCompiler.cs b/Software/Visual_Studio/Tango.Protobuf/Compilers/CCompiler.cs index 57064ec9f..fa0f130ac 100644 --- a/Software/Visual_Studio/Tango.Protobuf/Compilers/CCompiler.cs +++ b/Software/Visual_Studio/Tango.Protobuf/Compilers/CCompiler.cs @@ -47,12 +47,20 @@ namespace Tango.Protobuf.Compilers /// <returns> /// Compilation result. /// </returns> - public override CompilerFolderResult CompileFolder(string sourceFolder) + public override CompilerFolderResult CompileFolder(string sourceFolder, params String[] includeFolders) { String temp = PathHelper.GetTempFolderPath(); PathHelper.CopyDirectory(sourceFolder, temp, true); - List<String> directories = Directory.GetDirectories(sourceFolder, "*", SearchOption.AllDirectories).ToList(); + List<String> directories = Directory.GetDirectories(sourceFolder, "*", SearchOption.AllDirectories).Where(x => includeFolders == null || includeFolders.Length == 0 || includeFolders.Contains(Path.GetFileName(x))).ToList(); + + foreach (var dir in Directory.GetDirectories(temp)) + { + if (!directories.Select(x => Path.GetFileName(x)).Contains(Path.GetFileName(dir))) + { + Directory.Delete(dir, true); + } + } foreach (var file in Directory.GetFiles(temp, "*.proto", SearchOption.AllDirectories)) { diff --git a/Software/Visual_Studio/Tango.Protobuf/IProtoCompiler.cs b/Software/Visual_Studio/Tango.Protobuf/IProtoCompiler.cs index db5303515..65b07786f 100644 --- a/Software/Visual_Studio/Tango.Protobuf/IProtoCompiler.cs +++ b/Software/Visual_Studio/Tango.Protobuf/IProtoCompiler.cs @@ -30,7 +30,7 @@ namespace Tango.Protobuf /// </summary> /// <param name="sourceFolder">The source folder</param> /// <returns>Compilation result.</returns> - CompilerFolderResult CompileFolder(String sourceFolder); + CompilerFolderResult CompileFolder(String sourceFolder, params String[] includeFolders); /// <summary> /// Compiles all files in the specified folder recursively and asynchronously. diff --git a/Software/Visual_Studio/Tango.Protobuf/ProtoCompiler.cs b/Software/Visual_Studio/Tango.Protobuf/ProtoCompiler.cs index a9322f495..65ce25300 100644 --- a/Software/Visual_Studio/Tango.Protobuf/ProtoCompiler.cs +++ b/Software/Visual_Studio/Tango.Protobuf/ProtoCompiler.cs @@ -156,7 +156,7 @@ namespace Tango.Protobuf /// <returns> /// Compilation result. /// </returns> - public virtual CompilerFolderResult CompileFolder(string sourceFolder) + public virtual CompilerFolderResult CompileFolder(string sourceFolder, params String[] includeFolders) { if (!UsesDefaultStructure) { diff --git a/Software/Visual_Studio/Tango.UnitTesting/Embroidery_TST.cs b/Software/Visual_Studio/Tango.UnitTesting/Embroidery_TST.cs new file mode 100644 index 000000000..ccd71fdc8 --- /dev/null +++ b/Software/Visual_Studio/Tango.UnitTesting/Embroidery_TST.cs @@ -0,0 +1,31 @@ +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Runtime.InteropServices; +using System.Text; +using System.Threading.Tasks; +using Tango.PMR; +using Tango.PMR.Embroidery; + +namespace Tango.UnitTesting +{ + [TestClass] + [TestCategory("Embroidery")] + public class Embroidery_TST + { + [DllImport("Tango.Embroidery.dll", CallingConvention = CallingConvention.Cdecl, EntryPoint = "AnalyzeEmbroideryFile")] + public static extern int AnalyzeEmbroideryFile(IntPtr data, int size, ref IntPtr output); + + [TestMethod] + public void Analyze_Embroidery_File() + { + AnalyzeInput input = new AnalyzeInput(); + input.FilePath = "C:\\Users\\Roy\\Desktop\\RGB_Strips.pes"; + + + NativePMR<AnalyzeInput, AnalyzeOutput> nativePMR = new NativePMR<AnalyzeInput, AnalyzeOutput>(AnalyzeEmbroideryFile); + AnalyzeOutput output = nativePMR.Invoke(input); + } + } +} diff --git a/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj b/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj index c2f91e115..acbcc129a 100644 --- a/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj +++ b/Software/Visual_Studio/Tango.UnitTesting/Tango.UnitTesting.csproj @@ -30,6 +30,7 @@ <ErrorReport>prompt</ErrorReport> <WarningLevel>4</WarningLevel> <AllowUnsafeBlocks>true</AllowUnsafeBlocks> + <PlatformTarget>x86</PlatformTarget> </PropertyGroup> <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> <DebugType>pdbonly</DebugType> @@ -78,6 +79,7 @@ <Compile Include="..\Versioning\GlobalVersionInfo.cs"> <Link>GlobalVersionInfo.cs</Link> </Compile> + <Compile Include="Embroidery_TST.cs" /> <Compile Include="Helper.cs" /> <Compile Include="Protobuf_TST.cs" /> <Compile Include="Properties\AssemblyInfo.cs" /> diff --git a/Software/Visual_Studio/Tango.sln b/Software/Visual_Studio/Tango.sln index 74d2f61b2..2c9bc8189 100644 --- a/Software/Visual_Studio/Tango.sln +++ b/Software/Visual_Studio/Tango.sln @@ -1,7 +1,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 15 -VisualStudioVersion = 15.0.26430.16 +VisualStudioVersion = 15.0.26430.14 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.Protobuf", "Tango.Protobuf\Tango.Protobuf.csproj", "{40073806-914E-4E78-97AB-FA9639308EBE}" EndProject @@ -145,6 +145,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.PMRGenerator.CLI", "U EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tango.BL", "Tango.BL\Tango.BL.csproj", "{F441FEEE-322A-4943-B566-110E12FD3B72}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Tango.Embroidery", "Embroidery\Tango.Embroidery\Tango.Embroidery.vcxproj", "{A37247ED-B26B-42EE-9F3B-EF0FDEB381F1}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -1886,6 +1888,30 @@ Global {F441FEEE-322A-4943-B566-110E12FD3B72}.Release|x64.Build.0 = Release|Any CPU {F441FEEE-322A-4943-B566-110E12FD3B72}.Release|x86.ActiveCfg = Release|Any CPU {F441FEEE-322A-4943-B566-110E12FD3B72}.Release|x86.Build.0 = Release|Any CPU + {A37247ED-B26B-42EE-9F3B-EF0FDEB381F1}.Debug|Any CPU.ActiveCfg = Debug|Win32 + {A37247ED-B26B-42EE-9F3B-EF0FDEB381F1}.Debug|ARM.ActiveCfg = Debug|Win32 + {A37247ED-B26B-42EE-9F3B-EF0FDEB381F1}.Debug|ARM64.ActiveCfg = Debug|Win32 + {A37247ED-B26B-42EE-9F3B-EF0FDEB381F1}.Debug|x64.ActiveCfg = Debug|x64 + {A37247ED-B26B-42EE-9F3B-EF0FDEB381F1}.Debug|x64.Build.0 = Debug|x64 + {A37247ED-B26B-42EE-9F3B-EF0FDEB381F1}.Debug|x86.ActiveCfg = Debug|Win32 + {A37247ED-B26B-42EE-9F3B-EF0FDEB381F1}.Debug|x86.Build.0 = Debug|Win32 + {A37247ED-B26B-42EE-9F3B-EF0FDEB381F1}.DefaultBuild|Any CPU.ActiveCfg = Release|x64 + {A37247ED-B26B-42EE-9F3B-EF0FDEB381F1}.DefaultBuild|Any CPU.Build.0 = Release|x64 + {A37247ED-B26B-42EE-9F3B-EF0FDEB381F1}.DefaultBuild|ARM.ActiveCfg = Release|x64 + {A37247ED-B26B-42EE-9F3B-EF0FDEB381F1}.DefaultBuild|ARM.Build.0 = Release|x64 + {A37247ED-B26B-42EE-9F3B-EF0FDEB381F1}.DefaultBuild|ARM64.ActiveCfg = Release|x64 + {A37247ED-B26B-42EE-9F3B-EF0FDEB381F1}.DefaultBuild|ARM64.Build.0 = Release|x64 + {A37247ED-B26B-42EE-9F3B-EF0FDEB381F1}.DefaultBuild|x64.ActiveCfg = Debug|x64 + {A37247ED-B26B-42EE-9F3B-EF0FDEB381F1}.DefaultBuild|x64.Build.0 = Debug|x64 + {A37247ED-B26B-42EE-9F3B-EF0FDEB381F1}.DefaultBuild|x86.ActiveCfg = Debug|Win32 + {A37247ED-B26B-42EE-9F3B-EF0FDEB381F1}.DefaultBuild|x86.Build.0 = Debug|Win32 + {A37247ED-B26B-42EE-9F3B-EF0FDEB381F1}.Release|Any CPU.ActiveCfg = Release|Win32 + {A37247ED-B26B-42EE-9F3B-EF0FDEB381F1}.Release|ARM.ActiveCfg = Release|Win32 + {A37247ED-B26B-42EE-9F3B-EF0FDEB381F1}.Release|ARM64.ActiveCfg = Release|Win32 + {A37247ED-B26B-42EE-9F3B-EF0FDEB381F1}.Release|x64.ActiveCfg = Release|x64 + {A37247ED-B26B-42EE-9F3B-EF0FDEB381F1}.Release|x64.Build.0 = Release|x64 + {A37247ED-B26B-42EE-9F3B-EF0FDEB381F1}.Release|x86.ActiveCfg = Release|Win32 + {A37247ED-B26B-42EE-9F3B-EF0FDEB381F1}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -1928,6 +1954,7 @@ Global {0565AEEC-ED1B-4F0E-A277-D33F852207BC} = {34839F9A-61D3-4ED3-B3F7-7DA3424CB0B6} {69DB0564-268C-4B3C-B5D6-A3CDC7D14EAE} = {B2AF4F3F-2828-47C3-8F3E-A0EA0BD66FF8} {5AFD5B7D-757A-400C-B0C9-118834F5D67E} = {5F6BBAA8-EAD0-4B18-97E5-55B4F56DD760} + {A37247ED-B26B-42EE-9F3B-EF0FDEB381F1} = {34839F9A-61D3-4ED3-B3F7-7DA3424CB0B6} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {7986F7F4-A86A-4994-B1B6-0988D7F057B6} diff --git a/Software/Visual_Studio/Utilities/Tango.Protobuf.CLI/Options.cs b/Software/Visual_Studio/Utilities/Tango.Protobuf.CLI/Options.cs index 321ab4494..506e3ed50 100644 --- a/Software/Visual_Studio/Utilities/Tango.Protobuf.CLI/Options.cs +++ b/Software/Visual_Studio/Utilities/Tango.Protobuf.CLI/Options.cs @@ -19,6 +19,9 @@ namespace Tango.Protobuf.CLI [Option('l', Required = true, HelpText = "Target language.")] public String Language { get; set; } + [Option("c", Required = false, HelpText = "Optional folder names to exclusively include (separated by commas).")] + public String Includes { get; set; } + [ParserState] public IParserState LastParserState { get; set; } diff --git a/Software/Visual_Studio/Utilities/Tango.Protobuf.CLI/Program.cs b/Software/Visual_Studio/Utilities/Tango.Protobuf.CLI/Program.cs index 123de0996..0690f44bf 100644 --- a/Software/Visual_Studio/Utilities/Tango.Protobuf.CLI/Program.cs +++ b/Software/Visual_Studio/Utilities/Tango.Protobuf.CLI/Program.cs @@ -11,43 +11,51 @@ namespace Tango.Protobuf.CLI { static int Main(string[] args) { - if (args.Length == 0) + try { - return ExitHelp(); - } - - var options = new Options(); - - if (CommandLine.Parser.Default.ParseArguments(args, options)) - { - if (!Directory.Exists(options.SourceFolder)) + if (args.Length == 0) { - return ExitError("Could not locate source folder \"" + Path.GetFullPath(options.SourceFolder) + "\""); - } - if (!Directory.Exists(options.OutputFolder)) - { - return ExitError("Could not locate output folder " + Path.GetFullPath(options.OutputFolder)); + return ExitHelp(); } - CompilerLanguage language; - if (!Enum.TryParse<CompilerLanguage>(options.Language, out language)) - { - return ExitError("Invalid language: " + options.Language); - } + var options = new Options(); - try + if (CommandLine.Parser.Default.ParseArguments(args, options)) { - var compiler = CompilerFactory.CreateCompiler(language); - var result = compiler.CompileFolder(Path.GetFullPath(options.SourceFolder)); - result.Save(Path.GetFullPath(options.OutputFolder)); - } - catch (Exception ex) - { - return ExitError(ex.Message); + if (!Directory.Exists(options.SourceFolder)) + { + return ExitError("Could not locate source folder \"" + Path.GetFullPath(options.SourceFolder) + "\""); + } + if (!Directory.Exists(options.OutputFolder)) + { + return ExitError("Could not locate output folder " + Path.GetFullPath(options.OutputFolder)); + } + + CompilerLanguage language; + if (!Enum.TryParse<CompilerLanguage>(options.Language, out language)) + { + return ExitError("Invalid language: " + options.Language); + } + + try + { + var compiler = CompilerFactory.CreateCompiler(language); + var result = compiler.CompileFolder(Path.GetFullPath(options.SourceFolder), options.Includes != null ? options.Includes.Split(',') : null); + result.Save(Path.GetFullPath(options.OutputFolder)); + } + catch (Exception ex) + { + return ExitError(ex.Message); + } } - } - return ExitSuccess("Protobuf folder compiled to " + Path.GetFullPath(options.OutputFolder)); + return ExitSuccess("Protobuf folder compiled to " + Path.GetFullPath(options.OutputFolder)); + } + catch (Exception ex) + { + Console.WriteLine(ex.ToString()); + return -1; + } } private static int ExitSuccess(String text) |
