Ejemplo n.º 1
0
        //***************** Telemetry Functions *****************
        #region Game Data
        private void Telemetry_Data(SCSTelemetry data, bool updated)
        {
            Test = data;
            // Use any of the available data provided by the SDK here.
            // Use SCSTelemetry "data" parameter.
            toolStripStatusLabel1.Text = $"Game: { data.Game}";

            if (data.SpecialEventsValues.JobDelivered)
            {
                // Sets the Revenue and the XP when "JobDelivered" event occurs
                Amount = data.GamePlay.JobDelivered.Revenue.ToString("#0");
                XP     = data.GamePlay.JobDelivered.EarnedXp;
            }

            if (data.SpecialEventsValues.JobCancelled)
            {
                // Sets the Loss(money) "JobCancelled" event occurs
                Amount = data.GamePlay.JobCancelled.Penalty.ToString("#0");
            }

            if (data.SpecialEventsValues.OnJob)
            {
                // Sets useful information when you have active job (Used for "OnJobStarted" and "JobDelivered" events)
                Origin           = data.JobValues.CitySource;
                Destination      = data.JobValues.CityDestination;
                Income           = data.JobValues.Income;
                Corp_Destination = data.JobValues.CompanyDestination;
                Corp_Origin      = data.JobValues.CompanySource;
            }
        }
Ejemplo n.º 2
0
 private static void Telemetry_Data(SCSTelemetry data, bool newTimestamp)
 {
     if (newTimestamp)
     {
         MainForm.data = data;
     }
 }
 private void Telemetry_Data(SCSTelemetry data, bool updated)
 {
     try
     {
         if (!InvokeRequired)
         {
             DateTime remaindelivtime = data.JobValues.RemainingDeliveryTime.Date;
             DateTime gametime        = data.CommonValues.GameTime.Date;
             double   percentage_tour = Convert.ToDouble(data.NavigationValues.NavigationDistance) / Convert.ToDouble(data.JobValues.PlannedDistanceKm);
             if (!Double.IsNaN(percentage_tour))
             {
                 Progessbar.Dispatcher.Invoke(() => Progessbar.Value = percentage_tour, DispatcherPriority.Background);
             }
             if (data.NavigationValues.NavigationDistance > 2000)
             {
                 Progessbar.Dispatcher.Invoke(() => DistanceLeft.Content     = data.NavigationValues.NavigationDistance / 1000, DispatcherPriority.Background);
                 Progessbar.Dispatcher.Invoke(() => DistanceLeftUnit.Content = "km", DispatcherPriority.Background);
             }
             else
             {
                 Progessbar.Dispatcher.Invoke(() => DistanceLeft.Content     = data.NavigationValues.NavigationDistance, DispatcherPriority.Background);
                 Progessbar.Dispatcher.Invoke(() => DistanceLeftUnit.Content = "m", DispatcherPriority.Background);
             }
             Progessbar.Dispatcher.Invoke(() => MaxSpeed.Content   = data.NavigationValues.SpeedLimit, DispatcherPriority.Background);
             Progessbar.Dispatcher.Invoke(() => SpeedLabel.Content = data.TruckValues.CurrentValues.DashboardValues.Speed.Kph, DispatcherPriority.Background);
         }
     }
     catch
     { }
 }
Ejemplo n.º 4
0
        Brush ColoredTextColor = new SolidBrush(Color.FromArgb(255, 174, 0)); //Yellow Color like in ETS2
        #endregion
        private void Telemetry_Data(SCSTelemetry data, bool updated)
        {
            try
            {
                ets2data = data;

                if (data.GameVersion.Major == 0)
                {
                    Console.Title = simulatorNotRunning;
                    GameRunning   = false;
                }
                else if (data.Timestamp == 0)
                {
                    Console.Title = simulatorNotDriving;
                    GameRunning   = true;
                }
                else
                {
                    Console.Title = simulatorRunning;
                    GameRunning   = true

                                    //Get game time, with ugly code but it works
                                    string[] uraArr = data.CommonValues.GameTime.Date.ToUniversalTime().ToString().Split(' ')[1].Split(':');
                    Variables.time = string.Join(":", uraArr.Reverse().Skip(1).Reverse());

                    //Game status (true=running, false=paused)
                    Variables.GameRunning = !data.Paused;
                }
            }
            catch (Exception ex)
            {
                Console.Write(ex.ToString());
            }
        }
Ejemplo n.º 5
0
 private void Telemetry_Data_Handler(SCSTelemetry data, bool newTimestamp)
 {
     if (!InvokeRequired)
     {
         Telemetry_Data = data;
         if (data != null)
         {
             if (!String.IsNullOrWhiteSpace(data.TruckValues.ConstantsValues.BrandId))
             {
                 if (!String.IsNullOrWhiteSpace(data.TruckValues.ConstantsValues.BrandId) && !onJob && !freeroamactive)
                 {
                     DiscordHandler.FreeRoam();
                     freeroamactive = true;
                     idleactive     = false;
                 }
             }
             else
             {
                 if (!idleactive)
                 {
                     Console.WriteLine("hit");
                     DiscordHandler.idle();
                     idleactive = true;
                 }
             }
         }
     }
 }
