李勇

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

此 diff 太大无法显示。
... ... @@ -26,7 +26,7 @@ import ArrayBufferUtil from 'libs/ArrayBufferUtil';
import UTF8 from 'utf-8';
let loger = Loger.getLoger('MessageEntrance');
let _sdkInfo = {"version": "v.1.8.19.20170411", "author": "www.3mang.com"};
let _sdkInfo = {"version": "v.1.8.22.20170411", "author": "www.3mang.com"};
//APE
let _sass;
... ... @@ -251,6 +251,9 @@ export default class MessageEntrance extends Emiter {
if(_doc_ape){
_doc_ape.updaterRecordStatus();
}
if(_whiteboard_ape){
_whiteboard_ape.updaterRecordStatus();
}
}
//有人员离开
... ...
... ... @@ -220,6 +220,14 @@ class DocApe extends Ape {
});
}
}
//清除当前文档模块的数据
clearData(){
loger.log("clearData->")
this.docList={};
GlobalConfig.activeDocId=0;
GlobalConfig.activeDocCurPage=1;
}
//切换文档
documentSwitchDoc(paramInfo) {
loger.log('切换文档->', paramInfo);
... ... @@ -366,14 +374,6 @@ class DocApe extends Ape {
this.sendUniform(adapterPdu, true);
}
//清除当前文档模块的数据
clearData(){
loger.log("clearData->")
this.docList={};
GlobalConfig.activeDocId=0;
GlobalConfig.activeDocCurPage=1;
}
/////收到消息处理/////////////////////////////////////////////////////////////////////////////////
tableInsertHandler(owner, itemIdx, itemData) {
/* let itemDataInfo = this.unPackPdu(owner, itemIdx, itemData);
... ... @@ -546,29 +546,6 @@ class DocApe extends Ape {
this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG);
return null;
}
/* message RCDocSendDataModelPdu {
required uint32 item_idx=1;//唯一标识
required uint32 owner=2;
optional uint32 from=3;
optional uint32 cur_page_no=4;
optional uint32 page_num =5;
optional string file_type=6;
optional string creat_user_id=7;//创建文档userid
optional string relative_url=8;//文档相对地址
optional string url =9;//文档地址
optional uint32 cur_V=10;
optional uint32 cur_H=11;
optional uint32 scale=12;
optional bool visible=13;
optional uint32 action=14;//0,无操作, 1翻页 /缩放/滚动、2.显示/隐藏
optional string doc_id=15;//文档在服务器数据库中的唯一id
optional string file_name=16;//文档的名字
optional string dynamic_TS=17;//"dynamicTransferStatic": "0"
optional string md5=18;//md5
optional uint32 show_type=19;//显示模式
}*/
//判断type类型,根据type设置不同的参数
let docModelPdu = new pdu['RCDocSendDataModelPdu'];
docModelPdu.itemIdx = _itemIdx;
... ...
... ... @@ -64,6 +64,25 @@ class WhiteBoardApe extends Ape {
this.annoInfos = {};//储存所有的标注数据
this.insertHistory = [];//添加的白板记录,用于撤回操作
}
//更新文档模块的录制信息,每次开启录制的时候需要把当前文档的信息更新一次
updaterRecordStatus(_param){
if(GlobalConfig.isHost&&!GlobalConfig.isRecordPlayBack){
let curPageAnnos={};
for (let key in this.annoInfos) {
let item = this.annoInfos[key];
if (item && item.parentId == GlobalConfig.activeDocId && item.curPageNo == GlobalConfig.activeDocCurPage) {
curPageAnnos[key]=item;
}
}
if(Object.keys(curPageAnnos).length>0){
loger.log("开启录制成功->更新当前的标注数据->docId:", GlobalConfig.activeDocId, 'page:',GlobalConfig.activeDocCurPage);
this.sendUpdaterAnnotaion({"itemIdxArr":curPageAnnos});
}else {
loger.log("开启录制成功->当前没有标注数据需要更新->docId:", GlobalConfig.activeDocId, 'page:',GlobalConfig.activeDocCurPage);
}
}
}
/////////////发送数据操作//////////////////////////////////////////////////////
// 添加标注,发送信息
sendInsetAnnotaion(_param) {
... ... @@ -215,51 +234,51 @@ class WhiteBoardApe extends Ape {
//更新标注
sendUpdaterAnnotaion(_param) {
if (_param == null || EngineUtils.isEmptyObject(_param)) {
loger.log('sendUpdaterAnnotaion失败,参数错误');
if (_param == null ||_param.itemIdxArr==null) {
loger.log('更新标注数据->失败->参数错误');
this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG);
return;
}
itemIdx = _param.itemIdx;
let whiteBoardModelPdu = this.packPdu(_param, itemIdx);
if (whiteBoardModelPdu == null) {
loger.log('sendInsetAnnotaion失败,参数错误');
this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG);
return;
}
let tableItemPdu = new pdu['RCRegistryTableItemPdu'];
tableItemPdu.itemIdx = itemIdx;
tableItemPdu.owner = 0;//收到flash的是这个值,不清楚先写固定
tableItemPdu.registerObjId = ApeConsts.WHITEBOARD_OBJ_TABLE_ID;
tableItemPdu.itemData = whiteBoardModelPdu.toArrayBuffer();
//updater
let whiteBoardUpdateItem = new pdu['RCRegistryTableUpdateItemPdu'];
//optional RCPduType_E type = 1 [default = RCPDU_REG_TABLE_UPDATE_PDU];
//repeated RCRegistryTableItemPdu items = 2;
whiteBoardUpdateItem.type = pdu.RCPDU_REG_TABLE_UPDATE_PDU;//
whiteBoardUpdateItem.items.push(tableItemPdu);
let updateObjPdu = new pdu['RCRegistryUpdateObjPdu'];
updateObjPdu.objId = ApeConsts.WHITEBOARD_OBJ_TABLE_ID;
updateObjPdu.subType = whiteBoardUpdateItem.type;
updateObjPdu.userData = whiteBoardUpdateItem.toArrayBuffer();
//同步
let adapterItemPdu = new pdu['RCAdapterItemPdu'];
adapterItemPdu.type = pdu.RCPDU_REG_UPDATE_OBJ;
adapterItemPdu.itemData = updateObjPdu.toArrayBuffer();
let adapterPdu = new pdu['RCAdapterPdu'];
adapterPdu.type = pdu.RCPDU_REG_ADAPTER;
adapterPdu.item.push(adapterItemPdu);
for (let key in _param.itemIdxArr) {
let itemIdx =parseInt(key);
let item= _param.itemIdxArr[key];
let whiteBoardModelPdu = this.packPdu(item, itemIdx);
if (whiteBoardModelPdu == null) {
loger.log('更新标注数据->失败->数据无效');
this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG);
continue;
}
let tableItemPdu = new pdu['RCRegistryTableItemPdu'];
tableItemPdu.itemIdx = itemIdx;
tableItemPdu.owner = 0;//收到flash的是这个值,不清楚先写固定
tableItemPdu.registerObjId = ApeConsts.WHITEBOARD_OBJ_TABLE_ID;
tableItemPdu.itemData = whiteBoardModelPdu.toArrayBuffer();
loger.log("白板发送更新数据===============22");
this.sendUniform(adapterPdu, true);
//updater
let whiteBoardUpdateItem = new pdu['RCRegistryTableUpdateItemPdu'];
whiteBoardUpdateItem.type = pdu.RCPDU_REG_TABLE_UPDATE_PDU;//
whiteBoardUpdateItem.items.push(tableItemPdu);
let updateObjPdu = new pdu['RCRegistryUpdateObjPdu'];
updateObjPdu.objId = ApeConsts.WHITEBOARD_OBJ_TABLE_ID;
updateObjPdu.subType = whiteBoardUpdateItem.type;
updateObjPdu.userData = whiteBoardUpdateItem.toArrayBuffer();
//同步
let adapterItemPdu = new pdu['RCAdapterItemPdu'];
adapterItemPdu.type = pdu.RCPDU_REG_UPDATE_OBJ;
adapterItemPdu.itemData = updateObjPdu.toArrayBuffer();
adapterPdu.item.push(adapterItemPdu);
}
let len=adapterPdu.item.length
if(len>0){
loger.log("更新标注数据->发送数量->",adapterPdu.item.length);
this.sendUniform(adapterPdu, true);
}else {
loger.log("更新标注数据->没有可更新的数据");
}
}
/////收到消息处理/////////////////////////////////////////////////////////////////////////////////
... ... @@ -287,7 +306,7 @@ class WhiteBoardApe extends Ape {
tableUpdateApeHandler(_tableUpdateItems,_seekTime){
let tableUpdateItemsLen = _tableUpdateItems.length;
loger.log('tableUpdateApeHandler',"activeDocId->",GlobalConfig.activeDocId ,"tableUpdateItemsLen->", tableUpdateItemsLen);
loger.log('白板标注更新->',"activeDocId->",GlobalConfig.activeDocId ,"数量->", tableUpdateItemsLen);
for (let i = 0; i < tableUpdateItemsLen; ++i) {
let tableItem = _tableUpdateItems[i];
let whiteBoardModel = this.unPackPdu(tableItem.owner, tableItem.itemIdx, tableItem.itemData);
... ... @@ -297,7 +316,7 @@ class WhiteBoardApe extends Ape {
tableDeleteHandler(object_id, tableDeleteData) {
// console.log("白板收到数据,tableDeleteHandler object_id="+object_id);//((18<< 16) + 1)=1179649
loger.log('tableDeleteHandler', object_id, tableDeleteData);//["tableDeleteHandler",1179649,{"type":231,"itemIdx":[1486301768]}]
loger.log('删除白板数据->', object_id, tableDeleteData);//["tableDeleteHandler",1179649,{"type":231,"itemIdx":[1486301768]}]
if (tableDeleteData && tableDeleteData.itemIdx) {
let len = tableDeleteData.itemIdx.length;
let itemIdxs = tableDeleteData.itemIdx;
... ... @@ -313,7 +332,7 @@ class WhiteBoardApe extends Ape {
//文档更新,白板也要更新
docUpdateHandler(_data) {
loger.log("白板收到文档更新的消息docUpdateHandler");
loger.log("白板收到文档更新的消息");
//loger.log(_data);
//如果切换了文档或翻页,清除之前的添加步骤记录
... ... @@ -325,11 +344,11 @@ class WhiteBoardApe extends Ape {
//删除白板数据
docDeleteHandler(_parentId) {
loger.log("白板收到文档删除的消息docDeleteHandler", _parentId);
loger.log("白板收到文档删除的消息->", _parentId);
for (let key in this.annoInfos) {
let item = this.annoInfos[key];
if (item && item.parentId == _parentId) {
loger.log("文档删除白板数据也删除,itemIdx:" + key, "_parentId:", _parentId);
loger.log("文档删除->白板数据也删除,itemIdx:" + key, "_parentId:", _parentId);
this.sendDeleteAnnotaion({"itemIdx": key});
}
}
... ... @@ -418,14 +437,14 @@ class WhiteBoardApe extends Ape {
unPackPdu(owner, itemIdx, itemData) {
try {
loger.log("白板收到数据===unPackPdu ");
loger.log("白板标注数据->unPackPdu");
let whiteBoardModelPdu = pdu['RCWhiteBoardDataModelPdu'].decode(itemData);
let _pointGroup = EngineUtils.arrayFromJsonString(whiteBoardModelPdu.pointGroup);
whiteBoardModelPdu.pointGroup = _pointGroup;
this.annoInfos[itemIdx] = whiteBoardModelPdu;
return whiteBoardModelPdu;
} catch (err) {
loger.log("unPackPdu Pdu解析错误,itemIdx=" + itemIdx + " err:" + err.message);
loger.log("白板标注数据->unPackPdu->Pdu解析错误,itemIdx=" + itemIdx + " err:" + err.message);
}
return null;
}
... ...