水库泄洪调度演示
演示效果为:绘制水库为立体状,底面高程是baseHeight,顶面高程在minHeight到maxHeight之间随时间变化
真实数据值: 演示时获取
演示效果为:绘制水库为立体状,底面高程是baseHeight,顶面高程在minHeight到maxHeight之间随时间变化
真实数据值: 演示时获取
ReservoirSimulation#currentRecord
查看,该记录存值为比例形式0-1小数,通过 ReservoirSimulation#metadata
可计算
Name | Type | Description | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
具有如下属性
|
Example:
function getCurrentProperty(propertyName, metadata) {
const currentRecord = reservoirSimulation.currentRecord;
if (currentRecord === null) {
return String(undefined);
}
let property = currentRecord[propertyName];
if (property !== null) {
property = metadata[propertyName].min + (metadata[propertyName].max - metadata[propertyName].min) * property;
return String(property.toFixed(4));
}
return String(undefined);
}
reservoirSimulation.progressEvent.addEventListener(function(reservoirSimulation) {
const metadata = reservoirSimulation.metadata;
const quantityIn = getCurrentProperty("quantityIn", metadata);
const quantityOut = getCurrentProperty("quantityOut", metadata);
const height = getCurrentProperty("height", metadata);
const tempDate = new Date(reservoirSimulation._startTime.getTime());
tempDate.setSeconds(
reservoirSimulation.startTime.getSeconds() +
reservoirSimulation._stepSliceIndex * reservoirSimulation.intervalTime
);
document.getElementById("reservoir_progressEvent").innerText = `进度:\t${reservoirSimulation.progress.toFixed(4)}\n` +
`对应时刻:\t${tempDate.toLocaleString()}\n` +
`时刻切分索引:\t${reservoirSimulation._stepSliceIndex}\n` +
`出库流量:\t${quantityOut}\n` +
`入库流量:\t${quantityIn}\n` +
`水面高度:\t${height}\n`;
})
Members
基础高度,水库底面高程
baseWaterColor : Color
水面基础颜色
当前时刻对应的水库状态记录。
结束时刻,来自元数据的json描述.来自元数据的json描述.
水库库区多边形geojson数据源地址,仅使用geojson内第一个多边形的坐标
guid
时刻间隔时长,单位为秒,来自元数据的json描述.
水库顶面的最大高程
元数据.
水库调度过程中元数据地址
水库顶面的最小高程
倍速。取值0.0 - 1.0将放慢,大于1.0将加速。
例如:
假设:
ReservoirSimulation#physicalSeconds
为200秒,设置当前倍速参数为200,则该次模拟将在1秒内播放完.
假设:ReservoirSimulation#intervalTime
为200秒,设置当前倍速参数为200,则该次模拟将在每隔1秒更新一次数据.
进度,为0.0-1.0之间的小数.
readonly progressEvent : Event
进度更新事件,暂停后将不触发
标记是否已解析完元数据,在
ReservoirSimulation#readyPromise
触发前更新为true
-
Default Value:
false
readonly readyPromise : Promise.<ReservoirSimulation>
解析完元数据的异步对象
readonly rectangle : Rectangle|null
水库库区的矩形范围
初始时刻时间,来自元数据的json描述.
步总数,即模拟时刻的总个数,int型.来自元数据的json描述.
Methods
销毁资源
Returns:
是否已销毁
Returns:
暂停,对应有
ReservoirSimulation#continue
从头开始播放(重新播放),对应有
ReservoirSimulation#stop