Example #1
0
 private void ResetAllWindowPositions(Gauges gauges, GaugeLayout layout)
 {
     foreach (GaugeSet set in GaugeSetPool.instance)
     {
         LayoutGaugeSet(set, layout);
     }
 }
        public static bool createGaugesById(string id_project, string planneddate, string deliverydate, string observation1, string numver, string observation2, string numprod, string observation3)
        {
            var    id_projectObj = JsonConvert.DeserializeObject(id_project);
            string idProject     = Convert.ToString(id_projectObj);
            // var planneddateObj = JsonConvert.DeserializeObject(planneddate);
            DateTime varplanneddate = Convert.ToDateTime(planneddate);
            //  var deliverydateObj = JsonConvert.DeserializeObject(deliverydate);
            DateTime vardeliverydate = Convert.ToDateTime(deliverydate);
            TimeSpan dateCal         = vardeliverydate - varplanneddate;
            int      deliverydays    = dateCal.Days;


            bool resp = false;

            try
            {
                Gauges gauges = new Gauges();
                gauges.codigo_proyecto  = idProject;
                gauges.nombre_indicador = "Fecha planificada";
                gauges.valor_indicador  = deliverydays;
                gauges.valor_indicador  = 1;
                ServicesLibrary.GaugesImpl gaugesIml = new ServicesLibrary.GaugesImpl();
                gaugesIml.createGaugesByIdProject(gauges);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            return(resp);
        }
Example #3
0
        public bool createGaugeByIdProject(Gauges gauges)
        {
            SqlConnection sqlConnection = null;
            SqlCommand    cmd           = null;
            //  SqlDataReader dr = null;
            bool response = false;

            try
            {
                sqlConnection = DataAccess.Connection.getInstance().getConnection();
                cmd           = new SqlCommand("sp_CreateGauges", sqlConnection);
                cmd.Parameters.AddWithValue("@idProject", gauges.codigo_proyecto);
                cmd.Parameters.AddWithValue("@nameGauge", gauges.nombre_indicador);
                cmd.Parameters.AddWithValue("@valueGauge", gauges.valor_indicador);
                cmd.Parameters.AddWithValue("@observationGauge", gauges.observacion_indicador);
                cmd.CommandType = CommandType.StoredProcedure;
                int filas = cmd.ExecuteNonQuery();
                if (filas > 0)
                {
                    response = true;
                }
            }
            catch (Exception ex)
            {
                response = false;
                throw ex;
            }
            finally
            {
                sqlConnection.Close();
            }
            return(response);
        }
Example #4
0
 public Droid(Components type, Dictionary <CraftedResourcesType, int> requires, List <Components> buildsInto, Gauges damage, Gauges health, bool canLeaveBase, ResourceBase additionalResource)
     : base(type, requires, additionalResource)
 {
     Damage       = damage;
     Health       = health;
     CanLeaveBase = canLeaveBase;
 }
 public Steel(CraftedResourcesType type, Dictionary <ResourceTypes, int> requires, List <Components> buildsInto, Gauges strength, Effects resistance, Gauges shineyness, ResourceBase additionalResource)
     : base(type, requires, buildsInto, additionalResource)
 {
     Strength   = strength;
     Resistance = resistance;
     Shineyness = shineyness;
 }
Example #6
0
 public void EnableAllGauges(Gauges gauges)
 {
     foreach (AbstractGauge gauge in gauges)
     {
         SetGaugeEnabled(gauge.GetWindowId(), true);
     }
 }
Example #7
0
 public Weapon(Components type, Dictionary <CraftedResourcesType, int> requires, Gauges attackSpeed, Gauges damage, bool requiresProficiency, bool isTwohanded)
     : base(type, requires)
 {
     RequiresProficiency = requiresProficiency;
     IsTwohanded         = isTwohanded;
     AttackSpeed         = attackSpeed;
     Damage = damage;
 }
Example #8
0
            public ConfigWindow(Gauges gauges)
                : base(Constants.WINDOW_ID_CONFIG, "NanoGauges Configuration")
            {
                this.gauges = gauges;

                SetSize(350, 300);
                CenterWindow();
            }
Example #9
0
 private void Manager_AfterMessageReceived(MessageEventArgs e)
 {
     if (MS43AnalogValues.CanParse(e.Message))
     {
         var av = new MS43JMGAnalogValues();
         av.Parse(e.Message);
         Gauges.ForEach(g => g.Update(av));
     }
 }
Example #10
0
        public void Can_serialize_a_gague_properly()
        {
            var target = new Gauges {
                Value = 0.25m
            };
            string result = Serializer.Serialize(target);

            result.Should().NotBeNullOrEmpty();
        }
Example #11
0
            public void ResetAllWindowPositions(Gauges gauges)
            {
                GaugeLayout layout = new DefaultLayout(gauges, this);

                foreach (GaugeSet set in GaugeSetPool.instance)
                {
                    LayoutGaugeSet(set, layout);
                }
            }
Example #12
0
 protected GaugeLayout(Gauges gauges, Configuration configuration)
 {
     this.gauges                = gauges;
     this.configuration         = configuration;
     this.verticalGaugeWidth    = configuration.verticalGaugeWidth;
     this.verticalGaugeHeight   = configuration.verticalGaugeHeight;
     this.gaugeScaling          = configuration.gaugeScaling;
     this.horizontalGaugeWidth  = configuration.horizontalGaugeWidth;
     this.horizontalGaugeHeight = configuration.horizontalGaugeHeight;
 }
Example #13
0
 public ConfigWindow(Gauges gauges)
     : base(Constants.WINDOW_ID_CONFIG, "NanoGauges Configuration")
 {
     this.gauges = gauges;
     //
     profilesWindow = new ProfilesWindow();
     hotkeysWindow  = new HotkeysWindow();
     exportWindow   = new ExportWindow();
     //
     SetSize(350, 300);
     CenterWindow();
 }
Example #14
0
 private async void Manager_AfterMessageReceived(MessageEventArgs e)
 {
     if (MS43AnalogValues.CanParse(e.Message))
     {
         var av = new MS43BBAnalogValues();
         av.Parse(e.Message);
         await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
         {
             Gauges.ForEach(g => g.Update(av));
         });
     }
 }
