Перейти из форума на сайт.

НовостиФайловые архивы
ПоискАктивные темыТоп лист
ПравилаКто в on-line?
Вход Забыли пароль? Первый раз на этом сайте? Регистрация
Компьютерный форум Ru.Board » Компьютеры » Прикладное программирование » Вопросы по Delphi (до версии 2009) - часть 5

Модерирует : ShIvADeSt

ShIvADeSt (19-05-2010 05:14): Продолжаем тут http://forum.ru-board.com/topic.cgi?forum=33&topic=11215  Версия для печати • ПодписатьсяДобавить в закладки
На первую страницук этому сообщениюк последнему сообщению

   

Man Without Face



Member
Редактировать | Профиль | Сообщение | Цитировать | Сообщить модератору

procedure TfTypes.ChangeReservFiltr;
var bar_ser:TBarSeries;
  mseries:array of TFastLineSeries;
  mproduct:array of integer;
  count_product,i,j:integer;
  value_found: Boolean;
begin
if not bInit then
   begin
   with qReservoirsState do
      begin
      if Active then Close;
      ParamByName('obj').AsInteger:=ID_AZS;
      ParamByName('date_from').AsDate:=cxdedReservFrom.Date;
      ParamByName('date_to').Asdate:=cxdedReservTo.Date;
      Prepare;
      Open;
      end;
 
   with qReservoirsStatus do
      begin
      if Active then Close;
      ParamByName('obj').AsInteger:=ID_AZS;
      ParamByName('date_from').AsDate:=cxdedReservFrom.Date;
      ParamByName('date_to').Asdate:=cxdedReservTo.Date;
      Prepare;
      Open;
      end;
 
      with qryShiftListRes do
      begin
      if Active then Close;
      ParamByName('obj').AsInteger:=ID_AZS;
      ParamByName('date_from').AsDate:=cxdedReservFrom.Date;
      ParamByName('date_to').Asdate:=cxdedReservTo.Date;
      Prepare;
      Open;
      end;
//////////////////////////////////////////////////////////////////////////
    with qCharts do
      begin
      if Active then Close;
      ParamByName('obj').AsInteger:=ID_AZS;
      ParamByName('date_from').AsDate:=cxdedReservFrom.Date;
      ParamByName('date_to').Asdate:=cxdedReservTo.Date;
      Prepare;
      Open;
      end;
 
 
    with qChart2 do
      begin
      if Active then Close;
      ParamByName('obj').AsInteger:=ID_AZS;
      ParamByName('date_from').AsDate:=cxdedReservFrom.Date;
      ParamByName('date_to').Asdate:=cxdedReservTo.Date;
      Prepare;
      Open;
      end;
 
      //Строим график
      dbChart1.View3D:=false;
      dbChart1.Legend.Visible:=true;
      dbChart1.Legend.ColorWidth:=0;
      dbChart1.Legend.ShadowSize:=1;
      dbChart1.Legend.Alignment:=laRight;
      dbChart1.Legend.ColorWidth:=15;
 
      dbChart1.SeriesList.Clear; //Очищаю график
      dbchart1.Refresh;
      begin
        //dbChart1.Title.Text.Add('График отклонения фактического движения за смену от расчетного');
        //Подсчитываю количество линий:
                count_product:=0;
                while not(qCharts.Eof) do begin
                  inc(count_product);
                  SetLength(mproduct,count_product);
                  mproduct[count_product-1]:=qCharts.FieldByName('rc_smenavol_volumenum').AsInteger;
                  qCharts.Next;
                end;
        //Строю график
 
        qChart2.Open;
        for i:=0 to count_product-1 do begin
 
          SetLength(mseries,dbChart1.SeriesList.Count+1);
          mseries[dbChart1.SeriesList.Count]:=TFastLineSeries.Create(dbChart1);
          mseries[dbChart1.SeriesList.Count].LinePen.Width:=2;
          dbChart1.AddSeries(mseries[dbChart1.SeriesList.Count]);
 
                qChart2.First();
 
                    for j := Trunc(cxdedReservFrom.Date) to trunc(strtodate('07.03.2010')) do begin
                      while trunc(qChart2.FieldByName('rc_sd_begindate').AsDateTime) < j do
                       //begin
                        qChart2.Next();
                        value_found := False;
                       //end;
                       //showmessage(DateToStr(j));
                      while trunc(qChart2.FieldByName('rc_sd_begindate').AsDateTime) = j do begin
                        if qChart2.FieldByName('rc_smenavol_volumenum').AsInteger = mproduct[i] then begin
 
                            if cxRadioGroup1.ItemIndex = 0 then  //График фактического отклонения движения за смену от расчетного
                            mseries[dbChart1.SeriesList.Count-1].Add(qChart2.FieldByName('otklon_fakdvforsmena').AsInteger,datetostr(trunc((qChart2.FieldByName('rc_sd_begindate').Asdatetime))))
                            else  //График фактического остатка от нарастающего расчетного
                            mseries[dbChart1.SeriesList.Count-1].Add(qChart2.FieldByName('otklon_fakrestfromincrease').AsInteger,datetostr(trunc((qChart2.FieldByName('rc_sd_begindate').Asdatetime))));                    
 
                          value_found := True;
                        end;
 
                        qChart2.Next();
                      end;
 
                      if not value_found then
                   
                        mseries[dbChart1.SeriesList.Count-1].Add(0,datetostr(trunc((qChart2.FieldByName('rc_sd_begindate').Asdatetime))));
                    end;
 
        end;
      end;
 
   end;
end;

Всего записей: 381 | Зарегистр. 25-01-2010 | Отправлено: 13:25 12-03-2010
   

На первую страницук этому сообщениюк последнему сообщению

Компьютерный форум Ru.Board » Компьютеры » Прикладное программирование » Вопросы по Delphi (до версии 2009) - часть 5
ShIvADeSt (19-05-2010 05:14): Продолжаем тут http://forum.ru-board.com/topic.cgi?forum=33&topic=11215


Реклама на форуме Ru.Board.

Powered by Ikonboard "v2.1.7b" © 2000 Ikonboard.com
Modified by Ru.B0ard
© Ru.B0ard 2000-2024

BitCoin: 1NGG1chHtUvrtEqjeerQCKDMUi6S6CG4iC

Рейтинг.ru