public static BaseInfo CreateBaseInfoByString(string line) { line = line.ToUpper(); BaseInfo info = null; try { if (In(line, HeadType.G90, HeadType.G91)) { info = new HeadInfo(line); } else if (In(line, HeadType.G0)) { info = new SingleMoveInfo(line); } else if (In(line, HeadType.G1)) { info = new UnionMoveInfo(line); } else if (In(line, HeadType.M21)) { info = new M21Info(line); } else if (In(line, HeadType.Start)) { info = new StartInfo(line); } else if (In(line, HeadType.M30)) { info = new EndInfo(line); } else if (In(line, HeadType.M98)) { info = new ChildInfo(line); } else if (In(line, HeadType.M99)) { info = new OtherInfo(line); } else { throw new Exception(); } } catch (Exception) { throw new WarningException(L.R("BaseInfoCollection.NotAnalyse", "行{0}未能解析!"), line); } return(info); }
private void SetAxisAndType(HeadInfo info) { HeadInfo headInfo = info as HeadInfo; if (headInfo.AxisType == HeadType.G90) card.SetAbsolute(); else card.SetRelative(); SetCoordinatePage(headInfo.Coordinate); }