Example #1
0
 /// <summary>
 /// Constructor for scripted subsystems
 /// </summary>
 /// <param name="ADCSNode"></param>
 /// <param name="asset"></param>
 public ADCS(XmlNode ADCSNode, Asset asset)
 {
     Asset = asset;
     GetSubNameFromXmlNode(ADCSNode);
     POINTVEC_KEY = new StateVarKey<Matrix<double>>(Asset.Name + "." + "eci_pointing_vector(xyz)");
     addKey(POINTVEC_KEY);
 }
Example #2
0
        public void TemplatedGetProfileUnitTest()
        {
            SystemState state = new SystemState();
            HSFProfile<int> intProf = new HSFProfile<int>(0, 1);
            intProf.Add(1, 2);
            intProf.Add(2, -1);

            StateVarKey<int> intKey = new StateVarKey<int>("testIntVar");
            state.SetProfile(intKey, intProf);

            HSFProfile<double> doubleProf = new HSFProfile<double>(0, 1);
            doubleProf.Add(1, 2);
            doubleProf.Add(2, -1);

            StateVarKey<double> doubleKey = new StateVarKey<double>("testDoubleVar");
            state.SetProfile(doubleKey, doubleProf);

            HSFProfile<Matrix<double>> matrixProf = new HSFProfile<Matrix<double>>(0, new Matrix<double>(1, 2, 1));
            matrixProf.Add(1, new Matrix<double>(1, 2, 2));
            matrixProf.Add(2, new Matrix<double>(1, 2, -1));

            var matrixKey = new StateVarKey<Matrix<double>>("testMatrixVar");
            state.SetProfile(matrixKey, matrixProf);

            HSFProfile<int> newIntProf = state.GetProfile(intKey);
            HSFProfile<double> newDoubleProf = state.GetProfile(doubleKey);
            HSFProfile<Matrix<double>> newMatrixProf = state.GetProfile(matrixKey);

            Console.WriteLine();
        }
Example #3
0
 /// <summary>
 /// Constructor for built in subsystem
 /// Defaults: lowQualityPixels = 5000, midQualityPixels = 10000, highQualityPixels = 15000
 /// lowQualityTime = 3s, midQyalityTime = 5s, highQualityTime = 7s
 /// </summary>
 /// <param name="EOSensorXmlNode"></param>
 /// <param name="dependencies"></param>
 /// <param name="asset"></param>
 public EOSensor(XmlNode EOSensorXmlNode, Dependency dependencies, Asset asset)
 {
     DefaultSubName = "EOSensor";
     Asset = asset;
     GetSubNameFromXmlNode(EOSensorXmlNode);
     PIXELS_KEY = new StateVarKey<double>(Asset.Name +"." + "numpixels");
     INCIDENCE_KEY = new StateVarKey<double>(Asset.Name + "." + "incidenceangle");
     EOON_KEY = new StateVarKey<bool>(Asset.Name + "." + "eosensoron");
     addKey(PIXELS_KEY);
     addKey(INCIDENCE_KEY);
     addKey(EOON_KEY);
     DependentSubsystems = new List<Subsystem>();
     SubsystemDependencyFunctions = new Dictionary<string, Delegate>();
     if (EOSensorXmlNode.Attributes["lowQualityPixels"] != null)
         _lowQualityPixels = (double)Convert.ChangeType(EOSensorXmlNode.Attributes["lowQualityPixels"].Value.ToString(), typeof(double));
     if (EOSensorXmlNode.Attributes["lowQualityPixels"] != null)
         _lowQualityTime = (double)Convert.ChangeType(EOSensorXmlNode.Attributes["lowQualityTime"].Value.ToString(), typeof(double));
     if (EOSensorXmlNode.Attributes["midQualityPixels"] != null)
         _midQualityPixels = (double)Convert.ChangeType(EOSensorXmlNode.Attributes["midQualityPixels"].Value.ToString(), typeof(double));
     if (EOSensorXmlNode.Attributes["midQualityTime"] != null)
         _midQualityTime = (double)Convert.ChangeType(EOSensorXmlNode.Attributes["midQualityTime"].Value.ToString(), typeof(double));
     if (EOSensorXmlNode.Attributes["highQualityPixels"] != null)
         _highQualityPixels = (double)Convert.ChangeType(EOSensorXmlNode.Attributes["highQualityPixels"].Value.ToString(), typeof(double));
     if (EOSensorXmlNode.Attributes["highQualityTime"] != null)
         _highQualityTime = (double)Convert.ChangeType(EOSensorXmlNode.Attributes["highQualityTime"].Value.ToString(), typeof(double));
     dependencies.Add("PowerfromEOSensor"+"."+Asset.Name, new Func<Event, HSFProfile<double>>(POWERSUB_PowerProfile_EOSENSORSUB));
     dependencies.Add("SSDRfromEOSensor" + "." + Asset.Name, new Func<Event, HSFProfile<double>>(SSDRSUB_NewDataProfile_EOSENSORSUB));
 }