Ejemplo n.º 6
0
        private void Telemetry_Data(SCSTelemetry data, bool updated)
        {
            try {
                if (InvokeRequired)
                {
                    Invoke(new TelemetryData(Telemetry_Data), data, updated);
                    return;
                }

                l_updateRate.Text = Telemetry.UpdateInterval + "ms";

                lbGeneral.Text = "General info:\n " +
                                 "\t SDK Running:\n" +
                                 $"\t\t\t{data.SdkActive}\n" +
                                 "\tSDK Version:\n" +
                                 $"\t\t\t{data.DllVersion}\n" +
                                 "\tGame:\n " +
                                 $"\t\t\t{data.Game}\n" +
                                 "\tGame Version:\n" +
                                 $"\t\t\t{data.GameVersion}\n" +
                                 "\tTelemetry Version:\n" +
                                 $"\t\t\t{data.TelemetryVersion}\n" +
                                 "\tTimeStamp:\n" +
                                 $"\t\t\t{data.Timestamp}\n" +
                                 "\tGame Paused:\n" +
                                 $"\t\t\t{data.Paused}\n" +
                                 "\tOn Job:\n" +
                                 $"\t\t\t{data.SpecialEventsValues.OnJob}\n" +
                                 "\tJob Finished:\n" +
                                 $"\t\t\t{data.SpecialEventsValues.JobFinished}\n" +
                                 "\tJob Delivered:\n" +
                                 $"\t\t\t{data.SpecialEventsValues.JobDelivered}\n" +
                                 "\tJob Cancelled:\n" +
                                 $"\t\t\t{data.SpecialEventsValues.JobCancelled}\n" +
                                 "\tFined:\n" +
                                 $"\t\t\t{data.SpecialEventsValues.Fined}\n" +
                                 "\ttollgate:\n" +
                                 $"\t\t\t{data.SpecialEventsValues.Tollgate}\n" +
                                 "\tferry:\n" +
                                 $"\t\t\t{data.SpecialEventsValues.Ferry}\n" +
                                 "\ttrain:\n" +
                                 $"\t\t\t{data.SpecialEventsValues.Train}\n";

                common.Text  = JsonConvert.SerializeObject(data.CommonValues, Formatting.Indented);
                truck.Text   = JsonConvert.SerializeObject(data.TruckValues, Formatting.Indented);
                trailer.Text =
                    JsonConvert.SerializeObject(data.TrailerValues[0],
                                                Formatting
                                                .Indented);     //TODO: UNTIL I WORK ON A BETTER DEMO SHOW ONLY TRAILER 0
                job.Text           = JsonConvert.SerializeObject(data.JobValues, Formatting.Indented);
                control.Text       = JsonConvert.SerializeObject(data.ControlValues, Formatting.Indented);
                navigation.Text    = JsonConvert.SerializeObject(data.NavigationValues, Formatting.Indented);
                substances.Text    = JsonConvert.SerializeObject(data.Substances, Formatting.Indented);
                gameplayevent.Text = JsonConvert.SerializeObject(data.GamePlay, Formatting.Indented);
            } catch (Exception ex) {
                // ignored atm i found no proper way to shut the telemetry down and down call this anymore when this or another thing is already disposed
                Console.WriteLine("Telemetry was closed: " + ex);
            }
        }
Ejemplo n.º 7
0
 public void Telemetry_Data(SCSTelemetry data, bool updated)
 {
     try
     {
         if (!InvokeRequired)
         {
             TruckBrand = data.TruckValues.ConstantsValues.BrandId;
         }
     }
     catch
     { }
 }
Ejemplo n.º 8
0
 private void EtsTelemetry_Data(SCSTelemetry data, bool updated)
 {
     try
     {
         // Invoke telemetry collection
         if (InvokeControl.InvokeRequired)
         {
             InvokeControl.Invoke(new TelemetryData(EtsTelemetry_Data), data, updated);
             //GameTelemetry = new ETS2game(data);
             _data = data;
             ManagerForm.PushTelemetry();
             return;
         }
     }
     catch { }
 }
Ejemplo n.º 9
0
        private void Telemetry_Data(SCSTelemetry data, bool updated)
        {
            try {
                if (InvokeRequired)
                {
                    Invoke(new TelemetryData(Telemetry_Data), data, updated);
                    return;
                }

                lbGeneral.Text = "General info:\n " +
                                 "\tSDK Version:\n" +
                                 $"\t\t\t{data.DllVersion}\n" +
                                 "\tGame:\n " +
                                 $"\t\t\t{data.Game}\n" +
                                 "\tGame Version:\n" +
                                 $"\t\t\t{data.GameVersion}\n" +
                                 "\tTelemetry Version:\n" +
                                 $"\t\t\t{data.TelemetryVersion}\n" +
                                 "\tTimeStamp:\n" +
                                 $"\t\t\t{data.Timestamp}\n" +
                                 "\tGame Paused:\n" +
                                 $"\t\t\t{data.Paused}\n" +
                                 "\tOn Job:\n" +
                                 $"\t\t\t{data.SpecialEventsValues.OnJob}\n" +
                                 "\tJob Finished:\n" +
                                 $"\t\t\t{data.SpecialEventsValues.JobFinished}\n" +
                                 "\tTrailer Connected:\n" +
                                 $"\t\t\t{data.SpecialEventsValues.TrailerConnected}\n";

                common.Text     = JsonConvert.SerializeObject(data.CommonValues, Formatting.Indented);
                truck.Text      = JsonConvert.SerializeObject(data.TruckValues, Formatting.Indented);
                trailer.Text    = JsonConvert.SerializeObject(data.TrailerValues, Formatting.Indented);
                job.Text        = JsonConvert.SerializeObject(data.JobValues, Formatting.Indented);
                control.Text    = JsonConvert.SerializeObject(data.ControlValues, Formatting.Indented);
                navigation.Text = JsonConvert.SerializeObject(data.NavigationValues, Formatting.Indented);
                substances.Text = JsonConvert.SerializeObject(data.Substances, Formatting.Indented);
            } catch (Exception ex) {
                // ignored atm i found no proper way to shut the telemetry down and down call this anymore when this or another thing is already disposed
                Console.WriteLine("Telemetry was closed: " + ex);
            }
        }
