public void SetProcessingParameters(List <BiofeedbackVariable> variables, string variableNameToProcess, MathOperation mathOperation, TypeOfProcessing typeOfProcessing) { this.bfVariables = new List <BiofeedbackVariable>(variables); this.variableNameToProcess = variableNameToProcess; this.mathOperation = mathOperation; this.typeOfProcessing = typeOfProcessing; }
public ProcessingJob(List <BiofeedbackVariable> variables, string variableNameToProcess, MathOperation mathOperation, TypeOfProcessing typeOfProcessing) { this.bfVariables = variables; this.variableNameToProcess = variableNameToProcess; this.mathOperation = mathOperation; this.typeOfProcessing = typeOfProcessing; }
private string CreateImageOperation(string originalImageName, ApplicationUser user, TypeOfProcessing typeOfProcessing, ImageCropProp cropProperties) { string nazwaPliku = ""; switch (typeOfProcessing) { case TypeOfProcessing.Progowanie: nazwaPliku = "Thresholding"; break; case TypeOfProcessing.RedukcjaPoziomowSzarosci: nazwaPliku = "ExcludeGray"; break; case TypeOfProcessing.KSrednich: nazwaPliku = "KMeans"; break; default: break; } string userPath = @"\Resources\Images\" + user.UserName + @"\"; string userExeFile = userPath + $"{nazwaPliku}.exe"; System.IO.File.Copy($@"G:\ProjektMagisterski\ProjektMagisterskiServer\Segmentation\dist\{nazwaPliku}.exe", $@"G:\ProjektMagisterski\ProjektMagisterskiServer\ProjektMagisterskiServer{userExeFile}", true); ProcessStartInfo start = new ProcessStartInfo(); start.FileName = $@"G:\ProjektMagisterski\ProjektMagisterskiServer\ProjektMagisterskiServer{userExeFile}"; string[] args = { "", "", "" }; args[0] = $@"G:\ProjektMagisterski\ProjektMagisterskiServer\Segmentation\{nazwaPliku}.py"; string processedImage = originalImageName.Replace(".jpg", "Przetworzone.png"); args[1] = $@"G:\ProjektMagisterski\ProjektMagisterskiServer\ProjektMagisterskiServer\Resources\Images\{user.UserName}\{originalImageName}"; args[2] = $@"G:\ProjektMagisterski\ProjektMagisterskiServer\ProjektMagisterskiServer\Resources\Images\{user.UserName}\{processedImage}"; start.Arguments = string.Format("{0} {1} {2} {3} {4} {5} {6}", args[0], args[1], args[2], cropProperties.y1, cropProperties.y2, cropProperties.x1, cropProperties.x2); start.UseShellExecute = false; start.RedirectStandardOutput = true; using (Process process = Process.Start(start)) { using (StreamReader reader = process.StandardOutput) { string result = reader.ReadToEnd(); var x = 2; } } System.IO.File.Delete($@"G:\ProjektMagisterski\ProjektMagisterskiServer\ProjektMagisterskiServer{userExeFile}"); return($@"Resources\Images\{user.UserName}\{processedImage}"); }