private List <IonPolarity> GetScanIonPolarities(IDataAccess dataAccess) { List <IonPolarity> rv = new List <IonPolarity>(); IonPolarity polaritiesInFile = IonPolarity.Unassigned; IBDAFileInformation fileInfo = dataAccess.FileInformation; if (fileInfo.IsMSDataPresent()) { IBDAMSScanFileInformation msInfo = fileInfo.MSScanFileInformation; IBDAMSScanTypeInformation scanInfo = msInfo.GetMSScanTypeInformation(MSScanType.Scan); if (scanInfo != null) { polaritiesInFile = scanInfo.IonPolarities; } } if (polaritiesInFile == IonPolarity.Unassigned) { UserMessage msg = new UserMessage(0, string.Empty, ProgramModule.CoreFacades, DACoreFacadeMessages.MSG_MFE_NoMsScanData); throw new MSDAApplicationException(msg as IUserMessage); } switch (polaritiesInFile) { case IonPolarity.Mixed: rv.Add(IonPolarity.Positive); rv.Add(IonPolarity.Negative); break; case IonPolarity.Positive: rv.Add(IonPolarity.Positive); break; case IonPolarity.Negative: rv.Add(IonPolarity.Negative); break; default: break; } return(rv); }
private void PrintFileInfo(IMsdrDataReader dataAccess) { IBDAFileInformation fileInfo = dataAccess.FileInformation; println("Data File: " + fileInfo.DataFileName); println("Acquisition Time: " + fileInfo.AcquisitionTime.ToShortDateString()); println("IRM Status: " + fileInfo.IRMStatus); println("Measurement Type: " + fileInfo.MeasurementType); println("Separation Technique: " + fileInfo.SeparationTechnique); print("MS Data Present: "); if (fileInfo.IsMSDataPresent()) { println("yes"); } else { println("no"); } print("Non-MS data present: "); if (fileInfo.IsNonMSDataPresent()) { println("yes"); } else { println("no"); } print("UV spectra present: "); if (fileInfo.IsUVSpectralDataPresent()) { println("yes"); } else { println("no"); } }