Source code for MSQuant: frmZedSpectra.vb, MSQuant/msquant/src/GUI/forms/frmZedSpectra.vb.

Table of contents page.

Home page for MSQuant.

'****************************************************************************
'* Copyright (C) 2007 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 vendor independet spectra on the     *
'*          screen, based on the ZedGraph.                                  *
'*                                                                          *
'****************************************************************************

'****************************************************************************
'*                               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:   frmZedSpectra.vb                                          *
'*    TYPE:  VISUAL_BASIC                                                   *
'*                                                                          *
'* CREATED: PM 2007-09-19   Vrs 1.0.                                        *
'* UPDATED: PM 2007-xx-xx                                                   *
'*                                                                          *
'****************************************************************************

Option Strict On
Option Explicit On 

Imports ZedGraph

Imports SDUPutility 'For SDUPlogger

Imports massSpectrometryBase 'For rawDataFileHandling
Imports utilityStatic 'For numbersClose


'****************************************************************************
'*    <placeholder for header>                                              *
'****************************************************************************
Public Class frmZedSpectra
    'Inherits System.Windows.Forms.Form
    Inherits frmSpectrumDisplay

    'Dim mZoomInCursor As Cursor
    'Dim mZoomOutCursor As Cursor
    'Dim mToZoomIn As Boolean = True
    Private mPreviousZoom As massZoomStructure
    Private mPreviousSpectrumNumber As Integer

    Friend WithEvents mZedGraphControl As ZedGraphControl

    Dim mPane As GraphPane

    Private mX0_absolute As Integer 'Pixel x-coordinate of x-axis origin.


