李勇

1.修改会议状态的pdu结构,增加开始上课、暂停、关闭会议的接口

此 diff 太大无法显示。
@@ -97,8 +97,9 @@ export default class MessageEntrance extends Emiter { @@ -97,8 +97,9 @@ export default class MessageEntrance extends Emiter {
97 this.leaveClass=this._leaveClass; 97 this.leaveClass=this._leaveClass;
98 this.getMcuClientStatus=this._getMcuClientStatus; 98 this.getMcuClientStatus=this._getMcuClientStatus;
99 this.getClassDetail=this._getClassDetail; 99 this.getClassDetail=this._getClassDetail;
100 - this.sendUpdaterClassInfo=this._sendUpdaterClassInfo;  
101 - 100 + this.sendStartClass=this._sendStartClass;
  101 + this.sendPauseClass=this._sendPauseClass;
  102 + this.sendCloseClass=this._sendCloseClass;
102 //chatApe 103 //chatApe
103 this.sendChatMsg=this._sendChatMsg; 104 this.sendChatMsg=this._sendChatMsg;
104 105
@@ -432,19 +433,25 @@ export default class MessageEntrance extends Emiter { @@ -432,19 +433,25 @@ export default class MessageEntrance extends Emiter {
432 }; 433 };
433 this._emit(msg.type, msg); 434 this._emit(msg.type, msg);
434 } 435 }
435 - //更新会议数据  
436 - _sendUpdaterClassInfo(_param){ 436 +
  437 + //开始上课
  438 + _sendStartClass(_param){
437 if(_confer_ape){ 439 if(_confer_ape){
438 - _confer_ape.sendUpdaterClassInfo(_param); 440 + _confer_ape.startClass(_param);
439 } 441 }
440 } 442 }
441 - _sendUpdaterClassStatus(_param){ 443 + //暂停上课
  444 + _sendPauseClass(_param){
442 if(_confer_ape){ 445 if(_confer_ape){
443 - _confer_ape.sendUpdaterClassStatus(_param); 446 + _confer_ape.pauseClass(_param);
  447 + }
  448 + }
  449 + //停止上课
  450 + _sendCloseClass(_param){
  451 + if(_confer_ape){
  452 + _confer_ape.closeClass(_param);
444 } 453 }
445 } 454 }
446 -  
447 -  
448 455
449 456
450 //ChatApe 457 //ChatApe
@@ -26,11 +26,22 @@ class EngineUtils{ @@ -26,11 +26,22 @@ class EngineUtils{
26 return null; 26 return null;
27 } 27 }
28 28
29 - //生成时间戳 保证唯一 29 + //生成时间戳后9位 保证唯一
30 static creatTimestamp(){ 30 static creatTimestamp(){
31 let time = new Date().getTime(); 31 let time = new Date().getTime();
32 let timestamp:int = time % 1000000000;//time后9位 32 let timestamp:int = time % 1000000000;//time后9位
33 return timestamp; 33 return timestamp;
34 } 34 }
  35 + //生成时间戳 string
  36 + static creatTimestampStr(){
  37 + let curTime = new Date();
  38 + let timeStr = "" + curTime.getFullYear() + "-";
  39 + timeStr += (curTime.getMonth()+1) + "-";
  40 + timeStr += curTime.getDate() + "-";
  41 + timeStr+=curTime.getHours() + "-";
  42 + timeStr+=curTime.getMinutes() + "-";
  43 + timeStr+=curTime.getSeconds();
  44 + return timeStr;
  45 + }
35 } 46 }
36 export default EngineUtils; 47 export default EngineUtils;
@@ -5,6 +5,7 @@ import Loger from 'Loger'; @@ -5,6 +5,7 @@ import Loger from 'Loger';
5 import ApeConsts from "apes/ApeConsts"; 5 import ApeConsts from "apes/ApeConsts";
6 6
7 let loger = Loger.getLoger('GlobalConfig'); 7 let loger = Loger.getLoger('GlobalConfig');
  8 +import EngineUtils from 'EngineUtils';
