sor文件的解读提供二次开发接口
步骤如下:
1、上传你的sor、trc文件
2、通过服务器下载解析后的json文件
3、根据你自己得需要获取信息

示例代码`

function uploadFile() {
var time = new Date().getTime();
var file = document.getElementById(‘file’).files;
var fileType = file[0].name.split(".")[file[0].name.split(".").length-1];
if(fileType==‘trc’||fileType==‘sor’){
}else{
alert(‘无法解析该文件!’);
return;
}
var key = time+“9$@888888@ 9132999999999 9132999999999 9132999999999@888888@ 9 " + f i l e T y p e + " 9 9"+fileType+"9 9"+fileType+"9@888888”;
var newfile = new File([file[0]], key);
var formData = new FormData();
formData.append(key, newfile);
loadLayer();
$.ajax({
url: “联系我索要地址”,
type: “POST”,
data: formData,
contentType: false,
processData: false,
success: function (data) {
var fileUrl = “联系我索要地址/”+data.substr(8,25);
readJson(fileUrl);
},
error: function () {
alert(“上传失败!”);
}
});
}
function showolm(ooindex){

stage.clear();
stage.frames = 24;
var  scene = new JTopo.Scene(stage);
scene.clear();canvas.width = $(window).width();
canvas.heirht = 300;
var startPos = 50;
var endPos = 0;
var lineWidth = 200;var  nodes =[];for(var i=0;i<otdrJson[ooindex]._ListEvent.length;i++){var event = otdrJson[ooindex]._ListEvent[i];var txt =(event.SpanLength/1000).toFixed(3) +"km\n\n" +(event.SpanLoss=='-'?'-':(event.SpanLoss*1).toFixed(3)) +"dB\n\n" +eventTypeChange(event.Type)var node = addEventNode(startPos +(i)*lineWidth, 100,80,80, txt);scene.add(node);nodes.push(node);}for(var j=0;j<  nodes.length;j++){if(j< nodes.length-1){var section = otdrJson[ooindex]._ListSection[j];var txta=(section.Length/1000).toFixed(3)+"km"var txtb =(section.Loss=='-'?'-':(section.Loss*1).toFixed(3))+"dB" var txtc =(i==0?0:(section.Loss/section.Length*1000).toFixed(3))+"dB/km";var linka = addLine(nodes[j],nodes[j+1], txta,0);var linkb = addLine(nodes[j],nodes[j+1], txtb,18);var linkc = addLine(nodes[j],nodes[j+1], txtc,35);scene.add(linka);scene.add(linkb);scene.add(linkc);}  }

}`
function loadSummary() {
var base = document.getElementById(‘base’);
var mark = document.getElementById(‘mark’);
var testParam = document.getElementById(‘testParam’);
var result = document.getElementById(‘result’);
var testOption = document.getElementById(‘testOption’);
var baseRows = base.rows;
var markRows = mark.rows;
var testParamRows = testParam.rows;
var resultRows = result.rows;
var testOptionRows = testOption.rows;
//通用标识
var date = new Date(otdrJson[Index]._Identification.TestDate.substr(6,13)/1).toLocaleString();
baseRows[1].cells[1].innerHTML = otdrJson[Index]._Identification.FileName;
baseRows[2].cells[1].innerHTML = date.split(’ ‘)[0];
baseRows[3].cells[1].innerHTML = date.split(’ ‘)[1];
baseRows[4].cells[1].innerHTML = otdrJson[Index]._Identification.ProjectName;
baseRows[5].cells[1].innerHTML = otdrJson[Index]._Identification.Customer;
baseRows[6].cells[1].innerHTML = otdrJson[Index]._Identification.Company;
baseRows[7].cells[1].innerHTML = otdrJson[Index]._Identification.OperateAName;
baseRows[8].cells[1].innerHTML = otdrJson[Index]._Identification.OperateBName;
//标识
markRows[1].cells[1].innerHTML = otdrJson[Index]._Identification.UnitModel;
markRows[2].cells[1].innerHTML = otdrJson[Index]._Identification.UnitSerialNumber;
markRows[3].cells[1].innerHTML = otdrJson[Index]._Identification.CableID;
markRows[4].cells[1].innerHTML = otdrJson[Index]._Identification.FiberID;
markRows[5].cells[1].innerHTML = otdrJson[Index]._Identification.LocationA;
markRows[6].cells[1].innerHTML = otdrJson[Index]._Identification.LocationB;
//测试参数
testParamRows[1].cells[1].innerHTML = otdrJson[Index]._Summary.WaveLength1000000000+“nm”;
testParamRows[2].cells[1].innerHTML = (otdrJson[Index]._Summary.Range/1000).toFixed(3
)+“km”;
testParamRows[3].cells[1].innerHTML = otdrJson[Index]._Summary.Pulse
1000000+“μs”;
testParamRows[4].cells[1].innerHTML = otdrJson[Index]._Summary.Duration.TotalSeconds+“s”;
testParamRows[5].cells[1].innerHTML = otdrJson[Index]._Summary.Highresolutionfalse?“否”:“是”;
testParamRows[6].cells[1].innerHTML = (otdrJson[Index]._Summary.Resolution/1).toFixed(3)+“m”;
//测试结果
resultRows[1].cells[1].innerHTML = (otdrJson[Index]._Summary.SpanLength/1000).toFixed(3)+“km”;
resultRows[2].cells[1].innerHTML = (otdrJson[Index]._Summary.SpanLoss/1).toFixed(3)+“dB”;
resultRows[3].cells[1].innerHTML = (otdrJson[Index]._Summary.AverageLoss1000).toFixed(3)+“dB/km”;
resultRows[4].cells[1].innerHTML = (otdrJson[Index]._Summary.AverageSpliceLoss/1).toFixed(3)+“dB”;
resultRows[5].cells[1].innerHTML = (otdrJson[Index]._Summary.MaximumSpliceLoss/1).toFixed(3)+“dB”;
resultRows[6].cells[1].innerHTML = (otdrJson[Index]._Summary.SpanORL/1).toFixed(3)+“dB”;
//测试设置
testOptionRows[1].cells[1].innerHTML = (otdrJson[Index]._Summary.IOR/1).toFixed(6);
testOptionRows[2].cells[1].innerHTML = (otdrJson[Index]._Summary.BackScatter/1).toFixed(3)+“dB”;
testOptionRows[3].cells[1].innerHTML = (otdrJson[Index]._Summary.HelixFactor/1).toFixed(2)+"%";
testOptionRows[4].cells[1].innerHTML = (otdrJson[Index]._Summary.SpliceLossThreshold/1).toFixed(3)+“dB”;
testOptionRows[5].cells[1].innerHTML = (otdrJson[Index]._Summary.ReflectanceThreshold/1).toFixed(3)+“dB”;
testOptionRows[6].cells[1].innerHTML = (otdrJson[Index]._Summary.EndOfFiberThreshold/1).toFixed(3)+“dB”;
testOptionRows[7].cells[1].innerHTML = (otdrJson[Index]._Summary.FiberCoreSize
10000).toFixed(3)+“μm”;
}
function loadThreshold() {
var threshold = document.getElementById(‘threshold’);
var rows = threshold.rows;
//阈值
rows[0].cells[0].innerHTML = ‘阈值(’+otdrJson[Index]._WaveLength+’)’;
rows[2].cells[1].childNodes[0].checked = otdrJson[Index]._Thresholds.UnidirConnectLoss.Applicable;
rows[2].cells[2].innerHTML = otdrJson[Index]._Thresholds.UnidirConnectLoss.Fail+".000dB";
rows[2].cells[3].innerHTML = otdrJson[Index]._Thresholds.UnidirConnectLoss.Warning+".000dB";
rows[3].cells[1].childNodes[0].checked = otdrJson[Index]._Thresholds.UnidirSpliceLoss.Applicable;
rows[3].cells[2].innerHTML = otdrJson[Index]._Thresholds.UnidirSpliceLoss.Fail+".000dB";
rows[3].cells[3].innerHTML = otdrJson[Index]._Thresholds.UnidirSpliceLoss.Warning+".000dB";
rows[4].cells[1].childNodes[0].checked = otdrJson[Index]._Thresholds.Reflectance.Applicable;
rows[4].cells[2].innerHTML = otdrJson[Index]._Thresholds.Reflectance.Fail+".000dB";
rows[4].cells[3].innerHTML = otdrJson[Index]._Thresholds.Reflectance.Warning+".000dB";
rows[5].cells[1].childNodes[0].checked = otdrJson[Index]._Thresholds.FiberSectionAttenuation.Applicable;
rows[5].cells[2].innerHTML = otdrJson[Index]._Thresholds.FiberSectionAttenuation.Fail1000+“00dB/km”;
rows[5].cells[3].innerHTML = otdrJson[Index]._Thresholds.FiberSectionAttenuation.Warning
1000+“00dB/km”;
rows[6].cells[1].childNodes[0].checked = otdrJson[Index]._Thresholds.SpanLoss.Applicable;
rows[6].cells[2].innerHTML = otdrJson[Index]._Thresholds.SpanLoss.Fail+".000dB";
rows[6].cells[3].innerHTML = otdrJson[Index]._Thresholds.SpanLoss.Warning+".000dB";
rows[7].cells[1].childNodes[0].checked = otdrJson[Index]._Thresholds.SpanLength.Applicable;
rows[7].cells[2].innerHTML = otdrJson[Index]._Thresholds.SpanLength.Fail+".000km";
rows[7].cells[3].innerHTML = otdrJson[Index]._Thresholds.SpanLength.Warning+".000km";
rows[8].cells[1].childNodes[0].checked = otdrJson[Index]._Thresholds.SpanOrl.Applicable;
rows[8].cells[2].innerHTML = otdrJson[Index]._Thresholds.SpanOrl.Fail+".000dB";
rows[8].cells[3].innerHTML = otdrJson[Index]._Thresholds.SpanOrl.Warning+".000dB";
}
function loadEvent() {
var events = document.getElementById(‘events’);
var tr = “序号事件类型位置(km)损耗(dB)” +
反射率与前点距离(km)两点损耗(dB)” +
“两点衰减系数(dB/km)
累计损耗(dB)”;
var countLoss = 0;
for(var i=0;i<otdrJson[Index]._ListEvent.length;i++){
var event = otdrJson[Index]._ListEvent[i];
var section;
if(i>0){
countLoss += event.SpanLoss;
section = otdrJson[Index]._ListSection[i-1];
}else{
section={Loss:’-’,Length:0};
}
tr+=""+(i+1)+""+eventTypeChange(event.Type)
+"" +(event.SpanLength/1000).toFixed(3)
+""+(event.SpanLoss’-’?’-’:(event.SpanLoss1).toFixed(3))
+"
"+(event.Reflectivity==’-’?’-’:(event.Reflectivity1).toFixed(3))
+""+(section.Length/1000).toFixed(3)
+""+ (section.Loss==’-’?’-’:(section.Loss1).toFixed(3))
+"
"+(i==0?0:(section.Loss/section.Length1000).toFixed(3))
+""+((countLoss1).toFixed(3)==‘NaN’?’-’:(countLoss1).toFixed(3))+"";
}
events.innerHTML = tr;
}

