Option Strict On
Option Explicit On
Imports massSpectrometryBase 'For ionTypeEnum.
'****************************************************************************
'* <placeholder for header> *
'****************************************************************************
Public Class AnalystSpectrumMarking
Inherits SDUPspectrumMarking
Protected WithEvents mAnalystDisplayCOM As AnalystCOM
Private mCalcFragSpec_AnalystCOM2 As rawDataFileHandling 'Type is
' base, real type is expected to be Analyst specific.
'****************************************************************************
'* <placeholder for header> *
'****************************************************************************
Public Sub New( _
ByRef aDisplay As AnalystCOM, _
ByRef aCalcFragSpec_AnalystCOM2 As rawDataFileHandling)
mAnalystDisplayCOM = aDisplay
mCalcFragSpec_AnalystCOM2 = aCalcFragSpec_AnalystCOM2
End Sub 'Constructor.
'Changed PM_SPECTRUMDISPLAY_ZEDGRAPH 2007-09-25
'****************************************************************************
'* <placeholder for header> *
'****************************************************************************
Public Overrides Sub newXaxisPosition(ByVal aNewPixelXvalue As Integer)
'We never expect this to happen.
Trace.Assert(False, "Stop!", _
"PIL ASSERT. Internal/development assert for stopping execution......")
End Sub 'newXaxisPosition
'****************************************************************************
'* <placeholder for header> *
'****************************************************************************
Public Overrides Sub addIonMarker( _
ByVal anIon As fragmentExStructure, _
ByVal aMCRdelta As Double, _
ByVal aToken As Integer)
Dim MCRcalcLoc As Double = anIon.MCRcalcLoc
'Changed PM_REFACTOR 2005-02-24. Compute yLoc when we need it.
Dim yLoc As Double = largestYinData(MCRcalcLoc, aMCRdelta)
'Changed PM_REFACTOR 2007-07-23
'anINcalcFragSpec_ANALYSTCOM.AppendDataPoint(MCRCalcLoc, yLoc)
Dim dataSource As AnalystCOM = DirectCast(mCalcFragSpec_AnalystCOM2, _
AnalystRawDataFileHandling).getAnalystDataSource()
dataSource.XYdata_AppendDataPoint(MCRcalcLoc, yLoc)
If anIon.ionType = ionTypeEnum.enumPrecursorIon2 Then
'Changed PM_REFACTOR 2007-07-22
'Dim index As Integer = _
' mAxGraphControl_ANALYSTCOM_2.SeriesColl.Item( _
' 1).SeriesCaptionColl.CreateAddUserLabel( _
' fragment.descStr, MCRCalcLoc, yLoc)
Dim index As Integer = _
mAnalystDisplayCOM.axControl_CreateAddUserLabel( _
1, anIon.descStr, MCRcalcLoc, yLoc)
'Changed PM_REFACTOR 2007-07-22
'mAxGraphControl_ANALYSTCOM_2.SeriesColl.Item( _
' 1).SeriesCaptionColl.Item(index).Font.Italic = _
' True
'mAxGraphControl_ANALYSTCOM_2.SeriesColl.Item( _
' 1).SeriesCaptionColl.Item(index).Font.Bold = _
' True
mAnalystDisplayCOM.axControl_fontBoldItalic( _
1, index)
Else
'Not precursor ion...
'Changed PM_REFACTOR 2007-07-22
'mAxGraphControl_ANALYSTCOM_2.SeriesColl.Item( _
' 1).SeriesCaptionColl.CreateAddUserLabel( _
' fragment.descStr, MCRCalcLoc, yLoc)
mAnalystDisplayCOM.axControl_CreateAddUserLabel( _
1, anIon.descStr, MCRcalcLoc, yLoc)
End If
End Sub 'addIonMarker
'****************************************************************************
'* <placeholder for header> *
'****************************************************************************
Public Overrides Sub lastMarkerAdded(ByVal aHighestX As Double)
'Changed PM_REFACTOR 2007-07-22
'mAxGraphControl_ANALYSTCOM_2.GraphArea.XAxis.Max = aHighestX
mAnalystDisplayCOM.axControl_setXaxisMax(aHighestX)
'Changed PM_REFACTOR 2007-07-22
'mAxGraphControl_ANALYSTCOM_2.SeriesColl.Item(2).DataObject = _
' anINcalcFragSpec_ANALYSTCOM
Dim dataSource As Object = DirectCast(mCalcFragSpec_AnalystCOM2, _
AnalystRawDataFileHandling).getAnalystDataSource()
mAnalystDisplayCOM.axControl_setXYObject(2, dataSource)
'Changed PM_REFACTOR 2007-07-22
'mAxGraphControl_ANALYSTCOM_2.InvalidateControl()
mAnalystDisplayCOM.axControl_InvalidateControl()
End Sub 'lastMarkerAdded
'****************************************************************************
'* <placeholder for header> *
'****************************************************************************
Public Overrides Sub addMarker2( _
ByRef anInMarker As markerStructure, _
ByVal anInBaseLineLength As Integer, _
ByVal anInHighlight As Boolean, _
ByVal anOverrideColour As Color, _
ByVal anInLabelDirection As labelDirectionEnum, _
ByVal anInYpixelOffset As Integer, _
ByVal anYdisplayLevel As Integer)
'Note: we ignore anInLabelDirection as it is not possible.
'anOverrideColour is not used !!!??? Probably because we can set
' the colour for analyst spectra.
If Not anInHighlight Then 'For now: assume C12 peaks are NOT highlighted.
'Changed PM_REFACTOR 2007-07-22
'mAxGraphControl_ANALYSTCOM_3.SeriesColl.Item(1).MarkerColl.CreateAddMarker( _
' anInMarker.MCR)
mAnalystDisplayCOM.axControl_CreateAddMarker(1, anInMarker.MCR)
End If
End Sub 'addMarker
'****************************************************************************
'* <placeholder for header> *
'****************************************************************************
Public Overrides Sub highLightMarker(ByVal aTag As Integer)
'We ignore it... Perhaps later we can use some feature in the Analyst
'control to do some highlighting.
End Sub 'highLightMarker
'****************************************************************************
'* <placeholder for header> *
'****************************************************************************
Public Overrides Sub clearMarkers()
'From frmProteinValidation.vb, basicDisplayRawSpectrum().
Dim count As Integer = _
mAnalystDisplayCOM.axControl_SeriesCollCount()
If count = 1 Then
'This will add a second series first time around.
mAnalystDisplayCOM.axControl_CreateAddSeries() 'This
' changes count!
count = mAnalystDisplayCOM.axControl_SeriesCollCount()
End If
If Not count = 2 Then
MsgBox("Problem with creating series object in Graph")
End If
'Now put them into an overlay.
'
'This data object will hold our fragments.
' aCalcFragSpec_ANALYSTCOM.XValuesAreSorted = False 'This was the missing
' ' line!!! (can not do this for spectra).
Dim dataSource As AnalystCOM = _
DirectCast(mCalcFragSpec_AnalystCOM2, _
AnalystRawDataFileHandling).getAnalystDataSource()
dataSource.XYdata_create(False)
'Changed PM_REFACTOR 2007-07-22
'mAxGraphControl_ANALYSTCOM_3.SeriesColl.Item(1).MarkerColl.RemoveAll()
mAnalystDisplayCOM.axControl_SeriesRemoveAll(1)
'From frmProteinValidation.vb, basicDisplayRawSpectrum().
mAnalystDisplayCOM.axControl_AutoCreateMetaData(2)
End Sub 'clearMarkers
'Changed PM_ZOOM_MARKERS 2004-06-17
'****************************************************************************
'* <placeholder for header> *
'****************************************************************************
Public Overrides Sub updateMarkersPosition()
'We ignore it... It is only needed when we handle zooming ourselves.
'The Analyst control handles zooming internally.
End Sub 'updateMarkersPosition
'Here in this Analyst specific for now, even though it is completely general.
'****************************************************************************
'* <placeholder for header> *
'****************************************************************************
Function largestYinData(ByVal aMCR As Double, ByVal aMCRdelta As Double) _
As Double
' Get the numbers of the points with the smallest and largest
' intensities.
Dim startMass As Double = aMCR - aMCRdelta
Dim endMass As Double = aMCR + aMCRdelta
'Changed PM_BACK_TO_NORMAL 2003-07-29
'mANALYSTCOM_Data.GetYValueRangeForXValueRange( _
' startMass, endMass, minPoint, maxPoint)
'Dim toReturn As Double = mANALYSTCOM_Data.GetDataPointYValue(maxPoint)
Dim datapointsInRange As Integer
Dim toReturn As Double = _
CInt(mCalcFragSpec_AnalystCOM2.maxYValueInMassRange( _
startMass, endMass, datapointsInRange))
' Why CInt?? - because the return value is floating point!
Return toReturn
End Function 'largestYinData
End Class 'AnalystSpectrumMarking
Generated by script codePublish.pl at 2009-01-05T15:20:59.