SpacecraftParameters.java

  1. /* Copyright 2002-2021 CS GROUP
  2.  * Licensed to CS GROUP (CS) under one or more
  3.  * contributor license agreements.  See the NOTICE file distributed with
  4.  * this work for additional information regarding copyright ownership.
  5.  * CS licenses this file to You under the Apache License, Version 2.0
  6.  * (the "License"); you may not use this file except in compliance with
  7.  * the License.  You may obtain a copy of the License at
  8.  *
  9.  *   http://www.apache.org/licenses/LICENSE-2.0
  10.  *
  11.  * Unless required by applicable law or agreed to in writing, software
  12.  * distributed under the License is distributed on an "AS IS" BASIS,
  13.  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14.  * See the License for the specific language governing permissions and
  15.  * limitations under the License.
  16.  */
  17. package org.orekit.files.ccsds.ndm.adm.apm;

  18. import org.orekit.files.ccsds.definitions.FrameFacade;
  19. import org.orekit.files.ccsds.section.CommentsContainer;

  20. /**
  21.  * Container for spacecraft parameters data.
  22.  * @author Bryan Cazabonne
  23.  * @since 10.2
  24.  */
  25. public class SpacecraftParameters extends CommentsContainer {

  26.     /** Coordinate system for the inertia tensor. */
  27.     private FrameFacade inertiaReferenceFrame;

  28.     /** Moment of Inertia about the 1-axis (kg.m²). */
  29.     private double i11;

  30.     /** Moment of Inertia about the 2-axis (kg.m²). */
  31.     private double i22;

  32.     /** Moment of Inertia about the 3-axis (kg.m²). */
  33.     private double i33;

  34.     /** Inertia Cross Product of the 1 and 2 axes (kg.m²). */
  35.     private double i12;

  36.     /** Inertia Cross Product of the 1 and 3 axes (kg.m²). */
  37.     private double i13;

  38.     /** Inertia Cross Product of the 2 and 3 axes (kg.m²). */
  39.     private double i23;

  40.     /** Simple constructor.
  41.      */
  42.     public SpacecraftParameters() {
  43.         inertiaReferenceFrame = null;
  44.         i11             = Double.NaN;
  45.         i22             = Double.NaN;
  46.         i33             = Double.NaN;
  47.         i12             = Double.NaN;
  48.         i13             = Double.NaN;
  49.         i23             = Double.NaN;
  50.     }

  51.     /** {@inheritDoc} */
  52.     @Override
  53.     public void validate(final double version) {
  54.         super.validate(version);
  55.         checkNotNaN(i11, SpacecraftParametersKey.I11);
  56.         checkNotNaN(i22, SpacecraftParametersKey.I22);
  57.         checkNotNaN(i33, SpacecraftParametersKey.I33);
  58.         checkNotNaN(i12, SpacecraftParametersKey.I12);
  59.         checkNotNaN(i13, SpacecraftParametersKey.I13);
  60.         checkNotNaN(i23, SpacecraftParametersKey.I23);
  61.     }

  62.     /**
  63.      * Get the coordinate system for the inertia tensor.
  64.      * @return the coordinate system for the inertia tensor
  65.      */
  66.     public FrameFacade getInertiaReferenceFrame() {
  67.         return inertiaReferenceFrame;
  68.     }

  69.     /**
  70.      * Set the coordinate system for the inertia tensor.
  71.      * @param inertiaReferenceFrame frame to be set
  72.      */
  73.     public void setInertiaReferenceFrame(final FrameFacade inertiaReferenceFrame) {
  74.         refuseFurtherComments();
  75.         this.inertiaReferenceFrame = inertiaReferenceFrame;
  76.     }

  77.     /**
  78.      * Get the moment of Inertia about the 1-axis (N.m²).
  79.      * @return the moment of Inertia about the 1-axis.
  80.      */
  81.     public double getI11() {
  82.         return i11;
  83.     }

  84.     /**
  85.      * Set the moment of Inertia about the 1-axis (N.m²).
  86.      * @param i11 moment of Inertia about the 1-axis
  87.      */
  88.     public void setI11(final double i11) {
  89.         refuseFurtherComments();
  90.         this.i11 = i11;
  91.     }

  92.     /**
  93.      * Get the moment of Inertia about the 2-axis (N.m²).
  94.      * @return the moment of Inertia about the 2-axis.
  95.      */
  96.     public double getI22() {
  97.         return i22;
  98.     }

  99.     /**
  100.      * Set the moment of Inertia about the 2-axis (N.m²).
  101.      * @param i22 moment of Inertia about the 2-axis
  102.      */
  103.     public void setI22(final double i22) {
  104.         refuseFurtherComments();
  105.         this.i22 = i22;
  106.     }

  107.     /**
  108.      * Get the moment of Inertia about the 3-axis (N.m²).
  109.      * @return the moment of Inertia about the 3-axis.
  110.      */
  111.     public double getI33() {
  112.         return i33;
  113.     }

  114.     /**
  115.      * Set the moment of Inertia about the 3-axis (N.m²).
  116.      * @param i33 moment of Inertia about the 3-axis
  117.      */
  118.     public void setI33(final double i33) {
  119.         refuseFurtherComments();
  120.         this.i33 = i33;
  121.     }

  122.     /**
  123.      * Get the moment of Inertia about the 1 and 2 axes (N.m²).
  124.      * @return the moment of Inertia about the 1 and 2 axes.
  125.      */
  126.     public double getI12() {
  127.         return i12;
  128.     }

  129.     /**
  130.      * Set the moment of Inertia about the 1 and 2 axes (N.m²).
  131.      * @param i12 moment of Inertia about the 1 and 2 axes
  132.      */
  133.     public void setI12(final double i12) {
  134.         refuseFurtherComments();
  135.         this.i12 = i12;
  136.     }

  137.     /**
  138.      * Get the moment of Inertia about the 1 and 3 axes (N.m²).
  139.      * @return the moment of Inertia about the 1 and 3 axes.
  140.      */
  141.     public double getI13() {
  142.         return i13;
  143.     }

  144.     /**
  145.      * Set the moment of Inertia about the 1 and 3 axes (N.m²).
  146.      * @param i13 moment of Inertia about the 1 and 3 axes
  147.      */
  148.     public void setI13(final double i13) {
  149.         refuseFurtherComments();
  150.         this.i13 = i13;
  151.     }

  152.     /**
  153.      * Get the moment of Inertia about the 2 and 3 axes (N.m²).
  154.      * @return the moment of Inertia about the 2 and 3 axes.
  155.      */
  156.     public double getI23() {
  157.         return i23;
  158.     }

  159.     /**
  160.      * Set the moment of Inertia about the 2 and 3 axes (N.m²).
  161.      * @param i23 moment of Inertia about the 2 and 3 axes
  162.      */
  163.     public void setI23(final double i23) {
  164.         refuseFurtherComments();
  165.         this.i23 = i23;
  166.     }

  167. }