Skip to content

Commit

Permalink
Use InputPosition for positions in requests
Browse files Browse the repository at this point in the history
  • Loading branch information
rkusa committed Dec 6, 2022
1 parent cef360b commit a285bad
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 36 deletions.
6 changes: 3 additions & 3 deletions protos/dcs/atmosphere/v0/atmosphere.proto
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ message GetWindRequest {
// The position on the map we want the wind information for.
// Requires lat/lon/alt fields to be populated, there are
// no default values
dcs.common.v0.Position position = 1;
dcs.common.v0.InputPosition position = 1;
}

message GetWindResponse {
Expand All @@ -36,7 +36,7 @@ message GetWindWithTurbulenceRequest {
// The position on the map we want the wind information for.
// Requires lat/lon/alt fields to be populated, there are
// no default values
dcs.common.v0.Position position = 1;
dcs.common.v0.InputPosition position = 1;
}

message GetWindWithTurbulenceResponse {
Expand All @@ -50,7 +50,7 @@ message GetTemperatureAndPressureRequest {
// The position on the map we want the wind information for.
// Requires lat/lon/alt fields to be populated, there are
// no default values
dcs.common.v0.Position position = 1;
dcs.common.v0.InputPosition position = 1;
}

message GetTemperatureAndPressureResponse {
Expand Down
8 changes: 4 additions & 4 deletions protos/dcs/coalition/v0/coalition.proto
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ message AddGroupRequest {
bool hidden = 2;
bool late_activation = 3;
string name = 4;
dcs.common.v0.Position position = 5;
dcs.common.v0.InputPosition position = 5;
repeated Point waypoints = 6;
uint32 start_time = 7;
string task = 8;
Expand All @@ -71,7 +71,7 @@ message AddGroupRequest {
message GroundUnitTemplate {
string name = 1;
string type = 2;
dcs.common.v0.Position position = 3;
dcs.common.v0.InputPosition position = 3;
optional uint32 unit_id = 4;
optional uint32 heading = 5;
Skill skill = 6;
Expand Down Expand Up @@ -109,7 +109,7 @@ message AddGroupRequest {
POINT_TYPE_LAND = 5;
}

dcs.common.v0.Position position = 1;
dcs.common.v0.InputPosition position = 1;
AltitudeType altitude_type = 2;
PointType type = 3;
string action = 4;
Expand Down Expand Up @@ -160,7 +160,7 @@ message AddStaticObjectRequest {
optional uint32 rate = 6;

double heading = 7;
dcs.common.v0.Position position = 8;
dcs.common.v0.InputPosition position = 8;
// cargo mass in kilograms
uint32 cargo_mass = 9;
}
Expand Down
18 changes: 18 additions & 0 deletions protos/dcs/common/v0/common.proto
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,24 @@ message Position {
double v = 5;
}

/**
* Position used in requests to DCS-gRPC.
*
* Latitude and Longitude are in Decimal Degrees format (e.g. 41.33 / 37.21).
* Negative values are used for West of the meridian and south of the equator.
*
* Altitude is given in meters above Mean Sea Level (MSL) and can be a decimal
* value.
*/
message InputPosition {
// Latitude in Decimal Degrees format
double lat = 1;
// Longitude in Decimal Degrees format
double lon = 2;
// Altitude in Meters above Mean Sea Level (MSL)
double alt = 3;
}

/**
* This type is returned if an object category cannot be determined
*
Expand Down
18 changes: 9 additions & 9 deletions protos/dcs/trigger/v0/trigger.proto
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ message SetUserFlagResponse {

message MarkToAllRequest {
string text = 2;
dcs.common.v0.Position position = 3;
dcs.common.v0.InputPosition position = 3;
bool read_only = 4;
string message = 5;
}
Expand All @@ -131,7 +131,7 @@ message MarkToAllResponse {
message MarkToCoalitionRequest {
uint32 id = 1;
string text = 2;
dcs.common.v0.Position position = 3;
dcs.common.v0.InputPosition position = 3;
dcs.common.v0.Coalition coalition = 4;
bool read_only = 5;
string message = 6;
Expand All @@ -144,7 +144,7 @@ message MarkToCoalitionResponse {
message MarkToGroupRequest {
uint32 id = 1;
string text = 2;
dcs.common.v0.Position position = 3;
dcs.common.v0.InputPosition position = 3;
uint32 group_id = 4;
bool read_only = 5;
string message = 6;
Expand All @@ -162,7 +162,7 @@ message RemoveMarkResponse {
}

message ExplosionRequest {
dcs.common.v0.Position position = 1;
dcs.common.v0.InputPosition position = 1;
uint32 power = 2;
}

Expand All @@ -181,7 +181,7 @@ message SmokeRequest {

// Altitude parameter will be ignored. Smoke always eminates from ground
// level which will be calculated server-side
dcs.common.v0.Position position = 1;
dcs.common.v0.InputPosition position = 1;
SmokeColor color = 2;
}

Expand All @@ -191,7 +191,7 @@ message SmokeResponse {
message IlluminationBombRequest {
// The altitude of Illumination Bombs is meters above ground. Ground level
// will be calculated server-side
dcs.common.v0.Position position = 1;
dcs.common.v0.InputPosition position = 1;
uint32 power = 2;
}

Expand All @@ -209,7 +209,7 @@ message SignalFlareRequest {

// Altitude parameter will be ignored. Signal flares always fire from
// ground level which will be calculated server-side
dcs.common.v0.Position position = 1;
dcs.common.v0.InputPosition position = 1;
FlareColor color = 2;
uint32 azimuth = 3;
}
Expand Down Expand Up @@ -251,7 +251,7 @@ enum Shape {

message MarkupToAllRequest {
Shape shape = 1;
repeated dcs.common.v0.Position points = 2;
repeated dcs.common.v0.InputPosition points = 2;
Color border_color = 3;
Color fill_color = 4;
LineType line_type = 5;
Expand All @@ -266,7 +266,7 @@ message MarkupToAllResponse {
message MarkupToCoalitionRequest {
Shape shape = 1;
dcs.common.v0.Coalition coalition = 2;
repeated dcs.common.v0.Position points = 3;
repeated dcs.common.v0.InputPosition points = 3;
Color border_color = 4;
Color fill_color = 5;
LineType line_type = 6;
Expand Down
20 changes: 1 addition & 19 deletions protos/dcs/tts/v0/tts.proto
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ message TransmitRequest {

// The origin of the transmission. Relevant if the SRS server has "Line of
// Sight" and/or "Distance Limit" enabled.
Position position = 5;
dcs.common.v0.InputPosition position = 5;

// The coalition of the transmission. Relevant if the SRS server has "Secure
// Coalition Radios" enabled. Only Blue and Red are supported, all other
Expand Down Expand Up @@ -86,21 +86,3 @@ message TransmitResponse {
// The duration in milliseconds it roughly takes to speak the transmission.
uint32 duration_ms = 1;
}

/**
* Position of an object in DCS
*
* Latitude and Longitude are in Decimal Degrees format (e.g. 41.33 / 37.21).
* Negative values are used for West of the meridian and south of the equator
*
* Altitude is given in meters above Mean Sea Level (MSL) and can be a decimal
* value.
*/
message Position {
// Latitude in Decimal Degrees format
double lat = 1;
// Longitude in Decimal Degrees format
double lon = 2;
// Altitude in Meters above Mean Sea Level (MSL)
double alt = 3;
}
2 changes: 1 addition & 1 deletion src/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ impl Server {
pub struct TtsOptions {
plaintext: Option<String>,
srs_client_name: Option<String>,
position: Option<stubs::tts::v0::Position>,
position: Option<stubs::common::v0::InputPosition>,
coalition: Option<stubs::common::v0::Coalition>,
provider: Option<stubs::tts::v0::transmit_request::Provider>,
}
Expand Down

0 comments on commit a285bad

Please sign in to comment.