Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- dynRESTreq.Params.AddItem('svc', 'report/exec_report', TRESTRequestParameterKind.pkGETorPOST);
- dynRESTreq.Params.AddItem('params', '{"reportResourceId":14464460,"reportTemplateId":13,"reportTemplate":null,"reportObjectId":14643030,"reportObjectSecId":0,"interval":{"flags":16777216,"from":1483995600,"to":1485776769}}', TRESTRequestParameterKind.pkGETorPOST);
- dynRESTreq.Params.AddItem('sid', result ,TRESTRequestParameterKind.pkGETorPOST);
- dynRESTreq.Execute;
- dynRESTreq.Params.AddItem('svc', 'report/select_result_rows', TRESTRequestParameterKind.pkGETorPOST);
- dynRESTreq.Params.AddItem('params', '{"tableIndex":0,"config":{"type":"range","data":{"from":0,"to":100,"level":0}}}', TRESTRequestParameterKind.pkGETorPOST);
- dynRESTreq.Params.AddItem('sid', result ,TRESTRequestParameterKind.pkGETorPOST);
- dynRESTreq.Execute;
- str_report := '';
- str_report := dynRESTresp.Content;
- Json1 := TJSONObject.ParseJSONValue(str_report) as TJSONArray;
- if not Assigned(JSON1) then raise Exception.Create('Файл не содержит JSON-данные');
- for i := 0 to Json1.Size-1 do begin
- track2 := ((Json1.Get(i) as TJSONObject).Get('c').JsonValue as TJSONArray);
- arr_stop[counter2] := (track2.Get(0).value);//время
- arr_stop[counter2+1] := ((track2.Get(1) as TJSONObject).Get('y').JsonValue.Value);//Y
- arr_stop[counter2+2] := ((track2.Get(1) as TJSONObject).Get('x').JsonValue.Value);//X
- counter2 := counter2 + 3;
- end;
- dynRESTreq.Params.AddItem('svc', 'report/exec_report', TRESTRequestParameterKind.pkGETorPOST);
- dynRESTreq.Params.AddItem('params', '{"reportResourceId":14464460,"reportTemplateId":13,"reportTemplate":null,"reportObjectId":14643030,"reportObjectSecId":0,"interval":{"flags":16777216,"from":1483995600,"to":1485776769}}', TRESTRequestParameterKind.pkGETorPOST);
- dynRESTreq.Params.AddItem('sid', result ,TRESTRequestParameterKind.pkGETorPOST);
- dynRESTreq.Execute;
- dynRESTreq.Params.AddItem('svc', 'report/select_result_rows', TRESTRequestParameterKind.pkGETorPOST);
- dynRESTreq.Params.AddItem('params', '{"tableIndex":1,"config":{"type":"range","data":{"from":0,"to":100,"level":0}}}', TRESTRequestParameterKind.pkGETorPOST);
- dynRESTreq.Params.AddItem('sid', result ,TRESTRequestParameterKind.pkGETorPOST);
- dynRESTreq.Execute;
- str_report := '';
- str_report := dynRESTresp.Content;
- Json1 := TJSONObject.ParseJSONValue(str_report) as TJSONArray;
- if not Assigned(JSON1) then raise Exception.Create('Файл не содержит JSON-данные');
- for i := 0 to Json1.Size-1 do begin
- track2 := ((Json1.Get(i) as TJSONObject).Get('c').JsonValue as TJSONArray);
- arr_stop[counter2] := (track2.Get(0).value);//время
- arr_stop[counter2+1] := ((track2.Get(1) as TJSONObject).Get('y').JsonValue.Value);//Y
- arr_stop[counter2+2] := ((track2.Get(1) as TJSONObject).Get('x').JsonValue.Value);//X
- counter2 := counter2 + 3;
- end;
- for j := 0 to (counter2 div 3) - 1 do begin
- if(StrToInt(copy(arr_stop[counter3], 1, pos(':', arr_stop[counter3])-1)) < 9) then begin
- Chromium1.Browser.MainFrame.ExecuteJavaScript('stop1Drow(' + '"' + arr_stop[counter3] + '"' + ',' + arr_stop[counter3+1] +',' + arr_stop[counter3+2] +',' + IntToStr(o+1) +')','about:blank', 0);
- o := o + 1;
- end
- 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
- Chromium1.Browser.MainFrame.ExecuteJavaScript('stop2Drow(' + '"' + arr_stop[counter3] + '"' + ',' + arr_stop[counter3+1] +',' + arr_stop[counter3+2] +',' + IntToStr(p+1) +')','about:blank', 0);
- p := p + 1;
- end
- else if (StrToInt(copy(arr_stop[counter3], 1, pos(':', arr_stop[counter3])-1)) > 45) then begin
- Chromium1.Browser.MainFrame.ExecuteJavaScript('stop3Drow(' + '"' + arr_stop[counter3] + '"' + ',' + arr_stop[counter3+1] +',' + arr_stop[counter3+2] +',' + IntToStr(l+1) +')','about:blank', 0);
- l := l + 1;
- end;
- counter3 := counter3 + 3;
- end;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement