Esempio n. 1
0
 private void ChangeSectionStatusCardButton_PreviewMouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
 {
     if (sectionSelected)
     {
         ChangeSectionStatusCardButton.Background = ConvertColor.ConvertStringColorToSolidColorBrush(ColorManager.Secondary200);
     }
 }
Esempio n. 2
0
 private void UpdateSelectedSectionButtons()
 {
     ChangeSectionStatusCardButton.Foreground = sectionSelected ? ConvertColor.ConvertStringColorToSolidColorBrush(ColorManager.Secondary900) :
                                                ConvertColor.ConvertStringColorToSolidColorBrush(ColorManager.Secondary400);
     DeleteSectionCardButton.Background = sectionSelected ? ConvertColor.ConvertStringColorToSolidColorBrush(ColorManager.Primary900) :
                                          ConvertColor.ConvertStringColorToSolidColorBrush(ColorManager.Primary200);
 }
Esempio n. 3
0
        private void ChangeSelectedAttributeNameCardButton_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            ChangeSelectedAttributeNameCardButton.Background = ConvertColor.ConvertStringColorToSolidColorBrush(ColorManager.Secondary100);

            Mouse.OverrideCursor = Cursors.Wait;

            if (!SelectedAttributeNameTextBox.Text.Equals(string.Empty))
            {
                string oldName = GroupManager.GetGroup(ActiveGroupID).GetAttribute(ActiveAttributeID).Name;
                string newName = SelectedAttributeNameTextBox.Text;

                if (!oldName.Equals(newName))
                {
                    GroupManager.GetGroup(ActiveGroupID).GetAttribute(ActiveAttributeID).Name = newName;
                    GroupManager.SaveGroups();

                    foreach (GroupSettingsAttribute item in AttributesStackPanel.Children)
                    {
                        if (item.AttributeName.Equals(oldName))
                        {
                            item.AttributeName = newName;
                        }
                    }

                    //TODO update group charts
                }
            }

            Mouse.OverrideCursor = null;
        }
Esempio n. 4
0
        private void ChangeSelectedAttributeLineWidthCardButton_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            ChangeSelectedAttributeLineWidthCardButton.Background = ConvertColor.ConvertStringColorToSolidColorBrush(ColorManager.Secondary100);

            Mouse.OverrideCursor = Cursors.Wait;

            if (int.TryParse(SelectedAttributeLineWidthTextBox.Text, out int lineWidth))
            {
                if (lineWidth > 0)
                {
                    var activeAttribute = GroupManager.GetGroup(ActiveGroupID).GetAttribute(ActiveAttributeID);
                    if (activeAttribute.LineWidth != lineWidth)
                    {
                        activeAttribute.LineWidth = lineWidth;
                        GroupManager.SaveGroups();
                        foreach (GroupSettingsAttribute item in AttributesStackPanel.Children)
                        {
                            if (item.ID == ActiveAttributeID)
                            {
                                item.LineWidth = activeAttribute.LineWidth;
                            }
                        }

                        ((DriverlessMenu)MenuManager.GetTab(TextManager.DriverlessMenuName).Content).BuildCharts();
                    }
                }
            }

            Mouse.OverrideCursor = null;
        }
