!1073 优化:自定义命令

pull/1073/MERGE
ZoeLeeFZ 4 years ago committed by ChenX
parent 8ee0cd0b80
commit 316c19d756

@ -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个,取消触发切割反应器!");

@ -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) =>
{

@ -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<ObjectId> = 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[] = [];

@ -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);
}
});

@ -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"
}

@ -25,10 +25,18 @@ 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;
delete this._customCommand[icommand.command];
}
async Upload()
{
if (!this._needUpload) return;

@ -75,6 +75,7 @@ class CommandMachine
}
RemoveCommand(cmdName: string)
{
if (!cmdName) return;
cmdName = cmdName.toUpperCase();
this.CommandMap.delete(cmdName);
this.m_CommandNameList.delete(cmdName);

@ -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());
}

@ -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<string, string> = 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",

@ -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: "西南等轴测",
},
];

@ -106,29 +106,34 @@ export class CommandItem extends React.Component<CommandItemProps, {}>{
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;
};

File diff suppressed because it is too large Load Diff

@ -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 = () =>
{

@ -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<ITemplateEditorProps, any> {
{
TempEditor.End();
if (this.props.isCheck)
commandMachine.ExecCommand("TEMPLATECHECK");
commandMachine.ExecCommand(CommandNames.TemplateCheck);
else
commandMachine.ExecCommand("TEMPLATE");
commandMachine.ExecCommand(CommandNames.Template);
}
};

@ -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)
{

@ -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<ToolsBlockProps, {}>
{
let txt = cmd.title.length > 4 ? cmd.title.slice(0, 3) + ".." : cmd.title;
return (
<li key={index} title={cmd.title + "\n" + cmd.command} style={{ width: "55px", display: cmd.command === "TEMPLATECHECK" && !userConfig.isAdmin ? "none" : "block" }} onClick={() =>
<li key={index} title={cmd.title + "\n" + cmd.command} style={{ width: "55px", display: cmd.command === CommandNames.TemplateCheck && !userConfig.isAdmin ? "none" : "block" }} onClick={() =>
{
this.HandleOnClick(cmd.command);
}}>

@ -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();

Loading…
Cancel
Save