Changeset 82
- Timestamp:
- Jun 23, 2012, 11:58:40 PM (12 years ago)
- Location:
- trunk
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Pages/UWebCamPage.pas
r81 r82 41 41 Id: Integer; 42 42 LastFileDate: string; 43 ImageWidth, ImageHeight: string; 43 ImageWidth, ImageHeight: Integer; 44 ImageWidthThumb, ImageHeightThumb: Integer; 44 45 begin 45 46 with TWebSession(HandlerData) do begin … … 54 55 if HandlerData.Request.Query.IndexOfName('Id') = -1 then Id := '' 55 56 else Id := IntToStr(StrToInt(HandlerData.Request.Query.Values['Id'])); 56 if (HandlerData.Request.Query.IndexOfName('W') = -1) or 57 (HandlerData.Request.Query.IndexOfName('H') = -1) then begin 58 ImageWidth := '640'; 59 ImageHeight := '480'; 57 if (HandlerData.Request.Query.IndexOfName('W') = -1) then begin 58 ImageWidth := 640; 60 59 end else begin 61 ImageWidth := IntToStr(StrToInt(HandlerData.Request.Query.Values['W'])); 62 ImageHeight := IntToStr(StrToInt(HandlerData.Request.Query.Values['H'])); 60 ImageWidth := StrToInt(HandlerData.Request.Query.Values['W']); 63 61 end; 64 62 65 63 Text := Text + '<table style="width: 100%"><tr><td style="width: 20%" valign="top">' + 66 64 '<strong>Velikost</strong><br/>' + 67 '<a href="?W=320&H=240&Id=' + Id + '">320x240</a><br/> ' + 68 '<a href="?W=640&H=480&Id=' + Id + '">640x480</a><br/> ' + 69 '<a href="?W=1024&H=768&Id=' + Id + '">1024x768</a><br/> ' + 70 '<a href="?W=1280&H=1024&Id=' + Id + '">1280x1024</a><br/><br/>'; 65 '<a href="?W=160&Id=' + Id + '">Malá</a><br/> ' + 66 '<a href="?W=320&Id=' + Id + '">Menší</a><br/> ' + 67 '<a href="?W=640&Id=' + Id + '">Střední</a><br/> ' + 68 '<a href="?W=1024&Id=' + Id + '">Větší</a><br/> ' + 69 '<a href="?W=1280&Id=' + Id + '">Velká</a><br/><br/>'; 71 70 72 71 Text := Text + '<strong>Místní kamery</strong><br/>'; 73 Text := Text + '<a href="?W=' + ImageWidth + 74 '&H=' + ImageHeight +'">Všechny</a><br/>'; 72 Text := Text + '<a href="?W=' + IntToStr(ImageWidth) + '">Všechny</a><br/>'; 75 73 try 76 74 DbRows := TDbRows.Create; 77 Database.Query(DbRows, 'SELECT * FROM Webcam WHERE Enabled=1');75 Database.Query(DbRows, 'SELECT * FROM `Webcam` WHERE `Enabled`=1'); 78 76 for I := 0 to DbRows.Count - 1 do begin 79 Text := Text + '<a href="?Id=' + DbRows[I].Values['Id'] + '&W=' + I mageWidth+80 ' &H=' + ImageHeight +'">' + DbRows[I].Values['Name'] + '</a><br/>';77 Text := Text + '<a href="?Id=' + DbRows[I].Values['Id'] + '&W=' + IntToStr(ImageWidth) + 78 '">' + DbRows[I].Values['Name'] + '</a><br/>'; 81 79 end; 82 80 finally … … 93 91 try 94 92 DbRows := TDbRows.Create; 95 Database.Query(DbRows, 'SELECT * FROM Webcam WHERE Enabled=1'); 93 Database.Query(DbRows, 'SELECT * FROM `Webcam` WHERE `Enabled`=1'); 94 ImageWidthThumb := 160; 96 95 for I := 0 to DbRows.Count - 1 do begin 96 ImageHeightThumb := Round(ImageWidthThumb * StrToInt(DbRows[I].Values['Height']) / StrToInt(DbRows[I].Values['Width'])); 97 97 WebCamImage := 'images/webcam/' + DbRows[I].Values['ImageName']; 98 Text := Text + '<span align="center" >' + //DbRows[I].Values['Name'] + '<br/>' +99 '<a href="?Id=' + DbRows[I].Values['Id'] + '&W=' + ImageWidth+100 '&H=' + ImageHeight +'">' +101 '<img name="theImage" src="' + NavigationLink('/' + WebCamImage) + '" width="160" height="120" alt="' +102 DbRows[I].Values['Name'] + '"/></a></span> ';98 Text := Text + '<span align="center" valign="middle" style="vertical-align: middle;">' + //DbRows[I].Values['Name'] + '<br/>' + 99 '<a href="?Id=' + DbRows[I].Values['Id'] + '&W=' + IntToStr(ImageWidth) + '">' + 100 '<img name="theImage" src="' + NavigationLink('/' + WebCamImage) + '" width="' + 101 IntToStr(ImageWidthThumb) + '" height="' + IntToStr(ImageHeightThumb) + '" alt="' + 102 DbRows[I].Values['Name'] + '"/></a></span> '; 103 103 end; 104 104 finally … … 108 108 try 109 109 DbRows := TDbRows.Create; 110 Database.Query(DbRows, 'SELECT * FROM Webcam WHERE (Id=' +111 Id + ') AND ( Enabled=1)');110 Database.Query(DbRows, 'SELECT * FROM `Webcam` WHERE (`Id`=' + 111 Id + ') AND (`Enabled`=1)'); 112 112 if DbRows.Count > 0 then begin 113 113 … … 115 115 RefreshInterval := StrToInt(DbRows[0].Values['ImagePeriod']); 116 116 Id := DbRows[0].Values['Id']; 117 ImageHeight := Round(ImageWidth * StrToInt(DbRows[0].Values['Height']) / StrToInt(DbRows[0].Values['Width'])); 117 118 118 119 if FileExists(WebCamImage) then begin … … 142 143 '<br /><div align="center">' + DbRows[0].Values['Name'] + '<br/>' + 143 144 '<img name="theImageTemp" src="' + NavigationLink('/' + WebCamImage) + '" width="0" height="0" alt="Temp image"/>' + 144 '<img name="theImage" src="' + NavigationLink('/' + WebCamImage) + '" width="' + ImageWidth + '" height="' + ImageHeight + '" alt="' + 145 '<img name="theImage" src="' + NavigationLink('/' + WebCamImage) + '" width="' + IntToStr(ImageWidth) + 146 '" height="' + IntToStr(ImageHeight) + '" alt="' + 145 147 DbRows[0].Values['Name'] + '"/><br/>Aktualizace: <span id="lasttime">' + 146 148 LastFileDate + '</span>, Perioda: ' + -
trunk/UCore.lfm
r80 r82 1 object MainModule: TMainModule1 object Core: TCore 2 2 OldCreateOrder = False 3 3 Height = 278 -
trunk/UCore.lrs
r80 r82 1 { This is an automatically generated lazarus resource file } 2 3 LazarusResources.Add('TMainModule','FORMDATA',[ 4 'TPF0'#11'TMainModule'#10'MainModule'#14'OldCreateOrder'#8#6'Height'#3#22#1#16 5 +'HorizontalOffset'#3#17#1#14'VerticalOffset'#3#208#0#5'Width'#3#175#1#0#7'TW' 6 +'ebApp'#7'WebApp1'#13'OnPageProduce'#7#18'WebApp1PageProduce'#10'ServerType' 7 +#7#5'stTCP'#4'left'#3#160#0#3'top'#2'X'#0#0#0 1 LazarusResources.Add('TCore','FORMDATA',[ 2 'TPF0'#5'TCore'#4'Core'#14'OldCreateOrder'#8#6'Height'#3#22#1#16'HorizontalOf' 3 +'fset'#3#17#1#14'VerticalOffset'#3#208#0#5'Width'#3#175#1#0#7'TWebApp'#7'Web' 4 +'App1'#13'OnPageProduce'#7#18'WebApp1PageProduce'#10'ServerType'#7#5'stTCP'#4 5 +'left'#3#160#0#3'top'#2'X'#0#0#0 8 6 ]); -
trunk/ZdechovNET.lpi
r81 r82 191 191 <IsPartOfProject Value="True"/> 192 192 <ComponentName Value="ProjectsPage"/> 193 <HasResources Value="True"/> 193 194 <ResourceBaseClass Value="DataModule"/> 194 195 <UnitName Value="UProjectsPage"/> … … 207 208 <Filename Value="UCore.pas"/> 208 209 <IsPartOfProject Value="True"/> 209 <HasResources Value="True"/> 210 <ComponentName Value="Core"/> 211 <HasResources Value="True"/> 212 <ResourceBaseClass Value="DataModule"/> 210 213 <UnitName Value="UCore"/> 211 214 </Unit23> … … 218 221 </Target> 219 222 <SearchPaths> 220 <OtherUnitFiles Value="/usr/lib/mysql ;/usr/lib64/mysql;Application;WebServer;Network;Pages;Modules/User;Common"/>223 <OtherUnitFiles Value="/usr/lib/mysql/;/usr/lib64/mysql/;Application;WebServer;Network;Pages;Modules/User;Common"/> 221 224 <UnitOutputDirectory Value="lib/$(TargetCPU)-$(TargetOS)"/> 222 225 </SearchPaths>
Note:
See TracChangeset
for help on using the changeset viewer.