!1318 优化:拆单失败亮显发送图纸

pull/1318/MERGE
ZoeLeeFZ 4 years ago committed by ChenX
parent d54f8ac2ac
commit a3c9c00a16

@ -0,0 +1,7 @@
export const ReportFunctionList: ((msg: string) => void)[] = [];
export function SendReport(msg: string)
{
for (let f of ReportFunctionList)
f(msg);
}

@ -0,0 +1,10 @@
import { Object3D } from "three";
import { Entity } from "../DatabaseServices/Entity/Entity";
export const ShowObjectsFunctionList: ((ens: (Entity[]) | Object3D[]) => void)[] = [];
export function ShowSelectObjects(ens: (Entity[]) | Object3D[])
{
for (let f of ShowObjectsFunctionList)
f(ens);
}

@ -29,6 +29,9 @@ import { Entity } from './../DatabaseServices/Entity/Entity';
import { ICompHardwareOption } from './../UI/Components/RightPanel/RightPanelInterface'; import { ICompHardwareOption } from './../UI/Components/RightPanel/RightPanelInterface';
import { CanDrawHoleFuzz } from "../Geometry/DrillParse/BoardGetFace"; import { CanDrawHoleFuzz } from "../Geometry/DrillParse/BoardGetFace";
import { Intent, Toaster } from "../Common/Toaster"; import { Intent, Toaster } from "../Common/Toaster";
import { SendReport } from "../Common/Report";
import { ShowSelectObjects } from "../Common/ShowSelectObjects";
import { IsDev } from "../Common/Deving";
/**板件轮廓数据 */ /**板件轮廓数据 */
@ -152,6 +155,7 @@ export namespace Production
timeout: 8000, timeout: 8000,
intent: Intent.DANGER, intent: Intent.DANGER,
}); });
Report([br], br.Name + " 轮廓错误");
return undefined; return undefined;
} }
let outline = GetSealedBoardContour(br, false); let outline = GetSealedBoardContour(br, false);
@ -163,6 +167,7 @@ export namespace Production
timeout: 8000, timeout: 8000,
intent: Intent.DANGER, intent: Intent.DANGER,
}); });
Report([br], br.Name + "扣除封边轮廓有误");
return; return;
} }
@ -997,4 +1002,10 @@ export namespace Production
pl.CloseMark = true; pl.CloseMark = true;
return pl; return pl;
} }
export function Report(ens: Entity[], msg: string)
{
if (IsDev()) return;
ShowSelectObjects(ens);
SendReport(msg);
}
} }

@ -20,6 +20,14 @@ import { RightPanelStore } from '../Store/RightPanelStore/RightPanelStore';
import { TopPanelStore } from '../Store/TopPanelStore'; import { TopPanelStore } from '../Store/TopPanelStore';
import { ToasterInjectFunctions, IToasterOption } from '../../Common/Toaster'; import { ToasterInjectFunctions, IToasterOption } from '../../Common/Toaster';
import { ShowLinesToaster } from '../Components/Toaster'; import { ShowLinesToaster } from '../Components/Toaster';
import { ReportFunctionList } from '../../Common/Report';
import { ReportError } from '../../Common/ErrorMonitoring';
import { FileServer } from '../../DatabaseServices/FileServer';
import { PostJson } from '../../Common/Request';
import { ErrorReportUrl } from '../../Common/HostUrl';
import { ShowObjectsFunctionList } from '../../Common/ShowSelectObjects';
import { Object3D } from 'three';
import { Entity } from '../../DatabaseServices/Entity/Entity';
export let appUi: WebCAD; export let appUi: WebCAD;
@ -65,7 +73,23 @@ export class WebCAD
intent: option.intent, intent: option.intent,
}, option.key ?? ""); }, option.key ?? "");
}); });
let fileServer = FileServer.GetInstance() as FileServer;
ReportFunctionList.push(async (msg: string) =>
{
if (!fileServer.m_CurFileId)
return;
ReportError(fileServer.m_CurFileId, "报告错误! 原因:" + msg);
PostJson(ErrorReportUrl, { file_id: fileServer.m_CurFileId });
});
ShowObjectsFunctionList.push((ens: Object3D[] | Entity[]) =>
{
if (ens.length === 0) return;
if (ens[0] instanceof Object3D)
app.Viewer.OutlinePass.selectedObjects = ens as Object3D[];
else
app.Viewer.OutlinePass.selectedObjects = (ens as Entity[]).map(e => e.DrawObject);
});
} }
//初始化顶层布局 上中下布局 //初始化顶层布局 上中下布局

Loading…
Cancel
Save