blob: cb6738b49c1f163764b916cc23dc63e6f55b22ee [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
// Sebastien Gemme
//
// SPDX-License-Identifier: EPL-1.0
// *****************************************************************************
@GenModel(prefix="ApogyExamplesAntenna",
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="ApogyExamplesAntenna",
childCreationExtenders="true",
extensibleProviderFactory="true",
suppressGenModelAnnotations="false",
dynamicTemplates="true",
templateDirectory="platform:/plugin/org.eclipse.apogy.common.emf.codegen/templates")
@GenModel(modelDirectory="/org.eclipse.apogy.examples.antenna/src-gen")
@GenModel(editDirectory="/org.eclipse.apogy.examples.antenna.edit/src-gen")
package org.eclipse.apogy.examples.antenna
import org.eclipse.apogy.addons.sensors.fov.ConicalFieldOfView
import org.eclipse.apogy.common.Apogy
/*
* Examples Antenna Facade.
*/
@Apogy(isSingleton="true", hasCustomClass="true")
class ApogyExamplesAntennaFacade{
/**
* Returns a new PTUDishAntenna object, which has the same type as
* the given PTU dish antenna.
*
* @param ptuDishAntenna The PTU dish antenna with a particular implementation.
* @return The new power system, which has the same type as the old one
*/
op PTUDishAntenna makePTUDishAntennaSameType(PTUDishAntenna ptuDishAntenna)
}
/**
* This class represents the abstract concept of an antenna.
*/
@Apogy(hasCustomClass="true")
abstract class Antenna
{
/**
* This is whether or not the antenna has been successfully
* initialized; initially false
* @see #init()
*/
@GenModel(children="false",
notify="true",
property="Readonly",
propertyCategory="Status")
boolean initialized = "false"
/**
* This operation is used to perform the operations
* (if any) required to initialize the antenna
* @return Whether or not the antenna was successfully initialized
*/
op boolean init()
}
/**
* This class represents an abstract dish-based variety of antenna,
* which has a particular conical field of view (FOV).
*/
@Apogy(hasCustomItemProvider="true")
abstract class DishAntenna extends Antenna
{
/**
* This is the (conical) field of view that all dish-based antennas possess
*/
@GenModel(children="true",
notify="true",
property="Readonly",
propertyCategory="Field Of View")
contains ConicalFieldOfView[1] fov
}
/**
* This class represents an abstract dish-based antenna,
* which is mounted upon a pan-tilt unit (PTU). Naturally,
* the pan and tilt angles are kept track of and can be changed
* accordingly. In addition, there is an option for the
* antenna to track the position of the sun in the sky.
*/
@Apogy(hasCustomClass="true", hasCustomItemProvider="true")
abstract class PTUDishAntenna extends DishAntenna
{
/**
* This is the current pan angle (given in radians) of the
* PTU, that the antenna is attached to.
*/
@GenModel(children="false",
notify="true",
property="Readonly",
propertyCategory="PTU Angles")
@Apogy(units="rad")
double panAngle
/**
* This is the current tilt angle (given in radians) of the PTU
* that the antenna is attached to.
*/
@GenModel(children="false",
notify="true",
property="Readonly",
propertyCategory="PTU Angles")
@Apogy(units="rad")
double tiltAngle
/**
* This is whether or not the PTU antenna should be tracking
* the sun.
*/
@GenModel(children="false",
notify="true",
property="Readonly",
propertyCategory="Tracking")
boolean trackingSun = "false"
/**
* Command the PTU (and implicitly the antenna) to move to the
* specified pan and tilt angles.
*
* @param panAngle The target pan angle for the PTU (given in radians.)
* @param tiltAngle The target tilt angle for the PTU (given in radians.)
*/
op void moveTo(@Apogy(units="rad") double panAngle,
@Apogy(units="rad") double tiltAngle)
/**
* This is used to toggle whether the PTU (and implicitly the
* antenna mounted on it) should be following the sun. If
* true, then the antenna will continue tracking the sun until
* it is told otherwise.
*
* @param track Whether or not the PTU antenna should be following the sun.
*/
op void trackSun(boolean track)
}
/*
* This is a specific implementation of the PTU dish antenna, in which
* all operations are stubs and hence, non-functional; the operations
* should simply log a message, indicating that they were performed.
*/
@Apogy(hasCustomClass="true", hasCustomItemProvider="true")
class PTUDishAntennaStub extends PTUDishAntenna
{
/*
* For specific implementation details,
* see {@link org.eclipse.apogy.examples.antenna.impl.PTUDishAntennaStubImpl}
*/
}
/*
* This is a simulated implementation of the PTU dish antenna, where all
* operations are executed upon a simulated (i.e. virtual) antenna. While
* there are no physical components interacted with, it attempts to emulate,
* wherever possible, the actions and results of its real world counterpart(s).
*/
@Apogy(hasCustomClass="true", hasCustomItemProvider="true")
class PTUDishAntennaSimulated extends PTUDishAntenna
{
/*
* For specific implementation details,
* see {@link org.eclipse.apogy.examples.antenna.impl.PTUDishAntennaSimulatedImpl}
*/
}