private string GenerateTableForPressure() { var tableHeader = "<table style=\"table align: center; width: 100 % display: block;margin - left: auto;margin - right: auto;" + " text-align: left; border: 1px solid black; border-collapse: collapse; \">" + " <caption style=\" background-color: #ffffff; border: 1px solid black;\"><strong>Valores de Pressão</strong></caption>" + "<tr style=\"border: 1px solid black;\">" + "<th style=\"border: 1px solid black;\">Tipo</th>" + "<th style=\"border: 1px solid black;\">SetPoint (bar)</th>" + "<th style=\"border: 1px solid black;\">Taxa (bar/min)</th>" + "<th style=\"border: 1px solid black;\">Tempo (min)</th>" + "<th style=\"border: 1px solid black;\">Tolerância (bar)</th>" + "</tr>"; var tableBody = ""; var change = true; foreach (var item in _pressureRepository.getValues()) { if (change) { tableBody += "<tr style=\"border: 1px solid black; background-color: #f2f2f2;\">"; } else { tableBody += "<tr style=\"border: 1px solid black;background-color: #ffffff;\">"; } tableBody += "<td style=\"border: 1px solid black;\">" + item.Tipo + "</td>" + "<td style=\"border: 1px solid black;\">" + item.SetPoint + "</td>" + "<td style=\"border: 1px solid black;\">" + item.Taxa + "</td>" + "<td style=\"border: 1px solid black;\">" + item.Tempo + "</td>" + "<td style=\"border: 1px solid black;\">" + item.Tolerancia + "</td>" + "</tr>"; change = (!change); } return(tableHeader + tableBody + " </table> "); }
public void SaveToFile(string path) { using (StreamWriter outputFile = new StreamWriter(path)) { outputFile.WriteLine(""); var header = "Tipo;SetPoint;Taxa;Tempo;Tolerancia;TxMinima;TxMaxima;TempoOnHold"; outputFile.WriteLine("#Temp-" + header); foreach (TemperatureValue item in _temperatureRepository.getValues()) { string type = item.Tipo == "Rampa" ? "0" : "1"; var line = type + ";" + item.SetPoint + ";" + item.Taxa + ";" + item.Tempo + ";" + item.Tolerancia + ";" + item.TxMinima + ";" + item.TxMaxima + ";" + item.TempoHold + ";"; outputFile.WriteLine(line); } header = "Tipo;SetPoint;Taxa;Tempo;Tolerancia"; outputFile.WriteLine("#Pressao-" + header); foreach (PressureValue item in _pressureRepository.getValues()) { string type = item.Tipo == "Rampa" ? "0" : "1"; var line = type + ";" + item.SetPoint + ";" + item.Taxa + ";" + item.Tempo + ";" + item.Tolerancia + ";"; outputFile.WriteLine(line); } header = "Tipo;SetPoint;Taxa;Tempo;Tolerancia;Parametro;Decisao"; outputFile.WriteLine("#Vacuo-" + header); foreach (VacuumValue item in _vacauumRepository.getValues()) { string type = item.Tipo == "Rampa" ? "0" : "1"; var line = type + ";" + item.SetPoint + ";" + item.Taxa + ";" + item.Tempo + ";" + item.Tolerancia + ";"; outputFile.WriteLine(line); } } }
public DataGrid generateDataGrid(string type) { DataGrid returnedGrid = new DataGrid(); returnedGrid.BorderBrush = Brushes.Transparent; returnedGrid.Columns.Clear(); returnedGrid.BorderBrush = Brushes.Transparent; returnedGrid.Columns.Clear(); returnedGrid.ItemsSource = null; returnedGrid.AutoGenerateColumns = true; returnedGrid.AutoGeneratingColumn += AutoGeneratingColumn; returnedGrid.AutoGeneratedColumns += ReturnedGrid_AutoGeneratedColumns; returnedGrid.CanUserAddRows = false; returnedGrid.Visibility = Visibility.Visible; returnedGrid.CanUserReorderColumns = false; returnedGrid.CanUserSortColumns = false; returnedGrid.IsReadOnly = true; Grid.SetRow(returnedGrid, 0); if (type == "Temperature") { returnedGrid.Name = type; var List = _temperatureRepository.getValues(); returnedGrid.ItemsSource = List; return(returnedGrid); } else if (type == "Pressure") { returnedGrid.Name = type; var List = _pressureRepository.getValues(); returnedGrid.ItemsSource = List; return(returnedGrid); } else if (type == "Vacuum") { returnedGrid.Name = type; var List = _vacauumRepository.getValues(); returnedGrid.ItemsSource = List; return(returnedGrid); } return(null); }
public void GenerateValues(out List <double> xValues, out List <double> yValues) { xValues = new List <double>(); yValues = new List <double>(); foreach (var pressure in _pressureRepositoy.getValues()) { double?xLast = null; double?yLast = null; if (xValues.Count != 0) { xLast = xValues.Last(); } if (pressure.Tipo == "Rampa") { if (xValues.Count != 0) { yLast = yValues.Last(); } var(curXValues, curYValues) = GenerateIncreasingValue(xLast, yLast, Convert.ToDouble(pressure.SetPoint, CultureInfo.InvariantCulture), Convert.ToDouble(pressure.Taxa, CultureInfo.InvariantCulture)); xValues.AddRange(curXValues); yValues.AddRange(curYValues); } else { if (xValues.Count != 0) { yLast = Convert.ToDouble(pressure.SetPoint, CultureInfo.InvariantCulture); } var(curXValues, curYValues) = GenerateStepValue(xLast, Convert.ToInt32(pressure.Tempo), Convert.ToDouble(pressure.SetPoint, CultureInfo.InvariantCulture)); xValues.AddRange(curXValues); yValues.AddRange(curYValues); } } }
public string getValues() { return(_valueRepository.getValues() + " and Service"); }