mirror of https://gitee.com/cf-fz/WebCAD.git
!2129 功能:酷家乐配置导入导出功能
parent
319f9f3fe9
commit
0cd83bbef4
@ -0,0 +1,45 @@
|
||||
import { CADFiler } from "../../../DatabaseServices/CADFiler";
|
||||
import { KJLImportConfigOption } from "./KJLImportConfigOption";
|
||||
|
||||
export function serializeKJLConfigData(file: CADFiler, conf: KJLImportConfigOption)
|
||||
{
|
||||
file.Write(conf.version);
|
||||
file.WriteBool(conf.isImportVirtualModel);
|
||||
file.Write(conf.kjlUseName);
|
||||
|
||||
file.Write2dArray(conf.edgeValueMap);
|
||||
file.Write2dArray(conf.drillValueMap);
|
||||
|
||||
file.Write(conf.materials.length);
|
||||
for (let material of conf.materials)
|
||||
{
|
||||
file.Write(material.kjlName);
|
||||
file.Write(material.id);
|
||||
}
|
||||
}
|
||||
|
||||
export function deserializeKJLConfigData(file: CADFiler, option: KJLImportConfigOption)
|
||||
{
|
||||
option.version = file.Read();
|
||||
option.isImportVirtualModel = file.ReadBool();
|
||||
option.kjlUseName = file.Read();
|
||||
|
||||
let count = file.Read();
|
||||
option.edgeValueMap = file.Read2dArray(count);
|
||||
|
||||
count = file.Read();
|
||||
option.drillValueMap = file.Read2dArray(count);
|
||||
|
||||
count = file.Read();
|
||||
let materials = [];
|
||||
for (let i = 0; i < count; i++)
|
||||
{
|
||||
materials.push({ kjlName: file.Read(), id: file.Read() });
|
||||
}
|
||||
option.materials = materials;
|
||||
|
||||
if (option.version > 5)
|
||||
{
|
||||
//需要的时候这里开始迭代
|
||||
}
|
||||
}
|
Loading…
Reference in new issue