Пример #1
0
 public GCodeController(ILoadOptionsManager loadOptionsManager, IUserFileManager fileManager, GCodeLoadHelper loadHelper, ICNCLibUserContext userContext)
 {
     _loadOptionsManager = loadOptionsManager;
     _fileManager        = fileManager;
     _loadHelper         = loadHelper;
     _userContext        = userContext;
 }
Пример #2
0
        public string Post([FromBody] LoadOptions input)
        {
            var load = GCodeLoadHelper.CallLoad(input.FileName, input.FileContent, input);
            var sw   = new StringWriter();

            new XmlSerializer(typeof(GCode.CamBam.CamBam)).Serialize(sw, load.CamBam);
            return(sw.ToString());
        }
Пример #3
0
        public async Task <IEnumerable <string> > Put([FromBody] CreateGCode input)
        {
            LoadOptions opt = await _loadOptionsManager.Get(input.LoadOptionsId);

            opt.FileName    = input.FileName;
            opt.FileContent = input.FileContent;

            return(GCodeLoadHelper.CallLoad(opt).Commands.ToStringList());
        }
Пример #4
0
        public async Task <string> Put([FromBody] CreateGCode input)
        {
            LoadOptions opt = await _loadOptionsManager.Get(input.LoadOptionsId);

            var load = GCodeLoadHelper.CallLoad(input.FileName, input.FileContent, opt);
            var sw   = new StringWriter();

            new XmlSerializer(typeof(GCode.CamBam.CamBam)).Serialize(sw, load.CamBam);
            return(sw.ToString());
        }
Пример #5
0
        public async Task <IEnumerable <string> > Post([FromBody] LoadOptions input)
        {
            if (input.FileName.StartsWith(@"db:"))
            {
                input.FileName = input.FileName.Substring(3);
                var fileDto = await _fileManager.GetByName(input.FileName);

                input.FileContent = fileDto.Content;
            }

            return(GCodeLoadHelper.CallLoad(input).Commands.ToStringList());
        }
Пример #6
0
 public IEnumerable <string> Post([FromBody] LoadOptions input)
 {
     return(GCodeLoadHelper.CallLoad(input.FileName, input.FileContent, input).Commands.ToStringList());
 }
Пример #7
0
 public CambamController(ILoadOptionsManager loadOptionsManager, GCodeLoadHelper loadHelper, ICNCLibUserContext userContext)
 {
     _loadOptionsManager = loadOptionsManager;
     _loadHelper         = loadHelper;
     _userContext        = userContext;
 }