Example #1
0
        async void FlipBtn_Clicked(System.Object sender, System.EventArgs e)
        {
            FlipBtn.IsEnabled = false;
            DisplayLabel.TranslateTo(100, 0, 400);
            await DisplayLabel.RotateYTo(-90, 200);

            DisplayLabel.RotationY = -270;

            if (headSide)
            {
                DisplayLabel.Text = Data.list[currentIndex].Year;
                headSide          = false;
            }
            else
            {
                DisplayLabel.Text = Data.list[currentIndex].Name;
                headSide          = true;
            }

            DisplayLabel.RotateYTo(-360, 200);
            await DisplayLabel.TranslateTo(0, 0, 220);

            DisplayLabel.RotationY = 0;
            FlipBtn.IsEnabled      = true;
        }
Example #2
0
        public IEnumerable <LapDto> GetLapStream(long activityId, PeakStreamType streamType)
        {
            // string units = DisplayLabel.PeakStreamTypeUnits(streamType);

            var result = _context.ActivityPeakDetail
                         .Where(p => p.ActivityId == activityId && p.StreamType == streamType &&
                                _context.PeakStreamTypeDuration
                                .Where(d => d.PeakStreamType == p.StreamType)
                                .Select(d => d.Duration)
                                .ToList()
                                .Contains(p.Duration)
                                )
                         .OrderBy(p => p.Duration)
                         .Select(p => new LapDto
            {
                Id                = p.Id,
                Type              = streamType,
                Selected          = false,
                Name              = p.Duration.ToString(),
                Value             = p.Value.ToString(),
                StartIndex        = p.StartIndex.Value,
                EndIndex          = p.EndIndex.Value,
                StreamStep        = p.Activity.StreamStep,
                SteppedStartIndex = p.StartIndex.Value / p.Activity.StreamStep,
                SteppedEndIndex   = p.EndIndex.Value / p.Activity.StreamStep,
            }).ToList();

            foreach (LapDto l in result)
            {
                l.Name = DisplayLabel.StreamDurationForDisplay(Convert.ToInt32(l.Name));
            }
            return(result);
        }
Example #3
0
 public GTabSettings(ServerDbs serverDb, BaseDb gdb)
 {
     DbData              = serverDb;
     TabName             = new DisplayLabel(serverDb, gdb);
     GenerateSearchPopUp = true;
     CanBeDelayed        = true;
     CanChangeId         = true;
     AttIdWidth          = 60;
     SearchEngine        = new GSearchEngine <TKey, TValue>(serverDb.Filename, this);
 }
Example #4
0
        private void Handle_ValueChanged(object sender, ValueChangedEventArgs e)
        {
            var newStep = Math.Round(e.NewValue / 10000);

            Slider.Value      = newStep * 10000;
            DisplayLabel.Text = Slider.Value.ToString();
            DisplayLabel.TranslateTo(Slider.Value * ((Slider.Width - 300) / Slider.Maximum), 0, 10);
            //setChart(Convert.ToDecimal(Slider.Value));
            setmicroChart(Convert.ToSingle(Slider.Value));
        }
        public IHttpActionResult GetPowerCurve(string id)
        {
            var powerCurve = ActivityPeakDetails.LoadForActivity(Convert.ToInt64(id)).GetPowerCurve();
            var chart      = new {
                Duration = powerCurve.Select(a => DisplayLabel.ShortStreamDurationForDisplay(a.Duration)).ToArray(),
                Watts    = powerCurve.Select(a => a.Watts.ToString()).ToArray()
            };

            return(Ok(chart));
        }
Example #6
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DigitalWatch.Displays.SegmentDisplayWidget"/> class.
 /// </summary>
 public SegmentDisplayWidget()
 {
     Build();
     DisplayLabel.ModifyFont(Pango.FontDescription.FromString(FONT_DESCRIPTION));
     isBlinking = false;
     displayLabelHasBlinkColor = false;
     timerIsRunning            = false;
     blinkColor = new Color();
     Color.Parse(BLINK_COLOR, ref blinkColor);
     Clear();
 }
