Révision 9601eaf0 GES_PAC/Model/SerieAnimal.cs
GES_PAC/Model/SerieAnimal.cs | ||
---|---|---|
1 |
|
|
1 |
|
|
2 | 2 |
using Microsoft.Maui.Layouts; |
3 | 3 |
|
4 | 4 |
namespace GES_PAC.Model |
... | ... | |
52 | 52 |
{ |
53 | 53 |
return Comportements.Count != 0; |
54 | 54 |
} |
55 |
public string GetTimeInChamber() |
|
55 |
public bool IsTimeWarning() |
|
56 |
{ |
|
57 |
if (Mesures.Count == 0 || IsOut) |
|
58 |
return false; |
|
59 |
return (DateTime.Now - GetFirstMeasure().Time) > TimeSpan.FromHours(1); |
|
60 |
} |
|
61 |
public string GetFormatedTimeInChamber() |
|
56 | 62 |
{ |
57 | 63 |
if (Mesures.Count == 0) |
58 | 64 |
return ""; |
... | ... | |
63 | 69 |
else |
64 | 70 |
timeInChamber = DateTime.Now - GetFirstMeasure().Time; |
65 | 71 |
|
66 |
return $"{timeInChamber.Hours:00}:{timeInChamber.Minutes:00}"; |
|
72 |
return $"{timeInChamber.Hours:00}:{timeInChamber.Minutes:00}" + (IsTimeWarning() ? "⚠" : "");
|
|
67 | 73 |
} |
74 |
|
|
68 | 75 |
} |
69 | 76 |
} |
Formats disponibles : Unified diff