Example #15
0
 private void FillGauges(Gauges obj)
 {
     Rpm1.Value       = obj.RpmGauge1;
     Rpm2.Value       = obj.RpmGuage2;
     Temp1.Value      = obj.TempGauge1;
     Temp2.Value      = obj.TempGuage2;
     Torque1.Value    = obj.TorqueGauge1;
     Torque2.Value    = obj.TorqueGauge2;
     BlackRpm.Value   = obj.BGRpm;
     BlackTemp.Value  = obj.BGTemp;
     BlackTorue.Value = obj.BGTorque;
 }
Example #16
0
 public DefaultLayout(Gauges gauges, Configuration configuration)
     : base(gauges, configuration)
 {
     standard = new StandardLayout(gauges, configuration);
     launch   = new LaunchLayout(gauges, configuration);
     flight   = new FlightLayout(gauges, configuration);
     landing  = new LandingLayout(gauges, configuration);
     docking  = new DockingLayout(gauges, configuration);
     orbiting = new OrbitingLayout(gauges, configuration);
     set1     = new ClusterLayout(gauges, configuration);
     set2     = new ClusterLayout(gauges, configuration);
     set3     = new ClusterLayout(gauges, configuration);
 }
Example #17
0
 public void ResetAllWindowPositions(Gauges gauges)
 {
     // The default layout only works well in screen width at 1900 pixels or above
     if (Screen.width >= 1900)
     {
         ResetAllWindowPositions(gauges, new DefaultLayout(gauges, this));
     }
     else
     {
         // Screen is tiny, so prefer a clusterlayout at first
         ResetAllWindowPositions(gauges, new ClusterLayout(gauges, this));
     }
 }
 public override void createGauge(Viewport viewport)
 {
     //gauge data
     carGauge = new Gauges(ref guageTexture,
                           ref needleTexture,
                           ref lightTexture,
                           ref canister,
                           currentMotor.RedLineRPM,
                           currentMotor.CurrentRPM,
                           ref spriteBatch,
                           new Vector2(viewport.Width - guageTexture.Width, viewport.Height - guageTexture.Height),
                           ref currentFont);
 }
        public MetricsContextValueSource Filter(IFilterMetrics filter)
        {
            if (!filter.IsContextMatch(Context))
            {
                return(Empty);
            }

            return(new MetricsContextValueSource(
                       Context,
                       Gauges.Where(filter.IsGaugeMatch),
                       Counters.Where(filter.IsCounterMatch),
                       Meters.Where(filter.IsMeterMatch),
                       Histograms.Where(filter.IsHistogramMatch),
                       Timers.Where(filter.IsTimerMatch),
                       ApdexScores.Where(filter.IsApdexMatch)));
        }
