Skip to content

Commit

Permalink
(automatic) update dialects to rev https://github.com/mavlink/mavlink…
Browse files Browse the repository at this point in the history
  • Loading branch information
gomavlib-bot committed Jun 7, 2024
1 parent 12a247b commit 4be549c
Show file tree
Hide file tree
Showing 6 changed files with 135 additions and 0 deletions.
1 change: 1 addition & 0 deletions pkg/dialects/all/dialect.go
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,7 @@ var dial = &dialect.Dialect{
&MessageVelocityLimits{},
&MessageFigureEightExecutionStatus{},
&MessageBatteryStatusV2{},
&MessageFuelStatus{},
&MessageGroupStart{},
&MessageGroupEnd{},
&MessageRadioRcChannels{},
Expand Down
19 changes: 19 additions & 0 deletions pkg/dialects/all/enum_mav_fuel_type.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//autogenerated:yes
//nolint:revive,misspell,govet,lll,dupl,gocritic
package all

import (
"github.com/bluenviron/gomavlib/v3/pkg/dialects/development"
)

// Fuel types for use in FUEL_TYPE. Fuel types specify the units for the maximum, available and consumed fuel, and for the flow rates.
type MAV_FUEL_TYPE = development.MAV_FUEL_TYPE

const (
// Not specified. Fuel levels are normalized (i.e. maximum is 1, and other levels are relative to 1.
MAV_FUEL_TYPE_UNKNOWN MAV_FUEL_TYPE = development.MAV_FUEL_TYPE_UNKNOWN
// A generic liquid fuel. Fuel levels are in millilitres (ml). Fuel rates are in millilitres/second.
MAV_FUEL_TYPE_LIQUID MAV_FUEL_TYPE = development.MAV_FUEL_TYPE_LIQUID
// A gas tank. Fuel levels are in kilo-Pascal (kPa), and flow rates are in milliliters per second (ml/s).
MAV_FUEL_TYPE_GAS MAV_FUEL_TYPE = development.MAV_FUEL_TYPE_GAS
)
19 changes: 19 additions & 0 deletions pkg/dialects/all/message_fuel_status.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//autogenerated:yes
//nolint:revive,misspell,govet,lll
package all

import (
"github.com/bluenviron/gomavlib/v3/pkg/dialects/development"
)

// Fuel status.
// This message provides "generic" fuel level information for display in a GCS and for triggering failsafes in an autopilot.
// The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE.
// The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value.
// A recipient can assume that if these fields are supplied they are accurate.
// If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume).
// Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot).
// This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2.
// If both messages are sent for the same fuel system, the ids and corresponding information must match.
// This should be streamed (nominally at 0.1 Hz).
type MessageFuelStatus = development.MessageFuelStatus
1 change: 1 addition & 0 deletions pkg/dialects/development/dialect.go
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@ var dial = &dialect.Dialect{
&MessageVelocityLimits{},
&MessageFigureEightExecutionStatus{},
&MessageBatteryStatusV2{},
&MessageFuelStatus{},
&MessageGroupStart{},
&MessageGroupEnd{},
&MessageRadioRcChannels{},
Expand Down
58 changes: 58 additions & 0 deletions pkg/dialects/development/enum_mav_fuel_type.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
//autogenerated:yes
//nolint:revive,misspell,govet,lll,dupl,gocritic
package development

import (
"fmt"
"strconv"
)

// Fuel types for use in FUEL_TYPE. Fuel types specify the units for the maximum, available and consumed fuel, and for the flow rates.
type MAV_FUEL_TYPE uint64

const (
// Not specified. Fuel levels are normalized (i.e. maximum is 1, and other levels are relative to 1.
MAV_FUEL_TYPE_UNKNOWN MAV_FUEL_TYPE = 0
// A generic liquid fuel. Fuel levels are in millilitres (ml). Fuel rates are in millilitres/second.
MAV_FUEL_TYPE_LIQUID MAV_FUEL_TYPE = 1
// A gas tank. Fuel levels are in kilo-Pascal (kPa), and flow rates are in milliliters per second (ml/s).
MAV_FUEL_TYPE_GAS MAV_FUEL_TYPE = 2
)

var labels_MAV_FUEL_TYPE = map[MAV_FUEL_TYPE]string{
MAV_FUEL_TYPE_UNKNOWN: "MAV_FUEL_TYPE_UNKNOWN",
MAV_FUEL_TYPE_LIQUID: "MAV_FUEL_TYPE_LIQUID",
MAV_FUEL_TYPE_GAS: "MAV_FUEL_TYPE_GAS",
}

var values_MAV_FUEL_TYPE = map[string]MAV_FUEL_TYPE{
"MAV_FUEL_TYPE_UNKNOWN": MAV_FUEL_TYPE_UNKNOWN,
"MAV_FUEL_TYPE_LIQUID": MAV_FUEL_TYPE_LIQUID,
"MAV_FUEL_TYPE_GAS": MAV_FUEL_TYPE_GAS,
}

// MarshalText implements the encoding.TextMarshaler interface.
func (e MAV_FUEL_TYPE) MarshalText() ([]byte, error) {
if name, ok := labels_MAV_FUEL_TYPE[e]; ok {
return []byte(name), nil
}
return []byte(strconv.Itoa(int(e))), nil
}

// UnmarshalText implements the encoding.TextUnmarshaler interface.
func (e *MAV_FUEL_TYPE) UnmarshalText(text []byte) error {
if value, ok := values_MAV_FUEL_TYPE[string(text)]; ok {
*e = value
} else if value, err := strconv.Atoi(string(text)); err == nil {
*e = MAV_FUEL_TYPE(value)
} else {
return fmt.Errorf("invalid label '%s'", text)
}
return nil
}

// String implements the fmt.Stringer interface.
func (e MAV_FUEL_TYPE) String() string {
val, _ := e.MarshalText()
return string(val)
}
37 changes: 37 additions & 0 deletions pkg/dialects/development/message_fuel_status.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
//autogenerated:yes
//nolint:revive,misspell,govet,lll
package development

// Fuel status.
// This message provides "generic" fuel level information for display in a GCS and for triggering failsafes in an autopilot.
// The fuel type and associated units for fields in this message are defined in the enum MAV_FUEL_TYPE.
// The reported `consumed_fuel` and `remaining_fuel` must only be supplied if measured: they must not be inferred from the `maximum_fuel` and the other value.
// A recipient can assume that if these fields are supplied they are accurate.
// If not provided, the recipient can infer `remaining_fuel` from `maximum_fuel` and `consumed_fuel` on the assumption that the fuel was initially at its maximum (this is what battery monitors assume).
// Note however that this is an assumption, and the UI should prompt the user appropriately (i.e. notify user that they should fill the tank before boot).
// This kind of information may also be sent in fuel-specific messages such as BATTERY_STATUS_V2.
// If both messages are sent for the same fuel system, the ids and corresponding information must match.
// This should be streamed (nominally at 0.1 Hz).
type MessageFuelStatus struct {
// Fuel ID. Must match ID of other messages for same fuel system, such as BATTERY_STATUS_V2.
Id uint8
// Capacity when full. Must be provided.
MaximumFuel float32
// Consumed fuel (measured). This value should not be inferred: if not measured set to NaN. NaN: field not provided.
ConsumedFuel float32
// Remaining fuel until empty (measured). The value should not be inferred: if not measured set to NaN. NaN: field not provided.
RemainingFuel float32
// Percentage of remaining fuel, relative to full. Values: [0-100], UINT8_MAX: field not provided.
PercentRemaining uint8
// Positive value when emptying/using, and negative if filling/replacing. NaN: field not provided.
FlowRate float32
// Fuel temperature. NaN: field not provided.
Temperature float32
// Fuel type. Defines units for fuel capacity and consumption fields above.
FuelType MAV_FUEL_TYPE `mavenum:"uint32"`
}

// GetID implements the message.Message interface.
func (*MessageFuelStatus) GetID() uint32 {
return 371
}

0 comments on commit 4be549c

Please sign in to comment.