Esempio n. 1
0
 public override void EnableGauges(GaugeSet set)
 {
     foreach (int id in set)
     {
         set.SetGaugeEnabled(id, false);
     }
     //
     set.SetGaugeEnabled(Constants.WINDOW_ID_GAUGE_BIOME, true);
     set.SetGaugeEnabled(Constants.WINDOW_ID_GAUGE_LATITUDE, true);
     set.SetGaugeEnabled(Constants.WINDOW_ID_GAUGE_LONGITUDE, true);
     set.SetGaugeEnabled(Constants.WINDOW_ID_GAUGE_SETS, true);
     set.SetGaugeEnabled(Constants.WINDOW_ID_GAUGE_INDICATOR, true);
     set.SetGaugeEnabled(Constants.WINDOW_ID_GAUGE_CAM, true);
     //
     set.SetGaugeEnabled(Constants.WINDOW_ID_GAUGE_ORBIT, true);
     set.SetGaugeEnabled(Constants.WINDOW_ID_GAUGE_INCL, true);
     set.SetGaugeEnabled(Constants.WINDOW_ID_GAUGE_TIMETOPEA, true);
     set.SetGaugeEnabled(Constants.WINDOW_ID_GAUGE_TIMETOAPA, true);
     set.SetGaugeEnabled(Constants.WINDOW_ID_GAUGE_APA, true);
     set.SetGaugeEnabled(Constants.WINDOW_ID_GAUGE_PEA, true);
     //
     set.SetGaugeEnabled(Constants.WINDOW_ID_GAUGE_FUEL, true);
     set.SetGaugeEnabled(Constants.WINDOW_ID_GAUGE_OXID, true);
     set.SetGaugeEnabled(Constants.WINDOW_ID_GAUGE_EVAMP, true);
     set.SetGaugeEnabled(Constants.WINDOW_ID_GAUGE_MONO, true);
     set.SetGaugeEnabled(Constants.WINDOW_ID_GAUGE_AMP, true);
     set.SetGaugeEnabled(Constants.WINDOW_ID_GAUGE_CHARGE, true);
 }
Esempio n. 2
0
            public override void DoLayout(GaugeSet set)
            {
                Reset();

                AddToTopBlock(set, Constants.WINDOW_ID_GAUGE_SETS);
                AddToTopBlock(set, Constants.WINDOW_ID_GAUGE_INDICATOR);
                AddToTopBlock(set, Constants.WINDOW_ID_GAUGE_CAM);

                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_ORBIT);
                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_INCL);
                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_TIMETOPEA);
                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_TIMETOAPA);
                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_PEA);
                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_APA);


                AddToRightNavballBlock(set, Constants.WINDOW_ID_GAUGE_FUEL);
                AddToRightNavballBlock(set, Constants.WINDOW_ID_GAUGE_OXID);
                AddToRightNavballBlock(set, Constants.WINDOW_ID_GAUGE_EVAMP);
                AddToRightNavballBlock(set, Constants.WINDOW_ID_GAUGE_MONO);
                AddToRightNavballBlock(set, Constants.WINDOW_ID_GAUGE_AMP);
                AddToRightNavballBlock(set, Constants.WINDOW_ID_GAUGE_CHARGE);


                // horizontal gauges
                int hDY = (int)(configuration.horizontalGaugeHeight * gaugeScaling) + Gauges.LAYOUT_GAP;

                set.SetWindowPosition(Constants.WINDOW_ID_GAUGE_BIOME, 10, 60 + 0 * hDY);
                set.SetWindowPosition(Constants.WINDOW_ID_GAUGE_LATITUDE, 10, 60 + 1 * hDY);
                set.SetWindowPosition(Constants.WINDOW_ID_GAUGE_LONGITUDE, 10, 60 + 2 * hDY);
            }
Esempio n. 3
0
 public override void EnableGauges(GaugeSet set)
 {
     foreach (int id in set)
     {
         set.SetGaugeEnabled(id, true);
     }
 }
Esempio n. 4
0
 public void copyPositionsFrom(GaugeSet source)
 {
     foreach (int key in source.windowPositions.Keys)
     {
         SetWindowPosition(key, source.GetWindowPosition(key));
     }
 }
