Loading src/snapshot/index.php +55 −9 Original line number Original line Diff line number Diff line Loading @@ -78,18 +78,21 @@ font-family: "Helvetica Neue", Helvetica; font-family: "Helvetica Neue", Helvetica; } } #snapshot{ .button{ background-color: #CF4040; /* not Green */ font-weight: bold; border-radius:3px; outline:none; border: none; border: none; color: white; color: white; padding: 32px 32px; text-align: center; text-align: center; text-decoration: none; text-decoration: none; display: inline-block; display: inline-block; } #snapshot{ background-color: #CF4040; /* not Green */ padding: 32px 32px; font-size: 20px; font-size: 20px; font-weight: bold; border-radius:3px; outline:none; } } #snapshot:hover{ #snapshot:hover{ Loading @@ -104,6 +107,26 @@ background-color: #A0A0A0; /* not Green */ background-color: #A0A0A0; /* not Green */ } } #synced{ width:25px; height:25px; } #help_button{ background-color: #404040; /* not Green */ padding: 3px 7px; font-size: 15px; } #help_button:hover{ background-color: #303030; /* not Green */ } #help_button:active{ background-color: #202020; /* not Green */ } </style> </style> <script> <script> Loading @@ -115,8 +138,31 @@ </head> </head> <body> <body> <div> <button title='Download images (synced) from all channels over network' id='snapshot' onclick='take_snapshot()'>Snapshot</button> <button title='Download images from all channels over network' id='snapshot' onclick='take_snapshot()' class='button'>Snapshot</button> </div> <br/> <div> <table> <tr> <td valign='middle'><span style='font-size:20px;line-height:25px;'>sync</span></td> <td valign='middle'><input type='checkbox' id='synced' checked/></td> <td valign='middle'><button id='help_button' class='button' onclick='toggle_help()' >?</button></td> </tr> </table> </div> <br/> <div id='help' style='display:none;'> <b>if checked</b>: <ul> <li>all ports - same timestamp</li> <li>fps will be reprogrammed - set to single trigger mode then restored - careful if some other program is doing recording</li> </ul> <b>if unchecked</b>: <ul> <li>timestamps can be different</li> <li>fps will not be reprogrammed - no intereference with other recording programs, only network load.</li> </ul> </div> </body> </body> </html> </html> No newline at end of file src/snapshot/snapshot.js +29 −8 Original line number Original line Diff line number Diff line Loading @@ -6,7 +6,13 @@ function take_snapshot(){ $("#snapshot").attr("disabled",true); $("#snapshot").attr("disabled",true); if(ports.length!=0){ if(ports.length!=0){ if ($("#synced").attr("checked")){ read_trig_master(); read_trig_master(); }else{ download_all(false); } }else{ }else{ console.log("No ports detected"); console.log("No ports detected"); } } Loading Loading @@ -50,17 +56,15 @@ function trigger(){ url:ip+"/snapshot.php?trig", url:ip+"/snapshot.php?trig", success:function(){ success:function(){ setTimeout(download_all,200); setTimeout(function(){ download_all(true); },200); } } }); }); } } function download_all(){ function restore_trig_period(){ ports.forEach(function(c,i){ download_single(ip+":"+c+"/bimg"); }); $.ajax({ $.ajax({ url: ip+"/parsedit.php?immediate&TRIG_PERIOD="+(tp_old+1)+"*-2&sensor_port="+trig_master, url: ip+"/parsedit.php?immediate&TRIG_PERIOD="+(tp_old+1)+"*-2&sensor_port="+trig_master, Loading @@ -81,6 +85,16 @@ function download_all(){ } } function download_all(rtp){ ports.forEach(function(c,i){ download_single(ip+":"+c+"/bimg"); }); if (rtp) restore_trig_period(); } function download_single(addr){ function download_single(addr){ var link = document.createElement('a'); var link = document.createElement('a'); Loading @@ -96,3 +110,10 @@ function download_single(addr){ document.body.removeChild(link); document.body.removeChild(link); } } function toggle_help(){ $("#help").toggle(); } Loading
src/snapshot/index.php +55 −9 Original line number Original line Diff line number Diff line Loading @@ -78,18 +78,21 @@ font-family: "Helvetica Neue", Helvetica; font-family: "Helvetica Neue", Helvetica; } } #snapshot{ .button{ background-color: #CF4040; /* not Green */ font-weight: bold; border-radius:3px; outline:none; border: none; border: none; color: white; color: white; padding: 32px 32px; text-align: center; text-align: center; text-decoration: none; text-decoration: none; display: inline-block; display: inline-block; } #snapshot{ background-color: #CF4040; /* not Green */ padding: 32px 32px; font-size: 20px; font-size: 20px; font-weight: bold; border-radius:3px; outline:none; } } #snapshot:hover{ #snapshot:hover{ Loading @@ -104,6 +107,26 @@ background-color: #A0A0A0; /* not Green */ background-color: #A0A0A0; /* not Green */ } } #synced{ width:25px; height:25px; } #help_button{ background-color: #404040; /* not Green */ padding: 3px 7px; font-size: 15px; } #help_button:hover{ background-color: #303030; /* not Green */ } #help_button:active{ background-color: #202020; /* not Green */ } </style> </style> <script> <script> Loading @@ -115,8 +138,31 @@ </head> </head> <body> <body> <div> <button title='Download images (synced) from all channels over network' id='snapshot' onclick='take_snapshot()'>Snapshot</button> <button title='Download images from all channels over network' id='snapshot' onclick='take_snapshot()' class='button'>Snapshot</button> </div> <br/> <div> <table> <tr> <td valign='middle'><span style='font-size:20px;line-height:25px;'>sync</span></td> <td valign='middle'><input type='checkbox' id='synced' checked/></td> <td valign='middle'><button id='help_button' class='button' onclick='toggle_help()' >?</button></td> </tr> </table> </div> <br/> <div id='help' style='display:none;'> <b>if checked</b>: <ul> <li>all ports - same timestamp</li> <li>fps will be reprogrammed - set to single trigger mode then restored - careful if some other program is doing recording</li> </ul> <b>if unchecked</b>: <ul> <li>timestamps can be different</li> <li>fps will not be reprogrammed - no intereference with other recording programs, only network load.</li> </ul> </div> </body> </body> </html> </html> No newline at end of file
src/snapshot/snapshot.js +29 −8 Original line number Original line Diff line number Diff line Loading @@ -6,7 +6,13 @@ function take_snapshot(){ $("#snapshot").attr("disabled",true); $("#snapshot").attr("disabled",true); if(ports.length!=0){ if(ports.length!=0){ if ($("#synced").attr("checked")){ read_trig_master(); read_trig_master(); }else{ download_all(false); } }else{ }else{ console.log("No ports detected"); console.log("No ports detected"); } } Loading Loading @@ -50,17 +56,15 @@ function trigger(){ url:ip+"/snapshot.php?trig", url:ip+"/snapshot.php?trig", success:function(){ success:function(){ setTimeout(download_all,200); setTimeout(function(){ download_all(true); },200); } } }); }); } } function download_all(){ function restore_trig_period(){ ports.forEach(function(c,i){ download_single(ip+":"+c+"/bimg"); }); $.ajax({ $.ajax({ url: ip+"/parsedit.php?immediate&TRIG_PERIOD="+(tp_old+1)+"*-2&sensor_port="+trig_master, url: ip+"/parsedit.php?immediate&TRIG_PERIOD="+(tp_old+1)+"*-2&sensor_port="+trig_master, Loading @@ -81,6 +85,16 @@ function download_all(){ } } function download_all(rtp){ ports.forEach(function(c,i){ download_single(ip+":"+c+"/bimg"); }); if (rtp) restore_trig_period(); } function download_single(addr){ function download_single(addr){ var link = document.createElement('a'); var link = document.createElement('a'); Loading @@ -96,3 +110,10 @@ function download_single(addr){ document.body.removeChild(link); document.body.removeChild(link); } } function toggle_help(){ $("#help").toggle(); }