private void btnVacuum_Click(object sender, RoutedEventArgs e) { currentStatus = "Vacuum"; TotalTIme.Text = "Dif de Tempo com a Temperatura: " + (_temperatures.getTotalTime() - _vacuums.getTotalTime()).ToString(); TotalTIme.Text += " | Tempo total: " + _vacuums.getTotalTime().ToString(); UpdateGrid(); MainWindow_CollectionChanged(); }
private void btnPressure_Click(object sender, RoutedEventArgs e) { try { currentStatus = "Pressure"; TotalTIme.Text = "Dif de Tempo com a Temperatura: " + (_temperatures.getTotalTime() - _pressures.getTotalTime()).ToString(); TotalTIme.Text += " | Tempo total: " + _pressures.getTotalTime().ToString(); UpdateGrid(); MainWindow_CollectionChanged(); } catch (Exception ex) { MessageBox.Show("An error has occured:" + ex.Message, "Erro", MessageBoxButton.OK, MessageBoxImage.Error); } }
public MainWindow() { InitializeComponent(); _gridConfiguraitonRepository = new GridConfiguraitonRepository(); _temperatures = new ValueRepository <TemperatureValue>(MainWindow_CollectionChanged); _temperatureChartManager = new TemperatureChartManager(_temperatures); _pressures = new ValueRepository <PressureValue>(MainWindow_CollectionChanged); _pressureChartManager = new PressureChartManager(_pressures); _vacuums = new ValueRepository <VacuumValue>(MainWindow_CollectionChanged); _vacuumChartManager = new VacuumChartManager(_vacuums); _dataGridManager = new DataGridManager(_gridConfiguraitonRepository, _pressures, _temperatures, _vacuums); _controlManager = new ControlManager(_gridConfiguraitonRepository); _gridManager = new GridManager(_dataGridManager, _controlManager); _fileControl = new FileControl(_pressures, _temperatures, _vacuums); _pdfControl = new PDFControl(_pressures, _temperatures, _vacuums, (PressureChartManager)_pressureChartManager, (TemperatureChartManager)_temperatureChartManager, (VacuumChartManager)_vacuumChartManager); gridValues.Children[2].Visibility = Visibility.Hidden; TotalTIme.Text = "Tempo total: " + _temperatures.getTotalTime().ToString(); UpdateGrid(); MainWindow_CollectionChanged(); }
public string GenerateToPDF(string reportName) { string JQLibLocation = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) + "\\js\\jquery.js"; string JLibLocation = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) + "\\js\\jquery.flot.js"; string userName = System.Security.Principal.WindowsIdentity.GetCurrent().Name; string header = "<!DOCTYPE html><html> " + "<head > " + "<meta charset=\"UTF-8\">" + "<script src=\"file:///" + JQLibLocation + "\"></script>" + "<script src=\"file:///" + JLibLocation + "\"></script>" + //"<script src=\"https://cdn.plot.ly/plotly-latest.min.js\"></script>"+ "</head>" + "<body style=\"font-family: Arial !important;font-size: 14px !important;\" > " + "<center>" + "<div> <h1><b>Resumo da Receita</b></h1></div>" + "</center>" + "<div> <p><b>Receita:</b> " + reportName.Split('.')[0] + "</p></div>" + "<div> <p><b>Responsável:</b> " + userName + " " + "</p></div>" + "<div> <p><b>Última Atualização:</b>" + DateTime.Now.ToString() + "</p></div>" + "<div> <p><b>Tempo Total:</b> " + _temperatureRepository.getTotalTime() + " min</div>" + "<center>"; var chart1 = " <div id=\"ChartDiv1\"style=\"width: 900px; height: 350px; \"></div> " + "<div id =\"legendChart\"style=\"width: 900px; height: 50px; \"></div>"; var tempTable = GenerateTableForTemperature() + "<br> <br> <br>"; var pressureTable = GenerateTableForPressure() + "<br> <br> <br>"; var vacuumTable = GenerateTableForVacuum() + "<br> <br>"; var vacuumChartValues = generateValuesToChartVaacum(); var temperatureChartValues = generateValuesToChartTemperature(); var pressureChartValues = generateValuesToChartPressure(); string footer = "</body>"; //string JsLocation = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) + "\\js\\chart.js"; string JsLocation = Path.GetDirectoryName(Assembly.GetEntryAssembly().Location) + "\\js\\chart.js"; string includeJS = "<script src=\"file:///" + JsLocation + "\"></script>"; string html = header + chart1 + "</center>" + tempTable + pressureTable + vacuumTable + vacuumChartValues + temperatureChartValues + pressureChartValues + includeJS + footer + "</html> "; return(html); }