Example #4
0
 /// <summary>
 /// Constructor for scripted subsystem
 /// </summary>
 /// <param name="CommXmlNode"></param>
 /// <param name="asset"></param>
 public Comm(XmlNode CommXmlNode, Asset asset)
 {
     DefaultSubName = "Comm";
     Asset = asset;
     GetSubNameFromXmlNode(CommXmlNode);
     DATARATE_KEY = new StateVarKey<double>(Asset.Name + "." + "datarate(mb/s)");
     addKey(DATARATE_KEY);
 }
Example #5
0
 /// <summary>
 /// Constructor for use by scripted subsystem
 /// </summary>
 /// <param name="SSDRXmlNode"></param>
 /// <param name="asset"></param>
 public SSDR(XmlNode SSDRXmlNode, Asset asset)
 {
     DefaultSubName = "SSDR";
     Asset = asset;
     GetSubNameFromXmlNode(SSDRXmlNode);
     if (SSDRXmlNode.Attributes["bufferSize"] != null)
         _bufferSize = (double)Convert.ChangeType(SSDRXmlNode.Attributes["bufferSize"].Value.ToString(), typeof(double));
     DATABUFFERRATIO_KEY = new StateVarKey<double>(Asset.Name + "." + "databufferfillratio");
     addKey(DATABUFFERRATIO_KEY);
 }
Example #6
0
 /// <summary>
 /// Constructor for built in subsystem
 /// </summary>
 /// <param name="CommXmlNode"></param>
 /// <param name="dependencies"></param>
 /// <param name="asset"></param>
 public Comm(XmlNode CommXmlNode, Dependency dependencies, Asset asset)
 {
     DefaultSubName = "Comm";
     Asset = asset;
     GetSubNameFromXmlNode(CommXmlNode);
     SubsystemDependencyFunctions = new Dictionary<string, Delegate>();
     DependentSubsystems = new List<Subsystem>();
     DATARATE_KEY = new StateVarKey<double>(Asset.Name + "." + "datarate(mb/s)");
     addKey(DATARATE_KEY);
     dependencies.Add("PowerfromComm" + "." + Asset.Name, new Func<Event, HSFProfile<double>>(POWERSUB_PowerProfile_COMMSUB));
 }
Example #7
0
 /// <summary>
 /// Constructor for built in subsystem
 /// Default: BufferSize = 4098
 /// </summary>
 /// <param name="SSDRXmlNode"></param>
 /// <param name="dependencies"></param>
 /// <param name="asset"></param>
 public SSDR(XmlNode SSDRXmlNode, Dependency dependencies, Asset asset)
 {
     DefaultSubName = "SSDR";
     Asset = asset;
     GetSubNameFromXmlNode(SSDRXmlNode);
     if (SSDRXmlNode.Attributes["bufferSize"] != null)
         _bufferSize = (double)Convert.ChangeType(SSDRXmlNode.Attributes["bufferSize"].Value.ToString(), typeof(double));
     DATABUFFERRATIO_KEY = new StateVarKey<double>(Asset.Name + "." +"databufferfillratio");
     addKey(DATABUFFERRATIO_KEY);
     SubsystemDependencyFunctions = new Dictionary<string, Delegate>();
     DependentSubsystems = new List<Subsystem>();
     dependencies.Add("PowerfromSSDR" + "." + Asset.Name, new Func<Event, HSFProfile<double>>(POWERSUB_PowerProfile_SSDRSUB));
     dependencies.Add("CommfromSSDR" + "." + Asset.Name, new Func<Event, HSFProfile<double>>(COMMSUB_DataRateProfile_SSDRSUB));
     dependencies.Add("EvalfromSSDR" + "." + Asset.Name, new Func<Event, double>(EVAL_DataRateProfile_SSDRSUB));
 }
