generated from ni/github-repo-template
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add waveform.proto under ni/protobuf/types (#40)
* Add waveform.proto under ni/protobuf/types * Define a precisiontime proto file and use the new messages in the waveform. * Fix syntax error. * Address review comments. * Delete the unused precision_duration.proto and README.md files. Place the DoubleWaveform datatype at the top of the waveform.proto file. * Address Brad's comments. * Rename DoubleWaveform -> DoubleAnalogWaveform
- Loading branch information
Showing
2 changed files
with
97 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
//--------------------------------------------------------------------- | ||
//--------------------------------------------------------------------- | ||
syntax = "proto3"; | ||
|
||
//--------------------------------------------------------------------- | ||
//--------------------------------------------------------------------- | ||
package ni.protobuf.types; | ||
|
||
//--------------------------------------------------------------------- | ||
//--------------------------------------------------------------------- | ||
option csharp_namespace = "NationalInstruments.Protobuf.Types"; | ||
option go_package = "types"; | ||
option java_multiple_files = true; | ||
option java_outer_classname = "PrecisionTimeProto"; | ||
option java_package = "com.ni.protobuf.types"; | ||
option objc_class_prefix = "NIPT"; | ||
option php_namespace = "NI\\PROTOBUF\\TYPES"; | ||
option ruby_package = "NI::Protobuf::Types"; | ||
|
||
// A PrecisionTimestamp represents a point in time expressed in NI Binary Time Format (NI-BTF). | ||
// https://www.ni.com/docs/en-US/bundle/labwindows-cvi/page/cvi/libref/ni-btf.htm | ||
// NI-BTF stores time values in Coordinated Universal Time (UTC) format. | ||
// A PrecisionTimestamp is encoded as a count of seconds and fractions of seconds at | ||
// 2^-64 resolution. The count is relative to an epoch of January 1, 1904. | ||
message PrecisionTimestamp | ||
{ | ||
// Represents the number of seconds since the epoch | ||
// 1904-01-01T00:00:00Z. | ||
int64 seconds = 1; | ||
|
||
// Non-negative fractions of a second at 2^-64 resolution. | ||
uint64 fractional_seconds = 2; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
//--------------------------------------------------------------------- | ||
//--------------------------------------------------------------------- | ||
syntax = "proto3"; | ||
|
||
//--------------------------------------------------------------------- | ||
//--------------------------------------------------------------------- | ||
package ni.protobuf.types; | ||
|
||
import "ni/protobuf/types/precision_timestamp.proto"; | ||
|
||
//--------------------------------------------------------------------- | ||
//--------------------------------------------------------------------- | ||
option csharp_namespace = "NationalInstruments.Protobuf.Types"; | ||
option go_package = "types"; | ||
option java_multiple_files = true; | ||
option java_outer_classname = "WaveformProto"; | ||
option java_package = "com.ni.protobuf.types"; | ||
option objc_class_prefix = "NIPT"; | ||
option php_namespace = "NI\\PROTOBUF\\TYPES"; | ||
option ruby_package = "NI::Protobuf::Types"; | ||
|
||
// DoubleAnalogWaveform datatype. | ||
message DoubleAnalogWaveform | ||
{ | ||
// The trigger time of the waveform. | ||
PrecisionTimestamp t0 = 1; | ||
|
||
// The time interval in seconds between data points in the waveform. | ||
double dt = 2; | ||
|
||
// The data values of the waveform. | ||
repeated double y_data = 3; | ||
|
||
// The names and values of all waveform attributes. | ||
// A waveform attribute is metadata attached to a waveform. | ||
// It is represented in this message as a map associating the name of the attribute with the value described by WaveformAttributeValue. | ||
// The NI-DAQmx driver sets the following string attributes: | ||
// NI_ChannelName: the name of the virtual channel producing the waveform. | ||
// NI_LineNames: the name of the digital line in the waveform. | ||
// NI_UnitDescription: the units of measure for the waveform. | ||
// NI_dBReference: the reference value to use when converting measurement levels to decibel. | ||
// For additional information on waveform attributes, please visit https://www.ni.com/docs/en-US/bundle/labview-api-ref/page/functions/get-waveform-attribute.html | ||
map<string, WaveformAttributeValue> attributes = 4; | ||
} | ||
|
||
// Waveform Attribute Value | ||
message WaveformAttributeValue | ||
{ | ||
// The kind of attribute value. | ||
oneof attribute | ||
{ | ||
// Represents a bool attribute. | ||
bool bool_value = 1; | ||
|
||
// Represents an integer attribute. | ||
int32 integer_value = 2; | ||
|
||
// Represents a double attribute. | ||
double double_value = 3; | ||
|
||
// Represents a string attribute. | ||
string string_value = 4; | ||
} | ||
} |