Documentation
¶
Index ¶
- type AngleOffset
- type AxialOffset
- type BodyTube
- type BodyTubeSubcomponents
- type CenteringRing
- type DeploymentConfig
- type Fillet
- type FilletMaterial
- type IgnitionConfig
- type InnerTube
- type InnerTubeSubcomponents
- type LineMaterial
- type MassComponent
- type MassProvider
- type Material
- type Motor
- type MotorConfiguration
- type MotorMount
- type NoseSubcomponents
- type Nosecone
- type OpenrocketDocument
- type Parachute
- type Position
- type RadiusOffset
- type RocketDocument
- type RocketStage
- type Shockcord
- type Stage
- type Subcomponents
- type SustainerSubcomponents
- type TabPosition
- type TrapezoidFinset
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AngleOffset ¶
type AngleOffset struct {
XMLName xml.Name `xml:"angleoffset"`
Method string `xml:"method,attr"`
Value float64 `xml:",chardata"`
}
AngleOffset represents the angle offset element of the XML document
func (*AngleOffset) String ¶
func (a *AngleOffset) String() string
String returns full string representation of the angleoffset
type AxialOffset ¶
type AxialOffset struct {
XMLName xml.Name `xml:"axialoffset"`
Method string `xml:"method,attr"`
Value float64 `xml:",chardata"`
}
AxialOffset is a calculated offset from the center of the component to the center of the rocket
func (*AxialOffset) String ¶
func (a *AxialOffset) String() string
String returns full string representation of the AxialOffset
type BodyTube ¶
type BodyTube struct {
XMLName xml.Name `xml:"bodytube"`
Name string `xml:"name"`
ID string `xml:"id"`
Finish string `xml:"finish"`
Material Material `xml:"material"`
Length float64 `xml:"length"`
Thickness float64 `xml:"thickness"`
Radius string `xml:"radius"` // WARN: May be 'auto' and num
Subcomponents BodyTubeSubcomponents `xml:"subcomponents"`
}
BodyTube represents the body tube element of the XML document
type BodyTubeSubcomponents ¶
type BodyTubeSubcomponents struct {
XMLName xml.Name `xml:"subcomponents"`
InnerTube InnerTube `xml:"innertube"`
TrapezoidFinsets []TrapezoidFinset `xml:"trapezoidfinset"` // Changed to slice
Parachute Parachute `xml:"parachute"`
CenteringRings []CenteringRing `xml:"centeringring"`
Shockcord Shockcord `xml:"shockcord"`
}
BodyTubeSubcomponents represents the nested subcomponents element of the XML document
func (*BodyTubeSubcomponents) String ¶
func (b *BodyTubeSubcomponents) String() string
String returns full string representation of the BodyTubeSubcomponents
type CenteringRing ¶
type CenteringRing struct {
XMLName xml.Name `xml:"centeringring"`
Name string `xml:"name"`
ID string `xml:"id"`
InstanceCount int `xml:"instancecount"`
InstanceSeparation float64 `xml:"instanceseparation"`
AxialOffset AxialOffset `xml:"axialoffset"`
Position Position `xml:"position"`
Material Material `xml:"material"`
Length float64 `xml:"length"`
RadialPosition float64 `xml:"radialposition"`
RadialDirection float64 `xml:"radialdirection"`
OuterRadius string `xml:"outerradius"` // WARN: May be 'auto'
InnerRadius string `xml:"innerradius"` // WARN: May be 'auto'
}
CenteringRing represents the centering ring element of the XML document
func (*CenteringRing) GetMass ¶ added in v0.3.0
func (c *CenteringRing) GetMass() float64
GetMass calculates the mass of the centering ring(s). NOTE: Cannot calculate mass if OuterRadius or InnerRadius is "auto". Returns 0 if radii are "auto" or invalid.
func (*CenteringRing) String ¶
func (c *CenteringRing) String() string
String returns full string representation of the CenteringRing
type DeploymentConfig ¶
type DeploymentConfig struct {
XMLName xml.Name `xml:"deploymentconfiguration"`
ConfigID string `xml:"configid,attr"`
DeployEvent string `xml:"deployevent"`
DeployAltitude float64 `xml:"deployaltitude"`
DeployDelay float64 `xml:"deploydelay"`
}
DeploymentConfig represents the deployment configuration element of the XML document
func (*DeploymentConfig) String ¶
func (d *DeploymentConfig) String() string
String returns full string representation of the deployment clusterconfiguration
type Fillet ¶ added in v0.8.0
type Fillet struct {
XMLName xml.Name `xml:"fillet"`
Name string `xml:"name"`
ID string `xml:"id"`
AxialOffset AxialOffset `xml:"axialoffset"`
Position Position `xml:"position"`
Length float64 `xml:"length"`
Radius float64 `xml:"radius"`
Material Material `xml:"material"` // Or could be a simpler surface material type
}
Fillet represents a fillet subcomponent within a fin set.
type FilletMaterial ¶
type FilletMaterial struct {
XMLName xml.Name `xml:"filletmaterial"`
Type string `xml:"type,attr"`
Density float64 `xml:"density,attr"`
Name string `xml:",chardata"`
}
FilletMaterial represents the fillet material element of the XML document (XMLName is the only delta from Material)
func (*FilletMaterial) String ¶
func (f *FilletMaterial) String() string
String returns full string representation of the filletmaterial
type IgnitionConfig ¶
type IgnitionConfig struct {
XMLName xml.Name `xml:"ignitionconfiguration"`
ConfigID string `xml:"configid,attr"`
IgnitionEvent string `xml:"ignitionevent"`
IgnitionDelay float64 `xml:"ignitiondelay"`
}
IgnitionConfig represents the ignition configuration element of the XML document
func (*IgnitionConfig) String ¶
func (i *IgnitionConfig) String() string
String returns full string representation of the ignition clusterconfiguration
type InnerTube ¶
type InnerTube struct {
XMLName xml.Name `xml:"innertube"`
Name string `xml:"name"`
ID string `xml:"id"`
AxialOffset AxialOffset `xml:"axialoffset"`
Position Position `xml:"position"`
Material Material `xml:"material"`
Length float64 `xml:"length"`
RadialPosition float64 `xml:"radialposition"`
RadialDirection float64 `xml:"radialdirection"`
OuterRadius float64 `xml:"outerradius"`
Thickness float64 `xml:"thickness"`
ClusterConfiguration string `xml:"clusterconfiguration"`
ClusterScale float64 `xml:"clusterscale"`
ClusterRotation float64 `xml:"clusterrotation"`
MotorMount MotorMount `xml:"motormount"` // Direct motor mount info
Subcomponents InnerTubeSubcomponents `xml:"subcomponents"` // Contains nested components like another motor mount? (Schema unclear)
}
InnerTube represents the inner tube element of the XML document
type InnerTubeSubcomponents ¶ added in v0.3.4
type InnerTubeSubcomponents struct {
XMLName xml.Name `xml:"subcomponents"`
MotorMount MotorMount `xml:"motormount"` // Often empty if motor is directly in InnerTube?
}
InnerTubeSubcomponents represents the nested subcomponents for an InnerTube. Note: The exact structure and purpose within InnerTube needs clarification from OR schema/usage. It seems redundant with the direct MotorMount field.
func (*InnerTubeSubcomponents) String ¶ added in v0.3.4
func (s *InnerTubeSubcomponents) String() string
String returns a string representation of InnerTubeSubcomponents.
type LineMaterial ¶
type LineMaterial struct {
XMLName xml.Name `xml:"linematerial"`
Type string `xml:"type,attr"`
Density float64 `xml:"density,attr"`
Name string `xml:",chardata"`
}
LineMaterial is the same as Material with a diff XMLName
func (*LineMaterial) String ¶
func (l *LineMaterial) String() string
String returns full string representation of the LineMaterial
type MassComponent ¶
type MassComponent struct {
XMLName xml.Name `xml:"masscomponent"`
Name string `xml:"name"`
ID string `xml:"id"`
AxialOffset AxialOffset `xml:"axialoffset"`
Position Position `xml:"position"`
PackedLength float64 `xml:"packedlength"`
PackedRadius float64 `xml:"packedradius"`
RadialPosition float64 `xml:"radialposition"`
RadialDirection float64 `xml:"radialdirection"`
Mass float64 `xml:"mass"`
Type string `xml:"masscomponenttype"`
}
MassComponent represents the mass component element of the XML document
func (*MassComponent) GetMass ¶ added in v0.3.0
func (m *MassComponent) GetMass() float64
GetMass returns the pre-defined mass of the component.
func (*MassComponent) String ¶
func (m *MassComponent) String() string
String returns full string representation of the MassComponent
type MassProvider ¶ added in v0.3.0
type MassProvider interface {
GetMass() float64
}
MassProvider defines an interface for components that can provide their mass. This helps in aggregating mass from various component types.
type Material ¶
type Material struct {
XMLName xml.Name `xml:"material"`
Type string `xml:"type,attr"`
Density float64 `xml:"density,attr"`
Name string `xml:",chardata"`
}
Material represents the material element of the XML document
type Motor ¶
type Motor struct {
XMLName xml.Name `xml:"motor"`
ConfigID string `xml:"configid,attr"`
Type string `xml:"type"`
Manufacturer string `xml:"manufacturer"`
Digest string `xml:"digest"`
Designation string `xml:"designation"`
Diameter float64 `xml:"diameter"`
Length float64 `xml:"length"`
Delay string `xml:"delay"`
}
Motor represents the motor element of the XML document
type MotorConfiguration ¶
type MotorConfiguration struct {
XMLName xml.Name `xml:"motorconfiguration"`
ConfigID string `xml:"configid,attr"`
Default bool `xml:"default,attr"`
Stages []Stage `xml:"stage"`
}
MotorConfiguration represents the motor configuration element of the XML document
func (*MotorConfiguration) String ¶
func (m *MotorConfiguration) String() string
String returns full string representation of the MotorConfiguration
type MotorMount ¶
type MotorMount struct {
XMLName xml.Name `xml:"motormount"`
IgnitionEvent string `xml:"ignitionevent"`
IgnitionDelay float64 `xml:"ignitiondelay"`
Overhang float64 `xml:"overhang"`
Motor Motor `xml:"motor"`
IgnitionConfig IgnitionConfig `xml:"ignitionconfiguration"` // WARN: This duplicates field above but let's keep it for now
}
MotorMount represents the motor mount element of the XML document
func (*MotorMount) String ¶
func (m *MotorMount) String() string
String returns full string representation of the motormount
type NoseSubcomponents ¶
type NoseSubcomponents struct {
XMLName xml.Name `xml:"subcomponents"`
MassComponent MassComponent `xml:"masscomponent"`
}
NoseSubcomponents represents the nested subcomponents element of the XML document
func (*NoseSubcomponents) String ¶
func (n *NoseSubcomponents) String() string
String returns full string representation of the NoseSubcomponents
type Nosecone ¶
type Nosecone struct {
XMLName xml.Name `xml:"nosecone"`
Name string `xml:"name"`
ID string `xml:"id"`
Finish string `xml:"finish"`
Material Material `xml:"material"`
Length float64 `xml:"length"`
Thickness float64 `xml:"thickness"`
Shape string `xml:"shape"`
ShapeClipped bool `xml:"shapeclipped"`
ShapeParameter float64 `xml:"shapeparameter"`
AftRadius float64 `xml:"aftradius"`
AftShoulderRadius float64 `xml:"aftshoulderradius"`
AftShoulderLength float64 `xml:"aftshoulderlength"`
AftShoulderThickness float64 `xml:"aftshoulderthickness"`
AftShoulderCapped bool `xml:"aftshouldercapped"`
IsFlipped bool `xml:"isflipped"`
Subcomponents NoseSubcomponents `xml:"subcomponents"`
}
Nosecone represents the nosecone element of the XML document
type OpenrocketDocument ¶
type OpenrocketDocument struct {
XMLName xml.Name `xml:"openrocket"`
Version string `xml:"version,attr"`
Creator string `xml:"creator,attr"`
Rocket RocketDocument `xml:"rocket"`
}
OpenrocketDocument represents the root of the XML document
func (*OpenrocketDocument) Bytes ¶
func (o *OpenrocketDocument) Bytes() []byte
Bytes returns the byte representation of the OpenrocketDocument
func (*OpenrocketDocument) Describe ¶
func (o *OpenrocketDocument) Describe() string
Describe returns a string representation of the OpenrocketDocument
func (*OpenrocketDocument) String ¶
func (o *OpenrocketDocument) String() string
String returns full string representation of the OpenrocketDocument
type Parachute ¶
type Parachute struct {
XMLName xml.Name `xml:"parachute"`
Name string `xml:"name"`
ID string `xml:"id"`
AxialOffset AxialOffset `xml:"axialoffset"`
Position Position `xml:"position"`
PackedLength float64 `xml:"packedlength"`
PackedRadius float64 `xml:"packedradius"`
RadialPosition float64 `xml:"radialposition"`
RadialDirection float64 `xml:"radialdirection"`
CD string `xml:"cd"` // WARN: May be 'auto' and num
Material Material `xml:"material"`
DeployEvent string `xml:"deployevent"`
DeployAltitude float64 `xml:"deployaltitude"`
DeployDelay float64 `xml:"deploydelay"`
DeploymentConfig DeploymentConfig `xml:"deploymentconfiguration"`
Diameter float64 `xml:"diameter"`
LineCount int `xml:"linecount"`
LineLength float64 `xml:"linelength"`
LineMaterial LineMaterial `xml:"linematerial"`
}
Parachute represents the parachute element of the XML document
func (*Parachute) GetMass ¶ added in v0.3.0
GetMass calculates the mass of the parachute based on canopy and line materials/dimensions. NOTE: This calculation assumes Parachute.Material.Density represents AREAL density (e.g., kg/m^2). Line mass calculation uses LineMaterial density (assumed linear).
type Position ¶
type Position struct {
XMLName xml.Name `xml:"position"`
Value float64 `xml:",chardata"`
Type string `xml:"type,attr"`
}
Position represents the position of the component in the rocket
type RadiusOffset ¶
type RadiusOffset struct {
XMLName xml.Name `xml:"radiusoffset"`
Method string `xml:"method,attr"`
Value float64 `xml:",chardata"`
}
RadiusOffset represents the radius offset element of the XML document
func (*RadiusOffset) String ¶
func (r *RadiusOffset) String() string
String returns full string representation of the radiusoffset
type RocketDocument ¶
type RocketDocument struct {
XMLName xml.Name `xml:"rocket"`
Name string `xml:"name"`
ID string `xml:"id"`
AxialOffset AxialOffset `xml:"axialoffset"`
Position Position `xml:"position"`
Designer string `xml:"designer"`
Revision string `xml:"revision"`
MotorConfiguration MotorConfiguration `xml:"motorconfiguration"`
ReferenceType string `xml:"referencetype"`
Subcomponents Subcomponents `xml:"subcomponents"`
}
RocketDocument represents the rocket element of the XML document
func (*RocketDocument) String ¶
func (r *RocketDocument) String() string
String returns full string representation of the RocketDocument
type RocketStage ¶
type RocketStage struct {
XMLName xml.Name `xml:"stage"`
Name string `xml:"name"`
ID string `xml:"id"`
SustainerSubcomponents SustainerSubcomponents `xml:"subcomponents"`
}
RocketStage represents the stage subcomponent element of the XML document
func (*RocketStage) String ¶
func (r *RocketStage) String() string
String returns full string representation of the RocketStage
type Shockcord ¶
type Shockcord struct {
XMLName xml.Name `xml:"shockcord"`
Name string `xml:"name"`
ID string `xml:"id"`
AxialOffset AxialOffset `xml:"axialoffset"`
Position Position `xml:"position"`
PackedLength float64 `xml:"packedlength"`
PackedRadius float64 `xml:"packedradius"`
RadialPosition float64 `xml:"radialposition"`
RadialDirection float64 `xml:"radialdirection"`
CordLength float64 `xml:"cordlength"`
Material Material `xml:"material"`
}
Shockcord represents the shockcord element of the XML document
type Stage ¶
type Stage struct {
XMLName xml.Name `xml:"stage"`
Number int `xml:"number,attr"`
Active bool `xml:"active,attr"`
}
Stage represents motor configuration stages
type Subcomponents ¶
type Subcomponents struct {
XMLName xml.Name `xml:"subcomponents"`
Stages []RocketStage `xml:"stage"`
}
Subcomponents represents the subcomponents element of the XML document
func (*Subcomponents) List ¶
func (s *Subcomponents) List() []RocketStage
List returns a list of all subcomponents so we can iterate over them
func (*Subcomponents) String ¶
func (s *Subcomponents) String() string
String returns full string representation of the Subcomponents
type SustainerSubcomponents ¶
type SustainerSubcomponents struct {
XMLName xml.Name `xml:"subcomponents"`
Nosecone Nosecone `xml:"nosecone"`
BodyTube BodyTube `xml:"bodytube"`
}
SustainerSubcomponents represents the sustainer subcomponents element of the XML document
func (*SustainerSubcomponents) String ¶
func (s *SustainerSubcomponents) String() string
String returns full string representation of the SustainerSubcomponents
type TabPosition ¶
type TabPosition struct {
RelativeTo string `xml:"relativeto,attr"`
Value float64 `xml:",chardata"`
}
TabPosition represents the tabposition element of the XML document
func (*TabPosition) String ¶
func (t *TabPosition) String() string
String returns full string representation of the tabposition
type TrapezoidFinset ¶
type TrapezoidFinset struct {
XMLName xml.Name `xml:"trapezoidfinset"`
Name string `xml:"name"`
ID string `xml:"id"`
InstanceCount int `xml:"instancecount"`
FinCount int `xml:"fincount"`
RadiusOffset RadiusOffset `xml:"radiusoffset"`
AngleOffset AngleOffset `xml:"angleoffset"`
Rotation float64 `xml:"rotation"`
AxialOffset AxialOffset `xml:"axialoffset"`
Position Position `xml:"position"`
Finish string `xml:"finish"`
Material Material `xml:"material"`
Thickness float64 `xml:"thickness"`
CrossSection string `xml:"crosssection"`
Cant float64 `xml:"cant"`
TabHeight float64 `xml:"tabheight"`
TabLength float64 `xml:"tablength,attr"`
TabPositions []TabPosition `xml:"tabposition"`
FilletRadius float64 `xml:"filletradius,attr"`
FilletMaterial FilletMaterial `xml:"filletmaterial"`
RootChord float64 `xml:"rootchord,attr"`
TipChord float64 `xml:"tipchord,attr"`
SweepLength float64 `xml:"sweeplength,attr"` // This might be sweep angle or sweep distance
Height float64 `xml:"height"`
Subcomponents struct {
Fillets []Fillet `xml:"fillet"`
} `xml:"subcomponents"`
}
TrapezoidFinset represents the trapezoid finset element of the XML document
func (*TrapezoidFinset) GetMass ¶
func (t *TrapezoidFinset) GetMass() float64
GetMass calculates mass based on material density and dimensions
func (*TrapezoidFinset) String ¶
func (t *TrapezoidFinset) String() string
String returns full string representation of the TrapezoidFinset