Commit 9362d75a authored by Oleg Dzhimiev's avatar Oleg Dzhimiev
Browse files

initial

parent 9cbc926d
Loading
Loading
Loading
Loading

INSTALL.txt

0 → 100644
+13 −0
Original line number Diff line number Diff line
Installation in Kubuntu 12.04:

1. Install the following packages, terminal:
 sudo apt-get install php5 apache2

2. Make the src folder visible to the web server:
2a. Create a link, terminal: "sudo ln -sf <path-to-eyesis4pi_gui-folder> /var/www/eysisgui"
2b. Or copy all the files to /var/www/eyesisgui.
Note: "/var/www" is the (apache2) web server's document root folder.

3. Make the footage root folder "/data/footage" writable for everyone.

Questions: <support-list-eyesis@elphel.com>
 No newline at end of file

LICENSE.part

0 → 100644
+1499 −0

File added.

Preview size limit exceeded, changes collapsed.

button.css

0 → 100644
+80 −0
Original line number Diff line number Diff line

button {
/*  font-family:"Times New Roman", Times, serif;*/
  border: 0px solid black;
  font-size: 16px;
  /*line-height: 24px;*/  
  padding: 4px 20px 3px 20px;
  margin: 3px 3px 3px 3px;
  /*border radius*/
  border-radius: 5px;
  -webkit-border-radius: 5px;
  -moz-border-radius: 5px;  
  /*shadow*/
  -moz-box-shadow: 2px 2px 2px gray;
  -webkit-box-shadow: 2px 2px 2px gray;
  box-shadow: 2px 2px 2px gray;
  
  /*text-shadow: 1px 1px 1px gray;*/
  color: rgba(260,260,260,1);
  
  text-align:center;
  /*remove text selection*/
/*  -webkit-user-select: none;
  -khtml-user-select: none;
  -moz-user-select: none;
  -o-user-select: none;
  user-select: none;*/
} 

button::-moz-focus-inner {
  border: 0;
}

button:active, button:disabled  {
  text-shadow: 0px 0px 0px gray;
  color: rgba(150,100,100,1);
  /*shadow*/
  -moz-box-shadow: 1px 1px 1px gray;
  -webkit-box-shadow: 1px 1px 1px gray;
  box-shadow: 1px 1px 1px gray;
  
  /*margin: 3px 1px 3px 5px;*/
  
/*  margin-left: 2px;
  margin-top: 2px;*/ 
}

button:hover{
/*  -moz-box-shadow: 0px 0px 10px black;
  -webkit-box-shadow: 0px 0px 10px black;
  box-shadow: 0px 0px 10px black;  */
}

/*background gradients*/

button {
  background: -webkit-gradient(linear, left top, left bottom, from(rgba(200,100,100,0.7)), to(rgba(200,100,100,0.7))); /* for webkit browsers */
  background: -moz-linear-gradient(top,  rgba(200,100,100,0.7),  rgba(200,100,100,0.7)); /* for firefox 3.6+ */   
}

button:hover {
  background: -webkit-gradient(linear, left top, left bottom, from(rgba(256,170,170,1)), to(rgba(230,130,130,1))); /* for webkit browsers */
  background: -moz-linear-gradient(top,  rgba(256,170,170,1),  rgba(230,130,130,1)); /* for firefox 3.6+ */
}

button:active, button:disabled {
  background: -webkit-gradient(linear, left top, left bottom, from(rgba(230,130,130,1)), to(rgba(256,170,170,1))); /* for webkit browsers */
  background: -moz-linear-gradient(top,  rgba(230,130,130,1), rgba(256,170,170,1)); /* for firefox 3.6+ */
}

.input_text {
  border: 0px solid black;
  /*line-height: 22px;*/
  width: 100px;
  height: 24px;
  -moz-line-height: 22px;
  border-radius: 3px;
  -webkit-border-radius: 3px;
  -moz-border-radius: 3px; 
}

button.html

0 → 100644
+21 −0
Original line number Diff line number Diff line
<html>
<head>
    <title>Button style test</title>
    <link rel="shortcut icon" href="favicon.ico" />

    <script src="jquery-1.7.2.min.js" type="text/javascript"></script>

    <link rel="stylesheet" type="text/css" href="button.css" />
</head>
<body>
    <table>
      <tr>
	<td>
	<button style="height:100px;width:100px;">test</button>
	</td><td>
	<button style="height:100px;width:100px;">test1</button>
	</td>
      </tr>
    </table>
</body>
</html>
 No newline at end of file

camogm.js

0 → 100644
+183 −0
Original line number Diff line number Diff line
function camogm_launch(init){
  if (init) camogm_create_table();
  camogm_cmd("run_camogm",true,camogm_launch_response);
  intvl_status = setInterval("status_message(true,'Launching camogm')",1000);
  console.log("camogm launch");
  
  //actions
//   if (camogm_en) {
//   }else{
//       clearInterval(intvl_camogm_status);
//       clearInterval(intvl_hdd_free_space);
//   }
}

function camogm_exit(){
  console.log("camogm exit");
  camogm_cmd("exit",true);
}

function camogm_rec_start(){
  console.log("camogm: begin recording");
  //camogm_cmd("mount",false);
  camogm_cmd("start",true);
  if (!disable_intervals) intvl_camogm_status = setInterval("camogm_status(true)",10000);
  if (!disable_intervals) intvl_hdd_free_space = setInterval("camogm_get_hdd_free_space(false)",10000);
}