Ejemplo n.º 10
0
        /// <summary>
        ///     Convert the Shared Memory Byte data structure in a C# object
        /// </summary>
        /// <param name="structureDataBytes">
        ///     byte array from the shared memory
        /// </param>
        /// <returns>
        ///     C# object with game data of the shared memory
        /// </returns>
        public SCSTelemetry Convert(byte[] structureDataBytes)
        {
            _offsetArea = 0;
            SetOffset();


            _data = structureDataBytes;
            var retData = new SCSTelemetry();

            #region FIRST ZONE

            retData.SdkActive = GetBool();
            GetBoolArray(3);
            retData.Paused = GetBool();
            GetBoolArray(3);
            retData.Timestamp           = GetULong();
            retData.SimulationTimestamp = GetULong();
            retData.RenderTimestamp     = GetULong();



            NextOffsetArea();

            #endregion

            #region SECOND ZONE

            retData.DllVersion        = GetUint();
            retData.GameVersion.Major = GetUint();
            retData.GameVersion.Minor = GetUint();
            retData.Game = GetUint().ToEnum <SCSGame>();
            retData.TelemetryVersion.Major = GetUint();
            retData.TelemetryVersion.Minor = GetUint();

            retData.CommonValues.GameTime = GetUint();
            retData.TruckValues.ConstantsValues.MotorValues.ForwardGearCount  = GetUint();
            retData.TruckValues.ConstantsValues.MotorValues.ReverseGearCount  = GetUint();
            retData.TruckValues.ConstantsValues.MotorValues.RetarderStepCount = GetUint();
            retData.TruckValues.ConstantsValues.WheelsValues.Count            = GetUint();
            retData.TruckValues.ConstantsValues.MotorValues.SelectorCount     = GetUint();
            retData.SetDeliveryTime(GetUint());
            retData.MaxTrailerCount = GetUint();
            retData.JobValues.CargoValues.UnitCount = GetUint();
            retData.JobValues.PlannedDistanceKm     = GetUint();


            retData.TruckValues.CurrentValues.MotorValues.GearValues.HShifterSlot   = GetUint();
            retData.TruckValues.CurrentValues.MotorValues.BrakeValues.RetarderLevel = GetUint();
            retData.TruckValues.CurrentValues.LightsValues.AuxFront  = GetUint().ToEnum <AuxLevel>();
            retData.TruckValues.CurrentValues.LightsValues.AuxRoof   = GetUint().ToEnum <AuxLevel>();
            retData.TruckValues.CurrentValues.WheelsValues.Substance = GetUintArray(WheelSize);

            retData.TruckValues.ConstantsValues.MotorValues.SlotHandlePosition = GetUintArray(32);
            retData.TruckValues.ConstantsValues.MotorValues.SlotSelectors      = GetUintArray(32);

            retData.GamePlay.JobDelivered.DeliveryTime = GetUint();
            var jobStartingTime = new SCSTelemetry.Time(GetUint());
            retData.GamePlay.JobCancelled.Started = jobStartingTime;
            retData.GamePlay.JobDelivered.Started = jobStartingTime;
            var jobFinishingTime = new SCSTelemetry.Time(GetUint());
            retData.GamePlay.JobCancelled.Finished = jobFinishingTime;
            retData.GamePlay.JobDelivered.Finished = jobFinishingTime;

            NextOffsetArea();

            #endregion

            #region THIRD ZONE

            retData.CommonValues.NextRestStop = GetInt();

            retData.TruckValues.CurrentValues.MotorValues.GearValues.Selected = GetInt();
            retData.TruckValues.CurrentValues.DashboardValues.GearDashboards  = GetInt();
            retData.TruckValues.ConstantsValues.MotorValues.SlotGear          = GetIntArray(32);

            retData.GamePlay.JobDelivered.EarnedXp = GetInt();

            NextOffsetArea();

            #endregion

            #region 4TH ZONE

            retData.CommonValues.Scale = GetFloat();

            retData.TruckValues.ConstantsValues.CapacityValues.Fuel                      = GetFloat();
            retData.TruckValues.ConstantsValues.WarningFactorValues.Fuel                 = GetFloat();
            retData.TruckValues.ConstantsValues.CapacityValues.AdBlue                    = GetFloat();
            retData.TruckValues.ConstantsValues.WarningFactorValues.AdBlue               = GetFloat();
            retData.TruckValues.ConstantsValues.WarningFactorValues.AirPressure          = GetFloat();
            retData.TruckValues.ConstantsValues.WarningFactorValues.AirPressureEmergency = GetFloat();
            retData.TruckValues.ConstantsValues.WarningFactorValues.OilPressure          = GetFloat();
            retData.TruckValues.ConstantsValues.WarningFactorValues.WaterTemperature     = GetFloat();
            retData.TruckValues.ConstantsValues.WarningFactorValues.BatteryVoltage       = GetFloat();
            retData.TruckValues.ConstantsValues.MotorValues.EngineRpmMax                 = GetFloat();
            retData.TruckValues.ConstantsValues.MotorValues.DifferentialRation           = GetFloat();
            retData.JobValues.CargoValues.Mass = GetFloat();
            retData.TruckValues.ConstantsValues.WheelsValues.Radius           = GetFloatArray(WheelSize);
            retData.TruckValues.ConstantsValues.MotorValues.GearRatiosForward = GetFloatArray(24);
            retData.TruckValues.ConstantsValues.MotorValues.GearRatiosReverse = GetFloatArray(8);
            retData.JobValues.CargoValues.UnitMass = GetFloat();

            retData.TruckValues.CurrentValues.DashboardValues.Speed.Value = GetFloat();
            retData.TruckValues.CurrentValues.DashboardValues.RPM         = GetFloat();
            retData.ControlValues.InputValues.Steering = GetFloat();
            retData.ControlValues.InputValues.Throttle = GetFloat();
            retData.ControlValues.InputValues.Brake    = GetFloat();
            retData.ControlValues.InputValues.Clutch   = GetFloat();
            retData.ControlValues.GameValues.Steering  = GetFloat();
            retData.ControlValues.GameValues.Throttle  = GetFloat();
            retData.ControlValues.GameValues.Brake     = GetFloat();
            retData.ControlValues.GameValues.Clutch    = GetFloat();
            retData.TruckValues.CurrentValues.DashboardValues.CruiseControlSpeed.Value     = GetFloat();
            retData.TruckValues.CurrentValues.MotorValues.BrakeValues.AirPressure          = GetFloat();
            retData.TruckValues.CurrentValues.MotorValues.BrakeValues.Temperature          = GetFloat();
            retData.TruckValues.CurrentValues.DashboardValues.FuelValue.Amount             = GetFloat();
            retData.TruckValues.CurrentValues.DashboardValues.FuelValue.AverageConsumption = GetFloat();
            retData.TruckValues.CurrentValues.DashboardValues.FuelValue.Range  = GetFloat();
            retData.TruckValues.CurrentValues.DashboardValues.AdBlue           = GetFloat();
            retData.TruckValues.CurrentValues.DashboardValues.OilPressure      = GetFloat();
            retData.TruckValues.CurrentValues.DashboardValues.OilTemperature   = GetFloat();
            retData.TruckValues.CurrentValues.DashboardValues.WaterTemperature = GetFloat();
            retData.TruckValues.CurrentValues.DashboardValues.BatteryVoltage   = GetFloat();
            retData.TruckValues.CurrentValues.LightsValues.DashboardBacklight  = GetFloat();
            retData.TruckValues.CurrentValues.DamageValues.Engine       = GetFloat();
            retData.TruckValues.CurrentValues.DamageValues.Transmission = GetFloat();
            retData.TruckValues.CurrentValues.DamageValues.Cabin        = GetFloat();
            retData.TruckValues.CurrentValues.DamageValues.Chassis      = GetFloat();
            retData.TruckValues.CurrentValues.DamageValues.WheelsAvg    = GetFloat();


            retData.TruckValues.CurrentValues.DashboardValues.Odometer = GetFloat();
            retData.NavigationValues.NavigationDistance = GetFloat();
            retData.NavigationValues.NavigationTime     = GetFloat();
            retData.NavigationValues.SpeedLimit         = GetFloat();
            retData.TruckValues.CurrentValues.WheelsValues.SuspDeflection = GetFloatArray(WheelSize);
            retData.TruckValues.CurrentValues.WheelsValues.Velocity       = GetFloatArray(WheelSize);
            retData.TruckValues.CurrentValues.WheelsValues.Steering       = GetFloatArray(WheelSize);
            retData.TruckValues.CurrentValues.WheelsValues.Rotation       = GetFloatArray(WheelSize);
            retData.TruckValues.CurrentValues.WheelsValues.Lift           = GetFloatArray(WheelSize);
            retData.TruckValues.CurrentValues.WheelsValues.LiftOffset     = GetFloatArray(WheelSize);

            retData.GamePlay.JobDelivered.CargoDamage = GetFloat();
            retData.GamePlay.JobDelivered.DistanceKm  = GetFloat();

            retData.GamePlay.RefuelEvent.Amount = GetFloat();

            retData.JobValues.CargoValues.CargoDamage = GetFloat();

            NextOffsetArea();

            #endregion

            #region 5Th ZONE

            retData.TruckValues.ConstantsValues.WheelsValues.Steerable = GetBoolArray(WheelSize);
            retData.TruckValues.ConstantsValues.WheelsValues.Simulated = GetBoolArray(WheelSize);
            retData.TruckValues.ConstantsValues.WheelsValues.Powered   = GetBoolArray(WheelSize);
            retData.TruckValues.ConstantsValues.WheelsValues.Liftable  = GetBoolArray(WheelSize);

            retData.JobValues.CargoLoaded = GetBool();
            retData.JobValues.SpecialJob  = GetBool();

            retData.TruckValues.CurrentValues.MotorValues.BrakeValues.ParkingBrake               = GetBool();
            retData.TruckValues.CurrentValues.MotorValues.BrakeValues.MotorBrake                 = GetBool();
            retData.TruckValues.CurrentValues.DashboardValues.WarningValues.AirPressure          = GetBool();
            retData.TruckValues.CurrentValues.DashboardValues.WarningValues.AirPressureEmergency = GetBool();

            retData.TruckValues.CurrentValues.DashboardValues.WarningValues.FuelW            = GetBool();
            retData.TruckValues.CurrentValues.DashboardValues.WarningValues.AdBlue           = GetBool();
            retData.TruckValues.CurrentValues.DashboardValues.WarningValues.OilPressure      = GetBool();
            retData.TruckValues.CurrentValues.DashboardValues.WarningValues.WaterTemperature = GetBool();
            retData.TruckValues.CurrentValues.DashboardValues.WarningValues.BatteryVoltage   = GetBool();
            retData.TruckValues.CurrentValues.ElectricEnabled                         = GetBool();
            retData.TruckValues.CurrentValues.EngineEnabled                           = GetBool();
            retData.TruckValues.CurrentValues.DashboardValues.Wipers                  = GetBool();
            retData.TruckValues.CurrentValues.LightsValues.BlinkerLeftActive          = GetBool();
            retData.TruckValues.CurrentValues.LightsValues.BlinkerRightActive         = GetBool();
            retData.TruckValues.CurrentValues.LightsValues.BlinkerLeftOn              = GetBool();
            retData.TruckValues.CurrentValues.LightsValues.BlinkerRightOn             = GetBool();
            retData.TruckValues.CurrentValues.LightsValues.Parking                    = GetBool();
            retData.TruckValues.CurrentValues.LightsValues.BeamLow                    = GetBool();
            retData.TruckValues.CurrentValues.LightsValues.BeamHigh                   = GetBool();
            retData.TruckValues.CurrentValues.LightsValues.Beacon                     = GetBool();
            retData.TruckValues.CurrentValues.LightsValues.Brake                      = GetBool();
            retData.TruckValues.CurrentValues.LightsValues.Reverse                    = GetBool();
            retData.TruckValues.CurrentValues.DashboardValues.CruiseControl           = GetBool();
            retData.TruckValues.CurrentValues.WheelsValues.OnGround                   = GetBoolArray(WheelSize);
            retData.TruckValues.CurrentValues.MotorValues.GearValues.HShifterSelector = GetBoolArray(2);

            retData.GamePlay.JobDelivered.AutoParked = GetBool();
            retData.GamePlay.JobDelivered.AutoLoaded = GetBool();

            NextOffsetArea();

            #endregion

            #region 6TH ZONE

            retData.TruckValues.Positioning.Cabin = GetFVector();
            retData.TruckValues.Positioning.Head  = GetFVector();
            retData.TruckValues.Positioning.Hook  = GetFVector();
            var tempPos = new SCSTelemetry.FVector[WheelSize];
            for (var j = 0; j < WheelSize; j++)
            {
                tempPos[j] = new SCSTelemetry.FVector {
                    X = GetFloat()
                };
            }

            for (var j = 0; j < WheelSize; j++)
            {
                tempPos[j].Y = GetFloat();
            }

            for (var j = 0; j < WheelSize; j++)
            {
                tempPos[j].Z = GetFloat();
            }

            retData.TruckValues.ConstantsValues.WheelsValues.PositionValues = tempPos;


            retData.TruckValues.CurrentValues.AccelerationValues.LinearVelocity           = GetFVector();
            retData.TruckValues.CurrentValues.AccelerationValues.AngularVelocity          = GetFVector();
            retData.TruckValues.CurrentValues.AccelerationValues.LinearAcceleration       = GetFVector();
            retData.TruckValues.CurrentValues.AccelerationValues.AngularAcceleration      = GetFVector();
            retData.TruckValues.CurrentValues.AccelerationValues.CabinAngularVelocity     = GetFVector();
            retData.TruckValues.CurrentValues.AccelerationValues.CabinAngularAcceleration = GetFVector();

            NextOffsetArea();

            #endregion

            #region 7TH ZONE

            retData.TruckValues.Positioning.CabinOffset = GetFPlacement();
            retData.TruckValues.Positioning.HeadOffset  = GetFPlacement();


            NextOffsetArea();

            #endregion

            #region 8TH ZONE

            retData.SetTruckPosition(GetDPlacement());


            NextOffsetArea();

            #endregion

            #region 9TH ZONE

            retData.TruckValues.ConstantsValues.BrandId = GetString();
            retData.TruckValues.ConstantsValues.Brand   = GetString();
            retData.TruckValues.ConstantsValues.Id      = GetString();
            retData.TruckValues.ConstantsValues.Name    = GetString();
            retData.JobValues.CargoValues.Id            = GetString();
            retData.JobValues.CargoValues.Name          = GetString();
            retData.JobValues.CityDestinationId         = GetString();
            retData.JobValues.CityDestination           = GetString();
            retData.JobValues.CompanyDestinationId      = GetString();
            retData.JobValues.CompanyDestination        = GetString();
            retData.JobValues.CitySourceId    = GetString();
            retData.JobValues.CitySource      = GetString();
            retData.JobValues.CompanySourceId = GetString();
            retData.JobValues.CompanySource   = GetString();
            var tempShift = GetString(16);
            if (tempShift?.Length > 0)
            {
                retData.TruckValues.ConstantsValues.MotorValues.ShifterTypeValue = tempShift.ToEnum <ShifterType>();
            }

            retData.TruckValues.ConstantsValues.LicensePlate          = GetString();
            retData.TruckValues.ConstantsValues.LicensePlateCountryId = GetString();
            retData.TruckValues.ConstantsValues.LicensePlateCountry   = GetString();

            var tempJobMarket = GetString(32);
            if (tempJobMarket?.Length > 0)
            {
                retData.JobValues.Market = tempJobMarket.ToEnum <JobMarket>();
            }

            var tempfineOffence = GetString(16);
            if (tempfineOffence?.Length > 0)
            {
                retData.GamePlay.FinedEvent.Offence = tempfineOffence.ToEnum <Offence>();
            }

            retData.GamePlay.FerryEvent.SourceName = GetString();
            retData.GamePlay.FerryEvent.TargetName = GetString();
            retData.GamePlay.FerryEvent.SourceId   = GetString();
            retData.GamePlay.FerryEvent.TargetId   = GetString();
            retData.GamePlay.TrainEvent.SourceName = GetString();
            retData.GamePlay.TrainEvent.TargetName = GetString();
            retData.GamePlay.TrainEvent.SourceId   = GetString();
            retData.GamePlay.TrainEvent.TargetId   = GetString();


            NextOffsetArea();

            #endregion

            #region 10TH ZONE

            retData.JobValues.Income = GetULong();

            NextOffsetArea();

            #endregion

            #region 11TH ZONE

            retData.GamePlay.JobCancelled.Penalty    = GetLong();
            retData.GamePlay.JobDelivered.Revenue    = GetLong();
            retData.GamePlay.FinedEvent.Amount       = GetLong();
            retData.GamePlay.TollgateEvent.PayAmount = GetLong();
            retData.GamePlay.FerryEvent.PayAmount    = GetLong();
            retData.GamePlay.TrainEvent.PayAmount    = GetLong();

            NextOffsetArea();

            #endregion

            #region 12TH ZONE

            retData.SpecialEventsValues.OnJob       = GetBool();
            retData.SpecialEventsValues.JobFinished = GetBool();

            retData.SpecialEventsValues.JobCancelled = GetBool();
            retData.SpecialEventsValues.JobDelivered = GetBool();
            retData.SpecialEventsValues.Fined        = GetBool();
            retData.SpecialEventsValues.Tollgate     = GetBool();
            retData.SpecialEventsValues.Ferry        = GetBool();
            retData.SpecialEventsValues.Train        = GetBool();

            retData.SpecialEventsValues.Refuel      = GetBool();
            retData.SpecialEventsValues.RefuelPayed = GetBool();

            NextOffsetArea();

            #endregion

            #region 13TH ZONE

            for (var i = 0; i < Substances; i++)
            {
                var tempSubstance = GetString();
                if (tempSubstance.Length != 0)
                {
                    retData.Substances.Add(new SCSTelemetry.Substance {
                        Index = i, Value = tempSubstance
                    });
                }
            }

            NextOffsetArea();

            #endregion

            #region 14TH ZONE

            retData.TrailerValues = GetTrailers();

            #endregion


            return(retData);
        }
