1.开启录制的时候,增加对当前显示的文档数据记录,解决录制文件中内容缺少的问题
2.录制回放时在seek的时候,增加对SDK中当前文档和白板标注模块数据的清除
正在显示
8 个修改的文件
包含
100 行增加
和
58 行删除
此 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.16.20170410", "author": "www.3mang.com"}; | 29 | +let _sdkInfo = {"version": "v.1.8.19.20170411", "author": "www.3mang.com"}; |
| 30 | 30 | ||
| 31 | //APE | 31 | //APE |
| 32 | let _sass; | 32 | let _sass; |
| @@ -38,7 +38,7 @@ let _video_ape; | @@ -38,7 +38,7 @@ let _video_ape; | ||
| 38 | let _audio_ape; | 38 | let _audio_ape; |
| 39 | let _doc_ape; | 39 | let _doc_ape; |
| 40 | let _whiteboard_ape; | 40 | let _whiteboard_ape; |
| 41 | -let _parseBuf; | 41 | +let _recordPlayback; |
| 42 | 42 | ||
| 43 | //MCUClient 外部实例化主类 | 43 | //MCUClient 外部实例化主类 |
| 44 | export default class MessageEntrance extends Emiter { | 44 | export default class MessageEntrance extends Emiter { |
| @@ -77,9 +77,10 @@ export default class MessageEntrance extends Emiter { | @@ -77,9 +77,10 @@ export default class MessageEntrance extends Emiter { | ||
| 77 | _mcu.on(MessageTypes.CLASS_JOIN_MCU_SUCCESS, this._mcuJoinMCUClassSuccessHandler.bind(this));//加入MCU课堂完成 | 77 | _mcu.on(MessageTypes.CLASS_JOIN_MCU_SUCCESS, this._mcuJoinMCUClassSuccessHandler.bind(this));//加入MCU课堂完成 |
| 78 | 78 | ||
| 79 | //录制回放 | 79 | //录制回放 |
| 80 | - _parseBuf = RecordPlayBackParse; | ||
| 81 | - _parseBuf.on('*', (type, data) => this._emit(type, data)); | ||
| 82 | - _parseBuf.on(RecordPlayBackParse.CLASS_JOIN_RECORD_PLAYBACK_SUCCESS, this._joinRecordPlaybackSuccessHandler.bind(this));//加入录制回放完成 | 80 | + _recordPlayback = RecordPlayBackParse; |
| 81 | + _recordPlayback.on('*', (type, data) => this._emit(type, data)); | ||
| 82 | + _recordPlayback.on(RecordPlayBackParse.CLASS_JOIN_RECORD_PLAYBACK_SUCCESS, this._joinRecordPlaybackSuccessHandler.bind(this));//加入录制回放完成 | ||
| 83 | + _recordPlayback.on(RecordPlayBackParse.RECORD_PLAYBACK_CLEAR_DATA, this._recordPlaybackClearDataHandler.bind(this));//录制回放状态更新 | ||
| 83 | 84 | ||
| 84 | 85 | ||
| 85 | // 注册所有应用Ape | 86 | // 注册所有应用Ape |
| @@ -90,7 +91,7 @@ export default class MessageEntrance extends Emiter { | @@ -90,7 +91,7 @@ export default class MessageEntrance extends Emiter { | ||
| 90 | _confer_ape.on(MessageTypes.CLASS_DELETE_ROSTER, this._onClassDeleteRoster.bind(this));//当前课堂人员离开 | 91 | _confer_ape.on(MessageTypes.CLASS_DELETE_ROSTER, this._onClassDeleteRoster.bind(this));//当前课堂人员离开 |
| 91 | _confer_ape.on(MessageTypes.CLASS_NONENTITY_ROSTER, this._onClassNonentityRoster.bind(this));//当前课堂中视频或音频占用channel的nodeId ,在人员列表中不存在 | 92 | _confer_ape.on(MessageTypes.CLASS_NONENTITY_ROSTER, this._onClassNonentityRoster.bind(this));//当前课堂中视频或音频占用channel的nodeId ,在人员列表中不存在 |
| 92 | _confer_ape.on(MessageTypes.CLASS_RECORD_START, this._onClassRecordStart.bind(this));//课堂开始录制 | 93 | _confer_ape.on(MessageTypes.CLASS_RECORD_START, this._onClassRecordStart.bind(this));//课堂开始录制 |
| 93 | - | 94 | + _confer_ape.on(MessageTypes.CLASS_RECORD_SUCCESS, this._onClassRecordSuccess.bind(this));//课堂开启录制成功 |
| 94 | 95 | ||
| 95 | _chat_ape = new ChatApe(); | 96 | _chat_ape = new ChatApe(); |
| 96 | _chat_ape.on('*', (type, data) => this._emit(type, data)); | 97 | _chat_ape.on('*', (type, data) => this._emit(type, data)); |
| @@ -245,7 +246,12 @@ export default class MessageEntrance extends Emiter { | @@ -245,7 +246,12 @@ export default class MessageEntrance extends Emiter { | ||
| 245 | _sass.saveClassRecordContrlInfo(_param); | 246 | _sass.saveClassRecordContrlInfo(_param); |
| 246 | } | 247 | } |
| 247 | } | 248 | } |
| 248 | - | 249 | + //开启录制成功 |
| 250 | + _onClassRecordSuccess(_param){ | ||
| 251 | + if(_doc_ape){ | ||
| 252 | + _doc_ape.updaterRecordStatus(); | ||
| 253 | + } | ||
| 254 | + } | ||
| 249 | 255 | ||
| 250 | //有人员离开 | 256 | //有人员离开 |
| 251 | _onClassDeleteRoster(_data) { | 257 | _onClassDeleteRoster(_data) { |
| @@ -513,10 +519,10 @@ export default class MessageEntrance extends Emiter { | @@ -513,10 +519,10 @@ export default class MessageEntrance extends Emiter { | ||
| 513 | 519 | ||
| 514 | //录制回放不需要选点 | 520 | //录制回放不需要选点 |
| 515 | if(GlobalConfig.isRecordPlayBack){ | 521 | if(GlobalConfig.isRecordPlayBack){ |
| 516 | - if (_parseBuf) { | 522 | + if (_recordPlayback) { |
| 517 | //开启录制回放流程 | 523 | //开启录制回放流程 |
| 518 | loger.log("开启录制回放流程"); | 524 | loger.log("开启录制回放流程"); |
| 519 | - _parseBuf.readyRecordPlay(); | 525 | + _recordPlayback.readyRecordPlay(); |
| 520 | }else { | 526 | }else { |
| 521 | loger.warn("开启录制回放流程失败,还未创建模块"); | 527 | loger.warn("开启录制回放流程失败,还未创建模块"); |
| 522 | } | 528 | } |
| @@ -1082,29 +1088,39 @@ export default class MessageEntrance extends Emiter { | @@ -1082,29 +1088,39 @@ export default class MessageEntrance extends Emiter { | ||
| 1082 | 1088 | ||
| 1083 | //开始录制回放 | 1089 | //开始录制回放 |
| 1084 | _startRecordPlayback(_param) { | 1090 | _startRecordPlayback(_param) { |
| 1085 | - if (_parseBuf) { | ||
| 1086 | - _parseBuf.startRecordPlayback(_param); | 1091 | + if (_recordPlayback) { |
| 1092 | + _recordPlayback.startRecordPlayback(_param); | ||
| 1087 | } | 1093 | } |
| 1088 | } | 1094 | } |
| 1089 | //停止录制回放 | 1095 | //停止录制回放 |
| 1090 | _stopRecordPlayback(_param) { | 1096 | _stopRecordPlayback(_param) { |
| 1091 | - if (_parseBuf) { | ||
| 1092 | - _parseBuf.stopRecordPlayback(_param); | 1097 | + if (_recordPlayback) { |
| 1098 | + _recordPlayback.stopRecordPlayback(_param); | ||
| 1093 | } | 1099 | } |
| 1094 | } | 1100 | } |
| 1095 | //暂停录制回放 | 1101 | //暂停录制回放 |
| 1096 | _pauseRecordPlayback(_param) { | 1102 | _pauseRecordPlayback(_param) { |
| 1097 | - if (_parseBuf) { | ||
| 1098 | - _parseBuf.pauseRecordPlayback(_param); | 1103 | + if (_recordPlayback) { |
| 1104 | + _recordPlayback.pauseRecordPlayback(_param); | ||
| 1099 | } | 1105 | } |
| 1100 | } | 1106 | } |
| 1101 | //seek录制回放 | 1107 | //seek录制回放 |
| 1102 | _seekRecordPlayback(_param) { | 1108 | _seekRecordPlayback(_param) { |
| 1103 | - if (_parseBuf) { | ||
| 1104 | - _parseBuf.seekRecordPlayback(_param); | 1109 | + if (_recordPlayback) { |
| 1110 | + _recordPlayback.seekRecordPlayback(_param); | ||
| 1105 | } | 1111 | } |
| 1106 | } | 1112 | } |
| 1107 | 1113 | ||
| 1114 | + //录制回放状态更新 | ||
| 1115 | + _recordPlaybackClearDataHandler(_param){ | ||
| 1116 | + loger.log("_recordPlaybackClearDataHandler->") | ||
| 1117 | + if(_doc_ape){ | ||
| 1118 | + _doc_ape.clearData(); | ||
| 1119 | + } | ||
| 1120 | + if(_whiteboard_ape){ | ||
| 1121 | + _whiteboard_ape.clearData(); | ||
| 1122 | + } | ||
| 1123 | + } | ||
| 1108 | //录制回放加入 课堂成功 | 1124 | //录制回放加入 课堂成功 |
| 1109 | _joinRecordPlaybackSuccessHandler(_data) { | 1125 | _joinRecordPlaybackSuccessHandler(_data) { |
| 1110 | loger.log('加入录制回放成功.'); | 1126 | loger.log('加入录制回放成功.'); |
| @@ -27,8 +27,8 @@ MessageTypes.CLASS_STATUS_INFO_CHANGE="class_status_info_change";// 'class.statu | @@ -27,8 +27,8 @@ MessageTypes.CLASS_STATUS_INFO_CHANGE="class_status_info_change";// 'class.statu | ||
| 27 | 27 | ||
| 28 | MessageTypes.CLASS_UPDATE_TIMER="class_update_timer";//'class.update.timer';//更新当前上课的时间 | 28 | MessageTypes.CLASS_UPDATE_TIMER="class_update_timer";//'class.update.timer';//更新当前上课的时间 |
| 29 | 29 | ||
| 30 | -MessageTypes.CLASS_RECORD_START="class_record_start";//'class.record.start';//开始录制 | ||
| 31 | - | 30 | +MessageTypes.CLASS_RECORD_START="class_record_start";//;//开始录制 |
| 31 | +MessageTypes.CLASS_RECORD_SUCCESS="class_record_success";////开启录制成功 | ||
| 32 | 32 | ||
| 33 | 33 | ||
| 34 | //聊天模块事件定义 | 34 | //聊天模块事件定义 |
| @@ -357,6 +357,7 @@ class RecordPlayBackParse extends Emiter { | @@ -357,6 +357,7 @@ class RecordPlayBackParse extends Emiter { | ||
| 357 | //把记录的文档信息也要清除 | 357 | //把记录的文档信息也要清除 |
| 358 | GlobalConfig.activeDocId=0; | 358 | GlobalConfig.activeDocId=0; |
| 359 | GlobalConfig.activeDocCurPage=1; | 359 | GlobalConfig.activeDocCurPage=1; |
| 360 | + this._emit(RecordPlayBackParse.RECORD_PLAYBACK_CLEAR_DATA); | ||
| 360 | this._emit(MessageTypes.RECORD_PLAYBACK_UPDATE, {"status": STOP}); | 361 | this._emit(MessageTypes.RECORD_PLAYBACK_UPDATE, {"status": STOP}); |
| 361 | } | 362 | } |
| 362 | 363 | ||
| @@ -380,7 +381,7 @@ class RecordPlayBackParse extends Emiter { | @@ -380,7 +381,7 @@ class RecordPlayBackParse extends Emiter { | ||
| 380 | //把记录的文档信息也要清除 | 381 | //把记录的文档信息也要清除 |
| 381 | GlobalConfig.activeDocId=0; | 382 | GlobalConfig.activeDocId=0; |
| 382 | GlobalConfig.activeDocCurPage=1; | 383 | GlobalConfig.activeDocCurPage=1; |
| 383 | - | 384 | + this._emit(RecordPlayBackParse.RECORD_PLAYBACK_CLEAR_DATA); |
| 384 | //各个ape模块查找关键帧数据 | 385 | //各个ape模块查找关键帧数据 |
| 385 | this._searchKeyfram(); | 386 | this._searchKeyfram(); |
| 386 | } | 387 | } |
| @@ -479,6 +480,7 @@ class RecordPlayBackParse extends Emiter { | @@ -479,6 +480,7 @@ class RecordPlayBackParse extends Emiter { | ||
| 479 | } | 480 | } |
| 480 | 481 | ||
| 481 | RecordPlayBackParse.prototype.CLASS_JOIN_RECORD_PLAYBACK_SUCCESS = RecordPlayBackParse.CLASS_JOIN_RECORD_PLAYBACK_SUCCESS = 'class_join_recordPlayback_success';//加入录制回放成功 | 482 | RecordPlayBackParse.prototype.CLASS_JOIN_RECORD_PLAYBACK_SUCCESS = RecordPlayBackParse.CLASS_JOIN_RECORD_PLAYBACK_SUCCESS = 'class_join_recordPlayback_success';//加入录制回放成功 |
| 483 | +RecordPlayBackParse.prototype.RECORD_PLAYBACK_CLEAR_DATA = RecordPlayBackParse.RECORD_PLAYBACK_CLEAR_DATA = 'record_playback_clear_data';//清除录制回放数据 | ||
| 482 | 484 | ||
| 483 | export default new RecordPlayBackParse; | 485 | export default new RecordPlayBackParse; |
| 484 | 486 |
| @@ -194,23 +194,23 @@ export default class Ape extends Emiter { | @@ -194,23 +194,23 @@ export default class Ape extends Emiter { | ||
| 194 | } | 194 | } |
| 195 | 195 | ||
| 196 | rosterInsertHandler(recordId, recordData) { | 196 | rosterInsertHandler(recordId, recordData) { |
| 197 | - loger.warn(this._session_name + ' rosterInsertHandler 应有子类具体覆盖处理.'); | 197 | + // loger.warn(this._session_name + ' rosterInsertHandler 应有子类具体覆盖处理.'); |
| 198 | } | 198 | } |
| 199 | 199 | ||
| 200 | rosterUpdateHandler(nodeId, nodeData) { | 200 | rosterUpdateHandler(nodeId, nodeData) { |
| 201 | - loger.warn(this._session_name + ' rosterUpdateHandler 应有子类具体覆盖处理.'); | 201 | + //loger.warn(this._session_name + ' rosterUpdateHandler 应有子类具体覆盖处理.'); |
| 202 | } | 202 | } |
| 203 | 203 | ||
| 204 | rosterDelHandler(recordData) { | 204 | rosterDelHandler(recordData) { |
| 205 | - loger.warn(this._session_name + ' rosterDelHandler 应有子类具体覆盖处理.'); | 205 | + //loger.warn(this._session_name + ' rosterDelHandler 应有子类具体覆盖处理.'); |
| 206 | } | 206 | } |
| 207 | 207 | ||
| 208 | tableInsertHandler(tableId, record) { | 208 | tableInsertHandler(tableId, record) { |
| 209 | - loger.warn(this._session_name + ' tableInsertHandler 应有子类具体覆盖处理.'); | 209 | + //loger.warn(this._session_name + ' tableInsertHandler 应有子类具体覆盖处理.'); |
| 210 | } | 210 | } |
| 211 | 211 | ||
| 212 | tableUpdateHandler(ownerId, recordId, recordData,seekTime) { | 212 | tableUpdateHandler(ownerId, recordId, recordData,seekTime) { |
| 213 | - loger.warn(this._session_name + ' tableUpdateHandler 应有子类具体覆盖处理.'); | 213 | + //loger.warn(this._session_name + ' tableUpdateHandler 应有子类具体覆盖处理.'); |
| 214 | } | 214 | } |
| 215 | tableUpdateApeHandler(tableUpdateItems,seekTime){ | 215 | tableUpdateApeHandler(tableUpdateItems,seekTime){ |
| 216 | 216 | ||
| @@ -219,20 +219,20 @@ export default class Ape extends Emiter { | @@ -219,20 +219,20 @@ export default class Ape extends Emiter { | ||
| 219 | 219 | ||
| 220 | } | 220 | } |
| 221 | tableDeleteHandler(tableId, record) { | 221 | tableDeleteHandler(tableId, record) { |
| 222 | - loger.warn(this._session_name + ' tableDelHandler 应有子类具体覆盖处理.'); | 222 | + //loger.warn(this._session_name + ' tableDelHandler 应有子类具体覆盖处理.'); |
| 223 | } | 223 | } |
| 224 | 224 | ||
| 225 | onJoinChannelHandlerSuccess() { | 225 | onJoinChannelHandlerSuccess() { |
| 226 | - loger.warn(this._session_name + ' onJoinChannelHandlerSuccess 应有子类具体覆盖处理.'); | 226 | + //loger.warn(this._session_name + ' onJoinChannelHandlerSuccess 应有子类具体覆盖处理.'); |
| 227 | } | 227 | } |
| 228 | 228 | ||
| 229 | onJoinSessionHandlerSuccess() { | 229 | onJoinSessionHandlerSuccess() { |
| 230 | - loger.warn(this._session_name + ' onJoinSessionHandlerSuccess 应有子类具体覆盖处理.'); | 230 | + //loger.warn(this._session_name + ' onJoinSessionHandlerSuccess 应有子类具体覆盖处理.'); |
| 231 | } | 231 | } |
| 232 | 232 | ||
| 233 | // 加入Session处理 | 233 | // 加入Session处理 |
| 234 | _joinSessionHandler(data) { | 234 | _joinSessionHandler(data) { |
| 235 | - loger.log(this._session_name, ' -> 加入Session'); | 235 | + //loger.log(this._session_name, ' -> 加入Session'); |
| 236 | this.onJoinSessionHandlerSuccess(); | 236 | this.onJoinSessionHandlerSuccess(); |
| 237 | } | 237 | } |
| 238 | 238 |
| @@ -500,10 +500,14 @@ class ConferApe extends Ape { | @@ -500,10 +500,14 @@ class ConferApe extends Ape { | ||
| 500 | } | 500 | } |
| 501 | 501 | ||
| 502 | onSendConferRecordRequestHandler(_data) { | 502 | onSendConferRecordRequestHandler(_data) { |
| 503 | - loger.log("onSendConferRecordRequestHandler"); | ||
| 504 | try { | 503 | try { |
| 505 | let conferRecordSendPdu = pdu['RCConferenceRecordRequestPdu'].decode(_data); | 504 | let conferRecordSendPdu = pdu['RCConferenceRecordRequestPdu'].decode(_data); |
| 506 | - loger.log(conferRecordSendPdu); | 505 | + // {"initiator":820461225,"record":false,"classTime":3213,"filename":"h5dev/20170410/1437784290_20170410.rec"} |
| 506 | + loger.log("onSendConferRecordRequestHandler->",conferRecordSendPdu); | ||
| 507 | + if(conferRecordSendPdu&&conferRecordSendPdu.record==true||conferRecordSendPdu.record=="true"){ | ||
| 508 | + //每次开启录制的时候,需要把当前显示的文档数据更新一次,否则无法录制已经显示的文件 | ||
| 509 | + this._emit(MessageTypes.CLASS_RECORD_SUCCESS); | ||
| 510 | + } | ||
| 507 | } catch (err) { | 511 | } catch (err) { |
| 508 | loger.warn("onSendConferRecordRequestHandler err", err.message); | 512 | loger.warn("onSendConferRecordRequestHandler err", err.message); |
| 509 | } | 513 | } |
| @@ -210,9 +210,19 @@ class DocApe extends Ape { | @@ -210,9 +210,19 @@ class DocApe extends Ape { | ||
| 210 | return path; | 210 | return path; |
| 211 | } | 211 | } |
| 212 | 212 | ||
| 213 | + //更新文档模块的录制信息,每次开启录制的时候需要把当前文档的信息更新一次 | ||
| 214 | + updaterRecordStatus(_param){ | ||
| 215 | + if(GlobalConfig.isHost&&!GlobalConfig.isRecordPlayBack&&GlobalConfig.activeDocId>0){ | ||
| 216 | + loger.log("开启录制成功->更新当前的文档数据->docId:", GlobalConfig.activeDocId, 'page:',GlobalConfig.activeDocCurPage); | ||
| 217 | + this.documentSwitchPage({ | ||
| 218 | + "itemIdx": GlobalConfig.activeDocId, | ||
| 219 | + "curPageNo":GlobalConfig.activeDocCurPage | ||
| 220 | + }); | ||
| 221 | + } | ||
| 222 | + } | ||
| 213 | //切换文档 | 223 | //切换文档 |
| 214 | documentSwitchDoc(paramInfo) { | 224 | documentSwitchDoc(paramInfo) { |
| 215 | - loger.log('切换文档,documentSwitchDoc->', paramInfo); | 225 | + loger.log('切换文档->', paramInfo); |
| 216 | 226 | ||
| 217 | if (GlobalConfig.isRecordPlayBack) { | 227 | if (GlobalConfig.isRecordPlayBack) { |
| 218 | loger.warn('录制回放状态不允许切换文档'); | 228 | loger.warn('录制回放状态不允许切换文档'); |
| @@ -220,7 +230,7 @@ class DocApe extends Ape { | @@ -220,7 +230,7 @@ class DocApe extends Ape { | ||
| 220 | } | 230 | } |
| 221 | 231 | ||
| 222 | if (paramInfo == null || paramInfo.itemIdx == null) { | 232 | if (paramInfo == null || paramInfo.itemIdx == null) { |
| 223 | - loger.warn('documentSwitch失败,参数错误', paramInfo); | 233 | + loger.warn('切换文档失败,参数错误', paramInfo); |
| 224 | this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); | 234 | this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); |
| 225 | return; | 235 | return; |
| 226 | } | 236 | } |
| @@ -243,7 +253,7 @@ class DocApe extends Ape { | @@ -243,7 +253,7 @@ class DocApe extends Ape { | ||
| 243 | //获取已经存在的数据 | 253 | //获取已经存在的数据 |
| 244 | let docDataModel = this.docList[paramInfo.itemIdx]; | 254 | let docDataModel = this.docList[paramInfo.itemIdx]; |
| 245 | if (docDataModel == null) { | 255 | if (docDataModel == null) { |
| 246 | - loger.warn('documentSwitch失败,文档不存在', paramInfo); | 256 | + loger.warn('切换文档失败,文档不存在', paramInfo); |
| 247 | this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); | 257 | this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); |
| 248 | return; | 258 | return; |
| 249 | } | 259 | } |
| @@ -266,15 +276,13 @@ class DocApe extends Ape { | @@ -266,15 +276,13 @@ class DocApe extends Ape { | ||
| 266 | 276 | ||
| 267 | //文档翻页 | 277 | //文档翻页 |
| 268 | documentSwitchPage(paramInfo) { | 278 | documentSwitchPage(paramInfo) { |
| 269 | - loger.log('文档翻页,documentSwitchPage'); | ||
| 270 | - loger.log(paramInfo); | ||
| 271 | - //console.log(this.docList); | 279 | + loger.log('文档翻页->',paramInfo); |
| 272 | //获取已经存在的数据 | 280 | //获取已经存在的数据 |
| 273 | let docDataModel = this.docList[paramInfo.itemIdx]; | 281 | let docDataModel = this.docList[paramInfo.itemIdx]; |
| 274 | //console.log(docDataModelPdu); | 282 | //console.log(docDataModelPdu); |
| 275 | //console.log(docDataModel); | 283 | //console.log(docDataModel); |
| 276 | if (docDataModel == null) { | 284 | if (docDataModel == null) { |
| 277 | - loger.log('documentSwitchPage->,文档不存在', paramInfo); | 285 | + loger.log('文档翻页->,文档不存在', paramInfo); |
| 278 | this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); | 286 | this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); |
| 279 | return; | 287 | return; |
| 280 | } | 288 | } |
| @@ -289,12 +297,12 @@ class DocApe extends Ape { | @@ -289,12 +297,12 @@ class DocApe extends Ape { | ||
| 289 | 297 | ||
| 290 | //文档切换显示模式 | 298 | //文档切换显示模式 |
| 291 | documentSwitchShowModel(paramInfo) { | 299 | documentSwitchShowModel(paramInfo) { |
| 292 | - loger.log('documentSwitchShowModel', paramInfo); | 300 | + loger.log('文档切换显示模式', paramInfo); |
| 293 | //获取已经存在的数据 | 301 | //获取已经存在的数据 |
| 294 | let docDataModel = this.docList[paramInfo.itemIdx]; | 302 | let docDataModel = this.docList[paramInfo.itemIdx]; |
| 295 | 303 | ||
| 296 | if (docDataModel == null) { | 304 | if (docDataModel == null) { |
| 297 | - loger.log('documentSwitchShowModel->文档不存在', paramInfo); | 305 | + loger.log('文档切换显示模式->文档不存在', paramInfo); |
| 298 | this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); | 306 | this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); |
| 299 | return; | 307 | return; |
| 300 | } | 308 | } |
| @@ -326,7 +334,7 @@ class DocApe extends Ape { | @@ -326,7 +334,7 @@ class DocApe extends Ape { | ||
| 326 | documentDeleteAll(_param) { | 334 | documentDeleteAll(_param) { |
| 327 | for (let key in this.docList) { | 335 | for (let key in this.docList) { |
| 328 | //console.log("key:"+key); | 336 | //console.log("key:"+key); |
| 329 | - loger.log("删除文档数据,itemIdx:" + key); | 337 | + loger.log("删除文档数据->itemIdx:" + key); |
| 330 | this.documentDelete({"itemIdx": key}); | 338 | this.documentDelete({"itemIdx": key}); |
| 331 | } | 339 | } |
| 332 | } | 340 | } |
| @@ -354,10 +362,18 @@ class DocApe extends Ape { | @@ -354,10 +362,18 @@ class DocApe extends Ape { | ||
| 354 | adapterPdu.type = pdu.RCPDU_REG_ADAPTER; | 362 | adapterPdu.type = pdu.RCPDU_REG_ADAPTER; |
| 355 | adapterPdu.item.push(adapterItemPdu); | 363 | adapterPdu.item.push(adapterItemPdu); |
| 356 | 364 | ||
| 357 | - loger.log("文档发送删除数据=============" + tableDeleteItemPdu.itemIdx); | 365 | + loger.log("文档发送删除数据=============>" + tableDeleteItemPdu.itemIdx); |
| 358 | this.sendUniform(adapterPdu, true); | 366 | this.sendUniform(adapterPdu, true); |
| 359 | } | 367 | } |
| 360 | 368 | ||
| 369 | + //清除当前文档模块的数据 | ||
| 370 | + clearData(){ | ||
| 371 | + loger.log("clearData->") | ||
| 372 | + this.docList={}; | ||
| 373 | + GlobalConfig.activeDocId=0; | ||
| 374 | + GlobalConfig.activeDocCurPage=1; | ||
| 375 | + | ||
| 376 | + } | ||
| 361 | /////收到消息处理///////////////////////////////////////////////////////////////////////////////// | 377 | /////收到消息处理///////////////////////////////////////////////////////////////////////////////// |
| 362 | tableInsertHandler(owner, itemIdx, itemData) { | 378 | tableInsertHandler(owner, itemIdx, itemData) { |
| 363 | /* let itemDataInfo = this.unPackPdu(owner, itemIdx, itemData); | 379 | /* let itemDataInfo = this.unPackPdu(owner, itemIdx, itemData); |
| @@ -380,11 +396,11 @@ class DocApe extends Ape { | @@ -380,11 +396,11 @@ class DocApe extends Ape { | ||
| 380 | this.documentSwitchDoc(paramInfo); | 396 | this.documentSwitchDoc(paramInfo); |
| 381 | }*/ | 397 | }*/ |
| 382 | } | 398 | } |
| 383 | - | 399 | + //添加文档 |
| 384 | tableInsertApeHandler(_tableUpdateItems, _seekTime) { | 400 | tableInsertApeHandler(_tableUpdateItems, _seekTime) { |
| 385 | let tableInsertItems =_tableUpdateItems; | 401 | let tableInsertItems =_tableUpdateItems; |
| 386 | let tableInsertItemsLen = tableInsertItems.length; | 402 | let tableInsertItemsLen = tableInsertItems.length; |
| 387 | - loger.log('tableInsertApeHandler', "activeDocId->", GlobalConfig.activeDocId, "tableUpdateItemsLen->", tableInsertItemsLen); | 403 | + loger.log('添加文档->', "activeDocId->", GlobalConfig.activeDocId, "tableUpdateItemsLen->", tableInsertItemsLen); |
| 388 | for (let i = 0; i < tableInsertItemsLen; ++i) { | 404 | for (let i = 0; i < tableInsertItemsLen; ++i) { |
| 389 | let insertItem = tableInsertItems[i]; | 405 | let insertItem = tableInsertItems[i]; |
| 390 | //this.tableInsertHandler(insertItem.owner, insertItem.itemIdx, insertItem.itemData); | 406 | //this.tableInsertHandler(insertItem.owner, insertItem.itemIdx, insertItem.itemData); |
| @@ -394,7 +410,7 @@ class DocApe extends Ape { | @@ -394,7 +410,7 @@ class DocApe extends Ape { | ||
| 394 | if (itemDataInfo.visible == "true" || itemDataInfo.visible == true) { | 410 | if (itemDataInfo.visible == "true" || itemDataInfo.visible == true) { |
| 395 | GlobalConfig.activeDocId = itemDataInfo.itemIdx;//当前激活的文档ID | 411 | GlobalConfig.activeDocId = itemDataInfo.itemIdx;//当前激活的文档ID |
| 396 | GlobalConfig.activeDocCurPage = itemDataInfo.curPageNo;//当前激活的文档的当前页 | 412 | GlobalConfig.activeDocCurPage = itemDataInfo.curPageNo;//当前激活的文档的当前页 |
| 397 | - loger.log('tableInsertHandler 设置当前激活的文档id'); | 413 | + loger.log('添加文档->设置当前激活的文档id'); |
| 398 | } | 414 | } |
| 399 | this._emit(MessageTypes.DOC_UPDATE, itemDataInfo);//用添加和更新都统一DOC_UPDATE | 415 | this._emit(MessageTypes.DOC_UPDATE, itemDataInfo);//用添加和更新都统一DOC_UPDATE |
| 400 | } | 416 | } |
| @@ -403,7 +419,7 @@ class DocApe extends Ape { | @@ -403,7 +419,7 @@ class DocApe extends Ape { | ||
| 403 | this._showDefaultDoc(); | 419 | this._showDefaultDoc(); |
| 404 | } | 420 | } |
| 405 | tableDeleteHandler(object_id, tableDeleteData) { | 421 | tableDeleteHandler(object_id, tableDeleteData) { |
| 406 | - loger.log('tableDeleteHandler', object_id, tableDeleteData);//["tableDeleteHandler",1179649,{"type":231,"itemIdx":[1486301768]}] | 422 | + loger.log('删除文档数据->', object_id, tableDeleteData);//["tableDeleteHandler",1179649,{"type":231,"itemIdx":[1486301768]}] |
| 407 | if (tableDeleteData && tableDeleteData.itemIdx) { | 423 | if (tableDeleteData && tableDeleteData.itemIdx) { |
| 408 | let len = tableDeleteData.itemIdx.length; | 424 | let len = tableDeleteData.itemIdx.length; |
| 409 | let itemIdxs = tableDeleteData.itemIdx; | 425 | let itemIdxs = tableDeleteData.itemIdx; |
| @@ -415,7 +431,7 @@ class DocApe extends Ape { | @@ -415,7 +431,7 @@ class DocApe extends Ape { | ||
| 415 | if (itemDataInfo && (itemDataInfo.visible == "true" || itemDataInfo.visible == true)) { | 431 | if (itemDataInfo && (itemDataInfo.visible == "true" || itemDataInfo.visible == true)) { |
| 416 | GlobalConfig.activeDocId = 0;//当前激活的文档ID | 432 | GlobalConfig.activeDocId = 0;//当前激活的文档ID |
| 417 | GlobalConfig.activeDocCurPage = 1;//当前激活的文档的当前页 | 433 | GlobalConfig.activeDocCurPage = 1;//当前激活的文档的当前页 |
| 418 | - loger.log('tableDeleteHandler->当前显示的文档'); | 434 | + loger.log('删除文档数据->清除当前显示的文档'); |
| 419 | } | 435 | } |
| 420 | this._emit(MessageTypes.DOC_DELETE, {"itemIdx": itemIdxs[i]}); | 436 | this._emit(MessageTypes.DOC_DELETE, {"itemIdx": itemIdxs[i]}); |
| 421 | delete this.docList[itemIdxs[i]]; | 437 | delete this.docList[itemIdxs[i]]; |
| @@ -445,7 +461,7 @@ class DocApe extends Ape { | @@ -445,7 +461,7 @@ class DocApe extends Ape { | ||
| 445 | 461 | ||
| 446 | tableUpdateApeHandler(_tableUpdateItems, _seekTime) { | 462 | tableUpdateApeHandler(_tableUpdateItems, _seekTime) { |
| 447 | let tableUpdateItemsLen = _tableUpdateItems.length; | 463 | let tableUpdateItemsLen = _tableUpdateItems.length; |
| 448 | - loger.log('tableUpdateApeHandler', "activeDocId->", GlobalConfig.activeDocId, "tableUpdateItemsLen->", tableUpdateItemsLen); | 464 | + loger.log('更新文档->', "activeDocId->", GlobalConfig.activeDocId, "更新的数量->", tableUpdateItemsLen); |
| 449 | for (let i = 0; i < tableUpdateItemsLen; ++i) { | 465 | for (let i = 0; i < tableUpdateItemsLen; ++i) { |
| 450 | let tableItem = _tableUpdateItems[i]; | 466 | let tableItem = _tableUpdateItems[i]; |
| 451 | let itemDataInfo = this.unPackPdu(tableItem.owner, tableItem.itemIdx, tableItem.itemData); | 467 | let itemDataInfo = this.unPackPdu(tableItem.owner, tableItem.itemIdx, tableItem.itemData); |
| @@ -454,12 +470,12 @@ class DocApe extends Ape { | @@ -454,12 +470,12 @@ class DocApe extends Ape { | ||
| 454 | if (itemDataInfo && (itemDataInfo.visible == "true" || itemDataInfo.visible == true)) { | 470 | if (itemDataInfo && (itemDataInfo.visible == "true" || itemDataInfo.visible == true)) { |
| 455 | GlobalConfig.activeDocId = itemDataInfo.itemIdx;//当前激活的文档ID | 471 | GlobalConfig.activeDocId = itemDataInfo.itemIdx;//当前激活的文档ID |
| 456 | GlobalConfig.activeDocCurPage = itemDataInfo.curPageNo;//当前激活的文档的当前页 | 472 | GlobalConfig.activeDocCurPage = itemDataInfo.curPageNo;//当前激活的文档的当前页 |
| 457 | - loger.log('tableUpdateHandler 设置当前激活的文档id->', GlobalConfig.activeDocId, "curPageNum->", GlobalConfig.activeDocCurPage); | 473 | + loger.log('更新文档->设置当前激活的文档id->', GlobalConfig.activeDocId, "curPageNum->", GlobalConfig.activeDocCurPage); |
| 458 | } | 474 | } |
| 459 | loger.log('doc->', itemDataInfo); | 475 | loger.log('doc->', itemDataInfo); |
| 460 | this._emit(MessageTypes.DOC_UPDATE, itemDataInfo); | 476 | this._emit(MessageTypes.DOC_UPDATE, itemDataInfo); |
| 461 | } else { | 477 | } else { |
| 462 | - loger.log('tableUpdateHandler 数据无效--> itemIdx', itemIdx); | 478 | + loger.log('更新文档-> 数据无效--> itemIdx', itemIdx); |
| 463 | } | 479 | } |
| 464 | } | 480 | } |
| 465 | this._showDefaultDoc(); | 481 | this._showDefaultDoc(); |
| @@ -506,25 +522,25 @@ class DocApe extends Ape { | @@ -506,25 +522,25 @@ class DocApe extends Ape { | ||
| 506 | //检查文档是否已经存在,如果存在 返回true,否则返回false | 522 | //检查文档是否已经存在,如果存在 返回true,否则返回false |
| 507 | checkDocId(_docId) { | 523 | checkDocId(_docId) { |
| 508 | if (_docId == null) { | 524 | if (_docId == null) { |
| 509 | - loger.warn('checkDocId _docId参数为null'); | 525 | + loger.warn('查找文档->失败->参数为null'); |
| 510 | return true; | 526 | return true; |
| 511 | } | 527 | } |
| 512 | //遍历查找 | 528 | //遍历查找 |
| 513 | for (let key in this.docList) { | 529 | for (let key in this.docList) { |
| 514 | let item = this.docList[key]; | 530 | let item = this.docList[key]; |
| 515 | - loger.log('item.docId==============_docId', item.docId, _docId); | ||
| 516 | if (item && item.docId == _docId) { | 531 | if (item && item.docId == _docId) { |
| 532 | + loger.log('查找文档->已经存在->',_docId); | ||
| 517 | return true; | 533 | return true; |
| 518 | } | 534 | } |
| 519 | } | 535 | } |
| 520 | - | 536 | + loger.log('查找文档->没有查找到文档->',_docId); |
| 521 | //储存的数据中没有查找到 | 537 | //储存的数据中没有查找到 |
| 522 | return false; | 538 | return false; |
| 523 | } | 539 | } |
| 524 | 540 | ||
| 525 | ///////数据的封包和解包///////////////////////////////////////// | 541 | ///////数据的封包和解包///////////////////////////////////////// |
| 526 | packPdu(_param, _itemIdx) { | 542 | packPdu(_param, _itemIdx) { |
| 527 | - loger.log("文档===packPdu "); | 543 | + loger.log("文档===>packPdu "); |
| 528 | //验证坐标点集合数组是否合法 | 544 | //验证坐标点集合数组是否合法 |
| 529 | if (_param == null || _itemIdx == null) { | 545 | if (_param == null || _itemIdx == null) { |
| 530 | this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); | 546 | this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); |
| @@ -579,18 +595,16 @@ class DocApe extends Ape { | @@ -579,18 +595,16 @@ class DocApe extends Ape { | ||
| 579 | } | 595 | } |
| 580 | 596 | ||
| 581 | unPackPdu(owner, itemIdx, itemData) { | 597 | unPackPdu(owner, itemIdx, itemData) { |
| 582 | - loger.log("文档===unPackPdu "); | ||
| 583 | if (owner == null || itemIdx == null || itemData == null) { | 598 | if (owner == null || itemIdx == null || itemData == null) { |
| 584 | this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); | 599 | this._emit(MessageTypes.MCU_ERROR, MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); |
| 585 | return null; | 600 | return null; |
| 586 | } | 601 | } |
| 587 | - | ||
| 588 | try { | 602 | try { |
| 589 | let docModelPdu = pdu['RCDocSendDataModelPdu'].decode(itemData); | 603 | let docModelPdu = pdu['RCDocSendDataModelPdu'].decode(itemData); |
| 590 | - //loger.log(docModelPdu); | 604 | + loger.log("文档===>unPackPdu"); |
| 591 | return docModelPdu; | 605 | return docModelPdu; |
| 592 | } catch (err) { | 606 | } catch (err) { |
| 593 | - loger.log("文档收到数据 unPackPdu Pdu解析错误,itemIdx=" + itemIdx + " err:" + err.message); | 607 | + loger.log("文档===>unPackPdu->Pdu解析错误->itemIdx=" + itemIdx + "->err:" + err.message); |
| 594 | } | 608 | } |
| 595 | return null; | 609 | return null; |
| 596 | } | 610 | } |
| @@ -58,6 +58,12 @@ class WhiteBoardApe extends Ape { | @@ -58,6 +58,12 @@ class WhiteBoardApe extends Ape { | ||
| 58 | this.insertHistory = []; | 58 | this.insertHistory = []; |
| 59 | } | 59 | } |
| 60 | 60 | ||
| 61 | + //清除当前模块的数据 | ||
| 62 | + clearData(){ | ||
| 63 | + loger.log("clearData->") | ||
| 64 | + this.annoInfos = {};//储存所有的标注数据 | ||
| 65 | + this.insertHistory = [];//添加的白板记录,用于撤回操作 | ||
| 66 | + } | ||
| 61 | /////////////发送数据操作////////////////////////////////////////////////////// | 67 | /////////////发送数据操作////////////////////////////////////////////////////// |
| 62 | // 添加标注,发送信息 | 68 | // 添加标注,发送信息 |
| 63 | sendInsetAnnotaion(_param) { | 69 | sendInsetAnnotaion(_param) { |
-
请 注册 或 登录 后发表评论