Example #20
0
        public bool createGaugesByIdProject(Gauges gauges)
        {
            bool responseService = false;

            try
            {
                GaugesDAO gaugesDAO = new GaugesDAO();
                gauges.observacion_indicador = gauges.observacion_indicador == null ? gauges.observacion_indicador = "sin observacion" : gauges.observacion_indicador;
                responseService = gaugesDAO.createGaugeByIdProject(gauges);
            }
            catch (Exception ex)
            {
                responseService = false;
                throw ex;
            }
            return(responseService);
        }
Example #21
0
 static NanoGauges()
 {
     Log.SetLevel(Log.LEVEL.INFO);
     Log.Info("static init of NanoGauges");
     gauges = new Gauges();
     //
     // default window positions
     configuration.ResetAllWindowPositions(gauges);
     //
     configuration.SetGaugeSet(GaugeSet.ID.STANDARD);
     gauges.ReflectGaugeSetChange();
     //
     configuration.Load();
     Log.Info("log level is " + Log.GetLogLevel());
     //
     snapinManager = new SnapinManager(gauges);
     Log.SetLevel(configuration.GetLogLevel());
     trimIndicatorsEnabled = configuration.trimIndicatorsEnabled;
 }
Example #22
0
 static NanoGauges()
 {
     Log.SetLevel(Log.LEVEL.INFO);
     //
     Log.Info("static init of NanoGauges");
     gauges = new Gauges();
     configuration.ResetAllWindowPositions(gauges);
     configuration.SetGaugeSet(GaugeSet.ID.STANDARD);
     //
     profileManager = new ProfileManager();
     //
     hotkeyManager = new HotkeyManager();
     //
     configuration.Load();
     Log.Info("log level is " + Log.GetLogLevel());
     //
     gauges.ReflectGaugeSetChange();
     gauges.UpdateGaugeScaling();
     //
     snapinManager = new SnapinManager(gauges);
 }
Example #23
0
        private void TestValue()
        {
            var random = new Random();



            LineChart.FillChart(random.Next(1, 10), random.Next(1, 10), random.Next(1, 10), random.Next(1, 10));

            Gauges values = new Gauges
            {
                BGRpm        = random.Next(1, 6000),
                BGTemp       = random.Next(1, 200),
                BGTorque     = random.Next(1, 3000),
                RpmGauge1    = random.Next(1, 6000),
                RpmGuage2    = random.Next(1, 6000),
                TempGauge1   = random.Next(1, 200),
                TempGuage2   = random.Next(1, 200),
                TorqueGauge1 = random.Next(1, 3000),
                TorqueGauge2 = random.Next(1, 3000)
            };

            FillGauges(values);
            fillValueCards(cr);
        }
Example #24
0
 public SelectorGauge(Gauges gauges)
     : base(Constants.WINDOW_ID_GAUGE_SETS)
 {
     this.gauges = gauges;
     this.skin   = Utils.GetTexture("Nereid/NanoGauges/Resource/SETS-skin");
 }
Example #25
0
 public LaunchLayout(Gauges gauges, Configuration configuration)
     : base(gauges, configuration)
 {
 }
 public Battery(CraftedResourcesType type, Dictionary <ResourceTypes, int> requires, List <Components> buildsInto, ResourceBase additionalResource, Gauges power, bool isRechargable)
     : base(type, requires, buildsInto, additionalResource)
 {
     Power         = power;
     IsRechargable = isRechargable;
 }
Example #27
0
 public FlightLayout(Gauges gauges, Configuration configuration)
     : base(gauges, configuration)
 {
 }
 public StandardLayout(Gauges gauges, Configuration configuration)
     : base(gauges, configuration)
 {
 }
 public ClusterLayout(Gauges gauges, Configuration configuration)
     : base(gauges, configuration)
 {
 }
Example #30
0
 public void ResetWindowPositions(Gauges gauges)
 {
     currentGaugeSet.SetWindowPosition(Constants.WINDOW_ID_ABOUT, 50, 50);
     currentGaugeSet.SetWindowPosition(Constants.WINDOW_ID_CONFIG, 50, 50);
     LayoutGaugeSet(currentGaugeSet, new DefaultLayout(gauges, this));
 }