'****************************************************************************
'* Copyright (C) 2004 Peter Mortensen and Matthias Mann *
'* This file is part of MSQuant. *
'* *
'* MSQuant is distributed under the terms of *
'* the GNU General Public License. See src/COPYING.TXT or *
'* <http://www.gnu.org/licenses/gpl.txt> for details. *
'* *
'* MSQuant is free software; you can redistribute it *
'* and/or modify it under the terms of the GNU *
'* General Public License as published by the Free *
'* Software Foundation; either version 2 of the *
'* License, or (at your option) any later version. *
'* *
'* MSQuant is distributed in the hope that it will be *
'* useful, but WITHOUT ANY WARRANTY; without even the *
'* implied warranty of MERCHANTABILITY or FITNESS FOR *
'* A PARTICULAR PURPOSE. See the GNU General Public *
'* License for more details. *
'* *
'* You should have received a copy of the GNU General *
'* Public License along with MSQuant; if not, write to *
'* the Free Software Foundation, Inc., 59 Temple *
'* Place, Suite 330, Boston, MA 02111-1307 USA *
'* *
'* Purpose: Is responsible for showing Analyst spectra on the screen. *
'* But it does not use the built-in markers for Analyst. Instead *
'* it uses the Label markers. *
'* *
'****************************************************************************
'****************************************************************************
'* CEBI *
'* Software Development Group *
'* Peter Mortensen *
'* E-mail: NUKESPAMMERSdrmortensen@get2netZZZZZZ.dk *
'* WWW: http://www.cebi.sdu.dk/ *
'* *
'* Program for post-processing of result from search in mass *
'* spectrometric data. *
'* *
'* FILENAME: frmAnalystSpectraWithLabelMarkers.vb *
'* TYPE: VISUAL_BASIC *
'* *
'* CREATED: PM 2005-02-10 Vrs 1.0. *
'* UPDATED: PM 2005-xx-xx *
'* *
'****************************************************************************
Option Strict On
Option Explicit On
'Imports AxGraphControlLib '\Analyst\bin\GraphControl.ocx
'See guide in file frmAnalystSpectra.vb for how to add it.
'Changed PM_QSTAR_BROKEN_QUANTITATION_FULLZOOMBUG 2007-10-10
Imports SDUPutility 'For SDUPlogger
Imports massSpectrometryBase 'For rawDataFileHandling
'****************************************************************************
'd$ <summary>
'd$ Purpose: xyz
'd$
'd$ <see cref="xyz" />.
'd$ <applicationname>xyz</applicationname>
'd$ <author>Peter Mortensen</author>
'd$ <seealso>http://xyz</seealso>
'd$ <codetype>xyz</codetype>
'd$ </summary>
Public Class frmAnalystSpectraWithLabelMarkers
Inherits frmSpectrumDisplay
'Changed PM_REFACTOR 2007-07-19. The instance of new
'class, AnalystCOM, contains both instances for the
'display as well as the data. We mostly use the display
'here, but data is used when connecting the data to the
'display, e.g. in updateData().
'Protected Friend WithEvents mAxGraphControl_ANALYSTCOM_4 As _
' AxQS20_GraphControlLib.AxGraphControl
'Protected Friend WithEvents mAnalystCOM As AnalystCOM
Protected WithEvents mAnalystCOM As AnalystCOM 'Protected as it is used
' in derived class frmAnalystSpectra.
#Region " Windows Form Designer generated code "
'Form overrides dispose to clean up the component list.
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
'Changed PM_REFACTOR 2007-07-19. Required??
'Friend WithEvents AxGraphControl1 As AxQS20_GraphControlLib.AxGraphControl
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container
Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(frmFinneganSpectra))
'
'
'
'frmFinneganSpectra
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.ClientSize = New System.Drawing.Size(672, 381)
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.Name = "frmFinneganSpectra"
Me.Text = "frmFinneganSpectra"
End Sub
#End Region
'****************************************************************************
'* <placeholder for header> *
'* Note: aExternalDisplay can be Nothing. Then the internal one is used. *
'****************************************************************************
Public Sub New( _
ByRef aRawFile As massSpectrometryBase.rawDataFileHandling, _
ByRef anExternalDisplay2 As AnalystCOM, _
ByRef anInRawDataFileHandling As rawDataFileHandling, _
ByRef anInOutMarker As SDUPspectrumMarking)
'aRawFile and anInRawDataFileHandling is the same.
'Old 2nd parameter:
' ByRef aExternalDisplay As AxQS20_GraphControlLib.AxGraphControl, _
MyBase.New(anInRawDataFileHandling, anInOutMarker)
'This call is required by the Windows Form Designer.
InitializeComponent()
'Changed PM_REFACTOR 2004-02-05
If anExternalDisplay2 Is Nothing Then
'Changed PM_REFACTOR 2007-07-19. Not supported yet. Do we need it?
'mAxGraphControl_ANALYSTCOM_3 = AxGraphControl1
Trace.Assert( _
False, "Stop!", _
"PIL ASSERT. Internal/development assert for stopping execution......")
Else
'Changed PM_REFACTOR 2007-07-19
'mAxGraphControl_ANALYSTCOM_3 = aExternalDisplay
mAnalystCOM = anExternalDisplay2
End If
'Add any initialization after the InitializeComponent() call.
End Sub 'New
'Changed PM_QSTAR_BROKEN_QUANTITATION_FULLZOOMBUG 2007-10-10
'****************************************************************************
'* <placeholder for header> *
'****************************************************************************
Public Overrides Function getCOMlogger() _
As SDUPlogger
Return mAnalystCOM.getLogger()
End Function 'getCOMlogger
'****************************************************************************
'* <placeholder for header> *
'****************************************************************************
Protected Overrides Sub spectrumControlLocAndSize( _
ByRef anOutXLoc As Integer, ByRef anOutYLoc As Integer, _
ByRef anOutXSize As Integer, ByRef anOutYSize As Integer)
' Dim delete As QS20.GraphControlLib.GraphControl
' delete.SelectionColl.Add(10)
'
' Dim delete2 As QS20.GraphControlLib.Location
' Dim delete3 As QS20.GraphControlLib.GraphControl
' Dim delete4 As AxQS20_GraphControlLib.AxGraphControl
'
' Dim delete5 As QS20_GraphControlLib.GraphControl 'What is
' ' this?? Some old reference??
'Changed PM_REFACTOR 2007-07-22
'aXLoc = mAxGraphControl_ANALYSTCOM_3.Location.X
'aYLoc = mAxGraphControl_ANALYSTCOM_3.Location.Y
mAnalystCOM.axControl_getLocation(anOutXLoc, anOutYLoc)
'Changed PM_REFACTOR 2007-07-22
'Dim specSize As System.Drawing.Size = mAxGraphControl_ANALYSTCOM_3.Size
'aXSize = specSize.Width
'aYSize = specSize.Height
mAnalystCOM.axControl_getSize(anOutXSize, anOutYSize)
End Sub 'spectrumControlLocAndSize
'****************************************************************************
'* <placeholder for header> *
'****************************************************************************
Public Overrides Sub setSpectrumTitle(ByVal aTitle As String)
Me.Text = aTitle 'Should set window title. But as this
' file does no longer display a separate window (the Analyst control
' is instead embedded in some other form) nothing should happen!
'Changed PM_REFACTOR 2007-07-22
'mAxGraphControl_ANALYSTCOM_3.SeriesColl.Item(1).Title.Text = aTitle
mAnalystCOM.axControl_setTitle(1, aTitle)
'Changed PM_QSTAR_BROKEN_QUANTITATION_FULLZOOMBUG 2007-10-10. Comment
' below turned out to be true!!
'
' 'This is from the old code in frmProteinValidation.vb (it is not
' 'quite the same!!):
' Dim dataSource As Object = DirectCast(mRawDataFileHandling, _
' AnalystRawDataFileHandling).getAnalystDataSource()
' 'Note: this resets zoom of spectrum display to full zoom!!!
' mAnalystCOM.axControl_setDataObject(1, dataSource)
End Sub 'setSpectrumTitle
'****************************************************************************
'* <placeholder for header> *
'****************************************************************************
Public Overrides Function getTitle() _
As String
Dim toReturn As String = _
mAnalystCOM.axControl_getTitle()
Return toReturn
End Function 'getTitle
'****************************************************************************
'* <placeholder for header> *
'****************************************************************************
Public Overrides Sub updateData()
'Changed PM_REFACTOR 2007-07-23
''Changed PM_ANALYSTSPECTRA_DECOUPLING 2005-03-05
'mAxGraphControl_ANALYSTCOM_3.SeriesColl.Item(1).DataObject = _
' DirectCast(mRawDataFileHandling, _
' AnalystRawDataFileHandling).getANALYSTCOM_Data()
Dim dataSource As Object = DirectCast(mRawDataFileHandling, _
AnalystRawDataFileHandling).getAnalystDataSource()
'Note: this resets zoom of spectrum display to full zoom!!!
mAnalystCOM.axControl_setDataObject(1, dataSource)
'Does not seem to make any difference. It seems ***all*** spectrum
' displays are updated for the same WIFF file...
'mAxGraphControl_ANALYSTCOM_3.SeriesColl.Item(1).DataObject = _
' DirectCast(mRawDataFileHandling, _
' AnalystRawDataFileHandling).getClonedANALYSTCOM_Data()
Me.newZoom() 'Whenever the data is set we must set the zoom again.
End Sub 'updateData
'****************************************************************************
'* <placeholder for header> *
'****************************************************************************
Protected Overrides Sub newZoom()
'Changed PM_MARKER 2007-10-10
If True Then 'For test only.
Dim dataMinX As Double
Dim dataMaxX As Double
Dim dataMaxY As Double
Dim minX As Double
Dim maxX As Double
mAnalystCOM.axControl_getAxisRanges( _
dataMinX, dataMaxX, dataMaxY, minX, maxX)
End If
'Changed PM_REFACTOR 2007-07-22
''Changed PM_REFACTOR 2005-03-04
''mAxGraphControl_ANALYSTCOM_3.GraphArea.XAxis.Min = mStartMass
''mAxGraphControl_ANALYSTCOM_3.GraphArea.XAxis.Max = mEndMass
''mAxGraphControl_ANALYSTCOM_3.GraphArea.YAxis.Max = mMaxYVal
'mAxGraphControl_ANALYSTCOM_3.GraphArea.XAxis.Min = mZoom.startMass
'mAxGraphControl_ANALYSTCOM_3.GraphArea.XAxis.Max = mZoom.endMass
'mAxGraphControl_ANALYSTCOM_3.GraphArea.YAxis.Max = mZoom.maxYVal
mAnalystCOM.axControl_setXaxisMin(mZoom.startMass)
mAnalystCOM.axControl_setXaxisMax(mZoom.endMass)
mAnalystCOM.axControl_setYaxisMax(mZoom.maxYVal)
'Changed PM_MARKER 2007-10-10
If True Then 'For test only.
Dim dataMinX As Double
Dim dataMaxX As Double
Dim dataMaxY As Double
Dim minX As Double
Dim maxX As Double
mAnalystCOM.axControl_getAxisRanges( _
dataMinX, dataMaxX, dataMaxY, minX, maxX)
End If
'Changed PM_REFACTOR 2007-07-22
'mAxGraphControl_ANALYSTCOM_3.Refresh()
mAnalystCOM.axControl_Refresh()
End Sub 'newZoom
'****************************************************************************
'* <placeholder for header> *
'****************************************************************************
Public Overrides Sub refresh2()
'Changed PM_REFACTOR 2007-07-22
'mAxGraphControl_ANALYSTCOM_3.Refresh()
mAnalystCOM.axControl_Refresh()
End Sub 'refresh2
'Changed PM_ANALYST_MARKERS 2005-02-10
'****************************************************************************
'* <placeholder for header> *
'****************************************************************************
Public Overrides Function yOffsetForMarkers() As Integer
Return 30
End Function 'yOffsetForMarkers
'Changed PM_ANALYST_MARKERS 2005-02-10
'****************************************************************************
'* <placeholder for header> *
'****************************************************************************
Public Overrides Function xOffsetForMarkers() As Integer
Return 63 '42
End Function 'yOffsetForMarkers
'Changed PM_ANALYST_MARKERS 2005-02-10
'****************************************************************************
'* <placeholder for header> *
'****************************************************************************
Public Overrides Function xOffsetFromRightEdge() As Integer
Return 16 '18
End Function 'yOffsetForMarkers
'Changed PM_ANALYST_GRAPHZOOM_HANDLING 2007-07-25
''Changed PM_ANALYST_MARKERS 2005-02-10
'****************************************************************************
'* <placeholder for header> *
'****************************************************************************
Private Sub mAxGraphControl_ANALYSTCOM_3_GraphZoom( _
ByVal aSender As Object, _
ByVal anEvent As graphZoom2EventArgs) _
Handles mAnalystCOM.GraphZoom2
'Old:
' ByVal anEvent As AxQS20_GraphControlLib._DGraphControlEvents_GraphZoomEvent) _
' Handles mAxGraphControl_ANALYSTCOM_3.GraphZoom
'Second parameter; old type:
' AxGraphControlLib._DGraphControlEvents_GraphZoomEvent
' AxQS20._DGraphControlEvents_GraphZoomEvent
'Changed PM_REFACTOR 2007-07-22
'mAxGraphControl_ANALYSTCOM_3.Focus()
mAnalystCOM.axControl_Focus()
''mAxGraphControl_ANALYSTCOM_3.GraphArea
''mAxGraphControl_ANALYSTCOM_3.GraphArea.XAxis
''mAxGraphControl_ANALYSTCOM_3.GraphArea.XAxis.TitleText1()
''mAxGraphControl_ANALYSTCOM_3.GraphArea.XAxis.TitleText2()
'Dim min As Double = mAxGraphControl_ANALYSTCOM_3.GraphArea.XAxis.Min
'Dim max As Double = mAxGraphControl_ANALYSTCOM_3.GraphArea.XAxis.Max
'Dim dataMin As Double = mAxGraphControl_ANALYSTCOM_3.GraphArea.XAxis.DataMin
'Dim dataMax As Double = mAxGraphControl_ANALYSTCOM_3.GraphArea.XAxis.DataMax
Dim dataMinX As Double
Dim dataMaxX As Double
Dim dataMaxY As Double
Dim minX As Double
Dim maxX As Double
mAnalystCOM.axControl_getAxisRanges( _
dataMinX, dataMaxX, dataMaxY, minX, maxX)
mZoom.startMass = minX
mZoom.endMass = maxX
'Changed PM_QSTAR_BROKEN_ZOOMING 2007-10-03
Dim datapointsInRange As Integer
Dim maxYval As Integer = _
CInt(mRawDataFileHandling.maxYValueInMassRange( _
minX, maxX, datapointsInRange))
'Changed PM_ASSERT_MAXY 2008-07-14
'Only breakpoints for now. But should we ignore the
'request if there are not data points?
If datapointsInRange > 0 Then
Dim peter2 As Integer = 2
Else
Dim peter3 As Integer = 3
End If
mZoom.maxYVal = maxYval
'Changed PM_REFACTOR 2007-09-19
'updateMarkersPosition(mParentForm)
Me.setZoomRange2(mZoom)
'Changed PM_REFACTOR 2007-07-22
'frmAnalystSpectraWithLabelMarkers.avoidInvalidNumberOfParametersError( _
' mAxGraphControl_ANALYSTCOM_3)
mAnalystCOM.avoidInvalidNumberOfParametersError()
End Sub 'mAxGraphControl_ANALYSTCOM_3_GraphZoom
'****************************************************************************
'* <placeholder for header> *
'****************************************************************************
Protected Overrides Sub derivedClearDisplay()
'Not yet! Just ignore the request..
End Sub 'derivedClearDisplay
End Class 'frmAnalystSpectraWithLabelMarkers
Generated by script codePublish.pl at 2009-01-05T15:20:59.