Example #7
0
 public void DisplayLabel_DurationForDisplayTest()
 {
     Assert.AreEqual("Activity", DisplayLabel.StreamDurationForDisplay(int.MaxValue));
     Assert.AreEqual("5 secs", DisplayLabel.StreamDurationForDisplay(5));
     Assert.AreEqual("30 secs", DisplayLabel.StreamDurationForDisplay(30));
     Assert.AreEqual("1 min", DisplayLabel.StreamDurationForDisplay(60));
     Assert.AreEqual("1 min 1 secs", DisplayLabel.StreamDurationForDisplay(61));
     Assert.AreEqual("2 min", DisplayLabel.StreamDurationForDisplay(120));
     Assert.AreEqual("59 min", DisplayLabel.StreamDurationForDisplay(59 * 60));
     Assert.AreEqual("59 min 59 secs", DisplayLabel.StreamDurationForDisplay((59 * 60) + 59));
     Assert.AreEqual("01:00:00", DisplayLabel.StreamDurationForDisplay(60 * 60));
     Assert.AreEqual("01:00:01", DisplayLabel.StreamDurationForDisplay((60 * 60) + 1));
 }
 void ReleaseDesignerOutlets()
 {
     if (DisplayLabel != null)
     {
         DisplayLabel.Dispose();
         DisplayLabel = null;
     }
     if (GoBackButton != null)
     {
         GoBackButton.Dispose();
         GoBackButton = null;
     }
 }
Example #9
0
        /// <summary>
        /// Triggered by GLib.Timout.
        /// </summary>
        /// <returns><c>true</c> when the timer has to make another cycle or false when the timer can stop.</returns>
        private bool OnBlink()
        {
            if (displayLabelHasBlinkColor)
            {
                DisplayLabel.ModifyFg(StateType.Normal);
                displayLabelHasBlinkColor = false;
            }
            else
            {
                DisplayLabel.ModifyFg(StateType.Normal, blinkColor);
                displayLabelHasBlinkColor = true;
            }

            //The timer can be stoped if the blink function has been disabled and
            //the display has the normal color.
            timerIsRunning = isBlinking || displayLabelHasBlinkColor;
            return(timerIsRunning);
        }
Example #10
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = (Name != null ? Name.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Label != null ? Label.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ (Icon != null ? Icon.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ DisplayLabel.GetHashCode();
         hashCode = (hashCode * 397) ^ LabelStacked.GetHashCode();
         hashCode = (hashCode * 397) ^ DisplayIcon.GetHashCode();
         hashCode = (hashCode * 397) ^ IconStacked.GetHashCode();
         hashCode = (hashCode * 397) ^ Required.GetHashCode();
         hashCode = (hashCode * 397) ^ IsStart.GetHashCode();
         hashCode = (hashCode * 397) ^ (Value != null ? Value.GetHashCode() : 0);
         hashCode = (hashCode * 397) ^ NotVisible.GetHashCode();
         hashCode = (hashCode * 397) ^ NotEnabled.GetHashCode();
         hashCode = (hashCode * 397) ^ (ErrorMsg != null ? ErrorMsg.GetHashCode() : 0);
         return(hashCode);
     }
 }
Example #11
0
        public IHttpActionResult GetPowerCurve([FromUri] DateRange dates)
        {
            if (!dates.FromDateTime.HasValue)
            {
                return(BadRequest("Invalid From Date"));
            }

            if (!dates.ToDateTime.HasValue)
            {
                return(BadRequest("Invalid To Date"));
            }

            var powerCurve = _periodRepo.PowerCurve(this.User.Identity.GetUserId(), dates.FromDateTime.Value.Date, dates.ToDateTime.Value.Date);

            var chart = new
            {
                Duration = powerCurve.Select(a => DisplayLabel.ShortStreamDurationForDisplay(a.Duration)).ToArray(),
                Watts    = powerCurve.Select(a => a.Watts.ToString()).ToArray()
            };

            return(Ok(chart));
        }
