Example #1
0
        // Static helpers associated with this processed response
        #region Static Helper Methods

        public static List <IOutputItem> BuildProcessedResponseG29T(List <String> commandList)
        {
            List <string> stringsToRemove = new List <String>()
            {
                "Bed Topography Report for CSV:", string.Empty
            };
            List <string> clean = commandList.FindAll(s => !stringsToRemove.Contains(s.Trim()));

            // List is in reverse order (y=max is the first line) so we want to fix that.
            clean.Reverse();

            int sizeY = clean.Count;
            int sizeX = clean[0].Split("\t").Length;

            double[,] mesh = new double[sizeX, sizeY];

            double[] row;
            for (int y = 0; y < sizeY; y++)
            {
                // Split the string and convert the values in floats.
                row = Array.ConvertAll(clean[y].Split("\t"), s => double.Parse(s));

                for (int x = 0; x < sizeX; x++)
                {
                    // clean array
                    mesh[x, y] = row[x];
                }
            }

            return(new List <IOutputItem> {
                new pr_G29T_MeshMap(MarlinOutputItemFactory.GetId(), "G29 T Mesh Map - Double Click to View", mesh)
            });
        }
Example #2
0
        // Static helpers associated with this processed response
        #region Static Helper Methods
        public static List <IOutputItem> BuildProcessedResponse(List <String> commandList)
        {
            // At this point we have a list of file names in the format "THREAD~1.GCO 3257334"
            // We are going to turn each into an M20_PrintableFile output item.

            List <IOutputItem> files = new List <IOutputItem>();

            commandList.ForEach(s => files.Add(new pr_M20_PrintableFile(MarlinOutputItemFactory.GetId(), s)));

            return(files);
        }
Example #3
0
        // Static helpers associated with this processed response
        #region Static Helper Methods

        public static List <IOutputItem> BuildProcessedResponseM503(List <String> commandList)
        {
            return(new List <IOutputItem> {
                new pr_M503orM501_Config(MarlinOutputItemFactory.GetId(), "M503 or M501 Config - Drag and Drop to Macro Button To Capture", commandList)
            });
        }