| | |
| | | |
| | | this.isPause = false; |
| | | this.isRunning = false; |
| | | this.isStop = false; |
| | | // 是否开启动态绘制速度 |
| | | this.dynamicSpeed = false; |
| | | // 每个任务耗时(秒) |
| | |
| | | start: function () { |
| | | if (this.intervalFlag != undefined) { |
| | | this.isPause = false; |
| | | this.isStop = false; |
| | | } else { |
| | | this.isRunning = true; |
| | | this._doTask(); |
| | |
| | | |
| | | this.isRunning = false; |
| | | this.isPause = false; |
| | | this.isStop = true; |
| | | this.lastestTime = undefined; |
| | | this.speed = 1; |
| | | }, |
| | | setOnStopCallback: function (callback) { |
| | | this.onStopCallback = callback; |
| | |
| | | if (this.isPause) { |
| | | return; |
| | | } |
| | | if (index >= t.count) { |
| | | // 绘制3D图形时,最少需要2个点才可绘制图形 |
| | | // 因此此处索引只到倒数第二个点就结束 |
| | | if (index >= t.count - 1) { |
| | | this._endTask(this.intervalFlag); |
| | | return; |
| | | } |
| | | t.task(t.data, index, t.count); |
| | | |
| | | index += this.speed; |
| | | // console.log("_doTask:" + index); |
| | | }, this.timeout); |
| | | } |
| | | }, |