Esempio n. 5
0
            public void Layout(GaugeSet set)
            {
                Log.Info("layout " + GetType() + ", set " + set);
                //
                // move all gauges to 0/0 to find gauges that are unaffected by layout
                foreach (AbstractGauge g in gauges)
                {
                    int id = g.GetWindowId();
                    set.SetWindowPosition(id, Constants.ORIGIN);
                }
                //
                DoLayout(set);
                //
                EnableGauges(set);

                Reset();
                foreach (AbstractGauge g in gauges)
                {
                    int id = g.GetWindowId();
                    if (set.GetWindowPosition(id).Equals(Constants.ORIGIN))
                    {
                        AddToSpare(set, id);
                    }
                }

                Log.Detail("layout done for " + set);
            }
 public override void EnableGauges(GaugeSet set)
 {
     DisableAllgauges(set);
     //
     EnableAllHorizontalGauges(set);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_SETS, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_INDICATOR, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_CAM, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_G, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_MASS, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_THRUST, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_TWR, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_HSPD, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_THROTTLE, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_SPD, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_VSI, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_ALTIMETER, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_RADAR_ALTIMETER, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_FUEL, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_OXID, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_FLOW, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_MONO, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_CHARGE, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_AMP, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_PROPELLANT, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_EVAMP, true);
 }
Esempio n. 7
0
 public override void EnableGauges(GaugeSet set)
 {
     DisableAllgauges(set);
     //
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_SETS, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_INDICATOR, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_CAM, true);
     //
     EnableAllHorizontalGauges(set);
     //
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_IMPACT, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_ATM, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_VACCL, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_HACCL, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_ACCL, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_VAI, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_GLIDE, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_VVI, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_AOA, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_SPD, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_VSI, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_HSPD, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_ALTIMETER, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_RADAR_ALTIMETER, true);
     //
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_FUEL, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_FLOW, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_OXID, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_AIRIN, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_AIRPCT, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_PROPELLANT, true);
 }
            public override void DoLayout(GaugeSet set)
            {
                Reset();

                AddToTopBlock(set, Constants.WINDOW_ID_GAUGE_SETS);
                AddToTopBlock(set, Constants.WINDOW_ID_GAUGE_INDICATOR);
                AddToTopBlock(set, Constants.WINDOW_ID_GAUGE_CAM);

                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_ORBIT);
                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_INCL);
                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_TIMETOPEA);
                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_TIMETOAPA);
                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_PEA);
                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_APA);
                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_VTGT);
                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_DTGT);
                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_THRUST);
                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_OSPD);

                AddToRightNavballBlock(set, Constants.WINDOW_ID_GAUGE_FUEL);
                AddToRightNavballBlock(set, Constants.WINDOW_ID_GAUGE_OXID);
                AddToRightNavballBlock(set, Constants.WINDOW_ID_GAUGE_EVAMP);
                AddToRightNavballBlock(set, Constants.WINDOW_ID_GAUGE_MONO);
                AddToRightNavballBlock(set, Constants.WINDOW_ID_GAUGE_AMP);
                AddToRightNavballBlock(set, Constants.WINDOW_ID_GAUGE_CHARGE);

                // horizontal gauges
                LayoutHorizontalGauges(set);
            }
 public override void EnableGauges(GaugeSet set)
 {
     DisableAllgauges(set);
     //
     EnableAllHorizontalGauges(set);
     //
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_SETS, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_INDICATOR, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_CAM, true);
     //
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_THRUST, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_VTGT, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_DTGT, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_OSPD, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_ORBIT, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_INCL, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_TIMETOPEA, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_TIMETOAPA, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_APA, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_PEA, true);
     //
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_FUEL, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_OXID, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_EVAMP, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_MONO, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_AMP, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_CHARGE, true);
 }
Esempio n. 10
0
            public override void DoLayout(GaugeSet set)
            {
                Reset();

                AddToTopBlock(set, Constants.WINDOW_ID_GAUGE_SETS);
                AddToTopBlock(set, Constants.WINDOW_ID_GAUGE_INDICATOR);
                AddToTopBlock(set, Constants.WINDOW_ID_GAUGE_CAM);
                AddToTopBlock(set, Constants.WINDOW_ID_GAUGE_IMPACT);

                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_IMPACT);
                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_ATM);
                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_VACCL);
                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_HACCL);
                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_ACCL);
                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_GLIDE);
                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_VAI);
                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_VVI);
                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_AOA);
                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_SPD);
                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_VSI);
                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_HSPD);
                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_ALTIMETER);
                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_RADAR_ALTIMETER);

                AddToRightNavballBlock(set, Constants.WINDOW_ID_GAUGE_FUEL);
                AddToRightNavballBlock(set, Constants.WINDOW_ID_GAUGE_OXID);
                AddToRightNavballBlock(set, Constants.WINDOW_ID_GAUGE_FLOW);
                AddToRightNavballBlock(set, Constants.WINDOW_ID_GAUGE_AIRIN);
                AddToRightNavballBlock(set, Constants.WINDOW_ID_GAUGE_AIRPCT);
                AddToRightNavballBlock(set, Constants.WINDOW_ID_GAUGE_PROPELLANT);

                // horizontal gauges
                LayoutHorizontalGauges(set);
            }
