Login Page - Create Account

DTC Protocol Discussion Forum


Date/Time: Fri, 29 Nov 2024 16:49:32 +0000



Post From: Google Protocol Buffers

[2016-10-17 13:14:06]
DabbaDo - Posts: 148
I tried to compile/generate the DTCProtocol.3.proto file attached to post 4 on this thread.
The only error is "The first enum value must be zero in proto3" which occurs because of this:
enum PriceDisplayFormatEnum
{
PRICE_DISPLAY_FORMAT_UNSET = -1;
//The following formats indicate the number of decimal places to be displayed
PRICE_DISPLAY_FORMAT_DECIMAL_0 = 0;
...

I "fixed" it by moving the PRICE_DISPLAY_FORMAT_UNSET = -1; line to the end of the enum. This allows the proto to compile/generate good code, but I haven't tested its operation.
I'm using version 3.1.0 (NuGet package Google.Protobuf.Tools which goes alongside the 3.1.0 Google.Protobuf package).

The zeroes-first requirement is here: https://developers.google.com/protocol-buffers/docs/proto3#enum

FYI,
Dale

BTW, I wonder if you could start including this file under SierraChart\DTC now that google support of proto3 is "official".
Date Time Of Last Edit: 2016-10-17 13:27:47