/// <summary> /// Load the wiff file's content. /// </summary> /// <returns>A <see cref="bool"/> value indicating the success of the loading.</returns> public bool LoadContent() { bool result; var dataProvider = new AnalystWiffDataProvider(); // We're going to extract the Maldi parameters at this point. this.strmaldiparameters = this.GetMaldiParameters(this.fileName); try { // get wiff file object from given file Batch wiffFile = AnalystDataProviderFactory.CreateBatch(this.fileName, dataProvider); // get number of samples string[] sampleNames = wiffFile.GetSampleNames(); int numOfSamples = sampleNames.GetLength(0); // create sample objects for all the samples present in the wiff file for (int actSample = 0; actSample < numOfSamples; actSample++) { // create and add the sample to this objects list of samples... var sample = new WiffSample(wiffFile, this, actSample, this.strmaldiparameters); this.samples.Add(sample); } result = true; } catch (Exception e) { Util.ReportException(e); result = false; } return(result); }
public WiffFileReader(string wiffFilePath, string licenseFilePath) { if (string.IsNullOrWhiteSpace(wiffFilePath)) { throw new ArgumentNullException("wiffFilePath"); } if (string.IsNullOrWhiteSpace(licenseFilePath)) { throw new ArgumentNullException("licenseFilePath"); } if (!File.Exists(wiffFilePath)) { throw new FileNotFoundException("Wiff file not exists."); } try { ReadWiffLicense(licenseFilePath); this.dataProvider = new AnalystWiffDataProvider(true); this.batch = AnalystDataProviderFactory.CreateBatch(wiffFilePath, dataProvider); this.wiffFilePath = wiffFilePath; this.model = MzLiteJson.HandleExternalModelFile(this, GetModelFilePath()); } catch (Exception ex) { throw new MzLiteIOException(ex.Message, ex); } }
public override void Open() { if (IsOpen) { return; } _dataProvider = new AnalystWiffDataProvider(); _wiffFile = AnalystDataProviderFactory.CreateBatch(FilePath, _dataProvider); base.Open(); }
public WiffFile(string wiffpath) { string[] keys = { "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + "<license_key>"+ "<company_name>Proteo Wizard|Redistributable Beta Agreemeent 2012-03-20</company_name>"+ "<product_name>ProcessingFramework</product_name>" + "<features>WiffReaderSDK</features>"+ "<key_data> Z9360tXYtYTi+Ru6cbynF52hEBoKTFNHT0vYGPCI5ZmmAXRZ+W26Ag== </key_data>"+ "</license_key>" }; Clearcore2.Licensing.LicenseKeys.Keys = keys; provider = new AnalystWiffDataProvider(); m_batch = AnalystDataProviderFactory.CreateBatch(wiffpath, provider); FileInfo tmpfile = new FileInfo(wiffpath); int pos = tmpfile.Name.LastIndexOf("."); name = tmpfile.Name.Substring(0, pos); }
public override void Open() { if (IsOpen) return; _dataProvider = new AnalystWiffDataProvider(); _wiffFile = AnalystDataProviderFactory.CreateBatch(FilePath, _dataProvider); base.Open(); }