!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 { equaln } from "../../Geometry/GeUtils";
import { IHardwareType, Production } from "../../Production/Product";
import { HoleInBoard } from "../DrawDrilling/HoleUtils";
export interface ICountType<T = IHardwareType>
{
@ -121,46 +122,72 @@ class LookOverBoardInfosTool
{
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:
for (let objId of ids)
{
let gd = objId.Object;
if (!gd?.IsErase)
let gd = objId.Object as CylinderHole | ExtrudeHole;
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)
switch (gd.Type)
{
case GangDrillType.Ljg:
case GangDrillType.Pxl:
case GangDrillType.Ymj:
pxlCount++;
break;
case GangDrillType.Ljg:
case GangDrillType.Ymj:
break;
case GangDrillType.TK:
let spiteName = (gd.GroupId?.Object as GroupRecord)?.Name ?? "未命名";
//读取拆单名
addDrillToMap(spiteName, gd);
break findHole;
isTk = true;
break;
case GangDrillType.Wood:
case GangDrillType.WoodPXL:
addDrillToMap("木销", gd);
spliteName = "木销";
break;
default:
break findHole;
}
else
{
//TODO:统计自定义排钻
if (gd instanceof ExtrudeHole)
if (gd.isThrough)
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;
let ents = (gd.GroupId.Object as GroupRecord).Entitys;
addDrillToMap(name, ents[0].Object as Hole);
addDrillToMap("通孔" + spliteName, 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__)
{
br._Name = this._Name;
br._DrillList = new Map(this._DrillList.entries());
br._LayerNails = [...this._LayerNails];
br.ProcessingGroupList = [...this.ProcessingGroupList];

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

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

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

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

Loading…
Cancel
Save