From 316c19d7563fbdb85021d9f18335fdbc921d29ec Mon Sep 17 00:00:00 2001 From: ZoeLeeFZ Date: Tue, 2 Jun 2020 09:26:56 +0800 Subject: [PATCH] =?UTF-8?q?!1073=20=E4=BC=98=E5=8C=96:=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E5=91=BD=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Add-on/BoardCutting/AutoCuttingReactor.ts | 3 +- .../BoardCutting/HardwareCuttingReactor.ts | 3 +- src/Add-on/DrawDrilling/DrillingReactor.ts | 7 +- src/ApplicationServices/Application.ts | 9 +- src/Common/CommandNames.ts | 165 ++++++++++ src/DatabaseServices/CommandServer.ts | 10 +- src/Editor/CommandMachine.ts | 1 + src/Editor/CommandRegister.ts | 303 ++++++++--------- src/Editor/ContextMenu.ts | 39 +-- .../CameraControlButton/CameraControlBtn.tsx | 15 +- .../Components/CommandPanel/CommandItem.tsx | 25 +- src/UI/Components/CommandPanel/CommandList.ts | 307 +++++++++--------- src/UI/Components/Panel.tsx | 3 +- src/UI/Components/Template/TemplateEditor.tsx | 5 +- .../Components/ToolBar/ToolbarContainer.tsx | 49 +-- src/UI/Components/TopToolBar/ToolsBlock.tsx | 3 +- src/UI/Components/TopToolBar/TopToolBar.tsx | 199 ++++++------ 17 files changed, 665 insertions(+), 481 deletions(-) create mode 100644 src/Common/CommandNames.ts diff --git a/src/Add-on/BoardCutting/AutoCuttingReactor.ts b/src/Add-on/BoardCutting/AutoCuttingReactor.ts index 4bed82fa5..99b631445 100644 --- a/src/Add-on/BoardCutting/AutoCuttingReactor.ts +++ b/src/Add-on/BoardCutting/AutoCuttingReactor.ts @@ -2,6 +2,7 @@ import { app } from "../../ApplicationServices/Application"; import { Board } from "../../DatabaseServices/Entity/Board"; import { userConfig } from "../../Editor/UserConfig"; import { CuttingBoardByBoard } from "./CuttingUtils2"; +import { CommandNames } from "../../Common/CommandNames"; export class AutoCuttingReactor { @@ -16,7 +17,7 @@ export class AutoCuttingReactor let brs = createObjects.filter(o => !o.IsErase && o instanceof Board) as Board[]; - if (cmdName !== "插入模块" && cmdName !== "购买模块并插入" && cmdName !== "DRAWER") + if (cmdName !== "插入模块" && cmdName !== "购买模块并插入" && cmdName !== CommandNames.Drawer) if (brs.length > 10) { app.Editor.Prompt("复制的板件超过10个,取消触发切割反应器!"); diff --git a/src/Add-on/BoardCutting/HardwareCuttingReactor.ts b/src/Add-on/BoardCutting/HardwareCuttingReactor.ts index 39b4ead6d..6e5515170 100644 --- a/src/Add-on/BoardCutting/HardwareCuttingReactor.ts +++ b/src/Add-on/BoardCutting/HardwareCuttingReactor.ts @@ -2,13 +2,14 @@ import { app } from "../../ApplicationServices/Application"; import { Board } from "../../DatabaseServices/Entity/Board"; import { HardwareCompositeEntity } from "../../DatabaseServices/Hardware/HardwareCompositeEntity"; import { CuttingBoardByHardware } from "./CuttingUtils2"; +import { CommandNames } from "../../Common/CommandNames"; export class HardwareCuttingReactor { EnableHardware = true; constructor() { - const hardwareCmds = ["DOOR", "购买模块并插入", "插入模块", "DRAWER"]; + const hardwareCmds = ["DOOR", "购买模块并插入", "插入模块", CommandNames.Drawer]; app.CommandReactor.OnCommandEnd((cmdName, changeObjects, createObjects) => { diff --git a/src/Add-on/DrawDrilling/DrillingReactor.ts b/src/Add-on/DrawDrilling/DrillingReactor.ts index 9b2a1779f..ffe0d0bc8 100644 --- a/src/Add-on/DrawDrilling/DrillingReactor.ts +++ b/src/Add-on/DrawDrilling/DrillingReactor.ts @@ -5,9 +5,10 @@ import { DrawDrillingTool } from "./DrawDrillingTool"; import { GroupRecord } from "../../DatabaseServices/GroupTableRecord"; import { ObjectId } from "../../DatabaseServices/ObjectId"; import { Hole } from "../../DatabaseServices/3DSolid/Hole"; +import { CommandNames } from "../../Common/CommandNames"; //禁止触发反应的命令 -const ForbidReactorCmd = new Set(['DELETEDRILL', 'PZ', 'ENT', 'BBS', "SHOW", "HIDESELECT", "HUS"]); +const ForbidReactorCmd = new Set(['DELETEDRILL', 'PZ', 'ENT', 'BBS', CommandNames.Show, CommandNames.HideSelect, CommandNames.HideUnSelect]); export class DrillingReactor { @@ -17,7 +18,7 @@ export class DrillingReactor app.CommandReactor.OnCommandEnd((cmdName: string, changeObjects, createObjects) => { this.Enable = userConfig.openDrillingReactor; - if (cmdName === "COPY") + if (cmdName === CommandNames.Copy) { let holeGroupSet: WeakSet = new WeakSet(); for (let en of createObjects) @@ -60,7 +61,7 @@ export class DrillingReactor } } } - if (cmdName === "ERASE" && meatEnts.size === 0) + if (cmdName === CommandNames.Erase && meatEnts.size === 0) return; let brs: Board[] = []; diff --git a/src/ApplicationServices/Application.ts b/src/ApplicationServices/Application.ts index 2e051ea69..bc699dfeb 100644 --- a/src/ApplicationServices/Application.ts +++ b/src/ApplicationServices/Application.ts @@ -28,6 +28,7 @@ import { HostApplicationServices } from './HostApplicationServices'; import { WebSocketClientServer } from './WebSocketClientServer'; import { HardwareCuttingReactor } from '../Add-on/BoardCutting/HardwareCuttingReactor'; import { AutoSaveServer } from '../Editor/AutoSave'; +import { CommandNames } from '../Common/CommandNames'; export let app: ApplicationService; /** @@ -209,15 +210,15 @@ export class ApplicationService if ((app.Editor.KeyCtrl.KeyIsDown(KeyCode.ShiftLeft))) commandMachine.ExecCommand("COPYBASE"); else - commandMachine.ExecCommand("COPYCLIP"); + commandMachine.ExecCommand(CommandNames.CopyClip); } else if (e.code === KeyCode.KeyV) { - commandMachine.ExecCommand("PASTECLIP"); + commandMachine.ExecCommand(CommandNames.PasteClip); } else if (e.code === KeyCode.KeyS) { - commandMachine.ExecCommand("SAVE"); + commandMachine.ExecCommand(CommandNames.Save); } else if (e.code === KeyCode.KeyE) { @@ -248,7 +249,7 @@ export class ApplicationService } else if (e.code === KeyCode.Delete) { - commandMachine.ExecCommand("ERASE"); + commandMachine.ExecCommand(CommandNames.Erase); } }); diff --git a/src/Common/CommandNames.ts b/src/Common/CommandNames.ts new file mode 100644 index 000000000..75c95ce4e --- /dev/null +++ b/src/Common/CommandNames.ts @@ -0,0 +1,165 @@ +export enum CommandNames +{ + Puge = "PUGE", + KJLExport = "KJLEXPORT", + Group = "GROUP", + DXFImport = "DXF", + Insert = "INSERT", + Line = "LINE", + Undo = "UNDO", + Redo = "REDO", + RECTANG = "RECTANG", + Circle = "CIRCLE", + Ellipse = "ELLIPSE", + Spline = "SPLINE", + Polyline = "POLYLINE", + Arc = "ARC", + Reg = "REGION", + Scale = "SCALE", + Convert2Polyline = "CONVERT2POLYLINE", + Move = "MOVE", + Rotate = "ROTATE", + Revolve = "REVOLVE", + Sphere = "Sphere", + SpliteTemplate = "SPLITETEMPLATE", + SwitchCamera = "SWITCHCAMERA", + Erase = "ERASE", + Break = "BREAK", + Stretch = "STRETCH", + SelectStretch = "SELECTSTRETCH", + FS = "TOPVIEW", + QS = "FRONTVIEW", + YS = "RIGHTVIEW", + ZS = "LEFTVIEW", + BackView = "BACKVIEW", + BottomView = "BOTTOMVIEW", + Swiso = "SWISO", + HideSelect = "HIDESELECT", + + HideUnSelect = "HIDEUNSELECT", + Show = "SHOW", + Save = "SAVE", + SaveAs = "SAVEAS", + New = "NEW", + Open = "OPEN", + CustomUCS = "UCS", + Copy = "COPY", + Reverse = "REVERSE", + Extend = "EXTEND", + Trim = "TRIM", + Fillet = "FILLET", + Offset = "OFFSET", + PointLight = "POINTLIGHT", + PointLight2 = "POINTLIGHT2", + SpotLight = "SPOTLIGHT", + SpotLight2 = "SPOTLIGHT2", + RectLight = "RECTLIGHT", + Divide = "DIVIDE", + Point = "POINT", + AlignDim = "ALGINDIMEN", + LinearDim = "LINEARDIMEN", + AngleDim = "ANGLEDIM", + DimContinue = "CONTINUEDIM", + RadiusDim = "RADIUSDIM", + DiaDim = "DIAMETERDIMEN", + Text = "TEXT", + Intersect = "INTERSECT", + Union = "UNION", + Substract = "SUBSTRACT", + Pedit = "PEDIT", + Join = "JOIN", + Sweep = "Sweep", + Cylineder = "CYLINEDER", + + LRBoard = "LEFTRIGHTBOARD", + TBBoard = "TOPBOTTOMBOARD", + BehindBoard = "BEHINDBOARD", + LayerBoard = "LAYERBOARD", + VertialBoard = "VERTIALBOARD", + SingleBoard = "SINGLEBOARD", + CloseStrip = "CLOSESTRIP", + Door = "DOOR", + DrillConfig = "DRILLCONFIG", + Hole = "DRAWHOLE", + YiXing = "YIXING", + YXLK = "YIXINGCONTOUR", + LinearCutting = "LINEARCUTTING", + NonAssociativeCutting = "NONASSOCIATIVECUTTING", + ReferenceCutting = "REFERENCECUTTING", + AddPtOnBoard = "ADDPTONBOARD", + DeletePtOnBoard = "DELETEPTONBOARD", + BoardFindModify = "BOARDFINDMODIFY", + LookOverBoardInfos = "LOOKOVERBOARDINFOS", + BoardBatchCurtail = "BOARDBATCHCURTAIL", + AutoDimBrs = "AUTODIMBRS", + FastDimBrs = "FASTDIMBRS", + DeleteDim = "DELETEDIM", + RotateLayerBoard = "ROTATELAYERBOARD", + Drawer = "DRAWER", + DeleteHole = "DELETEHOLE", + ReverseDrillFace = "REVERSEDRILLFACE", + ActicityLayerBoard = "ACTICITYLAYERBOARD", + TestFb = "TESTFENGBIAN", + TestModeling = "TESTMODELING", + Mirror = "MIRROR", + Topline = "TOPLINE", + Winerack = "WINERACK", + Lattice = "LATTICE", + Array = "ARRAY", + ComanPanel = "COMMANDPANEL", + Config = "CONFIG", + Esc = "ESC", + Wireframe = "WIREFRAME", + Conceptual = "CONCEPTUAL", + Physical = "PHYSICAL", + Physical2 = "PHYSICAL2", + DownloadHoleOption = "DOWNHOLECONFIG", + UploadHoleConfig = "UPLOADHOLECONFIG", + ChaiDan = "CHAIDAN", + ChaiDanJB = "ChAIDANJIABEI", + ShowYouhua = "SHOWYOUHUA", + + BatchModify = "BATCHMODIFY", + AutoHoleFaceSetting = "AUTOHOLEFACESETTING", + Combine = "COMBINE", + Template = "TEMPLATE", + TemplateDesign = "TEMPLATEDESIGN", + TemplateSearch = "TEMPLATESEARCH", + TemplateDelete = "TEMPLATEDELETE", + TemplateCheck = "TEMPLATECHECK", + RotateTemplate = "ROTATETEMP", + Print = "PRINT", + Extrude = "EXTRUDE", + HoleTemplate = "HOLETEMPLATE", + CheckModeling = "CHECKMODELING", + ExportData = "EXPORTDATA", + ExportView = "EXPORTVIEW", + EnableSyncData = "ENABLESYNCDATA", + DisableSyncData = "DISABLESYNCDATA", + ToggleSyncData = "TOGGLESYNCDATA", + ShowProcessingGroupModal2 = "SHOWPROCESSINGGROUPMODAL2", + DrawVSBOX = "DRAWVSBOX", + Align = "ALIGN", + BuyMaterial = "BUYMATERIAL", + Interfere = "INTERFERE", + ShowDoor = "SHOWDOOR", + HideDoor = "HIDEDOOR", + Curve2Rect = "CURVE2RECT", + Pl2Br = "RECT2BOARD", + Curve2VSBox = "CURVE2VSBOX", + SetSmoothEdge = "SETSMOOTHEDGE", + ClearRef = "CLEARRELEVANCE", + ExportObj = "EXPORTOBJ", + ExportObj2 = "EXPORTOBJ2", + ExportSTL = "EXPORTSTL", + UpdateBoardInfos = "UPDATEBOARDINFOS", + ToggleUI = "TOGGLEUI", + BoardReplaceTempate = "BOARDREPLACETEMPLATE", + Dist = "DIST", + Explode = "EXPLODE", + Explosion = "EXPLOSIONMAP", + CopyClip = "COPYCLIP", + PasteClip = "PASTECLIP", + Text2Curve = "TEXT2CURVE", + R2b = "RECT2BOARD" +} diff --git a/src/DatabaseServices/CommandServer.ts b/src/DatabaseServices/CommandServer.ts index 28b0c27d8..0c2be8376 100644 --- a/src/DatabaseServices/CommandServer.ts +++ b/src/DatabaseServices/CommandServer.ts @@ -25,9 +25,17 @@ export class CommandServer extends Singleton private _customCommand: { [key: string]: ICommand; } = {}; private _needUpload = false; AddCustonCommand(icommand: ICommand) + { + if (icommand.command !== icommand.customize && icommand.customize !== icommand.defaultCustom) + { + this._needUpload = true; + this._customCommand[icommand.command] = toJS(icommand); + } + } + DeleteCustonCommand(icommand: ICommand) { this._needUpload = true; - this._customCommand[icommand.command] = toJS(icommand); + delete this._customCommand[icommand.command]; } async Upload() { diff --git a/src/Editor/CommandMachine.ts b/src/Editor/CommandMachine.ts index 3d1f0d25e..70df73b8c 100644 --- a/src/Editor/CommandMachine.ts +++ b/src/Editor/CommandMachine.ts @@ -75,6 +75,7 @@ class CommandMachine } RemoveCommand(cmdName: string) { + if (!cmdName) return; cmdName = cmdName.toUpperCase(); this.CommandMap.delete(cmdName); this.m_CommandNameList.delete(cmdName); diff --git a/src/Editor/CommandRegister.ts b/src/Editor/CommandRegister.ts index 3844421f0..8db4a88bf 100644 --- a/src/Editor/CommandRegister.ts +++ b/src/Editor/CommandRegister.ts @@ -181,10 +181,11 @@ import { Interfere } from './../Add-on/interfere'; import { ShowKinfeManageModal } from './../Add-on/showModal/ShowKnifeManageModal'; import { commandMachine } from './CommandMachine'; import { Command_Dist } from "../Add-on/Dist"; +import { CommandNames } from "../Common/CommandNames"; export function registerCommand() { - commandMachine.RegisterCommand("pu", new Command_Purge()); + commandMachine.RegisterCommand(CommandNames.Puge, new Command_Purge()); commandMachine.RegisterCommand("end", new Command_EndTempEditor()); @@ -192,7 +193,7 @@ export function registerCommand() commandMachine.RegisterCommand("RestoreColor", new Command_RestoreColor()); commandMachine.RegisterCommand("kjl", new Command_KJLImport()); - commandMachine.RegisterCommand("kjlexport", new KjlExport()); + commandMachine.RegisterCommand(CommandNames.KJLExport, new KjlExport()); commandMachine.RegisterCommand("clearkjltoken", new ClearKjlToken()); commandMachine.RegisterCommand("group", new Command_Group()); @@ -204,162 +205,162 @@ export function registerCommand() commandMachine.RegisterCommand("testRegionParse", new Command_TestRegionParse()); commandMachine.RegisterCommand("TestBoundaryBox", new Command_TestBoundaryBox()); - commandMachine.RegisterCommand("insert", new Command_Insert()); + commandMachine.RegisterCommand(CommandNames.Insert, new Command_Insert()); - commandMachine.RegisterCommand("l", new DrawLine()); - commandMachine.RegisterCommand("u", new Undo()); - commandMachine.RegisterCommand("redo", new Redo()); + commandMachine.RegisterCommand(CommandNames.Line, new DrawLine()); + commandMachine.RegisterCommand(CommandNames.Undo, new Undo()); + commandMachine.RegisterCommand(CommandNames.Redo, new Redo()); commandMachine.RegisterCommand("ze", new ZoomE()); - commandMachine.RegisterCommand("RECTANG", new DrawRect()); - commandMachine.RegisterCommand("c", new DrawCircle()); - commandMachine.RegisterCommand("el", new DrawEllipse()); - commandMachine.RegisterCommand("spl", new DrawSpline()); - commandMachine.RegisterCommand("pl", new DrawPolyline()); - commandMachine.RegisterCommand("sc", new Command_Scale()); - commandMachine.RegisterCommand("Conver2Polyline", new Command_Conver2Polyline()); - - commandMachine.RegisterCommand("move", new Command_Move()); + commandMachine.RegisterCommand(CommandNames.RECTANG, new DrawRect()); + commandMachine.RegisterCommand(CommandNames.Circle, new DrawCircle()); + commandMachine.RegisterCommand(CommandNames.Ellipse, new DrawEllipse()); + commandMachine.RegisterCommand(CommandNames.Spline, new DrawSpline()); + commandMachine.RegisterCommand(CommandNames.Polyline, new DrawPolyline()); + commandMachine.RegisterCommand(CommandNames.Scale, new Command_Scale()); + commandMachine.RegisterCommand(CommandNames.Convert2Polyline, new Command_Conver2Polyline()); + + commandMachine.RegisterCommand(CommandNames.Move, new Command_Move()); commandMachine.RegisterCommand("m0", new Command_M0()); - commandMachine.RegisterCommand("ro", new Command_Rotate()); - commandMachine.RegisterCommand("Revolve", new Command_DrawRevolve()); + commandMachine.RegisterCommand(CommandNames.Rotate, new Command_Rotate()); + commandMachine.RegisterCommand(CommandNames.Revolve, new Command_DrawRevolve()); - commandMachine.RegisterCommand("sp", new DrawSphere()); + commandMachine.RegisterCommand(CommandNames.Sphere, new DrawSphere()); commandMachine.RegisterCommand("fl", new DrawFloor()); - commandMachine.RegisterCommand("cc", new Command_SwitchCamera()); + commandMachine.RegisterCommand(CommandNames.SwitchCamera, new Command_SwitchCamera()); - commandMachine.RegisterCommand("Erase", new Command_Erase()); + commandMachine.RegisterCommand(CommandNames.Erase, new Command_Erase()); commandMachine.RegisterCommand("deletecurve", new DeleteCurve()); commandMachine.RegisterCommand("EraseLineArc", new Command_EraseLineAndArc()); commandMachine.RegisterCommand("c0", new DrawCircle0()); - commandMachine.RegisterCommand("break", new Command_Break()); + commandMachine.RegisterCommand(CommandNames.Break, new Command_Break()); commandMachine.RegisterCommand("testPointParse", new Command_TestPointPickParse()); - commandMachine.RegisterCommand("Stretch", new Stretch()); - commandMachine.RegisterCommand("SelectStretch", new Stretch(true)); + commandMachine.RegisterCommand(CommandNames.Stretch, new Stretch()); + commandMachine.RegisterCommand(CommandNames.SelectStretch, new Stretch(true)); - commandMachine.RegisterCommand("fs", new ViewChange(new Vector3(0, 0, -1))); - commandMachine.RegisterCommand("qs", new ViewChange(new Vector3(0, 1))); - commandMachine.RegisterCommand("ys", new ViewChange(new Vector3(-1))); - commandMachine.RegisterCommand("zs", new ViewChange(new Vector3(1))); - commandMachine.RegisterCommand("backView", new ViewChange(new Vector3(0, -1))); - commandMachine.RegisterCommand("Swiso", new ViewChange(new Vector3(1, 1, -1), true)); - commandMachine.RegisterCommand("bottomView", new ViewChange(new Vector3(0, 0, 1))); + commandMachine.RegisterCommand(CommandNames.FS, new ViewChange(new Vector3(0, 0, -1))); + commandMachine.RegisterCommand(CommandNames.QS, new ViewChange(new Vector3(0, 1))); + commandMachine.RegisterCommand(CommandNames.YS, new ViewChange(new Vector3(-1))); + commandMachine.RegisterCommand(CommandNames.ZS, new ViewChange(new Vector3(1))); + commandMachine.RegisterCommand(CommandNames.BackView, new ViewChange(new Vector3(0, -1))); + commandMachine.RegisterCommand(CommandNames.Swiso, new ViewChange(new Vector3(1, 1, -1), true)); + commandMachine.RegisterCommand(CommandNames.BottomView, new ViewChange(new Vector3(0, 0, 1))); commandMachine.RegisterCommand("grip", new DrawGripStretch()); commandMachine.RegisterCommand("fbx", new Fbx()); - commandMachine.RegisterCommand("hideselect", new Command_HideSelected()); - commandMachine.RegisterCommand("hus", new Command_HideUnselected()); - commandMachine.RegisterCommand("show", new Command_ShowAll()); + commandMachine.RegisterCommand(CommandNames.HideSelect, new Command_HideSelected()); + commandMachine.RegisterCommand(CommandNames.HideUnSelect, new Command_HideUnselected()); + commandMachine.RegisterCommand(CommandNames.Show, new Command_ShowAll()); - commandMachine.RegisterCommand("save", new Save()); - commandMachine.RegisterCommand("saveas", new SaveAs()); + commandMachine.RegisterCommand(CommandNames.Save, new Save()); + commandMachine.RegisterCommand(CommandNames.SaveAs, new SaveAs()); commandMachine.RegisterCommand("saveasbinary", new SaveAsBinary()); - commandMachine.RegisterCommand("new", new New()); + commandMachine.RegisterCommand(CommandNames.New, new New()); - commandMachine.RegisterCommand("open", new Open()); + commandMachine.RegisterCommand(CommandNames.Open, new Open()); commandMachine.RegisterCommand("reopen", new ReOpen()); - commandMachine.RegisterCommand("arc", new DrawArc()); + commandMachine.RegisterCommand(CommandNames.Arc, new DrawArc()); commandMachine.RegisterCommand("ent", new Entsel()); commandMachine.RegisterCommand("sky", new DrawSky()); - commandMachine.RegisterCommand("reg", new DrawRegion()); + commandMachine.RegisterCommand(CommandNames.Reg, new DrawRegion()); - commandMachine.RegisterCommand("ucs", new CustomUcs()); + commandMachine.RegisterCommand(CommandNames.CustomUCS, new CustomUcs()); commandMachine.RegisterCommand("reg2", new DrawRegTest()); - commandMachine.RegisterCommand("copy", new Command_Copy()); + commandMachine.RegisterCommand(CommandNames.Copy, new Command_Copy()); commandMachine.RegisterCommand("Wblock", new Command_Wblock()); commandMachine.RegisterCommand("lisp", new Command_Lisp()); - commandMachine.RegisterCommand("Reverse", new Command_Reverse()); - commandMachine.RegisterCommand("ex", new Command_Extend()); + commandMachine.RegisterCommand(CommandNames.Reverse, new Command_Reverse()); + commandMachine.RegisterCommand(CommandNames.Extend, new Command_Extend()); - commandMachine.RegisterCommand("tr", new Command_Trim()); + commandMachine.RegisterCommand(CommandNames.Trim, new Command_Trim()); - commandMachine.RegisterCommand("f", new CommandFillet()); + commandMachine.RegisterCommand(CommandNames.Fillet, new CommandFillet()); commandMachine.RegisterCommand("testFilletCode", new TestFillet()); - commandMachine.RegisterCommand("O", new Command_Offset()); + commandMachine.RegisterCommand(CommandNames.Offset, new Command_Offset()); commandMachine.RegisterCommand("OT", new Command_DynOffset()); commandMachine.RegisterCommand("TO", new Command_DynOffsetToolPath()); commandMachine.RegisterCommand("Length", new Command_Length()); //绘制灯 - commandMachine.RegisterCommand("ptl2", new DrawPointLight()); - commandMachine.RegisterCommand("ptl", new DrawPointLight2()); - commandMachine.RegisterCommand("sl", new DrawSpotLight()); - commandMachine.RegisterCommand("sl1", new DrawSpotLight2()); - commandMachine.RegisterCommand("rl", new DrawRectAreaLight()); + commandMachine.RegisterCommand(CommandNames.PointLight2, new DrawPointLight()); + commandMachine.RegisterCommand(CommandNames.PointLight, new DrawPointLight2()); + commandMachine.RegisterCommand(CommandNames.SpotLight, new DrawSpotLight()); + commandMachine.RegisterCommand(CommandNames.SpotLight2, new DrawSpotLight2()); + commandMachine.RegisterCommand(CommandNames.RectLight, new DrawRectAreaLight()); commandMachine.RegisterCommand("ptcopy", new Command_CopyPoint()); commandMachine.RegisterCommand("tan", new DrawTangentLine()); commandMachine.RegisterCommand("oo", new OffsetX()); - commandMachine.RegisterCommand("div", new CMD_Divide()); - commandMachine.RegisterCommand("pt", new CMD_DrawPoint()); - - commandMachine.RegisterCommand("dal", new DrawAlignedDimension()); - commandMachine.RegisterCommand("dli", new DrawLinearDimension()); - commandMachine.RegisterCommand("dan", new Command_Draw2LineAngularDim()); - commandMachine.RegisterCommand("dco", new Command_DimContinue()); - commandMachine.RegisterCommand("dimrad", new DrawRadiusDim()); - commandMachine.RegisterCommand("dimdia", new DrawDiameterDim()); - - commandMachine.RegisterCommand("text", new DrawText()); - commandMachine.RegisterCommand("int", new IntersectionOperation()); - commandMachine.RegisterCommand("union", new UnionOperation()); - commandMachine.RegisterCommand("sub", new SubsractOperation()); - commandMachine.RegisterCommand("pe", new Pedit()); - commandMachine.RegisterCommand("join", new Command_Join()); - commandMachine.RegisterCommand("sw", new Sweep()); - commandMachine.RegisterCommand("cyl", new DrawCylineder()); + commandMachine.RegisterCommand(CommandNames.Divide, new CMD_Divide()); + commandMachine.RegisterCommand(CommandNames.Point, new CMD_DrawPoint()); + + commandMachine.RegisterCommand(CommandNames.AlignDim, new DrawAlignedDimension()); + commandMachine.RegisterCommand(CommandNames.LinearDim, new DrawLinearDimension()); + commandMachine.RegisterCommand(CommandNames.AngleDim, new Command_Draw2LineAngularDim()); + commandMachine.RegisterCommand(CommandNames.DimContinue, new Command_DimContinue()); + commandMachine.RegisterCommand(CommandNames.RadiusDim, new DrawRadiusDim()); + commandMachine.RegisterCommand(CommandNames.DiaDim, new DrawDiameterDim()); + + commandMachine.RegisterCommand(CommandNames.Text, new DrawText()); + commandMachine.RegisterCommand(CommandNames.Intersect, new IntersectionOperation()); + commandMachine.RegisterCommand(CommandNames.Union, new UnionOperation()); + commandMachine.RegisterCommand(CommandNames.Substract, new SubsractOperation()); + commandMachine.RegisterCommand(CommandNames.Pedit, new Pedit()); + commandMachine.RegisterCommand(CommandNames.Join, new Command_Join()); + commandMachine.RegisterCommand(CommandNames.Sweep, new Sweep()); + commandMachine.RegisterCommand(CommandNames.Cylineder, new DrawCylineder()); //画板件命令 - commandMachine.RegisterCommand("zyc", new DrawLeftRight()); - commandMachine.RegisterCommand("dd", new DrawTopBottomBoard()); - commandMachine.RegisterCommand("bb", new DrawBehindBoard()); - commandMachine.RegisterCommand("cb", new DrawLayerBoard()); - commandMachine.RegisterCommand("lb", new DrawVerticalBoard()); - commandMachine.RegisterCommand("db", new DrawSingleBoard()); - commandMachine.RegisterCommand("skt", new DrawClosingStrip()); - commandMachine.RegisterCommand("door", new DrawDoor()); - commandMachine.RegisterCommand("drillconfig", new DrillConfig()); - commandMachine.RegisterCommand("pz", new DrawDrilling()); - commandMachine.RegisterCommand("yx", new DrawSpecialShapedBoard()); - commandMachine.RegisterCommand("yxlk", new DrawSpecialShapedBoardByContour()); - commandMachine.RegisterCommand("qg", new LinearCutting()); - commandMachine.RegisterCommand("qg2", new NonAssociativeCutting()); - commandMachine.RegisterCommand("qg4", new ReferenceCutting()); - commandMachine.RegisterCommand("jd", new AddPtOnBoard()); - commandMachine.RegisterCommand("sd", new DeletePtOnBoard()); - commandMachine.RegisterCommand("boardfindmodify", new BoardFindModify()); - commandMachine.RegisterCommand("bbs", new LookOverBoardInfos()); - commandMachine.RegisterCommand("boardbatchcurtail", new BoardBatchCurtail()); - commandMachine.RegisterCommand("autodimbrs", new Command_AutoDimBrs()); - commandMachine.RegisterCommand("fastdimbrs", new Command_FastDimBrs()); - commandMachine.RegisterCommand("deletedim", new DeleteDim()); - - commandMachine.RegisterCommand("rotatelybr", new RotateLayerBoard()); - - commandMachine.RegisterCommand("drawer", new DrawDrawrer()); - commandMachine.RegisterCommand("deletedrill", new DeleteDrill()); - commandMachine.RegisterCommand("reversedrillface", new ReverseDrillFace()); + commandMachine.RegisterCommand(CommandNames.LRBoard, new DrawLeftRight()); + commandMachine.RegisterCommand(CommandNames.TBBoard, new DrawTopBottomBoard()); + commandMachine.RegisterCommand(CommandNames.BehindBoard, new DrawBehindBoard()); + commandMachine.RegisterCommand(CommandNames.LayerBoard, new DrawLayerBoard()); + commandMachine.RegisterCommand(CommandNames.VertialBoard, new DrawVerticalBoard()); + commandMachine.RegisterCommand(CommandNames.SingleBoard, new DrawSingleBoard()); + commandMachine.RegisterCommand(CommandNames.CloseStrip, new DrawClosingStrip()); + commandMachine.RegisterCommand(CommandNames.Door, new DrawDoor()); + commandMachine.RegisterCommand(CommandNames.DrillConfig, new DrillConfig()); + commandMachine.RegisterCommand(CommandNames.Hole, new DrawDrilling()); + commandMachine.RegisterCommand(CommandNames.YiXing, new DrawSpecialShapedBoard()); + commandMachine.RegisterCommand(CommandNames.YXLK, new DrawSpecialShapedBoardByContour()); + commandMachine.RegisterCommand(CommandNames.LinearCutting, new LinearCutting()); + commandMachine.RegisterCommand(CommandNames.NonAssociativeCutting, new NonAssociativeCutting()); + commandMachine.RegisterCommand(CommandNames.ReferenceCutting, new ReferenceCutting()); + commandMachine.RegisterCommand(CommandNames.AddPtOnBoard, new AddPtOnBoard()); + commandMachine.RegisterCommand(CommandNames.DeletePtOnBoard, new DeletePtOnBoard()); + commandMachine.RegisterCommand(CommandNames.BoardFindModify, new BoardFindModify()); + commandMachine.RegisterCommand(CommandNames.LookOverBoardInfos, new LookOverBoardInfos()); + commandMachine.RegisterCommand(CommandNames.BoardBatchCurtail, new BoardBatchCurtail()); + commandMachine.RegisterCommand(CommandNames.AutoDimBrs, new Command_AutoDimBrs()); + commandMachine.RegisterCommand(CommandNames.FastDimBrs, new Command_FastDimBrs()); + commandMachine.RegisterCommand(CommandNames.DeleteDim, new DeleteDim()); + + commandMachine.RegisterCommand(CommandNames.RotateLayerBoard, new RotateLayerBoard()); + + commandMachine.RegisterCommand(CommandNames.Drawer, new DrawDrawrer()); + commandMachine.RegisterCommand(CommandNames.DeleteHole, new DeleteDrill()); + commandMachine.RegisterCommand(CommandNames.ReverseDrillFace, new ReverseDrillFace()); commandMachine.RegisterCommand("editorboardTemplate", new EditorBoardTemplate()); - commandMachine.RegisterCommand("acticitylayerboard", new ActicityLayerBoard()); + commandMachine.RegisterCommand(CommandNames.ActicityLayerBoard, new ActicityLayerBoard()); //改板 commandMachine.RegisterCommand("SetBRXAxis", new Command_SetBRXAxis); @@ -369,41 +370,42 @@ export function registerCommand() //提取走刀 commandMachine.RegisterCommand("testm", new FeedingCommand()); - commandMachine.RegisterCommand("mi", new MirrorCommand()); + commandMachine.RegisterCommand(CommandNames.Mirror, new MirrorCommand()); - commandMachine.RegisterCommand("topline", new ShowTopLine()); + commandMachine.RegisterCommand(CommandNames.Topline, new ShowTopLine()); //酒格 - commandMachine.RegisterCommand("winerack", new ConfigureWineRack()); + commandMachine.RegisterCommand(CommandNames.Winerack, new ConfigureWineRack()); commandMachine.RegisterCommand("drawwinerack", new DrawWineRack()); commandMachine.RegisterCommand("editorwinerack", new EditorWineRack()); commandMachine.RegisterCommand("testfb", new TestFb()); + commandMachine.RegisterCommand(CommandNames.Explode, new Command_Explode()); + commandMachine.RegisterCommand(CommandNames.Explosion, new Command_ExplosionMap()); - commandMachine.RegisterCommand("lattice", new DrawLattice()); + commandMachine.RegisterCommand(CommandNames.Lattice, new DrawLattice()); /*******test ↓↓↓*********/ commandMachine.RegisterCommand("pltest", new Command_PLTest()); commandMachine.RegisterCommand("tt2", new Command_INsTest()); - commandMachine.RegisterCommand("x", new Command_Explode()); + commandMachine.RegisterCommand("outcur", new TestTargeOnCurve()); commandMachine.RegisterCommand("close", new Command_ClosePt()); - commandMachine.RegisterCommand("explosionmap", new Command_ExplosionMap()); //用于测试包围盒 commandMachine.RegisterCommand("box", new Command_TestBox()); + commandMachine.RegisterCommand("testInt", new TestIntersect()); + commandMachine.RegisterCommand("collison", new TestCollision()); + //阵列 - commandMachine.RegisterCommand("array", new Command_Array()); - commandMachine.RegisterCommand("outcur", new TestTargeOnCurve()); + commandMachine.RegisterCommand(CommandNames.Array, new Command_Array()); - commandMachine.RegisterCommand("testInt", new TestIntersect()); - commandMachine.RegisterCommand("copyclip", new CopyClip()); + commandMachine.RegisterCommand(CommandNames.CopyClip, new CopyClip()); commandMachine.RegisterCommand("copybase", new CopyClip(true)); - commandMachine.RegisterCommand("PasteClip", new PasteClip()); - commandMachine.RegisterCommand("collison", new TestCollision()); + commandMachine.RegisterCommand(CommandNames.PasteClip, new PasteClip()); //命令面板 commandMachine.RegisterCommand("comanp", new Command_CommandPanel()); //选项 - commandMachine.RegisterCommand("config", new Command_Options()); + commandMachine.RegisterCommand(CommandNames.Config, new Command_Options()); commandMachine.RegisterCommand("esc", new Command_Esc()); commandMachine.RegisterCommand("EraseNoSelect", new Command_EraseNoSelect()); @@ -412,10 +414,10 @@ export function registerCommand() // commandMachine.RegisterCommand("rt", new RevTarget()) //视觉样式 - commandMachine.RegisterCommand("Wireframe", new CMD_Wireframe()); - commandMachine.RegisterCommand("Conceptual", new CMD_Conceptual()); - commandMachine.RegisterCommand("Physical", new CMD_Physical()); - commandMachine.RegisterCommand("Physical2", new CMD_Physical2()); + commandMachine.RegisterCommand(CommandNames.Wireframe, new CMD_Wireframe()); + commandMachine.RegisterCommand(CommandNames.Conceptual, new CMD_Conceptual()); + commandMachine.RegisterCommand(CommandNames.Physical, new CMD_Physical()); + commandMachine.RegisterCommand(CommandNames.Physical2, new CMD_Physical2()); //导入导出配置 commandMachine.RegisterCommand("downloadconfig", new DownLoadDConfig()); @@ -423,25 +425,25 @@ export function registerCommand() commandMachine.RegisterCommand("downloadholeconfig", new DownloadHoleOption()); commandMachine.RegisterCommand("uploadholeconfig", new UploadHoleOption()); - commandMachine.RegisterCommand("cd", new ChaiDan()); - commandMachine.RegisterCommand("cbcd", new ChaiDanJB()); - commandMachine.RegisterCommand("ckyh", new ShoWYouHua()); + commandMachine.RegisterCommand(CommandNames.ChaiDan, new ChaiDan()); + commandMachine.RegisterCommand(CommandNames.ChaiDanJB, new ChaiDanJB()); + commandMachine.RegisterCommand(CommandNames.ShowYouhua, new ShoWYouHua()); //批量修改封边排钻 - commandMachine.RegisterCommand("batchmodify", new BatchModify()); + commandMachine.RegisterCommand(CommandNames.BatchModify, new BatchModify()); //自动设置孔面 commandMachine.RegisterCommand("zdkm", new AutoHoleFaceSetting()); //绘制复合实体 - commandMachine.RegisterCommand("combine", new Command_CombineEntity()); + commandMachine.RegisterCommand(CommandNames.Combine, new Command_CombineEntity()); //Template - commandMachine.RegisterCommand("template", new ShowTemplate()); - commandMachine.RegisterCommand("templatedesign", new ShowTemplateDesign()); - commandMachine.RegisterCommand("TemplateSearch", new Command_TemplateSearch()); + commandMachine.RegisterCommand(CommandNames.Template, new ShowTemplate()); + commandMachine.RegisterCommand(CommandNames.TemplateDesign, new ShowTemplateDesign()); + commandMachine.RegisterCommand(CommandNames.TemplateSearch, new Command_TemplateSearch()); commandMachine.RegisterCommand("templateDelete", new Command_DeleteTemplate()); - commandMachine.RegisterCommand("templatecheck", new Command_TemplateSearch(true)); - commandMachine.RegisterCommand("SplitTemplate", new Command_SplitTemplate()); + commandMachine.RegisterCommand(CommandNames.TemplateCheck, new Command_TemplateSearch(true)); + commandMachine.RegisterCommand(CommandNames.SpliteTemplate, new Command_SplitTemplate()); commandMachine.RegisterCommand("SplitTemplateX", new Command_SplitTemplateByDir(0)); commandMachine.RegisterCommand("SplitTemplateY", new Command_SplitTemplateByDir(1)); commandMachine.RegisterCommand("SplitTemplateZ", new Command_SplitTemplateByDir(2)); @@ -453,58 +455,59 @@ export function registerCommand() commandMachine.RegisterCommand("testPlace", new Command_TestPlace()); commandMachine.RegisterCommand("testYH", new Command_TestYHWorker()); commandMachine.RegisterCommand("editorlattice", new EditorLattice()); - commandMachine.RegisterCommand("print", new Print()); - commandMachine.RegisterCommand("extrude", new DrawExtrude()); - commandMachine.RegisterCommand("drilltemplate", new ShowDrillingTemplate()); - commandMachine.RegisterCommand("checkmodeing", new CheckModeling()); + commandMachine.RegisterCommand(CommandNames.Print, new Print()); + commandMachine.RegisterCommand(CommandNames.Extrude, new DrawExtrude()); + + commandMachine.RegisterCommand(CommandNames.HoleTemplate, new ShowDrillingTemplate()); + commandMachine.RegisterCommand(CommandNames.CheckModeling, new CheckModeling()); //导出数据 - commandMachine.RegisterCommand("exportdata", new Command_ExportData()); - commandMachine.RegisterCommand("exportview", new Command_ExportView()); + commandMachine.RegisterCommand(CommandNames.ExportData, new Command_ExportData()); + commandMachine.RegisterCommand(CommandNames.ExportView, new Command_ExportView()); commandMachine.RegisterCommand("EnableSyncData", new Command_EnableSyncData()); commandMachine.RegisterCommand("DisableSyncData", new Command_DisableSyncData()); - commandMachine.RegisterCommand("toggleSyncData", new Command_ToggleSyncData()); + commandMachine.RegisterCommand(CommandNames.ToggleSyncData, new Command_ToggleSyncData()); //加工组 - commandMachine.RegisterCommand('showprocessgroup2', new Command_ShowProcessingGroupModal2()); + commandMachine.RegisterCommand(CommandNames.ShowProcessingGroupModal2, new Command_ShowProcessingGroupModal2()); //测试csg commandMachine.RegisterCommand("TestDrawEdgeGeometry", new Command_TestDrawEdgeGeometry()); - commandMachine.RegisterCommand("Text2Curve", new Text2Curve()); + commandMachine.RegisterCommand(CommandNames.Text2Curve, new Text2Curve()); - commandMachine.RegisterCommand("drawvsbox", new DrawVisualSpaceBox()); - commandMachine.RegisterCommand("align", new Align()); + commandMachine.RegisterCommand(CommandNames.DrawVSBOX, new DrawVisualSpaceBox()); + commandMachine.RegisterCommand(CommandNames.Align, new Align()); - commandMachine.RegisterCommand("buymaterial", new BuyMaterial()); - commandMachine.RegisterCommand("interfere", new Interfere()); + commandMachine.RegisterCommand(CommandNames.BuyMaterial, new BuyMaterial()); + commandMachine.RegisterCommand(CommandNames.Interfere, new Interfere()); commandMachine.RegisterCommand("testw", new Command_TestTape()); commandMachine.RegisterCommand("showknifeMg", new ShowKinfeManageModal()); - commandMachine.RegisterCommand("showdoors", new Command_SwitchDoor(true)); - commandMachine.RegisterCommand("hidedoors", new Command_SwitchDoor(false)); + commandMachine.RegisterCommand(CommandNames.ShowDoor, new Command_SwitchDoor(true)); + commandMachine.RegisterCommand(CommandNames.HideDoor, new Command_SwitchDoor(false)); //线条变矩形 - commandMachine.RegisterCommand("curve2rec", new Command_Curve2Polyline()); - commandMachine.RegisterCommand("r2b", new Polyline2Board()); - commandMachine.RegisterCommand("curve2vsbox", new Command_Curve2VSBox()); + commandMachine.RegisterCommand(CommandNames.Curve2Rect, new Command_Curve2Polyline()); + commandMachine.RegisterCommand(CommandNames.R2b, new Polyline2Board()); + commandMachine.RegisterCommand(CommandNames.Curve2VSBox, new Command_Curve2VSBox()); - commandMachine.RegisterCommand("SetSmoothEdge", new SetSmoothEdge()); - commandMachine.RegisterCommand("clearrelevance", new DeleteRelevance()); + commandMachine.RegisterCommand(CommandNames.SetSmoothEdge, new SetSmoothEdge()); + commandMachine.RegisterCommand(CommandNames.ClearRef, new DeleteRelevance()); commandMachine.RegisterCommand("exportobj", new Command_ExportObj()); commandMachine.RegisterCommand("exportobj2", new Command_ExportObj2()); commandMachine.RegisterCommand("ExportSTL", new Command_ExportSTL()); - commandMachine.RegisterCommand("updateboardinfos", new UpdateBoardInfos()); + commandMachine.RegisterCommand(CommandNames.UpdateBoardInfos, new UpdateBoardInfos()); - commandMachine.RegisterCommand("ToggleUI", new Command_ToggleUI()); + commandMachine.RegisterCommand(CommandNames.ToggleUI, new Command_ToggleUI()); - commandMachine.RegisterCommand("boardRepaceTemplate", new BoardReplaceTempate()); + commandMachine.RegisterCommand(CommandNames.BoardReplaceTempate, new BoardReplaceTempate()); //迁移自定义命令数据 commandMachine.RegisterCommand("upgradedata", new UpgradeData()); - commandMachine.RegisterCommand("dist", new Command_Dist()); + commandMachine.RegisterCommand(CommandNames.Dist, new Command_Dist()); } diff --git a/src/Editor/ContextMenu.ts b/src/Editor/ContextMenu.ts index d3a38156c..6586db27e 100644 --- a/src/Editor/ContextMenu.ts +++ b/src/Editor/ContextMenu.ts @@ -12,27 +12,28 @@ import { TemplateLeftRightBoardRecord } from "../DatabaseServices/Template/Progr import { TemplateTopBottomBoard } from "../DatabaseServices/Template/ProgramTempate/TemplateTopBottomBoard"; import { TemplateLatticeRecord } from "../DatabaseServices/Template/ProgramTempate/TemplateLatticeRecord"; import { TemplateVisualSpace } from "../DatabaseServices/Template/ProgramTempate/TemplateVisualSpace"; +import { CommandNames } from "../Common/CommandNames"; const KeyWordCommandMap: Map = new Map(Object.entries({ - "1": "HIDESELECT", - "2": "HUS", - "3": "SHOW", - "4": "SHOWDOORS", - "5": "HIDEDOORS", - "6": "JD", - "7": "SD", - "R": "REDO", - "U": "U", - - "C": "COPY", - "B": "COPY", - "P": "PASTECLIP", - - "DEL": "ERASE", - "RO": "RO", - "M": "MOVE", - - "O": "CONFIG", + "1": CommandNames.HideSelect, + "2": CommandNames.HideUnSelect, + "3": CommandNames.Show, + "4": CommandNames.ShowDoor, + "5": CommandNames.HideDoor, + "6": CommandNames.AddPtOnBoard, + "7": CommandNames.DeletePtOnBoard, + "R": CommandNames.Redo, + "U": CommandNames.Undo, + + "C": CommandNames.Copy, + // "B": CommandNames.Copy, + "P": CommandNames.PasteClip, + + "DEL": CommandNames.Erase, + "RO": CommandNames.Rotate, + "M": CommandNames.Move, + + "O": CommandNames.Config, "ESC": "ESC", "WR": "EDITORWINERACK", diff --git a/src/UI/Components/CameraControlButton/CameraControlBtn.tsx b/src/UI/Components/CameraControlButton/CameraControlBtn.tsx index 5323a5f25..8a61ae1d3 100644 --- a/src/UI/Components/CameraControlButton/CameraControlBtn.tsx +++ b/src/UI/Components/CameraControlButton/CameraControlBtn.tsx @@ -12,6 +12,7 @@ import { DownPanelStore } from "../../Store/DownPanelStore"; import { VisualStyleData } from "./IVisualType"; import { equalv3 } from "../../../Geometry/GeUtils"; import { Singleton } from "../../../Common/Singleton"; +import { CommandNames } from "../../../Common/CommandNames"; enum MenuType { @@ -26,31 +27,31 @@ interface IViewData } let viewData: IViewData[] = [ { - command: "FS", + command: CommandNames.FS, name: "俯视", }, { - command: "YS", + command: CommandNames.YS, name: "右视", }, { - command: "ZS", + command: CommandNames.ZS, name: "左视", }, { - command: "QS", + command: CommandNames.QS, name: "前视", }, { - command: "BOTTOMVIEW", + command: CommandNames.BottomView, name: "仰视", }, { - command: "BACKVIEW", + command: CommandNames.BackView, name: "后视", }, { - command: "SWISO", + command: CommandNames.Swiso, name: "西南等轴测", }, ]; diff --git a/src/UI/Components/CommandPanel/CommandItem.tsx b/src/UI/Components/CommandPanel/CommandItem.tsx index 258ecccca..a0a4d0186 100644 --- a/src/UI/Components/CommandPanel/CommandItem.tsx +++ b/src/UI/Components/CommandPanel/CommandItem.tsx @@ -106,29 +106,34 @@ export class CommandItem extends React.Component{ let target = this.m_InputEl; let cserver = CommandServer.GetInstance() as CommandServer; + + const commandData = this.props.commandData; + if (this.flag === TipType.OK) { if (this.isReset) { - if (this.props.commandData.customize !== target.value) + if (commandData.customize && commandData.customize !== target.value) { - commandMachine.RemoveCommand(this.props.commandData.customize); - this.props.commandData.customize = target.value.toUpperCase(); - this.props.commandData.customizeed = this.props.commandData.customize; + commandMachine.RemoveCommand(commandData.customize);// + commandData.customize = undefined; + cserver.DeleteCustonCommand(commandData); + // commandData.customizeed = commandData.customize; } } else { - this.props.commandData.customize = target.value.toUpperCase(); - this.props.commandData.customizeed = this.props.commandData.customize; - - commandMachine.RegisterCustomCommand(this.props.commandData.command, this.props.commandData.customize); - cserver.AddCustonCommand(this.props.commandData); + commandData.customize = target.value.toUpperCase(); + if (commandData.customize === commandData.defaultCustom) + commandData.customize = undefined; + commandData.customizeed = commandData.customize; + commandMachine.RegisterCustomCommand(commandData.command, commandData.customize || commandData.defaultCustom); + cserver.AddCustonCommand(commandData); } } else { - target.value = this.props.commandData.customizeed || this.props.commandData.defaultCustom; + target.value = commandData.customizeed || commandData.defaultCustom; } this.flag = TipType.OK; }; diff --git a/src/UI/Components/CommandPanel/CommandList.ts b/src/UI/Components/CommandPanel/CommandList.ts index 4b8986ec6..a30fb6617 100644 --- a/src/UI/Components/CommandPanel/CommandList.ts +++ b/src/UI/Components/CommandPanel/CommandList.ts @@ -1,4 +1,5 @@ import { IconEnum } from "../../IconEnum"; +import { CommandNames } from "../../../Common/CommandNames"; /** * 命令面板列表数据 * 非搜索项放在开头,暂勿随意更改位置,待优化 @@ -29,7 +30,7 @@ export const CommandList: ICommand[] = [ typeId: "i2d", link: "#", defaultCustom: "PT", - command: "PT", + command: CommandNames.Point, type: "二维", chName: "点", // enName: "Point", @@ -40,7 +41,7 @@ export const CommandList: ICommand[] = [ typeId: "i2d", link: "#", defaultCustom: "L", - command: "L", + command: CommandNames.Line, type: "二维", chName: "直线", // enName: "Line", @@ -51,7 +52,7 @@ export const CommandList: ICommand[] = [ typeId: "i2d", link: "#", defaultCustom: "ARC", - command: "ARC", + command: CommandNames.Arc, type: "二维", chName: "圆弧", // enName: "Arc", @@ -62,7 +63,7 @@ export const CommandList: ICommand[] = [ typeId: "i2d", link: "#", defaultCustom: "C", - command: "C", + command: CommandNames.Circle, type: "二维", chName: "圆", // enName: "Circle", @@ -73,7 +74,7 @@ export const CommandList: ICommand[] = [ typeId: "i2d", link: "#", defaultCustom: "PL", - command: "PL", + command: CommandNames.Polyline, type: "二维", chName: "多段线", // enName: "Polyline", @@ -84,28 +85,28 @@ export const CommandList: ICommand[] = [ typeId: "i2d", link: "#", defaultCustom: "RECTANG", - command: "RECTANG", + command: CommandNames.RECTANG, type: "二维", chName: "矩形", // enName: "Rectangle", chDes: "画一个矩形", }, - // { - // typeId: "i2d", - // link: "#", - // defaultCustom: "EL", - // command: "EL", - // type: "二维", - // chName: "椭圆", - // // enName: "Ellipse", - // chDes: "画一个椭圆", - // }, + { + typeId: "i2d", + link: "#", + defaultCustom: "EL", + command: CommandNames.Ellipse, + type: "二维", + chName: "椭圆", + // enName: "Ellipse", + chDes: "画一个椭圆", + }, { icon: IconEnum.Text, typeId: "i2d", link: "#", defaultCustom: "TEXT", - command: "TEXT", + command: CommandNames.Text, type: "二维", chName: "文字", // enName: "Text", @@ -116,7 +117,7 @@ export const CommandList: ICommand[] = [ typeId: "i2d", link: "#", defaultCustom: "TEXT2CURVE", - command: "TEXT2CURVE", + command: CommandNames.Text2Curve, type: "二维", chName: "文字转曲线", chDes: "将Text转为Curve类型", @@ -126,7 +127,7 @@ export const CommandList: ICommand[] = [ // typeId: "i2d", // link: "#", // defaultCustom: "SPL", - // command: "SPL", + // command: CommandNames.Spline, // type: "二维", // chName: "样条曲线", // // enName: "SPLine", @@ -137,7 +138,7 @@ export const CommandList: ICommand[] = [ typeId: "i2d", link: "#", defaultCustom: "REG", - command: "REG", + command: CommandNames.Reg, type: "二维", chName: "面域", // enName: "Draw Region", @@ -150,7 +151,7 @@ export const CommandList: ICommand[] = [ typeId: "i3d", link: "#", defaultCustom: "UCS", - command: "UCS", + command: CommandNames.CustomUCS, type: "三维", chName: "用户坐标系", // enName: "UCS Setting", @@ -161,7 +162,7 @@ export const CommandList: ICommand[] = [ typeId: "i3d", link: "#", defaultCustom: "EXTRUDE", - command: "EXTRUDE", + command: CommandNames.Extrude, type: "三维", chName: "拉伸实体", // enName: "Cylineder", @@ -172,7 +173,7 @@ export const CommandList: ICommand[] = [ typeId: "i3d", link: "#", defaultCustom: "REVOLVE", - command: "REVOLVE", + command: CommandNames.Revolve, type: "三维", chName: "车削实体", // enName: "Cylineder", @@ -185,7 +186,7 @@ export const CommandList: ICommand[] = [ typeId: "hb", link: "#", defaultCustom: "DB", - command: "DB", + command: CommandNames.SingleBoard, type: "画板", chName: "单板", // enName: "SingleBoard", @@ -196,7 +197,7 @@ export const CommandList: ICommand[] = [ typeId: "hb", link: "#", defaultCustom: "ZYC", - command: "ZYC", + command: CommandNames.LRBoard, type: "画板", chName: "左右侧板", // enName: "SideBoard", @@ -207,7 +208,7 @@ export const CommandList: ICommand[] = [ typeId: "hb", link: "#", defaultCustom: "DD", - command: "DD", + command: CommandNames.TBBoard, type: "画板", chName: "顶底板", // enName: "TopBottomBoard", @@ -218,7 +219,7 @@ export const CommandList: ICommand[] = [ typeId: "hb", link: "#", defaultCustom: "CB", - command: "CB", + command: CommandNames.LayerBoard, type: "画板", chName: "层板", // enName: "Shelves", @@ -229,7 +230,7 @@ export const CommandList: ICommand[] = [ typeId: "hb", link: "#", defaultCustom: "BB", - command: "BB", + command: CommandNames.BehindBoard, type: "画板", chName: "背板", // enName: "BackBoard", @@ -240,7 +241,7 @@ export const CommandList: ICommand[] = [ typeId: "hb", link: "#", defaultCustom: "LB", - command: "LB", + command: CommandNames.VertialBoard, type: "画板", chName: "立板", // enName: "VertivalBoard", @@ -262,7 +263,7 @@ export const CommandList: ICommand[] = [ typeId: "hb", link: "#", defaultCustom: "DOOR", - command: "DOOR", + command: CommandNames.Door, type: "画板", chName: "门板", // enName: "Door", @@ -273,7 +274,7 @@ export const CommandList: ICommand[] = [ typeId: "hb", link: "#", defaultCustom: "YX", - command: "YX", + command: CommandNames.YiXing, type: "画板", chName: "异形板", // enName: "SpecialShapeBoard", @@ -284,7 +285,7 @@ export const CommandList: ICommand[] = [ typeId: "hb", link: "#", defaultCustom: "YXLK", - command: "YXLK", + command: CommandNames.YXLK, type: "画板", chName: "异形轮廓应用", // enName: "SpecialShapedBoard Contour", @@ -295,7 +296,7 @@ export const CommandList: ICommand[] = [ typeId: "hb", link: "#", defaultCustom: "TOPLINE", - command: "TOPLINE", + command: CommandNames.Topline, type: "画板", chName: "线条", // enName: "TopLine", @@ -306,7 +307,7 @@ export const CommandList: ICommand[] = [ typeId: "hb", link: "#", defaultCustom: "SKT", - command: "SKT", + command: CommandNames.CloseStrip, type: "画板", chName: "收口条", // enName: "ClosingStrip", @@ -317,7 +318,7 @@ export const CommandList: ICommand[] = [ typeId: "hb", link: "#", defaultCustom: "ROTATELYBR", - command: "ROTATELYBR", + command: CommandNames.RotateLayerBoard, type: "画板", chName: "斜层板", chDes: "绘制斜层板", @@ -327,7 +328,7 @@ export const CommandList: ICommand[] = [ typeId: "hb", link: "#", defaultCustom: "WINERACK", - command: "WINERACK", + command: CommandNames.Winerack, type: "画板", chName: "酒格", chDes: "绘制酒格", @@ -338,7 +339,7 @@ export const CommandList: ICommand[] = [ typeId: "hb", link: "#", defaultCustom: "LATTICE", - command: "LATTICE", + command: CommandNames.Lattice, type: "画板", chName: "格子抽", chDes: "绘制格子抽", @@ -348,7 +349,7 @@ export const CommandList: ICommand[] = [ typeId: "hb", link: "#", defaultCustom: "CT", - command: "DRAWER", + command: CommandNames.Drawer, type: "画板", chName: "抽屉", chDes: "绘制抽屉", @@ -358,7 +359,7 @@ export const CommandList: ICommand[] = [ typeId: "hb", link: "#", defaultCustom: "CURVE2REC", - command: "CURVE2REC", + command: CommandNames.Curve2Rect, type: "画板", chName: "线条变矩形", chDes: "将任意线条分析为单个/多个矩形", @@ -368,7 +369,7 @@ export const CommandList: ICommand[] = [ typeId: "hb", link: "#", defaultCustom: "R2B", - command: "R2B", + command: CommandNames.R2b, type: "画板", chName: "矩形变板件", chDes: "将矩形转换为板件", @@ -380,7 +381,7 @@ export const CommandList: ICommand[] = [ typeId: "bjbj", link: "#", defaultCustom: "QG", - command: "QG", + command: CommandNames.LinearCutting, type: "板件编辑", chName: "线性切割", chDes: "根据所绘线条切割板件", @@ -390,7 +391,7 @@ export const CommandList: ICommand[] = [ typeId: "bjbj", link: "#", defaultCustom: "QG2", - command: "QG2", + command: CommandNames.NonAssociativeCutting, type: "板件编辑", chName: "板件相切", chDes: "以一个板件切割其他板件", @@ -400,7 +401,7 @@ export const CommandList: ICommand[] = [ typeId: "bjbj", link: "#", defaultCustom: "QG4", - command: "QG4", + command: CommandNames.ReferenceCutting, type: "板件编辑", chName: "参照切割", chDes: "以一个板件为参照切割其他板件", @@ -410,7 +411,7 @@ export const CommandList: ICommand[] = [ typeId: "bjbj", link: "#", defaultCustom: "BOARDBATCHCURTAIL", - command: "BOARDBATCHCURTAIL", + command: CommandNames.BoardBatchCurtail, type: "板件编辑", chName: "批量内缩", chDes: "批量内缩板件", @@ -420,7 +421,7 @@ export const CommandList: ICommand[] = [ typeId: "bjbj", link: "#", defaultCustom: "BOARDFINDMODIFY", - command: "BOARDFINDMODIFY", + command: CommandNames.BoardFindModify, type: "板件编辑", chName: "查找修改", chDes: "在当前所有板件属性中进行查找修改", @@ -429,8 +430,8 @@ export const CommandList: ICommand[] = [ icon: IconEnum.BacthModifyActiveLayerBr, typeId: "bjbj", link: "#", - defaultCustom: "ACTICITYLAYERBOARD", - command: "ACTICITYLAYERBOARD", + defaultCustom: "ACTLAYERBR", + command: CommandNames.ActicityLayerBoard, type: "板件编辑", chName: "层板改为活动层板", chDes: "将层板修改成活动层板", @@ -440,7 +441,7 @@ export const CommandList: ICommand[] = [ typeId: "bjbj", link: "#", defaultCustom: "CHECKMODEING", - command: "CHECKMODEING", + command: CommandNames.CheckModeling, type: "板件编辑", chName: "造型检查", chDes: "检查造型", @@ -450,7 +451,7 @@ export const CommandList: ICommand[] = [ typeId: "bjbj", link: "#", defaultCustom: "INTERFERE", - command: "INTERFERE", + command: CommandNames.Interfere, type: "板件编辑", chName: "干涉检查", chDes: "检查干涉", @@ -459,8 +460,8 @@ export const CommandList: ICommand[] = [ icon: IconEnum.ModifyHoleFace, typeId: "bjbj", link: "#", - defaultCustom: "REVERSEDRILLFACE", - command: "REVERSEDRILLFACE", + defaultCustom: "REVHOLEFACE", + command: CommandNames.ReverseDrillFace, type: "板件编辑", chName: "修改排孔面", chDes: "", @@ -470,7 +471,7 @@ export const CommandList: ICommand[] = [ typeId: "bjbj", link: "#", defaultCustom: "BATCHMODIFY", - command: "BATCHMODIFY", + command: CommandNames.BatchModify, type: "板件编辑", chName: "修改板边", chDes: "批量修改排钻封边", @@ -480,7 +481,7 @@ export const CommandList: ICommand[] = [ typeId: "bjbj", link: "#", defaultCustom: "BBS", - command: "BBS", + command: CommandNames.LookOverBoardInfos, type: "板件编辑", chName: "批量查看", chDes: "批量查看板件属性", @@ -490,7 +491,7 @@ export const CommandList: ICommand[] = [ typeId: "bjbj", link: "#", defaultCustom: "CLEARRELEVANCE", - command: "CLEARRELEVANCE", + command: CommandNames.ClearRef, type: "板件编辑", chName: "清除关联切割", chDes: "清除关联切割", @@ -500,7 +501,7 @@ export const CommandList: ICommand[] = [ typeId: "bjbj", link: "#", defaultCustom: "SETSMOOTHEDGE", - command: "SETSMOOTHEDGE", + command: CommandNames.SetSmoothEdge, type: "板件编辑", chName: "见光面封边", chDes: "见光面封边", @@ -510,7 +511,7 @@ export const CommandList: ICommand[] = [ typeId: "bjbj", link: "#", defaultCustom: "UPDATEBOARDINFOS", - command: "UPDATEBOARDINFOS", + command: CommandNames.UpdateBoardInfos, type: "板件编辑", chName: "根据板件名修改属性", chDes: "根据板件名修改属性", @@ -522,7 +523,7 @@ export const CommandList: ICommand[] = [ typeId: "dg", link: "#", defaultCustom: "SL", - command: "SL", + command: CommandNames.SpotLight, type: "灯光", chName: "射灯", // enName: "Spot lamp", @@ -533,7 +534,7 @@ export const CommandList: ICommand[] = [ typeId: "dg", link: "#", defaultCustom: "SL1", - command: "SL1", + command: CommandNames.SpotLight2, type: "灯光", chName: "下照射灯", // enName: "Down lamp", @@ -544,7 +545,7 @@ export const CommandList: ICommand[] = [ typeId: "dg", link: "#", defaultCustom: "PTL", - command: "PTL", + command: CommandNames.PointLight, type: "灯光", chName: "点光源", // enName: "Pointlight", @@ -555,7 +556,7 @@ export const CommandList: ICommand[] = [ typeId: "dg", link: "#", defaultCustom: "PTL2", - command: "PTL2", + command: CommandNames.PointLight2, type: "灯光", chName: "参数点光源", // enName: "Parametric Pointlight", @@ -566,7 +567,7 @@ export const CommandList: ICommand[] = [ typeId: "dg", link: "#", defaultCustom: "RL", - command: "RL", + command: CommandNames.RectLight, type: "灯光", chName: "矩形光", // enName: "Rectangular light", @@ -579,7 +580,7 @@ export const CommandList: ICommand[] = [ typeId: "pz", link: "#", defaultCustom: "PZ", - command: "PZ", + command: CommandNames.Hole, type: "排钻", chName: "排钻", // enName: "Drill", @@ -590,7 +591,7 @@ export const CommandList: ICommand[] = [ typeId: "pz", link: "#", defaultCustom: "DRILLCONFIG", - command: "DRILLCONFIG", + command: CommandNames.DrillConfig, type: "排钻", chName: "排钻配置", // enName: "DrillConfig", @@ -601,7 +602,7 @@ export const CommandList: ICommand[] = [ typeId: "pz", link: "#", defaultCustom: "DELETEDRILL", - command: "DELETEDRILL", + command: CommandNames.DeleteHole, type: "排钻", chName: "删除排钻", chDes: "删除排钻", @@ -623,7 +624,7 @@ export const CommandList: ICommand[] = [ typeId: "view", link: "#", defaultCustom: "FS", - command: "FS", + command: CommandNames.FS, type: "视图", chName: "俯视图", // enName: "Top View", @@ -634,7 +635,7 @@ export const CommandList: ICommand[] = [ typeId: "view", link: "#", defaultCustom: "QS", - command: "QS", + command: CommandNames.QS, type: "视图", chName: "前视图", // enName: "Front View", @@ -645,7 +646,7 @@ export const CommandList: ICommand[] = [ typeId: "view", link: "#", defaultCustom: "YS", - command: "YS", + command: CommandNames.YS, type: "视图", chName: "右视图", // enName: "Right View", @@ -656,7 +657,7 @@ export const CommandList: ICommand[] = [ typeId: "view", link: "#", defaultCustom: "ZS", - command: "ZS", + command: CommandNames.ZS, type: "视图", chName: "左视图", // enName: "Left View", @@ -667,7 +668,7 @@ export const CommandList: ICommand[] = [ typeId: "view", link: "#", defaultCustom: "BOTTOMVIEW", - command: "BOTTOMVIEW", + command: CommandNames.BottomView, type: "视图", chName: "仰视图", chDes: "切换到仰视图", @@ -677,7 +678,7 @@ export const CommandList: ICommand[] = [ typeId: "view", link: "#", defaultCustom: "BACKVIEW", - command: "BACKVIEW", + command: CommandNames.BackView, type: "视图", chName: "后视图", chDes: "切换到后视图", @@ -687,7 +688,7 @@ export const CommandList: ICommand[] = [ typeId: "view", link: "#", defaultCustom: "SWISO", - command: "SWISO", + command: CommandNames.Swiso, type: "视图", chName: "西南等轴测", // enName: "Swiso View", @@ -698,7 +699,7 @@ export const CommandList: ICommand[] = [ typeId: "view", link: "#", defaultCustom: "EXPLOSIONMAP", - command: "EXPLOSIONMAP", + command: CommandNames.Explosion, type: "视图", chName: "爆炸图", chDes: "爆炸图效果", @@ -708,7 +709,7 @@ export const CommandList: ICommand[] = [ typeId: "view", link: "#", defaultCustom: "CC", - command: "CC", + command: CommandNames.SwitchCamera, type: "视图", chName: "切换相机", // enName: "Switch Camera", @@ -721,7 +722,7 @@ export const CommandList: ICommand[] = [ typeId: "dim", link: "#", defaultCustom: "DAL", - command: "DAL", + command: CommandNames.AlignDim, type: "标注", chName: "对齐标注", // enName: "Aligned Dimension", @@ -732,7 +733,7 @@ export const CommandList: ICommand[] = [ typeId: "dim", link: "#", defaultCustom: "DLI", - command: "DLI", + command: CommandNames.LinearDim, type: "标注", chName: "线性标注", // enName: "Linear Dimension", @@ -743,7 +744,7 @@ export const CommandList: ICommand[] = [ typeId: "dim", link: "#", defaultCustom: "DAN", - command: "DAN", + command: CommandNames.AngleDim, type: "标注", chName: "角度标注", // enName: "Aligned Dimension", @@ -754,7 +755,7 @@ export const CommandList: ICommand[] = [ typeId: "dim", link: "#", defaultCustom: "DCO", - command: "DCO", + command: CommandNames.DimContinue, type: "标注", chName: "连续标注", // enName: "Continue Dimension", @@ -765,7 +766,7 @@ export const CommandList: ICommand[] = [ typeId: "dim", link: "#", defaultCustom: "DIMRAD", - command: "DIMRAD", + command: CommandNames.RadiusDim, type: "标注", chName: "标注半径", // enName: "Continue Dimension", @@ -776,7 +777,7 @@ export const CommandList: ICommand[] = [ typeId: "dim", link: "#", defaultCustom: "DIMDIA", - command: "DIMDIA", + command: CommandNames.DiaDim, type: "标注", chName: "标注直径", // enName: "Continue Dimension", @@ -787,7 +788,7 @@ export const CommandList: ICommand[] = [ typeId: "dim", link: "#", defaultCustom: "AUTODIMBRS", - command: "AUTODIMBRS", + command: CommandNames.AutoDimBrs, type: "标注", chName: "标注柜体", // enName: "Cabinet Dimension", @@ -798,7 +799,7 @@ export const CommandList: ICommand[] = [ typeId: "dim", link: "#", defaultCustom: "FASTDIMBRS", - command: "FASTDIMBRS", + command: CommandNames.FastDimBrs, type: "标注", chName: "自由标注", // enName: "Fast Dimension", @@ -809,7 +810,7 @@ export const CommandList: ICommand[] = [ typeId: "dim", link: "#", defaultCustom: "DELETEDIM", - command: "DELETEDIM", + command: CommandNames.DeleteDim, type: "标注", chName: "快速删除", // enName: "Delete Dimension", @@ -822,7 +823,7 @@ export const CommandList: ICommand[] = [ typeId: "VisualStyle", link: "#", defaultCustom: "XK", - command: "WIREFRAME", + command: CommandNames.Wireframe, type: "视觉样式", chName: "二维线框", chDes: "切换视觉样式到二维线框", @@ -832,7 +833,7 @@ export const CommandList: ICommand[] = [ typeId: "VisualStyle", link: "#", defaultCustom: "GN", - command: "CONCEPTUAL", + command: CommandNames.Conceptual, type: "视觉样式", chName: "概念", chDes: "切换视觉样式到概念模式", @@ -842,7 +843,7 @@ export const CommandList: ICommand[] = [ typeId: "VisualStyle", link: "#", defaultCustom: "PHYSICAL", - command: "PHYSICAL", + command: CommandNames.Physical, type: "视觉样式", chName: "真实", chDes: "切换视觉样式到真实模式", @@ -852,7 +853,7 @@ export const CommandList: ICommand[] = [ typeId: "VisualStyle", link: "#", defaultCustom: "PHYSICAL2", - command: "PHYSICAL2", + command: CommandNames.Physical2, type: "视觉样式", chName: "真实带线框", chDes: "切换视觉样式到真实模式", @@ -865,7 +866,7 @@ export const CommandList: ICommand[] = [ typeId: "util", link: "#", defaultCustom: "COPY", - command: "COPY", + command: CommandNames.Copy, type: "工具", chName: "复制", // enName: "Copy", @@ -876,7 +877,7 @@ export const CommandList: ICommand[] = [ typeId: "util", link: "#", defaultCustom: "COPYCLIP", - command: "COPYCLIP", + command: CommandNames.CopyClip, type: "工具", chName: "复制到剪贴板", // enName: "CopyClip", @@ -887,7 +888,7 @@ export const CommandList: ICommand[] = [ typeId: "util", link: "#", defaultCustom: "PASTECLIP", - command: "PASTECLIP", + command: CommandNames.PasteClip, type: "工具", chName: "从剪贴板粘贴", // enName: "PasteClip", @@ -898,7 +899,7 @@ export const CommandList: ICommand[] = [ typeId: "util", link: "#", defaultCustom: "E", - command: "ERASE", + command: CommandNames.Erase, type: "工具", chName: "删除", // enName: "Delete", @@ -909,7 +910,7 @@ export const CommandList: ICommand[] = [ typeId: "util", link: "#", defaultCustom: "M", - command: "MOVE", + command: CommandNames.Move, type: "工具", chName: "移动", // enName: "Move", @@ -920,7 +921,7 @@ export const CommandList: ICommand[] = [ typeId: "util", link: "#", defaultCustom: "RO", - command: "RO", + command: CommandNames.Rotate, type: "工具", chName: "旋转", // enName: "Rotate", @@ -931,7 +932,7 @@ export const CommandList: ICommand[] = [ typeId: "util", link: "#", defaultCustom: "BREAK", - command: "BREAK", + command: CommandNames.Break, type: "工具", chName: "打断", // enName: "Break", @@ -942,7 +943,7 @@ export const CommandList: ICommand[] = [ typeId: "util", link: "#", defaultCustom: "TR", - command: "TR", + command: CommandNames.Trim, type: "工具", chName: "修剪", // enName: "Trim", @@ -953,7 +954,7 @@ export const CommandList: ICommand[] = [ typeId: "util", link: "#", defaultCustom: "ARRAY", - command: "ARRAY", + command: CommandNames.Array, type: "工具", chName: "阵列", // enName: "Array", @@ -964,7 +965,7 @@ export const CommandList: ICommand[] = [ typeId: "util", link: "#", defaultCustom: "EX", - command: "EX", + command: CommandNames.Extend, type: "工具", chName: "延伸", // enName: "Extend", @@ -975,7 +976,7 @@ export const CommandList: ICommand[] = [ typeId: "util", link: "#", defaultCustom: "SC", - command: "SC", + command: CommandNames.Scale, type: "工具", chName: "缩放", // enName: "Scale", @@ -986,7 +987,7 @@ export const CommandList: ICommand[] = [ typeId: "util", link: "#", defaultCustom: "DIV", - command: "DIV", + command: CommandNames.Divide, type: "工具", chName: "等分", // enName: "Divid", @@ -997,7 +998,7 @@ export const CommandList: ICommand[] = [ typeId: "util", link: "#", defaultCustom: "F", - command: "F", + command: CommandNames.Fillet, type: "工具", chName: "倒角", // enName: "Fillet", @@ -1008,7 +1009,7 @@ export const CommandList: ICommand[] = [ typeId: "util", link: "#", defaultCustom: "REV", - command: "REV", + command: CommandNames.Reverse, type: "工具", chName: "翻转曲线", // enName: "Reverse PolyLines", @@ -1019,7 +1020,7 @@ export const CommandList: ICommand[] = [ typeId: "util", link: "#", defaultCustom: "S", - command: "STRETCH", + command: CommandNames.Stretch, type: "工具", chName: "拉伸", // enName: "Stretch", @@ -1030,7 +1031,7 @@ export const CommandList: ICommand[] = [ typeId: "util", link: "#", defaultCustom: "SS", - command: "SELECTSTRETCH", + command: CommandNames.SelectStretch, type: "工具", chName: "选择拉伸", // enName: "SelectedStretch", @@ -1052,7 +1053,7 @@ export const CommandList: ICommand[] = [ typeId: "util", link: "#", defaultCustom: "O", - command: "O", + command: CommandNames.Offset, type: "工具", chName: "偏移", // enName: "Offset", @@ -1074,7 +1075,7 @@ export const CommandList: ICommand[] = [ typeId: "util", link: "#", defaultCustom: "PE", - command: "PE", + command: CommandNames.Pedit, type: "工具", chName: "编辑多段线", // enName: "Pedit", @@ -1113,23 +1114,23 @@ export const CommandList: ICommand[] = [ // enName: "Entsel", chDes: "提示用户以单点方式选择单个对象", }, - { - icon: IconEnum.Multisel, - typeId: "util", - link: "#", - defaultCustom: "SS", - command: "SS", - type: "工具", - chName: "多选", - // enName: "Ssget", - chDes: "从所选对象创建选择集", - }, + // { + // icon: IconEnum.Multisel, + // typeId: "util", + // link: "#", + // defaultCustom: "SS", + // command: "SS", + // type: "工具", + // chName: "多选", + // // enName: "Ssget", + // chDes: "从所选对象创建选择集", + // }, { icon: IconEnum.Camera, typeId: "util", link: "#", defaultCustom: "HIDESELECT", - command: "HIDESELECT", + command: CommandNames.HideSelect, type: "工具", chName: "隐藏选中", chDes: "隐藏选中", @@ -1139,7 +1140,7 @@ export const CommandList: ICommand[] = [ typeId: "util", link: "#", defaultCustom: "SHOW", - command: "SHOW", + command: CommandNames.Show, type: "工具", chName: "显示所有", chDes: "显示所有", @@ -1149,7 +1150,7 @@ export const CommandList: ICommand[] = [ typeId: "util", link: "#", defaultCustom: "INT", - command: "INT", + command: CommandNames.Intersect, type: "工具", chName: "面域并集", // enName: "Region Intersect", @@ -1160,7 +1161,7 @@ export const CommandList: ICommand[] = [ typeId: "util", link: "#", defaultCustom: "UNION", - command: "UNION", + command: CommandNames.Union, type: "工具", chName: "面域交集", // enName: "Region Union", @@ -1171,7 +1172,7 @@ export const CommandList: ICommand[] = [ typeId: "util", link: "#", defaultCustom: "SUB", - command: "SUB", + command: CommandNames.Substract, type: "工具", chName: "差集", // enName: "Region Sub", @@ -1182,7 +1183,7 @@ export const CommandList: ICommand[] = [ typeId: "util", link: "#", defaultCustom: "SW", - command: "SW", + command: CommandNames.Sweep, type: "工具", chName: "扫掠", chDes: "通过扫掠二维路径来创建三维实体或曲面", @@ -1192,7 +1193,7 @@ export const CommandList: ICommand[] = [ typeId: "util", link: "#", defaultCustom: "MI", - command: "MI", + command: CommandNames.Mirror, type: "工具", chName: "镜像", // enName: "Mirror", @@ -1203,7 +1204,7 @@ export const CommandList: ICommand[] = [ typeId: "util", link: "#", defaultCustom: "ALIGN", - command: "ALIGN", + command: CommandNames.Align, type: "工具", chName: "对齐", chDes: "对齐", @@ -1213,7 +1214,7 @@ export const CommandList: ICommand[] = [ // typeId: "util", // link: "#", // defaultCustom: "X", - // command: "X", + // command: CommandNames.Explode, // type: "工具", // chName: "爆炸", // // enName: "Explode", @@ -1235,7 +1236,7 @@ export const CommandList: ICommand[] = [ typeId: "util", link: "#", defaultCustom: "EXPORTVIEW", - command: "EXPORTVIEW", + command: CommandNames.ExportView, type: "工具", chName: "单柜效果图", chDes: "导出单个柜子效果图", @@ -1253,8 +1254,8 @@ export const CommandList: ICommand[] = [ { typeId: "util", link: "#", - defaultCustom: "KJLEXPORT", - command: "KJLEXPORT", + defaultCustom: CommandNames.KJLExport, + command: CommandNames.KJLExport, type: "工具", chName: "酷家乐导出", chDes: "导出数据到酷家乐", @@ -1263,7 +1264,7 @@ export const CommandList: ICommand[] = [ typeId: "util", link: "#", defaultCustom: "DI", - command: "DIST", + command: CommandNames.Dist, type: "工具", chName: "测量", chDes: "测量", @@ -1285,7 +1286,7 @@ export const CommandList: ICommand[] = [ typeId: "file", link: "#", defaultCustom: "NEW", - command: "NEW", + command: CommandNames.New, type: "文件", chName: "新建文件", chDes: "新建文件", @@ -1295,7 +1296,7 @@ export const CommandList: ICommand[] = [ typeId: "file", link: "#", defaultCustom: "SAVE", - command: "SAVE", + command: CommandNames.Save, type: "文件", chName: "保存文件", chDes: "保存当前文件", @@ -1305,7 +1306,7 @@ export const CommandList: ICommand[] = [ typeId: "file", link: "#", defaultCustom: "SAVEAS", - command: "SAVEAS", + command: CommandNames.SaveAs, type: "文件", chName: "另存为", chDes: "将当前文件另存为", @@ -1315,7 +1316,7 @@ export const CommandList: ICommand[] = [ typeId: "file", link: "#", defaultCustom: "PRINT", - command: "PRINT", + command: CommandNames.Print, type: "文件", chName: "打印", chDes: "打印文件", @@ -1325,7 +1326,7 @@ export const CommandList: ICommand[] = [ typeId: "file", link: "#", defaultCustom: "U", - command: "U", + command: CommandNames.Undo, type: "文件", chName: "撤销", chDes: "撤销上一步操作", @@ -1335,7 +1336,7 @@ export const CommandList: ICommand[] = [ typeId: "file", link: "#", defaultCustom: "REDO", - command: "REDO", + command: CommandNames.Redo, type: "文件", chName: "重做", chDes: "重做被撤销的操作", @@ -1345,7 +1346,7 @@ export const CommandList: ICommand[] = [ typeId: "file", link: "#", defaultCustom: "OPEN", - command: "OPEN", + command: CommandNames.Open, type: "文件", chName: "打开", chDes: "打开文件", @@ -1378,7 +1379,7 @@ export const CommandList: ICommand[] = [ typeId: "temp", link: "#", defaultCustom: "TEMPLATEDESIGN", - command: "TEMPLATEDESIGN", + command: CommandNames.TemplateDesign, type: "模板", chName: "模板设计", chDes: "", @@ -1387,8 +1388,8 @@ export const CommandList: ICommand[] = [ icon: IconEnum.CutSpace, typeId: "temp", link: "#", - defaultCustom: "SplitTemplate", - command: "SplitTemplate", + defaultCustom: CommandNames.SpliteTemplate, + command: CommandNames.SpliteTemplate, type: "模板", chName: "切割空间", chDes: "切割空间", @@ -1400,7 +1401,7 @@ export const CommandList: ICommand[] = [ typeId: "module", link: "#", defaultCustom: "TEMPLATE", - command: "TEMPLATE", + command: CommandNames.Template, type: "模块", chName: "模块管理", chDes: "", @@ -1410,7 +1411,7 @@ export const CommandList: ICommand[] = [ typeId: "module", link: "#", defaultCustom: "DRILLTEMPLATE", - command: "DRILLTEMPLATE", + command: CommandNames.HoleTemplate, type: "模块", chName: "排钻模块", chDes: "", @@ -1420,7 +1421,7 @@ export const CommandList: ICommand[] = [ typeId: "module", link: "#", defaultCustom: "DRAWVSBOX", - command: "DRAWVSBOX", + command: CommandNames.DrawVSBOX, type: "模块", chName: "绘制空间", chDes: "根据宽高深绘制空间盒子", @@ -1430,21 +1431,11 @@ export const CommandList: ICommand[] = [ typeId: "module", link: "#", defaultCustom: "CURVE2VSBOX", - command: "CURVE2VSBOX", + command: CommandNames.Curve2VSBox, type: "模块", chName: "线框变空间", chDes: "将二维线框转换为空间盒子", }, - { - icon: IconEnum.CutSpace, - typeId: "module", - link: "#", - defaultCustom: "SPLITTEMPLATE", - command: "SPLITTEMPLATE", - type: "模块", - chName: "切割空间", - chDes: "切割空间盒子", - }, //拆单 { @@ -1452,7 +1443,7 @@ export const CommandList: ICommand[] = [ typeId: "cd", link: "#", defaultCustom: "CD", - command: "CD", + command: CommandNames.ChaiDan, type: "拆单", chName: "拆单优化", chDes: "", @@ -1462,7 +1453,7 @@ export const CommandList: ICommand[] = [ typeId: "cd", link: "#", defaultCustom: "CKYH", - command: "CKYH", + command: CommandNames.ShowYouhua, type: "拆单", chName: "查看优化", chDes: "", @@ -1472,7 +1463,7 @@ export const CommandList: ICommand[] = [ typeId: "cd", link: "#", defaultCustom: "CBCD", - command: "CBCD", + command: CommandNames.ChaiDanJB, type: "拆单", chName: "成倍拆单", chDes: "", @@ -1482,7 +1473,7 @@ export const CommandList: ICommand[] = [ typeId: "cd", link: "#", defaultCustom: "SHOWPROCESSGROUP2", - command: "SHOWPROCESSGROUP2", + command: CommandNames.ShowProcessingGroupModal2, type: "拆单", chName: "加工组", chDes: "查看或编辑加工组", @@ -1493,7 +1484,7 @@ export const CommandList: ICommand[] = [ typeId: "share", link: "#", defaultCustom: "TEMPLATESEARCH", - command: "TEMPLATESEARCH", + command: CommandNames.TemplateSearch, type: "共享", chName: "共享模块", chDes: "共享模块", @@ -1503,7 +1494,7 @@ export const CommandList: ICommand[] = [ typeId: "share", link: "#", defaultCustom: "BUYMATERIAL", - command: "BUYMATERIAL", + command: CommandNames.BuyMaterial, type: "共享", chName: "共享材质", chDes: "共享材质", diff --git a/src/UI/Components/Panel.tsx b/src/UI/Components/Panel.tsx index a2801b96a..7fc5e8505 100644 --- a/src/UI/Components/Panel.tsx +++ b/src/UI/Components/Panel.tsx @@ -15,6 +15,7 @@ import { SettingPanel } from './SettingPanel/SettingPanel'; import SoucePanel from './SourceManage/SoucePanel'; import { AppToaster } from './Toaster'; import { RemoveCustonCommand } from '../../Editor/CommandRegister'; +import { CommandNames } from '../../Common/CommandNames'; interface TopPanelState { @@ -45,7 +46,7 @@ export class TopPanel extends React.Component<{ store?: TopPanelStore; }, {}> } handleClick = (str) => { - commandMachine.ExecCommand("CONFIG"); + commandMachine.ExecCommand(CommandNames.Config); }; handleCancel = () => { diff --git a/src/UI/Components/Template/TemplateEditor.tsx b/src/UI/Components/Template/TemplateEditor.tsx index 2ae2a62d6..b020e6b76 100644 --- a/src/UI/Components/Template/TemplateEditor.tsx +++ b/src/UI/Components/Template/TemplateEditor.tsx @@ -13,6 +13,7 @@ import TempalteActionList from './TemplateActionList'; import TemplateParamList from './TemplateParamList'; import { TemplateSaveDir } from './TemplateSaveDir'; import { ModalHeader, ModalFooter } from '../Modal/ModalContainer'; +import { CommandNames } from '../../../Common/CommandNames'; export interface ITemplateEditorProps { @@ -106,9 +107,9 @@ export class TemplateEditor extends React.Component { { TempEditor.End(); if (this.props.isCheck) - commandMachine.ExecCommand("TEMPLATECHECK"); + commandMachine.ExecCommand(CommandNames.TemplateCheck); else - commandMachine.ExecCommand("TEMPLATE"); + commandMachine.ExecCommand(CommandNames.Template); } }; diff --git a/src/UI/Components/ToolBar/ToolbarContainer.tsx b/src/UI/Components/ToolBar/ToolbarContainer.tsx index afbb31c67..2654b18a6 100644 --- a/src/UI/Components/ToolBar/ToolbarContainer.tsx +++ b/src/UI/Components/ToolBar/ToolbarContainer.tsx @@ -10,45 +10,46 @@ import { app } from '../../../ApplicationServices/Application'; import { end } from 'xaop'; import { observable } from 'mobx'; import { arrayRemoveIf } from '../../../Common/ArrayExt'; +import { CommandNames } from '../../../Common/CommandNames'; @observer export class ToolbarContainer extends React.Component<{}, {}> { @observable iconList: ICommandIconInfo[] = [ - { svg: IconEnum.Delete, title: "删除", command: "ERASE" }, - { svg: IconEnum.Copy, title: "复制", command: "COPY" }, - { svg: IconEnum.PasteClip, title: "粘贴", command: "PASTECLIP" }, - { svg: IconEnum.Rotate, title: "旋转", command: "RO" }, - { svg: IconEnum.Move, title: "移动", command: "MOVE" }, - { svg: IconEnum.Offset, title: "偏移", command: "O" }, - { svg: IconEnum.Stretch, title: "拉伸", command: "S" }, - { svg: IconEnum.Zoom, title: "缩放", command: "SC" }, - { svg: IconEnum.Array, title: "阵列", command: "ARRAY" }, - { svg: IconEnum.Fillet, title: "倒角", command: "F" }, - { svg: IconEnum.Divide, title: "均分", command: "DIV" }, - { svg: IconEnum.Extend, title: "修剪", command: "TR" }, - { svg: IconEnum.Mirror, title: "镜像", command: "MI" }, - { svg: IconEnum.Break, title: "打断", command: "BREAK" }, - { svg: IconEnum.Join, title: "合并", command: "JOIN" }, - { svg: IconEnum.Extend, title: "延伸", command: "EX" }, - { svg: IconEnum.EditPolyLine, title: "编辑多段线", command: "PE" }, - { svg: IconEnum.Explode, title: "分解", command: "X" }, - { svg: IconEnum.Alignment, title: "对齐", command: "ALIGN" }, - { svg: IconEnum.ExportData, title: "效果图", command: "EXPORTDATA" }, + { svg: IconEnum.Delete, title: "删除", command: CommandNames.Erase }, + { svg: IconEnum.Copy, title: "复制", command: CommandNames.Copy }, + { svg: IconEnum.PasteClip, title: "粘贴", command: CommandNames.PasteClip }, + { svg: IconEnum.Rotate, title: "旋转", command: CommandNames.Rotate }, + { svg: IconEnum.Move, title: "移动", command: CommandNames.Move }, + { svg: IconEnum.Offset, title: "偏移", command: CommandNames.Offset }, + { svg: IconEnum.Stretch, title: "拉伸", command: CommandNames.Stretch }, + { svg: IconEnum.Zoom, title: "缩放", command: CommandNames.Scale }, + { svg: IconEnum.Array, title: "阵列", command: CommandNames.Array }, + { svg: IconEnum.Fillet, title: "倒角", command: CommandNames.Fillet }, + { svg: IconEnum.Divide, title: "均分", command: CommandNames.Divide }, + { svg: IconEnum.Extend, title: "修剪", command: CommandNames.Trim }, + { svg: IconEnum.Mirror, title: "镜像", command: CommandNames.Mirror }, + { svg: IconEnum.Break, title: "打断", command: CommandNames.Break }, + { svg: IconEnum.Join, title: "合并", command: CommandNames.Join }, + { svg: IconEnum.Extend, title: "延伸", command: CommandNames.Extend }, + { svg: IconEnum.EditPolyLine, title: "编辑多段线", command: CommandNames.Pedit }, + { svg: IconEnum.Explode, title: "分解", command: CommandNames.Explode }, + { svg: IconEnum.Alignment, title: "对齐", command: CommandNames.Align }, + { svg: IconEnum.ExportData, title: "效果图", command: CommandNames.ExportData }, ]; componentDidMount() { end(app.WebSocket, app.WebSocket.OnLinkEvent, (isOk: boolean) => { if (isOk) - this.iconList.push({ svg: IconEnum.Synchronous, title: "未同步", command: "TOGGLESYNCDATA" }); + this.iconList.push({ svg: IconEnum.Synchronous, title: "未同步", command: CommandNames.ToggleSyncData }); else - arrayRemoveIf(this.iconList, l => l.command === "TOGGLESYNCDATA"); + arrayRemoveIf(this.iconList, l => l.command === CommandNames.ToggleSyncData); }); app.CommandReactor.OnCommandEnd((cmdName: string, changeObjects, createObjects) => { - if (cmdName === "TOGGLESYNCDATA") + if (cmdName === CommandNames.ToggleSyncData) { - let icon = this.iconList.find(icon => icon?.command === "TOGGLESYNCDATA"); + let icon = this.iconList.find(icon => icon?.command === CommandNames.ToggleSyncData); if (icon) if (app.SyncDataReactor.Enable) { diff --git a/src/UI/Components/TopToolBar/ToolsBlock.tsx b/src/UI/Components/TopToolBar/ToolsBlock.tsx index 1aaa5d3f8..93dd6ec5c 100644 --- a/src/UI/Components/TopToolBar/ToolsBlock.tsx +++ b/src/UI/Components/TopToolBar/ToolsBlock.tsx @@ -12,6 +12,7 @@ import { Sleep } from "../../../Common/Sleep"; import { ICommandIconInfo, TopToolBarBlockData, TopToolBarBlockDataItem } from "./TopToolBarInterface"; import { ToolsBlockStore } from "./ToolsBlockStore"; import { userConfig } from "../../../Editor/UserConfig"; +import { CommandNames } from "../../../Common/CommandNames"; export interface ToolsBlockProps { @@ -101,7 +102,7 @@ export class ToolsBlock extends React.Component { let txt = cmd.title.length > 4 ? cmd.title.slice(0, 3) + ".." : cmd.title; return ( -
  • +
  • { this.HandleOnClick(cmd.command); }}> diff --git a/src/UI/Components/TopToolBar/TopToolBar.tsx b/src/UI/Components/TopToolBar/TopToolBar.tsx index 0b9d25d65..c235e1695 100644 --- a/src/UI/Components/TopToolBar/TopToolBar.tsx +++ b/src/UI/Components/TopToolBar/TopToolBar.tsx @@ -10,6 +10,7 @@ import { ThreeDEntityPanel } from "./ThreeDEntityPanel"; import { DimensionPanel } from "./DimensionPanel"; import { FileOperationPanel } from "./FileOperationPanel"; import { TemplateAndModulePanel } from "./TemplateAndModulePanel"; +import { CommandNames } from "../../../Common/CommandNames"; @observer export class TopToolBar extends React.Component<{}, {}> @@ -20,142 +21,142 @@ export class TopToolBar extends React.Component<{}, {}> let store = ToolsBlockStore.GetInstance() as ToolsBlockStore; //todo 更好的传入方式 store.iconList.file = [ - { svg: IconEnum.New, title: "新建", command: "NEW" }, - { svg: IconEnum.Save, title: "保存", command: "SAVE" }, - { svg: IconEnum.SaveAs, title: "另存为", command: "SAVEAS" }, - { svg: IconEnum.Cancel, title: "撤销", command: "U" }, - { svg: IconEnum.Undo, title: "重做", command: "REDO" }, - { svg: IconEnum.Open, title: "打开", command: "OPEN" }, + { svg: IconEnum.New, title: "新建", command: CommandNames.New }, + { svg: IconEnum.Save, title: "保存", command: CommandNames.Save }, + { svg: IconEnum.SaveAs, title: "另存为", command: CommandNames.SaveAs }, + { svg: IconEnum.Cancel, title: "撤销", command: CommandNames.Undo }, + { svg: IconEnum.Undo, title: "重做", command: CommandNames.Redo }, + { svg: IconEnum.Open, title: "打开", command: CommandNames.Open }, { svg: IconEnum.DXF, title: "DXF", command: "DXF" }, - { svg: IconEnum.Print, title: "打印", command: "PRINT" }, + { svg: IconEnum.Print, title: "打印", command: CommandNames.Print }, { svg: IconEnum.ClearHistoryRecord, title: "清除历史命令", command: "PU" }, ]; store.iconList.twoD = [ - { svg: IconEnum.Point, title: "点", command: "PT" }, - { svg: IconEnum.Line, title: "直线", command: "L" }, - { svg: IconEnum.Arc, title: "圆弧", command: "ARC" }, - { svg: IconEnum.CircleWithCrossDottedLine, title: "圆", command: "C" }, - { svg: IconEnum.PolyLine, title: "多段线", command: "PL" }, - { svg: IconEnum.Rectangle, title: "矩形", command: "RECTANG" }, - // { svg: IconEnum.SpLine, title: "样条曲线", command: "SPL" }, - { svg: IconEnum.Region, title: "面域", command: "REG" }, - { svg: IconEnum.Text, title: "文字", command: "TEXT" }, - { svg: IconEnum.Text2Curve, title: "文字转曲线", command: "TEXT2CURVE" }, + { svg: IconEnum.Point, title: "点", command: CommandNames.Point }, + { svg: IconEnum.Line, title: "直线", command: CommandNames.Line }, + { svg: IconEnum.Arc, title: "圆弧", command: CommandNames.Arc }, + { svg: IconEnum.CircleWithCrossDottedLine, title: "圆", command: CommandNames.Circle }, + { svg: IconEnum.PolyLine, title: "多段线", command: CommandNames.Polyline }, + { svg: IconEnum.Rectangle, title: "矩形", command: CommandNames.RECTANG }, + // { svg: IconEnum.SpLine, title: "样条曲线", command:CommandNames.Spline }, + { svg: IconEnum.Region, title: "面域", command: CommandNames.Reg }, + { svg: IconEnum.Text, title: "文字", command: CommandNames.Text }, + { svg: IconEnum.Text2Curve, title: "文字转曲线", command: CommandNames.Text2Curve }, ]; store.iconList.threeD = [ - // { svg: IconEnum.Ball, title: "球体", command: "SP" },//暂时隐藏 + // { svg: IconEnum.Ball, title: "球体", command: CommandNames.Sphere },//暂时隐藏 // { svg: IconEnum.Cuboid, title: "长方体", command: "BOX" }, - // { svg: IconEnum.Cylinder, title: "圆柱体", command: "CYL" }, - { svg: IconEnum.Sweep, title: "扫掠", command: "SW" }, + // { svg: IconEnum.Cylinder, title: "圆柱体", command: CommandNames.Cylineder }, + { svg: IconEnum.Sweep, title: "扫掠", command: CommandNames.Sweep }, // { svg: IconEnum.CSGunion, title: "实体并集", command: "CSGUNION" }, // { svg: IconEnum.CSGintersect, title: "实体差集", command: "CSGSUB" }, - { svg: IconEnum.ExtrudeEntity, title: "拉伸实体", command: "EXTRUDE" }, - { svg: IconEnum.Revolve, title: "车削实体", command: "REVOLVE" }, + { svg: IconEnum.ExtrudeEntity, title: "拉伸实体", command: CommandNames.Extrude }, + { svg: IconEnum.Revolve, title: "车削实体", command: CommandNames.Revolve }, ]; store.iconList.brDraw = [ - { svg: IconEnum.DB, title: "单板", command: "DB" }, - { svg: IconEnum.ZYC, title: "左右侧板", command: "ZYC" }, - { svg: IconEnum.DDB, title: "顶底板", command: "DD" }, - { svg: IconEnum.BB, title: "背板", command: "BB" }, - { svg: IconEnum.LB, title: "立板", command: "LB" }, - { svg: IconEnum.CB, title: "层板", command: "CB" }, - { svg: IconEnum.SKT, title: "收口条", command: "SKT" }, - { svg: IconEnum.TopLine, title: "线条", command: "TOPLINE" }, - { svg: IconEnum.YX, title: "异形板", command: "YX" }, - { svg: IconEnum.YXLK, title: "异形轮廓", command: "YXLK" }, - { svg: IconEnum.WineRack, title: "酒格", command: "WINERACK" }, - { svg: IconEnum.Door, title: "门板", command: "DOOR" }, - { svg: IconEnum.Drawer, title: "抽屉", command: "DRAWER" }, - { svg: IconEnum.Lattice, title: "格子抽", command: "LATTICE" }, - { svg: IconEnum.Curve2Rec, title: "线条变矩形", command: "CURVE2REC" }, - { svg: IconEnum.Rec2Br, title: "矩形变板件", command: "R2B" }, - { svg: IconEnum.UpdateInfo, title: "根据板名修改属性", command: "UPDATEBOARDINFOS" }, + { svg: IconEnum.DB, title: "单板", command: CommandNames.SingleBoard }, + { svg: IconEnum.ZYC, title: "左右侧板", command: CommandNames.LRBoard }, + { svg: IconEnum.DDB, title: "顶底板", command: CommandNames.TBBoard }, + { svg: IconEnum.BB, title: "背板", command: CommandNames.BehindBoard }, + { svg: IconEnum.LB, title: "立板", command: CommandNames.VertialBoard }, + { svg: IconEnum.CB, title: "层板", command: CommandNames.LayerBoard }, + { svg: IconEnum.SKT, title: "收口条", command: CommandNames.CloseStrip }, + { svg: IconEnum.TopLine, title: "线条", command: CommandNames.Topline }, + { svg: IconEnum.YX, title: "异形板", command: CommandNames.YiXing }, + { svg: IconEnum.YXLK, title: "异形轮廓", command: CommandNames.YXLK }, + { svg: IconEnum.WineRack, title: "酒格", command: CommandNames.Winerack }, + { svg: IconEnum.Door, title: "门板", command: CommandNames.Door }, + { svg: IconEnum.Drawer, title: "抽屉", command: CommandNames.Drawer }, + { svg: IconEnum.Lattice, title: "格子抽", command: CommandNames.Lattice }, + { svg: IconEnum.Curve2Rec, title: "线条变矩形", command: CommandNames.Curve2Rect }, + { svg: IconEnum.Rec2Br, title: "矩形变板件", command: CommandNames.R2b }, + { svg: IconEnum.UpdateInfo, title: "根据板名修改属性", command: CommandNames.UpdateBoardInfos }, ]; store.iconList.brEdit = [ - { svg: IconEnum.QG, title: "线性切割", command: "QG" }, - { svg: IconEnum.QG2, title: "板件相切", command: "QG2" }, - { svg: IconEnum.QG4, title: "参照切割", command: "QG4" }, - { svg: IconEnum.JoinBoard, title: "板件合并", command: "JOIN" }, - { svg: IconEnum.ObliqueCB, title: "斜层板", command: "ROTATELYBR" }, - { svg: IconEnum.Retraction, title: "批量内缩", command: "BOARDBATCHCURTAIL" }, - { svg: IconEnum.BoardFindModify, title: "查找修改", command: "BOARDFINDMODIFY" }, - { svg: IconEnum.BatchModifyDrillAndSeal, title: "修改板边", command: "BATCHMODIFY" }, - { svg: IconEnum.BBS, title: "批量查看", command: "BBS" }, - { svg: IconEnum.BacthModifyActiveLayerBr, title: "层板修改成活动层板", command: "ACTICITYLAYERBOARD" }, - { svg: IconEnum.ModifyHoleFace, title: "修改排孔面", command: "REVERSEDRILLFACE" }, - { svg: IconEnum.CheckModel, title: "造型检查", command: "CHECKMODEING" }, - { svg: IconEnum.CheckInterference, title: "干涉检查", command: "INTERFERE" }, - { svg: IconEnum.ClearRelatedGroove, title: "清除关联切割", command: "CLEARRELEVANCE" }, - { svg: IconEnum.SunnySideSealing, title: "见光面封边", command: "SETSMOOTHEDGE" }, + { svg: IconEnum.QG, title: "线性切割", command: CommandNames.LinearCutting }, + { svg: IconEnum.QG2, title: "板件相切", command: CommandNames.NonAssociativeCutting }, + { svg: IconEnum.QG4, title: "参照切割", command: CommandNames.ReferenceCutting }, + { svg: IconEnum.JoinBoard, title: "板件合并", command: CommandNames.Join }, + { svg: IconEnum.ObliqueCB, title: "斜层板", command: CommandNames.RotateLayerBoard }, + { svg: IconEnum.Retraction, title: "批量内缩", command: CommandNames.BoardBatchCurtail }, + { svg: IconEnum.BoardFindModify, title: "查找修改", command: CommandNames.BoardFindModify }, + { svg: IconEnum.BatchModifyDrillAndSeal, title: "修改板边", command: CommandNames.BatchModify }, + { svg: IconEnum.BBS, title: "批量查看", command: CommandNames.LookOverBoardInfos }, + { svg: IconEnum.BacthModifyActiveLayerBr, title: "层板修改成活动层板", command: CommandNames.ActicityLayerBoard }, + { svg: IconEnum.ModifyHoleFace, title: "修改排孔面", command: CommandNames.ReverseDrillFace }, + { svg: IconEnum.CheckModel, title: "造型检查", command: CommandNames.CheckModeling }, + { svg: IconEnum.CheckInterference, title: "干涉检查", command: CommandNames.Interfere }, + { svg: IconEnum.ClearRelatedGroove, title: "清除关联切割", command: CommandNames.ClearRef }, + { svg: IconEnum.SunnySideSealing, title: "见光面封边", command: CommandNames.SetSmoothEdge }, ]; store.iconList.dim = [ - { svg: IconEnum.DAL, title: "对齐标注", command: "DAL" }, - { svg: IconEnum.DimContinued, title: "线性标注", command: "DLI" }, - { svg: IconEnum.DimAngle, title: "角度标注", command: "DAN" }, - { svg: IconEnum.DimLinear, title: "连续标注", command: "DCO" }, - { svg: IconEnum.Circle, title: "半径标注", command: "DIMRAD" }, - { svg: IconEnum.Diameter, title: "直径标注", command: "DIMDIA" }, - { svg: IconEnum.AutoDim, title: "柜体标注", command: "AUTODIMBRS" }, - { svg: IconEnum.FastDim, title: "自由标注", command: "FASTDIMBRS" }, - { svg: IconEnum.DelDim, title: "快速删除", command: "DELETEDIM" }, + { svg: IconEnum.DAL, title: "对齐标注", command: CommandNames.AlignDim }, + { svg: IconEnum.DimContinued, title: "线性标注", command: CommandNames.LinearDim }, + { svg: IconEnum.DimAngle, title: "角度标注", command: CommandNames.AngleDim }, + { svg: IconEnum.DimLinear, title: "连续标注", command: CommandNames.DimContinue }, + { svg: IconEnum.Circle, title: "半径标注", command: CommandNames.RadiusDim }, + { svg: IconEnum.Diameter, title: "直径标注", command: CommandNames.DiaDim }, + { svg: IconEnum.AutoDim, title: "柜体标注", command: CommandNames.AutoDimBrs }, + { svg: IconEnum.FastDim, title: "自由标注", command: CommandNames.FastDimBrs }, + { svg: IconEnum.DelDim, title: "快速删除", command: CommandNames.DeleteDim }, ]; store.iconList.light = [ - { svg: IconEnum.SpotLamp, title: "射灯", command: "SL" }, - { svg: IconEnum.DownLamp, title: "下照射灯", command: "SL1" }, - { svg: IconEnum.SunLight, title: "点光源", command: "PTL" }, - { svg: IconEnum.ParamPtLight, title: "参数点光源", command: "PTL2" }, - { svg: IconEnum.RectLight, title: "矩形光", command: "RL" }, + { svg: IconEnum.SpotLamp, title: "射灯", command: CommandNames.SpotLight }, + { svg: IconEnum.DownLamp, title: "下照射灯", command: CommandNames.SpotLight2 }, + { svg: IconEnum.SunLight, title: "点光源", command: CommandNames.PointLight }, + { svg: IconEnum.ParamPtLight, title: "参数点光源", command: CommandNames.PointLight2 }, + { svg: IconEnum.RectLight, title: "矩形光", command: CommandNames.RectLight }, ]; store.iconList.drill = [ - { svg: IconEnum.Drill, title: "排钻", command: "PZ" }, - { svg: IconEnum.DeleteDrill, title: "删除排钻", command: "DELETEDRILL" }, - { svg: IconEnum.DrillConfig, title: "排钻配置", command: "DRILLCONFIG" }, + { svg: IconEnum.Drill, title: "排钻", command: CommandNames.Hole }, + { svg: IconEnum.DeleteDrill, title: "删除排钻", command: CommandNames.DeleteHole }, + { svg: IconEnum.DrillConfig, title: "排钻配置", command: CommandNames.DrillConfig }, // { svg: IconEnum.HideDrill, title: "隐藏排钻", command: "" }, ]; store.iconList.view = [ - { svg: IconEnum.UCS, title: "UCS", command: "UCS" }, - { svg: IconEnum.TopView, title: "俯视图", command: "FS" }, - { svg: IconEnum.RightView, title: "右视图", command: "YS" }, - { svg: IconEnum.LeftView, title: "左视图", command: "ZS" }, - { svg: IconEnum.FrontView, title: "前视图", command: "QS" }, - { svg: IconEnum.BottomView, title: "仰视图", command: "BOTTOMVIEW" }, - { svg: IconEnum.BackView, title: "后视图", command: "BACKVIEW" }, - { svg: IconEnum.SouthWest, title: "西南等轴测", command: "SWISO" }, - { svg: IconEnum.ExplosionMap, title: "爆炸图", command: "EXPLOSIONMAP" }, - { svg: IconEnum.Camera, title: "相机模式", command: "CC" }, + { svg: IconEnum.UCS, title: "UCS", command: CommandNames.CustomUCS }, + { svg: IconEnum.TopView, title: "俯视图", command: CommandNames.FS }, + { svg: IconEnum.RightView, title: "右视图", command: CommandNames.YS }, + { svg: IconEnum.LeftView, title: "左视图", command: CommandNames.ZS }, + { svg: IconEnum.FrontView, title: "前视图", command: CommandNames.QS }, + { svg: IconEnum.BottomView, title: "仰视图", command: CommandNames.BottomView }, + { svg: IconEnum.BackView, title: "后视图", command: CommandNames.BackView }, + { svg: IconEnum.SouthWest, title: "西南等轴测", command: CommandNames.Swiso }, + { svg: IconEnum.ExplosionMap, title: "爆炸图", command: CommandNames.Explosion }, + { svg: IconEnum.Camera, title: "相机模式", command: CommandNames.SwitchCamera }, ]; store.iconList.visualStyle = [ - { svg: IconEnum.WireframeView, title: "二维线框", command: "WIREFRAME" }, - { svg: IconEnum.ConceptView, title: "概念", command: "CONCEPTUAL" }, - { svg: IconEnum.Reality, title: "真实", command: "PHYSICAL" }, - { svg: IconEnum.Reality, title: "真实带线框", command: "PHYSICAL2" }, + { svg: IconEnum.WireframeView, title: "二维线框", command: CommandNames.Wireframe }, + { svg: IconEnum.ConceptView, title: "概念", command: CommandNames.Conceptual }, + { svg: IconEnum.Reality, title: "真实", command: CommandNames.Physical }, + { svg: IconEnum.Reality, title: "真实带线框", command: CommandNames.Physical2 }, ]; store.iconList.render = [ - { svg: IconEnum.ExportView, title: "单柜效果图", command: "EXPORTVIEW" }, + { svg: IconEnum.ExportView, title: "单柜效果图", command: CommandNames.ExportView }, ]; store.iconList.produce = [ - { svg: IconEnum.SplitOrder, title: "拆单优化", command: "CD" }, - { svg: IconEnum.HistoryOptimize, title: "查看优化", command: "CKYH" }, - { svg: IconEnum.DoubleSplitOrder, title: "成倍拆单", command: "CBCD" }, - { svg: IconEnum.ProcessGroup, title: "加工组", command: "SHOWPROCESSGROUP2" }, + { svg: IconEnum.SplitOrder, title: "拆单优化", command: CommandNames.ChaiDan }, + { svg: IconEnum.HistoryOptimize, title: "查看优化", command: CommandNames.ShowYouhua }, + { svg: IconEnum.DoubleSplitOrder, title: "成倍拆单", command: CommandNames.ChaiDanJB }, + { svg: IconEnum.ProcessGroup, title: "加工组", command: CommandNames.ShowProcessingGroupModal2 }, // { svg: IconEnum.QuotePrice, title: "报价", command: "" },//暂时隐藏 // { svg: IconEnum.ERPManage, title: "ERP", command: "" }, ]; store.iconList.template = [ - { svg: IconEnum.TemplateDesign, title: "模板设计", command: "TEMPLATEDESIGN" }, + { svg: IconEnum.TemplateDesign, title: "模板设计", command: CommandNames.TemplateDesign }, // { svg: IconEnum.TemplateReplace, title: "模板替换", command: "" }, //在模块管理器的右下角 - { svg: IconEnum.DrawVSBox, title: "绘制空间", command: "DRAWVSBOX" }, - { svg: IconEnum.Curve2VSBox, title: "线框变空间", command: "CURVE2VSBOX" }, - { svg: IconEnum.CutSpace, title: "切割空间", command: "SPLITTEMPLATE" }, + { svg: IconEnum.DrawVSBox, title: "绘制空间", command: CommandNames.DrawVSBOX }, + { svg: IconEnum.Curve2VSBox, title: "线框变空间", command: CommandNames.Curve2VSBox }, + { svg: IconEnum.CutSpace, title: "切割空间", command: CommandNames.SpliteTemplate }, ]; store.iconList.module = [ - { svg: IconEnum.ModuleManage, title: "模块管理", command: "TEMPLATE" }, - { svg: IconEnum.ReviewTemplate, title: "模板审核", command: "TEMPLATECHECK" }, - { svg: IconEnum.HoleModule, title: "排钻模块", command: "DRILLTEMPLATE" }, + { svg: IconEnum.ModuleManage, title: "模块管理", command: CommandNames.Template }, + { svg: IconEnum.ReviewTemplate, title: "模板审核", command: CommandNames.TemplateCheck }, + { svg: IconEnum.HoleModule, title: "排钻模块", command: CommandNames.HoleTemplate }, ]; store.iconList.commodity = [ - { svg: IconEnum.CommodityManage, title: "共享模块", command: "TEMPLATESEARCH" }, - { svg: IconEnum.ShareMaterial, title: "共享材质", command: "BUYMATERIAL" }, + { svg: IconEnum.CommodityManage, title: "共享模块", command: CommandNames.TemplateSearch }, + { svg: IconEnum.ShareMaterial, title: "共享材质", command: CommandNames.BuyMaterial }, ]; store.calcIconNumInTabs();