Esempio n. 5
0
        private void UpdateActiveAttributeOptions()
        {
            var group = GroupManager.GetGroup(ActiveGroupID);

            if (group != null)
            {
                NoAttributesGrid.Visibility = Visibility.Hidden;

                var attribute = group.GetAttribute(ActiveAttributeID);
                if (attribute != null)
                {
                    fieldsViewModel.LineWidth             = attribute.LineWidth;
                    fieldsViewModel.AttributeName         = attribute.Name;
                    SelectedAttributeNameTextBox.Text     = attribute.Name;
                    SelectedAttributeColorCard.Background = ConvertColor.ConvertStringColorToSolidColorBrush(attribute.Color);

                    UpdateInputFiles();
                }
                else
                {
                    NoAttributesGrid.Visibility = Visibility.Visible;
                }
            }
            else
            {
                NoAttributesGrid.Visibility = Visibility.Visible;
            }
        }
        private void CancelCardButton_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            CancelCardButton.Background = ConvertColor.ConvertStringColorToSolidColorBrush(ColorManager.Secondary100);

            switch (popUpType)
            {
            case PopUpType.ChangeLiveStatus:
                ((LiveSettings)((LiveMenu)MenuManager.GetTab(TextManager.LiveMenuName).Content).GetTab(TextManager.SettingsMenuName).Content).ChangeStatusResultAsync(change: false);
                break;

            case PopUpType.DeleteSection:
                ((LiveSettings)((LiveMenu)MenuManager.GetTab(TextManager.LiveMenuName).Content).GetTab(TextManager.SettingsMenuName).Content).DeleteSeciton(delete: false);
                break;

            case PopUpType.DeleteUnit:
                ((UnitsMenu)((SettingsMenu)MenuManager.GetTab(TextManager.SettingsMenuName).Content).GetTab(TextManager.UnitsSettingsName).Content).DeleteUnit(delete: false);
                break;

            case PopUpType.DeleteGroup:
                ((GroupSettings)((SettingsMenu)MenuManager.GetTab(TextManager.SettingsMenuName).Content).GetTab(TextManager.GroupsSettingsName).Content).DeleteGroup(delete: false);
                break;

            case PopUpType.DeleteGroupAttribute:
                ((GroupSettings)((SettingsMenu)MenuManager.GetTab(TextManager.SettingsMenuName).Content).GetTab(TextManager.GroupsSettingsName).Content).DeleteAttribute(delete: false);
                break;

            case PopUpType.DeleteInputFile:
                ((InputFilesSettings)((SettingsMenu)MenuManager.GetTab(TextManager.SettingsMenuName).Content).GetTab(TextManager.FilesSettingsName).Content).DeleteInputFile(delete: false);
                break;
            }
            Close();
        }
        private void CancelCardButton_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            CancelCardButton.Background = ConvertColor.ConvertStringColorToSolidColorBrush(ColorManager.Secondary100);

            ((LiveSettings)((LiveMenu)MenuManager.GetTab(TextManager.LiveMenuName).Content).GetTab(TextManager.SettingsMenuName).Content).ChangeDate(change: false);
            Close();
        }
        private void BuildChartGrid(Group group, ref int rowIndex)
        {
            RowDefinition chartRow = new RowDefinition()
            {
                Height = new GridLength(200)
            };
            RowDefinition gridSplitterRow = new RowDefinition
            {
                Height = new GridLength(5)
            };

            ChartsGrid.RowDefinitions.Add(chartRow);
            ChartsGrid.RowDefinitions.Add(gridSplitterRow);

            GridSplitter splitter = new GridSplitter
            {
                ResizeDirection     = GridResizeDirection.Rows,
                HorizontalAlignment = HorizontalAlignment.Stretch,
                Background          = ConvertColor.ConvertStringColorToSolidColorBrush(ColorManager.Secondary100)
            };

            ChartsGrid.Children.Add(splitter);

            var chart = BuildGroupChart(group);

            ChartsGrid.Children.Add(chart);

            Grid.SetRow(chart, rowIndex++);
            Grid.SetRow(splitter, rowIndex++);
        }
Esempio n. 9
0
        private void BackgroundCard_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
        {
            BackgroundCard.Background = isActive ? ConvertColor.ConvertStringColorToSolidColorBrush(ColorManager.Secondary700) :
                                        ConvertColor.ConvertStringColorToSolidColorBrush(ColorManager.Secondary200);

            StatusCard.Background = isActive ? ConvertColor.ConvertStringColorToSolidColorBrush(ColorManager.Secondary700) :
                                    ConvertColor.ConvertStringColorToSolidColorBrush(ColorManager.Secondary200);
        }
Esempio n. 10
0
 private void DeleteSectionCardButton_MouseEnter(object sender, System.Windows.Input.MouseEventArgs e)
 {
     if (sectionSelected)
     {
         DeleteSectionCardButton.Background = ConvertColor.ConvertStringColorToSolidColorBrush(ColorManager.Primary800);
         Mouse.OverrideCursor = Cursors.Hand;
     }
 }