8 9
9 class GlobalConfig { 10 class GlobalConfig {
10 constructor () { 11 constructor () {
@@ -112,17 +113,19 @@ class GlobalConfig { @@ -112,17 +113,19 @@ class GlobalConfig {
112 "classStatus":this.classStatus,//课堂的状态 113 "classStatus":this.classStatus,//课堂的状态
113 "classStartTime":this.classStartTime,//课堂点击开始时间 114 "classStartTime":this.classStartTime,//课堂点击开始时间
114 "classStopTime":this.classStopTime,//最后一次停止的时间(点暂停或结束),每次发送数据都获取当前时间戳 115 "classStopTime":this.classStopTime,//最后一次停止的时间(点暂停或结束),每次发送数据都获取当前时间戳
115 - "classTimestamp":this.recordTimestamp,//相对于点开始课堂的时间戳 116 + "classTimestamp":this.classTimestamp,//相对于点开始课堂的时间戳
116 117
117 - "classBeginTime":this.classBeginTime,//课堂创建的时间  
118 - "classEndTime":this.classEndTime,//课堂结束的时间 118 + "classBeginTime":this.classBeginTime,//课堂创建的时间,这个是Sass返回的
  119 + "classEndTime":this.classEndTime,//课堂结束的时间,这个是Sass返回的
119 120
120 "recordStatus":this.recordStatus,//当前录制状态 121 "recordStatus":this.recordStatus,//当前录制状态
121 - "recordTimestamp":this.recordTimestamp,//相对于开始录制的时间戳  
122 - "recordStreamName":this.recordStreamName,//录制的文件名 122 + "recordTimestamp":this.recordTimestamp,//相对于首次开始录制的时间戳
  123 + "recordFileName":this.recordFileName,//录制的文件名
123 "recordDownloadUrl":this.recordDownloadUrl,//下载地址 124 "recordDownloadUrl":this.recordDownloadUrl,//下载地址
124 125
125 - "systemTimestamp":this.systemTimestamp//当前的系统时间戳 126 + "serverTimestamp":this.serverTimestamp,//当前的系统时间戳
  127 + "activeDocId":this.activeDocId ,//当前激活的文档ID
  128 + "activeDocCurPage":this.activeDocCurPage//当前激活的文档的当前页
126 } 129 }
127 } 130 }
128 } 131 }
@@ -170,6 +173,9 @@ class GlobalConfig { @@ -170,6 +173,9 @@ class GlobalConfig {
170 return false; 173 return false;
171 } 174 }
172 175
  176 + static get serverTimestamp(){
  177 + return EngineUtils.creatTimestamp();
  178 + }
