예제 #1
0
        /// <summary>
        /// Перерисовака графика
        /// </summary>
        private void CreateChart()
        {
            int WidthDifference  = pbChart.Location.X + chart.Indent + 5;
            int HeightDifference = pbChart.Location.Y + chart.Indent + 10;

            pbChart.Size = new Size(this.Size.Width - WidthDifference, this.Size.Height - HeightDifference);
            StateClass stateClass =
                CalculationDefectsController.GetCurrentStateClass(StateClassController.GetShaft(cbMachines.SelectedItem as Machine),
                                                                  (cbMachines.SelectedItem as Machine).Head);
            List <ResultDiagnostics> resultDiagnostics = new List <ResultDiagnostics>();
            List <Repairs>           repairs           = RepairsController.GetRepairs((cbMachines.SelectedItem as Machine));
            List <ResultForecast>    forecasts         = new List <ResultForecast>();

            if (rbBearing.Checked)
            {
                resultDiagnostics = DiagnosticResultController.GetBearingResult(cbMachines.SelectedItem as Machine);
            }
            else
            {
                resultDiagnostics = DiagnosticResultController.GetShaftResult(cbMachines.SelectedItem as Machine);
            }
            if (rbStandartForecast.Checked)
            {
                forecasts =
                    ForecastController.GetStandartForecast(resultDiagnostics,
                                                           stateClass,
                                                           (cbMachines.SelectedItem as Machine));
            }
            else
            {
                forecasts =
                    ForecastController.GetSimpleForecast(resultDiagnostics,
                                                         stateClass,
                                                         (cbMachines.SelectedItem as Machine));
            }

            chart = new Chart(pbChart.ClientRectangle, resultDiagnostics, forecasts, stateClass, repairs);
            pbChart.Invalidate();
        }
예제 #2
0
 private void cbMachines_SelectedIndexChanged(object sender, EventArgs e)
 {
     LoadRepairs(RepairsController.GetRepairs(cbMachines.SelectedItem as Machine));
 }