} /* ValidateModelName*/ private void ValidateFileFormat() { errorProvider1.SetError(FileFormat, null); fileFormat = FileFormat.Text; if (!PicesFeatureFileIO.ValidDriverName(fileFormat)) { errorsFound = true; errorProvider1.SetError(FileFormat, "Format[" + fileFormat + "] is not a valid."); } }
private void BackGroundThread() { PicesDataBase.ThreadInit(); backGroundThreadRunning = true; imagesLoaded = 0; imagesFilteredOut = 0; imagesMissingFeatureData = 0; if (group != null) { featureData = SaveFeatureDataByGroup(); } else { featureData = SaveFeatureDataBySipperFiles(); } if (!cancelRequested) { backGroundStatus = "Saving Feature File"; String pathName = OSservices.GetPathPartOfFile(featureFileName); if (!String.IsNullOrEmpty(pathName)) { OSservices.CreateDirectoryPath(pathName); } if (IncludeSampleImages.Checked) { SaveSampleImages(featureData); } driver = new PicesFeatureFileIO(fileFormat); if (driver != null) { if (NormalizeData.Checked) { driver.SaveFeatureFileNormalized(featureFileName, featureData, runLog); } else { driver.SaveFeatureFile(featureFileName, featureData, runLog); } } } PicesDataBase.ThreadEnd(); backgroundThreadCompleted = true; backGroundThreadRunning = false; } /* BackGroundThread */
} /* ValidateDestinationDirectory */ private void ValidateFileFormat() { errorProvider1.SetError(FileFormat, ""); fileFormat = FileFormat.Text; if (!PicesFeatureFileIO.ValidDriverName(fileFormat)) { errorsFound = true; errorProvider1.SetError(FileFormat, "Invalid File Format."); return; } driver = new PicesFeatureFileIO(fileFormat); if (!driver.CanWrite) { errorsFound = true; errorProvider1.SetError(FileFormat, "This driver does not support Write."); return; } }
private void SaveActiveTrainingModelFeatureData_Load(object sender, EventArgs e) { modelNames = TrainingModel2.GetListOfTrainingModels(); if (modelNames != null) { foreach (String s in modelNames) { ModelName.Items.Add(s); } } ModelName.Text = OSservices.GetRootName(initialModelName); String[] fileFormats = PicesFeatureFileIO.RegisteredDriverNames(false, true); if (fileFormats != null) { foreach (String ff in fileFormats) { FileFormat.Items.Add(ff); } } FileFormat.Text = "Pices"; DestinationFileName.Text = OSservices.AddSlash(PicesSipperVariables.TempDirectory()) + ModelName.Text + ".data"; }
private void SaveFeatureData_Load(object sender, EventArgs e) { CruiseName.Text = cruise; StationName.Text = station; DeploymentNum.Text = deployment; SipperFile.Text = sipperFileName; if (group != null) { GroupName.Text = group.Name; } if (mlClass != null) { ClassName.Text = mlClass.Name; } ProbMin.Text = (100.0f * probMin).ToString("##0.0") + "%"; ProbMax.Text = (100.0f * probMax).ToString("##0.0") + "%"; SizeMin.Text = sizeMin.ToString("#,###,##0"); if (sizeMax <= 0) { SizeMax.Text = infinityStr; } else { SizeMax.Text = sizeMax.ToString("#,###,##0"); } DepthMin.Text = depthMin.ToString("##,##0.00"); if (depthMax <= 0.0) { DepthMax.Text = infinityStr; } else { DepthMax.Text = depthMax.ToString("##,##0.00"); } featureFileName = OSservices.AddSlash(PicesSipperVariables.PicesReportDir()) + "FeatureDataFiles"; featureFileName = OSservices.AddSlash(featureFileName); if (group != null) { featureFileName += group.Name; } else { if (!String.IsNullOrEmpty(cruise)) { featureFileName += cruise; if (!String.IsNullOrEmpty(station)) { featureFileName += "-" + station; if (!String.IsNullOrEmpty(deployment)) { featureFileName += "-" + deployment; if (!String.IsNullOrEmpty(sipperFileName)) { featureFileName += "-" + sipperFileName; } } } } } if (mlClass != null) { if (!String.IsNullOrEmpty(featureFileName)) { featureFileName += "-"; } featureFileName += mlClass.Name; } featureFileName += ".data"; FeatureFileName.Text = featureFileName; String[] validFileFormats = PicesFeatureFileIO.RegisteredDriverNames(false, true); foreach (String s in validFileFormats) { FileFormat.Items.Add(s); } FileFormat.SelectedItem = fileFormat; IncludeSampleImagesNumPerClass.Text = includeSampleImagesNumPerClass.ToString(); StartLoadingStatusOnTotalImageCount(); } /* SaveImagesToDisk2_Load */