Ejemplo n.º 11
0
        /*
         * void timer_Tick(object sender, EventArgs e)
         * {
         *  switch (Truck_Daten.HERSTELLER_ID)
         *  {
         *      case "mercedes":
         *          //BILD_ANZEIGE.Source = new BitmapImage(new Uri("Icons/icons8-mercedes-benz-256.png", UriKind.Relative));
         *          BILD_ANZEIGE.Source = new BitmapImage(new Uri("{iconPacks:SimpleIcons Kind=Mercedes}", UriKind.Relative));
         *          break;
         *      case "scania":
         *          BILD_ANZEIGE.Source = new BitmapImage(new Uri("Icons/icons8-scania-256.png", UriKind.Relative));
         *          break;
         *      case "volvo":
         *          //BILD_ANZEIGE.Source = new BitmapImage(new Uri("Icons/icons8-volvo-256.png", UriKind.Relative));
         *          BILD_ANZEIGE2 = "{iconPacks:SimpleIcons Kind=Volvo}";
         *          break;
         *      case "iveco":
         *          BILD_ANZEIGE.Source = new BitmapImage(new Uri("Icons/icons8-iveco-256.png", UriKind.Relative));
         *          break;
         *      case "renault":
         *          BILD_ANZEIGE.Source = new BitmapImage(new Uri("Icons/icons8-renault-256.png", UriKind.Relative));
         *          break;
         *      case "daf":
         *          BILD_ANZEIGE.Source = new BitmapImage(new Uri("Icons/icons8-daf-256.png", UriKind.Relative));
         *          break;
         *      case "man":
         *          BILD_ANZEIGE.Source = new BitmapImage(new Uri("Icons/man-256.png", UriKind.Relative));
         *          break;
         *  }
         *
         * }
         */


        private void Telemetry_Data_Handler(SCSTelemetry data, bool updated)
        {
            try
            {
                if (!InvokeRequired)
                {
                    // ALLGEMEINES
                    Truck_Daten.TELEMETRY_VERSION = "Telemetry: " + data.TelemetryVersion.Major.ToString() + "." + data.TelemetryVersion.Minor.ToString();

                    Truck_Daten.SPIEL_VERSION = "Game: " + data.GameVersion.Major.ToString() + "." + data.GameVersion.Minor.ToString();

                    if (Truck_Daten.SPIEL_VERSION == "Game: 1.16")
                    {
                        int_game_version = "1.37";
                    }
                    else if (Truck_Daten.SPIEL_VERSION == "Game: 1.17")
                    {
                        int_game_version = "1.38";
                    }
                    else if (Truck_Daten.SPIEL_VERSION == "Game: 1.18")
                    {
                        int_game_version = "1.39";
                    }
                    else if (Truck_Daten.SPIEL_VERSION == "Game: 1.19")
                    {
                        int_game_version = "1.40";
                    }
                    else if (Truck_Daten.SPIEL_VERSION == "Game: 1.20")
                    {
                        int_game_version = "1.41";
                    }
                    else if (Truck_Daten.SPIEL_VERSION == "Game: 1.21")
                    {
                        int_game_version = "1.42";
                    }

                    Truck_Daten.SPIEL_VERSION += " (" + int_game_version + ")";

                    Truck_Daten.DLL_VERSION = "DLL: " + data.DllVersion.ToString();
                    Truck_Daten.SPIEL       = data.Game.ToString();


                    Truck_Daten.IS_GAME_RUNNING = data.Paused;
                    Truck_Daten.SDK_ACTIVE      = data.SdkActive;
                    Truck_Daten.SPIEL           = data.Game.ToString();

                    Truck_Daten.ANZEIGE_KM_MILES   = (Truck_Daten.SPIEL == "Ets2") ? " km " : " mi";
                    Truck_Daten.ANZEIGE_TO_LBS     = (Truck_Daten.SPIEL == "Ets2") ? " t " : " lb ";
                    Truck_Daten.SPEED_KMH          = (int)data.TruckValues.CurrentValues.DashboardValues.Speed.Kph;
                    Truck_Daten.SPEED_TACHO_KMH    = (int)data.TruckValues.CurrentValues.DashboardValues.Speed.Kph - 85;
                    Truck_Daten.SPEED_MPH          = (int)data.TruckValues.CurrentValues.DashboardValues.Speed.Kph;
                    Truck_Daten.SPEED_TACHO_MPH    = (int)data.TruckValues.CurrentValues.DashboardValues.Speed.Kph - 85;
                    Truck_Daten.BLINKER_LINKS      = (bool)data.TruckValues.CurrentValues.LightsValues.BlinkerLeftOn;
                    Truck_Daten.BLINKER_RECHTS     = (bool)data.TruckValues.CurrentValues.LightsValues.BlinkerRightOn;
                    Truck_Daten.TEMPOMAT_KMH       = (int)data.TruckValues.CurrentValues.DashboardValues.CruiseControlSpeed.Kph;
                    Truck_Daten.TEMPOMAT_MPH       = (int)data.TruckValues.CurrentValues.DashboardValues.CruiseControlSpeed.Mph;
                    Truck_Daten.VorwaertsGaenge    = (int)data.TruckValues.ConstantsValues.MotorValues.ForwardGearCount;
                    Truck_Daten.RUECKWAERTS_GAENGE = (int)data.TruckValues.ConstantsValues.MotorValues.ReverseGearCount;
                    Truck_Daten.GANG           = (int)data.TruckValues.CurrentValues.MotorValues.GearValues.Selected;
                    Truck_Daten.HERSTELLER     = data.TruckValues.ConstantsValues.Brand;
                    Truck_Daten.HERSTELLER_ID  = data.TruckValues.ConstantsValues.BrandId;
                    Truck_Daten.MODELL         = translation.TRUCK_MODELL + data.TruckValues.ConstantsValues.Name;
                    Truck_Daten.FUEL_MAX       = (int)data.TruckValues.ConstantsValues.CapacityValues.Fuel;
                    Truck_Daten.FUEL_BESTAND   = (int)data.TruckValues.CurrentValues.DashboardValues.FuelValue.Amount;
                    Truck_Daten.FUEL_REST      = (int)data.TruckValues.CurrentValues.DashboardValues.FuelValue.Amount;
                    Truck_Daten.FUEL_VERBRAUCH = data.TruckValues.CurrentValues.DashboardValues.FuelValue.AverageConsumption;
                    Truck_Daten.ADBLUE_MAX     = Convert.ToInt32(data.TruckValues.ConstantsValues.CapacityValues.AdBlue).ToString();
                    Truck_Daten.ADBLUE_BESTAND = Convert.ToInt32(data.TruckValues.CurrentValues.DashboardValues.AdBlue).ToString();
                    Truck_Daten.RPM            = (int)data.TruckValues.CurrentValues.DashboardValues.RPM;
                    Truck_Daten.RPM_MAX        = (int)data.TruckValues.ConstantsValues.MotorValues.EngineRpmMax;
                    // STATUS ANZEIGEN
                    Truck_Daten.ELEKTRIK_STATUS  = data.TruckValues.CurrentValues.ElectricEnabled;
                    Truck_Daten.ABBLENDLICHT     = (bool)data.TruckValues.CurrentValues.LightsValues.Parking;
                    Truck_Daten.NORMMALLICHT     = (bool)data.TruckValues.CurrentValues.LightsValues.BeamLow;
                    Truck_Daten.PARKING_BRAKE    = (bool)data.TruckValues.CurrentValues.MotorValues.BrakeValues.ParkingBrake;
                    Truck_Daten.BRAKE_VISIBILITY = (bool)data.TruckValues.CurrentValues.MotorValues.BrakeValues.MotorBrake;

                    // Schadensanzeige
                    Truck_Daten.TRUCK_MOTOR_SCHADEN    = Convert.ToInt32(data.TruckValues.CurrentValues.DamageValues.Engine * 100);
                    Truck_Daten.TRUCK_GETRIEBE_SCHADEN = Convert.ToInt32(data.TruckValues.CurrentValues.DamageValues.Transmission * 100);
                    Truck_Daten.TRUCK_FAHRWERK_SCHADEN = Convert.ToInt32(data.TruckValues.CurrentValues.DamageValues.Chassis * 100);
                    Truck_Daten.TRUCK_CHASSIS_SCHADEN  = Convert.ToInt32(data.TruckValues.CurrentValues.DamageValues.Cabin * 100);
                    Truck_Daten.TRUCK_RAEDER_SCHADEN   = Convert.ToInt32(data.TruckValues.CurrentValues.DamageValues.WheelsAvg * 100);
                    Truck_Daten.TRAILER_FRACHT_SCHADEN = (double)data.JobValues.CargoValues.CargoDamage * 100;

                    Truck_Daten.TRAILER_FAHRWERK_SCHADEN = (double)data.TrailerValues[0].DamageValues.Wheels;
                    Truck_Daten.TRAILER_CHASSIS_SCHADEN  = (double)data.TrailerValues[0].DamageValues.Chassis;
                    // JOB DATEN
                    Truck_Daten.FRACHT_GELADEN      = (bool)data.TrailerValues[0].Attached;
                    Truck_Daten.IS_JOB_DATA_VISIBLE = (bool)data.TrailerValues[0].Attached;
                    Truck_Daten.REST_STRECKE        = (int)data.NavigationValues.NavigationDistance / 1000;
                    Truck_Daten.SPEZIAL_JOB         = (bool)data.JobValues.SpecialJob;
                    Truck_Daten.MARKET                = data.JobValues.Market.ToString();
                    Truck_Daten.START_ORT             = (string)data.JobValues.CitySource;
                    Truck_Daten.ZIEL_ORT              = (string)data.JobValues.CityDestination;
                    Truck_Daten.START_FIRMA           = (string)data.JobValues.CompanySource;
                    Truck_Daten.ZIEL_FIRMA            = (string)data.JobValues.CompanyDestination;
                    Truck_Daten.JOB_EINKOMMEN         = (double)data.JobValues.Income;
                    Truck_Daten.GEPLANTE_DISTANZ      = (int)data.JobValues.PlannedDistanceKm;
                    Truck_Daten.FRACHT_GEWICHT        = (double)data.JobValues.CargoValues.Mass;
                    Truck_Daten.FRACHT_GEWICHT_TONNEN = (int)data.JobValues.CargoValues.Mass / 1000;
                    Truck_Daten.FRACHT_NAME           = (string)data.JobValues.CargoValues.Name;
                    // TODO Es fehlen noch :CARGO_ID : UNIT_COUNT : UNIT_MASS und die ganzen ID von Job City Source/Destination etc. Falls benötigt, kurz sagen

                    // NAVIGATION
                    Truck_Daten.NAVIGATION_DISTANZ         = (double)data.NavigationValues.NavigationDistance / 1000;
                    Truck_Daten.NAVIGATION_SPEED_LIMIT_KMH = (int)data.NavigationValues.SpeedLimit.Kph;
                    Truck_Daten.NAVIGATION_SPEED_LIMIT_MPH = (int)data.NavigationValues.SpeedLimit.Mph;
                    Truck_Daten.NAVIGATION_ZEIT            = (double)data.NavigationValues.NavigationTime;

                    Truck_Daten.ANZEIGE_SPEED_LIMIT = Truck_Daten.SPIEL == "Ets2" ? Truck_Daten.NAVIGATION_SPEED_LIMIT_KMH.ToString() : Truck_Daten.NAVIGATION_SPEED_LIMIT_MPH.ToString();

                    // MAUTSTATIONEN
                    Truck_Daten.MAUT_BEZAHLT = (int)data.GamePlay.TollgateEvent.PayAmount;

                    // TANKEN
                    Truck_Daten.TANKEN_BEZAHLT = (int)data.GamePlay.RefuelEvent.Amount;

                    // STRAFEN
                    Truck_Daten.TANKEN_BEZAHLT = (int)data.GamePlay.FinedEvent.Amount;

                    // FÄHREN
                    Truck_Daten.FAEHRE_BEZAHLT     = (int)data.GamePlay.FerryEvent.PayAmount;
                    Truck_Daten.FAEHRE_ABFAHRT_VON = (string)data.GamePlay.FerryEvent.SourceName;
                    Truck_Daten.FAEHRE_ANKUNFT_IN  = (string)data.GamePlay.FerryEvent.TargetName;

                    // JOB ABGABE
                    Truck_Daten.ABGABE_JOB_BEENDET   = data.GamePlay.JobDelivered.Finished.ToString();
                    Truck_Daten.ABGABE_AUTOPARKING   = (bool)data.GamePlay.JobDelivered.AutoParked;
                    Truck_Daten.ABGABE_FRACHTSCHADEN = (double)data.GamePlay.JobDelivered.CargoDamage;
                    Truck_Daten.ABGABE_ABGABEZEIT    = data.GamePlay.JobDelivered.DeliveryTime.ToString();
                    Truck_Daten.ABGABE_DISTANZ_KM    = (int)data.GamePlay.JobDelivered.DistanceKm;
                    Truck_Daten.ABGABE_XP            = (int)data.GamePlay.JobDelivered.EarnedXp;
                    Truck_Daten.ABGABE_EINNAHMEN     = (double)data.GamePlay.JobDelivered.Revenue;

                    // Definition ETS / ATS
                    Truck_Daten.ANZEIGE_LITER_GALLONEN = (data.Game.ToString() == "Ets2") ? "Liter" : "Gall.";

                    // TEXTANZEIGE IM MAINVIEW-STREETVIEW
                    // TODO TRANSLATION DE EN
                    Truck_Daten.TXT_FAHRT  = "Du fährst " + Truck_Daten.FRACHT_GEWICHT_TONNEN + Truck_Daten.ANZEIGE_TO_LBS + data.JobValues.CargoValues.Name + " von ";
                    Truck_Daten.TXT_FAHRT += data.JobValues.CitySource + " nach ";
                    Truck_Daten.TXT_FAHRT += data.JobValues.CityDestination;
                    Truck_Daten.TXT_FAHRT += Environment.NewLine;
                    Truck_Daten.TXT_FAHRT += "Du musst noch " + Truck_Daten.REST_STRECKE + Truck_Daten.ANZEIGE_KM_MILES + " fahren !";

                    if (Truck_Daten.HERSTELLER_ID == "mercedes")
                    {
                        BILD_ANZEIGE.Source = new BitmapImage(new Uri("Icons/icons8-mercedes-benz-256.png", UriKind.Relative));
                    }

                    image.Visibility  = data.Game.ToString() == "Ats" ? Visibility.Hidden : Visibility.Visible;
                    image2.Visibility = data.Game.ToString() == "Ets" || data.Game.ToString() == "Ats" ? Visibility.Hidden : Visibility.Visible;
                    image3.Visibility = data.Game.ToString() == "Ets2" ? Visibility.Hidden : Visibility.Visible;
                }
            }
            catch
            { }
        }