Example #12
0
            public InfoForm()
            {
                DoubleBuffered = true;
                ShowInTaskbar  = false;
                MinimumSize    = new Size(32, 20);

                StartPosition         = FormStartPosition.Manual;
                FormBorderStyle       = FormBorderStyle.None;
                BackgroundImageLayout = ImageLayout.Stretch;

                ForeColor = SystemColors.InfoText;
                BackColor = SystemColors.Info;

                Label = new DisplayLabel
                {
                    BackColor   = Color.Transparent,
                    TextAlign   = ContentAlignment.MiddleCenter,
                    AutoSize    = true,
                    MinimumSize = new Size(32, 20),
                    Left        = IL_BORDER_THICKNESS_LEFT + IL_TEXT_MARGIN_LEFT,
                    Top         = IL_BORDER_THICKNESS_TOP + IL_TEXT_MARGIN_TOP
                };
                Controls.Add(Label);
            }
 public void RegisterDisplay(DisplayLabel displayLabel)
 {
     this._displayLabel = displayLabel;
 }
Example #14
0
		public void RegisterDisplay(DisplayLabel displayLabel) {
			this._displayLabel = displayLabel;
		}
        void ReleaseDesignerOutlets()
        {
            if (AboutButton != null)
            {
                AboutButton.Dispose();
                AboutButton = null;
            }

            if (AdditionButton != null)
            {
                AdditionButton.Dispose();
                AdditionButton = null;
            }

            if (ClearButton != null)
            {
                ClearButton.Dispose();
                ClearButton = null;
            }

            if (DisplayLabel != null)
            {
                DisplayLabel.Dispose();
                DisplayLabel = null;
            }

            if (DivisionButton != null)
            {
                DivisionButton.Dispose();
                DivisionButton = null;
            }

            if (EightButton != null)
            {
                EightButton.Dispose();
                EightButton = null;
            }

            if (EqualsButton != null)
            {
                EqualsButton.Dispose();
                EqualsButton = null;
            }

            if (FiveButton != null)
            {
                FiveButton.Dispose();
                FiveButton = null;
            }

            if (FourButton != null)
            {
                FourButton.Dispose();
                FourButton = null;
            }

            if (historyCalcSwipeGesture != null)
            {
                historyCalcSwipeGesture.Dispose();
                historyCalcSwipeGesture = null;
            }

            if (MultiplyButton != null)
            {
                MultiplyButton.Dispose();
                MultiplyButton = null;
            }

            if (NineButton != null)
            {
                NineButton.Dispose();
                NineButton = null;
            }

            if (OneButton != null)
            {
                OneButton.Dispose();
                OneButton = null;
            }

            if (SevenButton != null)
            {
                SevenButton.Dispose();
                SevenButton = null;
            }

            if (SixButton != null)
            {
                SixButton.Dispose();
                SixButton = null;
            }

            if (SubtractButton != null)
            {
                SubtractButton.Dispose();
                SubtractButton = null;
            }

            if (SymbolLabel != null)
            {
                SymbolLabel.Dispose();
                SymbolLabel = null;
            }

            if (ThreeButton != null)
            {
                ThreeButton.Dispose();
                ThreeButton = null;
            }

            if (TwoButton != null)
            {
                TwoButton.Dispose();
                TwoButton = null;
            }

            if (ZeroButton != null)
            {
                ZeroButton.Dispose();
                ZeroButton = null;
            }
        }
Example #16
0
 public override int GetHashCode()
 {
     return(Parent == null?DisplayLabel.GetHashCode() : DisplayLabel.GetHashCode() ^ Parent.GetHashCode());
 }
Example #17
0
 /// <summary>
 /// Initializes a new instance of the <see cref="DigitalWatch.Displays.LCDDisplayWidget"/> class.
 /// </summary>
 public LCDDisplayWidget()
 {
     Build();
     DisplayLabel.ModifyFont(Pango.FontDescription.FromString("Ahafoni CLM Bold 40"));
     Clear();
 }