Esempio n. 11
0
 private void ChangeSectionStatusCardButton_MouseLeave(object sender, System.Windows.Input.MouseEventArgs e)
 {
     if (sectionSelected)
     {
         ChangeSectionStatusCardButton.Background = ConvertColor.ConvertStringColorToSolidColorBrush(ColorManager.Secondary50);
         Mouse.OverrideCursor = null;
     }
 }
Esempio n. 12
0
 public ColorStampModel(ColorStruct rgba, ICommand command)
 {
     HexColor          = ConvertColor.Hex(rgba);
     Red               = rgba.Red;
     Green             = rgba.Green;
     Blue              = rgba.Blue;
     ColorClickCommand = command;
 }
Esempio n. 13
0
        private void CancelAddGroupCardButton_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            CancelAddGroupCardButton.Background = ConvertColor.ConvertStringColorToSolidColorBrush(ColorManager.Secondary100);

            AddGroupGridBackground.Visibility = Visibility.Hidden;
            AddGroupGrid.Visibility           = Visibility.Hidden;

            AddGroupNameTextBox.Text = string.Empty;
        }
Esempio n. 14
0
        private void BackgroundCard_MouseLeave(object sender, MouseEventArgs e)
        {
            BackgroundCard.Background = isActive ? ConvertColor.ConvertStringColorToSolidColorBrush(ColorManager.Secondary900) :
                                        ConvertColor.ConvertStringColorToSolidColorBrush(ColorManager.Secondary50);

            StatusCard.Background = isActive ? ConvertColor.ConvertStringColorToSolidColorBrush(ColorManager.Secondary900) :
                                    ConvertColor.ConvertStringColorToSolidColorBrush(ColorManager.Secondary50);

            Mouse.OverrideCursor = null;
        }
Esempio n. 15
0
        private void BackgroundCard_MouseEnter(object sender, MouseEventArgs e)
        {
            BackgroundCard.Background = isActive ? ConvertColor.ConvertStringColorToSolidColorBrush(ColorManager.Secondary800) :
                                        ConvertColor.ConvertStringColorToSolidColorBrush(ColorManager.Secondary100);

            StatusCard.Background = isActive ? ConvertColor.ConvertStringColorToSolidColorBrush(ColorManager.Secondary800) :
                                    ConvertColor.ConvertStringColorToSolidColorBrush(ColorManager.Secondary100);

            Mouse.OverrideCursor = Cursors.Hand;
        }
Esempio n. 16
0
        private void BackgroundCard_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            BackgroundCard.Background = isActive ? ConvertColor.ConvertStringColorToSolidColorBrush(ColorManager.Secondary800) :
                                        ConvertColor.ConvertStringColorToSolidColorBrush(ColorManager.Secondary100);

            StatusCard.Background = isActive ? ConvertColor.ConvertStringColorToSolidColorBrush(ColorManager.Secondary800) :
                                    ConvertColor.ConvertStringColorToSolidColorBrush(ColorManager.Secondary100);

            ((LiveSettings)((LiveMenu)MenuManager.GetTab(TextManager.LiveMenuName).Content).GetTab(TextManager.SettingsMenuName).Content).SelectSection(SectionID);
        }
Esempio n. 17
0
        internal void Insert(ColorStruct rgba, Action <ColorStampModel> command)
        {
            colorExtracted ??= new RelayCommand <ColorStampModel>(command);

            if (this.FirstOrDefault(x => x.HexColor == ConvertColor.Hex(rgba)) is null)
            {
                Insert(0, new ColorStampModel(rgba, colorExtracted));
            }
            RemoveLast();
        }
Esempio n. 18
0
        public void SetUp(string color, int inputFileID)
        {
            ChannelNameLabel.Opacity = 1;

            this.inputFileID     = inputFileID;
            colorCode            = color;
            ColorCard.Background = ConvertColor.ConvertStringColorToSolidColorBrush(color);

            SetChannelName(channelName);
        }
Esempio n. 19
0
        private void ChangeSectionDateCardButton_PreviewMouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            ChangeSectionDateCardButton.Background = ConvertColor.ConvertStringColorToSolidColorBrush(ColorManager.Secondary100);

            SetLoadingGrid(visibility: true, progressBarVisibility: false);

            var changeDateWindow = new PopUpEditDateWindow("Change date");

            changeDateWindow.ShowDialog();
        }
