public Segment(SqlDataReader reader) { Id = (int)reader["Id"]; IdRecette = (int)reader["IdRecette"]; Nom = (string)reader["Nom"]; Etat = (bool)reader["Etat"]; Type = (TYPEREDRESSEUR)Enum.Parse(typeof(TYPEREDRESSEUR), (string)reader["Type"]); Duree = TimeSpan.Parse(reader["Duree"].ToString()); ConsigneDepartV = (int)reader["ConsigneDepartV"]; ConsigneDepartA = (int)reader["ConsigneDepartA"]; ConsigneArriveeV = (int)reader["ConsigneArriveeV"]; ConsigneArriveeA = (int)reader["ConsigneArriveeA"]; TempsRestant = TimeSpan.Parse(reader["TempsRestant"].ToString()); Pulse = (bool)reader["Pulse"]; CompteurAH = (int)reader["CompteurAH"]; Temporisation = (bool)reader["Temporisation"]; TempsOn = TimeSpan.Parse(reader["TempsOn"].ToString()); TempsOff = TimeSpan.Parse(reader["TempsOff"].ToString()); AH = (bool)reader["AH"]; CompteurAH = (int)reader["CompteurAH"]; CalibreAH = (CALIBRE)Enum.Parse(typeof(CALIBRE), (string)reader["CalibreAH"]); Rampe = (bool)reader["Rampe"]; DureeRampe = TimeSpan.Parse(reader["DureeRampe"].ToString()); Options = OptionsService.GetAllOptionsFromTableId(Id, "Id" + this.GetType().Name); }
public Recette(DataService.Recette rec) { Id = rec.Id; IdProcess = rec.IdProcess; Nom = rec.Nom; Cyclage = rec.Cyclage; TempsRestant = new TimeSpan(0); Segments = GetAllSegmentFromRecetteId(Id); Options = OptionsService.GetAllOptionsFromTableId(Id, "Id" + this.GetType().Name); foreach (Segment seg in Segments) { TempsRestant = TempsRestant + seg.Duree; } }
public Redresseur(DataService.Redresseur red) { ValuesA = new ChartValues <double> { 0 }; ValuesB = new ChartValues <double> { 0 }; Id = red.Id; IdProcess = red.IdProcess; IpAdresse = red.IpAdresse; OnOff = red.OnOff; MiseSousTension = red.MiseSousTension; Etat = (MODES)Enum.Parse(typeof(MODES), red.Etat); Type = (TYPEREDRESSEUR)Enum.Parse(typeof(TYPEREDRESSEUR), red.Type); UMax = red.UMax; IMax = red.IMax; ConsigneV = red.ConsigneV; ConsigneA = red.ConsigneA; LectureV = red.LectureV; LectureA = red.LectureA; Temperature = red.Temperature; AH = red.AH; CompteurAH = red.CompteurAH; CalibreAH = (CALIBRE)Enum.Parse(typeof(CALIBRE), red.CalibreAH); Pulse = red.Pulse; Temporisation = red.Temporisation; TempsOn = red.TempsOn; TempsOff = red.TempsOff; DureeTempo = DateTime.Parse(red.DureeTempo.ToString()); DureeRestante = DateTime.Parse(red.DureeRestante.ToString()); Rampe = red.Rampe; DureeRampe = DateTime.Parse(red.DureeRampe.ToString()); Defaut = red.Defaut; Options = OptionsService.GetAllOptionsFromTableId(Id, "Id" + this.GetType().Name); Registres = Registre.GetAllRegisterFromRedresseurId(Id); ListRecette = RecetteService.GetListRecetteFromProcessId(IdProcess); RedresseurPoolingTask = new Thread(RedresseurPooling); RedresseurPoolingTask.Start(); }
public ObservableCollection <Process> GetAllData() { ObservableCollection <Process> result = new ObservableCollection <Process>(); try { using (var bdd = new AcoreDBEntities()) { List <Process> processes = bdd.Process.ToList(); foreach (Process pro in processes) { pro.Recettes = RecetteService.GetListRecetteFromProcessId(pro.Id); pro.Options = OptionsService.GetAllOptionsFromTableId(pro.Id, "Id" + pro.GetType().Name); result.Add(pro); } } } catch (Exception e) { Console.WriteLine("Exception: {0}", e); } return(result); }
public Redresseur(SqlDataReader reader) { ValuesA = new ChartValues <double> { 0 }; ValuesB = new ChartValues <double> { 0 }; Id = (int)reader["Id"]; IdProcess = (int)reader["IdProcess"]; IpAdresse = (string)reader["IpAdresse"]; OnOff = (bool)reader["OnOff"]; MiseSousTension = (bool)reader["MiseSousTension"]; Etat = (MODES)Enum.Parse(typeof(MODES), (string)reader["Etat"]); Type = (TYPEREDRESSEUR)Enum.Parse(typeof(TYPEREDRESSEUR), (string)reader["Type"]); UMax = (int)reader["UMax"]; IMax = (int)reader["IMax"]; ConsigneV = (int)reader["ConsigneV"]; ConsigneA = (int)reader["ConsigneA"]; LectureV = (int)reader["LectureV"]; LectureA = (int)reader["LectureA"]; Temperature = (int)reader["Temperature"]; AH = (bool)reader["AH"]; CompteurAH = (int)reader["CompteurAH"]; CalibreAH = (CALIBRE)Enum.Parse(typeof(CALIBRE), (string)reader["CalibreAH"]); Pulse = (bool)reader["Pulse"]; Temporisation = (bool)reader["Temporisation"]; TempsOn = (int)reader["TempsOn"]; TempsOff = (int)reader["TempsOff"]; DureeTempo = DateTime.Parse(reader["DureeTempo"].ToString()); DureeRestante = DateTime.Parse(reader["DureeRestante"].ToString()); Rampe = (bool)reader["Rampe"]; DureeRampe = DateTime.Parse(reader["DureeRampe"].ToString()); Defaut = (bool)reader["Defaut"]; //OrdreFabrication = (string)reader["OrdreFabrication"]; //EtatFin = (ETATFIN)Enum.Parse(typeof(ETATFIN), (string)reader["EtatFin"]); Options = OptionsService.GetAllOptionsFromTableId(Id, "Id" + this.GetType().Name); Registres = Registre.GetAllRegisterFromRedresseurId(Id); ListRecette = RecetteService.GetListRecetteFromProcessId(IdProcess); switch (Etat) { case MODES.LocalManuel: if (onOff) { EtatImageSource = "../Resources/liasonOkLocal.png"; } else { EtatImageSource = "../Resources/liasonPas.png"; } break; case MODES.LocalRecette: if (onOff) { EtatImageSource = "../Resources/liasonOkRecette.png"; } else { EtatImageSource = "../Resources/liasonPas.png"; } break; case MODES.RemoteManuel: if (onOff) { EtatImageSource = "../Resources/liasonOkRemote.png"; } else { EtatImageSource = "../Resources/liasonPas.png"; } break; case MODES.RemoteRecette: EtatImageSource = "../Resources/liasonPas.png"; break; case MODES.Supervision: if (onOff) { EtatImageSource = "../Resources/supervision.png"; } else { EtatImageSource = "../Resources/supervisionPas.png"; } break; } RedresseurPoolingTask = new Thread(RedresseurPooling); RedresseurPoolingTask.Start(); }