#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.
    Friend WithEvents ToolTip1 As System.Windows.Forms.ToolTip
    'Friend WithEvents AxXSpecDisplay1 As AxXSpecDisplay
    Friend WithEvents btnTest1 As System.Windows.Forms.Button
    Friend WithEvents chkLines As System.Windows.Forms.CheckBox
    Friend WithEvents lblMaxValue As System.Windows.Forms.Label
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Me.components = New System.ComponentModel.Container
        Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(frmFinneganSpectra))
        Me.ToolTip1 = New System.Windows.Forms.ToolTip(Me.components)
        Me.btnTest1 = New System.Windows.Forms.Button
        Me.chkLines = New System.Windows.Forms.CheckBox
        Me.lblMaxValue = New System.Windows.Forms.Label
        '
        'btnTest1
        '
        Me.btnTest1.Enabled = False
        Me.btnTest1.Location = New System.Drawing.Point(592, 320)
        Me.btnTest1.Name = "btnTest1"
        Me.btnTest1.Size = New System.Drawing.Size(56, 24)
        Me.btnTest1.TabIndex = 2
        Me.btnTest1.Text = "Test1"
        '
        'chkLines
        '
        Me.chkLines.Location = New System.Drawing.Point(16, 336)
        Me.chkLines.Name = "chkLines"
        Me.chkLines.Size = New System.Drawing.Size(56, 24)
        Me.chkLines.TabIndex = 3
        Me.chkLines.Text = "Lines"
        '
        'lblMaxValue
        '
        Me.lblMaxValue.Font = New System.Drawing.Font("Lucida Console", 18.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
        Me.lblMaxValue.ForeColor = System.Drawing.Color.FromArgb(CType(192, Byte), CType(0, Byte), CType(0, Byte))
        Me.lblMaxValue.Location = New System.Drawing.Point(164, 8)
        Me.lblMaxValue.Name = "lblMaxValue"
        Me.lblMaxValue.Size = New System.Drawing.Size(344, 23)
        Me.lblMaxValue.TabIndex = 4
        Me.lblMaxValue.Text = "<>"
        Me.lblMaxValue.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
        '
        'frmZedSpectra
        '
        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 = "frmZedSpectra"
        Me.Text = "frmZedSpectra"

    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 aExternalDisplay As ZedGraphControl, _
      ByRef anInRawDataFileHandling As rawDataFileHandling, _
      ByRef anInOutMarker As SDUPspectrumMarking)

        MyBase.New(anInRawDataFileHandling, anInOutMarker)

        'This call is required by the Windows Form Designer.
        InitializeComponent()

        'Changed PM_REFACTOR 2004-02-05
        If aExternalDisplay Is Nothing Then
            Trace.Assert( _
              False, "Stop!", _
              "PIL ASSERT. Internal/development assert for stopping execution......")
        Else
            mZedGraphControl = aExternalDisplay
        End If

        'Add any initialization after the InitializeComponent() call.

        mPane = mZedGraphControl.GraphPane
        mPane.Title.Text = "Some spectrum "
        mPane.XAxis.Title.Text = "MCR [Th]"
        mPane.CurveList.Clear()

        mZedGraphControl.IsShowPointValues = True

        mX0_absolute = 70 'Initial guess. Actual value depends on the
        '  width of the labels on the y-axis.

        'Dim list1 As PointPairList = New PointPairList()
        'Dim x As Double
        'Dim y1 As Double
        'Dim i As Integer
        'For i = 0 To (36 - 1)
        '    x = i + 5
        '    y1 = 1.5 + Math.Sin(i * 0.2)
        '    list1.Add(x, y1)
        'Next
        'Dim myCurve3 As StickItem = _
        '  mPane.AddStick("Some Sticks", list1, Color.Blue)
        'myCurve3.Line.Width = 2.0F
        'mZedGraphControl.AxisChange()

        If True Then
            '  2. For icon files/Property: "Build Action" is set
            '     to "Embedded Resource" (not the default "Content").

            'Dim assem As [Assembly] = [Assembly].GetExecutingAssembly()
            'mZoomInCursor = _
            '  New Cursor(assem.GetManifestResourceStream("ZoomIn.cur"))
            'mZoomOutCursor = _
            '  New Cursor(assem.GetManifestResourceStream("ZoomOut.cur"))
        End If

        mPreviousSpectrumNumber = -1
        mPreviousZoom.startMass = -10.0
        mPreviousZoom.endMass = -20.0
    End Sub 'New


    'Changed PM_QSTAR_BROKEN_QUANTITATION_FULLZOOMBUG 2007-10-10
    '****************************************************************************
    '*    <placeholder for header>                                              *
    '****************************************************************************
    Public Overrides Function getCOMlogger() _
      As SDUPlogger

        Trace.Assert(False, "Stop!", _
          "PIL ASSERT. Internal/development assert for stopping execution......")
        Return Nothing
    End Function 'getCOMlogger


    '****************************************************************************
    '*    <placeholder for header>                                              *
    '****************************************************************************
    Private Sub xAxisPositionUpdate(ByVal aStartMass As Double)

        'From ZedGraph codeproject.com intro page:
        ' GeneralTransform() is a method in the GraphPane class that, 
        ' given an (X,Y) value pair, returns the corresponding (X,Y) 
        ' screen pixel coordinates. The (X,Y) value pair can be 
        ' expressed in a variety of coordinate systems, as follows:
        Dim xOrigin As PointF = New PointF(CSng(mZoom.startMass), 0.0)
        Dim scrCoor2 As PointF = _
          mPane.GeneralTransform(xOrigin, CoordType.AxisXYScale)
        mX0_absolute = CInt(scrCoor2.X) + 12 'This will change the 
        '  outcome of xOffsetForMarkers() below.
        If mX0_absolute <> 70 Then
            Dim peter70 As Integer = 70
        End If
        mMarking.newXaxisPosition(Me.xOffsetForMarkers())
    End Sub 'xAxisPositionUpdate


    '****************************************************************************
    '*    <placeholder for header>                                              *
    '****************************************************************************
    Public Overrides Sub updateData()

        Try
            'Note: currently we get new data whenever the zoom
            '      state changes. This is not strictly necessary as we
            '      usually start at the highest zoom and could thus
            '      save those data and select a subset of them
            '      depending on the zoom.

            Trace.Assert(Not mRawDataFileHandling Is Nothing, _
              "PIL ASSERT. anInRawDataFileHandling Is Nothing !.")

            'Changed PM_USER_EXACT_ZOOM 2005-03-03
            Dim spectrumNum As Integer = _
              mRawDataFileHandling.currentSpectrumNumber()
            Dim doUpdate As Boolean = True
            If spectrumNum = mPreviousSpectrumNumber AndAlso _
              numbersClose( _
                mZoom.startMass, mPreviousZoom.startMass, _
                0.0000000001) AndAlso _
              numbersClose( _
                mZoom.endMass, mPreviousZoom.endMass, _
                0.0000000001) Then

                doUpdate = False
            End If
            mPreviousSpectrumNumber = spectrumNum
            mPreviousZoom = mZoom

            If doUpdate Then
                Dim someSignal As _
                  Generic.List(Of massSpectrometryBase.signalStructure) = _
                    Nothing 'Keep compiler happy.
                Me.getSignalInZoomRange(someSignal)

                'Note: finding the 2 indexes might be more efficient by
                '      doing two binary searches in the array.

                Dim len As Integer = someSignal.Count
                Dim lastIndex As Integer = len - 1

                Const NODATAPOINTS_MARKER As Integer = -1
                Dim startIndex As Integer = NODATAPOINTS_MARKER

                Dim endIndex As Integer = 0

                Dim j As Integer
                For j = 0 To lastIndex
                    Dim curSignalPoint As massSpectrometryBase.signalStructure = _
                      someSignal(j)
                    Dim x As Double = curSignalPoint.Xsig

                    Dim belowUpperBound As Boolean = x <= mZoom.endMass
                    If x >= mZoom.startMass AndAlso belowUpperBound Then
                        'Check of mEndMass above is necessary as the display range
                        'may be so that there are no data points in it.

                        If startIndex = NODATAPOINTS_MARKER Then 'We only need
                            '  to do this once as x values are always increasing.
                            startIndex = j
                        End If

                        If belowUpperBound Then
                            'In mass range for display.
                            endIndex = j 'We have to update everytime because 
                            '  we do not know where the last in-range 
                            '  data point is.
                        Else
                            'To the right of the asked for mass window for
                            'display. Bail out!
                            Exit For
                        End If
                    End If
                    If Not belowUpperBound Then
                        Exit For
                    End If
                Next j

                If startIndex = NODATAPOINTS_MARKER Then
                    endIndex = startIndex - 1 'To get correct length and zero
                    '  iterations in the loop below.
                Else
                    Trace.Assert(endIndex >= startIndex, _
                      "PIL ASSERT. endIndex >= startIndex, in updateData()/frmFinneganSpectra.vb.")
                End If

                Dim pointsInRange As Integer = endIndex - startIndex + 1

                Dim len2 As Integer = pointsInRange + 2 '2: extra points at
                '  beginning and end to fix mass range.
                Dim lastIndex2 As Integer = len2 - 1

                Dim list1 As PointPairList = New PointPairList()

                'Artificial datapoint to fix x-scale
                list1.Add(mZoom.startMass, 0.000000001)

                ''Dim dataArray(9, lastIndex2) As Double
                'dataArray(0, 0) = mZoom.startMass
                'dataArray(1, 0) = 0.000000001
                'dataArray(0, lastIndex2) = mZoom.endMass
                'dataArray(1, lastIndex2) = 0.000000001

                Dim maxSignal As Double = -1000000000.0
                If startIndex <> NODATAPOINTS_MARKER Then
                    Dim index2 As Integer = 1 '1 because we have inserted
                    '  zero point at mStartMass
                    For j = startIndex To endIndex
                        Dim curSignalPoint As massSpectrometryBase.signalStructure = _
                          someSignal(j)
                        Dim curY As Double = curSignalPoint.Ysig
                        If curY > maxSignal Then
                            maxSignal = curY
                        End If

                        'dataArray(0, index2) = curSignalPoint.Xsig
                        'dataArray(1, index2) = curY

                        If True Then 'False: test only!
                            list1.Add(curSignalPoint.Xsig, curY)
                        Else
                            list1.Add(curSignalPoint.Xsig, _
                              Math.Log10(curY))
                        End If

                        index2 += 1
                    Next j
                Else
                    Dim peter111 As Integer = 111
                End If

                'Artificial datapoint to fix x-scale.
                list1.Add(mZoom.endMass, 0.000000001)

                mPane.CurveList.Clear()

                'Dim plotHeader As String = "Some Sticks"
                Dim plotHeader As String = ""

                Dim myCurve3 As StickItem = _
                  mPane.AddStick(plotHeader, list1, Color.Blue)
                'myCurve3.Line.Width = 2.0F
                myCurve3.Line.Width = 1.0F

                'Changed PM_SPECTRUMDISPLAY_ZEDGRAPH 2007-09-24
                'mPane.XAxis
                'mPane.BarSettings.ClusterScaleWidthAuto
                mPane.XAxis.Scale.Min = mZoom.startMass
                mPane.XAxis.Scale.Max = mZoom.endMass
                mPane.XAxis.Scale.FontSpec.FontColor = Color.Red

                'Don't allow the user to zoom in the y-direction.
                mPane.YAxis.Scale.Min = 0.0 'Assumes no negative
                '  values. (What about possible log scale?)
                mPane.YAxis.Scale.Max = 1.1 * maxSignal

                'Changed PM_SPECTRUMDISPLAY_ZEDGRAPH 2007-09-25
                Dim log10frac As Double = Math.Log10(maxSignal)
                Dim log10 As Integer = CInt(log10frac + 0.5)
                Dim relAs100 As Integer = log10 - 2 '2: Max value is 100.0 - like
                '  100 %...
                'mPane.YAxis.Scale.Mag = relAs100
                mPane.YAxis.Title.Text = "Intensity"

                ''mPane.Title.IsVisible = False
                'mPane.Title.IsVisible = True
                mPane.Title.IsVisible = False


                'Changed PM_SPECTRUMDISPLAY_ZEDGRAPH 2007-09-25
                'mPane.YAxis.Scale
                'mPane.YAxis.Scale.DeLinearize()
                'mPane.YAxis.Scale.FormatAuto
                'mPane.YAxis.Scale.
                '
                'From ZedGraph help file for Scale.Mag Property:
                ' The magnitude multiplier for scale values. This is used to 
                ' limit the size of the displayed value labels. For example, 
                ' if the value is really 2000000, then the graph will display 
                ' 2000 with a 10^3 magnitude multiplier. This value can be 
                ' determined automatically depending on the state of MagAuto. 
                ' If this value is set manually by the user, then MagAuto will 
                ' also be set to false. 
                '
                'AxisLabel.IsOmitMag Property:
                ' For large scale values, a "magnitude" value (power of 10) is 
                ' automatically used for scaling the graph. This magnitude 
                ' value is automatically appended to the end of the Axis Title 
                ' (e.g., "(10^4)") to indicate that a magnitude is in use. 
                ' This property controls whether or not the magnitude is 
                ' included in the title. Note that it only affects the axis 
                ' title; a magnitude value may still be used even if it is not 
                ' shown in the title. 

                mZedGraphControl.AxisChange()

                ' 'Changed PM_SPECTRUMDISPLAY_ZEDGRAPH 2007-09-25
                ' 'mPane.XAxis.Scale.PickScale
                ' Dim intMass As Integer = CInt(mZoom.startMass)
                ' Dim onXaxisOrigin As Point = New Point(intMass, 0)
                ' Dim scrCoor As Point = _
                '   mZedGraphControl.PointToScreen(onXaxisOrigin)
                ' 'mZedGraphControl.
                ' '
                ' 'mPane.XAxis.location()
                ' Dim someText As TextObj = _
                '   New TextObj("x-origin", mZoom.startMass, 0.0F)
                ' someText.Location.AlignH = AlignH.Left
                ' someText.Location.AlignV = AlignV.Top
                ' mPane.GraphObjList.Add(someText)
                ' 
                ' Dim pf As PointF = someText.Location.TopLeft
                ' Dim pf2 As PointF = someText.Location.TransformTopLeft(mPane)
                ' 'Dim pf3 As PointF = someText.Location.TransformTopLeft(pf)



                ''From ZedGraph codeproject.com intro page:
                '' GeneralTransform() is a method in the GraphPane class that, 
                '' given an (X,Y) value pair, returns the corresponding (X,Y) 
                '' screen pixel coordinates. The (X,Y) value pair can be 
                '' expressed in a variety of coordinate systems, as follows:
                'Dim xOrigin As PointF = New PointF(CSng(mZoom.startMass), 0.0)
                'Dim scrCoor2 As PointF = _
                '  mPane.GeneralTransform(xOrigin, CoordType.AxisXYScale)
                'mX0_absolute = CInt(scrCoor2.X)
                'mMarking.newXaxisPosition(mX0_absolute)
                Me.xAxisPositionUpdate(mZoom.startMass)

                mZedGraphControl.Refresh()
            Else
                Dim peter9 As Integer = 9
            End If

        Catch exceptionObject As Exception
            MSQuantCommon2.displayStandardExceptionInfo( _
              exceptionObject, _
              "Could not display spectrum data.")
            Exit Sub
        End Try
    End Sub 'updateData


    '****************************************************************************
    '*    <placeholder for header>                                              *
    '****************************************************************************
    Protected Overrides Sub derivedClearDisplay()

        mPane.CurveList.Clear()

        '???
        'dataArray(0, 0) = mZoom.startMass
        'dataArray(1, 0) = 0.000000001
        'dataArray(0, 1) = mZoom.endMass
        'dataArray(1, 1) = 0.000000001
    End Sub 'derivedClearDisplay


    '****************************************************************************
    '*    <placeholder for header>                                              *
    '****************************************************************************
    Public Overrides Sub setSpectrumTitle(ByVal aTitle As String)
        Me.Text = aTitle 'Should set window title

        mPane.Title.Text = aTitle
    End Sub 'setSpectrumTitle


    '****************************************************************************
    '*    <placeholder for header>                                              *
    '****************************************************************************
    Public Overrides Function getTitle() _
    As String

        'Logical, but not as refactored. What should it be?
        'Dim toReturn As String = _
        '  mPane.Title.Text

        Dim toReturn As String = "Some title..."

        Return toReturn
    End Function 'getTitle


    '****************************************************************************
    '*    E V E N T S ,    B E G I N                                            *
    '****************************************************************************


    '****************************************************************************
    '*    <placeholder for header>                                              *
    '****************************************************************************
    Private Sub ZedGraphControl1_ZoomEvent( _
      ByVal aSender As ZedGraph.ZedGraphControl, _
      ByVal oldState As ZedGraph.ZoomState, _
      ByVal newState As ZedGraph.ZoomState) _
      Handles mZedGraphControl.ZoomEvent

        Dim newXmin As Double = mPane.XAxis.Scale.Min
        Dim newXmax As Double = mPane.XAxis.Scale.Max

        mZoom.startMass = newXmin
        mZoom.endMass = newXmax

        Me.xAxisPositionUpdate(mZoom.startMass)
        Me.setZoomRange2(mZoom)
    End Sub 'ZedGraphControl1_ZoomEvent


    ' '****************************************************************************
    ' '*    <placeholder for header>                                              *
    ' '****************************************************************************
    ' Private Sub frmFinneganSpectra_KeyDown( _
    '   ByVal aSender As Object, _
    '   ByVal anEvent As System.Windows.Forms.KeyEventArgs) _
    '   Handles MyBase.KeyDown
    ' 
    '     Me.zoomCursorSet(Control.ModifierKeys = Keys.Control)
    ' End Sub 'frmFinneganSpectra_KeyDown


    ' '****************************************************************************
    ' '*    <placeholder for header>                                              *
    ' '****************************************************************************
    ' Private Sub zoomCursorSet(ByVal aZoomOut As Boolean)
    '     If aZoomOut Then
    '         'Changed PM_VS2005 2006-06-14. Fully qual.
    '         Windows.Forms.Cursor.Current = mZoomOutCursor
    ' 
    '         mToZoomIn = False
    '     Else
    '         'Changed PM_VS2005 2006-06-14. Fully qual.
    '         Windows.Forms.Cursor.Current = mZoomInCursor
    ' 
    '         mToZoomIn = True
    '     End If
    ' End Sub 'zoomCursorSet


    ' '****************************************************************************
    ' '*    <placeholder for header>                                              *
    ' '****************************************************************************
    ' Private Sub XSpecDisplay_FINNEGANCOM_MouseMoveEvent( _
    '   ByVal sender As System.Object, _
    '   ByVal anEvent As _IXSpecDisplayEvents_MouseMoveEvent) _
    '   Handles mAxXSpecDisplay_FINNEGANCOM.MouseMoveEvent
    ' 
    '     If Not mStartingUp Then
    '         Me.zoomCursorSet(Control.ModifierKeys = Keys.Control)
    ' 
    '         If False Then
    '             'mAxXSpecDisplay_FINNEGANCOM.Cursor=
    '             mAxXSpecDisplay_FINNEGANCOM.Cursor = mZoomInCursor
    '             'mAxXSpecDisplay_FINNEGANCOM.Refresh()
    ' 
    '             'Changed PM_VS2005 2006-06-14. Fully qual.
    '             Windows.Forms.Cursor.Current = mZoomInCursor
    ' 
    '             'mZoomInCursor
    '             'mZoomOutCursor
    '         End If
    '     End If
    ' End Sub 'XSpecDisplay_FINNEGANCOM_MouseMoveEvent


    ' '****************************************************************************
    ' '*    <placeholder for header>                                              *
    ' '****************************************************************************
    ' Private Sub XSpecDisplay_FINNEGANCOM_MouseUpEvent( _
    '   ByVal sender As Object, _
    '   ByVal anEvent As _IXSpecDisplayEvents_MouseUpEvent) _
    '   Handles mAxXSpecDisplay_FINNEGANCOM.MouseUpEvent
    ' 
    '     Dim displayMassWindow As Double = mZoom.endMass - mZoom.startMass
    ' 
    '     Dim r As System.Drawing.Size = mAxXSpecDisplay_FINNEGANCOM.Size
    '     Dim specXsize As Double = r.Width
    '     Dim hitXmass As Double = _
    '       anEvent.x / specXsize * displayMassWindow + mZoom.startMass
    ' 
    '     Dim newDisplayMassWindow As Double
    ' 
    '     If mToZoomIn Then
    '         newDisplayMassWindow = 0.5 * displayMassWindow
    '     Else
    '         newDisplayMassWindow = 2.0 * displayMassWindow
    '     End If
    ' 
    '     Dim halfnewInterval As Double = 0.5 * newDisplayMassWindow
    '     Dim newStartMass As Double = hitXmass - halfnewInterval
    '     Dim newEndMass As Double = hitXmass + halfnewInterval
    ' 
    '     'Changed PM_ZOOM_QUANTWINDOW_BROKEN 2005-07-13
    '     Trace.Assert( _
    '       mInititalStartMass > 5.0, _
    '       "PIL ASSERT. mInititalStartMass is not initialised: " & _
    '       mInititalStartMass)
    '     Trace.Assert( _
    '       mInititalEndMass > 5.0, _
    '       "PIL ASSERT. mInititalEndMass is not initialised: " & _
    '       mInititalEndMass)
    ' 
    '     If newStartMass < mInititalStartMass Then
    '         newStartMass = mInititalStartMass
    '     End If
    '     If newEndMass > mInititalEndMass Then
    '         newEndMass = mInititalEndMass
    '     End If
    ' 
    '     mZoom.startMass = newStartMass
    '     mZoom.endMass = newEndMass
    ' 
    '     'Changed PM_REFACTOR 2005-03-03
    '     'Me.updateData(mRawDataFileHandling)
    '     ''Changed PM_ZOOM_MARKERS 2004-06-17
    '     'updateMarkersPosition(mParentForm)
    '     '
    '     'Me.newZoom()
    '     'Me.updateMarkersPosition(mParentForm)
    '     Me.setZoomRange2(mZoom)
    ' End Sub 'XSpecDisplay_FINNEGANCOM_MouseUpEvent


    '****************************************************************************
    '*    <placeholder for header>                                              *
    '****************************************************************************
    Protected Overrides Sub spectrumControlLocAndSize( _
     ByRef anOutXLoc As Integer, ByRef anOutYLoc As Integer, _
     ByRef anOutXSize As Integer, ByRef anOutYSize As Integer)

        anOutXLoc = mZedGraphControl.Location.X
        anOutYLoc = mZedGraphControl.Location.Y
        Dim specSize As System.Drawing.Size = mZedGraphControl.Size
        anOutXSize = specSize.Width
        anOutYSize = specSize.Height
    End Sub 'spectrumControlLocAndSize


    '****************************************************************************
    '*    <placeholder for header>                                              *
    '****************************************************************************
    Protected Overrides Sub newZoom()

        If True And Not mRawDataFileHandling Is Nothing Then
            Me.updateData()
        End If
    End Sub 'newZoom


    '****************************************************************************
    '*    <placeholder for header>                                              *
    '****************************************************************************
    Public Overrides Sub refresh2()

        mZedGraphControl.Refresh() 'Necessary?
    End Sub 'refresh2


    '****************************************************************************
    '*    <placeholder for header>                                              *
    '****************************************************************************
    Public Overrides Function yOffsetForMarkers() As Integer
        Return 559 - 511 'Two absolute pixel coordinates.
    End Function 'yOffsetForMarkers


    '****************************************************************************
    '*    <placeholder for header>                                              *
    '****************************************************************************
    Public Overrides Function xOffsetForMarkers() As Integer
        Return mX0_absolute - 12 'First two: absolute pixel coordinates.
    End Function 'yOffsetForMarkers


    '****************************************************************************
    '*    <placeholder for header>                                              *
    '****************************************************************************
    Public Overrides Function xOffsetFromRightEdge() As Integer
        Return 931 - 909 'Two absolute pixel coordinates.
    End Function 'yOffsetForMarkers


End Class 'frmZedSpectra

    

    

Generated by script codePublish.pl at 2008-09-23T11:59:18.