コード例 #1
0
ファイル: GraphVyrab.cs プロジェクト: rj128x/VotGESInt
        public static CheckGraphVyrabAnswer getAnswerHH(DateTime date)
        {
            DateTime dateStart=date.Date;
            DateTime dateEnd=date.Date.AddHours(24);

            CheckGraphVyrabAnswer answer=new CheckGraphVyrabAnswer();

            PBRDataHH ges=new PBRDataHH(dateStart, dateEnd, GTPEnum.ges);
            PBRDataHH gtp1=new PBRDataHH(dateStart, dateEnd, GTPEnum.gtp1);
            PBRDataHH gtp2=new PBRDataHH(dateStart, dateEnd, GTPEnum.gtp2);

            answer.Chart = new ChartAnswer();
            answer.Chart.Properties = getChartProperties(true);
            answer.Chart.Data = new ChartData();

            gtp1.InitData();
            gtp2.InitData();
            ges.InitData();

            CheckGraphVyrabTableRow rowFull=new CheckGraphVyrabTableRow();
            rowFull.Title = "Итог";
            CheckGraphVyrabTableRow rowMin=new CheckGraphVyrabTableRow();
            rowMin.Title = "Итог -";
            CheckGraphVyrabTableRow rowPl=new CheckGraphVyrabTableRow();
            rowPl.Title = "Итог +";

            answer.TableH.Add(rowFull);
            answer.TableH.Add(rowMin);
            answer.TableH.Add(rowPl);

            answer.TableHH.Add(rowFull);
            answer.TableHH.Add(rowMin);
            answer.TableHH.Add(rowPl);

            foreach (DateTime dt in ges.HalfHoursPBR.Keys) {
                CheckGraphVyrabTableRow row=new CheckGraphVyrabTableRow();

                row.Title = dt.ToString("dd.MM.yy HH:mm");
                row.GESFakt = ges.HalfHoursP[dt];
                row.GESPlan = ges.HalfHoursPBR[dt];
                row.GESDiff = ges.HalfHoursP[dt] - ges.HalfHoursPBR[dt];
                row.GESDiffProc = PBRData.getDiffProc(ges.HalfHoursP[dt], ges.HalfHoursPBR[dt]);

                row.GTP1Fakt = gtp1.HalfHoursP[dt];
                row.GTP1Plan = gtp1.HalfHoursPBR[dt];
                row.GTP1Diff = gtp1.HalfHoursP[dt] - gtp1.HalfHoursPBR[dt];
                row.GTP1DiffProc = PBRData.getDiffProc(gtp1.HalfHoursP[dt], gtp1.HalfHoursPBR[dt]);

                row.GTP2Fakt = gtp2.HalfHoursP[dt];
                row.GTP2Plan = gtp2.HalfHoursPBR[dt];
                row.GTP2Diff = gtp2.HalfHoursP[dt] - gtp2.HalfHoursPBR[dt];
                row.GTP2DiffProc = PBRData.getDiffProc(gtp2.HalfHoursP[dt], gtp2.HalfHoursPBR[dt]);

                rowMin.GESFakt += row.GESFakt / 2; rowPl.GESFakt += row.GESFakt / 2;	rowFull.GESFakt += row.GESFakt / 2;
                rowMin.GESPlan += row.GESPlan / 2; rowPl.GESPlan += row.GESPlan / 2; rowFull.GESPlan += row.GESPlan / 2;
                rowMin.GESDiff += row.GESDiff < 0 ? row.GESDiff/2 : 0;
                rowPl.GESDiff += row.GESDiff > 0 ? row.GESDiff/2 : 0;
                rowFull.GESDiff += row.GESDiff/2;

                rowMin.GTP1Fakt += row.GTP1Fakt / 2; rowPl.GTP1Fakt += row.GTP1Fakt / 2; rowFull.GTP1Fakt += row.GTP1Fakt / 2;
                rowMin.GTP1Plan += row.GTP1Plan / 2; rowPl.GTP1Plan += row.GTP1Plan / 2; rowFull.GTP1Plan += row.GTP1Plan / 2;
                rowMin.GTP1Diff += row.GTP1Diff < 0 ? row.GTP1Diff / 2 : 0;
                rowPl.GTP1Diff += row.GTP1Diff > 0 ? row.GTP1Diff / 2 : 0;
                rowFull.GTP1Diff += row.GTP1Diff / 2;

                rowMin.GTP2Fakt += row.GTP2Fakt / 2; rowPl.GTP2Fakt += row.GTP2Fakt / 2; rowFull.GTP2Fakt += row.GTP2Fakt / 2;
                rowMin.GTP2Plan += row.GTP2Plan / 2; rowPl.GTP2Plan += row.GTP2Plan / 2; rowFull.GTP2Plan += row.GTP2Plan / 2;
                rowMin.GTP2Diff += row.GTP2Diff < 0 ? row.GTP2Diff / 2 : 0;
                rowPl.GTP2Diff += row.GTP2Diff > 0 ? row.GTP2Diff / 2 : 0;
                rowFull.GTP2Diff += row.GTP2Diff / 2;

                answer.TableHH.Add(row);
            }

            rowMin.GESDiffProc = PBRData.getDiffProcDiff(rowMin.GESDiff, rowMin.GESPlan);
            rowPl.GESDiffProc = PBRData.getDiffProcDiff(rowPl.GESDiff, rowPl.GESPlan);
            rowFull.GESDiffProc = PBRData.getDiffProc(rowFull.GESFakt, rowFull.GESPlan);

            rowMin.GTP1DiffProc = PBRData.getDiffProcDiff(rowMin.GTP1Diff, rowMin.GTP1Plan);
            rowPl.GTP1DiffProc = PBRData.getDiffProcDiff( rowPl.GTP1Diff, rowPl.GTP1Plan);
            rowFull.GTP1DiffProc = PBRData.getDiffProc(rowFull.GTP1Fakt, rowFull.GTP1Plan);

            rowMin.GTP2DiffProc = PBRData.getDiffProcDiff(rowMin.GTP2Diff, rowMin.GTP2Plan);
            rowPl.GTP2DiffProc = PBRData.getDiffProcDiff(rowPl.GTP2Diff, rowPl.GTP2Plan);
            rowFull.GTP2DiffProc = PBRData.getDiffProc(rowFull.GTP2Fakt, rowFull.GTP2Plan);

            foreach (DateTime dt in ges.HoursPBR.Keys) {
                CheckGraphVyrabTableRow row=new CheckGraphVyrabTableRow();
                row.Title = dt.ToString("dd.MM.yy HH:mm");
                row.GESFakt = ges.HoursP[dt];
                row.GESPlan = ges.HoursPBR[dt];
                row.GESDiff = ges.HoursP[dt] - ges.HoursPBR[dt];
                row.GESDiffProc = PBRData.getDiffProc(ges.HoursP[dt], ges.HoursPBR[dt]);

                row.GTP1Fakt = gtp1.HoursP[dt];
                row.GTP1Plan = gtp1.HoursPBR[dt];
                row.GTP1Diff = gtp1.HoursP[dt] - gtp1.HoursPBR[dt];
                row.GTP1DiffProc = PBRData.getDiffProc(gtp1.HoursP[dt], gtp1.HoursPBR[dt]);

                row.GTP2Fakt = gtp2.HoursP[dt];
                row.GTP2Plan = gtp2.HoursPBR[dt];
                row.GTP2Diff = gtp2.HoursP[dt] - gtp2.HoursPBR[dt];
                row.GTP2DiffProc = PBRData.getDiffProc(gtp2.HoursP[dt], gtp2.HoursPBR[dt]);

                answer.TableH.Add(row);
            }

            answer.Chart.Data.addSerie(getDataSerie("gtp1Fakt", gtp1.HalfHoursP, -30));
            answer.Chart.Data.addSerie(getDataSerie("gtp2Fakt", gtp2.HalfHoursP, -30));
            answer.Chart.Data.addSerie(getDataSerie("gesFakt", ges.HalfHoursP, -30));
            answer.Chart.Data.addSerie(getDataSerie("gtp1Plan", gtp1.HalfHoursPBR, -30));
            answer.Chart.Data.addSerie(getDataSerie("gtp2Plan", gtp2.HalfHoursPBR, -30));
            answer.Chart.Data.addSerie(getDataSerie("gesPlan", ges.HalfHoursPBR, -30));

            answer.Chart.Properties.removeSerie("vyrabFakt");
            answer.Chart.Properties.removeSerie("vyrabPlan");
            return answer;
        }
