blob: 3a5fe4fd23cd0f78f1fba26251915c50ff8ea5f5 [file] [log] [blame]
// *****************************************************************************
// Copyright (c) 2018 Agence spatiale canadienne / Canadian Space Agency
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
// which accompanies this distribution, and is available at
// http://www.eclipse.org/legal/epl-v10.html
//
// Contributors:
// Pierre Allard - initial API and implementation
// Regent L'Archeveque
//
// SPDX-License-Identifier: EPL-1.0
// *****************************************************************************
@GenModel(prefix="ApogyCoreEnvironmentOrbit",
childCreationExtenders="true",
extensibleProviderFactory="true",
multipleEditorPages="false",
copyrightText="*******************************************************************************
Copyright (c) 2018 Agence spatiale canadienne / Canadian Space Agency
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
http://www.eclipse.org/legal/epl-v10.html
Contributors:
Pierre Allard - initial API and implementation
Regent L'Archeveque
SPDX-License-Identifier: EPL-1.0
*******************************************************************************",
modelName="ApogyCoreEnvironmentOrbit",
complianceLevel="8.0",
suppressGenModelAnnotations="false",
dynamicTemplates="true",
templateDirectory="platform:/plugin/org.eclipse.apogy.common.emf.codegen/templates")
@GenModel(modelDirectory="/org.eclipse.apogy.core.environment.orbit/src-gen")
@GenModel(editDirectory= "/org.eclipse.apogy.core.environment.orbit.edit/src-gen")
//@GenModel(testsDirectory="/org.eclipse.apogy.core.environment.orbit.tests/src-gen")
package org.eclipse.apogy.core.environment.orbit
import org.eclipse.emf.ecore.EDate
import org.eclipse.apogy.common.emf.Timed
import org.eclipse.apogy.common.emf.Named
import org.eclipse.apogy.common.emf.Described
import org.eclipse.apogy.common.math.Tuple3d
import org.eclipse.apogy.common.math.Matrix3x3
import org.eclipse.apogy.core.environment.Worksite
import org.eclipse.apogy.common.Apogy
// Basic Types
type List < T > wraps java.util.List
type Exception wraps java.lang.Exception
/**
* Class representing an orbit model.
*/
abstract class AbstractOrbitModel extends Named, Described
{
}
/**
* A worksite located in orbit.
*/
abstract class OrbitWorksite extends Worksite
{
/*
* The active OrbitModel to use to update the orbit worksite.
*/
refers AbstractOrbitModel orbitModel
}
abstract class AbstractFrame extends Named, Described
{
}
/**
* Class representing the position, velocity and acceleration of a body.
*/
class PVACoordinates
{
/*
* The position.
*/
@Apogy(units="m")
contains Tuple3d[1] position
/*
* The velocity.
*/
@Apogy(units="m/s")
contains Tuple3d[1] velocity
/*
* The acceleration.
*/
@Apogy(units="m/s²")
contains Tuple3d[1] acceleration
/*
* The angular velocity (spin) of this point as seen from the origin.
*/
@Apogy(units="rad/s")
contains Tuple3d[1] angularVelocity
}
/*
* Defines the triplet of Position, Velocity, Acceleration that is time stamped.
*/
class TimedStampedPVACoordinates extends PVACoordinates, Timed
{
}
/*
* This interface represents a PVCoordinates provider.
*/
interface PVCoordinatesProviderProvider
{
op TimedStampedPVACoordinates getPVCoordinates(Date date, AbstractFrame frame)
}
class AngularCoordinates
{
/*
* The rotation expressed as a rotation matrix.
*/
contains Matrix3x3 rotation
/*
* The rotation rates, in rad/s
*/
contains Tuple3d[1] angularRate
/*
* The rotation acceleration, in rad/s²
*/
contains Tuple3d[1] angularAcceleration
}
class TimedStampedAngularCoordinates extends AngularCoordinates, Timed
{
}
/*
* This class represents the rotation between a reference frame and the satellite frame,
* as well as the spin of the satellite (axis and rotation rate).
*/
class SpacecraftAttitude extends Timed
{
contains TimedStampedAngularCoordinates orientation
contains AbstractFrame referenceFrame
}
/*
* This interface represents an attitude provider.
* An attitude provider provides a way to compute an Attitude from an date and position-velocity local provider.
*/
interface AttitudeProvider
{
op SpacecraftAttitude getAttitude(PVCoordinatesProviderProvider pvProvider, Date date, AbstractFrame frame)
}
/*
* Defines a space craft state (position, velocity, acceleration and attitude) at one point in time.
*/
class SpacecraftState extends Timed
{
/*
* The spacecraft PVA coordinates at the specified time.
*/
@GenModel(property="Readonly")
contains TimedStampedPVACoordinates coordinates
/*
* The spacecraft attitude at the specified time.
*/
@GenModel(property="Readonly")
contains TimedStampedAngularCoordinates attitude
}
/*
* Defines an Orbit. An orbit defines the orbital parameter at a given point in time (orbital parameters can change with time.)
*/
abstract class Orbit extends Named, Described, Timed
{
/*
* The inertial frame used to represent this orbit.
*/
contains AbstractFrame referenceFrame
}
interface ValidityRangeProvider
{
/*
* Defines the earliest date for which the data is valid.
*/
derived readonly transient volatile EDate[1] fromValidDate
/*
* Defines the latest date for which the data is valid.
*/
derived readonly transient volatile EDate[1] toValidDate
/*
* Returns whether or not a specified date falls within the validity range.
*/
op boolean isDateInValidRange(EDate date)
}
/*
* Class that defines an orbit model. An orbit model specifies both initial condition (through the initial Orbit), and
* a propagation method (through the AbstractOrbitPropagator).
*/
@Apogy(hasCustomClass="true")
abstract class OrbitModel extends AbstractOrbitModel, ValidityRangeProvider
{
/*
* The frame in which the orbit is propagated.
*/
contains AbstractFrame referenceFrame
/*
* The attitude provider. Can be used to specify an attitude control law.
*/
contains AttitudeProvider[0..*] attitudeProvider
/*
* Propagate the current orbit to a specified time to get a Spacecraft state.
*/
op SpacecraftState propagate(EDate targetDate) throws Exception
/*
* Returns a list of SpacecraftState from startDate to endDate at time interval of timeInterval.
* @param timeInterval The time interval to get spacecraft states, in seconds.
*/
op List<SpacecraftState> getSpacecraftStates(EDate startDate, EDate endDate, @Apogy(units="s") double timeInterval) throws Exception
}
// Add start + stop date.
/*
* A class providing utilities methods for Orbits.
*/
@Apogy(isSingleton="true", hasCustomClass="true")
class ApogyCoreEnvironmentOrbitFacade
{
op boolean isDateInValidRange(EDate fromDate, EDate toDate, EDate date)
}