Initial commit: 大陆架零部件智能生产线数字孪生系统
- 实现TV1和TV2双大屏展示 - 集成ECharts数据可视化 - 实现实时数据刷新机制 - 添加刀具寿命管理模块 - 添加工单加工时长统计模块 - 添加加工中心7日工作时长统计模块 - 添加OEE分析、设备状态监控等功能 - 创建技术文档和使用说明书
This commit is contained in:
41
src/components/DMT/libs/bvh/utils/BufferUtils.js
Normal file
41
src/components/DMT/libs/bvh/utils/BufferUtils.js
Normal file
@@ -0,0 +1,41 @@
|
||||
export function isSharedArrayBufferSupported() {
|
||||
|
||||
return typeof SharedArrayBuffer !== 'undefined';
|
||||
|
||||
}
|
||||
|
||||
export function convertToBufferType( array, BufferConstructor ) {
|
||||
|
||||
if ( array === null ) {
|
||||
|
||||
return array;
|
||||
|
||||
} else if ( array.buffer ) {
|
||||
|
||||
const buffer = array.buffer;
|
||||
if ( buffer.constructor === BufferConstructor ) {
|
||||
|
||||
return array;
|
||||
|
||||
}
|
||||
|
||||
const ArrayConstructor = array.constructor;
|
||||
const result = new ArrayConstructor( new BufferConstructor( buffer.byteLength ) );
|
||||
result.set( array );
|
||||
return result;
|
||||
|
||||
} else {
|
||||
|
||||
if ( array.constructor === BufferConstructor ) {
|
||||
|
||||
return array;
|
||||
|
||||
}
|
||||
|
||||
const result = new BufferConstructor( array.byteLength );
|
||||
new Uint8Array( result ).set( new Uint8Array( array ) );
|
||||
return result;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user