173 //储存已经提前上传的文档列表 179 //储存已经提前上传的文档列表
174 static setDocListPrepare(_data){ 180 static setDocListPrepare(_data){
175 if(_data==null) return; 181 if(_data==null) return;
@@ -261,43 +267,46 @@ GlobalConfig.maxAudioChannels=1; @@ -261,43 +267,46 @@ GlobalConfig.maxAudioChannels=1;
261 GlobalConfig.maxMediaChannels=2; 267 GlobalConfig.maxMediaChannels=2;
262 GlobalConfig.isDebug=false; 268 GlobalConfig.isDebug=false;
263 GlobalConfig.deBugData={}; 269 GlobalConfig.deBugData={};
  270 +
  271 +
264 GlobalConfig.deviceType=-1; //设备类型 0:电脑 1:安卓 2:ios -1未知 272 GlobalConfig.deviceType=-1; //设备类型 0:电脑 1:安卓 2:ios -1未知
265 GlobalConfig.userIP="";//用户当前IP 273 GlobalConfig.userIP="";//用户当前IP
266 -  
267 GlobalConfig.userId=0; 274 GlobalConfig.userId=0;
268 GlobalConfig.userName=""; 275 GlobalConfig.userName="";
269 -GlobalConfig.nodeId=0;//随机生成 276 +
  277 +GlobalConfig.nodeId=0;//随机生成 mcu中的唯一ID
270 GlobalConfig.passwordRequired=false; 278 GlobalConfig.passwordRequired=false;
271 GlobalConfig.password=""; 279 GlobalConfig.password="";
272 GlobalConfig.userType=8; 280 GlobalConfig.userType=8;
273 GlobalConfig.userRole=ApeConsts.normal;//用户的身份,5种类型: 281 GlobalConfig.userRole=ApeConsts.normal;//用户的身份,5种类型:
274 GlobalConfig.role=ApeConsts.NR_NORMAL;//课堂角色身份 282 GlobalConfig.role=ApeConsts.NR_NORMAL;//课堂角色身份
275 283
276 -GlobalConfig.h5Module=0;  
277 -GlobalConfig.siteId="gust";  
278 -  
279 - 284 +GlobalConfig.h5Module=1;//是否支持H5
280 GlobalConfig.topNodeID=101;//现在固定值,还不知道是做什么用 285 GlobalConfig.topNodeID=101;//现在固定值,还不知道是做什么用
281 286
  287 +GlobalConfig.siteId="gust";//站点号
282 GlobalConfig.className= ""; // 课程名称 288 GlobalConfig.className= ""; // 课程名称
283 GlobalConfig.classId=0;//课堂号=classId=meetingNumber 之后统一修改为classId 289 GlobalConfig.classId=0;//课堂号=classId=meetingNumber 之后统一修改为classId
284 -GlobalConfig.classType=ApeConsts.CLASS_TYPE_INTERACT;//1:互动课堂,2:直播课堂 290 +GlobalConfig.classType=ApeConsts.CLASS_TYPE_INTERACT;//课堂类型 1:互动课堂,2:直播课堂
285 GlobalConfig.classStatus=ApeConsts.CLASS_STATUS_WAIT;// 0;//课堂还未开始 1;//直播中 2 //课间休息 3已经停止 291 GlobalConfig.classStatus=ApeConsts.CLASS_STATUS_WAIT;// 0;//课堂还未开始 1;//直播中 2 //课间休息 3已经停止
286 GlobalConfig.classStartTime="";//课堂点击开始时间 292 GlobalConfig.classStartTime="";//课堂点击开始时间
287 GlobalConfig.classStopTime="";//最后一次停止的时间(点暂停或结束),每次发送数据都获取当前时间戳 293 GlobalConfig.classStopTime="";//最后一次停止的时间(点暂停或结束),每次发送数据都获取当前时间戳
  294 +GlobalConfig.classBeginTime="";//课堂创建的时间,这个是Sass返回的
  295 +GlobalConfig.classEndTime="";//课堂结束的时间,这个是Sass返回的
  296 +GlobalConfig.classTimestamp=0;//从课堂开始到现在的时
  297 +
  298 +GlobalConfig.recordStatus=false;//当前录制状态
  299 +GlobalConfig.recordTimestamp=0;//相对于首次开始录制的进行时间
  300 +GlobalConfig.recordFileName="";//录制的文件名
  301 +GlobalConfig.recordDownloadUrl="";//下载地址
  302 +GlobalConfig.recordReplaytickValues={}; // 滚动条关键点,用于快进快退
  303 +
  304 +//GlobalConfig.serverTimestamp=0;//当前的系统时间戳 用get set 获取
288 305
289 -GlobalConfig.classBeginTime="";//课堂创建的时间  
290 -GlobalConfig.classEndTime="";//课堂结束的时间  
291 306
292 -GlobalConfig.recordStartTime= "";  
293 -GlobalConfig.recordStartTimestam = "";  
294 -GlobalConfig.recordEndTimestamp = "";  
295 -GlobalConfig.recordTimestamp= ""; 307 +GlobalConfig.activeDocId=0;//当前激活的文档ID
  308 +GlobalConfig.activeDocCurPage=1;//当前激活的文档的当前页
296 309
297 -GlobalConfig.recordEndTime= "";  
298 -GlobalConfig.recordPlayURL= "";  
299 -GlobalConfig.recordConfigFile = ""; // 录制脚本文件  
300 -GlobalConfig.tickValues={}; // 滚动条关键点,用于快进快退  
301 310
302 311
303 312
@@ -11,11 +11,13 @@ ApeConsts.CLASS_STATUS_WAIT= 0;//课堂还未开始 @@ -11,11 +11,13 @@ ApeConsts.CLASS_STATUS_WAIT= 0;//课堂还未开始
11 ApeConsts.CLASS_STATUS_STARTED= 1;//直播中 11 ApeConsts.CLASS_STATUS_STARTED= 1;//直播中
12 ApeConsts.CLASS_STATUS_PAUSE= 2;//暂停 12 ApeConsts.CLASS_STATUS_PAUSE= 2;//暂停
13 ApeConsts.CLASS_STATUS_CLOSE= 3;//结束 13 ApeConsts.CLASS_STATUS_CLOSE= 3;//结束
  14 +ApeConsts.CLASS_STATUS_UPTATE= 4;//更新课堂状态信息
14 15
15 ApeConsts.CLASS_WAIT_START = "class.wait.start";//课堂还未开始 16 ApeConsts.CLASS_WAIT_START = "class.wait.start";//课堂还未开始
16 ApeConsts.CLASS_STARTING = "class.started";//直播中 17 ApeConsts.CLASS_STARTING = "class.started";//直播中
17 ApeConsts.CLASS_PAUSING = "class.pause";//暂停 18 ApeConsts.CLASS_PAUSING = "class.pause";//暂停
18 ApeConsts.CLASS_PAUSING = "class.closed";//关闭 19 ApeConsts.CLASS_PAUSING = "class.closed";//关闭
  20 +ApeConsts.CLASS_PAUSING = "class.update";//更新当前的状态信息
19 21
20 //课堂类型 22 //课堂类型
21 ApeConsts.CLASS_TYPE_INTERACT= 1; // 互动课堂,通过MS转发音视频,不能进行H5观看 23 ApeConsts.CLASS_TYPE_INTERACT= 1; // 互动课堂,通过MS转发音视频,不能进行H5观看
@@ -22,9 +22,15 @@ import UTF8 from 'utf-8'; @@ -22,9 +22,15 @@ import UTF8 from 'utf-8';
22 import Loger from 'Loger'; 22 import Loger from 'Loger';
23 import GlobalConfig from 'GlobalConfig'; 23 import GlobalConfig from 'GlobalConfig';
24 import EngineUtils from 'EngineUtils'; 24 import EngineUtils from 'EngineUtils';
25 -  
26 let loger = Loger.getLoger('ConferApe'); 25 let loger = Loger.getLoger('ConferApe');
27 let itemIdx=0;//table插入新数据的计数id,目前用时间戳 26 let itemIdx=0;//table插入新数据的计数id,目前用时间戳
  27 +let timerCounter;
  28 +
  29 +const ACTION_TYPE_0=0;
  30 +const ACTION_TYPE_1=1;
  31 +const ACTION_TYPE_2=2;
  32 +const ACTION_TYPE_3=3;
  33 +const ACTION_TYPE_4=4;
28 class ConferApe extends Ape { 34 class ConferApe extends Ape {
29 constructor() { 35 constructor() {
30 super( 36 super(
@@ -44,8 +50,8 @@ class ConferApe extends Ape { @@ -44,8 +50,8 @@ class ConferApe extends Ape {
44 // 默认值: normal 50 // 默认值: normal
45 this.hostUserId = '';//主持人的 第三方userId 51 this.hostUserId = '';//主持人的 第三方userId
46 this.rosters = {};//用户列表 52 this.rosters = {};//用户列表
47 - this.activeDocId =0;//当前激活的文档ID  
48 - this.activeDocCurPage=1;//当前激活的文档的当前页 53 + //this.activeDocId =0;//当前激活的文档ID
  54 + //this.activeDocCurPage=1;//当前激活的文档的当前页
49 55
50 // Ape Models 56 // Ape Models
51 this.registerKey(this._session_id, this._session_name, this._session_tag, new ArrayBuffer); 57 this.registerKey(this._session_id, this._session_name, this._session_tag, new ArrayBuffer);
@@ -137,21 +143,48 @@ class ConferApe extends Ape { @@ -137,21 +143,48 @@ class ConferApe extends Ape {
137 143
138 this.sendUniform(adapterPdu, true); 144 this.sendUniform(adapterPdu, true);
139 } 145 }
  146 + //开始上课
  147 + startClass(_param){
  148 + GlobalConfig.classStatus=ApeConsts.CLASS_STATUS_STARTED;
  149 + GlobalConfig.classStartTime=EngineUtils.creatTimestampStr();
  150 + _param.actionType=ACTION_TYPE_1;
  151 + this.sendUpdaterClassStatusInfo(_param);
  152 + }
  153 + //暂停上课
  154 + pauseClass(_param){
  155 + GlobalConfig.classStatus=ApeConsts.CLASS_STATUS_PAUSE;
  156 + GlobalConfig.classStopTime=EngineUtils.creatTimestampStr();
  157 + _param.actionType=ACTION_TYPE_2;
  158 + this.sendUpdaterClassStatusInfo(_param);
  159 + }
  160 + //关闭课堂
  161 + closeClass(_param){
  162 + GlobalConfig.classStatus=ApeConsts.CLASS_STATUS_CLOSE;
  163 + GlobalConfig.classStopTime=EngineUtils.creatTimestampStr();
  164 + _param.actionType=ACTION_TYPE_3;
  165 + this.sendUpdaterClassStatusInfo(_param);
  166 + }
  167 + //更新课堂状态
  168 + updateClassStatus(_param){
  169 + GlobalConfig.classStatus=ApeConsts.CLASS_STATUS_UPTATE;
  170 + _param.actionType=ACTION_TYPE_4;
  171 + this.sendUpdaterClassStatusInfo(_param);
  172 + }
140 173
141 //更新会议信息 174 //更新会议信息
142 - sendUpdaterClassInfo(_param){  
143 - loger.log('sendUpdaterClassInfo----------'); 175 + sendUpdaterClassStatusInfo(_param){
  176 + loger.log('sendUpdaterClassStatusInfo----------');
144 if(_param==null||EngineUtils.isEmptyObject(_param)){ 177 if(_param==null||EngineUtils.isEmptyObject(_param)){
145 - loger.log('sendUpdaterClassInfo,参数错误'); 178 + loger.log('sendUpdaterClassStatusInfo,参数错误');
146 this._emit(MessageTypes.MCU_ERROR,MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); 179 this._emit(MessageTypes.MCU_ERROR,MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG);
147 return ; 180 return ;
148 } 181 }
149 - itemIdx=_param.itemIdx;  
150 - let whiteBoardModelPdu = this.packPdu(_param,itemIdx);  
151 - console.log(whiteBoardModelPdu); 182 + itemIdx=ApeConsts.CONFERENCE_OBJ_TABLE_ID;// itemIdx=_param.itemIdx;
  183 + let modelPdu = this.packPdu(_param,itemIdx);
  184 + //console.log(modelPdu);
152 185
153 - if(whiteBoardModelPdu==null){  
154 - loger.log('sendUpdaterClassInfo,参数错误'); 186 + if(modelPdu==null){
  187 + loger.log('sendUpdaterClassStatusInfo,参数错误');
155 this._emit(MessageTypes.MCU_ERROR,MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); 188 this._emit(MessageTypes.MCU_ERROR,MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG);
156 return ; 189 return ;
157 } 190 }
@@ -160,21 +193,21 @@ class ConferApe extends Ape { @@ -160,21 +193,21 @@ class ConferApe extends Ape {
160 tableItemPdu.itemIdx=itemIdx; 193 tableItemPdu.itemIdx=itemIdx;
161 tableItemPdu.owner = 0;//收到flash的是这个值,不清楚先写固定 194 tableItemPdu.owner = 0;//收到flash的是这个值,不清楚先写固定
162 tableItemPdu.registerObjId=ApeConsts.CONFERENCE_OBJ_TABLE_ID; 195 tableItemPdu.registerObjId=ApeConsts.CONFERENCE_OBJ_TABLE_ID;
163 - tableItemPdu.itemData =whiteBoardModelPdu.toArrayBuffer(); 196 + tableItemPdu.itemData =modelPdu.toArrayBuffer();
164 197
165 198
166 //updater 199 //updater
167 - let whiteBoardUpdateItem = new pdu['RCRegistryTableUpdateItemPdu']; 200 + let tableUpdateItem = new pdu['RCRegistryTableUpdateItemPdu'];
168 //optional RCPduType_E type = 1 [default = RCPDU_REG_TABLE_UPDATE_PDU]; 201 //optional RCPduType_E type = 1 [default = RCPDU_REG_TABLE_UPDATE_PDU];
169 //repeated RCRegistryTableItemPdu items = 2; 202 //repeated RCRegistryTableItemPdu items = 2;
170 - whiteBoardUpdateItem.type = pdu.RCPDU_REG_TABLE_UPDATE_PDU;//  
171 - whiteBoardUpdateItem.items.push(tableItemPdu); 203 + tableUpdateItem.type = pdu.RCPDU_REG_TABLE_UPDATE_PDU;//
  204 + tableUpdateItem.items.push(tableItemPdu);
172 205
173 206
174 let updateObjPdu = new pdu['RCRegistryUpdateObjPdu']; 207 let updateObjPdu = new pdu['RCRegistryUpdateObjPdu'];
175 updateObjPdu.objId = ApeConsts.CONFERENCE_OBJ_TABLE_ID; 208 updateObjPdu.objId = ApeConsts.CONFERENCE_OBJ_TABLE_ID;
176 - updateObjPdu.subType = whiteBoardUpdateItem.type;  
177 - updateObjPdu.userData = whiteBoardUpdateItem.toArrayBuffer(); 209 + updateObjPdu.subType = tableUpdateItem.type;
  210 + updateObjPdu.userData = tableUpdateItem.toArrayBuffer();
178 211
179 //同步 212 //同步
180 let adapterItemPdu = new pdu['RCAdapterItemPdu']; 213 let adapterItemPdu = new pdu['RCAdapterItemPdu'];
@@ -189,20 +222,20 @@ class ConferApe extends Ape { @@ -189,20 +222,20 @@ class ConferApe extends Ape {
189 this.sendUniform(adapterPdu,true); 222 this.sendUniform(adapterPdu,true);
190 } 223 }
191 224
192 - //更新会议状态 225 + /* //更新会议状态
193 sendUpdaterClassStatus(_param){ 226 sendUpdaterClassStatus(_param){
194 loger.log('sendUpdaterClassStatus----------'); 227 loger.log('sendUpdaterClassStatus----------');
195 if(_param==null||EngineUtils.isEmptyObject(_param)){ 228 if(_param==null||EngineUtils.isEmptyObject(_param)){
196 - loger.log('sendUpdaterClassInfo,参数错误'); 229 + loger.log('sendUpdaterClassStatusInfo,参数错误');
197 this._emit(MessageTypes.MCU_ERROR,MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); 230 this._emit(MessageTypes.MCU_ERROR,MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG);
198 return ; 231 return ;
199 } 232 }
200 itemIdx=_param.itemIdx; 233 itemIdx=_param.itemIdx;
201 - let whiteBoardModelPdu = this.packPdu(_param,itemIdx);  
202 - console.log(whiteBoardModelPdu); 234 + let modelPdu = this.packPdu(_param,itemIdx);
  235 + console.log(modelPdu);
203 236
204 - if(whiteBoardModelPdu==null){  
205 - loger.log('sendUpdaterClassInfo,参数错误'); 237 + if(modelPdu==null){
  238 + loger.log('sendUpdaterClassStatusInfo,参数错误');
206 this._emit(MessageTypes.MCU_ERROR,MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG); 239 this._emit(MessageTypes.MCU_ERROR,MessageTypes.ERR_APE_INTERFACE_PARAM_WRONG);
207 return ; 240 return ;
208 } 241 }
@@ -211,21 +244,21 @@ class ConferApe extends Ape { @@ -211,21 +244,21 @@ class ConferApe extends Ape {
211 tableItemPdu.itemIdx=itemIdx; 244 tableItemPdu.itemIdx=itemIdx;
212 tableItemPdu.owner = 0;//收到flash的是这个值,不清楚先写固定 245 tableItemPdu.owner = 0;//收到flash的是这个值,不清楚先写固定
213 tableItemPdu.registerObjId=ApeConsts.CONFERENCE_OBJ_TABLE_ID; 246 tableItemPdu.registerObjId=ApeConsts.CONFERENCE_OBJ_TABLE_ID;
214 - tableItemPdu.itemData =whiteBoardModelPdu.toArrayBuffer(); 247 + tableItemPdu.itemData =modelPdu.toArrayBuffer();
215 248
216 249
217 //updater 250 //updater
218 - let whiteBoardUpdateItem = new pdu['RCRegistryTableUpdateItemPdu']; 251 + let tableUpdateItem = new pdu['RCRegistryTableUpdateItemPdu'];
219 //optional RCPduType_E type = 1 [default = RCPDU_REG_TABLE_UPDATE_PDU]; 252 //optional RCPduType_E type = 1 [default = RCPDU_REG_TABLE_UPDATE_PDU];
220 //repeated RCRegistryTableItemPdu items = 2; 253 //repeated RCRegistryTableItemPdu items = 2;
221 - whiteBoardUpdateItem.type = pdu.RCPDU_REG_TABLE_UPDATE_PDU;//  
222 - whiteBoardUpdateItem.items.push(tableItemPdu); 254 + tableUpdateItem.type = pdu.RCPDU_REG_TABLE_UPDATE_PDU;//
  255 + tableUpdateItem.items.push(tableItemPdu);
223 256
224 257
225 let updateObjPdu = new pdu['RCRegistryUpdateObjPdu']; 258 let updateObjPdu = new pdu['RCRegistryUpdateObjPdu'];
226 updateObjPdu.objId = ApeConsts.CONFERENCE_OBJ_TABLE_ID; 259 updateObjPdu.objId = ApeConsts.CONFERENCE_OBJ_TABLE_ID;
227 - updateObjPdu.subType = whiteBoardUpdateItem.type;  
228 - updateObjPdu.userData = whiteBoardUpdateItem.toArrayBuffer(); 260 + updateObjPdu.subType = tableUpdateItem.type;
  261 + updateObjPdu.userData = tableUpdateItem.toArrayBuffer();
229 262
230 //同步 263 //同步
231 let adapterItemPdu = new pdu['RCAdapterItemPdu']; 264 let adapterItemPdu = new pdu['RCAdapterItemPdu'];
@@ -238,7 +271,7 @@ class ConferApe extends Ape { @@ -238,7 +271,7 @@ class ConferApe extends Ape {
238 271
239 console.log("会议发送更新数据111============"); 272 console.log("会议发送更新数据111============");
240 this.sendUniform(adapterPdu,true); 273 this.sendUniform(adapterPdu,true);
241 - } 274 + }*/
242 275
243 ///////白板数据的封包和解包///////////////////////////////////////// 276 ///////白板数据的封包和解包/////////////////////////////////////////
244 packPdu(_param,_itemIdx){ 277 packPdu(_param,_itemIdx){
@@ -249,19 +282,64 @@ class ConferApe extends Ape { @@ -249,19 +282,64 @@ class ConferApe extends Ape {
249 return null; 282 return null;
250 } 283 }
251 284
  285 +/* message RCClassStatusInfoPdu {
  286 + optional uint32 node_id=1;//mcu中的唯一ID
  287 + optional uint32 user_id=2;
  288 + optional uint32 user_name=3;
  289 + optional uint32 site_id=4;//站点号
  290 + optional uint32 class_id=5;
  291 + optional uint32 class_name=6;
  292 + required uint32 class_type=7;//课堂类型
  293 + required uint32 class_status=9;//课堂的状态
  294 + optional uint32 class_startTime=10;//课堂点击开始时间
  295 + optional uint32 class_stopTime=11;//最后一次停止的时间(点暂停或结束),每次发送数据都获取当前时间戳
  296 + optional uint32 class_timestamp=12;//相对于点开始课堂的时间戳
  297 + optional uint32 class_beginTime=13;//课堂创建的时间,这个是Sass返回的
  298 + optional uint32 class_endTime=14;//课堂结束的时间,这个是Sass返回的
  299 + optional uint32 record_status=15;//当前录制状态
  300 + optional uint32 record_timestamp=16;//相对于首次开始录制的时间戳
  301 + optional uint32 record_fileName=17;//录制的文件名
  302 + optional uint32 record_downloadUrl=18;//下载地址
  303 + optional uint32 server_timestamp=19;//当前的系统时间戳
  304 + }*/
  305 +
  306 + let classStatusInfo=new pdu['RCClassStatusInfoPdu'];
  307 + classStatusInfo.nodeId=GlobalConfig.nodeId;//mcu中的唯一ID
  308 + classStatusInfo.userId=GlobalConfig.userId;
  309 + classStatusInfo.userName=GlobalConfig.userName;
  310 + classStatusInfo.siteId=GlobalConfig.siteId;//站点号
  311 + classStatusInfo.classId=GlobalConfig.classId;
  312 + classStatusInfo.className=GlobalConfig.className;
  313 + classStatusInfo.classType=GlobalConfig.classType;//课堂类型
  314 + classStatusInfo.classStatus=GlobalConfig.classStatus;//课堂的状态
  315 + classStatusInfo.classStartTime=GlobalConfig.classStartTime;//课堂点击开始时间
  316 + classStatusInfo.classStopTime=GlobalConfig.classStopTime;//最后一次停止的时间(点暂停或结束),每次发送数据都获取当前时间戳
  317 + classStatusInfo.classTimestamp=GlobalConfig.classTimestamp;//相对于点开始课堂的时间戳
  318 + classStatusInfo.classBeginTime=GlobalConfig.classBeginTime;//课堂创建的时间,这个是Sass返回的
  319 + classStatusInfo.classEndTime=GlobalConfig.classEndTime;//课堂结束的时间,这个是Sass返回的
  320 + classStatusInfo.recordStatus=GlobalConfig.recordStatus;//当前录制状态
  321 + classStatusInfo.recordTimestamp=GlobalConfig.recordTimestamp;//相对于首次开始录制的时间戳
  322 + classStatusInfo.recordFileName=GlobalConfig.recordFileName;//录制的文件名
  323 + classStatusInfo.recordDownloadUrl=GlobalConfig.recordDownloadUrl;//下载地址
  324 + classStatusInfo.serverTimestamp=GlobalConfig.serverTimestamp;//当前的系统时间戳
  325 + classStatusInfo.activeDocId=GlobalConfig.activeDocId;//当前激活的文档id
  326 + classStatusInfo.activeDocCurPage=GlobalConfig.activeDocCurPage;//当前激活的文档的当前页
  327 +
  328 +
252 /* 329 /*
253 - optional uint32 class_status= 1;//当前课堂状态 //0:未开始,1,开始,2,暂停  
254 - optional string class_timestamp= 2;//目前用这个变量来记录时间 flash用的这个  
255 - optional item_idx=3;  
256 - optional from=4; 330 + optional uint32 item_idx=1;
  331 + optional uint32 from=2;
  332 + optional uint32 owner=3;
  333 + optional uint32 action_type=4;//状态改变的类型
  334 + optional RCClassStatusInfoPdu class_status_info=5;//当前课堂状态的信息
257 */ 335 */
258 //判断type类型,根据type设置不同的参数 336 //判断type类型,根据type设置不同的参数
259 let modelPdu =new pdu['RCClassSendDataModelPdu']; 337 let modelPdu =new pdu['RCClassSendDataModelPdu'];
260 modelPdu.itemIdx=_itemIdx; 338 modelPdu.itemIdx=_itemIdx;
261 - modelPdu.owner=GlobalConfig.nodeId;  
262 modelPdu.from=GlobalConfig.nodeId; 339 modelPdu.from=GlobalConfig.nodeId;
263 - modelPdu.classStatus =2;  
264 - modelPdu.classTimestamp=32532532; 340 + modelPdu.owner=GlobalConfig.nodeId;
  341 + modelPdu.actionType =_param.actionType;
  342 + modelPdu.classStatusInfo=classStatusInfo;
265 343
266 console.log(modelPdu); 344 console.log(modelPdu);
267 return modelPdu; 345 return modelPdu;
@@ -275,8 +353,8 @@ class ConferApe extends Ape { @@ -275,8 +353,8 @@ class ConferApe extends Ape {
275 } 353 }
276 354
277 try{ 355 try{
278 - let docModelPdu= pdu['RCClassSendDataModelPdu'].decode(itemData);  
279 - return docModelPdu; 356 + let modelPdu= pdu['RCClassSendDataModelPdu'].decode(itemData);
  357 + return modelPdu;
280 }catch (err){ 358 }catch (err){
281 loger.log("会议收到数据 unPackPdu Pdu解析错误,itemIdx="+itemIdx+" err:"+err.message); 359 loger.log("会议收到数据 unPackPdu Pdu解析错误,itemIdx="+itemIdx+" err:"+err.message);
282 } 360 }
@@ -23,6 +23,7 @@ import EngineUtils from 'EngineUtils'; @@ -23,6 +23,7 @@ import EngineUtils from 'EngineUtils';
23 23
24 let loger = Loger.getLoger('DocApe'); 24 let loger = Loger.getLoger('DocApe');
25 let itemIdx=0;//table插入新数据的计数id,目前用时间戳 25 let itemIdx=0;//table插入新数据的计数id,目前用时间戳
  26 +
26 class DocApe extends Ape { 27 class DocApe extends Ape {
27 constructor() { 28 constructor() {
28 super( 29 super(
@@ -31,16 +32,17 @@ class DocApe extends Ape { @@ -31,16 +32,17 @@ class DocApe extends Ape {
31 ApeConsts.DOCSHARING_SESSION_TAG 32 ApeConsts.DOCSHARING_SESSION_TAG
32 ); 33 );
33 this.docList = {};//记录文档的数组this.docList[itemIdx]=itemIdx的数据 34 this.docList = {};//记录文档的数组this.docList[itemIdx]=itemIdx的数据
34 - 35 + this.activeDocItemIdx =0;//当前激活的文档itemIdx
  36 + this.activeDocCurPage=1;//当前激活的文档的当前页
  37 + // 延迟
  38 + this._apeDelayed = true;
35 39
36 // Ape Models 40 // Ape Models
37 this.registerKey(this._session_id, this._session_name, this._session_tag, new ArrayBuffer); 41 this.registerKey(this._session_id, this._session_name, this._session_tag, new ArrayBuffer);
38 this.registerObj(pdu.RCPDU_REG_REGISTER_TABLE, ApeConsts.DOCSHARING_OBJ_TABLE_ID, ApeConsts.DOCSHARING_OBJ_TABLE_NAME, ApeConsts.DOCSHARING_OBJ_TABLE_TAG, 0, new ArrayBuffer); 42 this.registerObj(pdu.RCPDU_REG_REGISTER_TABLE, ApeConsts.DOCSHARING_OBJ_TABLE_ID, ApeConsts.DOCSHARING_OBJ_TABLE_NAME, ApeConsts.DOCSHARING_OBJ_TABLE_TAG, 0, new ArrayBuffer);
39 //this.registerObj(pdu.RCPDU_REG_REGISTER_TABLE, ApeConsts.DOCSHARING_OBJ_TABLE_ID_H5, ApeConsts.DOCSHARING_OBJ_TABLE_NAME_H5, ApeConsts.DOCSHARING_OBJ_TABLE_TAG_H5, 0, new ArrayBuffer); 43 //this.registerObj(pdu.RCPDU_REG_REGISTER_TABLE, ApeConsts.DOCSHARING_OBJ_TABLE_ID_H5, ApeConsts.DOCSHARING_OBJ_TABLE_NAME_H5, ApeConsts.DOCSHARING_OBJ_TABLE_TAG_H5, 0, new ArrayBuffer);
40 -  
41 - // 延迟  
42 - this._apeDelayed = true;  
43 } 44 }
  45 +
44 /////////////发送数据操作////////////////////////////////////////////////////// 46 /////////////发送数据操作//////////////////////////////////////////////////////
45 //上传文档 47 //上传文档
46 documentUpload(paramInfo){ 48 documentUpload(paramInfo){
@@ -282,6 +284,7 @@ class DocApe extends Ape { @@ -282,6 +284,7 @@ class DocApe extends Ape {
282 let itemDataInfo = this.unPackPdu(owner, itemIdx, itemData); 284 let itemDataInfo = this.unPackPdu(owner, itemIdx, itemData);
283 this.docList[itemIdx] = itemDataInfo; 285 this.docList[itemIdx] = itemDataInfo;
284 loger.log('tableInsertHandler',itemDataInfo); 286 loger.log('tableInsertHandler',itemDataInfo);
  287 + this._emit(MessageTypes.DOC_UPLOAD,itemDataInfo);
285 } 288 }
286 289
287 tableDeleteHandler(object_id, tableDeleteData){ 290 tableDeleteHandler(object_id, tableDeleteData){
@@ -296,6 +299,7 @@ class DocApe extends Ape { @@ -296,6 +299,7 @@ class DocApe extends Ape {
296 for (let i=0;i<len;i++){ 299 for (let i=0;i<len;i++){
297 if(this.docList[itemIdxs[i]]){ 300 if(this.docList[itemIdxs[i]]){
298 loger.log("删除文档数据:",itemIdxs[i]); 301 loger.log("删除文档数据:",itemIdxs[i]);
  302 + this._emit(MessageTypes.DOC_DELETE,itemIdxs[i]);
299 delete this.docList[itemIdxs[i]]; 303 delete this.docList[itemIdxs[i]];
300 } 304 }
301 } 305 }
@@ -307,6 +311,7 @@ class DocApe extends Ape { @@ -307,6 +311,7 @@ class DocApe extends Ape {
307 if(itemDataInfo!=null){ 311 if(itemDataInfo!=null){
308 this.docList[itemIdx] = itemDataInfo; 312 this.docList[itemIdx] = itemDataInfo;
309 loger.log('tableUpdateHandler',itemDataInfo); 313 loger.log('tableUpdateHandler',itemDataInfo);
  314 + this._emit(MessageTypes.DOC_UPDATE,itemDataInfo);
310 }else { 315 }else {
311 loger.log('tableUpdateHandler 数据无效--> itemIdx',itemIdx); 316 loger.log('tableUpdateHandler 数据无效--> itemIdx',itemIdx);
312 } 317 }
@@ -864,10 +864,33 @@ message RCWhiteBoardDataModel { @@ -864,10 +864,33 @@ message RCWhiteBoardDataModel {
864 optional bytes data = 13;//暂时预留的参数 864 optional bytes data = 13;//暂时预留的参数
865 } 865 }
866 message RCClassSendDataModelPdu { 866 message RCClassSendDataModelPdu {
867 - optional uint32 class_status= 1;//当前课堂状态 //0:未开始,1,开始,2,暂停  
868 - optional uint32 class_timestamp= 2;//目前用这个变量来记录时间 flash用的这个  
869 - optional uint32 item_idx=3;  
870 - optional uint32 from=4; 867 + optional uint32 item_idx=1;
  868 + optional uint32 from=2;
  869 + optional uint32 owner=3;
  870 + optional uint32 action_type=4;//状态改变的类型
  871 + optional RCClassStatusInfoPdu class_status_info=5;//当前课堂状态的信息
  872 +}
  873 +message RCClassStatusInfoPdu {
  874 + optional uint32 node_id=1;//mcu中的唯一ID
  875 + optional string user_id=2;
  876 + optional string user_name=3;
  877 + optional string site_id=4;//站点号
  878 + optional uint32 class_id=5;
  879 + optional string class_name=6;
  880 + required uint32 class_type=7;//课堂类型
  881 + required uint32 class_status=9;//课堂的状态
  882 + optional string class_startTime=10;//课堂点击开始时间
  883 + optional string class_stopTime=11;//最后一次停止的时间(点暂停或结束),每次发送数据都获取当前时间戳
  884 + optional uint32 class_timestamp=12;//相对于点开始课堂的时间戳
  885 + optional string class_beginTime=13;//课堂创建的时间,这个是Sass返回的
  886 + optional string class_endTime=14;//课堂结束的时间,这个是Sass返回的
  887 + optional bool record_status=15;//当前录制状态
  888 + optional uint32 record_timestamp=16;//相对于首次开始录制的时间戳
  889 + optional string record_fileName=17;//录制的文件名
  890 + optional string record_downloadUrl=18;//下载地址
  891 + optional uint32 server_timestamp=19;//当前的系统时间戳
  892 + optional uint32 active_doc_id=20;//当前激活的文档id
  893 + optional uint32 active_doc_cur_page=21;//当前激活的文档的当前页
871 } 894 }
872 895
873 //end 896 //end