Ejemplo n.º 12
0
 /// <summary>
 ///     Create a new LogEntry with SCSTelemetry data.
 /// </summary>
 /// <param name="data"></param>
 public LogEntry(SCSTelemetry data) => Data = data;
Ejemplo n.º 13
0
        /*        private void TelemetryOnJobStarted(object sender, EventArgs e) =>
         *          MessageBox.Show("Just started job OR loaded game with active.");
         *
         *      private void TelemetryJobCancelled(object sender, EventArgs e) =>
         *          MessageBox.Show("Job Cancelled");
         *
         *      private void TelemetryJobDelivered(object sender, EventArgs e) =>
         *          MessageBox.Show("Job Delivered");
         *
         *      private void TelemetryFined(object sender, EventArgs e) =>
         *          MessageBox.Show("Fined");
         *
         *      private void TelemetryTollgate(object sender, EventArgs e) =>
         *          MessageBox.Show("Tollgate");
         *
         *      private void TelemetryFerry(object sender, EventArgs e) =>
         *          MessageBox.Show("Ferry");
         *
         *      private void TelemetryTrain(object sender, EventArgs e) =>
         *          MessageBox.Show("Train");*/
        //private void TelemetryRefuel(object sender, EventArgs e) => rtb_fuel.Invoke((MethodInvoker)(() => rtb_fuel.BackColor = Color.Green));
        //private void TelemetryRefuelEnd(object sender, EventArgs e) => rtb_fuel.Invoke((MethodInvoker)(() => rtb_fuel.BackColor = Color.Red));

        /*        private void TelemetryRefuelPayed(object sender, EventArgs e)
         *      {
         *          MessageBox.Show("Fuel Payed");
         *      }*/

        public void Telemetry_Data(SCSTelemetry data, bool updated)
        {
            try
            {
                if (InvokeRequired)
                {
                    Invoke(new TelemetryData(Telemetry_Data), data, updated);
                    return;
                }
                UpdateInterval                   = Telemetry.UpdateInterval;
                Truck.Constant.RegPlate          = data.TruckValues.ConstantsValues.LicensePlate;
                Truck.Constant.RegPlateCountryID = data.TruckValues.ConstantsValues.LicensePlateCountryId;
                Truck.Constant.Manufacture       = data.TruckValues.ConstantsValues.Brand;
                Truck.Constant.Model             = data.TruckValues.ConstantsValues.Name;
                Truck.Constant.FuelCap           = (int)data.TruckValues.ConstantsValues.CapacityValues.Fuel;
                Truck.Constant.Transmission      = data.TruckValues.ConstantsValues.MotorValues.ShifterTypeValue.ToString();
                //Truck.OnJob = data.SpecialEventsValues.OnJob.ToString();

                //Truck Warnings
                Truck.Warnings.AirPressure          = data.TruckValues.CurrentValues.DashboardValues.WarningValues.AirPressure;
                Truck.Warnings.AirPressureEmergency = data.TruckValues.CurrentValues.DashboardValues.WarningValues.AirPressureEmergency;
                Truck.Warnings.Adblue           = data.TruckValues.CurrentValues.DashboardValues.WarningValues.AdBlue;
                Truck.Warnings.BatteryVoltage   = data.TruckValues.CurrentValues.DashboardValues.WarningValues.BatteryVoltage;
                Truck.Warnings.Fuel             = data.TruckValues.CurrentValues.DashboardValues.WarningValues.FuelW;
                Truck.Warnings.OilPressure      = data.TruckValues.CurrentValues.DashboardValues.WarningValues.OilPressure;
                Truck.Warnings.WaterTemperature = data.TruckValues.CurrentValues.DashboardValues.WarningValues.WaterTemperature;

                //Set Variable Values
                Truck.Current.Mileage            = (int)(data.TruckValues.CurrentValues.DashboardValues.Odometer * 0.62137); //In miles
                Truck.Current.Speed              = (int)data.TruckValues.CurrentValues.DashboardValues.Speed.Mph;
                Truck.Current.Gear               = data.TruckValues.CurrentValues.DashboardValues.GearDashboards.ToString();
                Truck.Current.Fuel               = (int)data.TruckValues.CurrentValues.DashboardValues.FuelValue.Amount;
                Truck.Current.Range              = (int)(data.TruckValues.CurrentValues.DashboardValues.FuelValue.Range * 0.62137); //In Miles
                Truck.Current.CruiseControl      = data.TruckValues.CurrentValues.DashboardValues.CruiseControl;
                Truck.Current.CruiseControlSpeed = (int)data.TruckValues.CurrentValues.DashboardValues.CruiseControlSpeed.Mph;
                Truck.Current.AirPressure        = (int)data.TruckValues.CurrentValues.MotorValues.BrakeValues.AirPressure;
                Truck.Current.BrakeTemperature   = (int)data.TruckValues.CurrentValues.MotorValues.BrakeValues.Temperature;
                Truck.Current.ParkingBrake       = data.TruckValues.CurrentValues.MotorValues.BrakeValues.ParkingBrake;
                Truck.Current.EngineBrake        = data.TruckValues.CurrentValues.MotorValues.BrakeValues.MotorBrake;
                Truck.Current.RetarderLevel      = data.TruckValues.CurrentValues.MotorValues.BrakeValues.RetarderLevel;
                Coord.X = data.TruckValues.CurrentValues.PositionValue.Position.X;
                Coord.Y = data.TruckValues.CurrentValues.PositionValue.Position.Y;
                Coord.Z = data.TruckValues.CurrentValues.PositionValue.Position.Z;

                //Truck Lights
                Truck.Lights.AuxFront           = data.TruckValues.CurrentValues.LightsValues.AuxFront.ToString();
                Truck.Lights.AuxRoof            = data.TruckValues.CurrentValues.LightsValues.AuxRoof.ToString();
                Truck.Lights.Beacon             = data.TruckValues.CurrentValues.LightsValues.Beacon;
                Truck.Lights.BeamHigh           = data.TruckValues.CurrentValues.LightsValues.BeamHigh;
                Truck.Lights.BeamLow            = data.TruckValues.CurrentValues.LightsValues.BeamLow;
                Truck.Lights.BlinkerLeftOn      = data.TruckValues.CurrentValues.LightsValues.BlinkerLeftOn;
                Truck.Lights.BlinkerLeftActive  = data.TruckValues.CurrentValues.LightsValues.BlinkerLeftActive;
                Truck.Lights.BlinkerRightOn     = data.TruckValues.CurrentValues.LightsValues.BlinkerRightOn;
                Truck.Lights.BlinkerRightActive = data.TruckValues.CurrentValues.LightsValues.BlinkerRightActive;
                Truck.Lights.Brake   = data.TruckValues.CurrentValues.LightsValues.Brake;
                Truck.Lights.Parking = data.TruckValues.CurrentValues.LightsValues.Parking;
                Truck.Lights.Reverse = data.TruckValues.CurrentValues.LightsValues.Reverse;

                //Game Values
                Game.Values.Time    = data.CommonValues.GameTime.Date.ToString();
                Game.Values.Day     = data.CommonValues.GameTime.Date.Day;
                Game.Values.WeekDay = data.CommonValues.GameTime.Date.DayOfWeek.ToString();

                //Format Game Values
                Game.Values.Time    = Game.Values.Time.Remove(0, 11);
                Game.Values.Time    = Game.Values.Time.Remove(5, 3);
                Game.Values.WeekDay = Game.Values.WeekDay.Substring(0, 3);

                lbGeneral.Text = "General info: \n\n" +
                                 "SDK Running: " + $"{data.SdkActive}\n\n" +
                                 "SDK Version: " + $"{data.DllVersion}\n\n" +
                                 "Game: " + $"{data.Game}\n\n" +
                                 "Game Version: " + $"{data.GameVersion.Major}.{data.GameVersion.Minor}\n\n" +
                                 "Telemetry Version: " + $"{data.TelemetryVersion.Major}.{data.TelemetryVersion.Minor}\n\n" +
                                 "In-Game Time: " + Game.Values.WeekDay + " - " + Game.Values.Time + "\n\n" +
                                 "In-Game Day: " + Game.Values.Day + "\n\n" +
                                 "Simulation TimeStamp: " + $"{data.SimulationTimestamp}\n\n" +
                                 "Render TimeStamp: " + $"{data.RenderTimestamp}\n\n" +
                                 "Game Paused: " + $"{data.Paused}\n\n" +
                                 "Update Int.: " + UpdateInterval + "m\n\n" +
                                 "COM Port: " + ComPort;
            }
            catch (Exception ex)
            {
                // ignored atm i found no proper way to shut the telemetry down and down call this anymore when this or another thing is already disposed
                Console.WriteLine("Telemetry was closed: " + ex);
            }
        }