public static HttpContent Upload(HttpRequest request) { var file = System.Text.Encoding.ASCII.GetString(request.Data); var lines = file.ToLines(); var nc = new List <string>(); var ncString = ""; var comment = ""; Engine.Port.JobActive = true; foreach (var step in lines) { var ncStep = step.TrimWhiteSpace(); if (ncStep.StartsWith("------WebKitFormBoundary")) { } else if (ncStep == "%") { } else if (ncStep.StartsWith("Content-")) { } else if (String.IsNullOrEmpty(ncStep)) { } /* drop this for now since i don't have limit switches setup */ else if (ncStep.StartsWith("G28 G91 Z0")) { } else if (ncStep.StartsWith("(") && ncStep.EndsWith(")")) { comment = ncStep.TrimStart('(').TrimEnd(')'); } else { nc.Add(ncStep); ncString += ncStep + Environment.NewLine; Engine.Port.QueueCommand(ncStep); } } return(HttpContent.Read(request, "index.html")); }
public static HttpContent Show(HttpRequest request) { return(HttpContent.Read(request, "test.html")); }
public static HttpContent Index(HttpRequest request) { return(HttpContent.Read(request, "index.html")); }