【光链路分析四】OTDR文件解读接口二次开发说明相关推荐

  1. gtalk接口二次开发告警平台

    由于平台的扩大,原先的短信告警平台已无法满足实际需求. 平台一个月就要花去5000元多的短信费用,发送信息量巨大,偶尔造成短信系统故障等问题,而且成本也很高.为了解缓解原短信系统的压力,同时希望将部份 ...

  2. 【光链路分析二】OTDR 测量文件 SOR文件解析

    OTDR 测量文件 SOR文件 解析 OTDR 标准格式文件是遵守Bellcore 标准的 概要[文件名称.测量时间.光缆标识.纤芯标识.起点.终点.设备型号.设备序列号等] 测量结果[长度.总损耗. ...

  3. 【光链路分析一】一款基于OTDR的光链路分析软件

    免费下载使用. http://www.fibermonitor.com:8090/ ** 针对otdr生产的sor文件 bellcore 100 200 400 以及主流的exfo 的trc文件 ** ...

  4. 【光链路分析三】otdr数据结构参考

    /// <summary>/// 标识/// </summary>[Serializable][DataContract(Name = "OTDR_Identific ...

  5. kkFileView代码分析(四)——office文件的转换(1)office插件管理

    2021SC@SDUSC 目录 前言: office插件管理分析: 1.public void startOfficeManager(): 启动Office组件进程 2.public OfficeDo ...

  6. Open-falcon运维监控系统——微信接口二次开发

    1.Open-falcon运维监控系统简介 OpenFalcon是一款由小米运维团队从互联网公司的需求出发, 根据多年的运维经验,结合市面上使用的一些运维监控系统的使用经验和反馈,开发的一套企业级.高 ...

  7. java读取rvt文件数据_Revit二次开发之隐藏API 独立进程读取rvt文件

    在项目中需要读取rvt文件,但是因为该格式为非公开格式,其数据需要revit的支持,但批量读取不可能一个一个用revit软件去打开.不过该方法还是需要revit的依赖,速度比开软件快了知道多少 1.1 ...

  8. 利用comtypes.client批处理dwg文件(AutoCAD二次开发Python)

    之前利用Python对cad文件进行处理,用的都是pyautocad,不过灵活度感觉不高.看过他的源代码后,发现他是调用comtypes.client对当前dwg文件进行处理的.运行逻辑如下: 以批量 ...

  9. EasyNVR网页Chrome无插件播放摄像机视频功能二次开发之云台控制接口示例代码

    随着多媒体技术和网络通信技术的迅速发展,视频监控技术在电力系统.电信行业.工业监控.工地.城市交通.水利系统.社区安防等领域得到越来越广泛的应用.摄像头直播视频监控通过网络直接连接,可达到的世界任何角 ...

最新文章

  1. C++11可变模版参数的妙用+ 认真分析mmap:是什么 为什么 怎么用
  2. 黄海广博士的机器学习个人笔记及深度学习笔记
  3. String与Date转换
  4. 【转】IOS制作静态库
  5. 未名湖边的烦恼-蓝桥杯算法训练题-递推/递归
  6. css制作tips提示框,气泡框,制作三角形
  7. 双系统下如何切换到ubantu界面及如何切换到windows界面
  8. qq微信淘宝京东自动转链转发机器人MkStone京东淘宝转链助手
  9. android手机计步器开发,超精准的Android手机计步器开发
  10. java和vue实现拖拽可视化_可视化拖拽页面编辑器 一__Vue.js
  11. Transformer模型简介
  12. selenium+python 登陆126邮箱
  13. Mac 显示/不显示隐藏文件
  14. 在2003服务器上预览时出现:您未被授权查看该页 您不具备使用所提供的凭据查看该目录或页的权限
  15. 电动汽车的新问题,保险公司赔不起,车主养不起
  16. Sql Server 里的向上取整、向下取整、四舍五入取整的实例!
  17. SQL Server 2017 安装必备
  18. MapReduce模型过程详解
  19. unittest---unittest中verbosity参数设置
  20. 分享35个ASP源码,总有一款适合您

热门文章

  1. AD9851电路设计
  2. Java程序员从阿里、百度面试回来,这些面试题你们会吗?(文末福利)
  3. 【一、vxWorks6.9】
  4. 半导体封装设备行业挤入一位国产选手:已实现数百台IC球焊机出货量,居国产首位,世界一流...
  5. 讨巧的站点简体/繁体中文切换方法
  6. 555定时器构成的多谐振荡器波形_20160102
  7. Window10家庭版启用远程桌面-RDPWrapper强制开启win10远程桌面
  8. python中魔法函数_Python魔法函数
  9. C语言课程设计——家庭财务管理系统源码
  10. 《Photoshop Lightroom4 经典教程》—第1课1.1节了解Lightroom的工作方式