Changeset 138 for trunk/Modules/ZdechovNET/UWebCamPage.pas
- Timestamp:
- Sep 9, 2022, 8:20:25 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/ZdechovNET/UWebCamPage.pas
r137 r138 45 45 Value: Integer; 46 46 NotFound: Boolean; 47 WidthValue: string; 47 48 begin 48 49 with TWebSession(HandlerData) do begin 49 50 ModuleUser.LoadUserInfo; 50 with HtmlDocument.Body, THtmlString(SubItems.AddNew(THtmlString.Create))do begin51 with HtmlDocument.Body, SubItems.AddString do begin 51 52 Text := ''; 52 53 CameraId := -1; … … 64 65 //HandlerData.Request.Query.Values['W'] := 'dsd'; 65 66 //HandlerData.Request.Query.Values['H'] := 'dsd'; 66 if (HandlerData.Request.Query.SearchKey('W') = -1) then begin 67 ImageWidth := 640; 68 end else begin 69 ImageWidth := StrToInt(HandlerData.Request.Query.Values['W']); 70 end; 67 if HandlerData.Request.Query.TryGetValue('W', WidthValue) then 68 ImageWidth := StrToInt(WidthValue) 69 else ImageWidth := 640; 71 70 72 71 Text := Text + '<table style="width: 100%"><tr><td style="width: 20%" valign="top">' + … … 84 83 Database.Query(DbRows, 'SELECT * FROM `Webcam` WHERE `Enabled`=1'); 85 84 for I := 0 to DbRows.Count - 1 do begin 86 Text := Text + MakeLink(DbRows[I]. Values['Name'], NavigationLink(87 '/kamery/' + DbRows[I]. Values['Id'] + '/?W=' + IntToStr(ImageWidth))) + '<br/>';85 Text := Text + MakeLink(DbRows[I].Items['Name'], NavigationLink( 86 '/kamery/' + DbRows[I].Items['Id'] + '/?W=' + IntToStr(ImageWidth))) + '<br/>'; 88 87 end; 89 88 finally … … 125 124 ImageWidthThumb := 160; 126 125 for I := 0 to DbRows.Count - 1 do begin 127 ImageHeightThumb := Round(ImageWidthThumb * StrToInt(DbRows[I]. Values['Height']) / StrToInt(DbRows[I].Values['Width']));128 WebCamImage := 'images/webcam/' + DbRows[I]. Values['ImageName'];126 ImageHeightThumb := Round(ImageWidthThumb * StrToInt(DbRows[I].Items['Height']) / StrToInt(DbRows[I].Items['Width'])); 127 WebCamImage := 'images/webcam/' + DbRows[I].Items['ImageName']; 129 128 Result := Result + '<span align="center" valign="middle" style="vertical-align: middle;">' + //DbRows[I].Values['Name'] + '<br/>' + 130 '<a href="' + NavigationLink('/kamery/' + DbRows[I]. Values['Id'] + '/?W=' + IntToStr(ImageWidth)) + '">' +129 '<a href="' + NavigationLink('/kamery/' + DbRows[I].Items['Id'] + '/?W=' + IntToStr(ImageWidth)) + '">' + 131 130 '<img name="theImage" src="' + NavigationLink('/' + WebCamImage) + '" width="' + 132 131 IntToStr(ImageWidthThumb) + '" height="' + IntToStr(ImageHeightThumb) + '" alt="' + 133 DbRows[I]. Values['Name'] + '"/></a></span> ';132 DbRows[I].Items['Name'] + '"/></a></span> '; 134 133 end; 135 134 finally … … 153 152 IntToStr(Id) + ') AND (`Enabled`=1)'); 154 153 if DbRows.Count > 0 then begin 155 WebCamImage := 'images/webcam/' + DbRows[0]. Values['ImageName'];156 RefreshInterval := StrToInt(DbRows[0]. Values['ImagePeriod']);157 ImageHeight := Round(ImageWidth * StrToInt(DbRows[0]. Values['Height']) / StrToInt(DbRows[0].Values['Width']));154 WebCamImage := 'images/webcam/' + DbRows[0].Items['ImageName']; 155 RefreshInterval := StrToInt(DbRows[0].Items['ImagePeriod']); 156 ImageHeight := Round(ImageWidth * StrToInt(DbRows[0].Items['Height']) / StrToInt(DbRows[0].Items['Width'])); 158 157 159 158 if FileExists(WebCamImage) then begin … … 181 180 '</script>' + #13#10 + 182 181 183 '<br /><div align="center">' + DbRows[0]. Values['Name'] + '<br/>' +182 '<br /><div align="center">' + DbRows[0].Items['Name'] + '<br/>' + 184 183 '<img name="theImageTemp" src="' + NavigationLink('/' + WebCamImage) + '" width="0" height="0" alt="Temp image"/>' + 185 184 '<img name="theImage" src="' + NavigationLink('/' + WebCamImage) + '" width="' + IntToStr(ImageWidth) + 186 185 '" height="' + IntToStr(ImageHeight) + '" alt="' + 187 DbRows[0]. Values['Name'] + '"/></div>';186 DbRows[0].Items['Name'] + '"/></div>'; 188 187 end else Result := Result + '<br />Obrázek nenalezen.<br /><br />'; 189 188 Result := Result + '<br/><div align="center">'; 190 189 if LastFileDate <> '' then Result := Result + 'Aktualizace: <span id="lasttime">' + 191 190 LastFileDate + '</span>, '; 192 Result := Result + 'Perioda: ' + IntToStr(RefreshInterval) + ' sekund, Typ: ' + DbRows[0].Values['DeviceType'] + '<br />' + 193 '<br/>' + DbRows[0].Values['Description']; 194 Result := Result + GetVideoArchive(DbRows[0].Values['Id']) + '</div>'; 191 Result := Result + 'Perioda: ' + IntToStr(RefreshInterval) + ' sekund, Typ: ' + 192 DbRows[0].Items['DeviceType'] + '<br />' + 193 '<br/>' + DbRows[0].Items['Description']; 194 Result := Result + GetVideoArchive(DbRows[0].Items['Id']) + '</div>'; 195 195 end else Result := Result + '<br />Id kamery nenalezeno.<br/><br>'; 196 196 finally
Note:
See TracChangeset
for help on using the changeset viewer.