!1426 功能:BBS统计通孔,双头杆数量

pull/1426/MERGE
ZoeLeeFZ 4 years ago committed by ChenX
parent 6aeb76389e
commit 3ecb8538b8

@ -12,6 +12,7 @@ import { HardwareCompositeEntity } from "../../DatabaseServices/Hardware/Hardwar
import { HardwareTopline } from "../../DatabaseServices/Hardware/HardwareTopline"; import { HardwareTopline } from "../../DatabaseServices/Hardware/HardwareTopline";
import { equaln } from "../../Geometry/GeUtils"; import { equaln } from "../../Geometry/GeUtils";
import { IHardwareType, Production } from "../../Production/Product"; import { IHardwareType, Production } from "../../Production/Product";
import { HoleInBoard } from "../DrawDrilling/HoleUtils";
export interface ICountType<T = IHardwareType> export interface ICountType<T = IHardwareType>
{ {
@ -121,46 +122,72 @@ class LookOverBoardInfosTool
{ {
for (let ids of idList) for (let ids of idList)
{ {
let holes = ids.map(id => id.Object) as Hole[];
if (!holes[0] || !HoleInBoard(holes, b))
continue;
let isTk = false;
let spliteName = "";
let hole: Hole;
let pxlCount = 0;
findHole: findHole:
for (let objId of ids) for (let objId of ids)
{ {
let gd = objId.Object; let gd = objId.Object as CylinderHole | ExtrudeHole;
if (!gd?.IsErase) if (!gd || gd.IsErase) break;
const group = gd.GroupId?.Object as GroupRecord;
if (!group)
{ {
Toaster({ message: `柜名:${b.BoardProcessOption.cabinetName} 板名:${b.Name} 的排钻的编组丢失,统计排钻个数时会丢失该个数!`, timeout: 5000, intent: Intent.DANGER });
break;
}
if (gd instanceof CylinderHole) if (gd instanceof CylinderHole)
switch (gd.Type) switch (gd.Type)
{ {
case GangDrillType.Ljg:
case GangDrillType.Pxl: case GangDrillType.Pxl:
case GangDrillType.Ymj: pxlCount++;
break;
case GangDrillType.Ljg: case GangDrillType.Ljg:
case GangDrillType.Ymj:
break;
case GangDrillType.TK: case GangDrillType.TK:
let spiteName = (gd.GroupId?.Object as GroupRecord)?.Name ?? "未命名"; isTk = true;
//读取拆单名 break;
addDrillToMap(spiteName, gd);
break findHole;
case GangDrillType.Wood: case GangDrillType.Wood:
case GangDrillType.WoodPXL: case GangDrillType.WoodPXL:
addDrillToMap("木销", gd); spliteName = "木销";
break;
default:
break findHole; break findHole;
} }
else else
{ {
//TODO:统计自定义排钻 if (gd.isThrough)
if (gd instanceof ExtrudeHole) isTk = true;
}
if (!spliteName)
spliteName = group.Name ?? "未命名";
if (!hole)
hole = gd;
}
if (spliteName && hole)
{ {
if (gd?.GroupId?.Object) if (isTk)
{ {
let name = (gd.GroupId.Object as GroupRecord).Name; addDrillToMap("通孔" + spliteName, hole);
let ents = (gd.GroupId.Object as GroupRecord).Entitys;
addDrillToMap(name, ents[0].Object as Hole);
} }
else else if (pxlCount === 2)
{ {
Toaster({ message: `柜名:${b.BoardProcessOption.cabinetName} 板名:${b.Name} 的排钻的编组丢失,统计排钻个数时会丢失该个数!`, timeout: 5000, intent: Intent.DANGER }); addDrillToMap("双头" + spliteName, hole);
}
}
} }
else
{
addDrillToMap(spliteName, hole);
} }
} }
} }

@ -324,6 +324,7 @@ export class Board extends ExtrudeSolid
{ {
if (br.__OriginalEnt__) if (br.__OriginalEnt__)
{ {
br._Name = this._Name;
br._DrillList = new Map(this._DrillList.entries()); br._DrillList = new Map(this._DrillList.entries());
br._LayerNails = [...this._LayerNails]; br._LayerNails = [...this._LayerNails];
br.ProcessingGroupList = [...this.ProcessingGroupList]; br.ProcessingGroupList = [...this.ProcessingGroupList];

@ -229,7 +229,6 @@ export class LookOverBoardInfosModal extends React.Component<LookOverBoardInfosM
this.InitWidth(); this.InitWidth();
let selectCtrl = app.Editor.SelectCtrl; let selectCtrl = app.Editor.SelectCtrl;
let dr = new DrillingReactor();
const UpdateByRedoUndo = (historyRec: CommandHistoryRecord) => const UpdateByRedoUndo = (historyRec: CommandHistoryRecord) =>
{ {
loop1: loop1:
@ -295,7 +294,7 @@ export class LookOverBoardInfosModal extends React.Component<LookOverBoardInfosM
e.stopPropagation(); e.stopPropagation();
return true; return true;
}), }),
end(dr, dr.StartReactor, () => end(app._drillingReactor, app._drillingReactor.StartReactor, () =>
{ {
this.UpdateDrillCount(this.dataList.realBr); this.UpdateDrillCount(this.dataList.realBr);
}), }),
@ -869,7 +868,6 @@ export class LookOverBoardInfosModal extends React.Component<LookOverBoardInfosM
const listItemHeight = 23; const listItemHeight = 23;
return ( return (
<>
<div <div
className={Classes.DIALOG_CONTAINER} className={Classes.DIALOG_CONTAINER}
style={{ width: "100%", height: "100%" }} style={{ width: "100%", height: "100%" }}
@ -987,7 +985,6 @@ export class LookOverBoardInfosModal extends React.Component<LookOverBoardInfosM
</ModalFooter> </ModalFooter>
</div> </div>
</div> </div>
</>
); );
} }
} }

@ -162,6 +162,8 @@ export class KnifeManage extends Component<IKnifeManageProps, IKnifeManageState>
} }
}; };
private handleCreateKnife = async (name: string, currentDir: IDirectoryProps, callback: Function) => private handleCreateKnife = async (name: string, currentDir: IDirectoryProps, callback: Function) =>
{
await CommandWrap(async () =>
{ {
let plRes = await app.Editor.GetSelection({ let plRes = await app.Editor.GetSelection({
Once: true, Once: true,
@ -229,6 +231,8 @@ export class KnifeManage extends Component<IKnifeManageProps, IKnifeManageState>
}); });
await callback(); await callback();
} }
}, this.currentInfo.id ? "更新刀具" : "选择刀具");
}; };
handleRenameKP = async (name: string) => handleRenameKP = async (name: string) =>