コード例 #2
0
ファイル: GraphVyrab.cs プロジェクト: rj128x/VotGES
        public static CheckGraphVyrabAnswer getAnswerHH(DateTime date)
        {
            DateTime dateStart=date.Date;
            DateTime dateEnd=date.Date.AddHours(24);

            CheckGraphVyrabAnswer answer=new CheckGraphVyrabAnswer();

            PBRDataHH ges=new PBRDataHH(dateStart, dateEnd, 0);
            PBRDataHH gtp1=new PBRDataHH(dateStart, dateEnd, 1);
            PBRDataHH gtp2=new PBRDataHH(dateStart, dateEnd, 2);

            answer.Chart = new ChartAnswer();
            answer.Chart.Properties = getChartProperties();
            answer.Chart.Data = new ChartData();

            gtp1.InitData();
            gtp2.InitData();
            ges.InitData();

            foreach (DateTime dt in ges.HalfHoursPBR.Keys) {
                CheckGraphVyrabTableRow row=new CheckGraphVyrabTableRow();

                row.Title = dt.ToString("dd.MM.yy HH:mm");
                row.GESFakt = ges.HalfHoursP[dt];
                row.GESPlan = ges.HalfHoursPBR[dt];
                row.GESDiff = ges.HalfHoursP[dt] - ges.HalfHoursPBR[dt];
                row.GESDiffProc = PBRData.getDiffProc(ges.HalfHoursP[dt], ges.HalfHoursPBR[dt]);

                row.GTP1Fakt = gtp1.HalfHoursP[dt];
                row.GTP1Plan = gtp1.HalfHoursPBR[dt];
                row.GTP1Diff = gtp1.HalfHoursP[dt] - gtp1.HalfHoursPBR[dt];
                row.GTP1DiffProc = PBRData.getDiffProc(gtp1.HalfHoursP[dt], gtp1.HalfHoursPBR[dt]);

                row.GTP2Fakt = gtp2.HalfHoursP[dt];
                row.GTP2Plan = gtp2.HalfHoursPBR[dt];
                row.GTP2Diff = gtp2.HalfHoursP[dt] - gtp2.HalfHoursPBR[dt];
                row.GTP2DiffProc = PBRData.getDiffProc(gtp2.HalfHoursP[dt], gtp2.HalfHoursPBR[dt]);

                answer.TableHH.Add(row);
            }

            foreach (DateTime dt in ges.HoursPBR.Keys) {
                CheckGraphVyrabTableRow row=new CheckGraphVyrabTableRow();
                row.Title = dt.ToString("dd.MM.yy HH:mm");
                row.GESFakt = ges.HoursP[dt];
                row.GESPlan = ges.HoursPBR[dt];
                row.GESDiff = ges.HoursPBR[dt] - ges.HoursP[dt];
                row.GESDiffProc = PBRData.getDiffProc(ges.HoursP[dt], ges.HoursPBR[dt]);

                row.GTP1Fakt = gtp1.HoursP[dt];
                row.GTP1Plan = gtp1.HoursPBR[dt];
                row.GTP1Diff = gtp1.HoursPBR[dt] - gtp1.HoursP[dt];
                row.GTP1DiffProc = PBRData.getDiffProc(gtp1.HoursP[dt], gtp1.HoursPBR[dt]);

                row.GTP2Fakt = gtp2.HoursP[dt];
                row.GTP2Plan = gtp2.HoursPBR[dt];
                row.GTP2Diff = gtp2.HoursPBR[dt] - gtp2.HoursP[dt];
                row.GTP2DiffProc = PBRData.getDiffProc(gtp2.HoursP[dt], gtp2.HoursPBR[dt]);

                answer.TableH.Add(row);
            }

            answer.Chart.Data.addSerie(getDataSerie("gtp1Fakt", gtp1.HalfHoursP, -30));
            answer.Chart.Data.addSerie(getDataSerie("gtp2Fakt", gtp2.HalfHoursP, -30));
            answer.Chart.Data.addSerie(getDataSerie("gesFakt", ges.HalfHoursP, -30));
            answer.Chart.Data.addSerie(getDataSerie("gtp1Plan", gtp1.HalfHoursPBR, -30));
            answer.Chart.Data.addSerie(getDataSerie("gtp2Plan", gtp2.HalfHoursPBR, -30));
            answer.Chart.Data.addSerie(getDataSerie("gesPlan", ges.HalfHoursPBR, -30));

            answer.Chart.Properties.removeSerie("vyrabFakt");
            answer.Chart.Properties.removeSerie("vyrabPlan");
            return answer;
        }
