private void MenuItem_Click(object sender, EventArgs e)
        {
            var uOp = ((InstrumentRangeOption)(((ToolStripMenuItemWithChannelOption)sender).AssociatedChannelOption));

            // Current = uOp.Range;
            // Current will be set via feedback
            OnRangeChanged?.Invoke(null, uOp.Range);
        }
Beispiel #2
0
 public void FitAll()
 {
     pictureBox1.Top     = 0;
     pictureBox1.Left    = 0;
     pictureBox1.Width_  = Width;
     pictureBox1.Height_ = Height;
     OnRangeChanged?.Invoke(this, null);
     DrawSelection();
 }
Beispiel #3
0
 private void ZoomImage_MouseWheel(object sender, MouseEventArgs e)
 {
     pictureBox1.ZoomCenterRatio_x = e.X / (double)Width;
     pictureBox1.ZoomCenterRatio_y = e.Y / (double)Height;
     pictureBox1.SuspendLayout();
     pictureBox1.Width  = (pictureBox1.Width * (1 + e.Delta / 3000.0));
     pictureBox1.Height = (pictureBox1.Height * (1 + e.Delta / 3000.0));
     pictureBox1.ResumeLayout();
     OnRangeChanged?.Invoke(this, null);
 }
Beispiel #4
0
        public void Init(double min, double max)
        {
            if (min >= max)
            {
                throw new ArgumentOutOfRangeException(nameof(max));
            }

            Min = min;
            Max = max;

            OnRangeChanged?.Invoke(this);
        }
Beispiel #5
0
            public Vector2 SetTimeRange(Vector2 timeRange)
            {
                Vector2 previousRange = GetTimeRange();

                StartTime = timeRange.x;
                EndTime   = timeRange.y;
                Vector2 newRange = GetTimeRange();

                if (previousRange != newRange)
                {
                    OnRangeChanged?.Invoke(newRange);
                }

                return(GetTimeRange());
            }
Beispiel #6
0
 private void ZoomImage_MouseMove(object sender, MouseEventArgs e)
 {
     if (is_draging)
     {
         pictureBox1.Left += (e.X - x0);
         pictureBox1.Top  += (e.Y - y0);
         if ((Math.Abs(e.X - x0) + Math.Abs(e.Y - y0)) > 0)
         {
             draged = true;
             x0     = e.X;
             y0     = e.Y;
             DrawSelection();
             OnRangeChanged?.Invoke(this, null);
         }
     }
 }
Beispiel #7
0
            public bool PanTimeRange(float diff)
            {
                if (diff < 0 && m_StartTime <= m_MinimumTime)
                {
                    return(false);
                }

                if (diff > 0 && m_EndTime >= m_MaximumTime)
                {
                    return(false);
                }

                Vector2 previousRange = GetTimeRange();
                float   originalSpan  = m_EndTime - m_StartTime;
                float   expectedStart = m_StartTime + diff;
                float   expectedEnd   = m_EndTime + diff;

                StartTime = expectedStart;
                EndTime   = expectedEnd;

                float newSpan = m_EndTime - m_StartTime;

                if (!FloatComparer.s_ComparerWithDefaultTolerance.Equals(originalSpan, newSpan))
                {
                    if (FloatComparer.s_ComparerWithDefaultTolerance.Equals(m_StartTime, m_MinimumTime))
                    {
                        EndTime = m_StartTime + originalSpan;
                    }
                    else
                    {
                        StartTime = m_EndTime - originalSpan;
                    }
                }

                Vector2 newRange = GetTimeRange();

                if (previousRange != newRange)
                {
                    OnRangeChanged?.Invoke(newRange);
                    return(true);
                }

                return(false);
            }
Beispiel #8
0
        public void Init(double minBidVolume, double maxBidVolume, double minAskVolume, double maxAskVolume)
        {
            if (minBidVolume >= maxBidVolume)
            {
                throw new ArgumentOutOfRangeException(nameof(maxBidVolume));
            }

            if (minAskVolume >= maxAskVolume)
            {
                throw new ArgumentOutOfRangeException(nameof(maxAskVolume));
            }

            MinBidVolume = minBidVolume;
            MaxBidVolume = maxBidVolume;

            MinAskVolume = minAskVolume;
            MaxAskVolume = maxAskVolume;

            OnRangeChanged?.Invoke(this);
        }
Beispiel #9
0
 private void Ranges_OnRangeChanged(Instrument instrument, InstrumentRange range)
 {
     OnRangeChanged?.Invoke(this, range);
 }