Advertisement
Guest User

Untitled

a guest
Feb 1st, 2017
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. dynRESTreq.Params.AddItem('svc', 'report/exec_report', TRESTRequestParameterKind.pkGETorPOST);
  2.   dynRESTreq.Params.AddItem('params', '{"reportResourceId":14464460,"reportTemplateId":13,"reportTemplate":null,"reportObjectId":14643030,"reportObjectSecId":0,"interval":{"flags":16777216,"from":1483995600,"to":1485776769}}', TRESTRequestParameterKind.pkGETorPOST);
  3.   dynRESTreq.Params.AddItem('sid', result ,TRESTRequestParameterKind.pkGETorPOST);
  4.   dynRESTreq.Execute;
  5.  
  6.     dynRESTreq.Params.AddItem('svc', 'report/select_result_rows', TRESTRequestParameterKind.pkGETorPOST);
  7.   dynRESTreq.Params.AddItem('params', '{"tableIndex":0,"config":{"type":"range","data":{"from":0,"to":100,"level":0}}}', TRESTRequestParameterKind.pkGETorPOST);
  8.   dynRESTreq.Params.AddItem('sid', result ,TRESTRequestParameterKind.pkGETorPOST);
  9.   dynRESTreq.Execute;
  10.    str_report := '';
  11.  
  12.    str_report := dynRESTresp.Content;
  13.  
  14.   Json1 := TJSONObject.ParseJSONValue(str_report) as TJSONArray;
  15.   if not Assigned(JSON1) then  raise Exception.Create('Файл не содержит JSON-данные');
  16.   for i := 0 to Json1.Size-1 do begin
  17.   track2 := ((Json1.Get(i) as TJSONObject).Get('c').JsonValue as TJSONArray);
  18.  
  19.   arr_stop[counter2] := (track2.Get(0).value);//время
  20.   arr_stop[counter2+1] := ((track2.Get(1) as TJSONObject).Get('y').JsonValue.Value);//Y
  21.   arr_stop[counter2+2] := ((track2.Get(1) as TJSONObject).Get('x').JsonValue.Value);//X
  22.   counter2 := counter2 + 3;
  23.  
  24.  
  25. end;
  26.  
  27.  
  28.   dynRESTreq.Params.AddItem('svc', 'report/exec_report', TRESTRequestParameterKind.pkGETorPOST);
  29.   dynRESTreq.Params.AddItem('params', '{"reportResourceId":14464460,"reportTemplateId":13,"reportTemplate":null,"reportObjectId":14643030,"reportObjectSecId":0,"interval":{"flags":16777216,"from":1483995600,"to":1485776769}}', TRESTRequestParameterKind.pkGETorPOST);
  30.   dynRESTreq.Params.AddItem('sid', result ,TRESTRequestParameterKind.pkGETorPOST);
  31.   dynRESTreq.Execute;
  32.  
  33.     dynRESTreq.Params.AddItem('svc', 'report/select_result_rows', TRESTRequestParameterKind.pkGETorPOST);
  34.   dynRESTreq.Params.AddItem('params', '{"tableIndex":1,"config":{"type":"range","data":{"from":0,"to":100,"level":0}}}', TRESTRequestParameterKind.pkGETorPOST);
  35.   dynRESTreq.Params.AddItem('sid', result ,TRESTRequestParameterKind.pkGETorPOST);
  36.   dynRESTreq.Execute;
  37.    str_report := '';
  38.  
  39.    str_report := dynRESTresp.Content;
  40.  
  41.   Json1 := TJSONObject.ParseJSONValue(str_report) as TJSONArray;
  42.   if not Assigned(JSON1) then  raise Exception.Create('Файл не содержит JSON-данные');
  43.   for i := 0 to Json1.Size-1 do begin
  44.   track2 := ((Json1.Get(i) as TJSONObject).Get('c').JsonValue as TJSONArray);
  45.  
  46.   arr_stop[counter2] := (track2.Get(0).value);//время
  47.   arr_stop[counter2+1] := ((track2.Get(1) as TJSONObject).Get('y').JsonValue.Value);//Y
  48.   arr_stop[counter2+2] := ((track2.Get(1) as TJSONObject).Get('x').JsonValue.Value);//X
  49.   counter2 := counter2 + 3;
  50.  
  51.  
  52. end;
  53.  
  54.   for j := 0 to (counter2 div 3) - 1 do begin
  55.  
  56.     if(StrToInt(copy(arr_stop[counter3], 1, pos(':', arr_stop[counter3])-1)) < 9) then begin
  57.     Chromium1.Browser.MainFrame.ExecuteJavaScript('stop1Drow(' + '"' + arr_stop[counter3] + '"' + ',' + arr_stop[counter3+1] +',' + arr_stop[counter3+2] +',' + IntToStr(o+1) +')','about:blank', 0);
  58.     o := o + 1;
  59.     end
  60.     else if (StrToInt(copy(arr_stop[counter3], 1, pos(':', arr_stop[counter3])-1)) > 9) and (StrToInt(copy(arr_stop[counter3], 1, pos(':', arr_stop[counter3])-1)) < 24) then begin
  61.     Chromium1.Browser.MainFrame.ExecuteJavaScript('stop2Drow(' + '"' + arr_stop[counter3] + '"' + ',' + arr_stop[counter3+1] +',' + arr_stop[counter3+2] +',' + IntToStr(p+1) +')','about:blank', 0);
  62.     p := p + 1;
  63.     end
  64.     else if (StrToInt(copy(arr_stop[counter3], 1, pos(':', arr_stop[counter3])-1)) > 45) then begin
  65.     Chromium1.Browser.MainFrame.ExecuteJavaScript('stop3Drow(' + '"' + arr_stop[counter3] + '"' + ',' + arr_stop[counter3+1] +',' + arr_stop[counter3+2] +',' + IntToStr(l+1) +')','about:blank', 0);
  66.     l := l + 1;
  67.     end;
  68.     counter3 := counter3 + 3;
  69.  
  70.   end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement