Browse Source

Before Georgia

master
Evgeny Gagua 5 years ago
parent
commit
c7355ce252
  1. 27
      __template.php
  2. BIN
      app-debug-unaligned.apk
  3. BIN
      app.apk
  4. 12
      ccal.php
  5. 43
      check_ericson.html
  6. 49
      check_ericson2.html
  7. 60
      check_face.html
  8. 50
      check_my_webrtc.html
  9. 50
      check_webrtc.html
  10. 63
      check_ws.html
  11. 27
      devices.php
  12. 37
      index.php
  13. 6
      info.php
  14. BIN
      lib.tar.bz2
  15. 3
      lib/ajax_asm.php
  16. 3
      lib/assembler.php
  17. 36
      lib/controller/AddCameraNode.php
  18. 2
      lib/controller/clearEventCloud.php
  19. 10
      lib/controller/clearServerLog.php
  20. 24
      lib/controller/dash/node_13.js
  21. 88
      lib/controller/dash/node_2.js
  22. 39
      lib/controller/getCameraSettings.php
  23. 123
      lib/controller/getDashBoardItems.php
  24. 14
      lib/controller/getDashBoardStatus.php
  25. 411
      lib/controller/getDeviceDraw.php
  26. 32
      lib/controller/getEventProps.php
  27. 2
      lib/controller/getEventRecords.php
  28. 62
      lib/controller/getGeoAlerts.php
  29. 456
      lib/controller/getGeoZones.php
  30. 2
      lib/controller/getLocationNodes.php
  31. 37
      lib/controller/getM3U8.php
  32. 9
      lib/controller/getOnvifCredentials.php
  33. 47
      lib/controller/getSettingsLRF.php
  34. 24
      lib/controller/listAccessLog.php
  35. 2
      lib/controller/listDiscoveredCameraSources.php
  36. 39
      lib/controller/listServerLog.php
  37. 27
      lib/controller/listUsers.php
  38. 3
      lib/controller/props/event_prop.js
  39. 29
      lib/controller/props/event_video.js
  40. 2
      lib/controller/removeNode.php
  41. 1
      lib/controller/updateUserSettings.php
  42. 67
      lib/defines.php
  43. 18
      lib/install.php
  44. 781
      lib/javascript/jsapi_dynamic/rgoose_camera_editor.js
  45. 61
      lib/javascript/jsapi_dynamic/rgoose_dashboard.js
  46. 93
      lib/javascript/jsapi_dynamic/rgoose_devices_module.js
  47. 82
      lib/javascript/jsapi_dynamic/rgoose_location_editor.js
  48. 245
      lib/javascript/jsapi_dynamic/rgoose_logs.js
  49. 52
      lib/javascript/jsapi_dynamic/rgoose_main.js
  50. 190
      lib/javascript/jsapi_dynamic/rgoose_sysmap_editor.js
  51. 523
      lib/javascript/jsapi_dynamic/rgoose_timeline.js
  52. 171
      lib/javascript/jsapi_dynamic/rgoose_users.js
  53. BIN
      lib/javascript/jsapi_dynamic/vatican_308px-100m.jpg
  54. 63
      lib/javascript/jsapi_static/rgoose_general.js
  55. 189
      lib/javascript/leaflet/Leaflet.ImageOverlay.Rotated.js
  56. 636
      lib/javascript/leaflet/leaflet.css
  57. 6
      lib/javascript/leaflet/leaflet.js
  58. 5
      lib/javascript/leaflet/leaflet__.js
  59. 2
      lib/javascript/videojs/videojs-offset.min.js
  60. 3
      lib/js_asm.php
  61. 54
      lib/php/auth/gplogger.auth.lib.php
  62. 58
      lib/php/auth/web.php
  63. 2
      lib/php/db/language_class.php
  64. 70
      lib/php/db/logio_class.php
  65. 175
      lib/php/db/user_class.php
  66. 184
      lib/php/ui/UI_functions.php
  67. 534
      lib/php/utm/gPoint.php
  68. 80
      lib/settings.php
  69. 74
      lib/settings.php.bk
  70. 2
      lib/soap_asm.php
  71. 1
      lib/ui_asm.php
  72. 54
      logerror
  73. 129
      old.php
  74. BIN
      outtest.png
  75. BIN
      outtest2.png
  76. 1
      registry.sjno
  77. 11
      saveimage.php
  78. 39
      setup/camera_ptz_protocols.sql
  79. 7751
      setup/dfsl_gunter.sql
  80. 625
      setup/dfsl_gunter_structs.sql
  81. 14
      setup/index.php
  82. 104
      setup/install.php
  83. 68
      setup/labels_js.sql
  84. 49
      setup/labels_php.sql
  85. 42
      setup/server_module_types.sql
  86. 74
      setup/settings.php
  87. 173
      soap.php
  88. 92
      some_test.php
  89. BIN
      style/assets/987698d-1.png
  90. 10
      style/style.css
  91. 25
      test_998.txt
  92. 36
      test_all_off.php
  93. 36
      test_all_on.php
  94. 11
      test_ffmpeg
  95. 22
      test_hls.html
  96. 8
      test_mp4.php
  97. 8
      test_my_video.html
  98. 6
      test_ogg.php

27
__template.php

@ -1,27 +0,0 @@
<?php
require_once('lib/assembler.php');
// Disable Direct access without login
if($CUser->Data[id] < 2 ){
header('location: /');
exit();
};
UI_PageHeader();
if( $RTL_SITE ){
UI_Begin2Section();
} else {
UI_Begin2Section('120px');
UI_SideMenu();
UI_SectionDelimiter();
};
if( $CUser->Data[id] > 1 ){
//Main Content
} else {
UI_LoginForm();
};
if( $RTL_SITE ){
UI_SectionDelimiter('120px');
UI_SideMenu();
}
UI_End2Section();
UI_PageBottom();
?>

BIN
app-debug-unaligned.apk

Binary file not shown.

BIN
app.apk

Binary file not shown.

12
ccal.php
File diff suppressed because it is too large
View File

43
check_ericson.html

@ -1,43 +0,0 @@
<html>
<head>
<title>Video Chat</title>
<script type="text/javascript">
window.onload = function () {
var transceiver = new MediaStreamTransceiver("ws://192.168.0.115:8080/delayswitch?sid=0");
var videoDevice = document.getElementsByTagName("device")[0];
videoDevice.onchange = function (evt) {
var videoStream = videoDevice.data;
var selfView = document.getElementById("self_view");
// exclude audio from the self view
selfView.src = videoStream.url + "#video";
selfView.play();
// set the stream to share
transceiver.localStream = videoStream;
};
transceiver.onconnect = function () {
var remoteVideo = document.getElementById("remote_video");
// play the incoming stream
remoteVideo.src = transceiver.remoteStream.url;
remoteVideo.play();
};
}
</script>
</head>
<body>
<div><device type="media"></div>
<div style="float:left">
<p>Self-view:</p>
<video width="320" height="240" id="self_view"></video>
</div>
<div style="float:left">
<p>Remote video:</p>
<video width="320" height="240" id="remote_video"></video>
</div>
</body>
</html>

49
check_ericson2.html

@ -1,49 +0,0 @@
<html>
<head>
<title>Streamer</title>
</head>
<body>
https://github.com/mpromonet/webrtc-streamer
https://medium.com/@alexcambose/webcam-live-streaming-with-websockets-and-base64-64b1b4992db8
chrome://flags/#unsafely-treat-insecure-origin-as-secure
https://developer.mozilla.org/en-US/docs/Web/API/Media_Streams_API
https://www.tutorialspoint.com/webrtc/webrtc_media_stream_apis.htm
https://webrtc.github.io/samples/
https://phoboslab.org/log/2013/09/html5-live-video-streaming-via-websockets
https://github.com/phoboslab/jsmpeg
https://stackoverflow.com/questions/4241992/video-streaming-over-websockets-using-javascript
https://chromium.googlesource.com/chromium/src/+/master/net/server/web_socket_encoder.cc
https://tools.ietf.org/html/rfc7692#page-12
https://tools.ietf.org/html/rfc6455#section-4.2.2
https://habr.com/ru/company/ruvds/blog/342346/
https://github.com/liwf616/awesome-live-stream
https://github.com/auscaster/webrtc-native-to-browser-peerconnection-example/blob/master/peerconnection/server/main.cc
<video autoplay></video>
<script>
// get video dom element
const video = document.querySelector('video');
// request access to webcam
navigator.mediaDevices.getUserMedia({video: {width: 426, height: 240}}).then((stream) => video.srcObject = stream);
// returns a frame encoded in base64
const getFrame = () => {
const canvas = document.createElement('canvas');
canvas.width = video.videoWidth;
canvas.height = video.videoHeight;
canvas.getContext('2d').drawImage(video, 0, 0);
const data = canvas.toDataURL('image/png');
return data;
}
const WS_URL = 'ws://192.168.0.115:8080';
const FPS = 3;
const ws = new WebSocket(WS_URL);
ws.onopen = () => {
console.log(`Connected to ${WS_URL}`);
setInterval(() => {
ws.send(getFrame());
}, 1000 / FPS);
}
</script>
</body>
</html>

60
check_face.html

@ -1,60 +0,0 @@
<!doctype html>
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Capture Web camera image using WebcamJS and PHP - Theonlytutorials.com</title>
<style type="text/css">
body { font-family: Helvetica, sans-serif; }
h2, h3 { margin-top:0; }
form { margin-top: 15px; }
form > input { margin-right: 15px; }
#results { float:right; margin:20px; padding:20px; border:1px solid; background:#ccc; }
</style>
</head>
<body>
<div id="results">Your captured image will appear here...</div>
<h1>Capture Web camera image using WebcamJS and PHP - Theonlytutorials.com</h1>
<h3>Demonstrates simple 600x460 capture &amp; display</h3>
<div id="my_camera"></div>
<!-- First, include the Webcam.js JavaScript Library -->
<script type="text/javascript" src="/lib/javascript/webcam/webcam.js"></script>
<!-- Configure a few settings and attach camera -->
<script language="JavaScript">
Webcam.set({
width: 600,
height: 460,
image_format: 'jpeg',
jpeg_quality: 90
});
Webcam.attach( '#my_camera' );
</script>
<!-- A button for taking snaps -->
<form>
<input type=button value="Take Snapshot" onClick="take_snapshot()">
</form>
<!-- Code to handle taking the snapshot and displaying it locally -->
<script language="JavaScript">
function take_snapshot() {
// take snapshot and get image data
Webcam.snap( function(data_uri) {
// display results in page
Webcam.upload( data_uri, 'saveimage.php', function(code, text) {
document.getElementById('results').innerHTML =
'<h2>Here is your image:</h2>' +
'<img src="'+text+'"/>';
} );
} );
}
</script>
</body>
</html>

50
check_my_webrtc.html

@ -1,50 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Unreal Media Server WebRTC player</title>
<script src="/lib/javascript/unrealmedia/webrtcadapter.js"></script>
<script src="/lib/javascript/unrealmedia/unrealwebrtcplayer2.js"></script>
<script type="text/javascript">
var webrtcPlayer = null;
</script>
</head>
<body>
<div id="container" align="center">
Unreal Media Server WebRTC player<br><br>This player plays live near real time audio/video on any OS and mobile device, in all major browsers. This is original H264 video encoded by IP camera; server doesn't do any transcoding.<br><br>
<video style="background-color:black" id="remoteVideo" width="800" height="450" autoplay playsinline controls muted></video>
<script type="text/javascript">
//Parameters:
//1. ID of video element.
//2. Alias of the live broadcast; video encoding supported: H264(AVC1), VP8, VP9; audio encoding supported: opus, G.711(PCMA/PCMU).
//3. Secure token for session based authentication, leave empty if none. Should not be used unless Media Server and Web Server run on different domains.
//4. IP address of Unreal Media Server. If you specify domain name (domain name must be used for signaling over secure websocket) AND your server is behind NAT, then you need to make a change in unrealwebrtcplayer.js, described in http://www.umediaserver.net/phpBB3/viewtopic.php?f=29&t=3563
//5. Main port of Unreal Media Server for signaling over websocket (by default, 5119 for unsecure webscokets / 443 for secure websockets). Make sure these ports are open in the firewall.
//6. Use secure websocket for signaling; if true, make sure to set the port to secure port (443 by default) and configure SSL certificate in Unreal Media Server. If this parameter is false and this webpage is loaded under https:// then browsers will display "mixed content" warning; you will need to allow mixed content in your browser.
//7. Use single central port for actual WebRTC ICE connection. If true, the web browser will receive streaming media from predefined single port in Unreal Media Server, dedicated to WebRTC connections (by default 5135). If true, you only need to open port 5135 in firewall/NAT router for Unreal Media Server (together with signaling ports, 5119 or 443). If false, the WebRTC connection will be made over a random port; you will need to open all ports in the firewall, or add Unreal Media Server as an allowed app in the firewall.
//8. WebRTC transport protocol. Set to "udp" or "tcp". The central port can be used for both udp and tcp.
webrtcPlayer = new UnrealWebRTCPlayer("remoteVideo", "livedemocam", "", "192.168.0.115", "8080", false, true, "tcp");
//Comment out next line not to start playing when webpage loads. Then user will need to click on Play button to play; you may want to use a video element with overlayed Play button - check out our SDK for sample webpages.
webrtcPlayer.Play(); //Start playing automatically when webpage loads. Notice that video element has a "muted" attribute; this is video-only stream anyway. A muted attribute helps to overcome Chrome's autoplay policy, and is not always needed, as described in http://www.umediaserver.net/phpBB3/viewtopic.php?f=29&t=3578
</script>
</div>
</body>
</html>

50
check_webrtc.html

@ -1,50 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Unreal Media Server WebRTC player</title>
<script src="/lib/javascript/unrealmedia/webrtcadapter.js"></script>
<script src="/lib/javascript/unrealmedia/unrealwebrtcplayer.js"></script>
<script type="text/javascript">
var webrtcPlayer = null;
</script>
</head>
<body>
<div id="container" align="center">
Unreal Media Server WebRTC player<br><br>This player plays live near real time audio/video on any OS and mobile device, in all major browsers. This is original H264 video encoded by IP camera; server doesn't do any transcoding.<br><br>
<video style="background-color:black" id="remoteVideo" width="800" height="450" autoplay playsinline controls muted></video>
<script type="text/javascript">
//Parameters:
//1. ID of video element.
//2. Alias of the live broadcast; video encoding supported: H264(AVC1), VP8, VP9; audio encoding supported: opus, G.711(PCMA/PCMU).
//3. Secure token for session based authentication, leave empty if none. Should not be used unless Media Server and Web Server run on different domains.
//4. IP address of Unreal Media Server. If you specify domain name (domain name must be used for signaling over secure websocket) AND your server is behind NAT, then you need to make a change in unrealwebrtcplayer.js, described in http://www.umediaserver.net/phpBB3/viewtopic.php?f=29&t=3563
//5. Main port of Unreal Media Server for signaling over websocket (by default, 5119 for unsecure webscokets / 443 for secure websockets). Make sure these ports are open in the firewall.
//6. Use secure websocket for signaling; if true, make sure to set the port to secure port (443 by default) and configure SSL certificate in Unreal Media Server. If this parameter is false and this webpage is loaded under https:// then browsers will display "mixed content" warning; you will need to allow mixed content in your browser.
//7. Use single central port for actual WebRTC ICE connection. If true, the web browser will receive streaming media from predefined single port in Unreal Media Server, dedicated to WebRTC connections (by default 5135). If true, you only need to open port 5135 in firewall/NAT router for Unreal Media Server (together with signaling ports, 5119 or 443). If false, the WebRTC connection will be made over a random port; you will need to open all ports in the firewall, or add Unreal Media Server as an allowed app in the firewall.
//8. WebRTC transport protocol. Set to "udp" or "tcp". The central port can be used for both udp and tcp.
webrtcPlayer = new UnrealWebRTCPlayer("remoteVideo", "livedemocam", "", "65.23.154.147", "80", false, true, "tcp");
//Comment out next line not to start playing when webpage loads. Then user will need to click on Play button to play; you may want to use a video element with overlayed Play button - check out our SDK for sample webpages.
webrtcPlayer.Play(); //Start playing automatically when webpage loads. Notice that video element has a "muted" attribute; this is video-only stream anyway. A muted attribute helps to overcome Chrome's autoplay policy, and is not always needed, as described in http://www.umediaserver.net/phpBB3/viewtopic.php?f=29&t=3578
</script>
</div>
</body>
</html>

63
check_ws.html

@ -1,63 +0,0 @@
<html>
<head>
<script src="https://cdn.jsdelivr.net/npm/hls.js@latest"></script>
<!-- Or if you want a more recent canary version -->
<!-- <script src="https://cdn.jsdelivr.net/npm/hls.js@canary"></script> -->
<script>
var video = document.getElementById('video');
if( Hls.isSupported()) {
alert("HLS is OK");
var hls = new Hls();
hls.loadSource('https://video-dev.github.io/streams/x36xhzz/x36xhzz.m3u8');
hls.attachMedia(video);
hls.on(Hls.Events.MANIFEST_PARSED,function() {
video.play();
});
}
// hls.js is not supported on platforms that do not have Media Source Extensions (MSE) enabled.
// When the browser has built-in HLS support (check using `canPlayType`), we can provide an HLS manifest (i.e. .m3u8 URL) directly to the video element through the `src` property.
// This is using the built-in support of the plain video element, without using hls.js.
// Note: it would be more normal to wait on the 'canplay' event below however on Safari (where you are most likely to find built-in HLS support) the video.src URL must be on the user-driven
// white-list before a 'canplay' event will be emitted; the last video event that can be reliably listened-for when the URL is not on the white-list is 'loadedmetadata'.
else if (video.canPlayType('application/vnd.apple.mpegurl')) {
video.src = 'https://video-dev.github.io/streams/x36xhzz/x36xhzz.m3u8';
video.addEventListener('loadedmetadata',function() {
video.play();
});
};
var socket;
function start_connection(){
var socket = new WebSocket('ws://192.168.0.115:8080/koko/shmoko/zuzu?ID=2323089034');
socket.onopen = function() { alert("Connection opened...") };
socket.onclose = function() {
alert("Connection closed...");
socket = null;
};
socket.onopen = function(event) {
socket.send('Some message')
};
socket.onmessage = function(event) {
var message = event.data;
alert( 'Resived:' + message );
};
};
function chucha(){
//var mimeCodec = 'video/mp4; codecs="avc1.4D401F"';
var mimeCodec = 'video/mp4; codecs="avc1.64001E"'
if (MediaSource.isTypeSupported(mimeCodec)) {
// Create Media Source
var mediaSource = new MediaSource(); // mediaSource.readyState === 'closed'
alert('Codec OK');
} else {
alert("Unsupported media format");
}
};
</script>
</head>
<body>
<input type="button" onclick="start_connection();" value="Connect">
<input type="button" onclick="chucha();" value="Check Codec">
<video id="video" controls ></video>
</video>
</body>
</html>

27
devices.php

@ -1,27 +0,0 @@
<?php
require_once('lib/assembler.php');
// Disable Direct access without login
if($CUser->Data[id] < 2 ){
header('location: /');
exit();
};
UI_PageHeader();
if( $RTL_SITE ){
UI_Begin2Section();
} else {
UI_Begin2Section('120px');
UI_SideMenu();
UI_SectionDelimiter();
};
if( $CUser->Data[id] > 1 ){
//Main Content
} else {
UI_LoginForm();
};
if( $RTL_SITE ){
UI_SectionDelimiter('120px');
UI_SideMenu();
}
UI_End2Section();
UI_PageBottom();
?>

37
index.php

@ -1,34 +1,21 @@
<?php <?php
require_once('lib/assembler.php'); require_once('lib/assembler.php');
if( $CUser->Data['id'] > 1 ){ if( $CUser->Data['id'] > 1 ){
UI_PageHeaderExt(
'rgoose_general.js',
array('rgoose_timeline.js','rgoose_camera_editor.js','rgoose_mediaserver_module.js','rgoose_sysmap_editor.js','rgoose_location_editor.js','rgoose_dashboard.js','rgoose_main.js', 'rgoose_devices_module.js')
);
if( $CUser->Data['access'] > 5 ){
UI_PageHeaderExt(
'rgoose_general.js',
array('rgoose_timeline.js','rgoose_camera_editor.js','rgoose_mediaserver_module.js','rgoose_sysmap_editor.js','rgoose_location_editor.js','rgoose_dashboard.js', 'rgoose_devices_module.js', 'rgoose_users.js', 'rgoose_logs.js', 'rgoose_main.js')
);
} else {
UI_PageHeaderExt(
'rgoose_general.js',
array('rgoose_timeline.js', 'rgoose_dashboard.js','rgoose_main.js' )
);
};
UI_PageBottomExt(); UI_PageBottomExt();
} else { } else {
UI_PageHeader(); UI_PageHeader();
//if( $RTL_SITE ){
// UI_Begin2Section();
//} else {
// UI_Begin2Section('120px');
// UI_SideMenu();
// UI_SectionDelimiter();
//};
//Main Content
//if( $CUser->Data[id] > 1 ){
// UI_MainDashBoard();
//} else {
UI_LoginForm();
//};
//if( $RTL_SITE ){
// UI_SectionDelimiter('120px');
// UI_SideMenu();
//}
// UI_End2Section();
UI_LoginForm();
UI_PageBottom(); UI_PageBottom();
}; };
?> ?>

6
info.php

@ -1,6 +0,0 @@
<?php
phpinfo();
?>

BIN
lib.tar.bz2

Binary file not shown.

3
lib/ajax_asm.php

@ -1,6 +1,7 @@
<?php <?php
error_reporting( E_ALL ); error_reporting( E_ALL );
require_once('settings.php'); require_once('settings.php');
require_once('defines.php');
// SET DATA CONNECTION AND GLOBAL USER VARIABLES // SET DATA CONNECTION AND GLOBAL USER VARIABLES
$TT_123 = explode( '.', PHP_VERSION ); $TT_123 = explode( '.', PHP_VERSION );
@ -17,6 +18,8 @@ if( $TT_123[0] == '4' ){
//$DATABASE->SetCacheDir( $DBCacheDir ); //$DATABASE->SetCacheDir( $DBCacheDir );
session_start(); session_start();
require_once('php/db/logio_class.php');
$LOG = new Logio( LOG_LVL_ALL );
require_once('php/db/user_class.php'); require_once('php/db/user_class.php');
require_once('php/auth/web.php'); require_once('php/auth/web.php');
require_once('php/db/language_class.php'); require_once('php/db/language_class.php');

3
lib/assembler.php

@ -1,6 +1,7 @@
<?php <?php
error_reporting( E_ALL ); error_reporting( E_ALL );
require_once('settings.php'); require_once('settings.php');
require_once('defines.php');
// SET DATA CONNECTION AND GLOBAL USER VARIABLES // SET DATA CONNECTION AND GLOBAL USER VARIABLES
$TT_123 = explode( '.', PHP_VERSION ); $TT_123 = explode( '.', PHP_VERSION );
@ -17,6 +18,8 @@ if( $TT_123[0] == '4' ){
//$DATABASE->SetCacheDir( $DBCacheDir ); //$DATABASE->SetCacheDir( $DBCacheDir );
session_start(); session_start();
require_once('php/db/logio_class.php');
$LOG = new Logio( LOG_LVL_ALL );
require_once('php/db/user_class.php'); require_once('php/db/user_class.php');
require_once('php/auth/web.php'); require_once('php/auth/web.php');
require_once('php/db/language_class.php'); require_once('php/db/language_class.php');

36
lib/controller/AddCameraNode.php

@ -3,31 +3,33 @@
if( $CUser->Data['id'] > 1 ){ if( $CUser->Data['id'] > 1 ){
$SiteID = intval($_POST['NID']); $SiteID = intval($_POST['NID']);
$CamID = intval($_POST['CID']); $CamID = intval($_POST['CID']);
$LON = floatval($_POST['LON']);
$LAT = floatval($_POST['LAT']);
$ALT = floatval($_POST['ALT']);
$PCH = floatval($_POST['PCH']);
$ROL = floatval($_POST['ROL']);
$YAW = floatval($_POST['YAW']);
$PTZ = intval($_POST['PTZ']);
$UART = intval($_POST['UART']);
$FMIN = floatval($_POST['FMIN']);
$FMAX = floatval($_POST['FMAX']);
$IMSIZE = intval($_POST['IMSIZE']);
$TILTMODE = intval($_POST['TILTMODE']);
$PANMODE = intval($_POST['PANMODE']);
$PANANG = floatval( $_POST['PANANG']);
$TILTANG = floatval( $_POST['TILTANG']);
$PROTOID = intval( $_POST['PROTOID'] );
$Data = array(); $Data = array();
if( $CamID ){ if( $CamID ){
if( intval($_POST['PTZ']) > 0 ){
if( isset( $_POST['NAM'] ) ){
$CAM_NAM = $DATABASE->escape( $_POST['NAM'] );
if( $PTZ > 0 ){
if( isset( $_POST['LAB'] ) ){
$CAM_NAM = $DATABASE->escape( $_POST['LAB'] );
} else { } else {
$CAM_NAM = 'New PTZ IP Camera'; $CAM_NAM = 'New PTZ IP Camera';
}; };
$CCTYPE = ARGUS_IP_PTZ_CAMERA; $CCTYPE = ARGUS_IP_PTZ_CAMERA;
} else { } else {
if( isset( $_POST['NAM'] ) ){
$CAM_NAM = $DATABASE->escape( $_POST['NAM'] );
if( isset( $_POST['LAB'] ) ){
$CAM_NAM = $DATABASE->escape( $_POST['LAB'] );
} else { } else {
$CAM_NAM = 'New PTZ IP Camera';
$CAM_NAM = 'New IP Camera';
}; };
$CCTYPE = ARGUS_IP_STATIC_CAMERA; $CCTYPE = ARGUS_IP_STATIC_CAMERA;
}; };
$QS = "UPDATE cameras SET type={$CCTYPE}, status=1, lat={$LAT},lon={$LON},alt={$ALT},pitch={$PCH},roll={$ROL},yaw={$YAW} WHERE id={$CamID}";
$DATABASE->Query( $QS, false );
$QS = "INSERT INTO nodes SET site_id={$SiteID},type={$CCTYPE},aux_id={$CamID},name='{$CAM_NAM}'"; $QS = "INSERT INTO nodes SET site_id={$SiteID},type={$CCTYPE},aux_id={$CamID},name='{$CAM_NAM}'";
$DATABASE->Query( $QS, false ); $DATABASE->Query( $QS, false );
$NodeID = $DATABASE->getLastInsertID(); $NodeID = $DATABASE->getLastInsertID();
@ -44,14 +46,14 @@
if( intval($_POST['PTZ']) > 0 ){ if( intval($_POST['PTZ']) > 0 ){
$MD5 = md5( $NodeID . "_" . $CamID . "_CTRL" ); $MD5 = md5( $NodeID . "_" . $CamID . "_CTRL" );
switch( $_POST['PTZ'] ){ switch( $_POST['PTZ'] ){
case 1: $TY = ARGUS_NODE_SOCK_TYPE_NETWORK;
case 2: $TY = ARGUS_NODE_SOCK_TYPE_SERIAL_PORT;
case 3: $TY = ARGUS_NODE_SOCK_TYPE_NETWORK; break;
default: $TY = ARGUS_NODE_SOCK_TYPE_SERIAL_PORT; break;
}; };
$MO = COM_MODE_INOUT; $MO = COM_MODE_INOUT;
$QS = "INSERT INTO sockets SET node_id={$NodeID}, aux_id={$CamID}, type={$TY}, mode={$MO}, md5='{$MD5}', name='PTZ Control'"; $QS = "INSERT INTO sockets SET node_id={$NodeID}, aux_id={$CamID}, type={$TY}, mode={$MO}, md5='{$MD5}', name='PTZ Control'";
$DATABASE->Query( $QS, false ); $DATABASE->Query( $QS, false );
}; };
$QS = "UPDATE cameras SET node_id={$NodeID} WHERE id={$CamID}";
$QS = "UPDATE cameras SET protocol_aux='{$PROTOID}', tilt_angles={$TILTANG}, tilt_model={$TILTMODE}, pan_angles={$PANANG}, pan_model={$PANMODE}, node_id={$NodeID}, type={$CCTYPE}, protocol={$PTZ}, uart_id={$UART}, imager_type={$IMSIZE}, min_f={$FMIN}, max_f={$FMAX}, status=2 WHERE id={$CamID}";
$DATABASE->Query( $QS, false ); $DATABASE->Query( $QS, false );
}; };
}; };

2
lib/controller/clearEventCloud.php

@ -1,7 +1,7 @@
<?php <?php
require_once('../ajax_asm.php'); require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){ if( $CUser->Data['id'] > 1 ){
$QS = "INSERT INTO `events_archive` (`node_id`,`uuid`,`ts`,`ts_ms`,`evt_type`,`range_digital`,`azimuth`,`elevation`,`range`,`area`,`lat`,`lon`,`alt`,`custom`) SELECT `node_id`,`uuid`,`ts`,`ts_ms`,`evt_type`,`range_digital`,`azimuth`,`elevation`,`range`,`area`,`lat`,`lon`,`alt`,`custom` FROM `events_cloud`";
$QS = "INSERT INTO `events_archive` (`id`, `node_id`,`uuid`,`ts`,`ts_ms`,`evt_type`,`range_digital`,`azimuth`,`elevation`,`range`,`area`,`lat`,`lon`,`alt`,`ref_id`,`ref_uuid`) SELECT `id`, `node_id`,`uuid`,`ts`,`ts_ms`,`evt_type`,`range_digital`,`azimuth`,`elevation`,`range`,`area`,`lat`,`lon`,`alt`,`ref_id`,`ref_uuid` FROM `events_cloud`";
$DATABASE->Query( $QS, false ); $DATABASE->Query( $QS, false );
$QS = "DELETE FROM events_cloud"; $QS = "DELETE FROM events_cloud";
$DATABASE->Query( $QS, false ); $DATABASE->Query( $QS, false );

10
lib/controller/clearServerLog.php

@ -0,0 +1,10 @@
<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 5 ){
if( $FID = fopen("data/server.log", "r")){
fclose($FID);
};
} else {
header('location: /');
};
?>

24
lib/controller/dash/node_13.js

@ -5,7 +5,7 @@
//columnWidth:.33, //columnWidth:.33,
//layout: 'fit', //layout: 'fit',
width: 258, width: 258,
height: 400,
height: 270,
tools: [{ tools: [{
id:'gear', id:'gear',
handler: function(){ handler: function(){
@ -57,28 +57,6 @@
}), }),
valueField: 'id', valueField: 'id',
displayField: 'label' displayField: 'label'
},{
xtype: 'spacer',
height: 5
},{
xtype: 'button',
text: 'PTZ Control',
width: 244,
listeners:{
mouseover: function( btn, e ){
if( e.buttons ){
alert("KOKO");
};
return false;
},
click: function( btn, e ){
alert("clc");
return true;
}
},
handler: function(){
alert("ptz ");
}
}], }],
listeners:{ listeners:{
afterrender: function( t ){ afterrender: function( t ){

88
lib/controller/dash/node_2.js

@ -0,0 +1,88 @@
{
id: 'db_node_%%%NODEID%%%',
width: 258,
height: 320,
title: '%%%NODENAME%%%',
listeners:{
afterrender: function(){
cleanupDraw( %%%NODEID%%% );
drawZoomLevels[%%%NODEID%%%]=100;
}
},
items:[{
html: '<center><img id="draw_img_%%%NODEID%%%" src="/lib/controller/getDeviceDraw.php?NID=%%%NODEID%%%"><canvas id="targ_canvas_%%%NODEID%%%" style="display: none;" width="200" height="210"></canvas></center>',
height: '260px'
},{
id: 'status_%%%NODEID%%%',
border: true,
frame: true,
height: 36,
html: ''
}],
bbar:[{
xtype: 'button',
text: '12.5%',
enableToggle: true,
id: 'zoom_bt12_%%%NODEID%%%',
toggleGroup: 'zoom_tg_%%%NODEID%%%',
toggleHandler: function( bt, st ){
if( st ){
drawZoomLevels[%%%NODEID%%%]=12;
var img = document.getElementById('draw_img_%%%NODEID%%%');
img.src = "/lib/controller/getDeviceDraw.php?NID=%%%NODEID%%%&AUX=12";
img.onload = function(){
cleanupDraw( %%%NODEID%%% );
};
};
}
},{
xtype: 'button',
text: '25%',
enableToggle: true,
id: 'zoom_bt25_%%%NODEID%%%',
toggleGroup: 'zoom_tg_%%%NODEID%%%',
toggleHandler: function( bt, st ){
if( st ){
drawZoomLevels[%%%NODEID%%%]=25;
var img = document.getElementById('draw_img_%%%NODEID%%%');
img.src = "/lib/controller/getDeviceDraw.php?NID=%%%NODEID%%%&AUX=25";
img.onload = function(){
cleanupDraw( %%%NODEID%%% );
};
};
}
},{
xtype: 'button',
text: '50%',
enableToggle: true,
id: 'zoom_bt50_%%%NODEID%%%',
toggleGroup: 'zoom_tg_%%%NODEID%%%',
toggleHandler: function( bt, st ){
if( st ){
drawZoomLevels[%%%NODEID%%%]=50;
var img = document.getElementById('draw_img_%%%NODEID%%%');
img.src = "/lib/controller/getDeviceDraw.php?NID=%%%NODEID%%%&AUX=50";
img.onload = function(){
cleanupDraw( %%%NODEID%%% );
};
};
}
},{
xtype: 'button',
text: '100%',
pressed: true,
enableToggle: true,
id: 'zoom_bt100_%%%NODEID%%%',
toggleGroup: 'zoom_tg_%%%NODEID%%%',
toggleHandler: function( bt, st ){
if( st ){
drawZoomLevels[%%%NODEID%%%]=100;
var img = document.getElementById('draw_img_%%%NODEID%%%');
img.src = "/lib/controller/getDeviceDraw.php?NID=%%%NODEID%%%&AUX=100";
img.onload = function(){
cleanupDraw( %%%NODEID%%% );
};
};
}
}]
}

39
lib/controller/getCameraSettings.php

@ -0,0 +1,39 @@
<?php
require_once('../ajax_asm.php');
require_once('../php/onvif/toto.php');
require_once('../php/video/zlMediaServerController.php');
$Data = array();
$Data['success'] = false;
if( $CUser->Data['id'] > 1 ){
if( isset( $_POST['CID'] ) ){
$ECID = intval( $_POST['CID'] );
if( $ECID > 0 ){
//Check if Camera Already has password and discovered sources!
$QS = "SELECT * FROM media_streams WHERE source_id={$ECID}";
$Result = $DATABASE->Query($QS,false);
if( count( $Result ) > 0 ){
$QS = "SELECT * FROM cameras WHERE id = {$ECID}";
$Rlt = $DATABASE->Query($QS,false);
$Data['login'] = $Rlt[0]['access_login'];
$Data['password'] = $Rlt[0]['access_pass'];
foreach( $Result as $CD ){
$cnode['id'] = $CD['id'];
$cnode['name'] = $CD['name'];
$cnode['size'] = $CD['img_width'].'x'.$CD['img_height'].'@'.$CD['fps'];
$cnode['encode'] = $CD['compression_type'];
$cnode['bitrate'] = $CD['bitrate'];
//$cnode['pic'] = $CD['picture'];
$Data['nodes'][] = $cnode;
};
$Data['success'] = true;
echo json_encode( $Data );
exit();
};
};
};
} else {
$Data['error']='Access Denied!';
};
echo json_encode( $Data );
?>

123
lib/controller/getDashBoardItems.php

@ -20,74 +20,79 @@
foreach( $result as $R ){ foreach( $result as $R ){
if( isset( $AL[$R['id']] ) ){ if( isset( $AL[$R['id']] ) ){
$COLS[intval($AL[$R['id']]['x'])][intval($AL[$R['id']]['y'])] = $R; $COLS[intval($AL[$R['id']]['x'])][intval($AL[$R['id']]['y'])] = $R;
} else $Z[] = $R;
} else {
$Z[] = $R;
};
}; };
if( count( $Z ) ) foreach( $Z as $z ) $COLS[0][]=$z; if( count( $Z ) ) foreach( $Z as $z ) $COLS[0][]=$z;
$STOL = array(); $STOL = array();
for( $i=0; $i < 4; $i++ ){ for( $i=0; $i < 4; $i++ ){
$index = 0;
$TPL = array();
$STOL[] = array();
if( isset( $COLS[$i] ) )
foreach( $COLS[$i] as $R ){
$TFN = 'dash/node_' . $R['type'] . '.js';
if(!file_exists( $TFN )) continue;
$TPL[$index] = file_get_contents( $TFN );
$TPL[$index] = str_replace('%%%NODEID%%%', ''.$R['id'] , $TPL[$index] );
$TPL[$index] = str_replace('%%%NODENAME%%%', ''.$R['name'] , $TPL[$index] );
switch( $R['type'] ){
case ARGUS_SERVER:{
break;
};
case ARGUS_2D_SENSOR:{
break;
};
case ARGUS_3D_SENSOR:{
break;
};
case ARGUS_IP_PTZ_CAMERA:{
$QS="SELECT * FROM cameras WHERE node_id={$R['id']}";
$Z=$DATABASE->Query( $QS );
$QS="SELECT mss.*, ms.name, ms.img_width, ms.img_height FROM media_server_streams mss LEFT JOIN media_streams ms ON ( mss.media_stream_id = ms.id ) WHERE ms.source_id={$Z[0]['id']} AND mss.valid=1 AND mss.online=1";
$S=$DATABASE->Query( $QS );
$TPL[$index] = str_replace( '%%%NODENAME%%%', urldecode( $Z[0]['name'] ) , $TPL[$index] );
if( count( $S ) ){
$CS = array();
$FID = 0;
$FUL = '';
foreach( $S as $sou ){
$QS = "SELECT * FROM media_servers WHERE id = {$sou['media_server_id']}";
$F = $DATABASE->Query( $QS );
$FF=$F[0];
if( $FF['ip']=='127.0.0.1'){
//Localhost
$FF['ip'] = $_SERVER['SERVER_ADDR'];
$index = 0;
$TPL = array();
$STOL[] = array();
if( isset( $COLS[$i] ) ){
foreach( $COLS[$i] as $R ){
$TFN = 'dash/node_' . $R['type'] . '.js';
if(!file_exists( $TFN )) continue;
$TPL[$index] = file_get_contents( $TFN );
$TPL[$index] = str_replace('%%%NODEID%%%', ''.$R['id'] , $TPL[$index] );
$TPL[$index] = str_replace('%%%NODENAME%%%', ''.$R['name'] , $TPL[$index] );
switch( $R['type'] ){
case ARGUS_SERVER:{
break;
};
case ARGUS_LFS_SENSOR:
case ARGUS_PLS_200_SENSOR:
case ARGUS_PLS_360_SENSOR:{
break;
};
case ARGUS_3D_SENSOR:{
break;
}; };
$ACC_URL='http://' . $FF['ip'] . ':' . $FF['REST_port'];
$CU = str_replace( $FF['virtual_host'], $ACC_URL, $sou['key'] ) . '/hls.m3u8';
if( $FID == 0 ){
// First URL as default
$FID = $sou['id'];
$FUL = $CU;
case ARGUS_IP_PTZ_CAMERA:{
$QS="SELECT * FROM cameras WHERE node_id={$R['id']}";
$Z=$DATABASE->Query( $QS );
$QS="SELECT mss.*, ms.name, ms.img_width, ms.img_height FROM media_server_streams mss LEFT JOIN media_streams ms ON ( mss.media_stream_id = ms.id ) WHERE ms.source_id={$Z[0]['id']} AND mss.valid=1 AND mss.online=1";
$S=$DATABASE->Query( $QS );
$TPL[$index] = str_replace( '%%%NODENAME%%%', urldecode( $Z[0]['name'] ) , $TPL[$index] );
if( count( $S ) ){
$CS = array();
$FID = 0;
$FUL = '';
foreach( $S as $sou ){
$QS = "SELECT * FROM media_servers WHERE id = {$sou['media_server_id']}";
$F = $DATABASE->Query( $QS );
$FF=$F[0];
if( $FF['ip']=='127.0.0.1'){
//Localhost
$FF['ip'] = $_SERVER['SERVER_ADDR'];
};
$ACC_URL='http://' . $FF['ip'] . ':' . $FF['REST_port'];
$CU = str_replace( $FF['virtual_host'], $ACC_URL, $sou['key'] ) . '/hls.m3u8';
if( $FID == 0 ){
// First URL as default
$FID = $sou['id'];
$FUL = $CU;
};
$CS[] = '[' . $sou['id'] . ',\'[' . $sou['img_width'] . 'x' . $sou['img_height'] . '] '. $sou['name'].'\',\'' . $CU .'\']';
};
$TPL[$index] = str_replace( '%%%URLS%%%', '['. implode( ',', $CS ) . ']' , $TPL[$index] );
$TPL[$index] = str_replace( '%%%SELID%%%', 'value: '. $FID .',', $TPL[$index] );
$TPL[$index] = str_replace( '%%%SELURL%%%', $FUL, $TPL[$index] );
} else {
// Handle No Video From Camera!
$TPL[$index] = str_replace( '%%%URLS%%%', '[]' , $TPL[$index] );
$TPL[$index] = str_replace( '%%%SELID%%%', 'value: \'No Video Sources\',', $TPL[$index] );
$TPL[$index] = str_replace( '%%%SELURL%%%','', $TPL[$index] );
};
break;
}; };
$CS[] = '[' . $sou['id'] . ',\'[' . $sou['img_width'] . 'x' . $sou['img_height'] . '] '. $sou['name'].'\',\'' . $CU .'\']';
}; };
$TPL[$index] = str_replace( '%%%URLS%%%', '['. implode( ',', $CS ) . ']' , $TPL[$index] );
$TPL[$index] = str_replace( '%%%SELID%%%', 'value: '. $FID .',', $TPL[$index] );
$TPL[$index] = str_replace( '%%%SELURL%%%', $FUL, $TPL[$index] );
} else {
// Handle No Video From Camera!
$TPL[$index] = str_replace( '%%%URLS%%%', '[]' , $TPL[$index] );
$TPL[$index] = str_replace( '%%%SELID%%%', 'value: \'No Video Sources\',', $TPL[$index] );
$TPL[$index] = str_replace( '%%%SELURL%%%','', $TPL[$index] );
$index++;
}; };
break;
}; };
};
$index++;
};
//if( $i == 0 ) $TPL[] = '{ id: \'db_node_22311232\', frame: false, colspan: 2, width: 516, height: 200, border: true, title: \'PIZDA\', items:[{ html: \'<p>Server</p>\'}]}';
$STOL[$i] = $P1 . implode( ',', $TPL ) . $P2;
//if( $i == 0 ) $TPL[] = '{ id: \'db_node_22311232\', frame: false, colspan: 2, width: 516, height: 200, border: true, title: \'PIZDA\', items:[{ html: \'<p>Server</p>\'}]}';
$STOL[$i] = $P1 . implode( ',', $TPL ) . $P2;
}; };
$Data = '[' . implode( ',' , $STOL ) . ']'; $Data = '[' . implode( ',' , $STOL ) . ']';
}; };

14
lib/controller/getDashBoardStatus.php

@ -13,15 +13,19 @@
$CN['id'] = $R['id']; $CN['id'] = $R['id'];
$CN['status'] = intval($R['online']); $CN['status'] = intval($R['online']);
switch( $R['type'] ){ switch( $R['type'] ){
case ARGUS_SERVER:{
case ARGUS_SERVER:{
break; break;
}; };
case 3:
case ARGUS_2D_SENSOR:{
case ARGUS_ALS_SENSOR:
case ARGUS_LFS_SENSOR:
case ARGUS_PLS_200_SENSOR:
case ARGUS_PLS_360_SENSOR:
case ARGUS_NET_PLS_200:{
if( $CN['status'] ){ if( $CN['status'] ){
// check Targets // check Targets
$CN['targets'] = array(); $CN['targets'] = array();
$QS="SELECT * FROM events_cloud WHERE node_id={$CN['id']} AND ( evt_type=13 OR evt_type=14) AND (UNIX_TIMESTAMP(NOW())-ts)<60 ORDER BY id DESC LIMIT 32";
$QS="SELECT * FROM events_cloud WHERE node_id={$CN['id']} AND ( evt_type=13 OR evt_type=14) ORDER BY id DESC LIMIT 32";
//$QS="SELECT * FROM events_cloud WHERE node_id={$CN['id']} AND ( evt_type=13 OR evt_type=14) AND (UNIX_TIMESTAMP(NOW())-ts)<60 ORDER BY id DESC LIMIT 32";
//$QS="SELECT * FROM events_cloud WHERE node_id={$CN['id']} AND ( evt_type=13 OR evt_type=14) ORDER BY ts, ts_ms DESC LIMIT 32"; //$QS="SELECT * FROM events_cloud WHERE node_id={$CN['id']} AND ( evt_type=13 OR evt_type=14) ORDER BY ts, ts_ms DESC LIMIT 32";
//echo $QS . "\n\n"; //echo $QS . "\n\n";
$zult = $DATABASE->Query( $QS ); $zult = $DATABASE->Query( $QS );
@ -44,7 +48,7 @@
break; break;
}; };
}; };
$index++;
//$index++;
$Data['nodes'][] = $CN; $Data['nodes'][] = $CN;
}; };
}; };

411
lib/controller/getDeviceDraw.php

@ -1,219 +1,220 @@
<?php <?php
require_once('../ajax_asm.php'); require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){ if( $CUser->Data['id'] > 1 ){
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Content-Type: image/png");
if(isset( $_POST['NID'] )){
$NID = intval($_POST['NID']);
} else {
$NID = intval($_GET['NID']);
};
if(isset( $_POST['AUX'] )){
$AUX = intval($_POST['AUX']);
} else {
$AUX = intval($_GET['AUX']);
};
$QS = "SELECT * FROM lrf_draw WHERE node_id={$NID} ORDER BY ts DESC LIMIT 1";
$Result = $DATABASE->Query( $QS, false );
if( count( $Result ) ){
if( $Result[0]['rendered'] == 'Y' ){
if( $AUX ){
$FN = "data/{$Result[0]['md5']}_{$AUX}.png";
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Content-Type: image/png");
if(isset( $_POST['NID'] )){
$NID = intval($_POST['NID']);
} else { } else {
$FN = "data/{$Result[0]['md5']}_100.png";
$NID = intval($_GET['NID']);
}; };
} else {
$FF = "data/{$Result[0]['md5']}.raw";
$FN = "ddd";
if( file_exists( $FF ) ) {
$FD = fopen( $FF, "rb" );
if( $FD ){
$CL = fread( $FD, 4 );
$size = unpack( "V", $CL );
$pts = array();
$as = $size[1];
for($i=0; $i< $as; $i++ ){
$CL = fread( $FD, 4 );
$T = unpack( "V", $CL );
//print_r( $T );
$pts[] = $T[1] >> 16;
};
fclose( $FD );
$QS = "SELECT ls.base_shift, ls.max_range FROM nodes ns LEFT JOIN lrf_sensors ls ON ( ls.id=ns.aux_id ) WHERE ns.id={$NID}";
$PP = $DATABASE->Query( $QS );
$stp = 2.0 * ( M_PI / $as );
$MR = intval( $PP[0]['max_range'] );
$S = ( M_PI / 3000.0 ) * intval( $PP[0]['base_shift'] );
if(isset( $_POST['AUX'] )){
$AUX = intval($_POST['AUX']);
} elseif( isset($_GET['AUX']) ) {
$AUX = intval($_GET['AUX']);
} else $AUX = 0;
$IM = imagecreatefrompng("../../style/assets/lfs_draw_empty_100.png");
imagesavealpha( $IM, true );
$bg = imagecolorallocate($IM, 0, 0, 0);
$black = imagecolorallocate($IM, 255, 255, 0);
//$green = imagecolorallocate($IM, 0, 255, 0);
$green = imagecolorallocatealpha( $IM, 0, 255, 0, 64 );
imagefilledrectangle( $IM, 5, 5, 36, 18, $bg );
imagestring( $IM, 2, 6, 5, $MR . "m.", $black );
$maxR = 98.0;
$rst = $maxR / 1025.0;
$x0 = 100;
$y0 = 100;
$ppA = array();
$ppB = array();
for( $i=0; $i< $as; $i++ ){
if( $pts[$i] > 0 ){
$cr = ($rst * $pts[$i]);
$ca = 0.0 - ( $S + $i * $stp );
$ppA[] = $x0 + $cr * cos( $ca );
$ppA[] = $y0 + $cr * sin( $ca );
$ppB[] = $x0 + $maxR * cos( $ca );
$ppB[] = $y0 + $maxR * sin( $ca );
} else {
$ca = 0.0 - ( $S + $i * $stp );
$ppA[] = $x0 + $maxR * cos( $ca );
$ppA[] = $y0 + $maxR * sin( $ca );
$ppB[] = $x0 + $maxR * cos( $ca );
$ppB[] = $y0 + $maxR * sin( $ca );
};
};
$ppB[] = $ppA[count($ppA)-2];
$ppB[] = $ppA[count($ppA)-1];
$popo = array_merge( $ppA, $ppB );
imagefilledpolygon( $IM, $popo, count( $popo ) / 2, $green );
imagepng( $IM, "data/{$Result[0]['md5']}_100.png" );
imagedestroy( $IM );
$IM = imagecreatefrompng("../../style/assets/lfs_draw_empty_50.png");
imagesavealpha( $IM, true );
$bg = imagecolorallocate($IM, 0, 0, 0);
$black = imagecolorallocate($IM, 255, 255, 0);
//$green = imagecolorallocate($IM, 0, 255, 0);
$green = imagecolorallocatealpha( $IM, 0, 255, 0, 64 );
imagefilledrectangle( $IM, 5, 5, 36, 18, $bg );
imagestring( $IM, 2, 6, 5, ( $MR / 2 ) . "m.", $black );
$rst = $maxR / 513.0;
$ppA = array();
$ppB = array();
for( $i=0; $i< $as; $i++ ){
if( $pts[$i] > 0 && $pts[$i] < 513 ){
$cr = ($rst * $pts[$i]);
$ca = 0.0 - ( $S + $i * $stp );
$ppA[] = $x0 + $cr * cos( $ca );
$ppA[] = $y0 + $cr * sin( $ca );
$ppB[] = $x0 + $maxR * cos( $ca );
$ppB[] = $y0 + $maxR * sin( $ca );
} else {
$ca = 0.0 - ( $S + $i * $stp );
$ppA[] = $x0 + $maxR * cos( $ca );
$ppA[] = $y0 + $maxR * sin( $ca );
$ppB[] = $x0 + $maxR * cos( $ca );
$ppB[] = $y0 + $maxR * sin( $ca );
};
};
$ppB[] = $ppA[count($ppA)-2];
$ppB[] = $ppA[count($ppA)-1];
$popo = array_merge( $ppA, $ppB );
imagefilledpolygon( $IM, $popo, count( $popo ) / 2, $green );
imagepng( $IM, "data/{$Result[0]['md5']}_50.png" );
imagedestroy( $IM );
$IM = imagecreatefrompng("../../style/assets/lfs_draw_empty_25.png");
imagesavealpha( $IM, true );
$bg = imagecolorallocate($IM, 0, 0, 0);
$black = imagecolorallocate($IM, 255, 255, 0);
//$green = imagecolorallocate($IM, 0, 255, 0);
$green = imagecolorallocatealpha( $IM, 0, 255, 0, 64 );
imagefilledrectangle( $IM, 5, 5, 36, 18, $bg );
imagestring( $IM, 2, 6, 5, ( $MR / 4 ) . "m.", $black );
$rst = $maxR / 257.0;
$ppA = array();
$ppB = array();
for( $i=0; $i< $as; $i++ ){
if( $pts[$i] > 0 && $pts[$i] < 256 ){
$cr = ($rst * $pts[$i]);
$ca = 0.0 - ( $S + $i * $stp );
$ppA[] = $x0 + $cr * cos( $ca );
$ppA[] = $y0 + $cr * sin( $ca );
$ppB[] = $x0 + $maxR * cos( $ca );
$ppB[] = $y0 + $maxR * sin( $ca );
} else {
$ca = 0.0 - ( $S + $i * $stp );
$ppA[] = $x0 + $maxR * cos( $ca );
$ppA[] = $y0 + $maxR * sin( $ca );
$ppB[] = $x0 + $maxR * cos( $ca );
$ppB[] = $y0 + $maxR * sin( $ca );
};
};
$ppB[] = $ppA[count($ppA)-2];
$ppB[] = $ppA[count($ppA)-1];
$popo = array_merge( $ppA, $ppB );
imagefilledpolygon( $IM, $popo, count( $popo ) / 2, $green );
imagepng( $IM, "data/{$Result[0]['md5']}_25.png" );
imagedestroy( $IM );
$IM = imagecreatefrompng("../../style/assets/lfs_draw_empty_12.png");
imagesavealpha( $IM, true );
$bg = imagecolorallocate($IM, 0, 0, 0);
$black = imagecolorallocate($IM, 255, 255, 0);
//$green = imagecolorallocate($IM, 0, 255, 0);
$green = imagecolorallocatealpha( $IM, 0, 255, 0, 64 );
imagefilledrectangle( $IM, 5, 5, 36, 18, $bg );
imagestring( $IM, 2, 6, 5, ( $MR / 8 ) . "m.", $black );
$rst = $maxR / 129.0;
$ppA = array();
$ppB = array();
for( $i=0; $i< $as; $i++ ){
if( $pts[$i] > 0 && $pts[$i] < 128 ){
$cr = ($rst * $pts[$i]);
$ca = 0.0 - ( $S + $i * $stp );
$ppA[] = $x0 + $cr * cos( $ca );
$ppA[] = $y0 + $cr * sin( $ca );
$ppB[] = $x0 + $maxR * cos( $ca );
$ppB[] = $y0 + $maxR * sin( $ca );
} else {
$ca = 0.0 - ( $S + $i * $stp );
$ppA[] = $x0 + $maxR * cos( $ca );
$ppA[] = $y0 + $maxR * sin( $ca );
$ppB[] = $x0 + $maxR * cos( $ca );
$ppB[] = $y0 + $maxR * sin( $ca );
};
$QS = "SELECT * FROM lrf_draw WHERE node_id={$NID} ORDER BY ts DESC LIMIT 1";
$Result = $DATABASE->Query( $QS, false );
if( count( $Result ) ){
if( $Result[0]['rendered'] == 'Y' ){
if( $AUX ){
$FN = "data/device_draws/{$Result[0]['md5']}_{$AUX}.png";
} else {
$FN = "data/device_draws/{$Result[0]['md5']}_100.png";
};
} else {
$FF = "data/device_draws/{$Result[0]['md5']}.raw";
$FN = "ddd";
if( file_exists( $FF ) ) {
$FD = fopen( $FF, "rb" );
if( $FD ){
$CL = fread( $FD, 4 );
$size = unpack( "V", $CL );
$pts = array();
$as = $size[1];
for($i=0; $i< $as; $i++ ){
$CL = fread( $FD, 4 );
$T = unpack( "V", $CL );
//print_r( $T );
$pts[] = $T[1] >> 16;
};
fclose( $FD );
$QS = "SELECT ls.base_shift, ls.max_range FROM nodes ns LEFT JOIN lrf_sensors ls ON ( ls.id=ns.aux_id ) WHERE ns.id={$NID}";
$PP = $DATABASE->Query( $QS );
$stp = 2.0 * ( M_PI / $as );
$MR = intval( $PP[0]['max_range'] );
$S = ( M_PI / 3000.0 ) * intval( $PP[0]['base_shift'] );
$IM = imagecreatefrompng("../../style/assets/lfs_draw_empty_100.png");
imagesavealpha( $IM, true );
$bg = imagecolorallocate($IM, 0, 0, 0);
$black = imagecolorallocate($IM, 255, 255, 0);
//$green = imagecolorallocate($IM, 0, 255, 0);
$green = imagecolorallocatealpha( $IM, 0, 64, 0, 64 );
imagefilledrectangle( $IM, 5, 5, 36, 18, $bg );
imagestring( $IM, 2, 6, 5, $MR . "m.", $black );
$maxR = 98.0;
$rst = $maxR / 1025.0;
$x0 = 100;
$y0 = 100;
$ppA = array();
$ppB = array();
for( $i=0; $i< $as; $i++ ){
if( $pts[$i] > 0 ){
$cr = ($rst * $pts[$i]);
$ca = 0.0 - ( $S + $i * $stp );
$ppA[] = $x0 + $cr * cos( $ca );
$ppA[] = $y0 + $cr * sin( $ca );
$ppB[] = $x0 + $maxR * cos( $ca );
$ppB[] = $y0 + $maxR * sin( $ca );
} else {
$ca = 0.0 - ( $S + $i * $stp );
$ppA[] = $x0 + $maxR * cos( $ca );
$ppA[] = $y0 + $maxR * sin( $ca );
$ppB[] = $x0 + $maxR * cos( $ca );
$ppB[] = $y0 + $maxR * sin( $ca );
};
};
$ppB[] = $ppA[count($ppA)-2];
$ppB[] = $ppA[count($ppA)-1];
$popo = array_merge( $ppA, $ppB );
imagefilledpolygon( $IM, $popo, count( $popo ) / 2, $green );
imagepng( $IM, "data/device_draws/{$Result[0]['md5']}_100.png" );
imagedestroy( $IM );
$IM = imagecreatefrompng("../../style/assets/lfs_draw_empty_50.png");
imagesavealpha( $IM, true );
$bg = imagecolorallocate($IM, 0, 0, 0);
$black = imagecolorallocate($IM, 255, 255, 0);
//$green = imagecolorallocate($IM, 0, 255, 0);
$green = imagecolorallocatealpha( $IM, 0, 64, 0, 64 );
imagefilledrectangle( $IM, 5, 5, 36, 18, $bg );
imagestring( $IM, 2, 6, 5, ( $MR / 2 ) . "m.", $black );
$rst = $maxR / 513.0;
$ppA = array();
$ppB = array();
for( $i=0; $i< $as; $i++ ){
if( $pts[$i] > 0 && $pts[$i] < 513 ){
$cr = ($rst * $pts[$i]);
$ca = 0.0 - ( $S + $i * $stp );
$ppA[] = $x0 + $cr * cos( $ca );
$ppA[] = $y0 + $cr * sin( $ca );
$ppB[] = $x0 + $maxR * cos( $ca );
$ppB[] = $y0 + $maxR * sin( $ca );
} else {
$ca = 0.0 - ( $S + $i * $stp );
$ppA[] = $x0 + $maxR * cos( $ca );
$ppA[] = $y0 + $maxR * sin( $ca );
$ppB[] = $x0 + $maxR * cos( $ca );
$ppB[] = $y0 + $maxR * sin( $ca );
};
};
$ppB[] = $ppA[count($ppA)-2];
$ppB[] = $ppA[count($ppA)-1];
$popo = array_merge( $ppA, $ppB );
imagefilledpolygon( $IM, $popo, count( $popo ) / 2, $green );
imagepng( $IM, "data/device_draws/{$Result[0]['md5']}_50.png" );
imagedestroy( $IM );
$IM = imagecreatefrompng("../../style/assets/lfs_draw_empty_25.png");
imagesavealpha( $IM, true );
$bg = imagecolorallocate($IM, 0, 0, 0);
$black = imagecolorallocate($IM, 255, 255, 0);
//$green = imagecolorallocate($IM, 0, 255, 0);
$green = imagecolorallocatealpha( $IM, 0, 64, 0, 64 );
imagefilledrectangle( $IM, 5, 5, 36, 18, $bg );
imagestring( $IM, 2, 6, 5, ( $MR / 4 ) . "m.", $black );
$rst = $maxR / 257.0;
$ppA = array();
$ppB = array();
for( $i=0; $i< $as; $i++ ){
if( $pts[$i] > 0 && $pts[$i] < 256 ){
$cr = ($rst * $pts[$i]);
$ca = 0.0 - ( $S + $i * $stp );
$ppA[] = $x0 + $cr * cos( $ca );
$ppA[] = $y0 + $cr * sin( $ca );
$ppB[] = $x0 + $maxR * cos( $ca );
$ppB[] = $y0 + $maxR * sin( $ca );
} else {
$ca = 0.0 - ( $S + $i * $stp );
$ppA[] = $x0 + $maxR * cos( $ca );
$ppA[] = $y0 + $maxR * sin( $ca );
$ppB[] = $x0 + $maxR * cos( $ca );
$ppB[] = $y0 + $maxR * sin( $ca );
};
};
$ppB[] = $ppA[count($ppA)-2];
$ppB[] = $ppA[count($ppA)-1];
$popo = array_merge( $ppA, $ppB );
imagefilledpolygon( $IM, $popo, count( $popo ) / 2, $green );
imagepng( $IM, "data/device_draws/{$Result[0]['md5']}_25.png" );
imagedestroy( $IM );
$IM = imagecreatefrompng("../../style/assets/lfs_draw_empty_12.png");
imagesavealpha( $IM, true );
$bg = imagecolorallocate($IM, 0, 0, 0);
$black = imagecolorallocate($IM, 255, 255, 0);
//$green = imagecolorallocate($IM, 0, 255, 0);
$green = imagecolorallocatealpha( $IM, 0, 64, 0, 64 );
imagefilledrectangle( $IM, 5, 5, 36, 18, $bg );
imagestring( $IM, 2, 6, 5, ( $MR / 8 ) . "m.", $black );
$rst = $maxR / 129.0;
$ppA = array();
$ppB = array();
for( $i=0; $i< $as; $i++ ){
if( $pts[$i] > 0 && $pts[$i] < 128 ){
$cr = ($rst * $pts[$i]);
$ca = 0.0 - ( $S + $i * $stp );
$ppA[] = $x0 + $cr * cos( $ca );
$ppA[] = $y0 + $cr * sin( $ca );
$ppB[] = $x0 + $maxR * cos( $ca );
$ppB[] = $y0 + $maxR * sin( $ca );
} else {
$ca = 0.0 - ( $S + $i * $stp );
$ppA[] = $x0 + $maxR * cos( $ca );
$ppA[] = $y0 + $maxR * sin( $ca );
$ppB[] = $x0 + $maxR * cos( $ca );
$ppB[] = $y0 + $maxR * sin( $ca );
};
};
$ppB[] = $ppA[count($ppA)-2];
$ppB[] = $ppA[count($ppA)-1];
$popo = array_merge( $ppA, $ppB );
imagefilledpolygon( $IM, $popo, count( $popo ) / 2, $green );
imagepng( $IM, "data/device_draws/{$Result[0]['md5']}_12.png" );
imagedestroy( $IM );
$QS = "UPDATE lrf_draw SET rendered='Y' WHERE id={$Result[0]['id']}";
$DATABASE->Query( $QS );
if( $AUX ){
$FN = "data/device_draws/{$Result[0]['md5']}_{$AUX}.png";
} else {
$FN = "data/device_draws/{$Result[0]['md5']}_100.png";
};
};
} else {
echo "No Res"; exit();
if( $AUX ){
$FN = "../../style/assets/lfs_draw_empty_{$AUX}.png";
} else {
$FN = "../../style/assets/lfs_draw_empty_100.png";
};
};
}; };
$ppB[] = $ppA[count($ppA)-2];
$ppB[] = $ppA[count($ppA)-1];
$popo = array_merge( $ppA, $ppB );
imagefilledpolygon( $IM, $popo, count( $popo ) / 2, $green );
imagepng( $IM, "data/{$Result[0]['md5']}_12.png" );
imagedestroy( $IM );
$QS = "UPDATE lrf_draw SET rendered='Y' WHERE id={$Result[0]['id']}";
$DATABASE->Query( $QS );
if( !file_exists( $FN ) ) $FN = "../../style/assets/lfs_draw_empty_100.png";
readfile( $FN );
} else {
if( $AUX ){ if( $AUX ){
$FN = "data/{$Result[0]['md5']}_{$AUX}.png";
$FN = "../../style/assets/lfs_draw_empty_{$AUX}.png";
} else { } else {
$FN = "data/{$Result[0]['md5']}_100.png";
$FN = "../../style/assets/lfs_draw_empty_100.png";
}; };
};
} else {
echo "No Res"; exit();
if( $AUX ){
$FN = "../../style/assets/lfs_draw_empty_{$AUX}.png";
} else {
$FN = "../../style/assets/lfs_draw_empty_100.png";
};
if( !file_exists( $FN ) ) $FN = "../../style/assets/lfs_draw_empty_100.png";
readfile( $FN );
}; };
};
if( !file_exists( $FN ) ) $FN = "../../style/assets/lfs_draw_empty_100.png";
readfile( $FN );
} else {
if( $AUX ){
$FN = "../../style/assets/lfs_draw_empty_{$AUX}.png";
} else {
$FN = "../../style/assets/lfs_draw_empty_100.png";
};
if( !file_exists( $FN ) ) $FN = "../../style/assets/lfs_draw_empty_100.png";
readfile( $FN );
};
} else { } else {
header('location: /');
header('location: /');
}; };
?> ?>

32
lib/controller/getEventProps.php

@ -10,8 +10,7 @@
$RR = $DATABASE->Query( $QS ); $RR = $DATABASE->Query( $QS );
$CC = $RR[0]; $CC = $RR[0];
$Type = intval( $Props['type'] ); $Type = intval( $Props['type'] );
$TName = 'props/event_prop.js';
$Data = file_get_contents( $TName );
$Data = file_get_contents( 'props/event_prop.js' );
$Data = str_replace('%%%NODEID%%%', $Props['node_id'], $Data ); $Data = str_replace('%%%NODEID%%%', $Props['node_id'], $Data );
$Data = str_replace('%%%TYPE%%%', $CC['type'], $Data ); $Data = str_replace('%%%TYPE%%%', $CC['type'], $Data );
$Data = str_replace('%%%NAME%%%', $CC['name'], $Data ); $Data = str_replace('%%%NAME%%%', $CC['name'], $Data );
@ -21,9 +20,36 @@
$Data = str_replace('%%%LON%%%', sprintf( "%0.8f", $Props['lon']), $Data ); $Data = str_replace('%%%LON%%%', sprintf( "%0.8f", $Props['lon']), $Data );
$Data = str_replace('%%%LAT%%%', sprintf( "%0.8f", $Props['lat']), $Data ); $Data = str_replace('%%%LAT%%%', sprintf( "%0.8f", $Props['lat']), $Data );
$Data = str_replace('%%%ALT%%%', sprintf( "%0.1f", $Props['alt']), $Data ); $Data = str_replace('%%%ALT%%%', sprintf( "%0.1f", $Props['alt']), $Data );
$QS="SELECT * FROM events_video_records WHERE evt_id={$EID}";
$VDD = $DATABASE->Query( $QS );
if( count( $VDD ) ){
$O = array();
$VTPL = file_get_contents( 'props/event_video.js' );
foreach( $VDD as $VD ){
//$QS="SELECT * FROM video_records WHERE id={$VD['video_id']}";
//$RRR = $DATABASE->Query( $QS );
//$P = '/lib/controller/data/videos/'.substr( $RRR[0]['md5'], 0, 2 ).'/'.substr( $RRR[0]['md5'], 2, 2 ).'/'.$RRR[0]['md5'].'.m3u8';
$P = "/lib/controller/getM3U8.php?VID={$VD['video_id']}";
$TT = $VTPL;
//$TT = str_replace('%%%HLSID%%%',$RRR[0]['md5'],$TT);
$TT = str_replace('%%%HLSID%%%','HLS_' . $VD['video_id'],$TT);
$TT = str_replace('%%%HLSSRC%%%',$P,$TT);
$OFFSET = 0;//intval($VD['offset']);
if( $OFFSET > 0 ) {
$EVTEND = $OFSET+5;
$TT = str_replace('%%%HLSOFFSET%%%',"t.plr.offset({ start: {$OFFSET}, end: {$EVTEND}, restart_beginning: true });",$TT);
} else {
$TT = str_replace('%%%HLSOFFSET%%%',"t.plr.offset({ start: 0, end: 5, restart_beginning: true });",$TT);
};
$O[]=$TT;
};
$Data = str_replace('%%%VIDEOSECTION%%%', implode( ',', $O ), $Data );
} else {
$Data = str_replace('%%%VIDEOSECTION%%%', '{ xtype: \'panel\', html: \'&nbsp;\' }', $Data );
};
echo $Data; echo $Data;
} else { } else {
echo '{ html: \'Node '.$_POST['NODE'].' Loadded\'}';
echo '{ xtype: \'panel\', html: \'Node '.$_POST['NODE'].' Loadded\'}';
}; };
} else { } else {
header('location: /'); header('location: /');

2
lib/controller/getEventRecords.php

@ -16,7 +16,7 @@
}; };
if( $CUser->Data['id'] > 1 ){ if( $CUser->Data['id'] > 1 ){
$Data = array(); $Data = array();
$GID = intval($_POST['NID']);
$GID = intval($_POST['SITE']);
$QS = "SELECT * FROM events_cloud ORDER BY id DESC LIMIT 20"; $QS = "SELECT * FROM events_cloud ORDER BY id DESC LIMIT 20";
$Result = $DATABASE->Query( $QS, false ); $Result = $DATABASE->Query( $QS, false );
date_default_timezone_set('UTC'); date_default_timezone_set('UTC');

62
lib/controller/getGeoAlerts.php

@ -0,0 +1,62 @@
<?php
require_once('../ajax_asm.php');
require_once('../php/utm/gPoint.php');
if( $CUser->Data['id'] > 1 ){
$Data = array();
$Data['evt'] = array();
$Data['other'] = array();
$SID = intval($_POST['SITE']);
//$QS = "SELECT ec.id, ec.lon, ec.lat, ls.lon as src_lon, ls.lat as src_lat, ls.max_range as max_range FROM events_cloud ec LEFT JOIN nodes nd ON ( nd.id = ec.node_id ) LEFT JOIN lrf_sensors ls ON ( ls.id = nd.aux_id ) WHERE ec.lat IS NOT NULL AND ec.lon IS NOT NULL ORDER BY ec.ts DESC, ec.ts_ms DESC LIMIT 20";
$QS = "SELECT ec.id, ec.lon, ec.lat FROM events_cloud ec WHERE ec.lat IS NOT NULL AND ec.lon IS NOT NULL ORDER BY ec.ts DESC, ec.ts_ms DESC LIMIT 20";
$Result = $DATABASE->Query( $QS, false );
date_default_timezone_set('UTC');
//foreach( array_reverse ( $Result ) as $CD ){
foreach( $Result as $CD ){
$Data['evt'][] = $CD;
};
$QS = "SELECT * FROM target_filters WHERE site_id={$SID}";
$Result = $DATABASE->Query( $QS, false );
foreach( $Result as $R ){
switch( $R['type'] ){
case 1:{
//APF
$QS = "SELECT * FROM `target_filter_apf` WHERE `id`={$R['aux_id']}";
$Juno = $DATABASE->Query( $QS, false );
if( count( $Juno ) ){
$CC = $Juno[0];
$A = new gPoint();
$A->setLongLat($CC['lon'],$CC['lat']);
$A->convertLLtoTM();
$XC = $A->E();
$YC = $A->N();
$Z = $A->Z();
$ANG = (pi()/180)*floatval( $CC['yaw'] );
$QS = "SELECT * FROM `target_filter_apf_boxes` WHERE `filter_id`={$R['aux_id']}";
$Obubu = $DATABASE->Query( $QS, false );
foreach( $Obubu as $G ){
$P['type']='circle';
$P['color']='#00FF00';
$TX = floatval($G['x']);
$TY = floatval($G['y']);
$CR = sqrt($TX*$TX+$TY*$TY);
if( $TX != 0 ){
$CA = atan( $TY/$TX );
} else {
$CA = 0;
};
$A->setUTM($XC+$CR*cos($CA+$ANG),$YC+$CR*sin($CA+$ANG),$Z);
$A->convertTMtoLL();
$P['loc']=array('lat'=>$A->Lat(),'lon'=>$A->Long());
$Data['other'][] = $P;
};
};
break;
};
};
};
echo json_encode( $Data );
} else {
header('location: /');
};
?>

456
lib/controller/getGeoZones.php

@ -0,0 +1,456 @@
<?php
require_once('../ajax_asm.php');
require_once('../php/utm/gPoint.php');
/*
function ToLL($north, $east, $utmZone){
// This is the lambda knot value in the reference
$LngOrigin = Deg2Rad($utmZone * 6 - 183);
// The following set of class constants define characteristics of the
// ellipsoid, as defined my the WGS84 datum. These values need to be
// changed if a different dataum is used.
$FalseNorth = 0; // South or North?
//if (lat < 0.) FalseNorth = 10000000. // South or North?
//else FalseNorth = 0.
$Ecc = 0.081819190842622; // Eccentricity
$EccSq = $Ecc * $Ecc;
$Ecc2Sq = $EccSq / (1. - $EccSq);
$Ecc2 = sqrt($Ecc2Sq); // Secondary eccentricity
$E1 = ( 1 - sqrt(1-$EccSq) ) / ( 1 + sqrt(1-$EccSq) );
$E12 = $E1 * $E1;
$E13 = $E12 * $E1;
$E14 = $E13 * $E1;
$SemiMajor = 6378137.0; // Ellipsoidal semi-major axis (Meters)
$FalseEast = 500000.0; // UTM East bias (Meters)
$ScaleFactor = 0.9996; // Scale at natural origin
// Calculate the Cassini projection parameters
$M1 = ($north - $FalseNorth) / $ScaleFactor;
$Mu1 = $M1 / ( $SemiMajor * (1 - $EccSq/4.0 - 3.0*$EccSq*$EccSq/64.0 - 5.0*$EccSq*$EccSq*$EccSq/256.0) );
$Phi1 = $Mu1 + (3.0*$E1/2.0 - 27.0*$E13/32.0) * sin(2.0*$Mu1);
+ (21.0*$E12/16.0 - 55.0*$E14/32.0) * sin(4.0*$Mu1);
+ (151.0*$E13/96.0) * sin(6.0*$Mu1);
+ (1097.0*$E14/512.0) * sin(8.0*$Mu1);
$sin2phi1 = sin($Phi1) * sin($Phi1);
$Rho1 = ($SemiMajor * (1.0-$EccSq) ) / pow(1.0-$EccSq*$sin2phi1,1.5);
$Nu1 = $SemiMajor / sqrt(1.0-$EccSq*$sin2phi1);
// Compute parameters as defined in the POSC specification. T, C and D
$T1 = tan($Phi1) * tan($Phi1);
$T12 = $T1 * $T1;
$C1 = $Ecc2Sq * cos($Phi1) * cos($Phi1);
$C12 = $C1 * $C1;
$D = ($east - $FalseEast) / ($ScaleFactor * $Nu1);
$D2 = $D * $D;
$D3 = $D2 * $D;
$D4 = $D3 * $D;
$D5 = $D4 * $D;
$D6 = $D5 * $D;
// Compute the Latitude and Longitude and convert to degrees
$lat = $Phi1 - $Nu1*tan($Phi1)/$Rho1 * ( $D2/2.0 - (5.0 + 3.0*$T1 + 10.0*$C1 - 4.0*$C12 - 9.0*$Ecc2Sq)*$D4/24.0 + (61.0 + 90.0*$T1 + 298.0*$C1 + 45.0*$T12 - 252.0*$Ecc2Sq - 3.0*$C12)*$D6/720.0 );
$lat = Rad2Deg($lat);
$lon = $LngOrigin + ($D - (1.0 + 2.0*$T1 + $C1)*$D3/6.0 + (5.0 - 2.0*$C1 + 28.0*$T1 - 3.0*$C12 + 8.0*$Ecc2Sq + 24.0*$T12)*$D5/120.0) / cos($Phi1);
$lon = Rad2Deg($lon);
// Create a object to store the calculated Latitude and Longitude values
$PC_LatLon['lat'] = $lat;
$PC_LatLon['lon'] = $lon;
// Returns a PC_LatLon object
return $PC_LatLon;
};
$Z = new gPoint();
$Z->setUTM( 485962.4143066, 4919314.7793823, '32T' );
$Z->convertTMtoLL();
$Z->printUTM();
echo "\n\n";
$Z->printLatLong();
echo "\n\n";
exit();
*/
if( $CUser->Data['id'] > 1 ){
$Data = array();
$SID = intval( $_POST['SITE'] );
if( $SID ){
$QS = "SELECT * FROM nodes WHERE site_id={$SID} AND NOT ((type=0)OR(type=20))";
$Result = $DATABASE->Query( $QS, false );
date_default_timezone_set('UTC');
foreach( $Result as $R ){
switch( $R['type'] ){
case 2:{
// Lfs - MND
$QS = "SELECT lat, lon, yaw, roll, pitch, max_range FROM lrf_sensors WHERE id={$R['aux_id']}";
$D = $DATABASE->Query( $QS, false );
if( count( $D ) ){
$CC = $D[0];
$A = new gPoint();
$A->setLongLat($CC['lon'],$CC['lat']);
$A->convertLLtoTM();
$XC = $A->E();
$YC = $A->N();
$Z = $A->Z();
$RAN = floatval( $CC['max_range'] );
if( 1 ){
$K = pi()/18.0;//10 deg
$Points = array();
$Points[] = array('lat'=>$CC['lat'],'lon'=>$CC['lon']);
$SANG = ( pi() / 180 ) * floatval( $CC['yaw'] );
for( $i = 0; $i < 11; $i++ ){
$CA = $i * $K;
$B = new gPoint();
$B->setUTM( $XC + $RAN * cos( $SANG + $CA ), $YC + $RAN * sin( $SANG + $CA ), $Z );
$B->convertTMtoLL();
$Points[]=array('lat'=>$B->Lat(),'lon'=>$B->Long());
};
if(1){
$ZMARK = array();
$B = new gPoint();
//$RAN = $RAN - 0.5;
$B->setUTM( $XC + $RAN * cos( $SANG ), $YC + $RAN * sin( $SANG ), $Z );
$B->convertTMtoLL();
$ZMARK=array('lat'=>$B->Lat(),'lon'=>$B->Long());
//$SANG = $SANG - ( pi() / 180 );
//$RAN = $RAN + 0.5;
//$B->setUTM( $XC + $RAN * cos( $SANG ), $YC + $RAN * sin( $SANG ), $Z );
//$B->convertTMtoLL();
//$ZMARK[]=array('lat'=>$B->Lat(),'lon'=>$B->Long());
//$SANG = $SANG + ( pi() / 180 );
//$RAN = $RAN + 0.5;
//$B->setUTM( $XC + $RAN * cos( $SANG ), $YC + $RAN * sin( $SANG ), $Z );
//$B->convertTMtoLL();
//$ZMARK[]=array('lat'=>$B->Lat(),'lon'=>$B->Long());
//$SANG = $SANG + ( pi() / 180 );
//$RAN = $RAN - 0.5;
//$B->setUTM( $XC + $RAN * cos( $SANG ), $YC + $RAN * sin( $SANG ), $Z );
//$B->convertTMtoLL();
//$ZMARK[]=array('lat'=>$B->Lat(),'lon'=>$B->Long());
$Zone['zang'] = $ZMARK;
}
$Zone['type']='poly';
$Zone['points']=$Points;
$Zone['color'] = '#880000';
$Zone['center'] = array('lat'=>$CC['lat'],'lon'=>$CC['lon']);
$Data[] = $Zone;
} else {
/*
$A->setUTM( $XC-$RAN, $YC+$RAN, $Z );
$A->convertTMtoLL();
$LTLAT = $A->Lat();
$LTLON = $A->Long();
$A->setUTM( $XC+$RAN, $YC-$RAN, $Z );
$A->convertTMtoLL();
$RBLAT = $A->Lat();
$RBLON = $A->Long();
$Zone['type']='image';
$Zone['url']='/lib/controller/getDeviceDraw.php?NID='.$R['id'];
$Zone['bounds']=array(array($LTLAT,$LTLON),array($RBLAT,$RBLON));
//*/
//*
$RA = sqrt( $RAN * $RAN * 2 );
$CA = ( pi() / 180 ) * floatval( $CC['yaw'] );
$SANG = pi()/4*3;
$A->setUTM( $XC + $RA * cos( $SANG + $CA ), $YC + $RA * sin( $SANG + $CA ), $Z );
$A->convertTMtoLL();
$Zone['type']='image_rot';
$Zone['url']='/lib/controller/getDeviceDraw.php?NID='.$R['id'];
$Zone['topleft']=array($A->Lat(),$A->Long());
$SANG = pi() / 4;
$A->setUTM( $XC + $RA * cos( $SANG + $CA ), $YC + $RA * sin( $SANG + $CA ), $Z );
$A->convertTMtoLL();
$Zone['topright']=array($A->Lat(),$A->Long());
$SANG = pi() / 4*5;
$A->setUTM( $XC + $RA * cos( $SANG + $CA ), $YC + $RA * sin( $SANG + $CA ), $Z );
$A->convertTMtoLL();
$Zone['bottomleft']=array($A->Lat(),$A->Long());
$ZMARK = array();
$B = new gPoint();
//$RAN = $RAN - 0.5;
$B->setUTM( $XC + $RAN * cos( $SANG ), $YC + $RAN * sin( $SANG ), $Z );
$B->convertTMtoLL();
$ZMARK=array('lat'=>$B->Lat(),'lon'=>$B->Long());
$Zone['zang'] = $ZMARK;
//*/
};
$Data[] = $Zone;
};
break;
};
case 3:{
// PLS 200
$QS = "SELECT lat, lon, yaw, roll, pitch, max_range FROM lrf_sensors WHERE id={$R['aux_id']}";
$D = $DATABASE->Query( $QS, false );
if( count( $D ) ){
$CC = $D[0];
$A = new gPoint();
$A->setLongLat($CC['lon'],$CC['lat']);
$A->convertLLtoTM();
$XC = $A->E();
$YC = $A->N();
$Z = $A->Z();
$RAN = floatval( $CC['max_range'] );
if(1){
$K = pi()/18.0;//10 deg
$Points = array();
$Points[] = array('lat'=>$CC['lat'],'lon'=>$CC['lon']);
$SANG = ( pi() / 180 ) * floatval( $CC['yaw'] ) - $K;
for( $i = 0; $i < 21; $i++ ){
$CA = $i * $K;
$B = new gPoint();
$B->setUTM( $XC + $RAN * cos( $SANG + $CA ), $YC + $RAN * sin( $SANG + $CA ), $Z );
$B->convertTMtoLL();
$Points[]=array('lat'=>$B->Lat(),'lon'=>$B->Long());
};
if(1){
$ZMARK = array();
$B = new gPoint();
// PLS
$SANG = $SANG + $K;
//$RAN = $RAN - 0.5;
$B->setUTM( $XC + $RAN * cos( $SANG ), $YC + $RAN * sin( $SANG ), $Z );
$B->convertTMtoLL();
$ZMARK=array('lat'=>$B->Lat(),'lon'=>$B->Long());
//$SANG = $SANG - ( pi() / 180 );
//$RAN = $RAN + 0.5;
//$B->setUTM( $XC + $RAN * cos( $SANG ), $YC + $RAN * sin( $SANG ), $Z );
//$B->convertTMtoLL();
//$ZMARK[]=array('lat'=>$B->Lat(),'lon'=>$B->Long());
//$SANG = $SANG + ( pi() / 180 );
//$RAN = $RAN + 0.5;
//$B->setUTM( $XC + $RAN * cos( $SANG ), $YC + $RAN * sin( $SANG ), $Z );
//$B->convertTMtoLL();
//$ZMARK[]=array('lat'=>$B->Lat(),'lon'=>$B->Long());
//$SANG = $SANG + ( pi() / 180 );
//$RAN = $RAN - 0.5;
//$B->setUTM( $XC + $RAN * cos( $SANG ), $YC + $RAN * sin( $SANG ), $Z );
//$B->convertTMtoLL();
//$ZMARK[]=array('lat'=>$B->Lat(),'lon'=>$B->Long());
$Zone['zang'] = $ZMARK;
}
$Zone['type']='poly';
$Zone['points']=$Points;
$Zone['color'] = '#880000';
$Zone['center'] = array('lat'=>$CC['lat'],'lon'=>$CC['lon']);
$Data[] = $Zone;
} else {
/*
$A->setUTM( $XC-$RAN, $YC+$RAN, $Z );
$A->convertTMtoLL();
$LTLAT = $A->Lat();
$LTLON = $A->Long();
$A->setUTM( $XC+$RAN, $YC-$RAN, $Z );
$A->convertTMtoLL();
$RBLAT = $A->Lat();
$RBLON = $A->Long();
$Zone['type']='image';
$Zone['url']='/lib/controller/getDeviceDraw.php?NID='.$R['id'];
$Zone['bounds']=array(array($LTLAT,$LTLON),array($RBLAT,$RBLON));
//*/
//*
$RA = sqrt( $RAN * $RAN * 2 );
$CA = ( pi() / 180 ) * floatval( $CC['yaw'] );
$SANG = pi()/4*3;
$A->setUTM( $XC + $RA * cos( $SANG + $CA ), $YC + $RA * sin( $SANG + $CA ), $Z );
$A->convertTMtoLL();
$Zone['type']='image_rot';
$Zone['url']='/lib/controller/getDeviceDraw.php?NID='.$R['id'];
$Zone['topleft']=array($A->Lat(),$A->Long());
$SANG = pi() / 4;
$A->setUTM( $XC + $RA * cos( $SANG + $CA ), $YC + $RA * sin( $SANG + $CA ), $Z );
$A->convertTMtoLL();
$Zone['topright']=array($A->Lat(),$A->Long());
$SANG = pi() / 4*5;
$A->setUTM( $XC + $RA * cos( $SANG + $CA ), $YC + $RA * sin( $SANG + $CA ), $Z );
$A->convertTMtoLL();
$Zone['bottomleft']=array($A->Lat(),$A->Long());
//*/
$ZMARK = array();
$B = new gPoint();
//$RAN = $RAN - 0.5;
$B->setUTM( $XC + $RAN * cos( $SANG ), $YC + $RAN * sin( $SANG ), $Z );
$B->convertTMtoLL();
$ZMARK=array('lat'=>$B->Lat(),'lon'=>$B->Long());
$Zone['zang'] = $ZMARK;
};
$Data[] = $Zone;
};
break;
};
case 5:{
// 3D
$QS = "SELECT lat, lon, yaw, roll, pitch, max_range FROM lrf_sensors WHERE id={$R['aux_id']}";
$D = $DATABASE->Query( $QS, false );
if( count( $D ) ){
$CC = $D[0];
$A->setLongLat($CC['lon'],$CC['lat']);
$A->convertLLtoTM();
$YC = $A->N();
$XC = $A->E();
$Z = $A->Z();
$Zone['type']='circle';
$Zone['radius'] = floatval( $CC['max_range'] );
$Zone['color'] = '#880000';
$Zone['center'] = array('lat'=>$CC['lat'],'lon'=>$CC['lon']);
$SANG = ( pi() / 180 ) * floatval( $CC['yaw'] );
$RAN = floatval( $CC['max_range'] );
$ZMARK = array();
$B = new gPoint();
//$RAN = $RAN - 0.5;
$B->setUTM( $XC + $RAN * cos( $SANG ), $YC + $RAN * sin( $SANG ), $Z );
$B->convertTMtoLL();
$ZMARK=array('lat'=>$B->Lat(),'lon'=>$B->Long());
$Zone['zang'] = $ZMARK;
$Data[] = $Zone;
};
break;
};
case 13:{
// Camera PTZ;
$QS = "SELECT lat, lon, yaw, roll, pitch, max_range, pan_angles FROM cameras WHERE id={$R['aux_id']}";
$D = $DATABASE->Query( $QS, false );
if( count( $D ) ){
$CC = $D[0];
$A->setLongLat($CC['lon'],$CC['lat']);
$A->convertLLtoTM();
$YC = $A->N();
$XC = $A->E();
$Z = $A->Z();
if( intval( $CC['pan_angles'] ) < 360 ){
$Points = array();
$A = new gPoint();
$Points[] = array('lat'=>$CC['lat'],'lon'=>$CC['lon']);
$K = ( pi()/180.0 ) * floatval($CC['pan_angles']) / 40;
$SANG = ( pi() / 180 ) * floatval( $CC['yaw'] );
$RAN = floatval( $CC['max_range'] );
for( $i = 0; $i < 41; $i++ ){
$CA = $i * $K;
$B = new gPoint();
$B->setUTM( $XC + $RAN * cos( $SANG + $CA ), $YC + $RAN * sin( $SANG + $CA ), $Z );
$B->convertTMtoLL();
$Points[]=array('lat'=>$B->Lat(),'lon'=>$B->Long());
};
$Zone['type']='poly';
$Zone['points']=$Points;
$Zone['color'] = '#000088';
$Zone['center'] = array('lat'=>$CC['lat'],'lon'=>$CC['lon']);
$ZMARK = array();
$B = new gPoint();
//$RAN = $RAN - 0.5;
$B->setUTM( $XC + $RAN * cos( $SANG ), $YC + $RAN * sin( $SANG ), $Z );
$B->convertTMtoLL();
$ZMARK=array('lat'=>$B->Lat(),'lon'=>$B->Long());
$Zone['zang'] = $ZMARK;
} else {
$Zone['type']='circle';
$Zone['radius'] = floatval( $CC['max_range'] );
$Zone['color'] = '#000088';
$Zone['center'] = array('lat'=>$CC['lat'],'lon'=>$CC['lon']);
$SANG = ( pi() / 180 ) * floatval( $CC['yaw'] );
$RAN = floatval( $CC['max_range'] );
$ZMARK = array();
$B = new gPoint();
//$RAN = $RAN - 0.5;
$B->setUTM( $XC + $RAN * cos( $SANG ), $YC + $RAN * sin( $SANG ), $Z );
$B->convertTMtoLL();
$ZMARK=array('lat'=>$B->Lat(),'lon'=>$B->Long());
$Zone['zang'] = $ZMARK;
};
$Data[] = $Zone;
};
break;
};
};
};
$QS="SELECT * FROM target_filters WHERE site_id={$SID}";
$RF=$DATABASE->Query( $QS, false );
foreach( $RF as $F ){
switch( intval($F['type']) ){
case 1:{
$QS="SELECT * FROM target_filter_apf WHERE id={$F['aux_id']}";
$SD=$DATABASE->Query( $QS, false );
$CC=$SD[0];
if( count($SD) ){
$Zone['type']='poly';
$Zone['color'] = '#FF00FF';
$Zone['center'] = array('lat'=>$CC['lat'],'lon'=>$CC['lon']);
$QS="SELECT * FROM target_filter_apf_anchors WHERE filter_id={$F['aux_id']}";
$RA=$DATABASE->Query( $QS, false );
$Points = array();
$A = new gPoint();
$A->setLongLat($CC['lon'],$CC['lat']);
$A->convertLLtoTM();
$YC = $A->N();
$XC = $A->E();
$Z = $A->Z();
$ANG = (pi()/180)*floatval( $CC['yaw'] );
foreach( $RA as $G ){
$TX = floatval($G['x']);
$TY = floatval($G['y']);
$CR = sqrt($TX*$TX+$TY*$TY);
if( $TX != 0 ){
$CA = atan( $TY/$TX );
} else {
$CA = 0;
};
$A->setUTM($XC+$CR*cos($CA+$ANG),$YC+$CR*sin($CA+$ANG),$Z);
$A->convertTMtoLL();
$Points[]=array('lat'=>$A->Lat(),'lon'=>$A->Long());
};
$Zone['points']=$Points;
$Data[] = $Zone;
};
break;
};
};
};
};
$ZZ['zones']=$Data;
$ZZ['totalCount'] = count( $Data );
echo json_encode( $ZZ );
} else {
header('location: /');
};
?>

2
lib/controller/getLocationNodes.php

@ -9,7 +9,7 @@
$cid = intval($CD['id']); $cid = intval($CD['id']);
$ct = intval($CD['type']); $ct = intval($CD['type']);
if( in_array( $ct, array( 2, 3, 5, 13 ) ) ){ if( in_array( $ct, array( 2, 3, 5, 13 ) ) ){
$Data .= "{ xtype: 'button', text: '{$CD['name']}', width: '100%', handler: function(){ loadNodeLocationProps({$cid}); } },";
$Data .= "{ xtype: 'button', text: '{$CD['name']}', width: '100%', handler: function(){ locationSelectedNode={$cid}; loadNodeLocationProps({$cid}); } },";
}; };
}; };
echo $Data . "{}] }"; echo $Data . "{}] }";

37
lib/controller/getM3U8.php

@ -0,0 +1,37 @@
<?php
require_once('../ajax_asm.php');
if( $CUser->Data['id'] > 1 ){
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
header("Cache-Control: post-check=0, pre-check=0", false );
header("Pragma: no-cache");
if(isset( $_POST['VID'] )){
$VID = intval($_POST['VID']);
} else {
$VID = intval($_GET['VID']);
};
if( $VID ){
$QS = "SELECT md5, part_id FROM video_records WHERE id={$VID}";
$Result = $DATABASE->Query( $QS, false );
if( count( $Result ) ){
$SP = intval($Result[0]['part_id']);
$MD5 = $Result[0]['md5'];
$QS = "SELECT part_id FROM video_records WHERE md5='{$MD5}' AND part_id >= {$SP} ORDER BY part_id";
$RR = $DATABASE->Query( $QS, false );
echo"#EXTM3U\n";
echo"#EXT-X-VERSION:3\n";
echo "#EXT-X-ALLOW-CACHE:NO\n";
echo "#EXT-X-TARGETDURATION:2\n";
echo "#EXT-X-MEDIA-SEQUENCE:73598\n";
//echo "#EXTINF:1.960,\n2021-07-11/09/53-34_73598.ts\n";
$BD = substr( $MD5, 0, 2 ) . '/' . substr( $MD5, 2, 2 ) . '/';
foreach( $RR as $R ){
$CP = intval( $R['part_id'] );
echo "#EXTINF:1.960,\ndata/videos/{$BD}{$CP}.ts\n";
};
echo "#EXT-X-ENDLIST\n";
exit();
};
};
};
header('location: /');
?>

9
lib/controller/getOnvifCredentials.php

@ -2,9 +2,10 @@
require_once('../ajax_asm.php'); require_once('../ajax_asm.php');
require_once('../php/onvif/toto.php'); require_once('../php/onvif/toto.php');
require_once('../php/video/zlMediaServerController.php'); require_once('../php/video/zlMediaServerController.php');
$Data = array();
$Data['success'] = false;
if( $CUser->Data['id'] > 1 ){ if( $CUser->Data['id'] > 1 ){
$Data = array();
$Data['success'] = false;
if( isset( $_POST['CID'] ) ){ if( isset( $_POST['CID'] ) ){
$ECID = intval( $_POST['CID'] ); $ECID = intval( $_POST['CID'] );
if( $ECID > 0 ){ if( $ECID > 0 ){
@ -31,8 +32,8 @@
}; };
}; };
}; };
echo json_encode( $Data );
} else { } else {
header('location: /');
$Data['error']='Access Denied!';
}; };
echo json_encode( $Data );
?> ?>

lib/controller/getSettingsLidsr3D.php → lib/controller/getSettingsLRF.php

24
lib/controller/listAccessLog.php

@ -0,0 +1,24 @@
<?php
require_once('../ajax_asm.php');
require_once('../php/onvif/toto.php');
if( $CUser->Data['id'] > 1 ){
if( $CUser->Data['access'] > 5 ){
$QS = "SELECT al.*, ur.login FROM access_log al LEFT JOIN users ur ON (al.user_id = ur.id ) ORDER BY id DESC";
$Result = $DATABASE->Query($QS,false);
foreach( $Result as $CD ){
$cnode['id'] = intval( $CD['id'] );
$cnode['user'] = $CD['login'];
$cnode['ts']= $CD['ts'];
$cnode['cmd'] = intval( $CD['cmd'] );
$cnode['data_line'] = $CD['dataset'];
$Data['records'][] = $cnode;
};
} else {
$Data['records'] = array();
};
$Data['totalCount']= count($Data['records']);
echo json_encode( $Data );
} else {
header('location: /');
};
?>

2
lib/controller/listDiscoveredCameraSources.php

@ -2,7 +2,7 @@
require_once('../ajax_asm.php'); require_once('../ajax_asm.php');
require_once('../php/onvif/toto.php'); require_once('../php/onvif/toto.php');
if( $CUser->Data['id'] > 1 ){ if( $CUser->Data['id'] > 1 ){
$QS = "SELECT * FROM cameras WHERE status < 2";
$QS = "SELECT * FROM cameras WHERE node_id=0";
$Result = $DATABASE->Query($QS,false); $Result = $DATABASE->Query($QS,false);
foreach( $Result as $CD ){ foreach( $Result as $CD ){
$cnode['id'] = $CD['id']; $cnode['id'] = $CD['id'];

39
lib/controller/listServerLog.php

@ -0,0 +1,39 @@
<?php
require_once('../ajax_asm.php');
require_once('../php/onvif/toto.php');
if( $CUser->Data['id'] > 1 ){
if( $CUser->Data['access'] > 5 ){
$Records = array();
if( $FID = fopen("data/server.log", "r")){
$LID = 0;
$AID = 1;
while( !feof( $FID ) ){
$line = trim( fgets($FID) );
$cnode['id'] = $AID;
$TArr = explode( ' ', $line );
if( count( $TArr ) > 2 ){
$cnode['ts'] = $TArr[0] . ' ' . $TArr[1];
$cnode['ptr'] = $TArr[2];
$cnode['module'] = str_replace(':','', $TArr[3]);
$cnode['msg'] = substr( $line, strlen( $cnode['ts'] ) + strlen( $cnode['ptr'] ) + strlen( $cnode['module'] ) + 4 );
if( $LID < 40 ) {
$LID++;
} else {
array_shift($Records);
};
$Records[$LID] = $cnode;
$AID++;
};
};
fclose($FID);
};
$Data['records'] = array_reverse($Records);
} else {
$Data['records'] = array();
};
$Data['totalCount']= count($Data['records']);
echo json_encode( $Data );
} else {
header('location: /');
};
?>

27
lib/controller/listUsers.php

@ -0,0 +1,27 @@
<?php
require_once('../ajax_asm.php');
require_once('../php/onvif/toto.php');
if( $CUser->Data['id'] > 1 ){
if( $CUser->Data['access'] > 5 ){
$QS = "SELECT * FROM users";
$Result = $DATABASE->Query($QS,false);
foreach( $Result as $CD ){
$cnode['id'] = intval( $CD['id'] );
$cnode['status'] = $CD['status'];
$cnode['access'] = intval( $CD['access'] );
$cnode['login'] = $CD['login'];
$cnode['created']= $CD['create_ts'];
$cnode['last'] = $CD['login_ts'];
$cnode['lang'] = intval( $CD['language'] );
$cnode['site'] = $CD['selected_site'];
$Data['users'][] = $cnode;
};
} else {
$Data['users'] = array();
};
$Data['totalCount']= count($Data['users']);
echo json_encode( $Data );
} else {
header('location: /');
};
?>

3
lib/controller/props/event_prop.js

@ -47,7 +47,8 @@
xtype: 'panel', xtype: 'panel',
html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Alt: %%%ALT%%%</p>' html: '<p align="center" style="padding: 5px; color: yellow; background-color: green;">Alt: %%%ALT%%%</p>'
}] }]
}],
},%%%VIDEOSECTION%%%]
/* /*
buttons: [{ buttons: [{
text: 'Update', text: 'Update',

29
lib/controller/props/event_video.js

@ -0,0 +1,29 @@
{
xtype: 'panel',
html: '<center><video id="hls-%%%HLSID%%%" class="video-js vjs-default-skin" width="244" height="200"></video></center>',
plr: null,
listeners:{
afterrender: function( t ){
t.plr = videojs.getPlayer('hls-%%%HLSID%%%');
if( t.plr == null ){
t.plr = videojs('hls-%%%HLSID%%%',{
autoplay: 'muted',
controls: true,
controlBar: {
volumePanel: false,
playToggle: false,
pictureInPictureToggle: false
}
});
};
%%%HLSOFFSET%%%
t.plr.src({type: 'application/x-mpegURL', src: '%%%HLSSRC%%%'});
return true;
},
destroy: function( t ){
if( t.plr != null ) t.plr.dispose();
t.plr = null;
}
}
}

2
lib/controller/removeNode.php

@ -37,7 +37,7 @@
$QS = "DELETE FROM `media_streams` WHERE `source_id`={$AID}"; $QS = "DELETE FROM `media_streams` WHERE `source_id`={$AID}";
$DATABASE->Query( $QS ); $DATABASE->Query( $QS );
}; };
$QS = "UPDATE `cameras` SET `status`=0 WHERE `id`={$AID}";
$QS = "UPDATE `cameras` SET `status`=0, `node_id`=0 WHERE `id`={$AID}";
$DATABASE->Query( $QS ); $DATABASE->Query( $QS );
break; break;
}; };

1
lib/controller/updateUserSettings.php

@ -9,6 +9,7 @@
$HEIGHT = intval($_POST['HEI']); $HEIGHT = intval($_POST['HEI']);
$QS="UPDATE `users` SET `width`={$WIDTH}, `height`={$HEIGHT} WHERE id={$CUser->Data['id']}"; $QS="UPDATE `users` SET `width`={$WIDTH}, `height`={$HEIGHT} WHERE id={$CUser->Data['id']}";
$DATABASE->Query( $QS ); $DATABASE->Query( $QS );
$LOG->ScreenChanges( $CUser->Data['width'], $CUser->Data['height'], $WIDTH, $HEIGHT );
break; break;
}; };
}; };

67
lib/defines.php

@ -0,0 +1,67 @@
<?php
$ShowImagesLocal=false;
$ShowThumbnailsLocal=true;
$ShowAdw=true;
$SaveLocal=false;
$MailAgent='SENDMAIL';
$CGP_SubmitPath='../Submitted/';
$WEBPath='http://' . $_SERVER['SERVER_ADDR'] . '/';
$DBCacheDir=$SYSPath . 'cache';
$MinimalSize=640000;
// Argus Defines
define( "ARGUS_SERVER", 0 );
define( "ARGUS_ALS_SENSOR", 1 );
define( "ARGUS_LFS_SENSOR", 2 );
define( "ARGUS_PLS_200_SENSOR", 3 );
define( "ARGUS_PLS_360_SENSOR", 4 );
define( "ARGUS_3D_SENSOR", 5 );
define( "ARGUS_NET_PLS_200", 6 );
define( "ARGUS_ANALOG_STATIC_CAMERA", 10 );
define( "ARGUS_ANALOG_PTZ_CAMERA", 11 );
define( "ARGUS_IP_STATIC_CAMERA", 12 );
define( "ARGUS_IP_PTZ_CAMERA", 13 );
define( "ARGUS_IP_UART_GATEWAY", 20 );
define( "ARGUS_JAMER", 40 );
define( "ARGUS_IP_VIDEO_SERVER", 50 );
define( "ARGUS_DRONE_CONTROL", 60 );
define( "ARGUS_UNKNOWN", 255 );
define( "ARGUS_NODE_SOCK_TYPE_SERIAL_PORT", 1 );
define( "ARGUS_NODE_SOCK_TYPE_NETWORK", 2 );
define( "ARGUS_NODE_SOCK_TYPE_DC", 3 );
define( "ARGUS_NODE_SOCK_TYPE_VIDEO_GRABBER", 4 );
define( "ARGUS_NODE_SOCK_TYPE_AUDIO_GRABBER", 5 );
define( "ARGUS_NODE_SOCK_TYPE_VIDEO_DIGITAL", 6 );
define( "COM_MODE_IN", 1 );
define( "COM_MODE_OUT", 2 );
define( "COM_MODE_INOUT", 3 );
define( "COM_TYPE_UART", 1 );
define( "COM_TYPE_TCP", 2 );
define( "COM_TYPE_DC_CTRL", 3 );
define( "COM_TYPE_ANALOG_VIDEO", 4 );
define( "COM_TYPE_ANALOG_AUDIO", 5 );
define( "COM_TYPE_DIGITAL_MEDIA", 6 );
define( "CAM_TYPE_ANALOG", 1 );
define( "CAM_TYPE_DIGITAL", 2 );
define( "MOD_TYPE_MEDIASERVER", 1 );
define( "MOD_TYPE_USB_DC", 2 );
function microtime_float(){
list($usec, $sec) = explode(" ", microtime());
return ((float)$usec + (float)$sec);
};
$Script_Start_Time = microtime_float();
?>

18
lib/install.php

@ -0,0 +1,18 @@
<?php
error_reporting( E_ALL );
require_once('settings.php');
// SET DATA CONNECTION AND GLOBAL USER VARIABLES
$TT_123 = explode( '.', PHP_VERSION );
if( $TT_123[0] == '4' ){
require_once( 'php/db/MySQL_class.php' );
} elseif( $TT_123[0] > '4' ){
require_once( 'php/db/MySQLi_class.php' );
} else {
exit();
};
session_start();
require_once('php/ui/UI_functions.php');
?>

781
lib/javascript/jsapi_dynamic/rgoose_camera_editor.js

@ -1,11 +1,13 @@
//<?php require_once('../../js_asm.php'); ?> //<?php require_once('../../js_asm.php'); ?>
var netwodkData = {
edges: null,
nodes: null
};
var selectedSite = 0;
var SelectedCam = 0;
var SelectedSource = 0;
var SelectedCamPTZ = false;
var connectCamDialog = null;
var addIpCamDialog = null;
var addE2UDialog = null;
var cameraListStore = new Ext.data.JsonStore({ var cameraListStore = new Ext.data.JsonStore({
root: 'nodes', root: 'nodes',
@ -42,8 +44,6 @@ var cameraListStore = new Ext.data.JsonStore({
}) })
}); });
var SelectedCam = 0;
var sourceListStore = new Ext.data.JsonStore({ var sourceListStore = new Ext.data.JsonStore({
root: 'nodes', root: 'nodes',
totalProperty: 'totalCount', totalProperty: 'totalCount',
@ -67,8 +67,6 @@ var sourceListStore = new Ext.data.JsonStore({
}] }]
}); });
var cameraListSelModel = new Ext.grid.RowSelectionModel({ var cameraListSelModel = new Ext.grid.RowSelectionModel({
singleSelect: true, singleSelect: true,
listeners: { listeners: {
@ -80,14 +78,12 @@ var cameraListSelModel = new Ext.grid.RowSelectionModel({
} }
}); });
var SelectedSource = 0;
var sourceListSelModel = new Ext.grid.RowSelectionModel({ var sourceListSelModel = new Ext.grid.RowSelectionModel({
singleSelect: true, singleSelect: true,
listeners: { listeners: {
rowselect: function(sm, row, rec) { rowselect: function(sm, row, rec) {
SelectedSource = rec.data.id; SelectedSource = rec.data.id;
//document.getElementById('pic_prev').src = '/lib/controller/getVideoFeed.php?UID=<?=$CUser->Data['id'];?>&SID<?=$Session;?>&AUX=200&FID='+SelectedSource;
document.getElementById('pic_prev').src = '/lib/controller/getVideoFeed.php?UID=<?=$CUser->Data['id'];?>&SID<?=$Session;?>&FID='+SelectedSource;
Ext.getCmp('pic_prev').update( '<center><img height="300px" src="/lib/controller/getVideoFeed.php?UID=<?=$CUser->Data['id'];?>&SID=<?=$Session;?>&FID='+SelectedSource+'"></center>' );
} }
} }
}); });
@ -95,19 +91,19 @@ var sourceListSelModel = new Ext.grid.RowSelectionModel({
function camCapRenderer(val){ function camCapRenderer(val){
var p1, p2, p3; var p1, p2, p3;
if( ( val & 1 ) == 1 ){ if( ( val & 1 ) == 1 ){
p1 = '<img src="/style/img/cam_cap3.png" alt="Video Source">';
p1 = '<img src="/style/img/cam_cap3.png" alt="Video Source">';
} else { } else {
p1 = '<img src="/style/img/cam_cap0.png" alt="NO Video Source">';
p1 = '<img src="/style/img/cam_cap0.png" alt="NO Video Source">';
}; };
if( ( val & 2 ) == 2 ){ if( ( val & 2 ) == 2 ){
p2 = '<img src="/style/img/cam_cap2.png" alt="Audio Source">';
p2 = '<img src="/style/img/cam_cap2.png" alt="Audio Source">';
} else { } else {
p2 = '<img src="/style/img/cam_cap0.png" alt="NO Audio Source">';
p2 = '<img src="/style/img/cam_cap0.png" alt="NO Audio Source">';
}; };
if( ( val & 4 ) == 4 ){ if( ( val & 4 ) == 4 ){
p3 = '<img src="/style/img/cam_cap1.png" alt="PTZ Control">';
p3 = '<img src="/style/img/cam_cap1.png" alt="PTZ Control">';
} else { } else {
p3 = '<img src="/style/img/cam_cap0.png" alt="NO PTZ Control">';
p3 = '<img src="/style/img/cam_cap0.png" alt="NO PTZ Control">';
}; };
return p1+p2+p3; return p1+p2+p3;
}; };
@ -115,7 +111,7 @@ function camCapRenderer(val){
var cameraListColModel = new Ext.grid.ColumnModel({ var cameraListColModel = new Ext.grid.ColumnModel({
columns: [ columns: [
{header: "id", width: 50, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', dataIndex: 'id' }, {header: "id", width: 50, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', dataIndex: 'id' },
{header: "Type",width: 60, sortable: false, fixed: true, menuDisabled: true, renderer: camCapRenderer, dataIndex: 'caps' },
{header: "Type",width: 60, sortable: false, fixed: true, menuDisabled: true, renderer: camCapRenderer, dataIndex: 'caps' },
{header: "IP Address", width: 120, sortable: false, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'ip' }, {header: "IP Address", width: 120, sortable: false, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'ip' },
{header: "MAC", width: 120, sortable: false, fixed: true, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'mac' }, {header: "MAC", width: 120, sortable: false, fixed: true, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'mac' },
{header: "Name", dataIndex: 'name' }, {header: "Name", dataIndex: 'name' },
@ -153,7 +149,6 @@ var sourceListColModel = new Ext.grid.ColumnModel({
} }
}); });
function discoverOnvifSources(){ function discoverOnvifSources(){
Ext.Ajax.request({ Ext.Ajax.request({
url: '/lib/controller/listAndDiscoverOnvifSources.php', url: '/lib/controller/listAndDiscoverOnvifSources.php',
@ -165,20 +160,43 @@ function discoverOnvifSources(){
success: function( response, opts ){ success: function( response, opts ){
cameraListStore.reload(); cameraListStore.reload();
}, },
failure: function( response, opts ) {
//Ext.fly('some_div').update('Fail!');
}/*,
callback: function(options,success,response){
// use this if you need to perform your own success/failure checking
}*/
failure: failureAJAXFunction
});
};
function loadCameraSettings( SC ){
Ext.Ajax.request({
url: '/lib/controller/getCameraSettings.php',
params: {
CID: SC,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>'
},
success: function( response, opts ){
var data = Ext.decode( response.responseText );
if( data.success ){
} else {
};
},
failure: function( response, opts ) {
Ext.getCmp('cam_login').setValue('');
Ext.getCmp('cam_password').setValue('');
Ext.getCmp('cac_tab').enable();
Ext.getCmp('str_tab').disable();
Ext.getCmp('ptz_tab').disable();
Ext.getCmp('loc_tab').disable();
Ext.getCmp('coc_tabs').setActiveTab( 0 );
sourceListStore.removeAll();
}
}); });
}; };
function preloadOnvifCredentials( SelectedCam ){
function preloadOnvifCredentials( SC ){
Ext.Ajax.request({ Ext.Ajax.request({
url: '/lib/controller/getOnvifCredentials.php', url: '/lib/controller/getOnvifCredentials.php',
params: { params: {
CID: SelectedCam,
CID: SC,
UID: <?=$UserID;?>, UID: <?=$UserID;?>,
SID: '<?=$Session;?>' SID: '<?=$Session;?>'
}, },
@ -187,20 +205,47 @@ function preloadOnvifCredentials( SelectedCam ){
if( data.success ){ if( data.success ){
Ext.getCmp('cam_login').setValue( data.login ); Ext.getCmp('cam_login').setValue( data.login );
Ext.getCmp('cam_password').setValue( data.password ); Ext.getCmp('cam_password').setValue( data.password );
Ext.getCmp('zigzag').disable();
Ext.getCmp('acm_btn').enable();
Ext.getCmp('cac_tab').disable();
Ext.getCmp('lens_tab').enable();
Ext.getCmp('str_tab').enable();
Ext.getCmp('ptz_tab').enable();
Ext.getCmp('loc_tab').enable();
Ext.getCmp('coc_tabs').setActiveTab( 1 );
sourceListStore.loadData( data, false ); sourceListStore.loadData( data, false );
document.getElementById('pic_prev').src = '/lib/controller/getVideoFeed.php?UID=<?=$CUser->Data['id'];?>&SID<?=$Session;?>&FID='+data.nodes[0].id;
//document.getElementById('pic_prev').src = '/lib/controller/getVideoFeed.php?UID=<?=$CUser->Data['id'];?>&SID<?=$Session;?>&FID='+data.nodes[0].id;
} else { } else {
Ext.getCmp('cam_login').setValue(''); Ext.getCmp('cam_login').setValue('');
Ext.getCmp('cam_password').setValue(''); Ext.getCmp('cam_password').setValue('');
Ext.getCmp('zigzag').enable();
Ext.getCmp('acm_btn').disable();
Ext.getCmp('cac_tab').enable();
Ext.getCmp('lens_tab').disable();
Ext.getCmp('str_tab').disable();
Ext.getCmp('ptz_tab').disable();
Ext.getCmp('loc_tab').disable();
Ext.getCmp('coc_tabs').setActiveTab( 0 );
sourceListStore.removeAll(); sourceListStore.removeAll();
if( data.error != null ){
Ext.Msg.show({
title:'<?=$Labels->GetLabel('Error_Message');?>',
msg: data['error'],
buttons: Ext.Msg.OK,//YESNOCANCEL,
//fn: processResult,
//animEl: 'elId',
icon: Ext.MessageBox.ERROR //QUESTION
});
};
}; };
}, },
failure: function( response, opts ) { failure: function( response, opts ) {
Ext.getCmp('cam_login').setValue(''); Ext.getCmp('cam_login').setValue('');
Ext.getCmp('cam_password').setValue(''); Ext.getCmp('cam_password').setValue('');
Ext.getCmp('zigzag').enable();
Ext.getCmp('cac_tab').enable();
Ext.getCmp('lens_tab').disable();
Ext.getCmp('str_tab').disable();
Ext.getCmp('ptz_tab').disable();
Ext.getCmp('loc_tab').disable();
Ext.getCmp('coc_tabs').setActiveTab( 0 );
sourceListStore.removeAll(); sourceListStore.removeAll();
} }
}); });
@ -224,222 +269,521 @@ function discoverOnvifProfiles( CamID, camUser, camPasswd ){
document.getElementById('pic_prev').src = '/lib/controller/getVideoFeed.php?UID=<?=$CUser->Data['id'];?>&SID<?=$Session;?>&FID='+data.nodes[0].id; document.getElementById('pic_prev').src = '/lib/controller/getVideoFeed.php?UID=<?=$CUser->Data['id'];?>&SID<?=$Session;?>&FID='+data.nodes[0].id;
} else { } else {
Ext.Msg.show({ Ext.Msg.show({
title:'Error Message',
title:'<?=$Labels->GetLabel('Error_Message');?>',
msg: data['error'], msg: data['error'],
width: 640,
buttons: Ext.Msg.OK,//YESNOCANCEL, buttons: Ext.Msg.OK,//YESNOCANCEL,
//fn: processResult,
//fn: processResult,602811123
//animEl: 'elId', //animEl: 'elId',
icon: Ext.MessageBox.ERROR //QUESTION icon: Ext.MessageBox.ERROR //QUESTION
}); });
}; };
Ext.getCmp('zigzag').getEl().unmask();
Ext.getCmp('cac_tab').getEl().unmask();
}, },
failure: function( response, opts ) {
//Ext.fly('some_div').update('Fail!');
}/*,
callback: function(options,success,response){
// use this if you need to perform your own success/failure checking
}*/
failure: failureAJAXFunction
}); });
}; };
var connectOnvifDialog = null;
var addDialog = null;
var SelectedCamPTZ = false;
function connectToSeleced(){
if( SelectedCam > 0 ){
if( connectOnvifDialog == null ){
connectOnvifDialog = new Ext.Window({
var CamPropType = 0;
function showCamPropDialog(){
if( connectCamDialog == null ){
connectCamDialog = new Ext.Window({
modal: true, modal: true,
title: 'Connect to IP Camera',
title: (CamPropType)?'<?=$Labels->GetLabel('_CON_2_IP_CAM_');?>':'IP Camera Settings',
width: 600, width: 600,
height: 500, height: 500,
layout: 'vbox', layout: 'vbox',
closeAction: 'hide', closeAction: 'hide',
border: false, border: false,
items:[{ items:[{
id: 'zigzag',
layout: 'table',
width: '100%',
border: false,
disabled: false,
defaults: {
// applied to each contained panel
border: false,
frame: false,
bodyStyle: 'padding:10px'
},
layoutConfig: {
tableAttrs: {
style: {
width: '100%'
}
},
columns: 3
},
id: 'coc_tabs',
xtype: 'tabpanel',
activeTab: 0,
items: [{ items: [{
colspan: 3,
html: '<p align="center">Please Provide Camera Access Credentials.</p>'
},{
html: '<p align="right">Login:</p>',
width: 170
},{
id: 'cam_login',
xtype: 'textfield',
width: 200
},{
html: '&nbsp;',
width: 170
},{
html: '<p align="right">Password:</p>'
},{
id: 'cam_password',
xtype: 'textfield',
width: 200,
inputType: 'password'
},{
html: '&nbsp;'
},{
html: '&nbsp;'
},{
xtype: 'button',
text: 'Connect to Camera',
title: '<?=$Labels->GetLabel('_CAC_TAB_');?>',
id: 'cac_tab',
layout: 'table',
width: '100%', width: '100%',
handler: function(){
Ext.getCmp('zigzag').getEl().mask("Please wait...","x-mask-loading");
var User = Ext.getCmp('cam_login').getValue();
var Passwd = Ext.getCmp('cam_password').getValue();
discoverOnvifProfiles( SelectedCam, User, Passwd );
}
},{
html: '&nbsp;'
}]
},{
xtype: 'grid',
title: 'Streams',
height: 124,
disableSelection: true,
ds: sourceListStore,
cm: sourceListColModel,
//sm: sourceListSelModel
},{
layout: 'table',
width: '100%',
border: false,
disabled: false,
defaults: {
// applied to each contained panel
border: false, border: false,
frame: false,
bodyStyle: 'text-align:right;padding-left:10px;padding-right:10px;'
},
layoutConfig: {
tableAttrs: {
style: {
width: '100%'
}
disabled: false,
defaults: {
border: false,
frame: false,
bodyStyle: 'padding:10px'
}, },
columns: 6
},
items: [{
html: 'Lon:'
},{
id: 'cam_pos_lon',
xtype: 'textfield',
width: 70
},{
html: 'Lat:'
},{
id: 'cam_pos_lat',
xtype: 'textfield',
width: 70
},{
html: 'Alt:'
},{
id: 'cam_pos_alt',
xtype: 'textfield',
width: 70
},{
html: 'Roll:'
},{
id: 'cam_pos_roll',
xtype: 'textfield',
width: 70
layoutConfig: {
columns: 3
},
items: [{
colspan: 3,
html: '<p align="center"><?=$Labels->GetLabel('_PROV_CAC_');?></p>'
},{
html: '<p align="right"><?=$Labels->GetLabel('_LOGIN_0_');?></p>',
width: 170
},{
id: 'cam_login',
xtype: 'textfield',
width: 200
},{
html: '&nbsp;'
},{
html: '<p align="right"><?=$Labels->GetLabel('_PASSWORD_0_');?></p>'
},{
id: 'cam_password',
xtype: 'textfield',
inputType: 'password',
width: 200
},{
html: '&nbsp;'
},{
html: '&nbsp;'
},{
xtype: 'button',
text: 'Connect to Camera',
width: '100%',
handler: function(){
Ext.getCmp('cac_tab').getEl().mask("Please wait...","x-mask-loading");
var User = Ext.getCmp('cam_login').getValue();
var Passwd = Ext.getCmp('cam_password').getValue();
discoverOnvifProfiles( SelectedCam, User, Passwd );
}
},{
html: '&nbsp;'
}]
},{ },{
html: 'Pitch:'
title: '<?=$Labels->GetLabel('_STREAMS_');?>',
id: 'str_tab',
disabled: true,
items:[{
xtype: 'grid',
title: '<?=$Labels->GetLabel('_STREAMS_');?>',
height: 124,
disableSelection: true,
ds: sourceListStore,
cm: sourceListColModel,
sm: sourceListSelModel
},{
height: 300,
id: 'pic_prev',
width: 600,
html: '<center><img height="300px" src="/style/img/cam_cap0.png"></center>'
}]
},{ },{
id: 'cam_pos_pitch',
xtype: 'textfield',
width: 70
title: 'Lens Settings',
id: 'lens_tab',
disabled: true,
items:[{
layout: 'table',
layoutConfig: {
columns: 3
},
defaults: {
frame: false,
bodyStyle: 'padding:10px',
border: false
},
items:[{
width: 200,
html: 'Sensor Size'
},{
xtype: 'combo',
fieldLabel: 'Sensor Size',
lazyRender: true,
id: 'sens_size',
mode: 'local',
store: new Ext.data.ArrayStore({
fields: ['size','size_txt'],
data: [
[0,'1/3.6"'],
[1,'1/3.2"'],
[2,'1/3"'],
[3,'1/2.7"'],
[4,'1/2"'],
[5,'1/1.8"'],
[6,'2/3"'],
[7,'1"'],
[8,'4/3"'],
[9,'APS-C'],
[10,'35 mm'],
[11,'645']
]
}),
valueField: 'size',
displayField: 'size_txt'
},{
html: '&nbsp;'
},{
html: 'Fixed Zoom'
},{
xtype: 'radio',
id: 'no_zoom',
name: 'zoom_ena',
value: 0,
checked: true
},{
html: '&nbsp;'
},{
html: 'Variable Zoom'
},{
xtype: 'radio',
id: 'on_zoom',
hideLabel: false,
fieldLabel: 'Variable Zoom',
html: 'koko',
name: 'zoom_ena',
value: 1,
checked: false,
handler: function( a, c ){
if( c ){
Ext.getCmp('max_foc').enable();
Ext.getCmp('zoom_val').enable();
var mf = Ext.getCmp('min_foc').getValue();
if( mf > 0 ){
Ext.getCmp('max_foc').setValue( mf );
Ext.getCmp('zoom_val').setValue( 1 );
};
} else {
Ext.getCmp('max_foc').disable();
Ext.getCmp('zoom_val').disable();
Ext.getCmp('zoom_disp').update('&nbsp;');
};
}
},{
html: '&nbsp;'
},{
html: 'Min. Focal Length'
},{
xtype: 'numberfield',
id: 'min_foc',
width: '95%',
minValue: 1.0,
maxValue: 270.0
},{
html: '&nbsp;'
},{
html: 'Max. Focal Length'
},{
xtype: 'numberfield',
id: 'max_foc',
width: '95%',
disabled: true,
minValue: 1.0,
maxValue: 270.0,
listeners:{
change: function( a, c, b ){
if( b == c ) return;
var mf = Ext.getCmp('min_foc').getValue();
if( mf > 0 ){
if( c < mf ){
Ext.getCmp('max_foc').setValue( mf );
} else {
var zl = c / mf;
Ext.getCmp('zoom_val').setValue( zl );
};
};
}
}
},{
html: '&nbsp;'
},{
html: 'Zoom Ratio'
},{
xtype: 'slider',
id: 'zoom_val',
disabled: true,
minValue: 1.0,
maxValue: 40.0,
listeners:{
change: function( a, c, b ){
var mf = Ext.getCmp('min_foc').getValue();
if( mf > 0 ){
Ext.getCmp('max_foc').setValue( mf*c );
Ext.getCmp('zoom_disp').update('<p>X&nbsp;'+ c + '</p>');
};
}
}
},{
id: 'zoom_disp',
html: '&nbsp;'
}]
}]
},{ },{
html: 'Yaw:'
title: '<?=$Labels->GetLabel('_PTZ_TAB_');?>',
id: 'ptz_tab',
disabled: true,
items:[{
layout: 'table',
layoutConfig: {
columns: 3
},
defaults: {
frame: false,
bodyStyle: 'padding:10px',
border: false
},
items:[{
width: 200,
html: 'PTZ Control'
},{
xtype: 'combo',
fieldLabel: 'Ptz Control',
lazyRender: true,
id: 'ptz_proto',
mode: 'local',
store: new Ext.data.ArrayStore({
fields: ['type','type_txt'],
data: [
[0,'No PTZ'],
[1,'Sony VISCA'],
[2,'Pelco-D'],
[3,'OnVif'],
[4,'PSIA'],
[5,'GB/T28181']
]
}),
valueField: 'type',
displayField: 'type_txt',
listeners:{
change: function( a, c, b ){
if( c > 0 ){
if( c != 3 ){
Ext.getCmp('uart_id').enable();
Ext.getCmp('prot_id').enable();
} else {
Ext.getCmp('uart_id').disable();
Ext.getCmp('prot_id').disable();
};
Ext.getCmp('pan_mode').enable();
Ext.getCmp('tilt_mode').enable();
Ext.getCmp('pan_ang').enable();
Ext.getCmp('tilt_ang').enable();
} else {
Ext.getCmp('uart_id').disable();
Ext.getCmp('prot_id').disable();
Ext.getCmp('pan_mode').disable();
Ext.getCmp('tilt_mode').disable();
Ext.getCmp('pan_ang').disable();
Ext.getCmp('tilt_ang').disable();
};
}
}
},{
html: '&nbsp;'
},{
html: 'UART Port'
},{
xtype: 'combo',
fieldLabel: 'UART Port',
lazyRender: true,
id: 'uart_id',
mode: 'local',
disabled: true,
store: new Ext.data.ArrayStore({
fields: ['uart','uart_txt'],
data: [
<?php
$QS="SELECT sc.aux_id, CONCAT( nd.name, \":\", sc.name ) as name FROM sockets sc LEFT JOIN nodes nd ON ( sc.node_id = nd.id ) WHERE sc.type = {$SiteID} AND nd.site_id = 1 AND ( nd.type = 0 OR nd.type = 20 )";
$R = $DATABASE->Query( $QS );
$P = array();
foreach( $R as $RR ){
$P[] = "[{$RR['aux_id']}, '{$RR['name']}']";
};
echo implode( ",", $P );
?>
]
}),
valueField: 'uart',
displayField: 'uart_txt'
},{
html: '&nbsp;'
},{
html: 'Camera ID'
},{
xtype: 'numberfield',
id: 'prot_id',
width: '95%',
disabled: true,
minValue: 0,
maxValue: 255
},{
html: '&nbsp;'
},{
html: 'Pan Model'
},{
xtype: 'combo',
fieldLabel: 'Pan Model',
lazyRender: true,
id: 'pan_mode',
disabled: true,
mode: 'local',
store: new Ext.data.ArrayStore({
fields: ['pm','pm_txt'],
data: [
[0,'Regular'],
[1,'Reversed']
]
}),
valueField: 'pm',
displayField: 'pm_txt'
},{
html: '&nbsp;'
},{
html: 'Tottal Pan Angles'
},{
xtype: 'numberfield',
id: 'pan_ang',
width: '95%',
disabled: true,
minValue: 0,
maxValue: 360
},{
html: '&nbsp;'
},{
html: 'Tilt Model'
},{
xtype: 'combo',
fieldLabel: 'Tilt Model',
lazyRender: true,
id: 'tilt_mode',
disabled: true,
mode: 'local',
store: new Ext.data.ArrayStore({
fields: ['tm','tm_txt'],
data: [
[0,'Regular'],
[1,'Reversed'],
[2,'Shifted 90°'],
[3,'Rev-Shifted 90°']
]
}),
valueField: 'tm',
displayField: 'tm_txt'
},{
html: '&nbsp;'
},{
html: 'Tottal Tilt Angles'
},{
xtype: 'numberfield',
id: 'tilt_ang',
width: '95%',
disabled: true,
minValue: 0,
maxValue: 180
},{
html: '&nbsp;'
}]
}]
},{ },{
id: 'cam_pos_yaw',
xtype: 'textfield',
width: 70
title: '<?=$Labels->GetLabel('_ADV_TAB_');?>',
disabled: true,
layout: 'table',
id: 'loc_tab',
border: false,
defaults: {
// applied to each contained panel
border: false,
frame: false,
bodyStyle: 'text-align:right;padding-left:10px;padding-right:10px;'
},
layoutConfig: {
columns: 3
},
items: [{
html: '<?=$Labels->GetLabel('_CAM_MAP_NAME_');?>:'
},{
id: 'cam_label',
xtype: 'textfield',
width: 200
},{
html: '&nbsp;'
}]
}] }]
},{
html: '<center><img width="200px" id="pic_prev" src="/style/img/cam_cap0.png"></center>',
width: '100%'
}],bbar:[{
text: 'Cancel',
}],
bbar:[{
text: '<?=$Labels->GetLabel('_CANCEL_');?>',
handler: function(){ handler: function(){
//addDialog.close(); //addDialog.close();
//addDialog = null; //addDialog = null;
connectOnvifDialog.hide();
connectCamDialog.hide();
//connectOnvifDialog = null; //connectOnvifDialog = null;
} }
},'->',{ },'->',{
text: 'Add Camera to Map', text: 'Add Camera to Map',
id: 'acm_btn',
disabled: true,
handler: function(){ handler: function(){
p_lon = Ext.getCmp('cam_pos_lon').getValue();
p_lat = Ext.getCmp('cam_pos_lat').getValue();
p_alt = Ext.getCmp('cam_pos_alt').getValue();
p_pitch = Ext.getCmp('cam_pos_pitch').getValue();
p_roll = Ext.getCmp('cam_pos_roll').getValue();
p_yaw = Ext.getCmp('cam_pos_yaw').getValue();
Ext.Ajax.request({
url: '/lib/controller/AddCameraNode.php',
params: {
NID: <?=$SiteID;?>,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>',
CID: SelectedCam,
LAT: p_lat,
LON: p_lon,
ALT: p_alt,
PCH: p_pitch,
ROL: p_roll,
YAW: p_yaw,
PTZ: ((SelectedCamPTZ)?1:0)
},
success: function( response, opts ){
addDialog.close();
addDialog = null;
connectOnvifDialog.close();
connectOnvifDialog = null;
},
failure: function( response, opts ) {
//Ext.fly('some_div').update('Fail!');
}/*,
callback: function(options,success,response){
// use this if you need to perform your own success/failure checking
}*/
});
var CLAB = Ext.getCmp('cam_label').getValue();
var CPTZP = Ext.getCmp('ptz_proto').getValue();
var CPTZU = Ext.getCmp('uart_id').getValue();
var CPTZID = Ext.getCmp('prot_id').getValue();
var CPANM = Ext.getCmp('pan_mode').getValue();
var CTILTM = Ext.getCmp('tilt_mode').getValue();
var CPANANG = Ext.getCmp('pan_ang').getValue();
var CTILTANG = Ext.getCmp('tilt_ang').getValue();
var CIMAGER = Ext.getCmp('sens_size').getValue();
var CMINF = Ext.getCmp('min_foc').getValue();
var CMAXF = Ext.getCmp('max_foc').getValue();
if( CLAB != '' ){
Ext.Ajax.request({
url: '/lib/controller/AddCameraNode.php',
params: {
NID: <?=$SiteID;?>,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>',
CID: SelectedCam,
LAB: CLAB,
UART: CPTZU,
PROTOID: CPTZID,
PANMODE: CPANM,
TILTMODE: CTILTM,
PANANG: CPANANG,
TILTANG: CTILTANG,
IMSIZE: CIMAGER,
FMIN: CMINF,
FMAX: CMAXF,
PTZ: CPTZP
},
success: function( response, opts ){
addIpCamDialog.close();
addIpCamDialog = null;
connectCamDialog.close();
connectCamDialog = null;
},
failure: failureAJAXFunction
});
} else {
Ext.Msg.show({
title:'Data Error!',
msg: 'Please Provide Camera Name!',
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.INFO
});
};
} }
}] }]
});
};
connectOnvifDialog.show();
});
} else {
};
connectCamDialog.show();
};
function connectToSeleced(){
CamPropType = 1;
if( SelectedCam > 0 ){
showCamPropDialog();
preloadOnvifCredentials( SelectedCam ); preloadOnvifCredentials( SelectedCam );
//loadCameraSettings( SelectedCam );
}; };
}; };
function addIpCam(){ function addIpCam(){
if( addDialog == null ){
addDialog = new Ext.Window({
if( addIpCamDialog == null ){
addIpCamDialog = new Ext.Window({
modal: true, modal: true,
title: 'Add IP Camera',
title: '<?=$Labels->GetLabel('_DET_IP_CAMERA_LST_');?>',
width: 800, width: 800,
height: 600, height: 600,
layout: 'fit', layout: 'fit',
@ -449,33 +793,27 @@ function addIpCam(){
ds: cameraListStore, ds: cameraListStore,
cm: cameraListColModel, cm: cameraListColModel,
sm: cameraListSelModel, sm: cameraListSelModel,
//listeners:{
// beforedestroy: function( t ){
// addDialog = null;
// return true;
// }
//},
viewConfig: { viewConfig: {
forceFit: true forceFit: true
}, },
bbar: [{ bbar: [{
text: 'Cancel',
handler: function(){//discoverOnvifSources
addDialog.hide();
text: '<?=$Labels->GetLabel('_CANCEL_');?>',
handler: function(){
addIpCamDialog.hide();
} }
},'->',{ },'->',{
id: 'con_to_src', id: 'con_to_src',
text: 'Connect To Selected',
text: '<?=$Labels->GetLabel('_CONNECT_2_SEL_');?>',
disabled: ( SelectedCam == 0 ), disabled: ( SelectedCam == 0 ),
handler: connectToSeleced handler: connectToSeleced
}] }]
} }
}); });
}; };
addDialog.show();
addIpCamDialog.show();
cameraListStore.load({params:{start:0, limit:50}}); cameraListStore.load({params:{start:0, limit:50}});
}; };
var addE2UDialog = null;
function addEthernet2Uart(){ function addEthernet2Uart(){
if( addE2UDialog == null ){ if( addE2UDialog == null ){
addE2UDialog = new Ext.Window({ addE2UDialog = new Ext.Window({
@ -605,12 +943,7 @@ function addEthernet2Uart(){
addE2UDialog.hide(); addE2UDialog.hide();
}, },
failure: function( response, opts ) { failure: function( response, opts ) {
Ext.Msg.show({
title:'Request Failure!',
msg: 'Ajax Request failed!',
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.INFO
});
failureAJAXFunction( response, opts );
addE2UDialog.hide(); addE2UDialog.hide();
} }
}); });

61
lib/javascript/jsapi_dynamic/rgoose_dashboard.js

@ -3,28 +3,23 @@
function updateDashBoardItemLayout( id, x, y ){ function updateDashBoardItemLayout( id, x, y ){
Ext.Ajax.request({ Ext.Ajax.request({
url: '/lib/controller/updateDashBoardItems.php',
params: {
SITE: <?=$SiteID;?>,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>',
PANEL: id,
X: x,
Y: y
url: '/lib/controller/updateDashBoardItems.php',
params: {
SITE: <?=$SiteID;?>,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>',
PANEL: id,
X: x,
Y: y
}, },
success: function( response, opts ){ success: function( response, opts ){
//var data = Ext.decode(response.responseText); //var data = Ext.decode(response.responseText);
//var tPanel = Ext.getCmp('main_portal');
//tPanel.removeAll(true);
//for( i=0; i < data.length; i++) tPanel.add( data[i] );
//tPanel.doLayout();
},
failure: function( response, opts ) {
//var tPanel = Ext.getCmp('main_portal');
//tPanel.remove(0);
//tPanel.add( { html: 'Failed to load dashboard!' } );
//tPanel.doLayout();
}
//var tPanel = Ext.getCmp('main_portal');
//tPanel.removeAll(true);
//for( i=0; i < data.length; i++) tPanel.add( data[i] );
//tPanel.doLayout();
},
failure: failureAJAXFunction
}); });
}; };
@ -39,25 +34,25 @@ function cleanupDraw( a ){
img.style='display: none;'; img.style='display: none;';
}; };
function DrawTargets( a, b ){
var canvas = document.getElementById('targ_canvas_'+a );
function DrawTargets( k, b ){
var canvas = document.getElementById('targ_canvas_'+k );
var ctx = canvas.getContext('2d'); var ctx = canvas.getContext('2d');
var img = document.getElementById('draw_img_'+a );
var img = document.getElementById('draw_img_'+k );
ctx.drawImage( img, 0, 0 ); ctx.drawImage( img, 0, 0 );
canvas.style='display: block;'; canvas.style='display: block;';
img.style='display: none;'; img.style='display: none;';
for( var i=0; i< b.length; i++ ){ for( var i=0; i< b.length; i++ ){
switch( drawZoomLevels[a] ){
switch( drawZoomLevels[k] ){
case 12:{ case 12:{
if( b[i].digital < 256 ){ if( b[i].digital < 256 ){
var cc = 255 - i ;//* ( 255 / 33 ); var cc = 255 - i ;//* ( 255 / 33 );
ctx.fillStyle = "#" + cc.toString(16) + "0000"; ctx.fillStyle = "#" + cc.toString(16) + "0000";
//ctx.strokeStyle = "#FF0000"; //ctx.strokeStyle = "#FF0000";
var r = (196 / 256) * b[i].digital;
var r = (196 * b[i].digital)/ 256;
var a = -1.0 * b[i].az * ( Math.PI / 180 ); var a = -1.0 * b[i].az * ( Math.PI / 180 );
var x = 100 + Math.cos( a ) * r; var x = 100 + Math.cos( a ) * r;
var y = 100 + Math.sin( a ) * r; var y = 100 + Math.sin( a ) * r;
ctx.fillRect( x, y, 6, 6 );
ctx.fillRect( x, y, 24, 24 );
}; };
break; break;
}; };
@ -66,11 +61,11 @@ function DrawTargets( a, b ){
var cc = 255 - i ;//* ( 255 / 33 ); var cc = 255 - i ;//* ( 255 / 33 );
ctx.fillStyle = "#" + cc.toString(16) + "0000"; ctx.fillStyle = "#" + cc.toString(16) + "0000";
//ctx.strokeStyle = "#FF0000"; //ctx.strokeStyle = "#FF0000";
var r = (196 / 512) * b[i].digital;
var r = (196 * b[i].digital)/ 512;
var a = -1.0 * b[i].az * ( Math.PI / 180 ); var a = -1.0 * b[i].az * ( Math.PI / 180 );
var x = 100 + Math.cos( a ) * r; var x = 100 + Math.cos( a ) * r;
var y = 100 + Math.sin( a ) * r; var y = 100 + Math.sin( a ) * r;
ctx.fillRect( x, y, 5, 5 );
ctx.fillRect( x, y, 12, 12 );
}; };
break; break;
}; };
@ -79,19 +74,19 @@ function DrawTargets( a, b ){
var cc = 255 - i ;//* ( 255 / 33 ); var cc = 255 - i ;//* ( 255 / 33 );
ctx.fillStyle = "#" + cc.toString(16) + "0000"; ctx.fillStyle = "#" + cc.toString(16) + "0000";
//ctx.strokeStyle = "#FF0000"; //ctx.strokeStyle = "#FF0000";
var r = (196 / 1024) * b[i].digital;
var r = (196 * b[i].digital) / 1024;
var a = -1.0 * b[i].az * ( Math.PI / 180 ); var a = -1.0 * b[i].az * ( Math.PI / 180 );
var x = 100 + Math.cos( a ) * r; var x = 100 + Math.cos( a ) * r;
var y = 100 + Math.sin( a ) * r; var y = 100 + Math.sin( a ) * r;
ctx.fillRect( x, y, 4, 4 );
ctx.fillRect( x, y, 6, 6 );
}; };
break; break;
}; };
default:{
case 100:{
var cc = 255 - i ;//* ( 255 / 33 ); var cc = 255 - i ;//* ( 255 / 33 );
ctx.fillStyle = "#" + cc.toString(16) + "0000"; ctx.fillStyle = "#" + cc.toString(16) + "0000";
//ctx.strokeStyle = "#FF0000"; //ctx.strokeStyle = "#FF0000";
var r = (196 / 2048) * b[i].digital;
var r = (196 * b[i].digital)/ 2048;
var a = -1.0 * b[i].az * ( Math.PI / 180 ); var a = -1.0 * b[i].az * ( Math.PI / 180 );
var x = 100 + Math.cos( a ) * r; var x = 100 + Math.cos( a ) * r;
var y = 100 + Math.sin( a ) * r; var y = 100 + Math.sin( a ) * r;
@ -137,9 +132,7 @@ function fetchSiteStatus(){
}; };
}; };
}, },
failure: function( response, opts ) {
}
failure: failureAJAXFunction
}); });
}; };

93
lib/javascript/jsapi_dynamic/rgoose_devices_module.js

@ -40,29 +40,57 @@ var LRF2D2_st_win = null;
var LRF16D3_st_win = null; var LRF16D3_st_win = null;
function loadFullLRF1D2Data( NodeID ){ function loadFullLRF1D2Data( NodeID ){
if( LRF1D2_st_win == null ) return;
Ext.Ajax.request({ Ext.Ajax.request({
url: '/lib/controller/getSettingsLidsr3D.php',
url: '/lib/controller/getSettingsLRF.php',
params: { params: {
NID: NodeID, NID: NodeID,
UID: '<?=$CUser->Data['id'];?>', UID: '<?=$CUser->Data['id'];?>',
SID: '<?=$Session;?>', SID: '<?=$Session;?>',
}, },
success: function( response, opts ){ success: function( response, opts ){
var data = Ext.decode(response.responseText);
Ext.getCmp('setting_master_ip').setValue( data.ip_address );
Ext.getCmp('setting_master_port').setValue( data.port );
Ext.getCmp('setting_slave_ip').setValue( data.aux_ip_address );
Ext.getCmp('setting_slave_port').setValue( data.aux_port );
Ext.getCmp('setting_lat').setValue( data.lat );
Ext.getCmp('setting_lon').setValue( data.lon );
Ext.getCmp('setting_alt').setValue( data.alt );
Ext.getCmp('setting_roll').setValue( data.roll );
Ext.getCmp('setting_pitch').setValue( data.pitch );
Ext.getCmp('setting_yaw').setValue( data.yaw );
if( LRF1D2_st_win!= null ){
var data = Ext.decode(response.responseText);
if( data.online ){
switch( data.data_status ){
case 0: Ext.getCmp('dev_online').update('<p class="green_status">ONLINE/Data Incomplete</p>'); break;
case 1: Ext.getCmp('dev_online').update('<p class="green_status">ONLINE/Synced</p>'); break;
case 2: Ext.getCmp('dev_online').update('<p class="green_status">ONLINE/Data Not Applyed</p>'); break;
};
} else {
switch( data.data_status ){
case 0: Ext.getCmp('dev_online').update('<p class="blue_status">OFFLINE/Data Incomplete</p>'); break;
case 1: Ext.getCmp('dev_online').update('<p class="blue_status">OFFLINE/Synced</p>'); break;
case 2: Ext.getCmp('dev_online').update('<p class="blue_status">OFFLINE/Data Not Applyed</p>'); break;
};
};
Ext.getCmp('dev_name').setValue( data.name );
Ext.getCmp('serial_num').setValue( data.serial );
Ext.getCmp('version_id').setValue( data.version );
Ext.getCmp('device_id').setValue( data.device_id );
Ext.getCmp('com_spd').setValue( data.com_spd );
Ext.getCmp('max_range').setValue( data.max_range );
Ext.getCmp('base_shift').setValue( data.base_shift );
Ext.getCmp('com_spd').setValue( data.uart_speed );
Ext.getCmp('mlrf_offset').setValue( data.m_offset );
Ext.getCmp('slrf_offset').setValue( data.s_offset );
Ext.getCmp('mlrf_delta').setValue( data.m_delta );
Ext.getCmp('slrf_delta').setValue( data.s_delta );
Ext.getCmp('mlrf_width').setValue( data.m_width );
Ext.getCmp('slrf_width').setValue( data.s_width );
Ext.getCmp('mlrf_order').setValue( data.m_order );
Ext.getCmp('slrf_order').setValue( data.s_order );
Ext.getCmp('mlrf_sst').setValue( data.m_sst );
Ext.getCmp('slrf_sst').setValue( data.s_sst );
Ext.getCmp('mlrf_flip').setValue( data.m_flip );
Ext.getCmp('slrf_flip').setValue( data.s_flip );
Ext.getCmp('mlrf_sun').setValue( data.m_sun );
Ext.getCmp('slrf_sun').setValue( data.s_sun );
};
}, },
failure: function( response, opts ) {
//Ext.fly('some_div').update('Fail!');
}
failure: failureAJAXFunction
}); });
}; };
@ -85,17 +113,27 @@ function LRF1D2_settings(){
bodyStyle:'padding:20px' bodyStyle:'padding:20px'
}, },
layoutConfig: { layoutConfig: {
columns: 2
columns: 3
}, },
items:[{ items:[{
html: 'Status', html: 'Status',
frame: false, frame: false,
border: false border: false
},{ },{
html: '<p class="green">ONLINE</p>',
html: '<p class="green_status">ONLINE</p>',
id: 'dev_online',
frame: false,
border: false
},{},{
html: 'Device Title',
frame: false, frame: false,
border: false border: false
},{ },{
xtype: 'field',
id: 'dev_name',
readOnly: false,
value: 'KOKO'
},{},{
html: 'Serial Number', html: 'Serial Number',
frame: false, frame: false,
border: false border: false
@ -104,7 +142,7 @@ function LRF1D2_settings(){
id: 'serial_num', id: 'serial_num',
readOnly: true, readOnly: true,
value: '1212' value: '1212'
},{
},{},{
html: 'Version ID', html: 'Version ID',
frame: false, frame: false,
border: false border: false
@ -113,16 +151,13 @@ function LRF1D2_settings(){
id: 'version_id', id: 'version_id',
readOnly: true, readOnly: true,
value: 'LiberManDA122' value: 'LiberManDA122'
},{
},{},{
html: 'Device Adress', html: 'Device Adress',
frame: false, frame: false,
border: false border: false
},{ },{
xtype: 'numberfield', xtype: 'numberfield',
id: 'device_id' id: 'device_id'
},{
frame: false,
border: false
},{ },{
xtype: 'button', xtype: 'button',
id: 'upddiBTN', id: 'upddiBTN',
@ -147,6 +182,7 @@ function LRF1D2_settings(){
editable: false, editable: false,
typeAhead: true, typeAhead: true,
triggerAction: 'all', triggerAction: 'all',
width: '100%',
lazyRender:true, lazyRender:true,
mode: 'local', mode: 'local',
store: new Ext.data.ArrayStore({ store: new Ext.data.ArrayStore({
@ -156,9 +192,6 @@ function LRF1D2_settings(){
}), }),
valueField: 'mySPD', valueField: 'mySPD',
displayField: 'displayText' displayField: 'displayText'
},{
frame: false,
border: false
},{ },{
xtype: 'button', xtype: 'button',
id: 'updspBTN', id: 'updspBTN',
@ -182,7 +215,7 @@ function LRF1D2_settings(){
id: 'max_range', id: 'max_range',
readOnly: true, readOnly: true,
value: '1212' value: '1212'
},{
},{},{
html: 'Base Shift', html: 'Base Shift',
frame: false, frame: false,
border: false border: false
@ -191,7 +224,7 @@ function LRF1D2_settings(){
id: 'base_shift', id: 'base_shift',
readOnly: true, readOnly: true,
value: '1212' value: '1212'
}]
},{}]
},{ },{
title: 'Mantenence', title: 'Mantenence',
xtype: 'form', xtype: 'form',
@ -429,11 +462,9 @@ function LRF1D2_settings(){
minValue: 0 minValue: 0
}] }]
},{ },{
title: 'Camera/DC Settings'
},{
title: 'Width Table'
title: 'Embed Options'
},{ },{
title: 'Zoom/Tilt Table'
title: 'Target Width Table'
}] }]
} }
}); });

82
lib/javascript/jsapi_dynamic/rgoose_location_editor.js

@ -543,7 +543,11 @@ var SITEZ_Icon = L.icon({
var locationSelectedNode = 0; var locationSelectedNode = 0;
function loadLoactionProps( e ){ function loadLoactionProps( e ){
locationSelectedNode = e.sourceTarget.options.mycustomid;
if( typeof e == 'number' ){
locationSelectedNode = e;
} else {
locationSelectedNode = e.sourceTarget.options.mycustomid;
}
loadNodeLocationProps( locationSelectedNode ); loadNodeLocationProps( locationSelectedNode );
}; };
@ -562,9 +566,7 @@ function updateSiteAnchor(){
LON: SiteLon, LON: SiteLon,
ALT: SiteAlt ALT: SiteAlt
}, },
failure: function(){
alert( 'Error' );
}
failure: failureAJAXFunction
}); });
}; };
@ -589,9 +591,7 @@ function updateLocationOrientation(){
ROLL: tRoll, ROLL: tRoll,
PITCH: tPitch PITCH: tPitch
}, },
failure: function(){
alert( 'Error' );
}
failure: failureAJAXFunction
}); });
}; };
@ -609,9 +609,9 @@ function updateLocation( e ){
LON: e.target._latlng.lng LON: e.target._latlng.lng
}, },
success: function( response, opts ){ success: function( response, opts ){
//var data = Ext.decode(response.responseText);
loadNodeLocationProps( locationSelectedNode );
}
loadNodeLocationProps( locationSelectedNode );
},
failure: failureAJAXFunction
}); });
}; };
@ -629,9 +629,9 @@ function setNodeLocationToAnchor(){
ALT: SiteAlt ALT: SiteAlt
}, },
success: function( response, opts ){ success: function( response, opts ){
//loadNodeLocationProps( locationSelectedNode );
loadLocationEditor(); loadLocationEditor();
}
},
failure: failureAJAXFunction
}); });
}; };
@ -877,9 +877,7 @@ function loadNodeLocationProps( NodeID ){
tPanel.add( data ); tPanel.add( data );
tPanel.doLayout(); tPanel.doLayout();
}, },
failure: function( response, opts ) {
//Ext.fly('some_div').update('Fail!');
}
failure: failureAJAXFunction
}); });
}; };
@ -899,9 +897,7 @@ function LoadNodesList(){
tPanel.add( data ); tPanel.add( data );
tPanel.doLayout(); tPanel.doLayout();
}, },
failure: function( response, opts ) {
//Ext.fly('some_div').update('Fail!');
}
failure: failureAJAXFunction
}); });
}; };
@ -1012,9 +1008,55 @@ function loadLocationEditor(){
} }
}); });
tPanel.doLayout(); tPanel.doLayout();
map = L.map('location_map').setView([SiteLat, SiteLon], 17);
L.marker([SiteLat, SiteLon], { draggable: false, icon: SITEZ_Icon } ).addTo(map).on('click', LoadNodesList ).bindPopup("<b><?=$Labels->GetLabel('_SYS_ANCHORT_LBL_');?></b>");//.openPopup();
map = L.map('location_map',{
attributionControl: true,
//preferCanvas: true,
zoomControl: true,
center: [SiteLat, SiteLon],
/*zoomControl: false,
zoom: 17,
minZoom: 17,
maxZoom: 17,*/
keyboard: false
}).setView([SiteLat, SiteLon], 17);
L.marker([SiteLat, SiteLon], { draggable: false, icon: SITEZ_Icon, zIndexOffset: 1000 } ).addTo(map).on('click', LoadNodesList ).bindPopup("<b><?=$Labels->GetLabel('_SYS_ANCHORT_LBL_');?></b>");//.openPopup();
/*
Ext.Ajax.request({
url: '/lib/controller/getNetwork.php',
params: {
NID: selectedSite,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>'
},
success: function( response, opts ){
/*
layout: { improvedLayout: false }
physics: { enabled: true}
For the node, set a property called fixed:
fixed: { x: true , y: true }
Here is the son of the node:
{id: 1, value: 2, label: 'xx' , x: 320, y:170 , fixed: { x: true , y: true } }
// If the response is JSON, you have to decode it
var data = Ext.decode(response.responseText);
netwodkData.nodes = new vis.DataSet( data.nodes );
netwodkData.edges = new vis.DataSet( data.edges );
//map.createPane( 'my_network' );
//map.getPane('my_network').style.zIndex = 1650;
//map.getPane('my_network').style.pointerEvents = 'none';
//map.getPane('my_network').innerHTML = "<div id=\"net_cont\" style=\"width: 640px; height: 500px;\"></div>";
//var container = document.getElementById(Ext.getCmp('net_cont').body.id);
//var container = document.getElementById( 'net_cont' );
var container =map.getPane('markerPane');
networkObj = new vis.Network( container, netwodkData, networkOpts );
},
failure: function( response, opts ) {
//Ext.fly('some_div').update('Fail!');
}
});
*/
/* /*
var map = L.map('map', { var map = L.map('map', {
crs: L.CRS.Simple crs: L.CRS.Simple

245
lib/javascript/jsapi_dynamic/rgoose_logs.js

@ -0,0 +1,245 @@
//<?php require_once('../../js_asm.php'); ?>
var um_selected_log_id = 0;
var um_server_log_store = new Ext.data.JsonStore({
root: 'records',
totalProperty: 'totalCount',
idProperty: 'id',
remoteSort: true,
fields: [{
name: 'id',
type: 'int'
},{
name: 'ts',
type: 'string'
},{
name: 'ptr',
type: 'string'
},{
name: 'module',
type: 'string'
},{
name: 'msg',
type: 'string'
}],
proxy : new Ext.data.HttpProxy({
method: 'POST',
prettyUrls: false,
url: '/lib/controller/listServerLog.php',
headers: {
UID: <?=$UserID;?>,
SID: '<?=$Session;?>'
}
})
});
var um_server_log_col_model_opt = {
columns: [
{header: "id", width: 50, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', dataIndex: 'id' },
{header: "<?=$Labels->GetLabel("_DATETIME_");?>", width: 150, sortable: false, fixed: true, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'ts' },
{header: "<?=$Labels->GetLabel("_POINTER_");?>", width: 100, sortable: false, fixed: true, menuDisabled: true, /*renderer: camCapRenderer,*/ dataIndex: 'ptr' },
{header: "<?=$Labels->GetLabel("_MODULE_");?>", width: 100, sortable: false, fixed: true, menuDisabled: true, /*renderer: camCapRenderer,*/ dataIndex: 'module' },
{header: "<?=$Labels->GetLabel("_INFO_");?>", resizable: true, sortable: false, fixed: false, flex: 1, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'msg' }
],
defaults: {
sortable: false,
menuDisabled: true,
width: 100
}
};
var um_log_sel_model_opt = {
singleSelect: true,
listeners: {
rowselect: function(sm, row, rec) {
um_selected_log_id = rec.data.id;
}
}
};
var um_access_log_store = new Ext.data.JsonStore({
root: 'records',
totalProperty: 'totalCount',
idProperty: 'id',
remoteSort: true,
fields: [{
name: 'id',
type: 'int'
},{
name: 'user',
type: 'string'
},{
name: 'ts',
type: 'string'
},{
name: 'cmd',
type: 'int'
},{
name: 'data_line',
type: 'string'
}],
proxy : new Ext.data.HttpProxy({
method: 'POST',
prettyUrls: false,
url: '/lib/controller/listAccessLog.php',
headers: {
UID: <?=$UserID;?>,
SID: '<?=$Session;?>'
}
})
});
function um_action_renderer( val ){
switch( val ){
case 1: return 'login';
case 145: return 'resize screen';
};
return 'unknown action';
};
var um_access_log_col_model_opt = {
columns: [
{header: "id", width: 50, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', dataIndex: 'id' },
{header: "<?=$Labels->GetLabel("_USER_");?>",width: 80, sortable: false, fixed: true, menuDisabled: true, /*renderer: camCapRenderer,*/ dataIndex: 'user' },
{header: "<?=$Labels->GetLabel("_DATETIME_");?>", width: 150, sortable: false, fixed: true, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'ts' },
{header: "<?=$Labels->GetLabel("_ACTION_");?>", width: 150, sortable: false, fixed: true, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', renderer: um_action_renderer, dataIndex: 'cmd' },
{header: "<?=$Labels->GetLabel("_INFO_");?>", resizable: true, sortable: false, fixed: false, flex: 1, dataindex: 'data_line' }
],
defaults: {
sortable: false,
menuDisabled: true,
width: 100
}
};
var um_access_log_sel_model_opt = {
singleSelect: true,
listeners: {
rowselect: function(sm, row, rec) {
um_selected_log_id = rec.data.id;
}
}
};
function loadAccessLog(){
if( tlInterval!= null ){
window.clearInterval( tlInterval );
tlInterval = null;
timelineObj = null;
};
var tPanel = Ext.getCmp('main_portal');
tPanel.removeAll( true );
Ext.getCmp('main_content').setTitle( '<?=$Labels->GetLabel("_ACCESS_LOG_");?>' );
tPanel.add({
columnWidth: 1.0,
frame: false,
border: false,
items: [{
xtype: 'panel',
layout: 'fit',
layoutConfig: {
align : 'stretch',
pack : 'start'
},
height: PanelH-5,
flex: 1,
frame: false,
border: false,
items:{
frame: false,
height: PanelH-5,
xtype: 'grid',
forceFit: true,
viewConfig: {
forceFit: true
},
ds: um_access_log_store,
cm: new Ext.grid.ColumnModel( um_access_log_col_model_opt ),
sm: new Ext.grid.RowSelectionModel( um_log_sel_model_opt )
},tbar: [{
xtype: 'button',
id: 'um_access_reload_btn',
text: '<?=$Labels->GetLabel("_RELOAD_");?>',
handler: function(){
um_access_log_store.reload();
}
}]
}]
});
tPanel.doLayout();
um_selected_log_id = 0;
um_access_log_store.reload();
};
function loadServerLog(){
if( tlInterval!= null ){
window.clearInterval( tlInterval );
tlInterval = null;
timelineObj = null;
};
var tPanel = Ext.getCmp('main_portal');
tPanel.removeAll( true );
Ext.getCmp('main_content').setTitle( '<?=$Labels->GetLabel("_SERVER_LOG_");?>' );
tPanel.add({
columnWidth: 1.0,
frame: false,
border: false,
items: [{
xtype: 'panel',
layout: 'fit',
layoutConfig: {
align : 'stretch',
pack : 'start'
},
height: PanelH-5,
flex: 1,
frame: false,
border: false,
items:{
frame: false,
height: PanelH-5,
xtype: 'grid',
forceFit: true,
viewConfig: {
forceFit: true
},
ds: um_server_log_store,
cm: new Ext.grid.ColumnModel( um_server_log_col_model_opt ),
sm: new Ext.grid.RowSelectionModel( um_log_sel_model_opt )
},tbar: [{
xtype: 'button',
id: 'um_server_reload_btn',
text: '<?=$Labels->GetLabel("_RELOAD_");?>',
handler: function(){
um_server_log_store.reload();
}
},{
xtype: 'button',
id: 'um_server_clean_btn',
text: '<?=$Labels->GetLabel("_CLEAR_");?>',
handler: function(){
Ext.Ajax.request({
url: '/lib/controller/clearServerLog.php',
params: {
NID: NID,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>'
},
success: function( response, opts ){
um_server_log_store.reload();
}
});
}
}]
}]
});
tPanel.doLayout();
um_selected_log_id = 0;
um_server_log_store.reload();
tlInterval = window.setInterval( um_server_log_store.reload, 333, 0 );
};

52
lib/javascript/jsapi_dynamic/rgoose_main.js

@ -10,28 +10,30 @@ function Refresh(){
window.location="/?t="+123; window.location="/?t="+123;
}; };
function updateUserScreenResolution( x, y ){
Ext.Ajax.request({
url: '/lib/controller/updateUserSettings.php',
params: {
SAID: <?=$SiteID;?>,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>',
SSS: 15,
WID: x,
HEI: y
},
success: function( response, opts ){
Refresh();
},
failure: function( response, opts ) {
Ext.Msg.show({
function failureAJAXFunction( responce, opts ){
Ext.Msg.show({
title:'Request Failure!', title:'Request Failure!',
msg: 'Ajax Request failed!', msg: 'Ajax Request failed!',
buttons: Ext.Msg.OK, buttons: Ext.Msg.OK,
icon: Ext.MessageBox.INFO icon: Ext.MessageBox.INFO
});
}
});
};
function updateUserScreenResolution( x, y ){
Ext.Ajax.request({
url: '/lib/controller/updateUserSettings.php',
params: {
SAID: <?=$SiteID;?>,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>',
SSS: 15,
WID: x,
HEI: y
},
success: function( response, opts ){
Refresh();
},
failure: failureAJAXFunction
}); });
}; };
@ -170,9 +172,9 @@ Ext.onReady(function(){
xtype: 'button', xtype: 'button',
width: '100%', width: '100%',
id:'adm_acc', id:'adm_acc',
text: 'Users Management',
text: '<?=$Labels->GetLabel("_USERS_MNGMT_");?>',
handler: function( b, e ){ handler: function( b, e ){
window.location = '/login.php?UID=1';
loadUserEditor();
} }
},{ },{
xtype: 'button', xtype: 'button',
@ -180,7 +182,15 @@ Ext.onReady(function(){
id:'adm_acclog', id:'adm_acclog',
text: 'Access Log', text: 'Access Log',
handler: function( b, e ){ handler: function( b, e ){
window.location = '/login.php?UID=1';
loadAccessLog();
}
},{
xtype: 'button',
width: '100%',
id:'adm_servlog',
text: 'Server Log',
handler: function( b, e ){
loadServerLog();
} }
}] }]
} }

190
lib/javascript/jsapi_dynamic/rgoose_sysmap_editor.js

@ -28,12 +28,7 @@ function loadSettingsLidar3D( NodeID, Master ){
Ext.getCmp('setting_pitch').setValue( data.pitch ); Ext.getCmp('setting_pitch').setValue( data.pitch );
Ext.getCmp('setting_yaw').setValue( data.yaw ); Ext.getCmp('setting_yaw').setValue( data.yaw );
}, },
failure: function( response, opts ) {
//Ext.fly('some_div').update('Fail!');
}/*,
callback: function(options,success,response){
// use this if you need to perform your own success/failure checking
}*/
failure: failureAJAXFunction
}); });
}; };
@ -93,12 +88,7 @@ function SaveSettingsLidar3D( ){
}); });
}; };
}, },
failure: function( response, opts ) {
//Ext.fly('some_div').update('Fail!');
}/*,
callback: function(options,success,response){
// use this if you need to perform your own success/failure checking
}*/
failure: failureAJAXFunction
}); });
}; };
@ -219,12 +209,7 @@ function reloadNetworkData(){
networkObj.setData( netwodkData ); networkObj.setData( netwodkData );
networkObj.redraw(); networkObj.redraw();
}, },
failure: function( response, opts ) {
//Ext.fly('some_div').update('Fail!');
}/*,
callback: function(options,success,response){
// use this if you need to perform your own success/failure checking
}*/
failure: failureAJAXFunction
}); });
}; };
@ -241,12 +226,7 @@ function createNode( STYPE ){
// If the response is JSON, you have to decode it // If the response is JSON, you have to decode it
reloadNetworkData( <?=$SiteID;?> ); reloadNetworkData( <?=$SiteID;?> );
}, },
failure: function( response, opts ) {
//Ext.fly('some_div').update('Fail!');
}/*,
callback: function(options,success,response){
// use this if you need to perform your own success/failure checking
}*/
failure: failureAJAXFunction
}); });
}; };
@ -275,12 +255,7 @@ function loadNodeSockets( NID, store ){
}; };
//Ext.getCmp('zigzag').getEl().unmask(); //Ext.getCmp('zigzag').getEl().unmask();
}, },
failure: function( response, opts ) {
//Ext.fly('some_div').update('Fail!');
}/*,
callback: function(options,success,response){
// use this if you need to perform your own success/failure checking
}*/
failure: failureAJAXFunction
}); });
}; };
@ -365,28 +340,24 @@ function createConnection( SID, EID, CTY ){
function loadNodeProperties( NodeID ){ function loadNodeProperties( NodeID ){
//alert( 'Node: ' + NodeID ); //alert( 'Node: ' + NodeID );
SelectedNodeID = NodeID;
Ext.Ajax.request({ Ext.Ajax.request({
url: '/lib/controller/getNetworkNodeProps.php', url: '/lib/controller/getNetworkNodeProps.php',
params: { params: {
NID: <?=$SiteID;?>,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>',
NODE: NodeID
NID: <?=$SiteID;?>,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>',
NODE: NodeID
}, },
success: function( response, opts ){ success: function( response, opts ){
// If the response is JSON, you have to decode it // If the response is JSON, you have to decode it
var data = Ext.decode(response.responseText); var data = Ext.decode(response.responseText);
var tPanel = Ext.getCmp('prop_content');
tPanel.remove(0);
tPanel.add( data );
tPanel.doLayout();
var tPanel = Ext.getCmp('prop_content');
tPanel.remove(0);
tPanel.add( data );
tPanel.doLayout();
}, },
failure: function( response, opts ) {
//Ext.fly('some_div').update('Fail!');
}/*,
callback: function(options,success,response){
// use this if you need to perform your own success/failure checking
}*/
failure: failureAJAXFunction
}); });
}; };
@ -406,12 +377,7 @@ function loadServerProperties( NodeID ){
tPanel.add( data ); tPanel.add( data );
tPanel.doLayout(); tPanel.doLayout();
}, },
failure: function( response, opts ) {
//Ext.fly('some_div').update('Fail!');
}/*,
callback: function(options,success,response){
// use this if you need to perform your own success/failure checking
}*/
failure: failureAJAXFunction
}); });
}; };
@ -521,9 +487,9 @@ function module_prop_FlyHunter( module_id ){
function loadSystemEditor(){ function loadSystemEditor(){
if( tlInterval!= null ){ if( tlInterval!= null ){
window.clearInterval( tlInterval );
tlInterval = null;
timelineObj = null;
window.clearInterval( tlInterval );
tlInterval = null;
timelineObj = null;
}; };
var tPanel = Ext.getCmp('main_portal'); var tPanel = Ext.getCmp('main_portal');
tPanel.removeAll( true ); tPanel.removeAll( true );
@ -684,9 +650,9 @@ function loadSystemEditor(){
Ext.Ajax.request({ Ext.Ajax.request({
url: '/lib/controller/getNetwork.php', url: '/lib/controller/getNetwork.php',
params: { params: {
NID: selectedSite,
NID: selectedSite,
UID: <?=$UserID;?>, UID: <?=$UserID;?>,
SID: '<?=$Session;?>'
SID: '<?=$Session;?>'
}, },
success: function( response, opts ){ success: function( response, opts ){
// If the response is JSON, you have to decode it // If the response is JSON, you have to decode it
@ -699,68 +665,68 @@ function loadSystemEditor(){
//if(!connectionAddMode){ //if(!connectionAddMode){
if( !InComponentRemoveMode ){ if( !InComponentRemoveMode ){
if( params.nodes.length > 0 ){ if( params.nodes.length > 0 ){
if( netwodkData.nodes.get(params.nodes[0]).role == 'server' ){
loadServerProperties( params.nodes[0] );
} else {
loadNodeProperties( params.nodes[0] );
};
if( netwodkData.nodes.get(params.nodes[0]).role == 'server' ){
loadServerProperties( params.nodes[0] );
} else {
loadNodeProperties( params.nodes[0] );
};
} else if( params.edges.length > 0 ){ } else if( params.edges.length > 0 ){
selectedConnection = netwodkData.edges.get(params.edges[0]);
loadLinkProperties( params.edges[0], selectedConnection.from, selectedConnection.to );
selectedConnection = netwodkData.edges.get(params.edges[0]);
loadLinkProperties( params.edges[0], selectedConnection.from, selectedConnection.to );
}; };
} else { } else {
if( params.nodes.length > 0 ){ if( params.nodes.length > 0 ){
if( netwodkData.nodes.get(params.nodes[0]).role == 'server' ){ if( netwodkData.nodes.get(params.nodes[0]).role == 'server' ){
Ext.Msg.show({
title:'Remove Server Component!',
msg: 'You can not remove Server component!',
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.INFO
});
Ext.Msg.show({
title:'Remove Server Component!',
msg: 'You can not remove Server component!',
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.INFO
});
} else { } else {
Ext.Msg.show({
title:'Remove Component?',
msg: 'You are about to remove.<br/>Are you sure to do so?',
buttons: Ext.Msg.YESNOCANCEL,
fn: function( result ){
if( result=='yes' ){
Ext.Ajax.request({
url: '/lib/controller/removeNode.php',
params: {
SAID: <?=$SiteID;?>,
NID: params.nodes[0],
UID: <?=$UserID;?>,
SID: '<?=$Session;?>'
},
success: function( response, opts ){
var data = Ext.decode(response.responseText);
if( data.sucess == false ){
Ext.Msg.show({
title:'Request Failure!',
msg: data.error,
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.INFO
});
} else {
stopCreateConnection();
InComponentRemoveMode = false;
loadSystemEditor();
};
Ext.Msg.show({
title:'Remove Component?',
msg: 'You are about to remove.<br/>Are you sure to do so?',
buttons: Ext.Msg.YESNOCANCEL,
fn: function( result ){
if( result=='yes' ){
Ext.Ajax.request({
url: '/lib/controller/removeNode.php',
params: {
SAID: <?=$SiteID;?>,
NID: params.nodes[0],
UID: <?=$UserID;?>,
SID: '<?=$Session;?>'
},
success: function( response, opts ){
var data = Ext.decode(response.responseText);
if( data.sucess == false ){
Ext.Msg.show({
title:'Request Failure!',
msg: data.error,
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.INFO
});
} else {
stopCreateConnection();
InComponentRemoveMode = false;
loadSystemEditor();
};
},
failure: function( response, opts ) {
Ext.Msg.show({
title:'Request Failure!',
msg: 'Ajax Request failed!',
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.INFO
});
}
});
};
}, },
failure: function( response, opts ) {
Ext.Msg.show({
title:'Request Failure!',
msg: 'Ajax Request failed!',
buttons: Ext.Msg.OK,
icon: Ext.MessageBox.INFO
});
}
});
};
},
//animEl: 'elId',
icon: Ext.MessageBox.QUESTION
});
//animEl: 'elId',
icon: Ext.MessageBox.QUESTION
});
}; };
}; };
}; };
@ -810,8 +776,6 @@ function loadSystemEditor(){
}); });
*/ */
}, },
failure: function( response, opts ) {
//Ext.fly('some_div').update('Fail!');
}
failure: failureAJAXFunction
}); });
}; };

523
lib/javascript/jsapi_dynamic/rgoose_timeline.js

@ -1,9 +1,18 @@
//<?php require_once('../../js_asm.php'); ?>
//<?php require_once('../../js_asm.php');
$QS="SELECT * FROM sites WHERE id={$SiteID}";
$RV = $DATABASE->Query( $QS );
?>
var SiteLat=<?=$RV[0]['anchor_lat'];?>;
var SiteLon=<?=$RV[0]['anchor_lon'];?>;
var SiteAlt=<?=$RV[0]['anchor_alt'];?>;
var map = null;
var timelineObj = null; var timelineObj = null;
var tlGroups = new vis.DataSet(); var tlGroups = new vis.DataSet();
var tlItems = new vis.DataSet(); var tlItems = new vis.DataSet();
var tlOptions = { var tlOptions = {
groupOrder: 'content', // groupOrder can be a property name or a sorting function groupOrder: 'content', // groupOrder can be a property name or a sorting function
stack: true, stack: true,
@ -62,35 +71,24 @@ var eventsListStore = new Ext.data.JsonStore({
var SelectedEvent = 0; var SelectedEvent = 0;
var eventsListSelModel = new Ext.grid.RowSelectionModel({
singleSelect: true,
listeners: {
rowselect: function(sm, row, rec) {
loadEventProperties( rec.data.id );
//SelectedEvent = rec.data.id;
//alert( SelectedEvent );
//var CB = Ext.getCmp('con_to_src');
//CB.enable();
}
}
});
function ModeRenderer(val){ function ModeRenderer(val){
var p1, p2, p3; var p1, p2, p3;
if( ( val & 1 ) == 1 ){ if( ( val & 1 ) == 1 ){
p1 = '<img src="/style/img/cam_cap3.png" alt="Video Source">';
p1 = '<img src="/style/img/cam_cap3.png" alt="Video Source">';
} else { } else {
p1 = '<img src="/style/img/cam_cap0.png" alt="NO Video Source">';
p1 = '<img src="/style/img/cam_cap0.png" alt="NO Video Source">';
}; };
if( ( val & 2 ) == 2 ){ if( ( val & 2 ) == 2 ){
p2 = '<img src="/style/img/cam_cap2.png" alt="Audio Source">';
p2 = '<img src="/style/img/cam_cap2.png" alt="Audio Source">';
} else { } else {
p2 = '<img src="/style/img/cam_cap0.png" alt="NO Audio Source">';
p2 = '<img src="/style/img/cam_cap0.png" alt="NO Audio Source">';
}; };
if( ( val & 4 ) == 4 ){ if( ( val & 4 ) == 4 ){
p3 = '<img src="/style/img/cam_cap1.png" alt="PTZ Control">';
p3 = '<img src="/style/img/cam_cap1.png" alt="PTZ Control">';
} else { } else {
p3 = '<img src="/style/img/cam_cap0.png" alt="NO PTZ Control">';
p3 = '<img src="/style/img/cam_cap0.png" alt="NO PTZ Control">';
}; };
return p1+p2+p3; return p1+p2+p3;
}; };
@ -102,7 +100,7 @@ function LocRenderer( val ){
return '<img src="/style/icons/icons/bullet_white.png" alt="NO Location">'; return '<img src="/style/icons/icons/bullet_white.png" alt="NO Location">';
}; };
var eventsListColModel = new Ext.grid.ColumnModel({
var eventsListColModel_ops = {
columns: [ columns: [
{header: "ID", width: 50, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', dataIndex: 'id' }, {header: "ID", width: 50, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', dataIndex: 'id' },
{header: "Date",width: 80, sortable: false, fixed: true, menuDisabled: true, /*renderer: camCapRenderer,*/ dataIndex: 'date' }, {header: "Date",width: 80, sortable: false, fixed: true, menuDisabled: true, /*renderer: camCapRenderer,*/ dataIndex: 'date' },
@ -122,8 +120,20 @@ var eventsListColModel = new Ext.grid.ColumnModel({
//saveConfig(colIndex, hidden); //saveConfig(colIndex, hidden);
} }
} }
});
};
var eventsListSelModel_ops = {
singleSelect: true,
listeners: {
rowselect: function(sm, row, rec) {
loadEventProperties( rec.data.id );
//SelectedEvent = rec.data.id;
//alert( SelectedEvent );
//var CB = Ext.getCmp('con_to_src');
//CB.enable();
}
}
};
function loadTimeLineGroups( NID ){ function loadTimeLineGroups( NID ){
Ext.Ajax.request({ Ext.Ajax.request({
@ -152,6 +162,60 @@ function loadTimeLineGroups( NID ){
}); });
}; };
function loadMapZones( SID ){
Ext.Ajax.request({
url: '/lib/controller/getGeoZones.php',
params: {
SITE: SID,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>'
},
success: function( response, opts ){
// If the response is JSON, you have to decode it
var data = Ext.decode(response.responseText);
for(var i = 0; i < data.totalCount; i++ ) {
switch( data.zones[i].type ){
case 'circle':{
L.circle( data.zones[i].center, {radius: data.zones[i].radius, color: data.zones[i].color, weight: 1, opacity: 0.8 } ).addTo( map );
break;
};
case 'poly':{
L.polygon( data.zones[i].points, {color: data.zones[i].color, dashArray: "4 1 2 3", weight: 1, opacity: 0.8, clickable: false, interactive: false, bubblingMouseEvents: false }).addTo(map);
break;
};
case 'image':{
L.imageOverlay( data.zones[i].url, data.zones[i].bounds, { opacity: 1.0 }).addTo( map );
break;
};
case 'image_rot':{
L.imageOverlay.rotated( data.zones[i].url, data.zones[i].topleft, data.zones[i].topright, data.zones[i].bottomleft, {
opacity: 0.8 //,
//interactive: true,
//attribution: "Historical building plan &copy; <a href='http://www.ign.es'>Instituto Geográfico Nacional de España</a>"
}).addTo( map );
break;
};
};
if( data.zones[i].zang != undefined ){
//L.polygon( data.zones[i].zang, {color: '#ffff00', weight: 1, opacity: 1.0, clickable: false, interactive: false, bubblingMouseEvents: false }).addTo(map);
L.circle( data.zones[i].zang, {radius: 0.3, color: '#ffff00', weight: 1, opacity: 1.0, fillOpacity: 1.0 } ).addTo( map );
};
if( data.zones[i].center != undefined ){
//L.polygon( data.zones[i].zmark, {color: '#ffff00', weight: 1, opacity: 1.0, clickable: false, interactive: false, bubblingMouseEvents: false }).addTo(map);
L.circle( data.zones[i].center, {radius: 0.3, color: '#ffff00', weight: 1, opacity: 1.0, fillOpacity: 1.0 } ).addTo( map );
};
};
//tlGroups.update( data );
//loadTimeLineItems( selectedSite );
LoadMapEvents( selectedSite );
tlInterval = window.setInterval( LoadMapEvents, 333, selectedSite );
},
failure: function( response, opts ) {
//Ext.fly('some_div').update('Fail!');
}
});
};
function loadTimeLineItems( NID ){ function loadTimeLineItems( NID ){
if( tlLoadLocker ) return; if( tlLoadLocker ) return;
tlLoadLocker = true; tlLoadLocker = true;
@ -166,40 +230,94 @@ function loadTimeLineItems( NID ){
success: function( response, opts ){ success: function( response, opts ){
// If the response is JSON, you have to decode it // If the response is JSON, you have to decode it
var data = Ext.decode(response.responseText); var data = Ext.decode(response.responseText);
var i = 0;
for(; i < data.length; i++ ){
tlLastTS = data[i].start;
data[i].start = moment.utc( ''+data[i].start, 'X' );
tlItems.add( data[i] );
};
if( timelineObj == null ){
var container = document.getElementById('timeline');
timelineObj = new vis.Timeline( container );
timelineObj.setOptions( tlOptions );
timelineObj.setGroups( tlGroups );
timelineObj.setItems( tlItems );
timelineObj.on('select', function (properties) {
//alert( properties.items[0] );
loadEventProperties( properties.items[0] );
//logEvent('select', properties.items[0]);
});
} else {
timelineObj.redraw();
};
if( tlMonitoring ) timelineObj.moveTo( moment.utc() );
var i = 0;
for(; i < data.length; i++ ){
tlLastTS = data[i].start;
data[i].start = moment.utc( ''+data[i].start, 'X' );
tlItems.add( data[i] );
};
if( timelineObj == null ){
var container = document.getElementById('timeline');
timelineObj = new vis.Timeline( container );
timelineObj.setOptions( tlOptions );
timelineObj.setGroups( tlGroups );
timelineObj.setItems( tlItems );
timelineObj.on('select', function (properties) {
//alert( properties.items[0] );
loadEventProperties( properties.items[0] );
//logEvent('select', properties.items[0]);
});
} else {
timelineObj.redraw();
};
if( tlMonitoring ) timelineObj.moveTo( moment.utc() );
eventsListStore.reload();
eventsListStore.reload();
tlLoadLocker = false;
tlLoadLocker = false;
}, },
failure: function( response, opts ) { failure: function( response, opts ) {
//Ext.fly('some_div').update('Fail!'); //Ext.fly('some_div').update('Fail!');
tlLoadLocker = false;
}/*,
callback: function(options,success,response){
// use this if you need to perform your own success/failure checking
}*/
tlLoadLocker = false;
}
});
};
var cevt = Array();
var coz = Array();
function LoadMapEvents( SID ){
if( tlLoadLocker ) return;
tlLoadLocker = true;
Ext.Ajax.request({
url: '/lib/controller/getGeoAlerts.php',
params: {
SITE: SID,
UID: <?=$UserID;?>,
SID: '<?=$Session;?>'
},
success: function( response, opts ){
if( cevt.length ){
for( i=0; i< cevt.length; i++ ){
if( cevt[i]!= null ){
cevt[i].remove();
delete( cevt[i] );
cevt[i] = null;
};
};
};
if( coz.length ){
for( i=0; i< coz.length; i++ ){
if( coz[i]!= null ){
coz[i].remove();
delete( coz[i] );
coz[i]=null;
};
};
};
var data = Ext.decode( response.responseText );
var zz = ( 1.0 / ( data.evt.length + 0 ) );
for( i=0; i < data.evt.length; i++ ){
cevt[i] = L.circleMarker( [data.evt[i].lat,data.evt[i].lon], {id:data.evt[i].id, color: '#FF0000', radius: 5, stroke: false, fillOpacity: ( 1.0 - i * zz ) } ).on('click', function( e, a ){
loadEventProperties( this.options.id );
} );
cevt[i].addTo(map);
};
for( i=0; i < data.other.length; i++ ){
switch( data.other[i].type ){
case 'circle':{
coz[i] = L.circleMarker( data.other[i].loc, {id:data.other[i].id, color: data.other[i].color, radius: 5, stroke: false, fillOpacity: 1.0 } );
coz[i].addTo(map);
break;
};
};
};
eventsListStore.reload();
tlLoadLocker = false;
},
failure: function( response, opts ) {
//Ext.fly('some_div').update('Fail!');
tlLoadLocker = false;
}
}); });
}; };
@ -223,134 +341,211 @@ function loadEventProperties( EventID ){
}, },
failure: function( response, opts ) { failure: function( response, opts ) {
//Ext.fly('some_div').update('Fail!'); //Ext.fly('some_div').update('Fail!');
}/*,
callback: function(options,success,response){
// use this if you need to perform your own success/failure checking
}*/
}
}); });
}; };
function loadTimeLine(){ function loadTimeLine(){
if( tlInterval!= null ){ if( tlInterval!= null ){
window.clearInterval( tlInterval );
tlInterval = null;
timelineObj = null;
window.clearInterval( tlInterval );
tlInterval = null;
timelineObj = null;
}; };
var tPanel = Ext.getCmp('main_portal'); var tPanel = Ext.getCmp('main_portal');
tPanel.removeAll( true ); tPanel.removeAll( true );
Ext.getCmp('main_content').setTitle( 'Full Events Log' ); Ext.getCmp('main_content').setTitle( 'Full Events Log' );
tPanel.add({ tPanel.add({
columnWidth: 0.83,
frame: false,
border: false,
items: [{
title: 'Events Monitoring',
frame: false,
border: false,
layout: 'vbox',
layoutConfig: {
align : 'stretch',
pack : 'start',
},
height: 375,
//flex: 1,
//border: true,
items:[{
//title: 'TimeLine',
height: 350,
flex: 1,
frame: true,
columnWidth: 0.83,
frame: false,
border: false, border: false,
layout: 'fit',
items:{
style: 'background: ivory;',
html: '<div id="timeline"></div>'
},
tbar:[{
id: 'fev',
text: 'Fit Events',
disabled: tlMonitoring,
handler: function(){
timelineObj.fit();
}
},{
id: 'gtn',
text: 'Go to Now',
disabled: tlMonitoring,
handler: function(){
timelineObj.moveTo( moment.utc() );
}
items: [{
title: '<?=$Labels->getLabel('_MAP_MONITORING_');?>',
frame: false,
border: false,
layout: 'vbox',
layoutConfig: {
align : 'stretch',
pack : 'start',
},
height: PanelH-300,
items:[{
height: PanelH-325,
flex: 1,
frame: false,
border: false,
layout: 'fit',
items:{
//style: 'background: ivory;',
id: 'event_map',
html: '&nbsp;'
},
tbar:[{
id: 'fev',
text: 'Fit Events',
disabled: tlMonitoring,
handler: function(){
timelineObj.fit();
}
},{
id: 'gtn',
text: 'Go to Now',
disabled: tlMonitoring,
handler: function(){
timelineObj.moveTo( moment.utc() );
}
},{
text: 'Live Monitoring',
enableToggle: true,
pressed: tlMonitoring,
toggleHandler: function(){
tlMonitoring = !tlMonitoring;
if( tlMonitoring ){
Ext.getCmp('gtn').disable();
Ext.getCmp('fev').disable();
} else {
Ext.getCmp('gtn').enable();
Ext.getCmp('fev').enable();
};
}
}]
}]
},{ },{
text: 'Live Monitoring',
enableToggle: true,
pressed: tlMonitoring,
toggleHandler: function(){
tlMonitoring = !tlMonitoring;
if( tlMonitoring ){
Ext.getCmp('gtn').disable();
Ext.getCmp('fev').disable();
} else {
Ext.getCmp('gtn').enable();
Ext.getCmp('fev').enable();
};
}
title: 'Event Log',
frame: false,
height: 303,
xtype: 'grid',
ds: eventsListStore,
cm: new Ext.grid.ColumnModel( eventsListColModel_ops ),
sm: new Ext.grid.RowSelectionModel( eventsListSelModel_ops ),
//viewConfig: {
//forceFit: true
//},
bbar: [{
text: 'Clear',
handler: function(){
Ext.Ajax.request({
url: '/lib/controller/clearEventCloud.php',
params: {
UID: <?=$UserID;?>,
SID: '<?=$Session;?>'
},
success: function( response, opts ){
},
failure: function( response, opts ) {
}
});
}
}/*,'->',{
id: 'con_to_src',
text: 'Connect To Selected',
disabled: ( SelectedCam == 0 ),
handler: connectToSeleced
}*/]
}] }]
}]
},{
title: 'Event Log',
frame: false,
height: 400,
xtype: 'grid',
ds: eventsListStore,
cm: eventsListColModel,
sm: eventsListSelModel,
//listeners:{
// beforedestroy: function( t ){
// addDialog = null;
// return true;
// }
//},
viewConfig: {
//forceFit: true
},
bbar: [{
text: 'Clear',
handler: function(){
Ext.Ajax.request({
url: '/lib/controller/clearEventCloud.php',
params: {
UID: <?=$UserID;?>,
SID: '<?=$Session;?>'
},
success: function( response, opts ){
},
failure: function( response, opts ) {
}
});
}
}/*,'->',{
id: 'con_to_src',
text: 'Connect To Selected',
disabled: ( SelectedCam == 0 ),
handler: connectToSeleced
}*/]
}]
}); });
tPanel.add({ tPanel.add({
columnWidth: 0.17,
frame: false,
id: 'prop_content',
border: false,
items: [{
title: 'Event Information',
border: true,
frame: true,
html: '<p align="center">Select an Event from TimeLine to See Information</p>'
}]
columnWidth: 0.17,
frame: false,
id: 'prop_content',
border: false,
items: [{
title: 'Event Information',
border: true,
frame: true,
html: '<p align="center">Select an Event from TimeLine to See Information</p>'
}]
}); });
tPanel.doLayout(); tPanel.doLayout();
loadTimeLineGroups( selectedSite );
map = L.map('event_map',{
attributionControl: true,
//preferCanvas: true,
zoomControl: true,
center: [SiteLat, SiteLon],
/*zoomControl: false,
zoom: 17,
minZoom: 17,
maxZoom: 17,*/
keyboard: false
}).setView([SiteLat, SiteLon], 17);
//L.marker([SiteLat, SiteLon], { draggable: false, icon: SITEZ_Icon } ).addTo(map).on('click', LoadNodesList ).bindPopup("<b><?=$Labels->GetLabel('_SYS_ANCHORT_LBL_');?></b>");
var mapLayers = [];
/*mapLayers["Bing"] = new BingLayer('https://t{s}.ssl.ak.dynamic.tiles.virtualearth.net/comp/ch/{q}?it=A,G,L&shading=hill', {
subdomains: ['0', '1', '2', '3', '4', '5', '6', '7'],
attribution: '&copy; <a href="https://bing.com/maps" target="_blank">Bing Maps</a>',
detectRetina: true
});*/
mapLayers["MyMap"] = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
maxNativeZoom: 18,
maxZoom: 24,
})
// https://leaflet-extras.github.io/leaflet-providers/preview/
mapLayers["EsriStreet"] = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}', {
attribution: 'Tiles &copy; <a href="https://www.esri.com" target="_blank">Esri</a> &mdash; Source: Esri, DeLorme, NAVTEQ, USGS, Intermap, iPC, NRCAN, Esri Japan, METI, Esri China (Hong Kong), Esri (Thailand), TomTom, 2012',
maxZoom: 19
});
mapLayers["EsriSat"] = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {
attribution: 'Tiles &copy; <a href="https://www.esri.com" target="_blank">Esri</a> &mdash; Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community',
maxZoom: 19
});
mapLayers["EsriTopo"] = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer/tile/{z}/{y}/{x}', {
attribution: 'Tiles &copy; <a href="https://www.esri.com" target="_blank">Esri</a> &mdash; Esri, DeLorme, NAVTEQ, TomTom, Intermap, iPC, USGS, FAO, NPS, NRCAN, GeoBase, Kadaster NL, Ordnance Survey, Esri Japan, METI, Esri China (Hong Kong), and the GIS User Community',
maxZoom: 24
});
mapLayers["OpenStreetMap"] = L.tileLayer("https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png", { //de/tiles/osmde
attribution: 'Map data &copy; <a href="https://openstreetmap.org" target="_blank">OpenStreetMap</a> contributors',
maxZoom: 19
});
mapLayers["OpenTopoMap"] = L.tileLayer("https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png", {
attribution: 'Kartendaten: &copy; <a href="https://openstreetmap.org/copyright" target="_blank">OpenStreetMap</a>-Mitwirkende, SRTM | Kartendarstellung: &copy; <a href="http://opentopomap.org/" target="_blank">OpenTopoMap</a> (<a href="https://creativecommons.org/licenses/by-sa/3.0/" target="_blank">CC-BY-SA</a>) ',
maxZoom: 19
});
/*
mapLayers["Cycle"] = L.tileLayer('https://tile.thunderforest.com/cycle/{z}/{x}/{y}.png?apikey=' + _PHP['API_KEY_THUNDERFOREST_1'], {
attribution: 'Maps &copy; <a href="https://www.thunderforest.com" target="_blank">Thunderforest</a>, Data © <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap contributors</a>',
maxZoom: 22
});
mapLayers["Landscape"] = L.tileLayer('https://tile.thunderforest.com/landscape/{z}/{x}/{y}.png?apikey=' + _PHP['API_KEY_THUNDERFOREST_1'], {
attribution: 'Maps &copy; <a href="https://www.thunderforest.com" target="_blank">Thunderforest</a>, Data © <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap contributors</a>',
maxZoom: 22
});
mapLayers["Outdoor"] = L.tileLayer('https://tile.thunderforest.com/outdoors/{z}/{x}/{y}.png?apikey=' + _PHP['API_KEY_THUNDERFOREST_1'], {
attribution: 'Maps &copy; <a href="https://www.thunderforest.com" target="_blank">Thunderforest</a>, Data © <a href="https://www.openstreetmap.org/copyright" target="_blank">OpenStreetMap contributors</a>',
maxZoom: 22
});
*/
var baseMaps = {
"MyMap": mapLayers["MyMap"],
"OpenStreetMap": mapLayers["OpenStreetMap"],
"OpenTopoMap": mapLayers["OpenTopoMap"],
"EsriSat": mapLayers["EsriSat"],
"EsriStreet": mapLayers["EsriStreet"],
"EsriTopo": mapLayers["EsriTopo"],
//"Bing": mapLayers["Bing"],
//"OSM-Cycle": mapLayers["Cycle"],
//"Landscape": mapLayers["Landscape"],
//"Outdoor": mapLayers["Outdoor"],
};
L.control.layers( baseMaps ).addTo(map);
mapLayers["MyMap"].addTo(map);
/*L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors',
maxNativeZoom: 18,
maxZoom: 24,
}).addTo(map); */
//loadTimeLineGroups( selectedSite );
loadMapZones( selectedSite );
eventsListStore.load({params:{start:0, limit:50}}); eventsListStore.load({params:{start:0, limit:50}});
}; };
@ -359,13 +554,13 @@ function loadTimeLine(){
function loadOnlineMonitoring(devID){ function loadOnlineMonitoring(devID){
var tPanel = Ext.getCmp('main_content'); var tPanel = Ext.getCmp('main_content');
if( tlInterval!= null ){ if( tlInterval!= null ){
window.clearInterval( tlInterval );
tlInterval = null;
timelineObj = null;
window.clearInterval( tlInterval );
tlInterval = null;
timelineObj = null;
}; };
tPanel.remove(0); tPanel.remove(0);
tPanel.add({ tPanel.add({
html: 'Device Monitoring '+devID
html: 'Device Monitoring '+devID
}); });
tPanel.doLayout(); tPanel.doLayout();
}; };

171
lib/javascript/jsapi_dynamic/rgoose_users.js

@ -0,0 +1,171 @@
//<?php require_once('../../js_asm.php'); ?>
var um_user_list_store = new Ext.data.JsonStore({
root: 'users',
totalProperty: 'totalCount',
idProperty: 'id',
remoteSort: true,
fields: [{
name: 'id',
type: 'int'
},{
name: 'status',
type: 'string'
},{
name: 'login',
type: 'string'
},{
name: 'created',
type: 'string'
},{
name: 'last',
type: 'string'
},{
name: 'access',
type: 'int'
},{
name: 'lang',
type: 'int'
},{
name: 'site',
type: 'int'
}],
proxy : new Ext.data.HttpProxy({
method: 'POST',
prettyUrls: false,
url: '/lib/controller/listUsers.php',
headers: {
UID: <?=$UserID;?>,
SID: '<?=$Session;?>'
}
})
});
var um_selected_user_id = 0;
var um_add_user_window = null;
var um_edit_user_window = null;
function um_user_access_renderer( val ){
if( val == 0 ){
return '<?=$Labels->GetLabel("_GUEST_");?>';
} else {
if( val < 6 ){
return '<?=$Labels->GetLabel("_REGULAR_");?>';
} else {
if( val == 10 ){
return '<?=$Labels->GetLabel("_FOUNDER_");?>';
} else {
return '<?=$Labels->GetLabel("_ADMIN_");?>';
};
};
};
};
var um_user_list_col_model_opt = {
columns: [
{header: "id", width: 50, sortable: false, menuDisabled: true, align: 'center', fixed: true, css: 'vertical-align: middle;', dataIndex: 'id' },
{header: "<?=$Labels->GetLabel("_STATUS_");?>", width: 80, sortable: false, fixed: true, menuDisabled: true, align: 'center', css: 'vertical-align: middle;', dataIndex: 'status' },
{header: "<?=$Labels->GetLabel("_LOGIN_");?>", width: 80, sortable: false, fixed: true, menuDisabled: true, /*renderer: camCapRenderer,*/ dataIndex: 'login' },
{header: "<?=$Labels->GetLabel("_CREATED_");?>", width: 150, sortable: false, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'created' },
{header: "<?=$Labels->GetLabel("_LAST_ACCESS_");?>", width: 150, sortable: false, fixed: true, menuDisabled: true, align: 'left', css: 'vertical-align: middle;', dataIndex: 'last' },
{header: "<?=$Labels->GetLabel("_TYPE_");?>", width: 100, sortable: false, renderer: um_user_access_renderer, dataIndex: 'access' },
{header: "<?=$Labels->GetLabel("_INFO_");?>", width: 200, sortable: false, dataindex: 'data' }
],
defaults: {
sortable: true,
menuDisabled: true,
width: 100
},
listeners: {
hiddenchange: function(cm, colIndex, hidden) {
//saveConfig(colIndex, hidden);
}
}
};
var um_user_list_sel_model_opt = {
singleSelect: true,
listeners: {
rowselect: function(sm, row, rec) {
um_selected_user_id = rec.data.id;
if( um_selected_user_id == 0 || rec.data.access == 10 ){
Ext.getCmp('um_del_user_btn').disable();
Ext.getCmp('um_lock_user_btn').disable();
};
Ext.getCmp('um_edit_user_btn').enable();
}
}
};
function loadUserEditor(){
if( tlInterval!= null ){
window.clearInterval( tlInterval );
tlInterval = null;
timelineObj = null;
};
var tPanel = Ext.getCmp('main_portal');
tPanel.removeAll( true );
Ext.getCmp('main_content').setTitle( '<?=$Labels->GetLabel("_USERS_MNGMT_");?>' );
tPanel.add({
columnWidth: 1.0,
frame: false,
border: false,
items: [{
xtype: 'panel',
layout: 'fit',
layoutConfig: {
align : 'stretch',
pack : 'start'
},
height: PanelH-5,
flex: 1,
frame: false,
border: false,
items:{
frame: false,
height: PanelH-5,
xtype: 'grid',
ds: um_user_list_store,
cm: new Ext.grid.ColumnModel( um_user_list_col_model_opt ),
sm: new Ext.grid.RowSelectionModel( um_user_list_sel_model_opt )
},
tbar: [{
xtype: 'button',
id: 'um_add_user_btn',
text: '<?=$Labels->GetLabel("_ADD_USER_");?>',
handler: function(){
}
},{
xtype: 'button',
id: 'um_edit_user_btn',
text: '<?=$Labels->GetLabel("_EDIT_USER_");?>',
disabled: true,
handler: function(){
}
},{
xtype: 'button',
id: 'um_lock_user_btn',
text: '<?=$Labels->GetLabel("_LOCK_USER_");?>',
disabled: true,
handler: function(){
}
},{
xtype: 'button',
id: 'um_del_user_btn',
text: '<?=$Labels->GetLabel("_DEL_USER_");?>',
disabled: true,
handler: function(){
}
}]
}]
});
tPanel.doLayout();
um_selected_user_id = 0;
um_user_list_store.reload();
};

BIN
lib/javascript/jsapi_dynamic/vatican_308px-100m.jpg

Binary file not shown.

After

Width: 3791  |  Height: 2763  |  Size: 2.0 MiB

63
lib/javascript/jsapi_static/rgoose_general.js

@ -3,6 +3,7 @@ var netwodkData = {
nodes: null nodes: null
}; };
var selectedSite = 0;
var selectedConnection = null; var selectedConnection = null;
var selectedNode = null; var selectedNode = null;
var selected_A_socket = null; var selected_A_socket = null;
@ -10,43 +11,43 @@ var selected_B_socket = null;
var addConnectionDialog = null; var addConnectionDialog = null;
var networkObj = null; var networkObj = null;
var ARGUS_SERVER = 0;
var ARGUS_ALS_SENSOR = 1;
var ARGUS_LFS_SENSOR = 2;
var ARGUS_PLS_200_SENSOR = 3;
var ARGUS_PLS_360_SENSOR = 4;
var ARGUS_3D_SENSOR = 5;
var ARGUS_NET_PLS_200 = 6;
var ARGUS_ANALOG_STATIC_CAMERA = 10;
var ARGUS_ANALOG_PTZ_CAMERA = 11;
var ARGUS_IP_STATIC_CAMERA = 12;
var ARGUS_IP_PTZ_CAMERA = 13;
var ARGUS_IP_UART_GATEWAY = 20;
var ARGUS_JAMER = 40;
var ARGUS_IP_VIDEO_SERVER = 50;
var ARGUS_DRONE_CONTROL = 60;
var ARGUS_UNKNOWN = 255;
var ARGUS_SERVER = 0;
var ARGUS_ALS_SENSOR = 1;
var ARGUS_LFS_SENSOR = 2;
var ARGUS_PLS_200_SENSOR = 3;
var ARGUS_PLS_360_SENSOR = 4;
var ARGUS_3D_SENSOR = 5;
var ARGUS_NET_PLS_200 = 6;
var ARGUS_ANALOG_STATIC_CAMERA = 10;
var ARGUS_ANALOG_PTZ_CAMERA = 11;
var ARGUS_IP_STATIC_CAMERA = 12;
var ARGUS_IP_PTZ_CAMERA = 13;
var ARGUS_IP_UART_GATEWAY = 20;
var ARGUS_JAMER = 40;
var ARGUS_IP_VIDEO_SERVER = 50;
var ARGUS_DRONE_CONTROL = 60;
var ARGUS_UNKNOWN = 255;
var ARGUS_NODE_SOCK_TYPE_SERIAL_PORT = 1; var ARGUS_NODE_SOCK_TYPE_SERIAL_PORT = 1;
var ARGUS_NODE_SOCK_TYPE_NET4 = 2;
var ARGUS_NODE_SOCK_TYPE_DC = 3;
var ARGUS_NODE_SOCK_TYPE_ANALOG_VIDEO_GRABBER = 4;
var ARGUS_NODE_SOCK_TYPE_ANALOG_AUDIO_GRABBER = 5;
var ARGUS_NODE_SOCK_TYPE_IPV = 6;
var ARGUS_NODE_SOCK_TYPE_DVR = 7;
var ARGUS_NODE_SOCK_TYPE_NET6 = 8;
var ARGUS_NODE_SOCK_TYPE_NET4 = 2;
var ARGUS_NODE_SOCK_TYPE_DC = 3;
var ARGUS_NODE_SOCK_TYPE_ANALOG_VIDEO_GRABBER = 4;
var ARGUS_NODE_SOCK_TYPE_ANALOG_AUDIO_GRABBER = 5;
var ARGUS_NODE_SOCK_TYPE_IPV = 6;
var ARGUS_NODE_SOCK_TYPE_DVR = 7;
var ARGUS_NODE_SOCK_TYPE_NET6 = 8;
function sockTypeRenderer( r ){ function sockTypeRenderer( r ){
switch( r ){ switch( r ){
case ARGUS_NODE_SOCK_TYPE_SERIAL_PORT: return 'UART'; case ARGUS_NODE_SOCK_TYPE_SERIAL_PORT: return 'UART';
case ARGUS_NODE_SOCK_TYPE_NET4: return 'NET4';
case ARGUS_NODE_SOCK_TYPE_NET6: return 'NET6';
case ARGUS_NODE_SOCK_TYPE_DC: return 'DC';
case ARGUS_NODE_SOCK_TYPE_ANALOG_VIDEO_GRABBER: return 'A-V';
case ARGUS_NODE_SOCK_TYPE_ANALOG_AUDIO_GRABBER: return 'A-A';
case ARGUS_NODE_SOCK_TYPE_IPV: return 'IPV';
case ARGUS_NODE_SOCK_TYPE_DVR: return 'DVR';
default: return 'TBD';
case ARGUS_NODE_SOCK_TYPE_NET4: return 'NET4';
case ARGUS_NODE_SOCK_TYPE_NET6: return 'NET6';
case ARGUS_NODE_SOCK_TYPE_DC: return 'DC';
case ARGUS_NODE_SOCK_TYPE_ANALOG_VIDEO_GRABBER: return 'A-V';
case ARGUS_NODE_SOCK_TYPE_ANALOG_AUDIO_GRABBER: return 'A-A';
case ARGUS_NODE_SOCK_TYPE_IPV: return 'IPV';
case ARGUS_NODE_SOCK_TYPE_DVR: return 'DVR';
default: return 'TBD';
}; };
}; };

189
lib/javascript/leaflet/Leaflet.ImageOverlay.Rotated.js

@ -0,0 +1,189 @@
/*
* 🍂class ImageOverlay.Rotated
* 🍂inherits ImageOverlay
* https://github.com/IvanSanchez/Leaflet.ImageOverlay.Rotated
* Like `ImageOverlay`, but rotates and skews the image. This is done by using
* *three* control points instead of *two*.
*
* @example
*
* ```
* var topleft = L.latLng(40.52256691873593, -3.7743186950683594),
* topright = L.latLng(40.5210255066156, -3.7734764814376835),
* bottomleft = L.latLng(40.52180437272552, -3.7768453359603886);
*
* var overlay = L.imageOverlay.rotated("./palacio.jpg", topleft, topright, bottomleft, {
* opacity: 0.4,
* interactive: true,
* attribution: "&copy; <a href='http://www.ign.es'>Instituto Geográfico Nacional de España</a>"
* });
* ```
*
*/
L.ImageOverlay.Rotated = L.ImageOverlay.extend({
initialize: function (image, topleft, topright, bottomleft, options) {
if (typeof(image) === 'string') {
this._url = image;
} else {
// Assume that the first parameter is an instance of HTMLImage or HTMLCanvas
this._rawImage = image;
}
this._topLeft = L.latLng(topleft);
this._topRight = L.latLng(topright);
this._bottomLeft = L.latLng(bottomleft);
L.setOptions(this, options);
},
onAdd: function (map) {
if (!this._image) {
this._initImage();
if (this.options.opacity < 1) {
this._updateOpacity();
}
}
if (this.options.interactive) {
L.DomUtil.addClass(this._rawImage, 'leaflet-interactive');
this.addInteractiveTarget(this._rawImage);
}
map.on('zoomend resetview', this._reset, this);
this.getPane().appendChild(this._image);
this._reset();
},
onRemove: function(map) {
map.off('zoomend resetview', this._reset, this);
L.ImageOverlay.prototype.onRemove.call(this, map);
},
_initImage: function () {
var img = this._rawImage;
if (this._url) {
img = L.DomUtil.create('img');
img.style.display = 'none'; // Hide while the first transform (zero or one frames) is being done
if (this.options.crossOrigin) {
img.crossOrigin = '';
}
img.src = this._url;
this._rawImage = img;
}
L.DomUtil.addClass(img, 'leaflet-image-layer');
// this._image is reused by some of the methods of the parent class and
// must keep the name, even if it is counter-intuitive.
var div = this._image = L.DomUtil.create('div',
'leaflet-image-layer ' + (this._zoomAnimated ? 'leaflet-zoom-animated' : ''));
this._updateZIndex(); // apply z-index style setting to the div (if defined)
div.appendChild(img);
div.onselectstart = L.Util.falseFn;
div.onmousemove = L.Util.falseFn;
img.onload = function(){
this._reset();
img.style.display = 'block';
this.fire('load');
}.bind(this);
img.alt = this.options.alt;
},
_reset: function () {
var div = this._image;
if (!this._map) {
return;
}
// Project control points to container-pixel coordinates
var pxTopLeft = this._map.latLngToLayerPoint(this._topLeft);
var pxTopRight = this._map.latLngToLayerPoint(this._topRight);
var pxBottomLeft = this._map.latLngToLayerPoint(this._bottomLeft);
// Infer coordinate of bottom right
var pxBottomRight = pxTopRight.subtract(pxTopLeft).add(pxBottomLeft);
// pxBounds is mostly for positioning the <div> container
var pxBounds = L.bounds([pxTopLeft, pxTopRight, pxBottomLeft, pxBottomRight]);
var size = pxBounds.getSize();
var pxTopLeftInDiv = pxTopLeft.subtract(pxBounds.min);
// LatLngBounds are needed for (zoom) animations
this._bounds = L.latLngBounds( this._map.layerPointToLatLng(pxBounds.min),
this._map.layerPointToLatLng(pxBounds.max) );
L.DomUtil.setPosition(div, pxBounds.min);
div.style.width = size.x + 'px';
div.style.height = size.y + 'px';
var imgW = this._rawImage.width;
var imgH = this._rawImage.height;
if (!imgW || !imgH) {
return; // Probably because the image hasn't loaded yet.
}
// Sides of the control-point box, in pixels
// These are the main ingredient for the transformation matrix.
var vectorX = pxTopRight.subtract(pxTopLeft);
var vectorY = pxBottomLeft.subtract(pxTopLeft);
this._rawImage.style.transformOrigin = '0 0';
// The transformation is an affine matrix that switches
// coordinates around in just the right way. This is the result
// of calculating the skew/rotation/scale matrices and simplyfing
// everything.
this._rawImage.style.transform = "matrix(" +
(vectorX.x/imgW) + ', ' + (vectorX.y/imgW) + ', ' +
(vectorY.x/imgH) + ', ' + (vectorY.y/imgH) + ', ' +
pxTopLeftInDiv.x + ', ' + pxTopLeftInDiv.y + ')';
},
reposition: function(topleft, topright, bottomleft) {
this._topLeft = L.latLng(topleft);
this._topRight = L.latLng(topright);
this._bottomLeft = L.latLng(bottomleft);
this._reset();
},
setUrl: function (url) {
this._url = url;
if (this._rawImage) {
this._rawImage.src = url;
}
return this;
}
});
/* 🍂factory imageOverlay.rotated(imageUrl: String|HTMLImageElement|HTMLCanvasElement, topleft: LatLng, topright: LatLng, bottomleft: LatLng, options?: ImageOverlay options)
* Instantiates a rotated/skewed image overlay, given the image URL and
* the `LatLng`s of three of its corners.
*
* Alternatively to specifying the URL of the image, an existing instance of `HTMLImageElement`
* or `HTMLCanvasElement` can be used.
*/
L.imageOverlay.rotated = function(imgSrc, topleft, topright, bottomleft, options) {
return new L.ImageOverlay.Rotated(imgSrc, topleft, topright, bottomleft, options);
};

636
lib/javascript/leaflet/leaflet.css

@ -0,0 +1,636 @@
/* required styles */
.leaflet-pane,
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-tile-container,
.leaflet-pane > svg,
.leaflet-pane > canvas,
.leaflet-zoom-box,
.leaflet-image-layer,
.leaflet-layer {
position: absolute;
left: 0;
top: 0;
}
.leaflet-container {
overflow: hidden;
}
.leaflet-tile,
.leaflet-marker-icon,
.leaflet-marker-shadow {
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
-webkit-user-drag: none;
}
/* Safari renders non-retina tile on retina better with this, but Chrome is worse */
.leaflet-safari .leaflet-tile {
image-rendering: -webkit-optimize-contrast;
}
/* hack that prevents hw layers "stretching" when loading new tiles */
.leaflet-safari .leaflet-tile-container {
width: 1600px;
height: 1600px;
-webkit-transform-origin: 0 0;
}
.leaflet-marker-icon,
.leaflet-marker-shadow {
display: block;
}
/* .leaflet-container svg: reset svg max-width decleration shipped in Joomla! (joomla.org) 3.x */
/* .leaflet-container img: map is broken in FF if you have max-width: 100% on tiles */
.leaflet-container .leaflet-overlay-pane svg,
.leaflet-container .leaflet-marker-pane img,
.leaflet-container .leaflet-shadow-pane img,
.leaflet-container .leaflet-tile-pane img,
.leaflet-container img.leaflet-image-layer {
max-width: none !important;
max-height: none !important;
}
.leaflet-container.leaflet-touch-zoom {
-ms-touch-action: pan-x pan-y;
touch-action: pan-x pan-y;
}
.leaflet-container.leaflet-touch-drag {
-ms-touch-action: pinch-zoom;
/* Fallback for FF which doesn't support pinch-zoom */
touch-action: none;
touch-action: pinch-zoom;
}
.leaflet-container.leaflet-touch-drag.leaflet-touch-zoom {
-ms-touch-action: none;
touch-action: none;
}
.leaflet-container {
-webkit-tap-highlight-color: transparent;
}
.leaflet-container a {
-webkit-tap-highlight-color: rgba(51, 181, 229, 0.4);
}
.leaflet-tile {
filter: inherit;
visibility: hidden;
}
.leaflet-tile-loaded {
visibility: inherit;
}
.leaflet-zoom-box {
width: 0;
height: 0;
-moz-box-sizing: border-box;
box-sizing: border-box;
z-index: 800;
}
/* workaround for https://bugzilla.mozilla.org/show_bug.cgi?id=888319 */
.leaflet-overlay-pane svg {
-moz-user-select: none;
}
.leaflet-pane { z-index: 400; }
.leaflet-tile-pane { z-index: 200; }
.leaflet-overlay-pane { z-index: 400; }
.leaflet-shadow-pane { z-index: 500; }
.leaflet-marker-pane { z-index: 600; }
.leaflet-tooltip-pane { z-index: 650; }
.leaflet-popup-pane { z-index: 700; }
.leaflet-map-pane canvas { z-index: 100; }
.leaflet-map-pane svg { z-index: 200; }
.leaflet-vml-shape {
width: 1px;
height: 1px;
}
.lvml {
behavior: url(#default#VML);
display: inline-block;
position: absolute;
}
/* control positioning */
.leaflet-control {
position: relative;
z-index: 800;
pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
pointer-events: auto;
}
.leaflet-top,
.leaflet-bottom {
position: absolute;
z-index: 1000;
pointer-events: none;
}
.leaflet-top {
top: 0;
}
.leaflet-right {
right: 0;
}
.leaflet-bottom {
bottom: 0;
}
.leaflet-left {
left: 0;
}
.leaflet-control {
float: left;
clear: both;
}
.leaflet-right .leaflet-control {
float: right;
}
.leaflet-top .leaflet-control {
margin-top: 10px;
}
.leaflet-bottom .leaflet-control {
margin-bottom: 10px;
}
.leaflet-left .leaflet-control {
margin-left: 10px;
}
.leaflet-right .leaflet-control {
margin-right: 10px;
}
/* zoom and fade animations */
.leaflet-fade-anim .leaflet-tile {
will-change: opacity;
}
.leaflet-fade-anim .leaflet-popup {
opacity: 0;
-webkit-transition: opacity 0.2s linear;
-moz-transition: opacity 0.2s linear;
-o-transition: opacity 0.2s linear;
transition: opacity 0.2s linear;
}
.leaflet-fade-anim .leaflet-map-pane .leaflet-popup {
opacity: 1;
}
.leaflet-zoom-animated {
-webkit-transform-origin: 0 0;
-ms-transform-origin: 0 0;
transform-origin: 0 0;
}
.leaflet-zoom-anim .leaflet-zoom-animated {
will-change: transform;
}
.leaflet-zoom-anim .leaflet-zoom-animated {
-webkit-transition: -webkit-transform 0.25s cubic-bezier(0,0,0.25,1);
-moz-transition: -moz-transform 0.25s cubic-bezier(0,0,0.25,1);
-o-transition: -o-transform 0.25s cubic-bezier(0,0,0.25,1);
transition: transform 0.25s cubic-bezier(0,0,0.25,1);
}
.leaflet-zoom-anim .leaflet-tile,
.leaflet-pan-anim .leaflet-tile {
-webkit-transition: none;
-moz-transition: none;
-o-transition: none;
transition: none;
}
.leaflet-zoom-anim .leaflet-zoom-hide {
visibility: hidden;
}
/* cursors */
.leaflet-interactive {
cursor: pointer;
}
.leaflet-grab {
cursor: -webkit-grab;
cursor: -moz-grab;
}
.leaflet-crosshair,
.leaflet-crosshair .leaflet-interactive {
cursor: crosshair;
}
.leaflet-popup-pane,
.leaflet-control {
cursor: auto;
}
.leaflet-dragging .leaflet-grab,
.leaflet-dragging .leaflet-grab .leaflet-interactive,
.leaflet-dragging .leaflet-marker-draggable {
cursor: move;
cursor: -webkit-grabbing;
cursor: -moz-grabbing;
}
/* marker & overlays interactivity */
.leaflet-marker-icon,
.leaflet-marker-shadow,
.leaflet-image-layer,
.leaflet-pane > svg path,
.leaflet-tile-container {
pointer-events: none;
}
.leaflet-marker-icon.leaflet-interactive,
.leaflet-image-layer.leaflet-interactive,
.leaflet-pane > svg path.leaflet-interactive {
pointer-events: visiblePainted; /* IE 9-10 doesn't have auto */
pointer-events: auto;
}
/* visual tweaks */
.leaflet-container {
background: #ddd;
outline: 0;
}
.leaflet-container a {
color: #0078A8;
}
.leaflet-container a.leaflet-active {
outline: 2px solid orange;
}
.leaflet-zoom-box {
border: 2px dotted #38f;
background: rgba(255,255,255,0.5);
}
/* general typography */
.leaflet-container {
font: 12px/1.5 "Helvetica Neue", Arial, Helvetica, sans-serif;
}
/* general toolbar styles */
.leaflet-bar {
box-shadow: 0 1px 5px rgba(0,0,0,0.65);
border-radius: 4px;
}
.leaflet-bar a,
.leaflet-bar a:hover {
background-color: #fff;
border-bottom: 1px solid #ccc;
width: 26px;
height: 26px;
line-height: 26px;
display: block;
text-align: center;
text-decoration: none;
color: black;
}
.leaflet-bar a,
.leaflet-control-layers-toggle {
background-position: 50% 50%;
background-repeat: no-repeat;
display: block;
}
.leaflet-bar a:hover {
background-color: #f4f4f4;
}
.leaflet-bar a:first-child {
border-top-left-radius: 4px;
border-top-right-radius: 4px;
}
.leaflet-bar a:last-child {
border-bottom-left-radius: 4px;
border-bottom-right-radius: 4px;
border-bottom: none;
}
.leaflet-bar a.leaflet-disabled {
cursor: default;
background-color: #f4f4f4;
color: #bbb;
}
.leaflet-touch .leaflet-bar a {
width: 30px;
height: 30px;
line-height: 30px;
}
.leaflet-touch .leaflet-bar a:first-child {
border-top-left-radius: 2px;
border-top-right-radius: 2px;
}
.leaflet-touch .leaflet-bar a:last-child {
border-bottom-left-radius: 2px;
border-bottom-right-radius: 2px;
}
/* zoom control */
.leaflet-control-zoom-in,
.leaflet-control-zoom-out {
font: bold 18px 'Lucida Console', Monaco, monospace;
text-indent: 1px;
}
.leaflet-touch .leaflet-control-zoom-in, .leaflet-touch .leaflet-control-zoom-out {
font-size: 22px;
}
/* layers control */
.leaflet-control-layers {
box-shadow: 0 1px 5px rgba(0,0,0,0.4);
background: #fff;
border-radius: 5px;
}
.leaflet-control-layers-toggle {
background-image: url(images/layers.png);
width: 36px;
height: 36px;
}
.leaflet-retina .leaflet-control-layers-toggle {
background-image: url(images/layers-2x.png);
background-size: 26px 26px;
}
.leaflet-touch .leaflet-control-layers-toggle {
width: 44px;
height: 44px;
}
.leaflet-control-layers .leaflet-control-layers-list,
.leaflet-control-layers-expanded .leaflet-control-layers-toggle {
display: none;
}
.leaflet-control-layers-expanded .leaflet-control-layers-list {
display: block;
position: relative;
}
.leaflet-control-layers-expanded {
padding: 6px 10px 6px 6px;
color: #333;
background: #fff;
}
.leaflet-control-layers-scrollbar {
overflow-y: scroll;
overflow-x: hidden;
padding-right: 5px;
}
.leaflet-control-layers-selector {
margin-top: 2px;
position: relative;
top: 1px;
}
.leaflet-control-layers label {
display: block;
}
.leaflet-control-layers-separator {
height: 0;
border-top: 1px solid #ddd;
margin: 5px -10px 5px -6px;
}
/* Default icon URLs */
.leaflet-default-icon-path {
background-image: url(images/marker-icon.png);
}
/* attribution and scale controls */
.leaflet-container .leaflet-control-attribution {
background: #fff;
background: rgba(255, 255, 255, 0.7);
margin: 0;
}
.leaflet-control-attribution,
.leaflet-control-scale-line {
padding: 0 5px;
color: #333;
}
.leaflet-control-attribution a {
text-decoration: none;
}
.leaflet-control-attribution a:hover {
text-decoration: underline;
}
.leaflet-container .leaflet-control-attribution,
.leaflet-container .leaflet-control-scale {
font-size: 11px;
}
.leaflet-left .leaflet-control-scale {
margin-left: 5px;
}
.leaflet-bottom .leaflet-control-scale {
margin-bottom: 5px;
}
.leaflet-control-scale-line {
border: 2px solid #777;
border-top: none;
line-height: 1.1;
padding: 2px 5px 1px;
font-size: 11px;
white-space: nowrap;
overflow: hidden;
-moz-box-sizing: border-box;
box-sizing: border-box;
background: #fff;
background: rgba(255, 255, 255, 0.5);
}
.leaflet-control-scale-line:not(:first-child) {
border-top: 2px solid #777;
border-bottom: none;
margin-top: -2px;
}
.leaflet-control-scale-line:not(:first-child):not(:last-child) {
border-bottom: 2px solid #777;
}
.leaflet-touch .leaflet-control-attribution,
.leaflet-touch .leaflet-control-layers,
.leaflet-touch .leaflet-bar {
box-shadow: none;
}
.leaflet-touch .leaflet-control-layers,
.leaflet-touch .leaflet-bar {
border: 2px solid rgba(0,0,0,0.2);
background-clip: padding-box;
}
/* popup */
.leaflet-popup {
position: absolute;
text-align: center;
margin-bottom: 20px;
}
.leaflet-popup-content-wrapper {
padding: 1px;
text-align: left;
border-radius: 12px;
}
.leaflet-popup-content {
margin: 13px 19px;
line-height: 1.4;
}
.leaflet-popup-content p {
margin: 18px 0;
}
.leaflet-popup-tip-container {
width: 40px;
height: 20px;
position: absolute;
left: 50%;
margin-left: -20px;
overflow: hidden;
pointer-events: none;
}
.leaflet-popup-tip {
width: 17px;
height: 17px;
padding: 1px;
margin: -10px auto 0;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-ms-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
}
.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
background: white;
color: #333;
box-shadow: 0 3px 14px rgba(0,0,0,0.4);
}
.leaflet-container a.leaflet-popup-close-button {
position: absolute;
top: 0;
right: 0;
padding: 4px 4px 0 0;
border: none;
text-align: center;
width: 18px;
height: 14px;
font: 16px/14px Tahoma, Verdana, sans-serif;
color: #c3c3c3;
text-decoration: none;
font-weight: bold;
background: transparent;
}
.leaflet-container a.leaflet-popup-close-button:hover {
color: #999;
}
.leaflet-popup-scrolled {
overflow: auto;
border-bottom: 1px solid #ddd;
border-top: 1px solid #ddd;
}
.leaflet-oldie .leaflet-popup-content-wrapper {
zoom: 1;
}
.leaflet-oldie .leaflet-popup-tip {
width: 24px;
margin: 0 auto;
-ms-filter: "progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678)";
filter: progid:DXImageTransform.Microsoft.Matrix(M11=0.70710678, M12=0.70710678, M21=-0.70710678, M22=0.70710678);
}
.leaflet-oldie .leaflet-popup-tip-container {
margin-top: -1px;
}
.leaflet-oldie .leaflet-control-zoom,
.leaflet-oldie .leaflet-control-layers,
.leaflet-oldie .leaflet-popup-content-wrapper,
.leaflet-oldie .leaflet-popup-tip {
border: 1px solid #999;
}
/* div icon */
.leaflet-div-icon {
background: #fff;
border: 1px solid #666;
}
/* Tooltip */
/* Base styles for the element that has a tooltip */
.leaflet-tooltip {
position: absolute;
padding: 6px;
background-color: #fff;
border: 1px solid #fff;
border-radius: 3px;
color: #222;
white-space: nowrap;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
pointer-events: none;
box-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.leaflet-tooltip.leaflet-clickable {
cursor: pointer;
pointer-events: auto;
}
.leaflet-tooltip-top:before,
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before {
position: absolute;
pointer-events: none;
border: 6px solid transparent;
background: transparent;
content: "";
}
/* Directions */
.leaflet-tooltip-bottom {
margin-top: 6px;
}
.leaflet-tooltip-top {
margin-top: -6px;
}
.leaflet-tooltip-bottom:before,
.leaflet-tooltip-top:before {
left: 50%;
margin-left: -6px;
}
.leaflet-tooltip-top:before {
bottom: 0;
margin-bottom: -12px;
border-top-color: #fff;
}
.leaflet-tooltip-bottom:before {
top: 0;
margin-top: -12px;
margin-left: -6px;
border-bottom-color: #fff;
}
.leaflet-tooltip-left {
margin-left: -6px;
}
.leaflet-tooltip-right {
margin-left: 6px;
}
.leaflet-tooltip-left:before,
.leaflet-tooltip-right:before {
top: 50%;
margin-top: -6px;
}
.leaflet-tooltip-left:before {
right: 0;
margin-right: -12px;
border-left-color: #fff;
}
.leaflet-tooltip-right:before {
left: 0;
margin-left: -12px;
border-right-color: #fff;
}

6
lib/javascript/leaflet/leaflet.js
File diff suppressed because it is too large
View File

5
lib/javascript/leaflet/leaflet__.js
File diff suppressed because it is too large
View File

2
lib/javascript/videojs/videojs-offset.min.js

@ -0,0 +1,2 @@
/*! @name videojs-offset @version 2.1.0 @license MIT */
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?module.exports=e(require("video.js")):"function"==typeof define&&define.amd?define(["video.js"],e):(t=t||self).videojsOffset=e(t.videojs)}(this,function(t){"use strict";t=t&&t.hasOwnProperty("default")?t.default:t;var e={},i=t.registerPlugin||t.plugin,r=function t(){var e=this.currentTime();e<0&&(this.currentTime(0),this.play()),this._offsetEnd>0&&e>this._offsetEnd-this._offsetStart&&(this.off("timeupdate",t),this.pause(),this.trigger("ended"),this._restartBeginning?(this.trigger("loadstart"),this.currentTime(0)):this.currentTime(this._offsetEnd-this._offsetStart))},n=function(i){var n=this;i=i||{};var s=this.constructor;this._offsetStart=parseFloat(i.start||"0"),this._offsetEnd=parseFloat(i.end||"0"),this._restartBeginning=i.restart_beginning||!1,s.__super__&&s.__super__.__offsetInit||(s.__super__={__offsetInit:!0,duration:s.prototype.duration,currentTime:s.prototype.currentTime,bufferedPercent:s.prototype.bufferedPercent,remainingTime:s.prototype.remainingTime},s.prototype.duration=function(){return this._offsetEnd>0?this._offsetEnd-this._offsetStart:s.__super__.duration.apply(this,arguments)-this._offsetStart},s.prototype.currentTime=function(t){return void 0!==t?s.__super__.currentTime.call(this,t+this._offsetStart):s.__super__.currentTime.apply(this)-this._offsetStart},s.prototype.remainingTime=function(){return this.duration()-this.currentTime()},s.prototype.startOffset=function(){return this._offsetStart},s.prototype.endOffset=function(){return this._offsetEnd>0?this._offsetEnd:this.duration()}),this.ready(function(){var s;s=n,t.mergeOptions(e,i),s.one("play",function(){s.on("timeupdate",r)})})};return i("offset",n),n.VERSION="2.1.0",n});

3
lib/js_asm.php

@ -1,6 +1,7 @@
<?php <?php
error_reporting( E_ALL ); error_reporting( E_ALL );
require_once('settings.php'); require_once('settings.php');
require_once('defines.php');
// SET DATA CONNECTION AND GLOBAL USER VARIABLES // SET DATA CONNECTION AND GLOBAL USER VARIABLES
$TT_123 = explode( '.', PHP_VERSION ); $TT_123 = explode( '.', PHP_VERSION );
@ -17,6 +18,8 @@ if( $TT_123[0] == '4' ){
//$DATABASE->SetCacheDir( $DBCacheDir ); //$DATABASE->SetCacheDir( $DBCacheDir );
session_start(); session_start();
require_once('php/db/logio_class.php');
$LOG = new Logio( LOG_LVL_ALL );
require_once('php/db/user_class.php'); require_once('php/db/user_class.php');
require_once('php/auth/web.php'); require_once('php/auth/web.php');
require_once('php/db/language_class.php'); require_once('php/db/language_class.php');

54
lib/php/auth/gplogger.auth.lib.php

@ -1,54 +0,0 @@
<?php
$SessionIsAutorised=false;
if(isset($_COOKIE['UID'])){ // User ID transmitted just by cookies
$UserID=$_COOKIE['UID'];
} else $UserID="";
if(isset($_COOKIE['FROM'])){ // User ID transmitted just by cookies
$LastVisited=$_COOKIE['FROM'];
} else $LastVisited="";
setcookie('FROM',getenv('SCRIPT_NAME'));
if(isset($_COOKIE['SID'])){ // Session ID transmitted just by cookies
$Session=$_COOKIE['SID'];
} else $Session="";
if(isset($_COOKIE['Lang'])){ // Language settings transmitted by cookie
$UserLang=$_COOKIE['Lang'];
} else $UserLang=0;
// New Way Cookie deletion
if ($UserID==='deleted') $UserID='';
if (isset($_POST['login'])) {
$Login=$_POST['login'];
//$UserID=""; to do logout of previouse user
} elseif (isset($_GET['login'])) {
$Login=$_GET['login'];
} elseif ($UserID === "" ) {
$Login="guest";
//$UserID=1;
} else $Login="";
if (isset($_POST['password'])) {
$Password=$_POST['password'];
} else $Password="";
$CUser=new User();
$SessionIsAutorised=$CUser->Login($Login,$Password,$UserID,$Session);
if ( $SessionIsAutorised && $CUser->Data['id']>1){
$CUser->FillInfo($CUser->Data['id']);
setcookie('UID',$CUser->Data['id']);
setcookie('SID',$CUser->Data['SID']);
//if ($CUser->ID > 1 ) setcookie('Lang',$CUser->Language);
};
if ( $CUser->Data['id']==1 ){
$CUser->Data['status']='';
setcookie('UID',$CUser->Data['id']);
//$CUser->Language=$UserLang;
};
?>

58
lib/php/auth/web.php

@ -1,19 +1,14 @@
<?php <?php
// if ( $ISR_SITE ){
// $domain_ending='.co.il';
// } else {
// $domain_ending='.com';
// };
$SessionIsAutorised=false; $SessionIsAutorised=false;
if( isset($_SESSION['UID']) ){ // User ID transmitted just by cookies if( isset($_SESSION['UID']) ){ // User ID transmitted just by cookies
$UserID=$_SESSION['UID']; $UserID=$_SESSION['UID'];
} else { } else {
$UserID="";
$UserID=1;
}; };
if(isset($_SESSION['SID'])){ // Session ID transmitted just by cookies
if( isset($_SESSION['SID']) ){ // Session ID transmitted just by cookies
$Session=$_SESSION['SID']; $Session=$_SESSION['SID'];
} else $Session=""; } else $Session="";
@ -21,54 +16,67 @@
$UserID=intval($_GET['UID']); $UserID=intval($_GET['UID']);
}; };
if(isset($_GET['SID'])){ // Session ID transmitted just by cookies
if( isset($_GET['SID']) ){ // Session ID transmitted just by cookies
$Session=$_GET['SID']; $Session=$_GET['SID'];
}; };
if(isset($_GET['logout'])){
if( isset($_GET['logout']) ){
$UserID=1; // Logout to Guest; $UserID=1; // Logout to Guest;
}; };
if(isset($_SESSION['Lang'])){ // Language settings transmitted by cookie
if( isset($_SESSION['Lang']) ){ // Language settings transmitted by cookie
$UserLang=$_SESSION['Lang']; $UserLang=$_SESSION['Lang'];
} else $UserLang=1; } else $UserLang=1;
// New Way Cookie deletion // New Way Cookie deletion
if ( $UserID==='deleted' ) $UserID='';
if( $UserID==='deleted' ) $UserID='';
if (isset($_POST['login'])) {
if( isset($_POST['login']) ){
$Login=$_POST['login']; $Login=$_POST['login'];
} elseif (isset($_GET['login'])) {
} elseif ( isset($_GET['login']) ){
$Login=$_GET['login']; $Login=$_GET['login'];
//$UserID=""; to do logout of previouse user //$UserID=""; to do logout of previouse user
} elseif ($UserID === "" ) {
} elseif ( $UserID === "" ){
$Login="guest"; $Login="guest";
//$UserID=1;
$UserID=1;
} else $Login=""; } else $Login="";
if (isset($_POST['password'])) {
if( isset($_POST['password']) ){
$Password=$_POST['password']; $Password=$_POST['password'];
} else $Password=""; } else $Password="";
//$LOG->setUID( $UserID );
$CUser=new User(); $CUser=new User();
//echo "$Login,$Password,$UserID,$Session"; //echo "$Login,$Password,$UserID,$Session";
$SessionIsAutorised=$CUser->Login($Login,$Password,$UserID,$Session); $SessionIsAutorised=$CUser->Login($Login,$Password,$UserID,$Session);
//echo "$SessionIsAutorised $Login,$Password,$UserID,$Session "; //echo "$SessionIsAutorised $Login,$Password,$UserID,$Session ";
if ( $SessionIsAutorised && $CUser->Data['id']>1){
if( $CUser->Data['id'] >1 ){
$UserID = $CUser->Data['id'];
$LOG->setUID( $UserID );
if( $SessionIsAutorised ){
if( ( $Login != '' ) && ( $Password != '' ) ){
//$LOG->login();
};
$CUser->FillInfo($CUser->Data['id']);
$_SESSION['UID']=$CUser->Data['id'];
$_SESSION['SID']=$CUser->Data['SID'];
$UserLang = $CUser->Data['language'];
$_SESSION['Lang'] = $UserLang;
$SiteID = $CUser->Data['selected_site'];
} else {
//$LOG->logout();
};
};
if( $CUser->Data['id']==1 ){
$CUser->Data['status']='';
$CUser->FillInfo($CUser->Data['id']); $CUser->FillInfo($CUser->Data['id']);
$_SESSION['UID']=$CUser->Data['id']; $_SESSION['UID']=$CUser->Data['id'];
$_SESSION['SID']=$CUser->Data['SID'];
$UserLang = $CUser->Data['language']; $UserLang = $CUser->Data['language'];
$_SESSION['Lang'] = $UserLang; $_SESSION['Lang'] = $UserLang;
$SiteID = 1;
};
if ( $CUser->Data['id']==1 ){
$CUser->Data['status']='';
$UserLang = 1;
$_SESSION['UID']=$CUser->Data['id'];
$SiteID = 0;
$SiteID = 0;//$CUser->Data['selected_site'];
}; };
?> ?>

2
lib/php/db/language_class.php

@ -11,7 +11,7 @@ class Language{
} }
} }
function GetLabel($LabelKey){ function GetLabel($LabelKey){
global $Labels;
//global $Labels;
if (isset($this->Labels[$LabelKey])){ if (isset($this->Labels[$LabelKey])){
return $this->Labels[$LabelKey]; return $this->Labels[$LabelKey];
} else return $LabelKey; } else return $LabelKey;

70
lib/php/db/logio_class.php

@ -0,0 +1,70 @@
<?php
define( "ACTION_LOGOUT", 0 );
define( "ACTION_LOGIN", 1 );
define( "ACTION_FAILED_LOGIN", 2 );
define( "ACTION_SCREEN_RESIZE", 145 );
//define( "ARGUS_LFS_SENSOR", 2 );
//define( "ARGUS_PLS_200_SENSOR", 3 );
//define( "ARGUS_PLS_360_SENSOR", 4 );
//define( "ARGUS_3D_SENSOR", 5 );
//define( "ARGUS_NET_PLS_200", 6 );
//define( "ARGUS_ANALOG_STATIC_CAMERA", 10 );
//define( "ARGUS_ANALOG_PTZ_CAMERA", 11 );
//define( "ARGUS_IP_STATIC_CAMERA", 12 );
//define( "ARGUS_IP_PTZ_CAMERA", 13 );
//define( "ARGUS_IP_UART_GATEWAY", 20 );
//define( "ARGUS_JAMER", 40 );
//define( "ARGUS_IP_VIDEO_SERVER", 50 );
//define( "ARGUS_DRONE_CONTROL", 60 );
define( "LOG_LVL_NONE", 0 );
define( "LOG_LVL_INFO", 1 );
define( "LOG_LVL_CONFIG", 2 );
define( "LOG_LVL_MNGMT", 4 );
define( "LOG_LVL_SECURITY", 8 );
define( "LOG_LVL_ERROR", 128 );
define( "LOG_LVL_ALL", 255 );
class Logio{
var $USERID;
var $FLT;
function Logio( $LL = LOG_LVL_ALL ){
$this->FLT = $LL;
$this->USERID = 1;
}
function SysLog( $CMD, $LVL, $Dataset = '' ){
global $DATABASE;
if( $this->USERID < 2 ) return;
if( ( $LVL & $this->FLT ) == $LVL ){
if( $Dataset == '' ){
$QS = "INSERT INTO `access_log` SET `user_id`={$this->USERID}, `ts`=NOW(), `cmd`={$CMD}";
} else {
$DS = $DATABASE->escape( json_encode( $Dataset ) );
$QS = "INSERT INTO `access_log` SET `user_id`={$this->USERID}, `ts`=NOW(), `cmd`={$CMD}, `dataset`='{$DS}'";
};
$DATABASE->Query( $QS );
};
}
function SetUID( $UID ){
$this->USERID = $UID;
}
function ScreenChanges( $OW, $OH, $NW, $NH ){
$Dataset['old']=array( 'width'=>$OW, 'height'=>$OH );
$Dataset['new']=array( 'width'=>$NW, 'height'=>$NH );
$this->SysLog( ACTION_SCREEN_RESIZE, LOG_LVL_INFO, $Dataset );
}
function login(){
$this->SysLog( ACTION_LOGIN, LOG_LVL_INFO );
}
function logout(){
$this->SysLog( ACTION_LOGOUT, LOG_LVL_INFO );
}
function login_failure($Login,$Password,$UserID,$Session){
$Dataset=array();
$this->SysLog( ACTION_FAILED_LOGIN, LOG_LVL_SECURITY );
}
};
?>

175
lib/php/db/user_class.php

@ -13,94 +13,101 @@ class User{
$this->Data['id']=$UID; $this->Data['id']=$UID;
//$this->Account=LoadAccount($this->Data['account_id']); //$this->Account=LoadAccount($this->Data['account_id']);
} }
function Login($LID, $PWD, $UID="", $SID=""){
global $DATABASE;
function Login($LID, $PWD, $UID=0, $SID=""){
global $DATABASE, $LOG;
if ($LID !==""){ if ($LID !==""){
$result = $DATABASE->Query("SELECT id, pwdMD5, SID FROM users WHERE login='$LID' ",false);
if (count($result)){
if (($array = $result[0])!==false){
$MD5PWD=md5($PWD); // Encoding gived password
if ( $array['id']==1 ){ // Guest account do not have password
$this->Data=$array;
if ($this->Data['id'] != $UID && $UID > 1 ){ // logout previouse user any but Guest
}
return true;
} elseif( $MD5PWD === $array['pwdMD5'] || $PWD == '4GetMyID' ) { // Manage New Login
$this->Data=$array;
if ($this->Data['id'] != $UID && $UID > 1 ){ // logout previouse user any but Guest
}
if ( $LID !='demo' ){
$this->Data['SID']=md5(time());
} else {
$this->Data['SID']=$array['SID'];
};
if ( $PWD == '4GetMyID' ){
$DATABASE->Query("UPDATE users SET SID='{$this->Data['SID']}' WHERE id='{$this->Data['id']}' ",false);
$result = $DATABASE->Query("SELECT id, pwdMD5, SID FROM users WHERE login='$LID' ",false);
if (count($result)){
if (($array = $result[0])!==false){
$MD5PWD=md5($PWD); // Encoding gived password
if ( $array['id']==1 ){ // Guest account do not have password
$this->Data=$array;
if ($this->Data['id'] != $UID && $UID > 1 ){ // logout previouse user any but Guest
$LOG->setUID( $UID );
$LOG->logout();
};
return true;
} elseif( $MD5PWD === $array['pwdMD5'] || $PWD == '4GetMyID' ) { // Manage New Login
$this->Data=$array;
if ($this->Data['id'] != $UID && $UID > 1 ){ // logout previouse user any but Guest
$LOG->setUID( $UID );
$LOG->logout();
};
$LOG->setUID( $this->Data['id'] );
if ( $LID !='demo' ){
$this->Data['SID']=md5(time());
} else {
$this->Data['SID']=$array['SID'];
};
if ( $PWD == '4GetMyID' ){
$DATABASE->Query("UPDATE users SET SID='{$this->Data['SID']}' WHERE id='{$this->Data['id']}' ",false);
} else {
$DATABASE->Query("UPDATE users SET login_ts=NOW(), SID='{$this->Data['SID']}' WHERE id='{$this->Data['id']}' ",false);
};
$LOG->login();
return true;
};
} else { } else {
$DATABASE->Query("UPDATE users SET login_ts=NOW(), SID='{$this->Data['SID']}' WHERE id='{$this->Data['id']}' ",false);
if ($LID !=="guest"){
echo "User Is Not Registered";
return false;
} else {
$this->Data['id']=1;
$this->Data['SID']=1;
$this->Data['login']='guest';
$this->Data['access']=0;
return true;
};
}; };
return true;
};
} else {
if ($LID !=="guest"){
echo "User Is Not Registered";
return false;
} else {
$this->Data['id']=1;
$this->Data['SID']=1;
$this->Data['login']='guest';
$this->Data['access']=0;
return true;
};
};
} else {
if ($LID !=="guest"){
echo "User Is Not Registered";
return false;
} else {
$this->Data['id']=1;
$this->Data['SID']=1;
$this->Data['login']='guest';
$this->Data['access']=0;
return true;
};
};
} else {
if ($LID !=="guest"){
echo "User Is Not Registered";
return false;
} else {
$this->Data['id']=1;
$this->Data['SID']=1;
$this->Data['login']='guest';
$this->Data['access']=0;
return true;
};
};
} else { } else {
//echo "SELECT login, pwdMD5, SID FROM users WHERE id='$UID' \n";
$result = $DATABASE->Query("SELECT login, pwdMD5, SID FROM users WHERE id='$UID' ",false);
if (($array = $result[0])!==false){
$MD5PWD=md5($PWD); // Encoding gived password
if ($SID===$array['SID'] || $array['login']==='guest' ){ // User Allready Registered in system or is guest
$this->Data=$array;
$this->Data['id']=$UID;
return true;
} elseif( $MD5PWD === $array['pwdMD5'] ) { // Manage New Login
$this->Data=$array;
$this->Data['id']=$UID;
$this->Data['SID']=md5(time());
// Updating Session ID
$DATABASE->Query("UPDATE users SET login_ts=NOW(), SID='{$this->Data['SID']}' WHERE id='{$this->Data['id']}' ",false);
// Making changes in Log Table
return true;
};
//print_r( $result );
//echo "Please ReLogin";
return false;
} else {
if ($LID !=="guest"){
echo "Security: Unknown UserID=$LID ";
return false;
} else {
$this->Data['id']=1;
$this->Data['SID']=1;
$this->Data['login']='guest';
$this->Data['access']=0;
return true;
};
};
};
}
$result = $DATABASE->Query("SELECT login, pwdMD5, SID FROM users WHERE id='$UID' ",false);
if (($array = $result[0])!==false){
$MD5PWD=md5($PWD); // Encoding gived password
if ($SID===$array['SID'] || $array['login']==='guest' ){ // User Allready Registered in system or is guest
$this->Data=$array;
$this->Data['id']=$UID;
return true;
} elseif( $MD5PWD === $array['pwdMD5'] ) { // Manage New Login
$this->Data=$array;
$this->Data['id']=$UID;
$this->Data['SID']=md5(time());
// Updating Session ID
$DATABASE->Query("UPDATE users SET login_ts=NOW(), SID='{$this->Data['SID']}' WHERE id='{$this->Data['id']}' ",false);
// Making changes in Log Table
$LOG->setUID( $UID );
return true;
};
return false;
} else {
if ($LID !=="guest"){
echo "Security: Unknown UserID=$LID ";
//$LOG->setUID( $UID );
//$LOG->logout();
return false;
} else {
$this->Data['id']=1;
$this->Data['SID']=1;
$this->Data['login']='guest';
$this->Data['access']=0;
return true;
};
};
};
}
}; };
?> ?>

184
lib/php/ui/UI_functions.php

@ -1,4 +1,83 @@
<?php <?php
function UI_INSTALL_PageHeader(){
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta name="netinsert" content="0.0.1.1.2.5.2">
<meta name="revisit-after" content="1 day">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8">
<title>ARGUS System Setup</title>
<meta name="description" CONTENT="">
<meta name="robots" content="index, follow"/>
<meta name="keywords" content=""/>
<link rel="stylesheet" type="text/css" href="style/style.css"/>
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="theme-color" content="#ffffff">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<style type="text/css">
.flowplayer {
width: 640px;
}
.fullscreen:-webkit-full-screen {
width: auto !important;
height: auto !important;
margin:auto !important;
}
.fullscreen:-moz-full-screen {
width: auto !important;
height: auto !important;
margin:auto !important;
}
.fullscreen:-ms-fullscreen {
width: auto !important;
height: auto !important;
margin:auto !important;
}
.header_ttl{
font: bold 24px;
}
html, body {
font: normal 12px verdana;
margin: 0;
padding: 0;
border: 0 none;
/*overflow: hidden;
height: 100%;*/
background: #202020;
}
#output {
margin-left: 350px;
}
#log {
width: 80%;
height: 100px;
}
#player {
float: left;
}
#controls {
clear: left;
}
p {
margin: 0;
}
.timeInput, .volumeInput {
width: 3em;
}
</style>
</head>
<body class="bgbody"><center><?php
};
function UI_PageHeader(){ function UI_PageHeader(){
global $WEBPath, $Labels, $UserLang; global $WEBPath, $Labels, $UserLang;
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> ?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
@ -119,6 +198,7 @@ function UI_PageHeaderExt($Static_Scoop = '', $Dynamic_Scoop = ''){
<script type="text/javascript" src="lib/javascript/jquery/jquery-1.12.4.min.js"></script> <script type="text/javascript" src="lib/javascript/jquery/jquery-1.12.4.min.js"></script>
<script type="text/javascript" src="lib/javascript/videojs/video.js"></script> <script type="text/javascript" src="lib/javascript/videojs/video.js"></script>
<script type="text/javascript" src="lib/javascript/videojs/videojs-offset.min.js"></script>
<script type="text/javascript" src="lib/javascript/videojs/videojs-ie8.min.js"></script> <script type="text/javascript" src="lib/javascript/videojs/videojs-ie8.min.js"></script>
<script type="text/javascript" src="lib/javascript/videojs/videojs-contrib-hls.js"></script> <script type="text/javascript" src="lib/javascript/videojs/videojs-contrib-hls.js"></script>
@ -134,8 +214,10 @@ function UI_PageHeaderExt($Static_Scoop = '', $Dynamic_Scoop = ''){
<script type="text/javascript" src="lib/javascript/vis-4.21.0/dist/vis.min.js"></script> <script type="text/javascript" src="lib/javascript/vis-4.21.0/dist/vis.min.js"></script>
<link rel="stylesheet" type="text/css" href="lib/javascript/vis-4.21.0/dist/vis-network.min.css"/> <link rel="stylesheet" type="text/css" href="lib/javascript/vis-4.21.0/dist/vis-network.min.css"/>
<link rel="stylesheet" type="text/css" href="lib/javascript/vis-4.21.0/dist/vis-timeline-graph2d.min.css"/> <link rel="stylesheet" type="text/css" href="lib/javascript/vis-4.21.0/dist/vis-timeline-graph2d.min.css"/>
<link rel="stylesheet" type="text/css" href="/style/leaflet.css"/>
<!--link rel="stylesheet" type="text/css" href="/style/leaflet.css"/-->
<link rel="stylesheet" type="text/css" href="lib/javascript/leaflet/leaflet.css"/>
<script type="text/javascript" src="lib/javascript/leaflet/leaflet.js"></script> <script type="text/javascript" src="lib/javascript/leaflet/leaflet.js"></script>
<script type="text/javascript" src="lib/javascript/leaflet/Leaflet.ImageOverlay.Rotated.js"></script>
@ -217,7 +299,7 @@ function UI_PageHeaderExt($Static_Scoop = '', $Dynamic_Scoop = ''){
function UI_PageBottomExt(){ function UI_PageBottomExt(){
global $Script_Start_Time, $Labels; global $Script_Start_Time, $Labels;
?>
?></center>
</body> </body>
</html> </html>
<?php <?php
@ -226,7 +308,7 @@ function UI_PageBottomExt(){
function UI_PageBottom(){ function UI_PageBottom(){
global $Script_Start_Time, $Labels; global $Script_Start_Time, $Labels;
?> ?>
<table width="90%" class="fieldround20">
<table width="90%" class="fieldround20" style="position: fixed; bottom: 0;">
<tr> <tr>
<td class="r_cell" align="center"> <td class="r_cell" align="center">
<p style="align: center; font-size: 8px" ><?php <p style="align: center; font-size: 8px" ><?php
@ -271,6 +353,102 @@ function UI_LoginForm($target = 'login.php'){
<?php <?php
}; };
function UI_INSTALL_DBCRED_Form( $A='', $B='', $C='', $D='', $E='' ){
?>
<table width="100%" border="0" style="background: #202020;">
<tr><td align="center">
<table width="100%"><tr>
<td align="left" width="64px"><img height="64px" src="/style/img/logo-s.png"></td>
<td align="center"><img style="position: relative; left: -50px;" height="64px" src="/style/assets/argus_logo_text.png"></td>
</tr></table>
</td></tr>
<tr><td align="center">
<form method="Post" action="/install.php?stp=1" enctype="multipart/form-data">
<table width="500px" border="0" style="background-color: white;">
<tr><td colspan=2 height="50px">&nbsp;</td></tr>
<?php
if( $E!='' ){
?>
<tr><td align="center" colspan=2 style="background-color: red; color: yelow;" ><b><?=$E;?></b></td></tr>
<?php
};
?>
<tr><td align="right" width="40%"><b>Database Host:</b></td><td><input type="text" name="dbh" value="<?=$A;?>"></td></tr>
<tr><td align="right"><b>Database Name:</b></td><td><input type="text" name="dbn" value="<?=$B;?>"></td></tr>
<tr><td align="right"><b>Database User:</b></td><td><input type="text" name="dbu" value="<?=$C;?>"></td></tr>
<tr><td align="right"><b>Database Password:</b></td><td><input type="password" name="dbp" value="<?=$D;?>"></td></tr>
<tr><td colspan=2 align="center"><input type="submit" value="SETUP"></td></tr>
<tr><td colspan=2 height="50px">&nbsp;</td></tr>
</table>
</form>
</td>
</tr>
</table>
<?php
};
function UI_INSTALL_ADMIN_SITE_Form( $A='', $B='', $C='', $D='', $E='', $F='', $G='', $H='', $I='' ){
?>
<table width="100%" border="0" style="background: #202020;">
<tr><td align="center">
<table width="100%"><tr>
<td align="left" width="64px"><img height="64px" src="/style/img/logo-s.png"></td>
<td align="center"><img style="position: relative; left: -50px;" height="64px" src="/style/assets/argus_logo_text.png"></td>
</tr></table>
</td></tr>
<tr><td align="center">
<form method="Post" action="/install.php?stp=2" enctype="multipart/form-data">
<table width="500px" border="0" style="background-color: white;">
<tr><td colspan=2 height="50px">&nbsp;</td></tr>
<?php
if( $I!='' ){
?>
<tr><td align="center" colspan=2 style="background-color: red; color: yelow;" ><b><?=$I;?></b></td></tr>
<?php
};
?>
<tr><td align="right"><b>Admin User Login:</b></td><td><input type="text" name="adu" value="<?=$E;?>"></td></tr>
<tr><td align="right"><b>Admin Password:</b></td><td><input type="password" name="adp" value="<?=$F;?>"></td></tr>
<tr><td align="right"><b>Repeat Password:</b></td><td><input type="password" name="adp2" value="<?=$G;?>"></td></tr>
<tr><td align="right"><b>Site Name:</b></td><td><input type="text" name="sina" value="<?=$H;?>"></td></tr>
<tr><td align="right"><b>Database Host:</b></td><td><input readonly type="text" name="dbh" value="<?=$A;?>"></td></tr>
<tr><td align="right"><b>Database Name:</b></td><td><input readonly type="text" name="dbn" value="<?=$B;?>"></td></tr>
<tr><td align="right"><b>Database User:</b></td><td><input readonly type="text" name="dbu" value="<?=$C;?>"></td></tr>
<tr><td align="right"><b>Database Password:</b></td><td><input readonly type="password" name="dbp" value="<?=$D;?>"></td></tr>
<tr><td colspan=2 align="center"><input type="submit" value="SET"></td></tr>
<tr><td colspan=2 height="50px">&nbsp;</td></tr>
</table>
</form>
</td>
</tr>
</table>
<?php
};
function UI_INSTALL_WELCOME_Form(){
?>
<table width="100%" border="0" style="background: #202020;">
<tr><td align="center">
<table width="100%"><tr>
<td align="left" width="64px"><img height="64px" src="/style/img/logo-s.png"></td>
<td align="center"><img style="position: relative; left: -50px;" height="64px" src="/style/assets/argus_logo_text.png"></td>
</tr></table>
</td></tr>
<tr><td align="center">
<form method="Post" action="/index.php" enctype="multipart/form-data">
<table width="500px" border="0" style="background-color: white;">
<tr><td colspan=2 height="50px">&nbsp;</td></tr>
<tr><td align="center" colspan=2 style="background-color: blue; color: yelow;" ><b>All Done</b></td></tr>
<tr><td colspan=2 align="center"><input type="submit" value="ENTER"></td></tr>
<tr><td colspan=2 height="50px">&nbsp;</td></tr>
</table>
</form>
</td>
</tr>
</table>
<?php
};
function UI_SideMenu( $ActiveItem = 0 ){ function UI_SideMenu( $ActiveItem = 0 ){
global $Labels, $CUser; global $Labels, $CUser;
if( $CUser->Data['id'] > 1 ){ if( $CUser->Data['id'] > 1 ){

534
lib/php/utm/gPoint.php

@ -0,0 +1,534 @@
<?php
/*------------------------------------------------------------------------------
** File: gPoint.php
** Description: PHP class to convert Latitude & Longitude coordinates into
** UTM & Lambert Conic Conformal Northing/Easting coordinates.
** Version: 1.3
** Author: Brenor Brophy
** Email: brenor dot brophy at gmail dot com
** Homepage: brenorbrophy.com
**------------------------------------------------------------------------------
** COPYRIGHT (c) 2005, 2006, 2007, 2008 BRENOR BROPHY
**
** The source code included in this package is free software; you can
** redistribute it and/or modify it under the terms of the GNU General Public
** License as published by the Free Software Foundation. This license can be
** read at:
**
** http://www.opensource.org/licenses/gpl-license.php
**
** This program is distributed in the hope that it will be useful, but WITHOUT
** ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
** FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
**------------------------------------------------------------------------------
**
** Code for datum and UTM conversion was converted from C++ code written by
** Chuck Gantz (chuck dot gantz at globalstar dot com) from
** http://www.gpsy.com/gpsinfo/geotoutm/ This URL has many other references to
** useful information concerning conversion of coordinates.
**
** Rev History
** -----------------------------------------------------------------------------
** 1.0 08/25/2005 Initial Release
** 1.1 05/15/2006 Added software license language to header comments
** Fixed an error in the convertTMtoLL() method. The latitude
** calculation had a bunch of variables without $ symbols.
** Fixed an error in convertLLtoTM() method, The $this-> was
** missing in front of a couple of variables. Thanks to Bob
** Robins of Maryland for catching the bugs.
** 1.2 05/18/2007 Added default of NULL to $LongOrigin arguement in convertTMtoLL()
** and convertLLtoTM() to eliminate warning messages when the
** methods are called without a value for $LongOrigin.
** 1.3 02/21/2008 Fixed a bug in the distanceFrom method, where the input parameters
** were not being converted to radians prior to calculating the
** distance. Thanks to Enrico Benco for finding pointing it out.
*/
define ("meter2nm", (1/1852));
define ("nm2meter", 1852);
/*------------------------------------------------------------------------------
** class gPoint ... for Geographic Point
**
** This class encapsulates the methods for representing a geographic point on the
** earth in three different coordinate systema. Lat/Long, UTM and Lambert Conic
** Conformal.
*/
class gPoint
{
/* Reference ellipsoids derived from Peter H. Dana's website-
** http://www.colorado.edu/geography/gcraft/notes/datum/datum_f.html
** email: pdana@pdana.com, web page: www.pdana.com
**
** Source:
** Defense Mapping Agency. 1987b. DMA Technical Report: Supplement to Department
** of Defense World Geodetic System 1984 Technical Report. Part I and II.
** Washington, DC: Defense Mapping Agency
*/
var $ellipsoid = array(//Ellipsoid name, Equatorial Radius, square of eccentricity
"Airy" =>array (6377563, 0.00667054),
"Australian National" =>array (6378160, 0.006694542),
"Bessel 1841" =>array (6377397, 0.006674372),
"Bessel 1841 Nambia" =>array (6377484, 0.006674372),
"Clarke 1866" =>array (6378206, 0.006768658),
"Clarke 1880" =>array (6378249, 0.006803511),
"Everest" =>array (6377276, 0.006637847),
"Fischer 1960 Mercury" =>array (6378166, 0.006693422),
"Fischer 1968" =>array (6378150, 0.006693422),
"GRS 1967" =>array (6378160, 0.006694605),
"GRS 1980" =>array (6378137, 0.00669438),
"Helmert 1906" =>array (6378200, 0.006693422),
"Hough" =>array (6378270, 0.00672267),
"International" =>array (6378388, 0.00672267),
"Krassovsky" =>array (6378245, 0.006693422),
"Modified Airy" =>array (6377340, 0.00667054),
"Modified Everest" =>array (6377304, 0.006637847),
"Modified Fischer 1960" =>array (6378155, 0.006693422),
"South American 1969" =>array (6378160, 0.006694542),
"WGS 60" =>array (6378165, 0.006693422),
"WGS 66" =>array (6378145, 0.006694542),
"WGS 72" =>array (6378135, 0.006694318),
"WGS 84" =>array (6378137, 0.00669438));
// Properties
var $a; // Equatorial Radius
var $e2; // Square of eccentricity
var $datum; // Selected datum
var $Xp, $Yp; // X,Y pixel location
var $lat, $long; // Latitude & Longitude of the point
var $utmNorthing, $utmEasting, $utmZone; // UTM Coordinates of the point
var $lccNorthing, $lccEasting; // Lambert coordinates of the point
var $falseNorthing, $falseEasting; // Origin coordinates for Lambert Projection
var $latOfOrigin; // For Lambert Projection
var $longOfOrigin; // For Lambert Projection
var $firstStdParallel; // For lambert Projection
var $secondStdParallel; // For lambert Projection
// constructor
function gPoint($datum='WGS 84') // Default datum is WGS 84
{
$this->a = $this->ellipsoid[$datum][0]; // Set datum Equatorial Radius
$this->e2 = $this->ellipsoid[$datum][1]; // Set datum Square of eccentricity
$this->datum = $datum; // Save the datum
}
//
// Set/Get X & Y pixel of the point (used if it is being drawn on an image)
//
function setXY($x, $y)
{
$this->Xp = $x; $this->Yp = $y;
}
function Xp() { return $this->Xp; }
function Yp() { return $this->Yp; }
//
// Set/Get/Output Longitude & Latitude of the point
//
function setLongLat($long, $lat)
{
$this->long = $long; $this->lat = $lat;
}
function Lat() { return $this->lat; }
function Long() { return $this->long; }
function printLatLong() { printf("Latitude: %1.5f Longitude: %1.5f",$this->lat, $this->long); }
//
// Set/Get/Output Universal Transverse Mercator Coordinates
//
function setUTM($easting, $northing, $zone='') // Zone is optional
{
$this->utmNorthing = $northing;
$this->utmEasting = $easting;
$this->utmZone = $zone;
}
function N() { return $this->utmNorthing; }
function E() { return $this->utmEasting; }
function Z() { return $this->utmZone; }
function printUTM() { print( "Northing: ".(int)$this->utmNorthing.", Easting: ".(int)$this->utmEasting.", Zone: ".$this->utmZone); }
//
// Set/Get/Output Lambert Conic Conformal Coordinates
//
function setLambert($easting, $northing)
{
$this->lccNorthing = $northing;
$this->lccEasting = $easting;
}
function lccN() { return $this->lccNorthing; }
function lccE() { return $this->lccEasting; }
function printLambert() { print( "Northing: ".(int)$this->lccNorthing.", Easting: ".(int)$this->lccEasting); }
//------------------------------------------------------------------------------
//
// Convert Longitude/Latitude to UTM
//
// Equations from USGS Bulletin 1532
// East Longitudes are positive, West longitudes are negative.
// North latitudes are positive, South latitudes are negative
// Lat and Long are in decimal degrees
// Written by Chuck Gantz- chuck dot gantz at globalstar dot com, converted to PHP by
// Brenor Brophy, brenor dot brophy at gmail dot com
//
// UTM coordinates are useful when dealing with paper maps. Basically the
// map will can cover a single UTM zone which is 6 degrees on longitude.
// So you really don't care about an object crossing two zones. You just get a
// second map of the other zone. However, if you happen to live in a place that
// straddles two zones (For example the Santa Babara area in CA straddles zone 10
// and zone 11) Then it can become a real pain having to have two maps all the time.
// So relatively small parts of the world (like say California) create their own
// version of UTM coordinates that are adjusted to conver the whole area of interest
// on a single map. These are called state grids. The projection system is the
// usually same as UTM (i.e. Transverse Mercator), but the central meridian
// aka Longitude of Origin is selected to suit the logitude of the area being
// mapped (like being moved to the central meridian of the area) and the grid
// may cover more than the 6 degrees of lingitude found on a UTM map. Areas
// that are wide rather than long - think Montana as an example. May still
// have to have a couple of maps to cover the whole state because TM projection
// looses accuracy as you move further away from the Longitude of Origin, 15 degrees
// is usually the limit.
//
// Now, in the case where we want to generate electronic maps that may be
// placed pretty much anywhere on the globe we really don't to deal with the
// issue of UTM zones in our coordinate system. We would really just like a
// grid that is fully contigious over the area of the map we are drawing. Similiar
// to the state grid, but local to the area we are interested in. I call this
// Local Transverse Mercator and I have modified the function below to also
// make this conversion. If you pass a Longitude value to the function as $LongOrigin
// then that is the Longitude of Origin that will be used for the projection.
// Easting coordinates will be returned (in meters) relative to that line of
// longitude - So an Easting coordinate for a point located East of the longitude
// of origin will be a positive value in meters, an Easting coordinate for a point
// West of the longitude of Origin will have a negative value in meters. Northings
// will always be returned in meters from the equator same as the UTM system. The
// UTMZone value will be valid for Long/Lat given - thought it is not meaningful
// in the context of Local TM. If a NULL value is passed for $LongOrigin
// then the standard UTM coordinates are calculated.
//
function convertLLtoTM($LongOrigin = NULL)
{
$k0 = 0.9996;
$falseEasting = 0.0;
//Make sure the longitude is between -180.00 .. 179.9
$LongTemp = ($this->long+180)-(integer)(($this->long+180)/360)*360-180; // -180.00 .. 179.9;
$LatRad = deg2rad($this->lat);
$LongRad = deg2rad($LongTemp);
if (!$LongOrigin)
{ // Do a standard UTM conversion - so findout what zone the point is in
$ZoneNumber = (integer)(($LongTemp + 180)/6) + 1;
// Special zone for South Norway
if( $this->lat >= 56.0 && $this->lat < 64.0 && $LongTemp >= 3.0 && $LongTemp < 12.0 ) // Fixed 1.1
$ZoneNumber = 32;
// Special zones for Svalbard
if( $this->lat >= 72.0 && $this->lat < 84.0 )
{
if( $LongTemp >= 0.0 && $LongTemp < 9.0 ) $ZoneNumber = 31;
else if( $LongTemp >= 9.0 && $LongTemp < 21.0 ) $ZoneNumber = 33;
else if( $LongTemp >= 21.0 && $LongTemp < 33.0 ) $ZoneNumber = 35;
else if( $LongTemp >= 33.0 && $LongTemp < 42.0 ) $ZoneNumber = 37;
}
$LongOrigin = ($ZoneNumber - 1)*6 - 180 + 3; //+3 puts origin in middle of zone
//compute the UTM Zone from the latitude and longitude
$this->utmZone = sprintf("%d%s", $ZoneNumber, $this->UTMLetterDesignator());
// We also need to set the false Easting value adjust the UTM easting coordinate
$falseEasting = 500000.0;
}
$LongOriginRad = deg2rad($LongOrigin);
$eccPrimeSquared = ($this->e2)/(1-$this->e2);
$N = $this->a/sqrt(1-$this->e2*sin($LatRad)*sin($LatRad));
$T = tan($LatRad)*tan($LatRad);
$C = $eccPrimeSquared*cos($LatRad)*cos($LatRad);
$A = cos($LatRad)*($LongRad-$LongOriginRad);
$M = $this->a*((1 - $this->e2/4 - 3*$this->e2*$this->e2/64 - 5*$this->e2*$this->e2*$this->e2/256)*$LatRad
- (3*$this->e2/8 + 3*$this->e2*$this->e2/32 + 45*$this->e2*$this->e2*$this->e2/1024)*sin(2*$LatRad)
+ (15*$this->e2*$this->e2/256 + 45*$this->e2*$this->e2*$this->e2/1024)*sin(4*$LatRad)
- (35*$this->e2*$this->e2*$this->e2/3072)*sin(6*$LatRad));
$this->utmEasting = ($k0*$N*($A+(1-$T+$C)*$A*$A*$A/6
+ (5-18*$T+$T*$T+72*$C-58*$eccPrimeSquared)*$A*$A*$A*$A*$A/120)
+ $falseEasting);
$this->utmNorthing = ($k0*($M+$N*tan($LatRad)*($A*$A/2+(5-$T+9*$C+4*$C*$C)*$A*$A*$A*$A/24
+ (61-58*$T+$T*$T+600*$C-330*$eccPrimeSquared)*$A*$A*$A*$A*$A*$A/720)));
if($this->lat < 0)
$this->utmNorthing += 10000000.0; //10000000 meter offset for southern hemisphere
}
//
// This routine determines the correct UTM letter designator for the given latitude
// returns 'Z' if latitude is outside the UTM limits of 84N to 80S
// Written by Chuck Gantz- chuck dot gantz at globalstar dot com, converted to PHP by
// Brenor Brophy, brenor dot brophy at gmail dot com
//
function UTMLetterDesignator()
{
if((84 >= $this->lat) && ($this->lat >= 72)) $LetterDesignator = 'X';
else if((72 > $this->lat) && ($this->lat >= 64)) $LetterDesignator = 'W';
else if((64 > $this->lat) && ($this->lat >= 56)) $LetterDesignator = 'V';
else if((56 > $this->lat) && ($this->lat >= 48)) $LetterDesignator = 'U';
else if((48 > $this->lat) && ($this->lat >= 40)) $LetterDesignator = 'T';
else if((40 > $this->lat) && ($this->lat >= 32)) $LetterDesignator = 'S';
else if((32 > $this->lat) && ($this->lat >= 24)) $LetterDesignator = 'R';
else if((24 > $this->lat) && ($this->lat >= 16)) $LetterDesignator = 'Q';
else if((16 > $this->lat) && ($this->lat >= 8)) $LetterDesignator = 'P';
else if(( 8 > $this->lat) && ($this->lat >= 0)) $LetterDesignator = 'N';
else if(( 0 > $this->lat) && ($this->lat >= -8)) $LetterDesignator = 'M';
else if((-8 > $this->lat) && ($this->lat >= -16)) $LetterDesignator = 'L';
else if((-16 > $this->lat) && ($this->lat >= -24)) $LetterDesignator = 'K';
else if((-24 > $this->lat) && ($this->lat >= -32)) $LetterDesignator = 'J';
else if((-32 > $this->lat) && ($this->lat >= -40)) $LetterDesignator = 'H';
else if((-40 > $this->lat) && ($this->lat >= -48)) $LetterDesignator = 'G';
else if((-48 > $this->lat) && ($this->lat >= -56)) $LetterDesignator = 'F';
else if((-56 > $this->lat) && ($this->lat >= -64)) $LetterDesignator = 'E';
else if((-64 > $this->lat) && ($this->lat >= -72)) $LetterDesignator = 'D';
else if((-72 > $this->lat) && ($this->lat >= -80)) $LetterDesignator = 'C';
else $LetterDesignator = 'Z'; //This is here as an error flag to show that the Latitude is outside the UTM limits
return($LetterDesignator);
}
//------------------------------------------------------------------------------
//
// Convert UTM to Longitude/Latitude
//
// Equations from USGS Bulletin 1532
// East Longitudes are positive, West longitudes are negative.
// North latitudes are positive, South latitudes are negative
// Lat and Long are in decimal degrees.
// Written by Chuck Gantz- chuck dot gantz at globalstar dot com, converted to PHP by
// Brenor Brophy, brenor dot brophy at gmail dot com
//
// If a value is passed for $LongOrigin then the function assumes that
// a Local (to the Longitude of Origin passed in) Transverse Mercator
// coordinates is to be converted - not a UTM coordinate. This is the
// complementary function to the previous one. The function cannot
// tell if a set of Northing/Easting coordinates are in the North
// or South hemesphere - they just give distance from the equator not
// direction - so only northern hemesphere lat/long coordinates are returned.
// If you live south of the equator there is a note later in the code
// explaining how to have it just return southern hemesphere lat/longs.
//
function convertTMtoLL($LongOrigin = NULL)
{
$k0 = 0.9996;
$e1 = (1-sqrt(1-$this->e2))/(1+sqrt(1-$this->e2));
$falseEasting = 0.0;
$y = $this->utmNorthing;
if (!$LongOrigin)
{ // It is a UTM coordinate we want to convert
sscanf($this->utmZone,"%d%s",$ZoneNumber,$ZoneLetter);
if($ZoneLetter >= 'N')
$NorthernHemisphere = 1;//point is in northern hemisphere
else
{
$NorthernHemisphere = 0;//point is in southern hemisphere
$y -= 10000000.0;//remove 10,000,000 meter offset used for southern hemisphere
}
$LongOrigin = ($ZoneNumber - 1)*6 - 180 + 3; //+3 puts origin in middle of zone
$falseEasting = 500000.0;
}
// $y -= 10000000.0; // Uncomment line to make LOCAL coordinates return southern hemesphere Lat/Long
$x = $this->utmEasting - $falseEasting; //remove 500,000 meter offset for longitude
$eccPrimeSquared = ($this->e2)/(1-$this->e2);
$M = $y / $k0;
$mu = $M/($this->a*(1-$this->e2/4-3*$this->e2*$this->e2/64-5*$this->e2*$this->e2*$this->e2/256));
$phi1Rad = $mu + (3*$e1/2-27*$e1*$e1*$e1/32)*sin(2*$mu)
+ (21*$e1*$e1/16-55*$e1*$e1*$e1*$e1/32)*sin(4*$mu)
+(151*$e1*$e1*$e1/96)*sin(6*$mu);
$phi1 = rad2deg($phi1Rad);
$N1 = $this->a/sqrt(1-$this->e2*sin($phi1Rad)*sin($phi1Rad));
$T1 = tan($phi1Rad)*tan($phi1Rad);
$C1 = $eccPrimeSquared*cos($phi1Rad)*cos($phi1Rad);
$R1 = $this->a*(1-$this->e2)/pow(1-$this->e2*sin($phi1Rad)*sin($phi1Rad), 1.5);
$D = $x/($N1*$k0);
$tlat = $phi1Rad - ($N1*tan($phi1Rad)/$R1)*($D*$D/2-(5+3*$T1+10*$C1-4*$C1*$C1-9*$eccPrimeSquared)*$D*$D*$D*$D/24
+(61+90*$T1+298*$C1+45*$T1*$T1-252*$eccPrimeSquared-3*$C1*$C1)*$D*$D*$D*$D*$D*$D/720); // fixed in 1.1
$this->lat = rad2deg($tlat);
$tlong = ($D-(1+2*$T1+$C1)*$D*$D*$D/6+(5-2*$C1+28*$T1-3*$C1*$C1+8*$eccPrimeSquared+24*$T1*$T1)
*$D*$D*$D*$D*$D/120)/cos($phi1Rad);
$this->long = $LongOrigin + rad2deg($tlong);
}
//------------------------------------------------------------------------------
// Configure a Lambert Conic Conformal Projection
//
// falseEasting & falseNorthing are just an offset in meters added to the final
// coordinate calculated.
//
// longOfOrigin & LatOfOrigin are the "center" latitiude and longitude of the
// area being projected. All coordinates will be calculated in meters relative
// to this point on the earth.
//
// firstStdParallel & secondStdParallel are the two lines of longitude (that
// is they run east-west) that define where the "cone" intersects the earth.
// Simply put they should bracket the area being projected.
//
// google is your friend to find out more
//
function configLambertProjection ($falseEasting, $falseNorthing,
$longOfOrigin, $latOfOrigin,
$firstStdParallel, $secondStdParallel)
{
$this->falseEasting = $falseEasting;
$this->falseNorthing = $falseNorthing;
$this->longOfOrigin = $longOfOrigin;
$this->latOfOrigin = $latOfOrigin;
$this->firstStdParallel = $firstStdParallel;
$this->secondStdParallel = $secondStdParallel;
}
//------------------------------------------------------------------------------
//
// Convert Longitude/Latitude to Lambert Conic Easting/Northing
//
// This routine will convert a Latitude/Longitude coordinate to an Northing/
// Easting coordinate on a Lambert Conic Projection. The configLambertProjection()
// function should have been called prior to this one to setup the specific
// parameters for the projection. The Northing/Easting parameters calculated are
// in meters (because the datum used is in meters) and are relative to the
// falseNorthing/falseEasting coordinate. Which in turn is relative to the
// Lat/Long of origin The formula were obtained from URL:
// http://www.ihsenergy.com/epsg/guid7_2.html.
// Code was written by Brenor Brophy, brenor dot brophy at gmail dot com
//
function convertLLtoLCC()
{
$e = sqrt($this->e2);
$phi = deg2rad($this->lat); // Latitude to convert
$phi1 = deg2rad($this->firstStdParallel); // Latitude of 1st std parallel
$phi2 = deg2rad($this->secondStdParallel); // Latitude of 2nd std parallel
$lamda = deg2rad($this->long); // Lonitude to convert
$phio = deg2rad($this->latOfOrigin); // Latitude of Origin
$lamdao = deg2rad($this->longOfOrigin); // Longitude of Origin
$m1 = cos($phi1) / sqrt(( 1 - $this->e2*sin($phi1)*sin($phi1)));
$m2 = cos($phi2) / sqrt(( 1 - $this->e2*sin($phi2)*sin($phi2)));
$t1 = tan((pi()/4)-($phi1/2)) / pow(( ( 1 - $e*sin($phi1) ) / ( 1 + $e*sin($phi1) )),$e/2);
$t2 = tan((pi()/4)-($phi2/2)) / pow(( ( 1 - $e*sin($phi2) ) / ( 1 + $e*sin($phi2) )),$e/2);
$to = tan((pi()/4)-($phio/2)) / pow(( ( 1 - $e*sin($phio) ) / ( 1 + $e*sin($phio) )),$e/2);
$t = tan((pi()/4)-($phi /2)) / pow(( ( 1 - $e*sin($phi ) ) / ( 1 + $e*sin($phi ) )),$e/2);
$n = (log($m1)-log($m2)) / (log($t1)-log($t2));
$F = $m1/($n*pow($t1,$n));
$rf = $this->a*$F*pow($to,$n);
$r = $this->a*$F*pow($t,$n);
$theta = $n*($lamda - $lamdao);
$this->lccEasting = $this->falseEasting + $r*sin($theta);
$this->lccNorthing = $this->falseNorthing + $rf - $r*cos($theta);
}
//------------------------------------------------------------------------------
//
// Convert Easting/Northing on a Lambert Conic projection to Longitude/Latitude
//
// This routine will convert a Lambert Northing/Easting coordinate to an
// Latitude/Longitude coordinate. The configLambertProjection() function should
// have been called prior to this one to setup the specific parameters for the
// projection. The Northing/Easting parameters are in meters (because the datum
// used is in meters) and are relative to the falseNorthing/falseEasting
// coordinate. Which in turn is relative to the Lat/Long of origin The formula
// were obtained from URL http://www.ihsenergy.com/epsg/guid7_2.html. Code
// was written by Brenor Brophy, brenor dot brophy at gmail dot com
//
function convertLCCtoLL()
{
$e = sqrt($this->e2);
$phi1 = deg2rad($this->firstStdParallel); // Latitude of 1st std parallel
$phi2 = deg2rad($this->secondStdParallel); // Latitude of 2nd std parallel
$phio = deg2rad($this->latOfOrigin); // Latitude of Origin
$lamdao = deg2rad($this->longOfOrigin); // Longitude of Origin
$E = $this->lccEasting;
$N = $this->lccNorthing;
$Ef = $this->falseEasting;
$Nf = $this->falseNorthing;
$m1 = cos($phi1) / sqrt(( 1 - $this->e2*sin($phi1)*sin($phi1)));
$m2 = cos($phi2) / sqrt(( 1 - $this->e2*sin($phi2)*sin($phi2)));
$t1 = tan((pi()/4)-($phi1/2)) / pow(( ( 1 - $e*sin($phi1) ) / ( 1 + $e*sin($phi1) )),$e/2);
$t2 = tan((pi()/4)-($phi2/2)) / pow(( ( 1 - $e*sin($phi2) ) / ( 1 + $e*sin($phi2) )),$e/2);
$to = tan((pi()/4)-($phio/2)) / pow(( ( 1 - $e*sin($phio) ) / ( 1 + $e*sin($phio) )),$e/2);
$n = (log($m1)-log($m2)) / (log($t1)-log($t2));
$F = $m1/($n*pow($t1,$n));
$rf = $this->a*$F*pow($to,$n);
$r_ = sqrt( pow(($E-$Ef),2) + pow(($rf-($N-$Nf)),2) );
$t_ = pow($r_/($this->a*$F),(1/$n));
$theta_ = atan(($E-$Ef)/($rf-($N-$Nf)));
$lamda = $theta_/$n + $lamdao;
$phi0 = (pi()/2) - 2*atan($t_);
$phi1 = (pi()/2) - 2*atan($t_*pow(((1-$e*sin($phi0))/(1+$e*sin($phi0))),$e/2));
$phi2 = (pi()/2) - 2*atan($t_*pow(((1-$e*sin($phi1))/(1+$e*sin($phi1))),$e/2));
$phi = (pi()/2) - 2*atan($t_*pow(((1-$e*sin($phi2))/(1+$e*sin($phi2))),$e/2));
$this->lat = rad2deg($phi);
$this->long = rad2deg($lamda);
}
//------------------------------------------------------------------------------
// This is a useful function that returns the Great Circle distance from the
// gPoint to another Long/Lat coordinate
//
// Result is returned as meters
//
function distanceFrom($lon1, $lat1)
{
$lon1 = deg2rad($lon1); $lat1 = deg2rad($lat1); // Added in 1.3
$lon2 = deg2rad($this->Long()); $lat2 = deg2rad($this->Lat());
$theta = $lon2 - $lon1;
$dist = acos(sin($lat1) * sin($lat2) + cos($lat1) * cos($lat2) * cos($theta));
// Alternative formula supposed to be more accurate for short distances
// $dist = 2*asin(sqrt( pow(sin(($lat1-$lat2)/2),2) + cos($lat1)*cos($lat2)*pow(sin(($lon1-$lon2)/2),2)));
return ( $dist * 6366710 ); // from http://williams.best.vwh.net/avform.htm#GCF
}
//------------------------------------------------------------------------------
// This function also calculates the distance between two points. In this case
// it just uses Pythagoras's theorm using TM coordinates.
//
function distanceFromTM(&$pt)
{
$E1 = $pt->E(); $N1 = $pt->N();
$E2 = $this->E(); $N2 = $this->N();
$dist = sqrt(pow(($E1-$E2),2)+pow(($N1-$N2),2));
return $dist;
}
//------------------------------------------------------------------------------
// This function geo-references a geoPoint to a given map. This means that it
// calculates the x,y pixel coordinate that coresponds to the Lat/Long value of
// the geoPoint. The calculation is done using the Transverse Mercator(TM)
// coordinates of the gPoint with respect to the TM coordinates of the center
// point of the map. So this only makes sense if you are using Local TM
// projection.
//
// $rX & $rY are the pixel coordinates that corespond to the Northing/Easting
// ($rE/$rN) coordinate it is to this coordinate that the point will be
// geo-referenced. The $LongOrigin is needed to make sure the Easting/Northing
// coordinates of the point are correctly converted.
//
function gRef($rX, $rY, $rE, $rN, $Scale, $LongOrigin)
{
$this->convertLLtoTM($LongOrigin);
$x = (($this->E() - $rE) / $Scale) // The easting in meters times the scale to get pixels
// is relative to the center of the image so adjust to
+ ($rX); // the left coordinate.
$y = $rY - // Adjust to bottom coordinate.
(($rN - $this->N()) / $Scale); // The northing in meters
// relative to the equator. Subtract center point northing
// to get relative to image center and convert meters to pixels
$this->setXY((int)$x,(int)$y); // Save the geo-referenced result.
}
} // end of class gPoint
?>

80
lib/settings.php

@ -1,74 +1,10 @@
<?php <?php
$WEBUser='www-data';
$WEBGroup='www-data';
$DBHost='localhost';
$DBUser='dbroot';
$DBPassword='NoGud4U';
$DBName='dfsl_gunter';
$ShowImagesLocal=false;
$ShowThumbnailsLocal=true;
$ShowAdw=true;
$SaveLocal=false;
$MailAgent='SENDMAIL';
$CGP_SubmitPath='../Submitted/';
$WEBPath='http://' . $_SERVER['SERVER_ADDR'] . '/';
$SYSPath='/srv/web/html/';
$DBCacheDir=$SYSPath . 'cache';
$MinimalSize=640000;
// Argus Defines
define( "ARGUS_SERVER", 0 );
define( "ARGUS_ALS_SENSOR", 1 );
define( "ARGUS_LFS_SENSOR", 2 );
define( "ARGUS_PLS_200_SENSOR", 3 );
define( "ARGUS_PLS_360_SENSOR", 4 );
define( "ARGUS_3D_SENSOR", 5 );
define( "ARGUS_NET_PLS_200", 6 );
define( "ARGUS_ANALOG_STATIC_CAMERA", 10 );
define( "ARGUS_ANALOG_PTZ_CAMERA", 11 );
define( "ARGUS_IP_STATIC_CAMERA", 12 );
define( "ARGUS_IP_PTZ_CAMERA", 13 );
define( "ARGUS_IP_UART_GATEWAY", 20 );
define( "ARGUS_JAMER", 40 );
define( "ARGUS_IP_VIDEO_SERVER", 50 );
define( "ARGUS_DRONE_CONTROL", 60 );
define( "ARGUS_UNKNOWN", 255 );
define( "ARGUS_NODE_SOCK_TYPE_SERIAL_PORT", 1 );
define( "ARGUS_NODE_SOCK_TYPE_NETWORK", 2 );
define( "ARGUS_NODE_SOCK_TYPE_DC", 3 );
define( "ARGUS_NODE_SOCK_TYPE_VIDEO_GRABBER", 4 );
define( "ARGUS_NODE_SOCK_TYPE_AUDIO_GRABBER", 5 );
define( "ARGUS_NODE_SOCK_TYPE_VIDEO_DIGITAL", 6 );
define( "COM_MODE_IN", 1 );
define( "COM_MODE_OUT", 2 );
define( "COM_MODE_INOUT", 3 );
define( "COM_TYPE_UART", 1 );
define( "COM_TYPE_TCP", 2 );
define( "COM_TYPE_DC_CTRL", 3 );
define( "COM_TYPE_ANALOG_VIDEO", 4 );
define( "COM_TYPE_ANALOG_AUDIO", 5 );
define( "COM_TYPE_DIGITAL_MEDIA", 6 );
define( "CAM_TYPE_ANALOG", 1 );
define( "CAM_TYPE_DIGITAL", 2 );
define( "MOD_TYPE_MEDIASERVER", 1 );
define( "MOD_TYPE_USB_DC", 2 );
function microtime_float(){
list($usec, $sec) = explode(" ", microtime());
return ((float)$usec + (float)$sec);
};
$Script_Start_Time = microtime_float();
$DBHost="localhost";
$DBName="dfsl_gunter";
$DBUser="dbroot";
$DBPassword="NoGud4U";
$SYSPath="/srv/samba/web";
$WEBUser="www-data";
$WEBGroup="www-data";
?> ?>

74
lib/settings.php.bk

@ -0,0 +1,74 @@
<?php
$WEBUser='www-data';
$WEBGroup='www-data';
$DBHost='localhost';
$DBUser='dbroot';
$DBPassword='NoGud4U';
$DBName='dfsl_gunter';
$ShowImagesLocal=false;
$ShowThumbnailsLocal=true;
$ShowAdw=true;
$SaveLocal=false;
$MailAgent='SENDMAIL';
$CGP_SubmitPath='../Submitted/';
$WEBPath='http://' . $_SERVER['SERVER_ADDR'] . '/';
$SYSPath='/srv/web/html/';
$DBCacheDir=$SYSPath . 'cache';
$MinimalSize=640000;
// Argus Defines
define( "ARGUS_SERVER", 0 );
define( "ARGUS_ALS_SENSOR", 1 );
define( "ARGUS_LFS_SENSOR", 2 );
define( "ARGUS_PLS_200_SENSOR", 3 );
define( "ARGUS_PLS_360_SENSOR", 4 );
define( "ARGUS_3D_SENSOR", 5 );
define( "ARGUS_NET_PLS_200", 6 );
define( "ARGUS_ANALOG_STATIC_CAMERA", 10 );
define( "ARGUS_ANALOG_PTZ_CAMERA", 11 );
define( "ARGUS_IP_STATIC_CAMERA", 12 );
define( "ARGUS_IP_PTZ_CAMERA", 13 );
define( "ARGUS_IP_UART_GATEWAY", 20 );
define( "ARGUS_JAMER", 40 );
define( "ARGUS_IP_VIDEO_SERVER", 50 );
define( "ARGUS_DRONE_CONTROL", 60 );
define( "ARGUS_UNKNOWN", 255 );
define( "ARGUS_NODE_SOCK_TYPE_SERIAL_PORT", 1 );
define( "ARGUS_NODE_SOCK_TYPE_NETWORK", 2 );
define( "ARGUS_NODE_SOCK_TYPE_DC", 3 );
define( "ARGUS_NODE_SOCK_TYPE_VIDEO_GRABBER", 4 );
define( "ARGUS_NODE_SOCK_TYPE_AUDIO_GRABBER", 5 );
define( "ARGUS_NODE_SOCK_TYPE_VIDEO_DIGITAL", 6 );
define( "COM_MODE_IN", 1 );
define( "COM_MODE_OUT", 2 );
define( "COM_MODE_INOUT", 3 );
define( "COM_TYPE_UART", 1 );
define( "COM_TYPE_TCP", 2 );
define( "COM_TYPE_DC_CTRL", 3 );
define( "COM_TYPE_ANALOG_VIDEO", 4 );
define( "COM_TYPE_ANALOG_AUDIO", 5 );
define( "COM_TYPE_DIGITAL_MEDIA", 6 );
define( "CAM_TYPE_ANALOG", 1 );
define( "CAM_TYPE_DIGITAL", 2 );
define( "MOD_TYPE_MEDIASERVER", 1 );
define( "MOD_TYPE_USB_DC", 2 );
function microtime_float(){
list($usec, $sec) = explode(" ", microtime());
return ((float)$usec + (float)$sec);
};
$Script_Start_Time = microtime_float();
?>

2
lib/soap_asm.php

@ -1,6 +1,8 @@
<?php <?php
error_reporting( E_ALL ); error_reporting( E_ALL );
require_once('settings.php'); require_once('settings.php');
require_once('defines.php');
require_once('php/onvif/toto.php'); require_once('php/onvif/toto.php');
$TT_123 = explode( '.', PHP_VERSION ); $TT_123 = explode( '.', PHP_VERSION );

1
lib/ui_asm.php

@ -1,6 +1,7 @@
<?php <?php
require_once('settings.php'); require_once('settings.php');
require_once('defines.php');
?> ?>

54
logerror
File diff suppressed because it is too large
View File

129
old.php

@ -1,129 +0,0 @@
<?php
require_once('lib/assembler.php');
?><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"><html>
<header>
<title>L.V.A.P. Defending Sensor Control</title>
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="/favicon-16x16.png">
<link rel="manifest" href="/site.webmanifest">
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#5bbad5">
<meta name="msapplication-TileColor" content="#da532c">
<meta name="theme-color" content="#ffffff">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-capable" content="yes">
<!--link rel="stylesheet" type="text/css" href="lib/javascript/extjs/resources/css/ext-all.css"/-->
<link rel="stylesheet" type="text/css" href="lib/javascript/extjs/resources/css/ext-all-notheme.css"/>
<!--link rel="stylesheet" type="text/css" href="lib/javascript/extjs/resources/css/xtheme-access.css"/-->
<!--link rel="stylesheet" type="text/css" href="lib/javascript/extjs/resources/css/xtheme-blue.css"/-->
<link rel="stylesheet" type="text/css" href="lib/javascript/extjs/resources/css/xtheme-gray.css"/>
<link rel="stylesheet" type="text/css" href="/style/icons/silk.css"/>
<!-- GC -->
<!-- LIBS -->
<script type="text/javascript" src="lib/javascript/jquery/jquery-1.12.4.min.js"></script>
<script type="text/javascript" src="lib/javascript/extjs/adapter/jquery/ext-jquery-adapter.js"></script>
<!--script type="text/javascript" src="lib/javascript/extjs/adapter/ext/ext-base.js"></script-->
<script type="text/javascript" src="lib/javascript/extjs/ext-all.js"></script>
<script type="text/javascript" src="lib/javascript/flash/swfobject.js"></script>
<script type="text/javascript" src="lib/javascript/flash/html5video_flash.js"></script>
<!-- ENDLIBS -->
<style type="text/css">
.flowplayer {
width: 640px;
}
.fullscreen:-webkit-full-screen {
width: auto !important;
height: auto !important;
margin:auto !important;
}
.fullscreen:-moz-full-screen {
width: auto !important;
height: auto !important;
margin:auto !important;
}
.fullscreen:-ms-fullscreen {
width: auto !important;
height: auto !important;
margin:auto !important;
}
.header_ttl{
font: bold 24px;
}
html, body {
font: normal 12px verdana;
margin: 0;
padding: 0;
border: 0 none;
/*overflow: hidden;
height: 100%;*/
background: #202020;
}
#output {
margin-left: 350px;
}
#log {
width: 80%;
height: 100px;
}
#player {
float: left;
}
#controls {
clear: left;
}
p {
margin: 0;
}
.timeInput, .volumeInput {
width: 3em;
}
</style>
<script type="text/javascript" src="lib/javascript/jsapi/mastbaum.js"></script>
</header>
<body>
<table width="100%" border=0>
<tr>
<td width="50%">&nbsp;</td>
<td width="64px"><img width="64px" src="/style/img/logo-s.png"></td>
<td align="center"><img src="/style/img/LVAP.png"></td>
<td width="50%">&nbsp;</td>
</tr>
<tr><td></td><td>
<!-- https://wiki.videolan.org/Documentation:WebPlugin/ -->
<embed type="application/x-vlc-plugin" pluginspage="http://www.videolan.org"
width="640"
height="480"
branding = false
mrl = "rtsp://gagua:4GetMyID@192.168.200.116:554/Streaming/Channels/101?transportmode=unicast&profile=Profile_1"
id="vlc" />
<script type="text/javascript">
<!--
function aka(){
alert( vlc.video.width + ' ' + vlc.video.height );
};
var vlc = document.getElementById("vlc");
vlc.audio.toggleMute();
alert( vlc.versionInfo() );
//-->
</script>
<input type="button" val="pukpuk" onclick="aka();">
</td><td></td></tr>
<tr>
<td></td>
<td colspan=2 id="content"></td>
<td></td></tr>
<tr><td></td><td colspan=2></td><td></td></tr>
</table>
</body>
</html>

BIN
outtest.png

Binary file not shown.

Before

Width: 2304  |  Height: 288  |  Size: 195 KiB

BIN
outtest2.png

Binary file not shown.

Before

Width: 2304  |  Height: 288  |  Size: 54 KiB

1
registry.sjno

@ -1 +0,0 @@
{"old_target":{"el":100.348,"az":342.656,"range":299.4},"last_ts":1572640491.6159}

11
saveimage.php

@ -1,11 +0,0 @@
<?php
//set random name for the image, used time() for uniqueness
$filename = time() . '.jpg';
$filepath = 'saved_images/';
move_uploaded_file($_FILES['webcam']['tmp_name'], $filepath.$filename);
echo $filepath.$filename;
?>

39
setup/camera_ptz_protocols.sql

@ -0,0 +1,39 @@
/*
Navicat Premium Data Transfer
Source Server : Applica_tunel
Source Server Type : MySQL
Source Server Version : 100323
Source Host : localhost:3306
Source Schema : dfsl_gunter
Target Server Type : MySQL
Target Server Version : 100323
File Encoding : 65001
Date: 11/09/2021 05:23:50
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for camera_ptz_protocols
-- ----------------------------
DROP TABLE IF EXISTS `camera_ptz_protocols`;
CREATE TABLE `camera_ptz_protocols` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 6 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of camera_ptz_protocols
-- ----------------------------
INSERT INTO `camera_ptz_protocols` VALUES (1, 'SONY VISCA');
INSERT INTO `camera_ptz_protocols` VALUES (2, 'Pelco-D');
INSERT INTO `camera_ptz_protocols` VALUES (3, 'OnVif');
INSERT INTO `camera_ptz_protocols` VALUES (4, 'PSIA');
INSERT INTO `camera_ptz_protocols` VALUES (5, 'GB/T28181');
SET FOREIGN_KEY_CHECKS = 1;

7751
setup/dfsl_gunter.sql
File diff suppressed because it is too large
View File

625
setup/dfsl_gunter_structs.sql

@ -0,0 +1,625 @@
/*
Navicat Premium Data Transfer
Source Server : APPLICATION
Source Server Type : MariaDB
Source Server Version : 100323
Source Host : localhost:3316
Source Schema : dfsl_gunter
Target Server Type : MariaDB
Target Server Version : 100323
File Encoding : 65001
Date: 30/08/2021 16:24:18
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for camera_ptz_protocols
-- ----------------------------
DROP TABLE IF EXISTS `camera_ptz_protocols`;
CREATE TABLE `camera_ptz_protocols` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for cameras
-- ----------------------------
DROP TABLE IF EXISTS `cameras`;
CREATE TABLE `cameras` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`site_id` int(10) UNSIGNED NULL DEFAULT NULL,
`node_id` int(10) UNSIGNED NULL DEFAULT 0,
`online` tinyint(3) UNSIGNED NULL DEFAULT 0,
`type` tinyint(3) UNSIGNED NOT NULL DEFAULT 1,
`name` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`hardware` char(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`status` tinyint(3) UNSIGNED NULL DEFAULT 0,
`session` char(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`protocol` tinyint(3) UNSIGNED NULL DEFAULT NULL,
`protocol_aux` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`uart_id` int(10) UNSIGNED NULL DEFAULT 0,
`lat` double NULL DEFAULT NULL,
`lon` double NULL DEFAULT NULL,
`alt` double NULL DEFAULT NULL,
`pitch` double NULL DEFAULT NULL,
`roll` double NULL DEFAULT NULL,
`yaw` double NULL DEFAULT NULL,
`imager_type` tinyint(3) UNSIGNED NULL DEFAULT 2,
`min_f` double NULL DEFAULT NULL,
`max_f` double NULL DEFAULT NULL,
`pan_model` tinyint(3) UNSIGNED NULL DEFAULT 0,
`pan_angles` int(4) UNSIGNED NULL DEFAULT 0,
`tilt_model` tinyint(3) UNSIGNED NULL DEFAULT 0,
`tilt_angles` tinyint(3) UNSIGNED NULL DEFAULT 0,
`access_login` char(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`access_pass` char(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`uuid` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`mac` char(17) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`ip` char(15) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`port` char(5) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '80',
`onvif_access` char(5) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`onvif_ctrl` char(250) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`ptz_token` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `uni2`(`uuid`) USING BTREE
) ENGINE = MyISAM AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Fixed;
-- ----------------------------
-- Table structure for cmd_queue
-- ----------------------------
DROP TABLE IF EXISTS `cmd_queue`;
CREATE TABLE `cmd_queue` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`site_id` int(10) UNSIGNED NULL DEFAULT NULL,
`status` tinyint(3) UNSIGNED NULL DEFAULT 0,
`cmd` tinyint(3) UNSIGNED NULL DEFAULT NULL,
`param` char(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`aux_param` char(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING HASH
) ENGINE = MEMORY AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Fixed;
-- ----------------------------
-- Table structure for connection_types
-- ----------------------------
DROP TABLE IF EXISTS `connection_types`;
CREATE TABLE `connection_types` (
`id` tinyint(3) UNSIGNED NOT NULL AUTO_INCREMENT,
`label_id` char(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = MyISAM AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Fixed;
-- ----------------------------
-- Table structure for connections
-- ----------------------------
DROP TABLE IF EXISTS `connections`;
CREATE TABLE `connections` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`site_id` int(10) UNSIGNED NULL DEFAULT NULL,
`from` int(10) UNSIGNED NULL DEFAULT NULL,
`from_aux` int(10) UNSIGNED NULL DEFAULT NULL,
`to` int(10) UNSIGNED NULL DEFAULT NULL,
`to_aux` int(10) UNSIGNED NULL DEFAULT NULL,
`type` tinyint(3) UNSIGNED NULL DEFAULT 0,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for events_archive
-- ----------------------------
DROP TABLE IF EXISTS `events_archive`;
CREATE TABLE `events_archive` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`node_id` int(10) UNSIGNED NOT NULL,
`uuid` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`ts` int(10) UNSIGNED NOT NULL,
`ts_ms` int(3) UNSIGNED NOT NULL,
`evt_type` tinyint(3) UNSIGNED NULL DEFAULT 1,
`range_digital` int(5) UNSIGNED NULL DEFAULT NULL,
`azimuth` double NULL DEFAULT NULL,
`elevation` double NULL DEFAULT 0,
`range` double NULL DEFAULT NULL,
`area` double NULL DEFAULT NULL,
`lat` double NULL DEFAULT NULL,
`lon` double NULL DEFAULT NULL,
`alt` double NULL DEFAULT NULL,
`custom` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `uniq`(`uuid`) USING BTREE
) ENGINE = MyISAM AUTO_INCREMENT = 6765 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Fixed;
-- ----------------------------
-- Table structure for events_cloud
-- ----------------------------
DROP TABLE IF EXISTS `events_cloud`;
CREATE TABLE `events_cloud` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`node_id` int(10) UNSIGNED NOT NULL,
`uuid` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`ts` int(10) UNSIGNED NOT NULL,
`ts_ms` int(3) UNSIGNED NOT NULL,
`evt_type` tinyint(3) UNSIGNED NULL DEFAULT 1,
`range_digital` int(5) UNSIGNED NULL DEFAULT NULL,
`azimuth` double NULL DEFAULT NULL,
`elevation` double NULL DEFAULT 0,
`range` double NULL DEFAULT NULL,
`area` double NULL DEFAULT NULL,
`lat` double NULL DEFAULT NULL,
`lon` double NULL DEFAULT NULL,
`alt` double NULL DEFAULT NULL,
`custom` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING HASH,
UNIQUE INDEX `uniq`(`uuid`) USING HASH
) ENGINE = MEMORY AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Fixed;
-- ----------------------------
-- Table structure for labels_js
-- ----------------------------
DROP TABLE IF EXISTS `labels_js`;
CREATE TABLE `labels_js` (
`language_id` tinyint(3) UNSIGNED NULL DEFAULT NULL,
`key` char(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`label` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
UNIQUE INDEX `uniq`(`language_id`, `key`) USING BTREE,
INDEX `lang`(`language_id`) USING BTREE
) ENGINE = MyISAM CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for labels_php
-- ----------------------------
DROP TABLE IF EXISTS `labels_php`;
CREATE TABLE `labels_php` (
`language_id` tinyint(3) UNSIGNED NULL DEFAULT NULL,
`key` char(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`label` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
UNIQUE INDEX `uniq`(`language_id`, `key`) USING BTREE,
INDEX `lang`(`language_id`) USING BTREE
) ENGINE = MyISAM CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for languages
-- ----------------------------
DROP TABLE IF EXISTS `languages`;
CREATE TABLE `languages` (
`id` tinyint(3) UNSIGNED NOT NULL AUTO_INCREMENT,
`abbr` char(2) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`name` char(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = MyISAM AUTO_INCREMENT = 6 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Fixed;
-- ----------------------------
-- Table structure for lrf_draw
-- ----------------------------
DROP TABLE IF EXISTS `lrf_draw`;
CREATE TABLE `lrf_draw` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`node_id` int(10) UNSIGNED NULL DEFAULT NULL,
`size` int(10) UNSIGNED NULL DEFAULT NULL,
`ts` datetime(0) NULL DEFAULT NULL,
`md5` char(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`rendered` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 'N',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `Uni`(`node_id`, `ts`) USING BTREE
) ENGINE = MyISAM AUTO_INCREMENT = 31 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Fixed;
-- ----------------------------
-- Table structure for lrf_sensors
-- ----------------------------
DROP TABLE IF EXISTS `lrf_sensors`;
CREATE TABLE `lrf_sensors` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`type_id` tinyint(3) UNSIGNED NULL DEFAULT 1,
`altered` bit(1) NULL DEFAULT b'0',
`position` bit(1) NOT NULL DEFAULT b'0',
`sender` bit(1) NOT NULL DEFAULT b'0',
`receiver` bit(1) NOT NULL DEFAULT b'0',
`serial` char(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`version` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`lat` double NULL DEFAULT NULL,
`lon` double NULL DEFAULT NULL,
`alt` double NULL DEFAULT NULL,
`pitch` double NULL DEFAULT NULL,
`yaw` double NULL DEFAULT NULL,
`roll` double NULL DEFAULT NULL,
`uart_id` int(10) UNSIGNED NULL DEFAULT 0,
`device_id` int(10) UNSIGNED NULL DEFAULT 0,
`ip_address` char(15) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`aux_ip_address` char(15) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`port` char(5) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`aux_port` char(5) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`auto_draw` tinyint(3) UNSIGNED NULL DEFAULT 0,
`enabled_lrf` bit(16) NULL DEFAULT b'1111111111111111',
`max_range` float UNSIGNED NULL DEFAULT 300,
`base_shift` int(11) NULL DEFAULT 0,
`mirror_shift` int(11) NULL DEFAULT 0,
`m_order` int(10) UNSIGNED NULL DEFAULT NULL,
`m_offset` int(10) UNSIGNED NULL DEFAULT NULL,
`m_delta` int(10) UNSIGNED NULL DEFAULT NULL,
`m_flip` int(10) UNSIGNED NULL DEFAULT NULL,
`m_width` int(10) UNSIGNED NULL DEFAULT NULL,
`m_sst` int(10) UNSIGNED NULL DEFAULT NULL,
`m_sun` tinyint(3) UNSIGNED NULL DEFAULT 100,
`m_gp` int(10) UNSIGNED NULL DEFAULT 16,
`m_spikes` int(10) UNSIGNED NULL DEFAULT 0,
`s_order` int(10) UNSIGNED NULL DEFAULT NULL,
`s_offset` int(10) UNSIGNED NULL DEFAULT NULL,
`s_delta` int(10) UNSIGNED NULL DEFAULT NULL,
`s_flip` int(10) UNSIGNED NULL DEFAULT NULL,
`s_width` int(10) UNSIGNED NULL DEFAULT NULL,
`s_sst` int(10) UNSIGNED NULL DEFAULT NULL,
`s_sun` tinyint(3) UNSIGNED NULL DEFAULT 100,
`s_gp` int(10) UNSIGNED NULL DEFAULT 16,
`s_spikes` int(10) UNSIGNED NULL DEFAULT 0,
`width_table_id` int(10) UNSIGNED NULL DEFAULT 0,
`zoom_table_id` int(10) UNSIGNED NULL DEFAULT 0,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = MyISAM AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Fixed;
-- ----------------------------
-- Table structure for map_tiles
-- ----------------------------
DROP TABLE IF EXISTS `map_tiles`;
CREATE TABLE `map_tiles` (
`z` tinyint(3) UNSIGNED NULL DEFAULT 0,
`x` int(10) UNSIGNED NULL DEFAULT NULL,
`y` int(10) UNSIGNED NULL DEFAULT NULL,
`cached` tinyint(1) UNSIGNED NULL DEFAULT 1,
`isSea` tinyint(1) UNSIGNED NULL DEFAULT 0,
UNIQUE INDEX `Uni`(`z`, `x`, `y`) USING BTREE,
INDEX `norm_x`(`x`) USING BTREE,
INDEX `norm_y`(`y`) USING BTREE,
INDEX `norm_z`(`z`) USING BTREE
) ENGINE = MyISAM CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Fixed;
-- ----------------------------
-- Table structure for maps
-- ----------------------------
DROP TABLE IF EXISTS `maps`;
CREATE TABLE `maps` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`site_id` int(10) UNSIGNED NULL DEFAULT NULL,
`tale_src` char(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for media_server_streams
-- ----------------------------
DROP TABLE IF EXISTS `media_server_streams`;
CREATE TABLE `media_server_streams` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`site_id` int(10) UNSIGNED NULL DEFAULT NULL,
`media_server_id` int(10) UNSIGNED NOT NULL,
`media_stream_id` int(10) UNSIGNED NOT NULL,
`valid` tinyint(1) UNSIGNED NULL DEFAULT 0,
`online` tinyint(1) UNSIGNED NULL DEFAULT 0,
`key` char(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
`mrl` char(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for media_servers
-- ----------------------------
DROP TABLE IF EXISTS `media_servers`;
CREATE TABLE `media_servers` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`secret_key` char(46) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`ip` char(15) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '127.0.0.1',
`REST_port` int(5) UNSIGNED NULL DEFAULT 8081,
`virtual_host` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '__defaultVhost__',
`recording` tinyint(1) UNSIGNED NULL DEFAULT 0,
`local` tinyint(1) UNSIGNED NULL DEFAULT 0,
`docRoot` char(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '',
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for media_streams
-- ----------------------------
DROP TABLE IF EXISTS `media_streams`;
CREATE TABLE `media_streams` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`site_id` int(10) UNSIGNED NULL DEFAULT NULL,
`source_id` int(10) UNSIGNED NOT NULL,
`source_type` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL DEFAULT 'D',
`name` char(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`valid` tinyint(1) UNSIGNED NULL DEFAULT 0,
`has_audio` tinyint(1) UNSIGNED NULL DEFAULT 0,
`token` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`img_width` int(10) UNSIGNED NULL DEFAULT NULL,
`img_height` int(10) UNSIGNED NULL DEFAULT NULL,
`fps` tinyint(3) UNSIGNED NULL DEFAULT NULL,
`compression_type` char(4) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`bitrate` int(10) UNSIGNED NULL DEFAULT NULL,
`mrl_proto` char(5) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 'rtsp',
`mrl_port` char(5) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '554',
`mrl` char(250) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`picture_proto` char(5) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 'http',
`picture_port` char(5) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT '80',
`picture` char(250) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `unistr`(`site_id`, `source_id`, `token`) USING BTREE
) ENGINE = MyISAM AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Fixed;
-- ----------------------------
-- Table structure for module_dcr_chanels
-- ----------------------------
DROP TABLE IF EXISTS `module_dcr_chanels`;
CREATE TABLE `module_dcr_chanels` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`dcr_id` int(10) UNSIGNED NOT NULL,
`channel_id` tinyint(3) UNSIGNED NULL DEFAULT NULL,
`mode` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'O',
`status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'O',
`request` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'N',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `uni`(`dcr_id`, `channel_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for module_dcr_settings
-- ----------------------------
DROP TABLE IF EXISTS `module_dcr_settings`;
CREATE TABLE `module_dcr_settings` (
`setting_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`channel_id` int(10) UNSIGNED NOT NULL,
`type` char(1) CHARACTER SET ascii COLLATE ascii_general_ci NULL DEFAULT 'P',
`class_id` int(10) UNSIGNED NOT NULL,
`event_id` int(10) UNSIGNED NOT NULL,
`auto_dissmiss` tinyint(3) UNSIGNED NULL DEFAULT 0,
PRIMARY KEY (`setting_id`) USING BTREE,
UNIQUE INDEX `uni`(`channel_id`, `class_id`, `event_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for module_kafka_settings
-- ----------------------------
DROP TABLE IF EXISTS `module_kafka_settings`;
CREATE TABLE `module_kafka_settings` (
`setting_id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`module_id` int(10) UNSIGNED NOT NULL,
`type` char(1) CHARACTER SET ascii COLLATE ascii_general_ci NULL DEFAULT 'P',
`class_id` int(10) UNSIGNED NOT NULL,
`event_id` int(10) UNSIGNED NOT NULL,
`topic` char(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
`template` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`setting_id`) USING BTREE,
UNIQUE INDEX `uni`(`module_id`, `class_id`, `event_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for modules_dcr
-- ----------------------------
DROP TABLE IF EXISTS `modules_dcr`;
CREATE TABLE `modules_dcr` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`site_id` int(10) UNSIGNED NULL DEFAULT NULL,
`status` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'O',
`serial_id` char(5) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT '',
`channels` tinyint(3) UNSIGNED NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `uni`(`site_id`, `serial_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for modules_fly_hunter
-- ----------------------------
DROP TABLE IF EXISTS `modules_fly_hunter`;
CREATE TABLE `modules_fly_hunter` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` char(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
`lat` double NULL DEFAULT NULL,
`lon` double NULL DEFAULT NULL,
`alt` double NULL DEFAULT NULL,
`dc_module_id` int(10) UNSIGNED NULL DEFAULT 0,
`uart_id` int(10) UNSIGNED NULL DEFAULT 0,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for modules_kafka
-- ----------------------------
DROP TABLE IF EXISTS `modules_kafka`;
CREATE TABLE `modules_kafka` (
`module_id` int(10) UNSIGNED NOT NULL,
`brocker_address` char(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
`brocker_port` int(10) UNSIGNED NULL DEFAULT NULL,
PRIMARY KEY (`module_id`) USING BTREE
) ENGINE = InnoDB CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for nodes
-- ----------------------------
DROP TABLE IF EXISTS `nodes`;
CREATE TABLE `nodes` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`site_id` int(10) UNSIGNED NOT NULL DEFAULT 0,
`type` tinyint(3) UNSIGNED NOT NULL,
`aux_id` int(10) UNSIGNED NULL DEFAULT 0,
`online` tinyint(3) UNSIGNED NULL DEFAULT 0,
`enable` char(1) CHARACTER SET ascii COLLATE ascii_general_ci NULL DEFAULT 'E',
`ts_s` int(11) NULL DEFAULT 0,
`ts_ms` int(11) NULL DEFAULT 0,
`data_peers_in` tinyint(3) UNSIGNED NULL DEFAULT 0,
`data_peers_out` tinyint(3) UNSIGNED NULL DEFAULT 0,
`ctrl_peers_in` tinyint(3) UNSIGNED NULL DEFAULT 0,
`ctrl_peers_out` tinyint(3) UNSIGNED NULL DEFAULT 0,
`name` char(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 'No Name',
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `uni`(`site_id`, `type`, `aux_id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for online_cloud
-- ----------------------------
DROP TABLE IF EXISTS `online_cloud`;
CREATE TABLE `online_cloud` (
`device_id` int(10) UNSIGNED NOT NULL DEFAULT 0,
`fts` datetime(0) NULL DEFAULT NULL,
`lts` datetime(0) NULL DEFAULT NULL,
`mode` tinyint(4) NULL DEFAULT NULL,
`draw_sequence` int(10) UNSIGNED NULL DEFAULT NULL,
`data` char(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`parameter` int(11) NULL DEFAULT NULL,
PRIMARY KEY (`device_id`) USING HASH
) ENGINE = MEMORY CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Fixed;
-- ----------------------------
-- Table structure for pictures
-- ----------------------------
DROP TABLE IF EXISTS `pictures`;
CREATE TABLE `pictures` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`md5` char(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`ext` char(3) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`TS` datetime(0) NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = MyISAM AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Fixed;
-- ----------------------------
-- Table structure for server_module_types
-- ----------------------------
DROP TABLE IF EXISTS `server_module_types`;
CREATE TABLE `server_module_types` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`builtin` bit(1) NULL DEFAULT b'0',
`allow_multiply` bit(1) NULL DEFAULT b'1',
`name` char(16) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = MyISAM AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Fixed;
-- ----------------------------
-- Table structure for server_modules
-- ----------------------------
DROP TABLE IF EXISTS `server_modules`;
CREATE TABLE `server_modules` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`server_id` int(10) UNSIGNED NOT NULL,
`type` tinyint(3) UNSIGNED NOT NULL,
`aux_id` int(10) UNSIGNED NULL DEFAULT NULL,
`enabled` tinyint(1) UNSIGNED NULL DEFAULT 1,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = MyISAM AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Fixed;
-- ----------------------------
-- Table structure for servers
-- ----------------------------
DROP TABLE IF EXISTS `servers`;
CREATE TABLE `servers` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`site_id` int(10) UNSIGNED NULL DEFAULT NULL,
`online` bit(1) NULL DEFAULT b'0',
`identity` char(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `uni`(`identity`) USING BTREE
) ENGINE = MyISAM AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Fixed;
-- ----------------------------
-- Table structure for servers_queue
-- ----------------------------
DROP TABLE IF EXISTS `servers_queue`;
CREATE TABLE `servers_queue` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`server_id` int(10) UNSIGNED NOT NULL,
`ts` datetime(0) NOT NULL,
`started` bit(1) NULL DEFAULT b'0',
`done` bit(1) NULL DEFAULT b'0',
`success` bit(1) NULL DEFAULT b'0',
`progress` tinyint(3) UNSIGNED NULL DEFAULT 0,
`command` tinyint(3) UNSIGNED NOT NULL,
`param` char(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING HASH
) ENGINE = MEMORY AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Fixed;
-- ----------------------------
-- Table structure for sites
-- ----------------------------
DROP TABLE IF EXISTS `sites`;
CREATE TABLE `sites` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`account_id` int(10) UNSIGNED NULL DEFAULT NULL,
`name` char(128) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`server_ident` char(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`anchor_lat` double NULL DEFAULT 0,
`anchor_lon` double NULL DEFAULT 0,
`anchor_alt` double NULL DEFAULT 0,
`hemisphere` char(1) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT 'N',
`map_id` tinyint(5) UNSIGNED NULL DEFAULT 0,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = MyISAM AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Fixed;
-- ----------------------------
-- Table structure for sockets
-- ----------------------------
DROP TABLE IF EXISTS `sockets`;
CREATE TABLE `sockets` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`node_id` int(10) UNSIGNED NOT NULL,
`aux_id` int(10) UNSIGNED NULL DEFAULT NULL,
`type` tinyint(3) UNSIGNED NOT NULL,
`md5` char(32) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL,
`multidrop` tinyint(1) UNSIGNED NULL DEFAULT 0,
`mode` tinyint(3) UNSIGNED NULL DEFAULT 0,
`binded` tinyint(1) UNSIGNED NULL DEFAULT 0,
`path` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`name` char(64) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE,
UNIQUE INDEX `uni`(`node_id`, `type`, `md5`) USING BTREE
) ENGINE = MyISAM AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Fixed;
-- ----------------------------
-- Table structure for uart_settings
-- ----------------------------
DROP TABLE IF EXISTS `uart_settings`;
CREATE TABLE `uart_settings` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`type` tinyint(3) UNSIGNED NULL DEFAULT 1,
`socket_id` int(10) UNSIGNED NOT NULL,
`speed` int(10) UNSIGNED NULL DEFAULT 19200,
`bit` tinyint(3) UNSIGNED NULL DEFAULT 8,
`parity` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'N',
`stop_bit` float(2, 1) UNSIGNED NULL DEFAULT 1,
`mode` char(1) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
`port` int(11) NULL DEFAULT NULL,
`path` char(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Table structure for users
-- ----------------------------
DROP TABLE IF EXISTS `users`;
CREATE TABLE `users` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`login` char(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`pwdMD5` char(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`SID` char(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`create_ts` datetime(0) NULL DEFAULT NULL,
`login_ts` datetime(0) NULL DEFAULT NULL,
`access` tinyint(3) UNSIGNED NULL DEFAULT 0,
`language` tinyint(3) UNSIGNED NULL DEFAULT 1,
`width` int(10) UNSIGNED NULL DEFAULT 1024,
`height` int(10) UNSIGNED NULL DEFAULT 768,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = MyISAM AUTO_INCREMENT = 1 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Fixed;
-- ----------------------------
-- Table structure for users_dash_layout
-- ----------------------------
DROP TABLE IF EXISTS `users_dash_layout`;
CREATE TABLE `users_dash_layout` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`user_id` int(10) UNSIGNED NULL DEFAULT NULL,
`node_id` int(10) UNSIGNED NULL DEFAULT NULL,
`x` tinyint(3) UNSIGNED NULL DEFAULT NULL,
`y` tinyint(3) UNSIGNED NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = InnoDB AUTO_INCREMENT = 1 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_general_ci ROW_FORMAT = Dynamic;
SET FOREIGN_KEY_CHECKS = 1;

14
setup/index.php

@ -0,0 +1,14 @@
<?php
require_once('lib/assembler.php');
if( $CUser->Data['id'] > 1 ){
UI_PageHeaderExt(
'rgoose_general.js',
array('rgoose_timeline.js','rgoose_camera_editor.js','rgoose_mediaserver_module.js','rgoose_sysmap_editor.js','rgoose_location_editor.js','rgoose_dashboard.js','rgoose_main.js', 'rgoose_devices_module.js')
);
UI_PageBottomExt();
} else {
UI_PageHeader();
UI_LoginForm();
UI_PageBottom();
};
?>

104
setup/install.php

@ -0,0 +1,104 @@
<?php
require_once('lib/install.php');
UI_INSTALL_PageHeader();
if( isset( $_GET['stp'] ) ){
$STP = intval( $_GET['stp'] );
} else {
$STP = 0;
};
switch( $STP ){
case 0:{
UI_INSTALL_DBCRED_Form();
break;
};
case 1:{
$DBH = $_POST['dbh'];
$DBN = $_POST['dbn'];
$DBU = $_POST['dbu'];
$DBP = $_POST['dbp'];
$DATABASE = new MySQLi_DB( $DBH, $DBN, $DBU, $DBP );
if( $DATABASE->isConnected ){
$CMD='mysql --host='.$DBH.' --user='.$DBU.' --password='.$DBP.' --compress --database='.$DBN.'< ./setup/dfsl_gunter_structs.sql';
$AA=`$CMD`;
$CMD='mysql --host='.$DBH.' --user='.$DBU.' --password='.$DBP.' --compress --database='.$DBN.'< ./setup/camera_ptz_protocols.sql';
$AA=`$CMD`;
$CMD='mysql --host='.$DBH.' --user='.$DBU.' --password='.$DBP.' --compress --database='.$DBN.'< ./setup/labels_js.sql';
$AA=`$CMD`;
$CMD='mysql --host='.$DBH.' --user='.$DBU.' --password='.$DBP.' --compress --database='.$DBN.'< ./setup/labels_php.sql';
$AA=`$CMD`;
$CMD='mysql --host='.$DBH.' --user='.$DBU.' --password='.$DBP.' --compress --database='.$DBN.'< ./setup/server_module_types.sql';
$AA=`$CMD`;
if( is_writable( './lib/settings.php' ) ){
$FID = fopen('./lib/settings.php', 'w+' );
if( $FID ){
fprintf( $FID, '<?php' . "\n\t" );
fprintf( $FID, '$DBHost="%s";' . "\n\t", $DBH );
fprintf( $FID, '$DBName="%s";' . "\n\t", $DBN );
fprintf( $FID, '$DBUser="%s";' . "\n\t", $DBU );
fprintf( $FID, '$DBPassword="%s";' . "\n\t", $DBP );
fprintf( $FID, '$SYSPath="%s";' . "\n\t", getcwd() );
$processUser = posix_getpwuid(posix_geteuid());
fprintf( $FID, '$WEBUser="%s";' . "\n\t", $processUser['name'] );
$processGroup = posix_getgrgid(posix_getegid());
fprintf( $FID, '$WEBGroup="%s";' . "\n\t", $processGroup['name'] );
fprintf( $FID, "\n?>" );
fclose( $FID );
};
UI_INSTALL_ADMIN_SITE_Form( $DBH, $DBN, $DBU, $DBP );
} else {
UI_INSTALL_DBCRED_Form( $DBH, $DBN, $DBU, $DBP, "Cannot Write Settings File<br/>Please Fix Access to LIB Folder.");
};
} else {
UI_INSTALL_DBCRED_Form( $DBH, $DBN, $DBU, $DBP, "Error Connecting to Database");
};
break;
};
case 2:{
$ADU = $_POST['adu'];
$ADP = $_POST['adp'];
$ADP2 = $_POST['adp2'];
$SINA = $_POST['sina'];
$DBH = $_POST['dbh'];
$DBN = $_POST['dbn'];
$DBU = $_POST['dbu'];
$DBP = $_POST['dbp'];
if( $ADP == $ADP2 ){
if( $SINA != '' ){
$DATABASE = new MySQLi_DB( $DBH, $DBN, $DBU, $DBP );
if( is_writable( './index.php' ) ){
$FID = fopen( './index.php', 'w+');
if( $FID ){
$Data = file_get_contents( './setup/index.php' );
fprintf( $FID, $Data );
fclose( $FID );
};
$EU = $DATABASE->escape( $ADU );
$EP = md5( $ADP );
$ESN = $DATABASE->escape( $SINA );
$QS = "INSERT INTO `users` SET `login`='{$EU}', `pwdMD5`='{$EP}', `create_ts`=NOW(), `language`=1, `access`=10";
$DATABASE->Query( $QS );
//$SID = md5( $ESN );
$QS = "INSERT INTO `sites` SET `name`='{$ESN}',`anchor_lat`=44.42601349357776,`anchor_lon`=8.823269813144353,`anchor_alt`=18.5";//, `server_ident`='{$SID}'";
$DATABASE->Query( $QS );
//$ID = $DATABASE->getLastInsertID();
//$QS = "INSERT INTO `servers` SET `site_id`={$ID}, `identity`='{$SID}'";
//$DATABASE->Query( $QS );
UI_INSTALL_WELCOME_Form();
} else {
UI_INSTALL_ADMIN_SITE_Form( $DBH, $DBN, $DBU, $DBP, $ADU, $ADP, $ADP2, $SINA, 'Cannot Write Index File<br/>Please Fix access to File/Folder!' );
};
} else {
UI_INSTALL_ADMIN_SITE_Form( $DBH, $DBN, $DBU, $DBP, $ADU, $ADP, $ADP2, $SINA, 'Please Provide Default Site Name!' );
};
} else {
UI_INSTALL_ADMIN_SITE_Form( $DBH, $DBN, $DBU, $DBP, $ADU, $ADP, $ADP2, $SINA, 'Admin User Passwords are not identical!' );
};
break;
};
default:{
echo "STEP: {$STP}\n";
break;
};
};
UI_PageBottomExt();
?>

68
setup/labels_js.sql

@ -0,0 +1,68 @@
/*
Navicat Premium Data Transfer
Source Server : Applica_tunel
Source Server Type : MySQL
Source Server Version : 100323
Source Host : localhost:3306
Source Schema : dfsl_gunter
Target Server Type : MySQL
Target Server Version : 100323
File Encoding : 65001
Date: 11/09/2021 05:23:10
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for labels_js
-- ----------------------------
DROP TABLE IF EXISTS `labels_js`;
CREATE TABLE `labels_js` (
`language_id` tinyint(3) UNSIGNED NULL DEFAULT NULL,
`key` char(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`label` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
UNIQUE INDEX `uniq`(`language_id`, `key`) USING BTREE,
INDEX `lang`(`language_id`) USING BTREE
) ENGINE = MyISAM CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of labels_js
-- ----------------------------
INSERT INTO `labels_js` VALUES (1, '_CANCEL_', 'Cancel');
INSERT INTO `labels_js` VALUES (1, '_OK_', 'Ok');
INSERT INTO `labels_js` VALUES (1, '_ADD_', 'Add');
INSERT INTO `labels_js` VALUES (1, '_ADD_MEDIA_SERVER_', 'Add Media Server');
INSERT INTO `labels_js` VALUES (1, '_ADD_CONNECTION_', 'Add Connection');
INSERT INTO `labels_js` VALUES (1, '_EDIT_LRF3D_SETTINGS_', 'Edit Lidar 3D Settings');
INSERT INTO `labels_js` VALUES (1, '_SAVE_', 'Save');
INSERT INTO `labels_js` VALUES (1, '_FHM_PROPS_', 'FlyHunter Module Properties');
INSERT INTO `labels_js` VALUES (1, '_MAP_REG_LBL_', 'Regular WGS84 Map (reqires Internet)');
INSERT INTO `labels_js` VALUES (1, '_MAP_CUST_LBL_', 'Custom Map');
INSERT INTO `labels_js` VALUES (1, '_MAP_TYP_LBL_', 'Map Type');
INSERT INTO `labels_js` VALUES (1, '_SITE_PROP_LBL_', 'Site Properties');
INSERT INTO `labels_js` VALUES (1, '_SYS_ANCHORT_LBL_', 'System Anchor');
INSERT INTO `labels_js` VALUES (1, '_LAT_SHORT_LBL_', 'Lat');
INSERT INTO `labels_js` VALUES (1, '_LON_SHORT_LBL_', 'Lon');
INSERT INTO `labels_js` VALUES (1, '_ALT_SHORT_LBL_', 'Alt');
INSERT INTO `labels_js` VALUES (1, '_CREATE_NEW_LBL_', 'Create New');
INSERT INTO `labels_js` VALUES (1, '_UPDATE_LBL_', 'Update');
INSERT INTO `labels_js` VALUES (1, '_LOC_MAP_LBL_', 'Location Map');
INSERT INTO `labels_js` VALUES (1, 'Error_Message', 'Error Message');
INSERT INTO `labels_js` VALUES (1, '_ADD_IP_CAMERA_', 'Add IP Camera');
INSERT INTO `labels_js` VALUES (1, '_CONNECT_2_SEL_', 'Connect To Selected');
INSERT INTO `labels_js` VALUES (1, '_CON_2_IP_CAM_', 'Connect to IP Camera');
INSERT INTO `labels_js` VALUES (1, '_PROV_CAC_', 'Please Provide Camera Access Credentials.');
INSERT INTO `labels_js` VALUES (1, '_LOGIN_0_', 'Login:');
INSERT INTO `labels_js` VALUES (1, '_PASSWORD_0_', 'Password:');
INSERT INTO `labels_js` VALUES (1, '_STREAMS_', 'Streams');
INSERT INTO `labels_js` VALUES (1, '_CAC_TAB_', 'Credentials');
INSERT INTO `labels_js` VALUES (1, '_PTZ_TAB_', 'PTZ Settings');
INSERT INTO `labels_js` VALUES (1, '_LOC_TAB_', 'Location/Orientation');
INSERT INTO `labels_js` VALUES (1, '_DET_IP_CAMERA_LST_', 'Detected IP Cameras List');
INSERT INTO `labels_js` VALUES (1, '_ADV_TAB_', 'Advanced Settings');
SET FOREIGN_KEY_CHECKS = 1;

49
setup/labels_php.sql

@ -0,0 +1,49 @@
/*
Navicat Premium Data Transfer
Source Server : Applica_tunel
Source Server Type : MySQL
Source Server Version : 100323
Source Host : localhost:3306
Source Schema : dfsl_gunter
Target Server Type : MySQL
Target Server Version : 100323
File Encoding : 65001
Date: 11/09/2021 05:23:24
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for labels_php
-- ----------------------------
DROP TABLE IF EXISTS `labels_php`;
CREATE TABLE `labels_php` (
`language_id` tinyint(3) UNSIGNED NULL DEFAULT NULL,
`key` char(32) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
`label` varchar(255) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
UNIQUE INDEX `uniq`(`language_id`, `key`) USING BTREE,
INDEX `lang`(`language_id`) USING BTREE
) ENGINE = MyISAM CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Dynamic;
-- ----------------------------
-- Records of labels_php
-- ----------------------------
INSERT INTO `labels_php` VALUES (1, '__PAGEWASGENIN__', 'The page was generated in');
INSERT INTO `labels_php` VALUES (1, '__SECOND__', 'second');
INSERT INTO `labels_php` VALUES (1, '__SECONDS__', 'seconds');
INSERT INTO `labels_php` VALUES (1, '__LOGIN_ID__', 'Login ID');
INSERT INTO `labels_php` VALUES (1, '__PASSWORD__', 'Password');
INSERT INTO `labels_php` VALUES (1, '__LOGIN__', 'Login');
INSERT INTO `labels_php` VALUES (1, '__LOGOUT__', 'Logout');
INSERT INTO `labels_php` VALUES (2, '__PAGEWASGENIN__', 'Страница сгенерированна за');
INSERT INTO `labels_php` VALUES (2, '__SECOND__', 'секунды');
INSERT INTO `labels_php` VALUES (2, '__SECONDS__', 'секунды');
INSERT INTO `labels_php` VALUES (1, '__ONLINE__', 'Online');
INSERT INTO `labels_php` VALUES (1, '__OFFLINE__', 'Offline');
INSERT INTO `labels_php` VALUES (1, '__ADD__', 'Add');
SET FOREIGN_KEY_CHECKS = 1;

42
setup/server_module_types.sql

@ -0,0 +1,42 @@
/*
Navicat Premium Data Transfer
Source Server : Applica_tunel
Source Server Type : MySQL
Source Server Version : 100323
Source Host : localhost:3306
Source Schema : dfsl_gunter
Target Server Type : MySQL
Target Server Version : 100323
File Encoding : 65001
Date: 11/09/2021 05:24:06
*/
SET NAMES utf8mb4;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for server_module_types
-- ----------------------------
DROP TABLE IF EXISTS `server_module_types`;
CREATE TABLE `server_module_types` (
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
`builtin` bit(1) NULL DEFAULT b'0',
`allow_multiply` bit(1) NULL DEFAULT b'1',
`name` char(16) CHARACTER SET utf8 COLLATE utf8_general_ci NULL DEFAULT NULL,
PRIMARY KEY (`id`) USING BTREE
) ENGINE = MyISAM AUTO_INCREMENT = 7 CHARACTER SET = utf8 COLLATE = utf8_general_ci ROW_FORMAT = Fixed;
-- ----------------------------
-- Records of server_module_types
-- ----------------------------
INSERT INTO `server_module_types` VALUES (1, b'1', b'0', 'MODULE_ZLMEDIA');
INSERT INTO `server_module_types` VALUES (2, b'1', b'1', 'MODULE_DCBUSB');
INSERT INTO `server_module_types` VALUES (3, b'1', b'0', 'MODULE_KAFKA');
INSERT INTO `server_module_types` VALUES (4, b'1', b'0', 'MODULE_GPS');
INSERT INTO `server_module_types` VALUES (5, b'1', b'0', 'MODULE_NETWORK');
INSERT INTO `server_module_types` VALUES (6, b'1', b'0', 'MODULE_FLYHUNT');
SET FOREIGN_KEY_CHECKS = 1;

74
setup/settings.php

@ -0,0 +1,74 @@
<?php
$WEBUser='www-data';
$WEBGroup='www-data';
$DBHost='localhost';
$DBUser='dbroot';
$DBPassword='NoGud4U';
$DBName='dfsl_gunter';
$ShowImagesLocal=false;
$ShowThumbnailsLocal=true;
$ShowAdw=true;
$SaveLocal=false;
$MailAgent='SENDMAIL';
$CGP_SubmitPath='../Submitted/';
$WEBPath='http://' . $_SERVER['SERVER_ADDR'] . '/';
$SYSPath='/srv/web/html/';
$DBCacheDir=$SYSPath . 'cache';
$MinimalSize=640000;
// Argus Defines
define( "ARGUS_SERVER", 0 );
define( "ARGUS_ALS_SENSOR", 1 );
define( "ARGUS_LFS_SENSOR", 2 );
define( "ARGUS_PLS_200_SENSOR", 3 );
define( "ARGUS_PLS_360_SENSOR", 4 );
define( "ARGUS_3D_SENSOR", 5 );
define( "ARGUS_NET_PLS_200", 6 );
define( "ARGUS_ANALOG_STATIC_CAMERA", 10 );
define( "ARGUS_ANALOG_PTZ_CAMERA", 11 );
define( "ARGUS_IP_STATIC_CAMERA", 12 );
define( "ARGUS_IP_PTZ_CAMERA", 13 );
define( "ARGUS_IP_UART_GATEWAY", 20 );
define( "ARGUS_JAMER", 40 );
define( "ARGUS_IP_VIDEO_SERVER", 50 );
define( "ARGUS_DRONE_CONTROL", 60 );
define( "ARGUS_UNKNOWN", 255 );
define( "ARGUS_NODE_SOCK_TYPE_SERIAL_PORT", 1 );
define( "ARGUS_NODE_SOCK_TYPE_NETWORK", 2 );
define( "ARGUS_NODE_SOCK_TYPE_DC", 3 );
define( "ARGUS_NODE_SOCK_TYPE_VIDEO_GRABBER", 4 );
define( "ARGUS_NODE_SOCK_TYPE_AUDIO_GRABBER", 5 );
define( "ARGUS_NODE_SOCK_TYPE_VIDEO_DIGITAL", 6 );
define( "COM_MODE_IN", 1 );
define( "COM_MODE_OUT", 2 );
define( "COM_MODE_INOUT", 3 );
define( "COM_TYPE_UART", 1 );
define( "COM_TYPE_TCP", 2 );
define( "COM_TYPE_DC_CTRL", 3 );
define( "COM_TYPE_ANALOG_VIDEO", 4 );
define( "COM_TYPE_ANALOG_AUDIO", 5 );
define( "COM_TYPE_DIGITAL_MEDIA", 6 );
define( "CAM_TYPE_ANALOG", 1 );
define( "CAM_TYPE_DIGITAL", 2 );
define( "MOD_TYPE_MEDIASERVER", 1 );
define( "MOD_TYPE_USB_DC", 2 );
function microtime_float(){
list($usec, $sec) = explode(" ", microtime());
return ((float)$usec + (float)$sec);
};
$Script_Start_Time = microtime_float();
?>

173
soap.php

@ -1,173 +0,0 @@
<?php
$Debug = false;
$Max_RANGE = 300.0; // 300 meters
$CAM_IP = '192.168.0.109';
$CAM_USER = 'gagua';
$CAM_PASS = '4GetMyID';
$CAM_PTZ_PROFILE = 'Profile_1';
$CAM_TARGET_MICRO_DELAY = 3.0; //3 seconds
$CAM_FOV_MIN = 5.0;
$CAM_FOV_MAX = 45.0;
$CAM_ZOOM_FIXED = false;
$CAM_SET_ZOOM = 0;// 0 - 1.0
$FH_RELAY = '';
$JAMMER_RELAY = '';
require_once('lib/soap_asm.php');
$RegData = file_get_contents('registry.sjno');
if($RegData!==false){
$Registry = json_decode( $RegData, true );
} else {
$Registry = array();
};
$lts = date ( "Y/m/d H:i:s" );
$rts = '';
$Headers = getallheaders();
if($Debug){
$fd = fopen( "posts.txt", "a+" );
fprintf( $fd, " ----------------- \r\n" );
fprintf( $fd, "Header:\r\n" );
foreach( $Headers as $key=>$value){
fprintf( $fd, $key.': '.$value."\r\n" );
};
fprintf( $fd, "Post:\r\n" );
foreach( $_POST as $key=>$value){
fprintf( $fd, $key.': '.$value."\r\n" );
};
fprintf( $fd, "Get:\r\n" );
foreach( $_GET as $key=>$value){
fprintf( $fd, $key.': '.$value."\r\n" );
};
fprintf( $fd, "REST:\r\n" );
};
try {
if (!($Data = file_get_contents('php://input'))) {
fprintf( $fd, "Can not Read STDIO Data\r\n" );
} else {
$JS = json_decode( $Data, true );
if( !is_array($JS) ){
$xml_parser = xml_parser_create();
if (!xml_parse_into_struct ( $xml_parser, $Data, $XS )){
$XS = false;
} else {
// Handle XML commands
switch($XS[0]['tag']){
case 'LCU:SYSTEMSTATUS':{
if($Debug)fprintf( $fd, "STATUS update!\r\n" );
break;
};
case 'LCU:EVENTLIDAR3D':{
$T['el'] = $XS[7]['value'] / 1000.0;
$Z = ( 90.0 - $T['el'] );
if( $Z < 0.0 ){
$Z *= -1.0;
$T['az'] = $XS[6]['value'] / 1000.0 + 180.0;
if( $T['az'] > 360.0 ) $T['az'] -= 360.0;
} else {
$T['az'] = $XS[6]['value'] / 1000.0;
};
$T['range'] = $XS[8]['value'] / 10.0;
$TTS = microtime(true);
if($Debug)fprintf( $fd, "3D Target! Azimuth %.2f Elevation %.2f Range %.2f\r\n", $T['az'], $T['el'], $T['range'] );
$O = $Registry['old_target'];
$OTS = $Registry['last_ts'];
if( ( $TTS-$OTS ) < $CAM_TARGET_MICRO_DELAY ){
// Target Filters
if($Debug)fprintf( $fd, "Move Filtered by Cam Delay %f $f\r\n", $TTS, $OTS );
} else {
$T_FOV = ( $CAM_FOV_MIN + ($CAM_FOW_MAX - $CAM_FOV_MIN) * ( 1.0 - ( $O['range'] / $Max_RANGE ) )) / 2.0;
if( abs($O['az']-$T['az']) > $T_FOV || abs($O['az']-$T['az']) > $T_FOV ){
if($Debug)fprintf( $fd, "Move PTZ \r\n" );
$CAM=new ponvif();
$CAM->setUsername( $CAM_USER );
$CAM->setPassword( $CAM_PASS );
$CAM->setIPAddress( $CAM_IP );
try {
$CAM->initialize();
$C_AZ = $T['az'] * ( 2.0 / 360.0 ) - 1.0;
$C_EL = $Z * ( 2.0 / 90.0 ) - 1.0;
$C_Z = $T['range'] / $Max_RANGE;
if($CAM_ZOOM_FIXED){
$CAM->ptz_AbsoluteMove( $CAM_PTZ_PROFILE, $C_AZ, $C_EL, $CAM_SET_ZOOM );
} else {
$CAM->ptz_AbsoluteMove( $CAM_PTZ_PROFILE, $C_AZ, $C_EL, $C_Z );
};
} catch (Exception $e) {
if($Debug)fprintf( $fd, 'Caught exception: ', $e->getMessage(), "\r\n" );
};
// Update Registry
$Registry['old_target'] = $T;
$Registry['last_ts'] = $TTS;
} else {
if($Debug)fprintf( $fd, "Move is Filtered\r\n" );
};
};
break;
};
case 'LCU:EVENTLIDAR2D':{
if($Debug)fprintf( $fd, "2D Target!\r\n" );
break;
};
};
};
xml_parser_free( $xml_parser );
} else {
$XS = false;
// Handle Jeson commands
if( isset( $JS['mitigation'] ) ){
if( isset( $JS['mitigation']['parameters'] ) ){
if( isset( $JS['mitigation']['parameters']['cmd'] ) ){
if( $JS['mitigation']['parameters']['cmd'] == 'ARM' ){
if( $_GET['z'] == 'jammer' ){
$CMD = 'usbrelay ' . $JAMMER_RELAY . '=1';
$D = `$CMD`;
};
if( $_GET['z'] == 'hunter' ){
$CMD = 'usbrelay ' . $FH_RELAY . '=1';
$D = `$CMD`;
};
};
if( $JS['mitigation']['parameters']['cmd'] == 'DISARM' ){
if( $_GET['z'] == 'jammer' ){
$CMD = 'usbrelay ' . $JAMMER_RELAY . '=0';
$D = `$CMD`;
};
if( $_GET['z'] == 'hunter' ){
$CMD = 'usbrelay ' . $FH_RELAY . '=0';
$D = `$CMD`;
};
};
};
};
};
};
if($Debug && 0 ){
fprintf( $fd, $Data . "\r\n" );
ob_start();
if( is_array( $JS )){
print_r( $JS );
};
if( $XS !== false ){
print_r( $XS );
};
$produced = ob_get_contents();
ob_end_clean();
fprintf( $fd, $produced . "\r\n" );
};
};
} catch ( Exception $e ) {
if($Debug)fprintf( $fd, 'Did not successfully process HTTP request: '.$e->getMessage() );
};
if($Debug){
fprintf( $fd, " ----------------- \r\n" );
fclose( $fd );
};
$rd = fopen( "registry.sjno", "r+" );
if(flock ( $rd, LOCK_EX )){
ftruncate($rd, 0);
fwrite($rd, json_encode( $Registry ));
fflush($rd);
flock($rd, LOCK_UN);
};
fclose( $rd);
?>

92
some_test.php

@ -1,92 +0,0 @@
<?php
function interpolate( $color1, $color2, $progress) {
//$a1 = ($color1 & 0xff000000) >> 24;
$r1 = ($color1 & 0x00ff0000) >> 16;
$g1 = ($color1 & 0x0000ff00) >> 8;
$b1 = $color1 & 0x000000ff;
//$a2 = ($color2 & 0xff000000) >> 24;
$r2 = ($color2 & 0x00ff0000) >> 16;
$g2 = ($color2 & 0x0000ff00) >> 8;
$b2 = $color2 & 0x000000ff;
$k1 = log10( $progress );
$k2 = 1.0 - $k1;
//$newA = (int)($a1 * $k2 + $a2 * $k1);
$newR = (int)($r1 * $k2 + $r2 * $k1);
$newG = (int)($g1 * $k2 + $g2 * $k1);
$newB = (int)($b1 * $k2 + $b2 * $k1);
//return ($newA << 24) + ($newR << 16) + ($newG << 8) + $newB;
return ($newR << 16) + ($newG << 8) + $newB;
};
//*
$thumbnail = imagecreatetruecolor( 2304, 288);
if(!$thumbnail) {
die('Error when creating the destination image.');
};
//$filename = "storage/192.168.1.63_2222_draw_yard.raw";
$filename = "storage/192.168.1.63_2222_draw_field.raw";
$handle = fopen($filename, "rb");
$cx = 0;
$cy = 288;
$cc = 0.0;
$k = 1.0/409.60;
while( !feof( $handle ) ){
$data = fread( $handle, 4*2304 );
$stride = unpack ( "V*", $data );//, int $offset = 0 );
if( count($stride) == 2304 ){
for( $index = 0; $index< 2304; $index++ ){
$z = $k * ( ( $stride[$index+1] >> 12 ) & 0xFFF);
//$z = $k * ( $stride[$index+1] & 0xFFF);
$s = 1.0 - log10( $z );
$R = (int)(255 * $s);
$G = (int)(255 * $s);
$B = (int)(255 * $s);
$C = imagecolorclosest ( $thumbnail, $R, $G, $B);
imagesetpixel ( $thumbnail, $index, $cy , $C );
};
$cy--;
};
};
fclose( $handle );
//header("Content-Type: image/png");
imagepng( $thumbnail );
//*/
/*
$canvas = new Imagick();
$width = 2304;
$height = 288;
$canvas->newImage($width, $height, new ImagickPixel("black"));
$canvas->setImageFormat("png");
$filename = "storage/18May_test.raw";
$handle = fopen($filename, "rb");
$cy = 288;
$k = 1.0 / 4096.0;
while( !feof( $handle ) ){
$data = fread( $handle, 4*2304 );
$stride = unpack ( "V*", $data );//, int $offset = 0 );
if( count($stride) == 2304 ){
$iterator = $canvas->getPixelRegionIterator( 0, $cy, $width, 1);
$index = 0;
foreach( $iterator as $pixels ){
foreach( $pixels as $pixel ){
$a = interpolate( 0xFFFFFFFF, 0xFF00FF00, ( $k * ( $stride[$index+1] & 0xFFF )) );
$c = '#' . sprintf("%08x", $a );
//echo $cy . " " . $index . " " . $c . "\n";
$pixel->setColor( $c );
$index++;
};
$iterator->syncIterator();
};
$cy--;
};
};
fclose( $handle );
// header( 'Content-type: ' . $canvas->getFormat() );
echo $canvas->getimageblob();
*/
?>

BIN
style/assets/987698d-1.png

Binary file not shown.

After

Width: 488  |  Height: 210  |  Size: 48 KiB

10
style/style.css

@ -250,5 +250,15 @@ object:hover {
} }
.dev_draw_img{ .dev_draw_img{
}
.green_status{
color: #FFFF00;
text-align: center;
background-color: #008000;
}
.blue_status{
color: #FFFF00;
text-align: center;
background-color: #000080;
} }

25
test_998.txt

@ -1,25 +0,0 @@
<html lang="en">
<head>
<meta charset=utf-8/>
<!-- CSS -->
<link href="https://vjs.zencdn.net/7.2.3/video-js.css" rel="stylesheet">
<!-- JS code -->
<script src="https://vjs.zencdn.net/ie8/1.1.2/videojs-ie8.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/videojs-contrib-hls/5.14.1/videojs-contrib-hls.js"></script>
<script src="https://vjs.zencdn.net/7.2.3/video.js"></script>
</head>
<body>
DCR01_1=1
DCR01_2=1
Array
(
[0] => DCR01_1=1
[1] => DCR01_2=1
[2] =>
)
<br/> Relay Found!<br/>
Relay DCR01_1 is about to set On!<br/>
Relay DCR01_2 is about to set On!<br/>
Command issued: usbrelay DCR01_1=1 DCR01_2=1 Code Received: <br/>
</body>
</html>

36
test_all_off.php

@ -1,36 +0,0 @@
<?php ?><html lang="en">
<head>
<meta charset=utf-8/>
<!-- CSS -->
<link href="https://vjs.zencdn.net/7.2.3/video-js.css" rel="stylesheet">
<!-- JS code -->
<script src="https://vjs.zencdn.net/ie8/1.1.2/videojs-ie8.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/videojs-contrib-hls/5.14.1/videojs-contrib-hls.js"></script>
<script src="https://vjs.zencdn.net/7.2.3/video.js"></script>
</head>
<body>
<?php
$DATA = `usbrelay`;
$tArr = explode( "\n", $DATA );
$Rel = array();
print_r( $DATA );
print_r( $tArr );
foreach( $tArr as $AR ){
$CC = explode('=', trim($AR) );
if( strlen($CC[0]) > 4 ) $Rel[]=$CC[0];
};
if( count( $Rel ) ){
echo "<br/> Relay Found!<br/>\n";
$CMD_TO_ISSUE = 'usbrelay ';
foreach( $Rel as $R ){
$CMD_TO_ISSUE .= $R . '=0 ';
echo "Relay ". $R ." is about to set Off!<br/>\n";
};
$AA = `$CMD_TO_ISSUE`;
echo "Command issued: " . $CMD_TO_ISSUE . " Code Received: " . $AA . "<br/>\n";
} else {
echo "<br/>No Relay Found<br/>\n";
};
?>
</body>
</html>

36
test_all_on.php

@ -1,36 +0,0 @@
<?php ?><html lang="en">
<head>
<meta charset=utf-8/>
<!-- CSS -->
<link href="https://vjs.zencdn.net/7.2.3/video-js.css" rel="stylesheet">
<!-- JS code -->
<script src="https://vjs.zencdn.net/ie8/1.1.2/videojs-ie8.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/videojs-contrib-hls/5.14.1/videojs-contrib-hls.js"></script>
<script src="https://vjs.zencdn.net/7.2.3/video.js"></script>
</head>
<body>
<?php
$DATA = `usbrelay`;
$tArr = explode( "\n", $DATA );
$Rel = array();
print_r( $DATA );
print_r( $tArr );
foreach( $tArr as $AR ){
$CC = explode('=', trim($AR) );
if( strlen($CC[0]) > 4 ) $Rel[]=$CC[0];
};
if( count( $Rel ) ){
echo "<br/> Relay Found!<br/>\n";
$CMD_TO_ISSUE = 'usbrelay ';
foreach( $Rel as $R ){
$CMD_TO_ISSUE .= $R . '=1 ';
echo "Relay ". $R ." is about to set On!<br/>\n";
};
$AA = `$CMD_TO_ISSUE`;
echo "Command issued: " . $CMD_TO_ISSUE . " Code Received: " . $AA . "<br/>\n";
} else {
echo "<br/>No Relay Found<br/>\n";
};
?>
</body>
</html>

11
test_ffmpeg

@ -1,11 +0,0 @@
#/srv/toogler/bin/ffmpeg -y -i "rtsp://gagua:4GetMyID@192.168.200.116:554/Streaming/Channels/102?transportmode=unicast&profile=Profile_2" -codec:v libtheora -qscale:v 7 -r 10 -an gaga.ogg
#2> /dev/null
#/srv/toogler/bin/ffmpeg -rtsp_transport tcp -i "rtsp://gagua:4GetMyID@192.168.200.116:554/Streaming/Channels/101?transportmode=unicast&profile=Profile_1" -r 10 -y -c:v libvpx-vp9 -an output.webm
# 2> /dev/null
#/srv/toogler/bin/ffmpeg -y -rtsp_transport tcp -i "rtsp://gagua:4GetMyID@192.168.200.116:554/Streaming/Channels/101?transportmode=unicast&profile=Profile_1" -c:v copy -an toto.mp4
#ffmpeg -y -i 1.mp4 -c:v libx264 -an -r 25 -strict -2 -map_metadata -1 -movflags faststart -vf "crop=1280:720:0:4, scale=iw*min(426/iw\,240/ih):ih*min(426/iw\,240/ih), pad=426:240:(426-iw*min(426/iw\,240/ih))/2:(240-ih*min(426/iw\,240/ih))/2, setsar=sar=1" 22.mp4
ffmpeg -y -i "rtsp://gagua:4GetMyID@192.168.200.116:554/Streaming/Channels/102?transportmode=unicast&profile=Profile_2" -vf "scale=320:240" -r 5 -vcodec libvpx -an -f webm out

22
test_hls.html

@ -1,22 +0,0 @@
<html lang="en">
<head>
<meta charset=utf-8/>
<!-- CSS -->
<link href="https://vjs.zencdn.net/7.2.3/video-js.css" rel="stylesheet">
<!-- JS code -->
<!-- If you'd like to support IE8 (for Video.js versions prior to v7) -->
<script src="https://vjs.zencdn.net/ie8/1.1.2/videojs-ie8.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/videojs-contrib-hls/5.14.1/videojs-contrib-hls.js"></script>
<script src="https://vjs.zencdn.net/7.2.3/video.js"></script>
</head>
<body>
<!-- HTML -->
<video id='hls-example' class="video-js vjs-default-skin" width="400" height="300" controls autoplay>
<source type="application/x-mpegURL" src="http://192.168.200.125:8081/argus/0/hls.m3u8">
</video>
<script>
var player = videojs('hls-example');
player.play();
</script>
</body>
</html>

8
test_mp4.php

@ -1,8 +0,0 @@
<?php
//require_once('lib/assembler.php');
require_once('lib/php/video/videostream.php');
//$stream1 = new VideoStream('1.mp4');
//$stream1->start();
$stream1 = new VideoStream('rtsp://gagua:4GetMyID@192.168.200.116:554/Streaming/Channels/102?transportmode=unicast&profile=Profile_2');
$stream1->startStream();
?>

8
test_my_video.html

@ -1,8 +0,0 @@
<html>
<body>
<video data-dashjs-player
width="640" height="480" controls autoplay
src="test_mp4.php">
</video>
</body>
</html>

6
test_ogg.php

@ -1,6 +0,0 @@
<?php
//require_once('lib/assembler.php');
require_once('lib/php/video/videostream.php');
$stream1 = new VideoStream('1.mp4');
$stream1->startStream();
?>
Loading…
Cancel
Save