Esempio n. 11
0
 protected void EnableAllgauges(GaugeSet set)
 {
     foreach (int id in set)
     {
         SetGaugeEnabled(set, id, true);
     }
 }
Esempio n. 12
0
 private bool Declutter(GaugeSet set, int id)
 {
     foreach (int other in set)
     {
         if (!set.IsGaugeEnabled(other))
         {
             continue;
         }
         if (id != other)
         {
             Pair <int, int> position = set.GetWindowPosition(id);
             Pair <int, int> cmp      = set.GetWindowPosition(other);
             if (Math.Abs(position.first - cmp.first) < MIN_GAUGE_DISTANCE && Math.Abs(position.second - cmp.second) < MIN_GAUGE_DISTANCE)
             {
                 int x = position.first + MIN_GAUGE_DISTANCE;
                 int y = position.second + MIN_GAUGE_DISTANCE;
                 if (x >= Screen.width - NanoGauges.configuration.verticalGaugeWidth)
                 {
                     x = 0;
                 }
                 if (y >= Screen.height - NanoGauges.configuration.verticalGaugeHeight)
                 {
                     y = 0;
                 }
                 Pair <int, int> newPosition = new Pair <int, int>(x, y);
                 set.SetWindowPosition(id, newPosition);
                 return(true);
             }
         }
     }
     return(false);
 }
Esempio n. 13
0
            public override void DoLayout(GaugeSet set)
            {
                Reset();

                AddToTopBlock(set, Constants.WINDOW_ID_GAUGE_SETS);
                AddToTopBlock(set, Constants.WINDOW_ID_GAUGE_INDICATOR);
                AddToTopBlock(set, Constants.WINDOW_ID_GAUGE_CAM);

                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_G);
                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_MASS);
                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_THRUST);
                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_TWR);

                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_HSPD);
                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_THROTTLE);
                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_SPD);
                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_VSI);
                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_ALTIMETER);
                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_RADAR_ALTIMETER);


                AddToRightNavballBlock(set, Constants.WINDOW_ID_GAUGE_FUEL);
                AddToRightNavballBlock(set, Constants.WINDOW_ID_GAUGE_OXID);
                AddToRightNavballBlock(set, Constants.WINDOW_ID_GAUGE_FLOW);
                AddToRightNavballBlock(set, Constants.WINDOW_ID_GAUGE_MONO);
                AddToRightNavballBlock(set, Constants.WINDOW_ID_GAUGE_CHARGE);
                AddToRightNavballBlock(set, Constants.WINDOW_ID_GAUGE_AMP);
                AddToRightNavballBlock(set, Constants.WINDOW_ID_GAUGE_PROPELLANT);
                AddToRightNavballBlock(set, Constants.WINDOW_ID_GAUGE_EVAMP);


                // horizontal gauges
                LayoutHorizontalGauges(set);
            }
Esempio n. 14
0
 protected void DisableAllgauges(GaugeSet set)
 {
     foreach (int id in set)
     {
         SetGaugeEnabled(set, id, false);
     }
 }
Esempio n. 15
0
 protected void AddToTopBlock(GaugeSet set, int windowId)
 {
     if (gauges.ContainsId(windowId))
     {
         SetGaugePosition(set, windowId, TopBlock(topBlockIndex++));
     }
 }
Esempio n. 16
0
 protected void AddToLeftNavballBlock(GaugeSet set, int windowId)
 {
     if (gauges.ContainsId(windowId))
     {
         SetGaugePosition(set, windowId, LeftNavballBlock(leftNavBlockIndex++));
     }
 }
Esempio n. 17
0
            public void CopySelectorPositionFrom(GaugeSet.ID id)
            {
                GaugeSet        source   = GaugeSetPool.instance.GetGaugeSet(id);
                Pair <int, int> position = source.GetWindowPosition(Constants.WINDOW_ID_GAUGE_SETS);

                foreach (GaugeSet set in GaugeSetPool.instance)
                {
                    set.SetWindowPosition(Constants.WINDOW_ID_GAUGE_SETS, position);
                }
            }