コード例 #3
0
ファイル: GraphVyrabRGE.cs プロジェクト: rj128x/VotGESInt
        public static CheckGraphVyrabRGEAnswer getAnswerHH(DateTime date)
        {
            DateTime dateStart=date.Date;
            DateTime dateEnd=date.Date.AddHours(24);

            CheckGraphVyrabRGEAnswer answer=new CheckGraphVyrabRGEAnswer();

            PBRDataHH rge1=new PBRDataHH(dateStart, dateEnd, GTPEnum.rge1);
            PBRDataHH rge2=new PBRDataHH(dateStart, dateEnd, GTPEnum.rge2);
            PBRDataHH rge3=new PBRDataHH(dateStart, dateEnd, GTPEnum.rge3);
            PBRDataHH rge4=new PBRDataHH(dateStart, dateEnd, GTPEnum.rge4);

            answer.ChartRGE1 = new ChartAnswer();
            answer.ChartRGE1.Properties = getChartProperties(220,true);
            answer.ChartRGE1.Data = new ChartData();

            answer.ChartRGE2 = new ChartAnswer();
            answer.ChartRGE2.Properties = getChartProperties(200,true);
            answer.ChartRGE2.Data = new ChartData();

            answer.ChartRGE3 = new ChartAnswer();
            answer.ChartRGE3.Properties = getChartProperties(200,true);
            answer.ChartRGE3.Data = new ChartData();

            answer.ChartRGE4 = new ChartAnswer();
            answer.ChartRGE4.Properties = getChartProperties(400,true);
            answer.ChartRGE4.Data = new ChartData();

            rge1.InitData();
            rge2.InitData();
            rge3.InitData();
            rge4.InitData();

            CheckGraphVyrabRGETableRow rowFull=new CheckGraphVyrabRGETableRow();
            rowFull.Title = "Итог";
            CheckGraphVyrabRGETableRow rowMin=new CheckGraphVyrabRGETableRow();
            rowMin.Title = "Итог -";
            CheckGraphVyrabRGETableRow rowPl=new CheckGraphVyrabRGETableRow();
            rowPl.Title = "Итог +";

            answer.TableH.Add(rowFull);
            answer.TableH.Add(rowMin);
            answer.TableH.Add(rowPl);

            answer.TableHH.Add(rowFull);
            answer.TableHH.Add(rowMin);
            answer.TableHH.Add(rowPl);

            foreach (DateTime dt in rge1.HalfHoursPBR.Keys) {
                CheckGraphVyrabRGETableRow row=new CheckGraphVyrabRGETableRow();

                row.Title = dt.ToString("dd.MM.yy HH:mm");
                row.RGE1Fakt = rge1.HalfHoursP[dt];
                row.RGE1Plan = rge1.HalfHoursPBR[dt];
                row.RGE1Diff = rge1.HalfHoursP[dt] - rge1.HalfHoursPBR[dt];
                row.RGE1DiffProc = PBRData.getDiffProc(rge1.HalfHoursP[dt], rge1.HalfHoursPBR[dt]);

                row.RGE2Fakt = rge2.HalfHoursP[dt];
                row.RGE2Plan = rge2.HalfHoursPBR[dt];
                row.RGE2Diff = rge2.HalfHoursP[dt] - rge2.HalfHoursPBR[dt];
                row.RGE2DiffProc = PBRData.getDiffProc(rge2.HalfHoursP[dt], rge2.HalfHoursPBR[dt]);

                row.RGE3Fakt = rge3.HalfHoursP[dt];
                row.RGE3Plan = rge3.HalfHoursPBR[dt];
                row.RGE3Diff = rge3.HalfHoursP[dt] - rge3.HalfHoursPBR[dt];
                row.RGE3DiffProc = PBRData.getDiffProc(rge3.HalfHoursP[dt], rge3.HalfHoursPBR[dt]);

                row.RGE4Fakt = rge4.HalfHoursP[dt];
                row.RGE4Plan = rge4.HalfHoursPBR[dt];
                row.RGE4Diff = rge4.HalfHoursP[dt] - rge4.HalfHoursPBR[dt];
                row.RGE4DiffProc = PBRData.getDiffProc(rge4.HalfHoursP[dt], rge4.HalfHoursPBR[dt]);

                rowMin.RGE1Fakt += row.RGE1Fakt / 2; rowPl.RGE1Fakt += row.RGE1Fakt / 2; rowFull.RGE1Fakt += row.RGE1Fakt / 2;
                rowMin.RGE1Plan += row.RGE1Plan / 2; rowPl.RGE1Plan += row.RGE1Plan / 2; rowFull.RGE1Plan += row.RGE1Plan / 2;
                rowMin.RGE1Diff += row.RGE1Diff < 0 ? row.RGE1Diff / 2 : 0;
                rowPl.RGE1Diff += row.RGE1Diff > 0 ? row.RGE1Diff / 2 : 0;
                rowFull.RGE1Diff += row.RGE1Diff / 2;

                rowMin.RGE2Fakt += row.RGE2Fakt / 2; rowPl.RGE2Fakt += row.RGE2Fakt / 2; rowFull.RGE2Fakt += row.RGE2Fakt / 2;
                rowMin.RGE2Plan += row.RGE2Plan / 2; rowPl.RGE2Plan += row.RGE2Plan / 2; rowFull.RGE2Plan += row.RGE2Plan / 2;
                rowMin.RGE2Diff += row.RGE2Diff < 0 ? row.RGE2Diff / 2 : 0;
                rowPl.RGE2Diff += row.RGE2Diff > 0 ? row.RGE2Diff / 2 : 0;
                rowFull.RGE2Diff += row.RGE2Diff / 2;

                rowMin.RGE3Fakt += row.RGE3Fakt / 2; rowPl.RGE3Fakt += row.RGE3Fakt / 2; rowFull.RGE3Fakt += row.RGE3Fakt / 2;
                rowMin.RGE3Plan += row.RGE3Plan / 2; rowPl.RGE3Plan += row.RGE3Plan / 2; rowFull.RGE3Plan += row.RGE3Plan / 2;
                rowMin.RGE3Diff += row.RGE3Diff < 0 ? row.RGE3Diff / 2 : 0;
                rowPl.RGE3Diff += row.RGE3Diff > 0 ? row.RGE3Diff / 2 : 0;
                rowFull.RGE3Diff += row.RGE3Diff / 2;

                rowMin.RGE4Fakt += row.RGE4Fakt / 2; rowPl.RGE4Fakt += row.RGE4Fakt / 2; rowFull.RGE4Fakt += row.RGE4Fakt / 2;
                rowMin.RGE4Plan += row.RGE4Plan / 2; rowPl.RGE4Plan += row.RGE4Plan / 2; rowFull.RGE4Plan += row.RGE4Plan / 2;
                rowMin.RGE4Diff += row.RGE4Diff < 0 ? row.RGE4Diff / 2 : 0;
                rowPl.RGE4Diff += row.RGE4Diff > 0 ? row.RGE4Diff / 2 : 0;
                rowFull.RGE4Diff += row.RGE4Diff / 2;

                answer.TableHH.Add(row);
            }

            rowMin.RGE1DiffProc = PBRData.getDiffProcDiff(rowMin.RGE1Diff, rowMin.RGE1Plan);
            rowPl.RGE1DiffProc = PBRData.getDiffProcDiff(rowPl.RGE1Diff, rowPl.RGE1Plan);
            rowFull.RGE1DiffProc = PBRData.getDiffProc(rowFull.RGE1Fakt, rowFull.RGE1Plan);

            rowMin.RGE2DiffProc = PBRData.getDiffProcDiff(rowMin.RGE2Diff, rowMin.RGE2Plan);
            rowPl.RGE2DiffProc = PBRData.getDiffProcDiff(rowPl.RGE2Diff, rowPl.RGE2Plan);
            rowFull.RGE2DiffProc = PBRData.getDiffProc(rowFull.RGE2Fakt, rowFull.RGE2Plan);

            rowMin.RGE3DiffProc = PBRData.getDiffProcDiff(rowMin.RGE3Diff, rowMin.RGE3Plan);
            rowPl.RGE3DiffProc = PBRData.getDiffProcDiff(rowPl.RGE3Diff, rowPl.RGE3Plan);
            rowFull.RGE3DiffProc = PBRData.getDiffProc(rowFull.RGE3Fakt, rowFull.RGE3Plan);

            rowMin.RGE4DiffProc = PBRData.getDiffProcDiff(rowMin.RGE4Diff, rowMin.RGE4Plan);
            rowPl.RGE4DiffProc = PBRData.getDiffProcDiff(rowPl.RGE4Diff, rowPl.RGE4Plan);
            rowFull.RGE4DiffProc = PBRData.getDiffProc(rowFull.RGE4Fakt, rowFull.RGE4Plan);

            foreach (DateTime dt in rge1.HoursPBR.Keys) {
                CheckGraphVyrabRGETableRow row=new CheckGraphVyrabRGETableRow();

                row.Title = dt.ToString("dd.MM.yy HH:mm");
                row.RGE1Fakt = rge1.HoursP[dt];
                row.RGE1Plan = rge1.HoursPBR[dt];
                row.RGE1Diff = rge1.HoursP[dt] - rge1.HoursPBR[dt];
                row.RGE1DiffProc = PBRData.getDiffProc(rge1.HoursP[dt], rge1.HoursPBR[dt]);

                row.RGE2Fakt = rge2.HoursP[dt];
                row.RGE2Plan = rge2.HoursPBR[dt];
                row.RGE2Diff = rge2.HoursP[dt] - rge2.HoursPBR[dt];
                row.RGE2DiffProc = PBRData.getDiffProc(rge2.HoursP[dt], rge2.HoursPBR[dt]);

                row.RGE3Fakt = rge3.HoursP[dt];
                row.RGE3Plan = rge3.HoursPBR[dt];
                row.RGE3Diff = rge3.HoursP[dt] - rge3.HoursPBR[dt];
                row.RGE3DiffProc = PBRData.getDiffProc(rge3.HoursP[dt], rge3.HoursPBR[dt]);

                row.RGE4Fakt = rge4.HoursP[dt];
                row.RGE4Plan = rge4.HoursPBR[dt];
                row.RGE4Diff = rge4.HoursP[dt] - rge4.HoursPBR[dt];
                row.RGE4DiffProc = PBRData.getDiffProc(rge4.HoursP[dt], rge4.HoursPBR[dt]);

                answer.TableH.Add(row);
            }

            answer.ChartRGE1.Data.addSerie(getDataSerie("Fakt", rge1.HalfHoursP, -30));
            answer.ChartRGE1.Data.addSerie(getDataSerie("Plan", rge1.HalfHoursPBR, -30));

            answer.ChartRGE2.Data.addSerie(getDataSerie("Fakt", rge2.HalfHoursP, -30));
            answer.ChartRGE2.Data.addSerie(getDataSerie("Plan", rge2.HalfHoursPBR, -30));

            answer.ChartRGE3.Data.addSerie(getDataSerie("Fakt", rge3.HalfHoursP, -30));
            answer.ChartRGE3.Data.addSerie(getDataSerie("Plan", rge3.HalfHoursPBR, -30));

            answer.ChartRGE4.Data.addSerie(getDataSerie("Fakt", rge4.HalfHoursP, -30));
            answer.ChartRGE4.Data.addSerie(getDataSerie("Plan", rge4.HalfHoursPBR, -30));

            answer.ChartRGE1.processAxes();
            answer.ChartRGE2.processAxes();
            answer.ChartRGE3.processAxes();
            answer.ChartRGE4.processAxes();

            return answer;
        }
