syntax="proto2";
package EPICS;

message FieldValue {
	required string name = 1;
	required string val = 2;
}

message ScalarString {
  required uint32 secondsintoyear = 1;
  required uint32 nano = 2;
  required string val = 3;
  optional int32 severity = 4 [default = 0];
  optional int32 status = 5 [default = 0];
  optional uint32 repeatcount = 6;
  repeated FieldValue fieldvalues = 7;
  optional bool fieldactualchange = 8;
}

message ScalarByte {
  required uint32 secondsintoyear = 1;
  required uint32 nano = 2;
  required bytes val = 3;
  optional int32 severity = 4 [default = 0];
  optional int32 status = 5 [default = 0];
  optional uint32 repeatcount = 6;
  repeated FieldValue fieldvalues = 7;
  optional bool fieldactualchange = 8;
}

message ScalarShort {
  required uint32 secondsintoyear = 1;
  required uint32 nano = 2;
  required sint32 val = 3;
  optional int32 severity = 4 [default = 0];
  optional int32 status = 5 [default = 0];
  optional uint32 repeatcount = 6;
  repeated FieldValue fieldvalues = 7;
  optional bool fieldactualchange = 8;
}

message ScalarInt {
  required uint32 secondsintoyear = 1;
  required uint32 nano = 2;
  required sfixed32 val = 3;
  optional int32 severity = 4 [default = 0];
  optional int32 status = 5 [default = 0];
  optional uint32 repeatcount = 6;
  repeated FieldValue fieldvalues = 7;
  optional bool fieldactualchange = 8;
}

message ScalarEnum {
  required uint32 secondsintoyear = 1;
  required uint32 nano = 2;
  required sint32 val = 3;
  optional int32 severity = 4 [default = 0];
  optional int32 status = 5 [default = 0];
  optional uint32 repeatcount = 6;
  repeated FieldValue fieldvalues = 7;
  optional bool fieldactualchange = 8;
}

message ScalarFloat {
  required uint32 secondsintoyear = 1;
  required uint32 nano = 2;
  required float val = 3;
  optional int32 severity = 4 [default = 0];
  optional int32 status = 5 [default = 0];
  optional uint32 repeatcount = 6;
  repeated FieldValue fieldvalues = 7;
  optional bool fieldactualchange = 8;
}

message ScalarDouble {
  required uint32 secondsintoyear = 1;
  required uint32 nano = 2;
  required double val = 3;
  optional int32 severity = 4 [default = 0];
  optional int32 status = 5 [default = 0];
  optional uint32 repeatcount = 6;
  repeated FieldValue fieldvalues = 7;
  optional bool fieldactualchange = 8;
}

message VectorString {
  required uint32 secondsintoyear = 1;
  required uint32 nano = 2;
  repeated string val = 3;
  optional int32 severity = 4 [default = 0];
  optional int32 status = 5 [default = 0];
  optional uint32 repeatcount = 6;
  repeated FieldValue fieldvalues = 7;
  optional bool fieldactualchange = 8;
}

message VectorChar {
  required uint32 secondsintoyear = 1;
  required uint32 nano = 2;
  required bytes val = 3;
  optional int32 severity = 4 [default = 0];
  optional int32 status = 5 [default = 0];
  optional uint32 repeatcount = 6;
  repeated FieldValue fieldvalues = 7;
  optional bool fieldactualchange = 8;
}

message VectorShort {
  required uint32 secondsintoyear = 1;
  required uint32 nano = 2;
  repeated sint32 val = 3 [packed = true];
  optional int32 severity = 4 [default = 0];
  optional int32 status = 5 [default = 0];
  optional uint32 repeatcount = 6;
  repeated FieldValue fieldvalues = 7;
  optional bool fieldactualchange = 8;
}

message VectorInt {
  required uint32 secondsintoyear = 1;
  required uint32 nano = 2;
  repeated sfixed32 val = 3  [packed = true];
  optional int32 severity = 4 [default = 0];
  optional int32 status = 5 [default = 0];
  optional uint32 repeatcount = 6;
  repeated FieldValue fieldvalues = 7;
  optional bool fieldactualchange = 8;
}

message VectorEnum {
  required uint32 secondsintoyear = 1;
  required uint32 nano = 2;
  repeated sint32 val = 3 [packed = true];
  optional int32 severity = 4 [default = 0];
  optional int32 status = 5 [default = 0];
  optional uint32 repeatcount = 6;
  repeated FieldValue fieldvalues = 7;
  optional bool fieldactualchange = 8;
}

message VectorFloat {
  required uint32 secondsintoyear = 1;
  required uint32 nano = 2;
  repeated float val = 3  [packed = true];
  optional int32 severity = 4 [default = 0];
  optional int32 status = 5 [default = 0];
  optional uint32 repeatcount = 6;
  repeated FieldValue fieldvalues = 7;
  optional bool fieldactualchange = 8;
}

message VectorDouble {
  required uint32 secondsintoyear = 1;
  required uint32 nano = 2;
  repeated double val = 3  [packed = true];
  optional int32 severity = 4 [default = 0];
  optional int32 status = 5 [default = 0];
  optional uint32 repeatcount = 6;
  repeated FieldValue fieldvalues = 7;
  optional bool fieldactualchange = 8;
}

message V4GenericBytes {
  required uint32 secondsintoyear = 1;
  required uint32 nano = 2;
  required bytes val = 3;
  optional int32 severity = 4 [default = 0];
  optional int32 status = 5 [default = 0];
  optional uint32 repeatcount = 6;
  repeated FieldValue fieldvalues = 7;
  optional bool fieldactualchange = 8;
  optional uint32 userTag = 9;
}

enum PayloadType {
	SCALAR_STRING = 0;
	SCALAR_SHORT = 1;
	SCALAR_FLOAT = 2;
	SCALAR_ENUM = 3;
	SCALAR_BYTE = 4;
	SCALAR_INT = 5;
	SCALAR_DOUBLE = 6;
	WAVEFORM_STRING = 7;
	WAVEFORM_SHORT = 8;
	WAVEFORM_FLOAT = 9;
	WAVEFORM_ENUM = 10;
	WAVEFORM_BYTE = 11;
	WAVEFORM_INT = 12;
	WAVEFORM_DOUBLE = 13;
	V4_GENERIC_BYTES = 14;
}

message PayloadInfo {
  required PayloadType type = 1;
  required string pvname = 2;
  required int32 year = 3;
  optional int32 elementCount = 4;
  optional double unused00 = 5;
  optional double unused01 = 6;
  optional double unused02 = 7;
  optional double unused03 = 8;
  optional double unused04 = 9;
  optional double unused05 = 10;
  optional double unused06 = 11;
  optional double unused07 = 12;
  optional double unused08 = 13;
  optional string unused09 = 14;
  repeated FieldValue headers = 15;
}
