!1386 功能:设置板件纹路快捷命令

pull/1386/MERGE
ZoeLeeFZ 4 years ago committed by ChenX
parent 9976636d71
commit 7923f52f75

@ -0,0 +1,28 @@
import { app } from "../../ApplicationServices/Application";
import { EBoardKeyList } from "../../Common/BoardKeyList";
import { Board } from "../../DatabaseServices/Entity/Board";
import { Command } from "../../Editor/CommandMachine";
import { PromptStatus } from "../../Editor/PromptResult";
import { LinesType } from "../../UI/Store/BoardInterface";
export class SetBoardLines implements Command
{
constructor(private lines: LinesType)
{
}
async exec()
{
let brRes = await app.Editor.GetSelection({
Msg: "选择需要设置纹路的板件",
Filter: { filterTypes: [Board] },
UseSelect: true,
});
if (brRes.Status === PromptStatus.Cancel) return;
let brs = brRes.SelectSet.SelectEntityList as Board[];
for (let br of brs)
br.BoardProcessOption[EBoardKeyList.Lines] = this.lines;
}
}

@ -16,6 +16,7 @@ const ForbidReactorCmd = new Set([
CommandNames.DeleteHole, CommandNames.Hole, CommandNames.LookOverBoardInfos,
CommandNames.ChangeColorByMaterial, CommandNames.RestoreColor,
'PZ', 'ENT', 'BBS',
CommandNames.ZhengWen, CommandNames.FanWen, CommandNames.KeFanZuan,
CommandNames.Show, CommandNames.HideSelect, CommandNames.HideUnSelect]);
export class DrillingReactor

@ -197,4 +197,7 @@ export enum CommandNames
R2B2 = "RECT2BOARD2",
FixIntSelfContour = "FIXINTSELFCONTOUR",
ParseHinge = "PARSEHINGE",//分析门板的铰链
ZhengWen = "ZHENGWEN",
FanWen = "FANWEN",
KeFanZuan = "KEFANZUAN",
}

@ -217,6 +217,7 @@ import { BuyMaterial } from './../Add-on/BuyMaterial';
import { Interfere } from './../Add-on/interfere';
import { ShowKinfeManageModal } from './../Add-on/showModal/ShowKnifeManageModal';
import { commandMachine } from './CommandMachine';
import { SetBoardLines } from "../Add-on/BoardEditor/SetBoardLines";
export function registerCommand()
{
@ -603,6 +604,10 @@ export function registerCommand()
commandMachine.RegisterCommand(CommandNames.FixIntSelfContour, new FixIntersectSelfContour());
commandMachine.RegisterCommand(CommandNames.ParseHinge, new ParseHinge());
commandMachine.RegisterCommand(CommandNames.ZhengWen, new SetBoardLines(0));
commandMachine.RegisterCommand(CommandNames.FanWen, new SetBoardLines(1));
commandMachine.RegisterCommand(CommandNames.KeFanZuan, new SetBoardLines(2));
}
export async function RegistCustomCommand()

@ -605,6 +605,33 @@ export const CommandList: ICommand[] = [
chName: "查找造型刀半径",
chDes: "查找造型刀半径",
},
{
typeId: "bjbj",
link: "#",
defaultCustom: CommandNames.ZhengWen,
command: CommandNames.ZhengWen,
type: "板件编辑",
chName: "板件正纹",
chDes: "板件正纹",
},
{
typeId: "bjbj",
link: "#",
defaultCustom: CommandNames.FanWen,
command: CommandNames.FanWen,
type: "板件编辑",
chName: "板件反纹",
chDes: "板件反纹",
},
{
typeId: "bjbj",
link: "#",
defaultCustom: CommandNames.KeFanZuan,
command: CommandNames.KeFanZuan,
type: "板件编辑",
chName: "板件可翻转纹路",
chDes: "板件可翻转纹路",
},
//灯光命令
{

Loading…
Cancel
Save