コード例 #4
0
ファイル: SutVedReport.cs プロジェクト: rj128x/VotGESInt
        public override void ReadData()
        {
            base.ReadData();
            PBR = new PBRDataHH(DateStart, DateEnd, GTPEnum.ges);
            PBR.InitData();

            PZad = new SortedList<DateTime, double>();
            List<int> items=new List<int>();
            items.Add(91);
            List<PiramidaEnrty> records=PiramidaAccess.GetDataFromDB(DateStart, DateEnd, 3, 2, 13, items, true, false, "PSV");
            foreach (PiramidaEnrty rec in records) {
                PZad.Add(rec.Date, rec.Value0);
            }

            SqlConnection con=null;;
            double lastP=Double.NaN;
            try {
                string sel=String.Format("SELECT TOP 1 VALUE0 FROM DATA WHERE Parnumber=13 and object=3 and objtype=2 and item=91 and data_date<@date order by data_date desc");
                con = PiramidaAccess.getConnection("PSV");
                con.Open();
                SqlCommand command=con.CreateCommand();
                command.CommandText = sel;
                command.Parameters.AddWithValue("@date", DateStart);
                lastP = (double)command.ExecuteScalar();
            } catch {
                Logger.Error("Ошибка при получении последнего задания мощности");
            }
            finally { try { con.Close(); } catch { } }

            LastP = lastP;
        }