李勇

v.1.8.22.20170411 开始录制的时候,文档模块和白板标注模块增加对当前显示的数据进行录制,解决录制中缺少内容的问题

此 diff 太大无法显示。
@@ -26,7 +26,7 @@ import ArrayBufferUtil from 'libs/ArrayBufferUtil'; @@ -26,7 +26,7 @@ import ArrayBufferUtil from 'libs/ArrayBufferUtil';
26 import UTF8 from 'utf-8'; 26 import UTF8 from 'utf-8';
27 27
28 let loger = Loger.getLoger('MessageEntrance'); 28 let loger = Loger.getLoger('MessageEntrance');
29 -let _sdkInfo = {"version": "v.1.8.19.20170411", "author": "www.3mang.com"}; 29 +let _sdkInfo = {"version": "v.1.8.22.20170411", "author": "www.3mang.com"};
30 30
31 //APE 31 //APE
32 let _sass; 32 let _sass;
@@ -251,6 +251,9 @@ export default class MessageEntrance extends Emiter { @@ -251,6 +251,9 @@ export default class MessageEntrance extends Emiter {
251 if(_doc_ape){ 251 if(_doc_ape){
252 _doc_ape.updaterRecordStatus(); 252 _doc_ape.updaterRecordStatus();
253 } 253 }
  254 + if(_whiteboard_ape){
  255 + _whiteboard_ape.updaterRecordStatus();
  256 + }
254 } 257 }
255 258
256 //有人员离开 259 //有人员离开
@@ -220,6 +220,14 @@ class DocApe extends Ape { @@ -220,6 +220,14 @@ class DocApe extends Ape {
220 }); 220 });
221 } 221 }
222 } 222 }
  223 + //清除当前文档模块的数据
  224 + clearData(){
  225 + loger.log("clearData->")
  226 + this.docList={};
  227 + GlobalConfig.activeDocId=0;
  228 + GlobalConfig.activeDocCurPage=1;
  229 +
  230 + }
