emSFP flow diag check


update

  receiver check
sdi.valid 1  
sdi.bit_rate 2 3G
sdi.sampling_format 0 422_ycbcr
sdi.frame_rate 10 24/1.001
sdi.video_format 0 SMPTE ST 274 1920x1080
sdi.progressive_scan 1  
sdi.payload_video_id 0x00000000  
igmp.query_count 0  
igmp.join_count 2  
igmp.join_received 1  
igmp.version 0  
igmp.querrier_address 0.0.0.0  
igmp.enable 1  
igmp.force_join 1
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>emSFP flow diag</title>
 <script type="text/javascript" src="mytools.js"></script>
 <script type="text/javascript">
//
// ---------------------------
//
   function getJson() {

    send_ip = "192.168.39.215";
    recv_ip = "192.168.39.216";
    flow_id = "a04f66a2-9910-11e5-8894-feff819cdc9f";

    send_uri="http://" + send_ip + "/emsfp/node/v1/flows/" + flow_id + "/";
    recv_uri="http://" + recv_ip + "/emsfp/node/v1/flows/" + flow_id + "/";
// "self/diag/flow/"

    var xmlhttp = new XMLHttpRequest();
    var data; // change to global for comprare

    var elem = document.getElementById("update_time");
//           elem.innerText = dispTime();

// 非同期、終了したら呼ばれる関数をセット
     xmlhttp.onreadystatechange = function () {
       if (xmlhttp.readyState == 4) {
         if (xmlhttp.status == 200) {
//           var data = JSON.parse(xmlhttp.responseText);
           data = JSON.parse(xmlhttp.responseText);

    var elem = document.getElementById("valid").innerText = data.sdi.valid;

// sdi.bitrate 0=HD,1=SD,2=3G
    var elem = document.getElementById("bit_rate").innerText = data.sdi.bit_rate;
    var elem = document.getElementById("bit_rate_c");
    switch(data.sdi.bit_rate){
        case "0":    elem.innerText = "HD"; break;
        case "1":    elem.innerText = "SD"; break;
        case "2":    elem.innerText = "3G"; break;
        default:    elem.innerText = "";    break;
    }

// sdi.sampling_format "000" 422_ycbcr:
    var elem = document.getElementById("sampling_format").innerText = data.sdi.sampling_format;
    var elem = document.getElementById("sampling_format_c");
    switch(data.sdi.sampling_format){
        case "0000":    elem.innerText = "422_ycbcr"; break;
        case "0":    elem.innerText = "422_ycbcr"; break;
        case "0001":    elem.innerText = "444_ycbcr"; break;
        case "0010":    elem.innerText = "444_rgb"; break;
        default:    elem.innerText = "";    break;
    }

// format_rate
    var elem = document.getElementById("frame_rate").innerText = data.sdi.frame_rate;
    var elem = document.getElementById("frame_rate_c");
    switch(data.sdi.frame_rate){
        case "0011":    elem.innerText = "24"; break;
        case "10":    elem.innerText = "24/1.001"; break;
        case "1010":    elem.innerText = "60/1.001"; break;
        case "1011":    elem.innerText = "60"; break;
        default:    break;
    }

// video_format
    var elem = document.getElementById("video_format").innerText = data.sdi.video_format;
    var elem = document.getElementById("video_format_c");
    switch(data.sdi.video_format){
        case "0":    elem.innerText = "SMPTE ST 274 1920x1080"; break;
        case "0000":    elem.innerText = "SMPTE ST 274 1920x1080"; break;
        case "0001":    elem.innerText = "SMPTE ST 296 1280x720"; break;
        case "0010":    elem.innerText = "SMPTE 2048-2 2048x1080"; break;
        case "0011":    elem.innerText = "SMPTE 295 1920x1080"; break;
        case "1000":    elem.innerText = "NTSC 720x486"; break;
        case "1001":    elem.innerText = "PAL 720x576"; break;
        default:    elem.innerText = "";    break;
    }

// progressive_scan
    var elem = document.getElementById("progressive_scan").innerText = data.sdi.progressive_scan;
// payload_video_id
    var elem = document.getElementById("payload_video_id").innerText = data.sdi.payload_video_id;

// ---------------------- igmp group ---------------------------------
// igmp.query_count
// igmp.answer_count
// igmp.join_count
// igmp.join_received
// igmp.version
// igmp.querrier_address
// igmp.enable

    var elem = document.getElementById("query_count").innerText = data.igmp.query_count;
//    var elem = document.getElementById("answer_count").innerText = data.igmp.answer_count;
    var elem = document.getElementById("join_count").innerText = data.igmp.join_count;
    var elem = document.getElementById("join_received").innerText = data.igmp.join_received;
    var elem = document.getElementById("version").innerText = data.igmp.version;
    var elem = document.getElementById("querrier_address").innerText = data.igmp.querrier_address;
    var elem = document.getElementById("enable").innerText = data.igmp.enable;
    var elem = document.getElementById("force_join").innerText = data.igmp.force_join;

         } else {
//  not status = 200, error
    var elem = document.getElementById("update_time");
           elem.innerText = "sender read error";

         }
       }
     }

//     xmlhttp.open("GET", "JSON/216diag.JSON");
     xmlhttp.open("GET", "http://192.168.39.216/emsfp/node/v1/self/diag/flow/a04f66a2-9910-11e5-8894-feff819cdc9f/");
     xmlhttp.responseType = 'json';
     xmlhttp.send();
    }