@ -62,7 +62,7 @@ export class ModelingComponent2 extends React.Component<{ store?: Modeling2Store
<div> <div>
{ {
d.items.map((item, i) => d.items.map((item, i) =>
<div key={i}> <div key={d1items[i].id}>
{ {
!is3D && <ToasterInput !is3D && <ToasterInput
type={CheckObjectType.OnlyNumber} type={CheckObjectType.OnlyNumber}

@ -13,6 +13,7 @@ export interface IKnifeInfo2
export interface IVModelingInfo export interface IVModelingInfo
{ {
id: string;
offset: number; offset: number;
depth: number; depth: number;
knife: IKnifeInfo2; knife: IKnifeInfo2;
@ -39,10 +40,15 @@ export class Modeling2Store implements IConfigStore
@observable modelingItems: IModeling2Item[] = []; @observable modelingItems: IModeling2Item[] = [];
@observable uiModeingItems: IUiVModeing[] = []; @observable uiModeingItems: IUiVModeing[] = [];
isUpdate = true; isUpdate = true;
private _ModelingItemId = 0;
constructor() constructor()
{ {
this.InitModelingItems(); this.InitModelingItems();
} }
get Id()
{
return `${Date.now()}-${this._ModelingItemId++}`;
}
@action @action
InitModelingItems() InitModelingItems()
{ {
@ -57,6 +63,7 @@ export class Modeling2Store implements IConfigStore
dir: FaceDirection.Front, dir: FaceDirection.Front,
items: [ items: [
{ {
id: this.Id,
offset: 0, offset: 0,
depth: 0, depth: 0,
knife: { id: "", name: "", props: { radius: 3, angle: 45 } } knife: { id: "", name: "", props: { radius: 3, angle: 45 } }
@ -96,10 +103,12 @@ export class Modeling2Store implements IConfigStore
{ {
const items = this.modelingItems[index].items; const items = this.modelingItems[index].items;
items.push({ const newItem = {
...items[0], ...items[0],
knife: { ...items[0].knife, props: { ...items[0].knife.props } } knife: { ...items[0].knife, props: { ...items[0].knife.props } }
}); };
newItem.id = this.Id;
items.push(newItem);
this.uiModeingItems[index].items.push({ this.uiModeingItems[index].items.push({
offset: "0", offset: "0",
depth: "0", depth: "0",
@ -114,6 +123,7 @@ export class Modeling2Store implements IConfigStore
ChangeModelingValue(index: number, data: I2DModeling) ChangeModelingValue(index: number, data: I2DModeling)
{ {
let newItems: IVModelingInfo[] = data.items.map(item => ({ let newItems: IVModelingInfo[] = data.items.map(item => ({
id: this.Id,
offset: item.offset, offset: item.offset,
depth: item.depth, depth: item.depth,
knife: { knife: {
@ -133,6 +143,7 @@ export class Modeling2Store implements IConfigStore
ChangeModelingValue3D(index: number, item: { knife: IKnifeInfo, dir: FaceDirection; }) ChangeModelingValue3D(index: number, item: { knife: IKnifeInfo, dir: FaceDirection; })
{ {
let newItem = { let newItem = {
id: this.Id,
dir: item.dir, dir: item.dir,
offset: 0, offset: 0,
depth: 0, depth: 0,
@ -170,6 +181,8 @@ export class Modeling2Store implements IConfigStore
uiItems.length = items.length; uiItems.length = items.length;
for (let j = 0; j < items.length; j++) for (let j = 0; j < items.length; j++)
{ {
if (!items[j].id)
items[j].id = this.Id;
if (uiItems[j]) if (uiItems[j])
{ {
uiItems[j].depth = items[j].depth.toString(); uiItems[j].depth = items[j].depth.toString();

Loading…
Cancel
Save