Esempio n. 18
0
 //
 protected void EnableAllHorizontalGauges(GaugeSet set)
 {
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_VESSEL, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_BIOME, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_LATITUDE, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_LONGITUDE, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_CAMERA, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_NAV, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_APOAPSIS, true);
     SetGaugeEnabled(set, Constants.WINDOW_ID_GAUGE_PERIAPSIS, true);
 }
Esempio n. 19
0
 protected void SetGaugeEnabled(GaugeSet set, int windowId, bool enabled)
 {
     if (gauges.ContainsId(windowId))
     {
         set.SetGaugeEnabled(windowId, enabled);
         if (set.IsCurrentGaugeSet())
         {
             gauges.SetGaugeEnabled(windowId, enabled);
         }
     }
 }
Esempio n. 20
0
 public void copyStatesFrom(GaugeSet source)
 {
     foreach (int key in source.gaugesEnabled.Keys)
     {
         SetGaugeEnabled(key, source.IsGaugeEnabled(key));
     }
     foreach (int key in gaugeIds)
     {
         gaugesEnabled[key] = source.IsGaugeEnabled(key);
     }
 }
Esempio n. 21
0
            private void ReadGaugeSets(BinaryReader reader)
            {
                int cnt = reader.ReadInt16();

                for (int i = 0; i < cnt; i++)
                {
                    GaugeSet.ID id = (GaugeSet.ID)reader.ReadInt16();
                    Log.Detail("loading gaugeset " + id);
                    GaugeSet set = GaugeSetPool.instance.GetGaugeSet(id);
                    ReadGaugeSet(reader, set);
                }
            }
Esempio n. 22
0
 private void WriteGaugesEnabled(BinaryWriter writer, GaugeSet set)
 {
     Log.Info("storing gauges enabled/disabled states");
     writer.Write((Int16)set.Count());
     Log.Info("writing " + set.Count() + " gauge states");
     foreach (int id in set.Keys())
     {
         writer.Write((Int32)id);
         bool enabled = set.IsGaugeEnabled(id);
         writer.Write(enabled);
         Log.Detail("window state written for window id " + id + ": " + enabled);
     }
 }
Esempio n. 23
0
            private void ReadGaugesEnabled(BinaryReader reader, GaugeSet set)
            {
                Log.Info("loading window enabled/disabled states");
                int count = reader.ReadInt16();

                Log.Detail("loading " + count + " gauge states");
                for (int i = 0; i < count; i++)
                {
                    int  id      = reader.ReadInt32();
                    bool enabled = reader.ReadBoolean();
                    set.SetGaugeEnabled(id, enabled);
                }
            }
Esempio n. 24
0
            // common layout for horizontal gauges
            protected void LayoutHorizontalGauges(GaugeSet set)
            {
                // horizontal gauges
                int hDY = (int)(configuration.horizontalGaugeHeight * gaugeScaling) + Gauges.LAYOUT_GAP;

                set.SetWindowPosition(Constants.WINDOW_ID_GAUGE_VESSEL, MARGIN_X_TOP_LEFT_BLOCK, MARGIN_Y_TOP_LEFT_BLOCK + 0 * hDY);
                set.SetWindowPosition(Constants.WINDOW_ID_GAUGE_BIOME, MARGIN_X_TOP_LEFT_BLOCK, MARGIN_Y_TOP_LEFT_BLOCK + 1 * hDY);
                set.SetWindowPosition(Constants.WINDOW_ID_GAUGE_LATITUDE, MARGIN_X_TOP_LEFT_BLOCK, MARGIN_Y_TOP_LEFT_BLOCK + 2 * hDY);
                set.SetWindowPosition(Constants.WINDOW_ID_GAUGE_LONGITUDE, MARGIN_X_TOP_LEFT_BLOCK, MARGIN_Y_TOP_LEFT_BLOCK + 3 * hDY);
                set.SetWindowPosition(Constants.WINDOW_ID_GAUGE_CAMERA, MARGIN_X_TOP_LEFT_BLOCK, MARGIN_Y_TOP_LEFT_BLOCK + 4 * hDY);
                set.SetWindowPosition(Constants.WINDOW_ID_GAUGE_NAV, MARGIN_X_TOP_LEFT_BLOCK, MARGIN_Y_TOP_LEFT_BLOCK + 5 * hDY);
                set.SetWindowPosition(Constants.WINDOW_ID_GAUGE_APOAPSIS, MARGIN_X_TOP_LEFT_BLOCK, MARGIN_Y_TOP_LEFT_BLOCK + 6 * hDY);
                set.SetWindowPosition(Constants.WINDOW_ID_GAUGE_PERIAPSIS, MARGIN_X_TOP_LEFT_BLOCK, MARGIN_Y_TOP_LEFT_BLOCK + 7 * hDY);
            }