Esempio n. 20
0
        private void AddGroupCardButton_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            AddGroupCardButton.Background = ConvertColor.ConvertStringColorToSolidColorBrush(ColorManager.Secondary100);
            Mouse.OverrideCursor          = Cursors.Wait;

            AddGroupGridBackground.Visibility = Visibility.Visible;
            AddGroupGrid.Visibility           = Visibility.Visible;
            AddGroupNameTextBox.Focus();

            Mouse.OverrideCursor = null;
        }
Esempio n. 21
0
        private void CancelAddAttributeCardButton_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            CancelAddAttributeCardButton.Background = ConvertColor.ConvertStringColorToSolidColorBrush(ColorManager.Secondary100);

            AddGroupGridBackground.Visibility = Visibility.Hidden;
            AddAttributeGrid.Visibility       = Visibility.Hidden;

            AddAttributeNameTextBox.Text          = string.Empty;
            fieldsViewModel.AddAttributeLineWidth = 1;
            //AddAttributeLineWidthTextBox.Text = "1";
        }
Esempio n. 22
0
        private void DeleteAttributeCardButton_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            DeleteAttributeCardButton.Background = ConvertColor.ConvertStringColorToSolidColorBrush(ColorManager.Primary800);

            AddGroupGridBackground.Visibility = Visibility.Visible;

            var changeLiveStatusWindow = new PopUpWindow($"You are about to delete '{GroupManager.GetGroup(ActiveGroupID).GetAttribute(ActiveAttributeID).Name}'\n" +
                                                         $"Are you sure about that?",
                                                         PopUpWindow.PopUpType.DeleteGroupAttribute);

            changeLiveStatusWindow.ShowDialog();
        }
        private void OkCardButton_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            OkCardButton.Background = ConvertColor.ConvertStringColorToSolidColorBrush(ColorManager.Secondary100);

            var date    = (DateTime)PickDateDatePicker.SelectedDate;
            var time    = (DateTime)PickTimeTimePicker.SelectedTime;
            var newDate = new DateTime(date.Year, date.Month, date.Day, time.Hour, time.Minute, time.Second);

            ((LiveSettings)((LiveMenu)MenuManager.GetTab(TextManager.LiveMenuName).Content).GetTab(TextManager.SettingsMenuName).Content).ChangeDate(change: true, newDate);

            Close();
        }
Esempio n. 24
0
        public LiveSectionItem(Section section)
        {
            InitializeComponent();

            this.section = section;

            DateLabel.Content = section.DateString;
            NameLabel.Content = section.Name;
            ChangeStausIcon(section.IsLive);

            IsLiveIcon.Foreground = section.IsLive ? ConvertColor.ConvertStringColorToSolidColorBrush(ColorManager.Secondary900) :
                                    ConvertColor.ConvertStringColorToSolidColorBrush(ColorManager.Primary900);
        }
Esempio n. 25
0
 /// <summary>
 /// Calls if a section is selected.
 /// </summary>
 /// <param name="id">Selected sections ID.</param>
 /// <param name="firstTime">If true, it will update the section in <see cref="LiveTelemetry"/>, no matter what.</param>
 public void SelectSection(int id, bool firstTime = false)
 {
     if (activeSection.ID != id || firstTime)
     {
         activeSection = GetSection(id);
         ChangeSectionColors();
         var channelNames = GetActiveChannelsAsync(id).Result;
         ((LiveTelemetry)((LiveMenu)MenuManager.GetTab(TextManager.LiveMenuName).Content).GetTab(TextManager.LiveMenuName).Content).UpdateSection(activeSection, channelNames);
         UpdateSelectedSectionInfo(channelNames);
         SelectedSectionStatusIcon.Kind       = activeSection.IsLive ? PackIconKind.AccessPoint : PackIconKind.AccessPointOff;
         SelectedSectionStatusIcon.Foreground = activeSection.IsLive ? ConvertColor.ConvertStringColorToSolidColorBrush(ColorManager.Secondary900) :
                                                ConvertColor.ConvertStringColorToSolidColorBrush(ColorManager.Primary900);
     }
 }