// =========================================  end of Javascript ========================================================
  </script>

</head>
<!------------------------------------------------------------>
<!--------------------------- HTML main  --------------------->
<!------------------------------------------------------------>
<body>
<H1>emSFP flow diag check</H1>
  <input id="Button_Get" type="button" value="emSFP flow JSON read now!" onclick="getJson();" />
  <hr />
<H3>update <span id="update_time"></span></H3>
<table border = 2 >
<th align="center"></th><th>receiver</th><th>check</th>
<!--------------------------- sdi group --------------------->
<tr align="center">
    <th align="left">sdi.valid</th><td><span id="valid"></span></td>
<td></td></tr>
<tr align="center"><th align="left">sdi.bit_rate</th><td><span id="bit_rate"></span></td><td><span id="bit_rate_c"></span></td></tr>
<tr align="center"><th align="left">sdi.sampling_format</th><td><span id="sampling_format"></span></td><td><span id="sampling_format_c"></span></td></tr>
<tr align="center"><th align="left">sdi.frame_rate</th><td><span id="frame_rate"></span></td><td><span id="frame_rate_c"></span></td></tr>
<tr align="center"><th align="left">sdi.video_format</th><td><span id="video_format"></span></td><td><span id="video_format_c"></span></td></tr>
<tr align="center"><th align="left">sdi.progressive_scan</th><td><span id="progressive_scan"></span></td><td></td></tr>
<tr align="center"><th align="left">sdi.payload_video_id</th><td><span id="payload_video_id"></span></td><td></td></tr>
<!--------------------------- igmp group --------------------->
<tr align="center"><th align="left">igmp.query_count</th><td><span id="query_count"></span></td><td></td></tr>
<tr align="center">
    <th align="left">igmp.join_count</th><td><span id="join_count"></span></td><td></td></tr>
<tr align="center">
    <th align="left">igmp.join_received</th><td><span id="join_received"></span></td>
<td></td></tr>
<tr align="center">
    <th align="left">igmp.version</th><td><span id="version"></span></td>
<td></td></tr>
<tr align="center">
    <th align="left">igmp.querrier_address</th><td><span id="querrier_address"></span></td>
<td></td></tr>
<tr align="center">
    <th align="left">igmp.enable</th><td><span id="enable"></span></td>
<td></td></tr>
<tr align="center">
    <th align="left">igmp.force_join</th><td><span id="force_join"></span></td>
<td></td></tr>

</table>
</body>
</html>