Example #8
0
 /// <summary>
 /// Constructor for built in subsystem
 /// </summary>
 /// <param name="PowerNode"></param>
 /// <param name="asset"></param>
 public Power(XmlNode PowerNode, Asset asset)
 {
     DefaultSubName = "Power";
     Asset = asset;
     GetSubNameFromXmlNode(PowerNode);
     DOD_KEY = new StateVarKey<double>(Asset.Name + "." + "depthofdischarge");
     POWIN_KEY = new StateVarKey<double>(Asset.Name + "." + "solarpanelpowerin");
     addKey(DOD_KEY);
     addKey(POWIN_KEY);
     if (PowerNode.Attributes["batterySize"] != null)
         _batterySize = (double)Convert.ChangeType(PowerNode.Attributes["batterySize"].Value, typeof(double));
     if (PowerNode.Attributes["fullSolarPower"] != null)
         _fullSolarPanelPower = (double)Convert.ChangeType(PowerNode.Attributes["fullSolarPower"].Value, typeof(double));
     if (PowerNode.Attributes["penumbraSolarPower"] != null)
         _penumbraSolarPanelPower = (double)Convert.ChangeType(PowerNode.Attributes["penumbraSolarPower"].Value, typeof(double));
 }
Example #9
0
 /// <summary>
 /// Constructor for built in subsystems
 /// Defaults: Slew time: 10s
 /// </summary>
 /// <param name="ADCSNode"></param>
 /// <param name="dependencies"></param>
 /// <param name="asset"></param>
 public ADCS(XmlNode ADCSNode, Dependency dependencies, Asset asset) 
 {
     DefaultSubName = "Adcs";
     Asset = asset;
     GetSubNameFromXmlNode(ADCSNode);
     /*double slewTime;
     if (ADCSNode.Attributes["timetoslew"].Value != null)
     {
         Double.TryParse(ADCSNode.Attributes["slewTime"].Value, out slewTime);
         _timetoslew = slewTime;
     }*/
     POINTVEC_KEY = new StateVarKey<Matrix<double>>(Asset.Name + "." + "eci_pointing_vector(xyz)");
     addKey(POINTVEC_KEY);
     DependentSubsystems = new List<Subsystem>();
     SubsystemDependencyFunctions = new Dictionary<string, Delegate>();
     dependencies.Add("PowerfromADCS"+"."+Asset.Name, new Func<Event, HSFProfile<double>>(POWERSUB_PowerProfile_ADCSSUB));
 }
Example #10
0
 /// <summary>
 /// Constructor for built in subsystem
 /// Defaults: batterySize = 1000000, fullSolarPanelPower =150, penumbraSolarPanelPower = 75
 /// </summary>
 /// <param name="PowerNode"></param>
 /// <param name="dependencies"></param>
 public Power(XmlNode PowerNode, Dependency dependencies, Asset asset) 
 {
     DefaultSubName = "Power";
     Asset = asset;
     GetSubNameFromXmlNode(PowerNode);
     DOD_KEY = new StateVarKey<double>(Asset.Name + "." + "depthofdischarge");
     POWIN_KEY = new StateVarKey<double>(Asset.Name + "." + "solarpanelpowerin");
     addKey(DOD_KEY);
     addKey(POWIN_KEY);
     SubsystemDependencyFunctions = new Dictionary<string, Delegate>();
     DependentSubsystems = new List<Subsystem>();
     if (PowerNode.Attributes["batterySize"] != null)
         _batterySize = (double)Convert.ChangeType(PowerNode.Attributes["batterySize"].Value, typeof(double));
     if (PowerNode.Attributes["fullSolarPower"] != null)
         _fullSolarPanelPower = (double)Convert.ChangeType(PowerNode.Attributes["fullSolarPower"].Value, typeof(double));
     if(PowerNode.Attributes["penumbraSolarPower"] != null)
         _penumbraSolarPanelPower = (double)Convert.ChangeType(PowerNode.Attributes["penumbraSolarPower"].Value, typeof(double));
 }