Esempio n. 26
0
        private void DeleteSectionCardButton_PreviewMouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
        {
            if (sectionSelected)
            {
                DeleteSectionCardButton.Background = ConvertColor.ConvertStringColorToSolidColorBrush(ColorManager.Primary800);

                SetLoadingGrid(visibility: true, progressBarVisibility: false);

                var deleteSectionWindow = new PopUpWindow($"You are about to delete {activeSection.Name}\n" +
                                                          $"Are you sure about that?",
                                                          PopUpWindow.PopUpType.DeleteSection);
                deleteSectionWindow.ShowDialog();
            }
        }
        private void DriverlessC0refCardButton_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            DriverlessC0refCardButton.Background = ConvertColor.ConvertStringColorToSolidColorBrush(ColorManager.Secondary100);

            try
            {
                DefaultsManager.GetDefault(TextManager.DriverlessC0refChannel).Value = DriverlessC0refTextBox.Text;
                DefaultsManager.SaveDefaults();
                ShowErrorMessage("Updated successfully", error: false);
            }
            catch (Exception)
            {
                ShowErrorMessage("There was an error while updating the 'driverless c0ref channel' settings", error: false, time: 5);
            }
        }
Esempio n. 28
0
        public void ChangeStatus(bool status)
        {
            this.status = status;
            ChangeStausIcon(status);

            if (isActive)
            {
                IsLiveIcon.Foreground = status ? ConvertColor.ConvertStringColorToSolidColorBrush(ColorManager.Secondary50) :
                                        ConvertColor.ConvertStringColorToSolidColorBrush(ColorManager.Primary900);
            }
            else
            {
                IsLiveIcon.Foreground = status ? ConvertColor.ConvertStringColorToSolidColorBrush(ColorManager.Secondary900) :
                                        ConvertColor.ConvertStringColorToSolidColorBrush(ColorManager.Primary900);
            }
        }
Esempio n. 29
0
        private void ChangeSelectedGroupHorizontalAxisCardButton_PreviewMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            ChangeSelectedGroupHorizontalAxisCardButton.Background = ConvertColor.ConvertStringColorToSolidColorBrush(ColorManager.Secondary100);

            Mouse.OverrideCursor = Cursors.Wait;

            string newHorizontalAxis = SelectedGroupHorizontalAxisTextBox.Text;

            if (!newHorizontalAxis.Equals(string.Empty))
            {
                GroupManager.GetGroup(ActiveGroupID).HorizontalAxis = newHorizontalAxis;
                GroupManager.SaveGroups();

                //TODO update charts
            }

            Mouse.OverrideCursor = null;
        }
Esempio n. 30
0
        } // end TypingOnlyNumber(object sender, KeyPressEventArgs e, bool includePoint, bool includeMinus)

        private void CalColor(bool previewColor)
        {
            double _L, _a, _b;

            //if (string.IsNullOrEmpty(tbxLabColorL.Text))
            //{
            //    tbxLabColorL.Text = "0";
            //}
            //if (string.IsNullOrEmpty(tbxLabColorA.Text))
            //{
            //    tbxLabColorA.Text = "0";
            //}
            //if (string.IsNullOrEmpty(tbxLabColorB.Text))
            //{
            //    tbxLabColorB.Text = "0";
            //}

            _L = double.Parse(tbxLabColorL.Text);
            _a = double.Parse(tbxLabColorA.Text);
            _b = double.Parse(tbxLabColorB.Text);

            ConvertColor cc = new ConvertColor();

            double[] rgb = new double[3];

            //Array rgb = new Array[3];

            rgb = cc.GetLabToRGB(_L, _a, _b);

            tbxRGB_R.Text = rgb[0].ToString();
            tbxRGB_G.Text = rgb[1].ToString();
            tbxRGB_B.Text = rgb[2].ToString();

            if (previewColor)
            {
                //pnlColorPreview.BackColor = Color.FromArgb(int.Parse(rgb[0].ToString()), int.Parse(rgb[1].ToString()), int.Parse(rgb[2].ToString()));
                //tdColor.BgColor = string.Format("rgb({0},{1},{2})", rgb[0].ToString(), rgb[1].ToString(), rgb[2].ToString()) ;
                //background-color: rgb(243, 255, 0);
                //tdColor.Style.ba
            }
        }