Class: FdProcessSimulation

FdMicroApp. FdProcessSimulation

BIM模型建造过程模拟类 用显隐控制来模拟构件的建造过程


new FdProcessSimulation(viewer, schedule, model [, options])

Parameters:
Name Type Argument Description
viewer Freedo.viewer

三维视窗

schedule Object

进度配置信息数据

model string | Freedo.FreedoPModelset | Array.<string> | Array.<Freedo.FreedoPModelset>

模型信息,支持四种格式

options Object <optional>

配置参数,可能包含以下属性:

Properties
Name Type Argument Default Description
key String <optional>
'planStart'

任务计划数据中对应时间的键名,表示用哪一个时间属性来进行进度模拟

speed Number <optional>
1000

表示动画的时间间隔,单位:ms

step Number <optional>
1

表示进度时间间隔,单位:天

Example
var data = {
  tasks: [
    {
      name: '任务名-正常完工',
      id: [],
      uid: ["1541802_140@4","1541803_140@4"],
      planStart: '20181212', // 计划开始时间
      planEnd: '20181230', // 计划完工时间
      realStart: '20181212', // 实际开工时间
      realEnd: '20181230', // 实际完工时间
      tip: '实际完成时间跟计划完成时间一样'
    },
    // ...
  ]
}

var ps = new Freedo.FdMicroApp.FdProcessSimulation(viewer, data, pModel, {
  key: 'planStart', // 使用上面数据中的'planStart'键名所对应的时间值进行进度模拟;该示例数据可选的其他值为'planEnd', 'realStart', 'realEnd'
  speed: 300, // 动画时间间隔(ms)
  step: 1 // 进度时间间隔(天)
});

ps.on(funciton(et, ev) {
  if (et === 'ProcessChanged') {
    // 监听进度改变事件
  }
  
  if (et === 'Completed') {
    // 监听进度完成事件
  }
});

ps.start(); // 开始进度模拟

Members


<readonly> option

获取配置参数


<readonly> prop

获取进度相关属性: speed, step, key, stepStamp, startStamp, endStamp, total


<readonly> ready

模型是否准备完成


<readonly> tasks

获取任务数据

Methods


distroy()

销毁


end()

结束


getUid(feature)

获取构件uid

Parameters:
Name Type Description
feature Freedo.FreedoPModelFeature

on(listener [, scope])

注册事件捕捉

Parameters:
Name Type Argument Description
listener FdMicroApp.FdProcessSimulation~FdProcessSimulationCallback

当有事件触发时被执行的函数。

scope Object <optional>

listener函数执行时的绑定的对象。

Returns:

返回一个函数,调用该函数可以取消监听。

Type
Freedo.Event~RemoveCallback

pause()

暂停


setData(option)

设置参数

Parameters:
Name Type Description
option Object

参数配置


start()

开始

Type Definitions


FdProcessSimulationCallback(eventType, eventArg)

Parameters:
Name Type Description
eventType String

事件类型有:Start(开始) / ProcessChanged(进度改变) / Completed(进度完成)

eventArg Object

Start五返回值,ProcessChanged返回当前进度,Completed无返回值