Example #11
0
 /// <summary>
 /// Constructor for scripted subsystem
 /// </summary>
 /// <param name="EOSensorXmlNode"></param>
 /// <param name="asset"></param>
 public EOSensor(XmlNode EOSensorXmlNode, Asset asset)
 {
     DefaultSubName = "EOSensor";
     Asset = asset;
     GetSubNameFromXmlNode(EOSensorXmlNode);
     PIXELS_KEY = new StateVarKey<double>(Asset.Name + "." + "numpixels");
     INCIDENCE_KEY = new StateVarKey<double>(Asset.Name + "." + "incidenceangle");
     EOON_KEY = new StateVarKey<bool>(Asset.Name + "." + "eosensoron");
     addKey(PIXELS_KEY);
     addKey(INCIDENCE_KEY);
     addKey(EOON_KEY);
     if (EOSensorXmlNode.Attributes["lowQualityPixels"] != null)
         _lowQualityPixels = (double)Convert.ChangeType(EOSensorXmlNode.Attributes["lowQualityPixels"].Value.ToString(), typeof(double));
     if (EOSensorXmlNode.Attributes["lowQualityPixels"] != null)
         _lowQualityTime = (double)Convert.ChangeType(EOSensorXmlNode.Attributes["lowQualityTime"].Value.ToString(), typeof(double));
     if (EOSensorXmlNode.Attributes["midQualityPixels"] != null)
         _midQualityPixels = (double)Convert.ChangeType(EOSensorXmlNode.Attributes["midQualityPixels"].Value.ToString(), typeof(double));
     if (EOSensorXmlNode.Attributes["midQualityTime"] != null)
         _midQualityTime = (double)Convert.ChangeType(EOSensorXmlNode.Attributes["midQualityTime"].Value.ToString(), typeof(double));
     if (EOSensorXmlNode.Attributes["highQualityPixels"] != null)
         _highQualityPixels = (double)Convert.ChangeType(EOSensorXmlNode.Attributes["highQualityPixels"].Value.ToString(), typeof(double));
     if (EOSensorXmlNode.Attributes["highQualityTime"] != null)
         _highQualityTime = (double)Convert.ChangeType(EOSensorXmlNode.Attributes["highQualityTime"].Value.ToString(), typeof(double));
 }
Example #12
0
 public void addKey(StateVarKey<Quat> keyIn) {
     if (Qkeys == null) //Only construct what you need
     {
         Qkeys = new List<StateVarKey<Quat>>();
     }
     Qkeys.Add(keyIn);
 }
Example #13
0
 public void addKey(StateVarKey<Matrix<double>> keyIn) {
     if (Mkeys == null) //Only construct what you need
     {
         Mkeys = new List<StateVarKey<Matrix<double>>>();
     }
     Mkeys.Add(keyIn);
 }
Example #14
0
 public void addKey(StateVarKey<bool> keyIn) {
     if (Bkeys == null) //Only construct what you need
     {
         Bkeys = new List<StateVarKey<bool>>();
     }
     Bkeys.Add(keyIn);
 }
Example #15
0
 public void addKey(StateVarKey<double> keyIn) {
     if (Dkeys == null) //Only construct what you need
     {
         Dkeys = new List<StateVarKey<double>>();
     }
     Dkeys.Add(keyIn);
 }