function camogm_rec_stop(){
  console.log("camogm: stop recording");
  camogm_cmd("stop",false);
  camogm_cmd("unmount",true);//replaced with sync
  clearInterval(intvl_hdd_free_space);
  clearInterval(intvl_camogm_status);
  intvl_hdd_free_space = false;
  intvl_camogm_status = false;
  green_the_bars();
}

function camogm_cmd(cmd,async,callback) {

    var url = "eyesis4pi_control.php?"+cmd+"&master_ip="+master_ip+"&n="+n+"&rec_delay="+camogm_rec_delay;
    
    $.ajax({
      url: url,
      async: async,
      success: function(data){
	//$("#status").html(data);
	if (typeof callback != 'undefined') callback(data);
      }
    }); 
    
}

function camogm_create_table(){
    var table_html = "";
    
    if (camogm_en) {
	table_html = "<tr>\n\t<td></td>\n\t<td align='center'>SSD free space</td>\n<td>&nbsp;&nbsp;Buffer (important when recording)</td></tr>";
	for (var i=0;i<n;i++) {
	  table_html +=  "<tr>\n\t<td>camera "+(i+1)+"</td><td id='cam"+(i+1)+"_hdd' align='right'></td><td><div id='buffer"+(i+1)+"_sum' class='buffer'><div id='buffer"+(i+1)+"' style='width:200px;' class='buffer_free'>free</div></div></td></tr>";
	}
    }
    $("#hdd_free_space").html(table_html);
    
}

function camogm_get_hdd_free_space(mount_en){
//     if (mount_en){
// 	//camogm_cmd("mount",false);
// 	camogm_cmd("get_hdd_space&mount_point=/var/html/CF",false,camogm_parse_hdd_free_space);
// 	//camogm_cmd("unmount",true);
//     }else{
// 	camogm_cmd("get_hdd_space&mount_point=/var/html/CF",true,camogm_parse_hdd_free_space);
//     }
      camogm_cmd("get_hdd_space&mount_point=/var/html/CF",true,camogm_parse_hdd_free_space);
      camogm_cmd("unmount",true);
}

function camogm_parse_hdd_free_space(data){
    var raw_data=0;
    var end = " KB";
    var random_color =  "rgba("+Math.floor(Math.random()*128)+","+Math.floor(Math.random()*128)+","+Math.floor(Math.random()*128)+",1)";
    
    for (var i=0;i<n;i++) {
	raw_data = +$(data).find('cam'+(i+1)).find('hdd_free_space').text();
	end = " KB";
	for (var j=0;j<3;j++) {
	    raw_data = Math.round(10*raw_data/1024)/10;
	    if (j==1) end = " MB";
	    if (j==2) end = " GB";
	    
	    //emergency stop
	    if ((j==1)&&(raw_data<128)) {
	      status_message(false,"SSD: low free space");
	      camogm_rec_stop();
	    }
	    
	    if (raw_data<1024) break;
	}
	$("#cam"+(i+1)+"_hdd").html("<b style='color:"+random_color+";'>"+raw_data+end+"</b>");
    }
}

function camogm_status(async){
    camogm_cmd("status",async,camogm_parse_status);
}

function camogm_parse_status(data){
    var buf_free;
    var buf_used;
    var buf_sum;
    
    for (var i=0;i<n;i++) {
	buf_free = +$(data).find('cam'+(i+1)).find('camogm_state').find('buffer_free').text();
	buf_used = +$(data).find('cam'+(i+1)).find('camogm_state').find('buffer_used').text();
	buf_sum = buf_free+buf_used;
	
	$("#buffer"+(i+1)).css({width:(Math.round(buf_free/buf_sum*$("#buffer"+(i+1)+"_sum").width()))+"px"});
    }    
    
    var state = "";
    for (var i=0;i<n;i++) {
	state = $(data).find('cam'+(i+1)).find('camogm_state').find('state').text();
	if (state!='"running"') break;
	state = "running";
    }    

    if (camogm_en) {
	//status_update(state);
	$("#status").html(state);
    }
    if (update_state_en) {
	if (state=="running") {
	  restore_parameters_en = false;
	  if (!disable_intervals&&!intvl_camogm_status){
	    camogm_status(true);
	    intvl_camogm_status = setInterval("camogm_status(true)",10000);
	  }
	  if (!disable_intervals&&!intvl_hdd_free_space){
	    camogm_get_hdd_free_space(false);
	    intvl_hdd_free_space = setInterval("camogm_get_hdd_free_space(false)",10000);
	  }
	}
	if (restore_parameters_en) restore_parameters();
	status_update(state);
	console.log("camogm state: "+state);
    }
}

function camogm_parse_state(data){
    var tmp;
    for (var i=0;i<n;i++) {
	tmp = $(data).find('cam'+(i+1)).find('camogm_state').text();
	if (tmp=="off") break;
    }
    
    if (tmp!="off") {
	camogm_create_table();
	camogm_status(true);
	camogm_cmd("mount",false);
	green_the_bars();
	camogm_get_hdd_free_space(true);
    }else{
	camogm_launch(true);
    }
    
}

function green_the_bars() {
    for (var i=0;i<n;i++) {	
	$("#buffer"+(i+1)).css({width:$("#buffer"+(i+1)+"_sum").width()+"px"});
    }  
}

function camogm_launch_response(){
    console.log("camogm launch response");
    clearInterval(intvl_status);
    status_message(false,"camogm launched");
    camogm_cmd("mount",false);
    camogm_status(true);
    green_the_bars();
    camogm_get_hdd_free_space(true);
}
 No newline at end of file
Loading