Esempio n. 25
0
 private void WriteWindowPositions(BinaryWriter writer, GaugeSet set)
 {
     Log.Info("storing window positions");
     writer.Write((Int16)set.Count());
     Log.Detail("writing " + set.Count() + " window positions");
     foreach (int id in set.Keys())
     {
         Pair <int, int> position = set.GetWindowPosition(id);
         writer.Write((Int32)id);
         writer.Write((Int16)position.first);
         writer.Write((Int16)position.second);
         Log.Trace("window position for window id " + id + " written: " + position.first + "/" + position.second);
     }
 }
Esempio n. 26
0
 public void Declutter(GaugeSet set)
 {
     Log.Info("declutter " + set);
     foreach (int id in set)
     {
         if (!set.IsGaugeEnabled(id))
         {
             continue;
         }
         while (Declutter(set, id))
         {
             Log.Info("decluttering gauge id " + id + " to " + set.GetWindowPosition(id) + " in set " + set);
         }
     }
 }
Esempio n. 27
0
            private void ReadWindowPositions(BinaryReader reader, GaugeSet set)
            {
                Log.Info("loading window positions");
                int count = reader.ReadInt16();

                Log.Detail("loading " + count + " window positions");
                for (int i = 0; i < count; i++)
                {
                    int id = reader.ReadInt32();
                    int x  = reader.ReadInt16();
                    int y  = reader.ReadInt16();
                    Log.Trace("read window position for window id " + id + ": " + x + "/" + y);
                    set.SetWindowPosition(id, x, y);
                }
            }
Esempio n. 28
0
            public override void DoLayout(GaugeSet set)
            {
                Reset();

                AddToTopBlock(set, Constants.WINDOW_ID_GAUGE_SETS);
                AddToTopBlock(set, Constants.WINDOW_ID_GAUGE_INDICATOR);
                AddToTopBlock(set, Constants.WINDOW_ID_GAUGE_CAM);

                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_G);
                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_ACCL);
                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_VACCL);
                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_HACCL);
                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_MASS);
                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_ATM);
                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_TWR);
                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_THRUST);
                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_ISPE);
                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_DISP);
                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_TIMETOAPA);
                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_APA);
                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_VAI);
                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_VVI);
                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_MACH);
                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_SPD);
                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_VSI);
                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_ALTIMETER);
                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_VT);
                AddToLeftNavballBlock(set, Constants.WINDOW_ID_GAUGE_RADAR_ALTIMETER);


                AddToRightNavballBlock(set, Constants.WINDOW_ID_GAUGE_FUEL);
                AddToRightNavballBlock(set, Constants.WINDOW_ID_GAUGE_OXID);
                AddToRightNavballBlock(set, Constants.WINDOW_ID_GAUGE_FLOW);
                AddToRightNavballBlock(set, Constants.WINDOW_ID_GAUGE_SRB);
                AddToRightNavballBlock(set, Constants.WINDOW_ID_GAUGE_AIRIN);
                AddToRightNavballBlock(set, Constants.WINDOW_ID_GAUGE_AIRPCT);
                AddToRightNavballBlock(set, Constants.WINDOW_ID_GAUGE_PROPELLANT);
                AddToRightNavballBlock(set, Constants.WINDOW_ID_GAUGE_Q);


                // horizontal gauges
                int hDY = (int)(configuration.horizontalGaugeHeight * gaugeScaling) + Gauges.LAYOUT_GAP;

                set.SetWindowPosition(Constants.WINDOW_ID_GAUGE_BIOME, 10, 60 + 0 * hDY);
                set.SetWindowPosition(Constants.WINDOW_ID_GAUGE_LATITUDE, 10, 60 + 1 * hDY);
                set.SetWindowPosition(Constants.WINDOW_ID_GAUGE_LONGITUDE, 10, 60 + 2 * hDY);
            }
