private static void ParamsReceivedEventHandler(object o, BasicDeliverEventArgs basicDeliverEventArgs) { Warning warning = Warning.Deserialize(basicDeliverEventArgs.Body); Console.ForegroundColor = ConsoleColor.DarkRed; Console.Write("SERIOUS FAULT - CREW GETTING READY: "); CarParams.Print(warning.TyresPressureWarningLevel, $"Tyres pressure - {warning.TyresPressureWarningLevel}"); CarParams.Print(warning.RadiatorFluidTempWarningLevel, $"Radiator fluid temperature - {warning.RadiatorFluidTempWarningLevel}"); CarParams.Print(warning.EngineTempWarningLevel, $"Engine temperature - {warning.EngineTempWarningLevel}"); Console.WriteLine(); }
private static void ParamsReceivedEventHandler(object o, BasicDeliverEventArgs basicDeliverEventArgs) { Warning warning = Warning.Deserialize(basicDeliverEventArgs.Body); Console.ForegroundColor = ConsoleColor.Cyan; Console.Write("Warning received: "); CarParams.Print(warning.TyresPressureWarningLevel, $"Tyres pressure - {warning.TyresPressureWarningLevel}"); CarParams.Print(warning.RadiatorFluidTempWarningLevel, $"Radiator fluid temperature - {warning.RadiatorFluidTempWarningLevel}"); CarParams.Print(warning.EngineTempWarningLevel, $"Engine temperature - {warning.EngineTempWarningLevel}"); Console.WriteLine(); if (warning.EngineTempWarningLevel == WarningLevel.Lv2 || warning.RadiatorFluidTempWarningLevel == WarningLevel.Lv2 || warning.TyresPressureWarningLevel == WarningLevel.Lv2) { RequestPitStop(warning.CarParams); } }