Exemplo n.º 1
0
 internal void Update(UsageCounters c)
 {
     GCodeFile     += c.GCodeFile;
     RasterFile    += c.RasterFile;
     Vectorization += c.Vectorization;
     Dithering     += c.Dithering;
     Line2Line     += c.Line2Line;
 }
Exemplo n.º 2
0
 internal void Update(UsageCounters c)
 {
     GCodeFile     += c.GCodeFile;
     RasterFile    += c.RasterFile;
     Vectorization += c.Vectorization;
     Centerline    += c.Centerline;
     Dithering     += c.Dithering;
     Line2Line     += c.Line2Line;
     SvgFile       += c.SvgFile;
     Passthrough   += c.Passthrough;
 }
Exemplo n.º 3
0
        private void UpdateAndSend(GrblCore Core)
        {
            //invia i dati solo almeno ad un giorno di distanza o al cambio version/grblversion
            Version current  = typeof(GitHub).Assembly.GetName().Version;
            bool    mustsend = DateTime.UtcNow.Subtract(LastSent).TotalDays > 1 || Version != current || (Core.Configuration.GrblVersion != null && GrblVersion != Core.Configuration.GrblVersion);

            Version     = current;
            GrblVersion = Core.Configuration.GrblVersion != null ? Core.Configuration.GrblVersion : GrblVersion;
            Locale      = System.Threading.Thread.CurrentThread.CurrentCulture.LCID;
            UiLang      = System.Threading.Thread.CurrentThread.CurrentUICulture.LCID;

            if (UsageTime < TimeSpan.Zero)
            {
                UsageTime = TimeSpan.Zero;                                     //fix wrong values
            }
            if (Tools.TimingBase.TimeFromApplicationStartup() > TimeSpan.Zero) //prevent wrong values
            {
                UsageTime = UsageTime.Add(Tools.TimingBase.TimeFromApplicationStartup());
            }

            Wrapper = Settings.GetObject("ComWrapper Protocol", ComWrapper.WrapperType.UsbSerial);

            LaserGRBL.Firmware fw = Settings.GetObject("Firmware Type", LaserGRBL.Firmware.Grbl);
            if (fw == LaserGRBL.Firmware.Grbl && Core.IsOrturBoard)
            {
                FirmwareString = "Ortur";
            }
            else
            {
                FirmwareString = fw.ToString();
            }

            if (Counters == null)
            {
                Counters = new UsageCounters();
            }
            Counters.Update(Core.UsageCounters);

            if (mustsend)
            {
                try
                {
                    if (TrueSend())
                    {
                        LastSent = DateTime.UtcNow;
                    }
                }
                catch (Exception)
                {
                }
            }
        }
Exemplo n.º 4
0
        private void UpdateAndSend(GrblCore Core)
        {
            //invia i dati solo almeno ad un giorno di distanza o al cambio version/grblversion
            Version current  = typeof(GitHub).Assembly.GetName().Version;
            bool    mustsend = DateTime.UtcNow.Subtract(LastSent).TotalDays > 1 || Version != current || (Core.Configuration.GrblVersion != null && GrblVersion != Core.Configuration.GrblVersion);

            Version     = current;
            GrblVersion = Core.Configuration.GrblVersion != null ? Core.Configuration.GrblVersion : GrblVersion;
            Locale      = System.Threading.Thread.CurrentThread.CurrentCulture.LCID;
            UiLang      = System.Threading.Thread.CurrentThread.CurrentUICulture.LCID;

            TimeSpan tfas  = Tools.TimingBase.TimeFromApplicationStartup();
            TimeSpan elaps = tfas - hUsageTime;

            hUsageTime = tfas;
            UsageTime  = UsageTime.Add(elaps);

            Wrapper = (ComWrapper.WrapperType)Settings.GetObject("ComWrapper Protocol", ComWrapper.WrapperType.UsbSerial);

            if (Counters == null)
            {
                Counters = new UsageCounters();
            }
            Counters.Update(Core.UsageCounters);

            if (mustsend)
            {
                try
                {
                    if (TrueSend())
                    {
                        LastSent = DateTime.UtcNow;
                    }
                }
                catch (Exception ex)
                {
                }
            }
        }