Esempio n. 29
0
            public override void EnableGauges(GaugeSet set)
            {
                GaugeSet.ID id = set.GetId();
                switch (id)
                {
                case GaugeSet.ID.STANDARD:
                    standard.EnableGauges(set);
                    return;

                case GaugeSet.ID.LAUNCH:
                    launch.EnableGauges(set);
                    return;

                case GaugeSet.ID.FLIGHT:
                    flight.EnableGauges(set);
                    return;

                case GaugeSet.ID.LAND:
                    landing.EnableGauges(set);
                    return;

                case GaugeSet.ID.DOCK:
                    docking.EnableGauges(set);
                    return;

                case GaugeSet.ID.ORBIT:
                    orbiting.EnableGauges(set);
                    return;

                case GaugeSet.ID.SET1:
                    set1.EnableGauges(set);
                    return;

                case GaugeSet.ID.SET2:
                    set2.EnableGauges(set);
                    return;

                case GaugeSet.ID.SET3:
                    set3.EnableGauges(set);
                    return;

                default:
                    Log.Warning("unknown gauge sewt ID for layout: " + id);
                    break;
                }
            }
Esempio n. 30
0
 public override void EnableGauges(GaugeSet set)
 {
     foreach (int id in set)
     {
         set.SetGaugeEnabled(id, false);
     }
     //
     set.SetGaugeEnabled(Constants.WINDOW_ID_GAUGE_SETS, true);
     set.SetGaugeEnabled(Constants.WINDOW_ID_GAUGE_INDICATOR, true);
     set.SetGaugeEnabled(Constants.WINDOW_ID_GAUGE_CAM, true);
     //
     set.SetGaugeEnabled(Constants.WINDOW_ID_GAUGE_BIOME, true);
     set.SetGaugeEnabled(Constants.WINDOW_ID_GAUGE_LATITUDE, true);
     set.SetGaugeEnabled(Constants.WINDOW_ID_GAUGE_LONGITUDE, true);
     //
     set.SetGaugeEnabled(Constants.WINDOW_ID_GAUGE_G, true);
     set.SetGaugeEnabled(Constants.WINDOW_ID_GAUGE_VACCL, true);
     set.SetGaugeEnabled(Constants.WINDOW_ID_GAUGE_HACCL, true);
     set.SetGaugeEnabled(Constants.WINDOW_ID_GAUGE_ACCL, true);
     set.SetGaugeEnabled(Constants.WINDOW_ID_GAUGE_ATM, true);
     set.SetGaugeEnabled(Constants.WINDOW_ID_GAUGE_ISPE, true);
     set.SetGaugeEnabled(Constants.WINDOW_ID_GAUGE_DISP, true);
     set.SetGaugeEnabled(Constants.WINDOW_ID_GAUGE_TWR, true);
     set.SetGaugeEnabled(Constants.WINDOW_ID_GAUGE_THRUST, true);
     set.SetGaugeEnabled(Constants.WINDOW_ID_GAUGE_MASS, true);
     set.SetGaugeEnabled(Constants.WINDOW_ID_GAUGE_TIMETOAPA, true);
     set.SetGaugeEnabled(Constants.WINDOW_ID_GAUGE_APA, true);
     set.SetGaugeEnabled(Constants.WINDOW_ID_GAUGE_VAI, true);
     set.SetGaugeEnabled(Constants.WINDOW_ID_GAUGE_VVI, true);
     set.SetGaugeEnabled(Constants.WINDOW_ID_GAUGE_MACH, true);
     set.SetGaugeEnabled(Constants.WINDOW_ID_GAUGE_SPD, true);
     set.SetGaugeEnabled(Constants.WINDOW_ID_GAUGE_VSI, true);
     set.SetGaugeEnabled(Constants.WINDOW_ID_GAUGE_ALTIMETER, true);
     set.SetGaugeEnabled(Constants.WINDOW_ID_GAUGE_VT, true);
     set.SetGaugeEnabled(Constants.WINDOW_ID_GAUGE_RADAR_ALTIMETER, true);
     //
     set.SetGaugeEnabled(Constants.WINDOW_ID_GAUGE_FUEL, true);
     set.SetGaugeEnabled(Constants.WINDOW_ID_GAUGE_OXID, true);
     set.SetGaugeEnabled(Constants.WINDOW_ID_GAUGE_FLOW, true);
     set.SetGaugeEnabled(Constants.WINDOW_ID_GAUGE_SRB, true);
     set.SetGaugeEnabled(Constants.WINDOW_ID_GAUGE_AIRIN, true);
     set.SetGaugeEnabled(Constants.WINDOW_ID_GAUGE_AIRPCT, true);
     set.SetGaugeEnabled(Constants.WINDOW_ID_GAUGE_PROPELLANT, true);
     set.SetGaugeEnabled(Constants.WINDOW_ID_GAUGE_Q, true);
 }