Révision 6f451cc1 GES_PAC/Model/Calibration.cs
GES_PAC/Model/Calibration.cs | ||
---|---|---|
1 |
|
|
1 |
using SQLite; |
|
2 |
using System.ComponentModel.DataAnnotations.Schema; |
|
2 | 3 |
|
3 | 4 |
namespace GES_PAC.Model |
4 | 5 |
{ |
5 | 6 |
public class Calibration |
6 | 7 |
{ |
7 |
public long Id { get; set; } |
|
8 |
#region Propri?t?s |
|
9 |
[PrimaryKey, AutoIncrement] |
|
10 |
public int Id { get; set; } |
|
11 |
public int PhaseCalibrationId { get; set; } |
|
12 |
[ForeignKey("PhaseCalibrationId")] |
|
8 | 13 |
public PhaseCalibration Phase { get; set; } |
9 |
public List<MesureCalibration> Mesures { get; set; } |
|
10 |
|
|
14 |
public List<MesureCalibration> Mesures { get; set; } = []; |
|
15 |
public int JourneeId { get; set; } |
|
16 |
[ForeignKey("JourneeId")] |
|
17 |
public Journee Journee { get; set; } |
|
18 |
#endregion |
|
19 |
|
|
20 |
#region Constructeurs |
|
21 |
public Calibration() { } |
|
11 | 22 |
public Calibration(PhaseCalibration Phase, MesureCalibration Mesure) |
12 | 23 |
{ |
13 | 24 |
this.Phase = Phase; |
14 | 25 |
Mesures = []; |
15 | 26 |
Mesures.Add(Mesure); |
16 | 27 |
} |
17 |
|
|
28 |
#endregion |
|
18 | 29 |
public void AddMesure(MesureCalibration mesure) |
19 | 30 |
{ |
31 |
mesure.Calibration = this; |
|
20 | 32 |
var index = Mesures.FindIndex(m => m.Type == mesure.Type); |
21 | 33 |
if (index != -1) |
22 | 34 |
{ |
Formats disponibles : Unified diff