223 //切换文档 231 //切换文档
224 documentSwitchDoc(paramInfo) { 232 documentSwitchDoc(paramInfo) {
225 loger.log('切换文档->', paramInfo); 233 loger.log('切换文档->', paramInfo);
@@ -366,14 +374,6 @@ class DocApe extends Ape { @@ -366,14 +374,6 @@ class DocApe extends Ape {
366 this.sendUniform(adapterPdu, true); 374 this.sendUniform(adapterPdu, true);
367 } 375 }
368 376
369 - //清除当前文档模块的数据  
370 - clearData(){  
371 - loger.log("clearData->")  
372 - this.docList={};  
373 - GlobalConfig.activeDocId=0;  
374 - GlobalConfig.activeDocCurPage=1;  
375 -  
376 - }  
377 /////收到消息处理///////////////////////////////////////////////////////////////////////////////// 377 /////收到消息处理/////////////////////////////////////////////////////////////////////////////////
378 tableInsertHandler(owner, itemIdx, itemData) { 378 tableInsertHandler(owner, itemIdx, itemData) {
379 /* let itemDataInfo = this.unPackPdu(owner, itemIdx, itemData); 379 /* let itemDataInfo = this.unPackPdu(owner, itemIdx, itemData);
@@ -546,29 +546,6 @@ class DocApe extends Ape { @@ -546,29 +546,6 @@ class DocApe extends Ape {
546 this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); 546 this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG);
547 return null; 547 return null;
548 } 548 }
549 -  
550 - /* message RCDocSendDataModelPdu {  
551 - required uint32 item_idx=1;//唯一标识  
552 - required uint32 owner=2;  
553 - optional uint32 from=3;  
554 - optional uint32 cur_page_no=4;  
555 - optional uint32 page_num =5;  
556 - optional string file_type=6;  
557 - optional string creat_user_id=7;//创建文档userid  
558 - optional string relative_url=8;//文档相对地址  
559 - optional string url =9;//文档地址  
560 - optional uint32 cur_V=10;  
561 - optional uint32 cur_H=11;  
562 - optional uint32 scale=12;  
563 - optional bool visible=13;  
564 - optional uint32 action=14;//0,无操作, 1翻页 /缩放/滚动、2.显示/隐藏  
565 - optional string doc_id=15;//文档在服务器数据库中的唯一id  
566 - optional string file_name=16;//文档的名字  
567 - optional string dynamic_TS=17;//"dynamicTransferStatic": "0"  
568 - optional string md5=18;//md5  
569 - optional uint32 show_type=19;//显示模式  
570 - }*/  
571 -  
572 //判断type类型,根据type设置不同的参数 549 //判断type类型,根据type设置不同的参数
573 let docModelPdu = new pdu['RCDocSendDataModelPdu']; 550 let docModelPdu = new pdu['RCDocSendDataModelPdu'];
574 docModelPdu.itemIdx = _itemIdx; 551 docModelPdu.itemIdx = _itemIdx;
@@ -64,6 +64,25 @@ class WhiteBoardApe extends Ape { @@ -64,6 +64,25 @@ class WhiteBoardApe extends Ape {
64 this.annoInfos = {};//储存所有的标注数据 64 this.annoInfos = {};//储存所有的标注数据
65 this.insertHistory = [];//添加的白板记录,用于撤回操作 65 this.insertHistory = [];//添加的白板记录,用于撤回操作
66 } 66 }
  67 + //更新文档模块的录制信息,每次开启录制的时候需要把当前文档的信息更新一次
  68 + updaterRecordStatus(_param){
  69 + if(GlobalConfig.isHost&&!GlobalConfig.isRecordPlayBack){
  70 + let curPageAnnos={};
  71 + for (let key in this.annoInfos) {
  72 + let item = this.annoInfos[key];
  73 + if (item && item.parentId == GlobalConfig.activeDocId && item.curPageNo == GlobalConfig.activeDocCurPage) {
  74 + curPageAnnos[key]=item;
  75 + }
  76 + }
  77 + if(Object.keys(curPageAnnos).length>0){
  78 + loger.log("开启录制成功->更新当前的标注数据->docId:", GlobalConfig.activeDocId, 'page:',GlobalConfig.activeDocCurPage);
  79 + this.sendUpdaterAnnotaion({"itemIdxArr":curPageAnnos});
  80 + }else {
  81 + loger.log("开启录制成功->当前没有标注数据需要更新->docId:", GlobalConfig.activeDocId, 'page:',GlobalConfig.activeDocCurPage);
  82 + }
  83 + }
  84 + }
  85 +
67 /////////////发送数据操作////////////////////////////////////////////////////// 86 /////////////发送数据操作//////////////////////////////////////////////////////
68 // 添加标注,发送信息 87 // 添加标注,发送信息
69 sendInsetAnnotaion(_param) { 88 sendInsetAnnotaion(_param) {
@@ -215,35 +234,33 @@ class WhiteBoardApe extends Ape { @@ -215,35 +234,33 @@ class WhiteBoardApe extends Ape {
215 234
216 //更新标注 235 //更新标注
217 sendUpdaterAnnotaion(_param) { 236 sendUpdaterAnnotaion(_param) {
218 - if (_param == null || EngineUtils.isEmptyObject(_param)) {  
219 - loger.log('sendUpdaterAnnotaion失败,参数错误'); 237 + if (_param == null ||_param.itemIdxArr==null) {
  238 + loger.log('更新标注数据->失败->参数错误');
220 this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); 239 this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG);
221 return; 240 return;
222 } 241 }
223 - itemIdx = _param.itemIdx;  
224 - let whiteBoardModelPdu = this.packPdu(_param, itemIdx);  
225 - 242 + let adapterPdu = new pdu['RCAdapterPdu'];
  243 + adapterPdu.type = pdu.RCPDU_REG_ADAPTER;
  244 + for (let key in _param.itemIdxArr) {
  245 + let itemIdx =parseInt(key);
  246 + let item= _param.itemIdxArr[key];
  247 + let whiteBoardModelPdu = this.packPdu(item, itemIdx);
226 if (whiteBoardModelPdu == null) { 248 if (whiteBoardModelPdu == null) {
227 - loger.log('sendInsetAnnotaion失败,参数错误'); 249 + loger.log('更新标注数据->失败->数据无效');
228 this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); 250 this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG);
229 - return; 251 + continue;
230 } 252 }
231 -  
232 let tableItemPdu = new pdu['RCRegistryTableItemPdu']; 253 let tableItemPdu = new pdu['RCRegistryTableItemPdu'];
233 tableItemPdu.itemIdx = itemIdx; 254 tableItemPdu.itemIdx = itemIdx;
234 tableItemPdu.owner = 0;//收到flash的是这个值,不清楚先写固定 255 tableItemPdu.owner = 0;//收到flash的是这个值,不清楚先写固定
235 tableItemPdu.registerObjId = ApeConsts.WHITEBOARD_OBJ_TABLE_ID; 256 tableItemPdu.registerObjId = ApeConsts.WHITEBOARD_OBJ_TABLE_ID;
236 tableItemPdu.itemData = whiteBoardModelPdu.toArrayBuffer(); 257 tableItemPdu.itemData = whiteBoardModelPdu.toArrayBuffer();
237 258
238 -  
239 //updater 259 //updater
240 let whiteBoardUpdateItem = new pdu['RCRegistryTableUpdateItemPdu']; 260 let whiteBoardUpdateItem = new pdu['RCRegistryTableUpdateItemPdu'];
241 - //optional RCPduType_E type = 1 [default = RCPDU_REG_TABLE_UPDATE_PDU];  
242 - //repeated RCRegistryTableItemPdu items = 2;  
243 whiteBoardUpdateItem.type = pdu.RCPDU_REG_TABLE_UPDATE_PDU;// 261 whiteBoardUpdateItem.type = pdu.RCPDU_REG_TABLE_UPDATE_PDU;//
244 whiteBoardUpdateItem.items.push(tableItemPdu); 262 whiteBoardUpdateItem.items.push(tableItemPdu);
245 263
246 -  
247 let updateObjPdu = new pdu['RCRegistryUpdateObjPdu']; 264 let updateObjPdu = new pdu['RCRegistryUpdateObjPdu'];
248 updateObjPdu.objId = ApeConsts.WHITEBOARD_OBJ_TABLE_ID; 265 updateObjPdu.objId = ApeConsts.WHITEBOARD_OBJ_TABLE_ID;
249 updateObjPdu.subType = whiteBoardUpdateItem.type; 266 updateObjPdu.subType = whiteBoardUpdateItem.type;
@@ -253,13 +270,15 @@ class WhiteBoardApe extends Ape { @@ -253,13 +270,15 @@ class WhiteBoardApe extends Ape {
253 let adapterItemPdu = new pdu['RCAdapterItemPdu']; 270 let adapterItemPdu = new pdu['RCAdapterItemPdu'];
254 adapterItemPdu.type = pdu.RCPDU_REG_UPDATE_OBJ; 271 adapterItemPdu.type = pdu.RCPDU_REG_UPDATE_OBJ;
255 adapterItemPdu.itemData = updateObjPdu.toArrayBuffer(); 272 adapterItemPdu.itemData = updateObjPdu.toArrayBuffer();
256 -  
257 - let adapterPdu = new pdu['RCAdapterPdu'];  
258 - adapterPdu.type = pdu.RCPDU_REG_ADAPTER;  
259 adapterPdu.item.push(adapterItemPdu); 273 adapterPdu.item.push(adapterItemPdu);
260 -  
261 - loger.log("白板发送更新数据===============22"); 274 + }
  275 + let len=adapterPdu.item.length
  276 + if(len>0){
  277 + loger.log("更新标注数据->发送数量->",adapterPdu.item.length);
262 this.sendUniform(adapterPdu, true); 278 this.sendUniform(adapterPdu, true);
  279 + }else {
  280 + loger.log("更新标注数据->没有可更新的数据");
  281 + }
263 } 282 }
264 283
265 /////收到消息处理///////////////////////////////////////////////////////////////////////////////// 284 /////收到消息处理/////////////////////////////////////////////////////////////////////////////////
@@ -287,7 +306,7 @@ class WhiteBoardApe extends Ape { @@ -287,7 +306,7 @@ class WhiteBoardApe extends Ape {
287 306
288 tableUpdateApeHandler(_tableUpdateItems,_seekTime){ 307 tableUpdateApeHandler(_tableUpdateItems,_seekTime){
289 let tableUpdateItemsLen = _tableUpdateItems.length; 308 let tableUpdateItemsLen = _tableUpdateItems.length;
290 - loger.log('tableUpdateApeHandler',"activeDocId->",GlobalConfig.activeDocId ,"tableUpdateItemsLen->", tableUpdateItemsLen); 309 + loger.log('白板标注更新->',"activeDocId->",GlobalConfig.activeDocId ,"数量->", tableUpdateItemsLen);
291 for (let i = 0; i < tableUpdateItemsLen; ++i) { 310 for (let i = 0; i < tableUpdateItemsLen; ++i) {
292 let tableItem = _tableUpdateItems[i]; 311 let tableItem = _tableUpdateItems[i];
293 let whiteBoardModel = this.unPackPdu(tableItem.owner, tableItem.itemIdx, tableItem.itemData); 312 let whiteBoardModel = this.unPackPdu(tableItem.owner, tableItem.itemIdx, tableItem.itemData);
@@ -297,7 +316,7 @@ class WhiteBoardApe extends Ape { @@ -297,7 +316,7 @@ class WhiteBoardApe extends Ape {
297 316
298 tableDeleteHandler(object_id, tableDeleteData) { 317 tableDeleteHandler(object_id, tableDeleteData) {
299 // console.log("白板收到数据,tableDeleteHandler object_id="+object_id);//((18<< 16) + 1)=1179649 318 // console.log("白板收到数据,tableDeleteHandler object_id="+object_id);//((18<< 16) + 1)=1179649
300 - loger.log('tableDeleteHandler', object_id, tableDeleteData);//["tableDeleteHandler",1179649,{"type":231,"itemIdx":[1486301768]}] 319 + loger.log('删除白板数据->', object_id, tableDeleteData);//["tableDeleteHandler",1179649,{"type":231,"itemIdx":[1486301768]}]
301 if (tableDeleteData && tableDeleteData.itemIdx) { 320 if (tableDeleteData && tableDeleteData.itemIdx) {
302 let len = tableDeleteData.itemIdx.length; 321 let len = tableDeleteData.itemIdx.length;
303 let itemIdxs = tableDeleteData.itemIdx; 322 let itemIdxs = tableDeleteData.itemIdx;
@@ -313,7 +332,7 @@ class WhiteBoardApe extends Ape { @@ -313,7 +332,7 @@ class WhiteBoardApe extends Ape {
313 332
314 //文档更新,白板也要更新 333 //文档更新,白板也要更新
315 docUpdateHandler(_data) { 334 docUpdateHandler(_data) {
316 - loger.log("白板收到文档更新的消息docUpdateHandler"); 335 + loger.log("白板收到文档更新的消息");
317 //loger.log(_data); 336 //loger.log(_data);
318 337
319 //如果切换了文档或翻页,清除之前的添加步骤记录 338 //如果切换了文档或翻页,清除之前的添加步骤记录
@@ -325,11 +344,11 @@ class WhiteBoardApe extends Ape { @@ -325,11 +344,11 @@ class WhiteBoardApe extends Ape {
325 344
326 //删除白板数据 345 //删除白板数据
327 docDeleteHandler(_parentId) { 346 docDeleteHandler(_parentId) {
328 - loger.log("白板收到文档删除的消息docDeleteHandler", _parentId); 347 + loger.log("白板收到文档删除的消息->", _parentId);
329 for (let key in this.annoInfos) { 348 for (let key in this.annoInfos) {
330 let item = this.annoInfos[key]; 349 let item = this.annoInfos[key];
331 if (item && item.parentId == _parentId) { 350 if (item && item.parentId == _parentId) {
332 - loger.log("文档删除白板数据也删除,itemIdx:" + key, "_parentId:", _parentId); 351 + loger.log("文档删除->白板数据也删除,itemIdx:" + key, "_parentId:", _parentId);
333 this.sendDeleteAnnotaion({"itemIdx": key}); 352 this.sendDeleteAnnotaion({"itemIdx": key});
334 } 353 }
335 } 354 }
@@ -418,14 +437,14 @@ class WhiteBoardApe extends Ape { @@ -418,14 +437,14 @@ class WhiteBoardApe extends Ape {
418 437
419 unPackPdu(owner, itemIdx, itemData) { 438 unPackPdu(owner, itemIdx, itemData) {
420 try { 439 try {
421 - loger.log("白板收到数据===unPackPdu "); 440 + loger.log("白板标注数据->unPackPdu");
422 let whiteBoardModelPdu = pdu['RCWhiteBoardDataModelPdu'].decode(itemData); 441 let whiteBoardModelPdu = pdu['RCWhiteBoardDataModelPdu'].decode(itemData);
423 let _pointGroup = EngineUtils.arrayFromJsonString(whiteBoardModelPdu.pointGroup); 442 let _pointGroup = EngineUtils.arrayFromJsonString(whiteBoardModelPdu.pointGroup);
424 whiteBoardModelPdu.pointGroup = _pointGroup; 443 whiteBoardModelPdu.pointGroup = _pointGroup;
425 this.annoInfos[itemIdx] = whiteBoardModelPdu; 444 this.annoInfos[itemIdx] = whiteBoardModelPdu;
426 return whiteBoardModelPdu; 445 return whiteBoardModelPdu;
427 } catch (err) { 446 } catch (err) {
428 - loger.log("unPackPdu Pdu解析错误,itemIdx=" + itemIdx + " err:" + err.message); 447 + loger.log("白板标注数据->unPackPdu->Pdu解析错误,itemIdx=" + itemIdx + " err:" + err.message);
429 } 448 }
430 return null; 449 return null;
431 } 450 }