Exemple #1
0
        public static Grid FixtureWithNoLabel(FixtureClass fixtureClass)
        {
            Grid grid = new Grid();

            grid.Margin = new Thickness(1, 1, 1, 1);

            RowDefinition rowdef = new RowDefinition();

            rowdef.Height = new GridLength(1, GridUnitType.Star);
            grid.RowDefinitions.Add(rowdef);

            rowdef        = new RowDefinition();
            rowdef.Height = GridLength.Auto;
            grid.RowDefinitions.Add(rowdef);

            Image image = new Image();

            image.Style  = (Style)ResourceLocator.FindResource("ImageStyle");
            image.Source = TwGui.GetImage(fixtureClass.ImageFilename);

            Border border = new Border();

            border.Style      = (Style)ResourceLocator.FindResource("FixtureBorderStyle");
            border.Background = TwBrushes.FrozenSolidColorBrush(fixtureClass.Color);
            border.Child      = image;

            Grid.SetRow(border, 1);
            grid.Children.Add(border);

            grid.ToolTip = fixtureClass.FriendlyName;

            return(grid);
        }
Exemple #2
0
        void WriteHorizontalSeparator(int row)
        {
            Border border = new Border();

            border.Style = (Style)ResourceLocator.FindResource("HorizontalSeparatorStyle");
            Grid.SetRow(border, row++);
            Grid.SetColumn(border, 0);
            Grid.SetColumnSpan(border, this.ColumnDefinitions.Count);
            this.Children.Add(border);
        }
        void InitializeHeader()
        {
            FixtureProfileHeader.AllowDrop = true;
            FixtureProfileHeader.Drop     += new DragEventHandler(DragDrop);

            FixtureProfileHeader.Button.Focusable  = false;
            FixtureProfileHeader.Button.IsTabStop  = false;
            FixtureProfileHeader.Button.Visibility = Visibility.Collapsed;
            FixtureProfileHeader.FixtureClassSelector.Visibility = Visibility.Collapsed;
            FixtureProfileHeader.MinVolume.Visibility            = Visibility.Hidden;
            FixtureProfileHeader.MaxVolume.Visibility            = Visibility.Hidden;
            FixtureProfileHeader.BorderVolume.Visibility         = Visibility.Collapsed;
            FixtureProfileHeader.MinPeak.Visibility     = Visibility.Hidden;
            FixtureProfileHeader.MaxPeak.Visibility     = Visibility.Hidden;
            FixtureProfileHeader.BorderPeak.Visibility  = Visibility.Collapsed;
            FixtureProfileHeader.MinMode.Visibility     = Visibility.Hidden;
            FixtureProfileHeader.MaxMode.Visibility     = Visibility.Hidden;
            FixtureProfileHeader.BorderMode.Visibility  = Visibility.Collapsed;
            FixtureProfileHeader.MinDuration.Visibility = Visibility.Hidden;
            FixtureProfileHeader.MaxDuration.Visibility = Visibility.Hidden;

            var textBlock = new TextBlock();

            textBlock.HorizontalAlignment = HorizontalAlignment.Center;
            textBlock.Style = (Style)ResourceLocator.FindResource("LabelStyle");
            Grid.SetColumn(textBlock, 2);
            Grid.SetColumnSpan(textBlock, 2);
            FixtureProfileHeader.Grid.Children.Add(textBlock);
            textBlock.Text = "Volume";

            textBlock = new TextBlock();
            textBlock.HorizontalAlignment = HorizontalAlignment.Center;
            textBlock.Style = (Style)ResourceLocator.FindResource("LabelStyle");
            Grid.SetColumn(textBlock, 5);
            Grid.SetColumnSpan(textBlock, 2);
            FixtureProfileHeader.Grid.Children.Add(textBlock);
            textBlock.Text = "Peak";

            textBlock = new TextBlock();
            textBlock.HorizontalAlignment = HorizontalAlignment.Center;
            textBlock.Style = (Style)ResourceLocator.FindResource("LabelStyle");
            Grid.SetColumn(textBlock, 8);
            Grid.SetColumnSpan(textBlock, 2);
            FixtureProfileHeader.Grid.Children.Add(textBlock);
            textBlock.Text = "Mode";

            textBlock = new TextBlock();
            textBlock.HorizontalAlignment = HorizontalAlignment.Center;
            textBlock.Style = (Style)ResourceLocator.FindResource("LabelStyle");
            Grid.SetColumn(textBlock, 11);
            Grid.SetColumnSpan(textBlock, 2);
            FixtureProfileHeader.Grid.Children.Add(textBlock);
            textBlock.Text = "Duration";
        }
 public void Initialize()
 {
     Image.Source          = TwGui.GetImage(FixtureClass.ImageFilename);
     this.Content          = Image;
     this.Tag              = FixtureClass;
     this.Background       = TwBrushes.FrozenSolidColorBrush(FixtureClass.Color);
     this.Style            = (Style)ResourceLocator.FindResource(FixtureClass.LowFrequency ? "ToolBarFixtureLowFrequencyButtonStyle" : "ToolBarFixtureButtonStyle");
     this.ToolTip          = "Classify as " + FixtureClass.FriendlyName + " (" + FixtureClass.Character + ")";
     this.ContextMenu      = FixtureButtonContextMenu();
     this.CommandParameter = FixtureClass;
 }
Exemple #5
0
        void WriteHorizontalSeparator(int row, double margin)
        {
            Border border = new Border();

            border.Style       = (Style)ResourceLocator.FindResource("HorizontalSeparatorStyle");
            border.BorderBrush = Brushes.LightGray;
            border.Margin      = new Thickness(0, margin, 0, 0);
            Grid.SetRow(border, row++);
            Grid.SetColumn(border, 0);
            Grid.SetColumnSpan(border, grid.ColumnDefinitions.Count);
            grid.Children.Add(border);
        }
Exemple #6
0
        public static Border FixtureImage(FixtureClass fixtureClass)
        {
            Image image = new Image();

            image.Style  = (Style)ResourceLocator.FindResource("ImageStyle");
            image.Source = TwGui.GetImage(fixtureClass.ImageFilename);

            Border border = new Border();

            border.Style      = (Style)ResourceLocator.FindResource("FixtureBorderStyle");
            border.Background = TwSingletonBrushes.Instance.FrozenSolidColorBrush(fixtureClass.Color);
            border.Child      = image;

            return(border);
        }
Exemple #7
0
        public static Grid FixtureWithImageLeftMenu(FixtureClass fixtureClass)
        {
            Grid grid = new Grid();

            grid.Margin = new Thickness(1, 0, 1, 0);

            grid.Tag = fixtureClass;

            ColumnDefinition columnDefinition = new ColumnDefinition();

            columnDefinition.Width = GridLength.Auto;
            grid.ColumnDefinitions.Add(columnDefinition);

            columnDefinition       = new ColumnDefinition();
            columnDefinition.Width = new GridLength(1, GridUnitType.Star);
            grid.ColumnDefinitions.Add(columnDefinition);

            Image image = new Image();

            image.Style  = (Style)ResourceLocator.FindResource("ImageStyle");
            image.Source = TwGui.GetImage(fixtureClass.ImageFilename);

            Border border = new Border();

            border.Style      = (Style)ResourceLocator.FindResource("FixtureBorderStyle");
            border.Background = TwBrushes.FrozenSolidColorBrush(fixtureClass.Color);
            border.Child      = image;

            Grid.SetColumn(border, 0);
            grid.Children.Add(border);

            var label = new Label();

            label.Content             = fixtureClass.LabelName;
            label.FontWeight          = FontWeights.Normal;
            label.HorizontalAlignment = HorizontalAlignment.Left;
            label.VerticalAlignment   = VerticalAlignment.Top;
            label.Padding             = new Thickness(1, 0, 1, 0);
            label.Margin = new Thickness(5, 0, 5, 0);

            Grid.SetColumn(label, 1);
            grid.Children.Add(label);

            return(grid);
        }
Exemple #8
0
        public static Grid FixtureWithImageRight(FixtureClass fixtureClass)
        {
            Grid grid = new Grid();

            grid.Margin = new Thickness(1, 1, 1, 1);

            var coldefImage = new ColumnDefinition();

            coldefImage.Width = new GridLength(1, GridUnitType.Star);
            grid.ColumnDefinitions.Add(coldefImage);

            var coldefText = new ColumnDefinition();

            coldefText.Width = GridLength.Auto;
            grid.ColumnDefinitions.Add(coldefText);

            Image image = new Image();

            image.Style  = (Style)ResourceLocator.FindResource("ImageStyle");
            image.Source = TwGui.GetImage(fixtureClass.ImageFilename);

            Border border = new Border();

            border.Style      = (Style)ResourceLocator.FindResource("FixtureBorderStyle");
            border.Background = TwBrushes.FrozenSolidColorBrush(fixtureClass.Color);
            border.Child      = image;

            Grid.SetColumn(border, 1);
            grid.Children.Add(border);

            TextBlock textBlock = new TextBlock();

            textBlock.Text                = fixtureClass.FriendlyName;
            textBlock.Margin              = new Thickness(0, 0, 6, 0);
            textBlock.TextAlignment       = TextAlignment.Right;
            textBlock.HorizontalAlignment = HorizontalAlignment.Right;
            textBlock.VerticalAlignment   = VerticalAlignment.Center;

            Grid.SetColumn(textBlock, 0);
            grid.Children.Add(textBlock);

            return(grid);
        }
Exemple #9
0
        public StyledFixtureLabel(FixtureClass fixtureClass, FontWeight fontWeight, bool showKey, bool manuallyClassified, bool firstCycle, bool firstCycleManuallyClassified, bool showFriendlyName, bool singleRow, bool showHasNotes)
        {
            this.Focusable = false;
            this.IsTabStop = false;

            this.InputBindings.Add(new MouseBinding(AnalysisPanel.BringSelectedEventIntoViewCommand, new MouseGesture(MouseAction.LeftDoubleClick, ModifierKeys.None)));

            FixtureClass = fixtureClass;

            Grid grid = new Grid();

            ColumnDefinition coldefText = new ColumnDefinition();

            coldefText.Width = GridLength.Auto;
            grid.ColumnDefinitions.Add(coldefText);

            ColumnDefinition coldefImage = new ColumnDefinition();

            coldefImage.Width = new GridLength(1, GridUnitType.Star);
            grid.ColumnDefinitions.Add(coldefImage);

            Image image = new Image();

            image.Style  = (Style)ResourceLocator.FindResource("ImageStyle");
            image.Source = TwGui.GetImage(fixtureClass.ImageFilename);

            Border border = new Border();

            border.Style             = (Style)ResourceLocator.FindResource("FixtureBorderStyle");
            border.Background        = TwBrushes.FrozenSolidColorBrush(fixtureClass.Color);
            border.VerticalAlignment = VerticalAlignment.Top;
            border.Child             = image;

            Grid.SetColumn(border, 0);
            grid.Children.Add(border);

            var stackPanel = new StackPanel();

            var label = new TextBlock();

            var name = showFriendlyName ? fixtureClass.FriendlyName : fixtureClass.ShortName;

            if (showKey)
            {
                label.Text = name + " (" + fixtureClass.Character + ")";
            }
            else
            {
                label.Text = name;
            }

            if (singleRow)
            {
                grid.ToolTip = "Selected Event is " + fixtureClass.FriendlyName;
            }

            if (manuallyClassified)
            {
                label.Text += "*";
                if (singleRow)
                {
                    grid.ToolTip += "\r\n* = Manually classified";
                }
            }

            label.Margin              = new Thickness(6, 0, 0, 0);
            label.FontWeight          = fontWeight;
            label.HorizontalAlignment = HorizontalAlignment.Left;
            label.VerticalAlignment   = VerticalAlignment.Center;

            stackPanel.Children.Add(label);

            if (firstCycle)
            {
                label                     = new TextBlock();
                label.Text                = "(1st Cycle)";
                label.Margin              = new Thickness(6, 0, 0, 0);
                label.FontWeight          = fontWeight;
                label.HorizontalAlignment = HorizontalAlignment.Left;
                label.VerticalAlignment   = VerticalAlignment.Center;
                stackPanel.Children.Add(label);

                if (singleRow)
                {
                    stackPanel.Orientation = Orientation.Horizontal;
                    label.Text             = "1";
                    if (singleRow)
                    {
                        grid.ToolTip += "\r\n1 = 1st Cycle";
                    }
                }

                if (firstCycleManuallyClassified)
                {
                    label.Text += "*";
                }
            }

            if (showHasNotes)
            {
                label                     = new TextBlock();
                label.Text                = "Notes";
                label.Margin              = new Thickness(6, 0, 0, 0);
                label.FontWeight          = fontWeight;
                label.HorizontalAlignment = HorizontalAlignment.Left;
                label.VerticalAlignment   = VerticalAlignment.Center;
                stackPanel.Children.Add(label);

                if (singleRow)
                {
                    stackPanel.Orientation = Orientation.Horizontal;
                    label.Text             = "N";
                    grid.ToolTip          += "\r\nN = Has User Notes";
                }
            }

            Grid.SetColumn(stackPanel, 1);
            grid.Children.Add(stackPanel);

            this.Content = grid;
        }
Exemple #10
0
        public StyledFixtureLabel(Event @event, bool showFriendlyName, bool activateCommand)
        {
            this.Focusable = false;
            this.IsTabStop = false;

            if (activateCommand)
            {
                this.InputBindings.Add(new MouseBinding(AnalysisPanel.BringSelectedEventIntoViewCommand, new MouseGesture(MouseAction.LeftDoubleClick, ModifierKeys.None)));
            }

            FixtureClass = @event.FixtureClass;

            this.ToolTip = BuildToolTip(@event);

            var panel = new StackPanel();

            panel.Orientation = Orientation.Horizontal;


            var panelTicks = new StackPanel();

            {
                var tick = new ClassificationTick();
                tick.Padding           = new Thickness(0, 1, 4, 1);
                tick.VerticalAlignment = VerticalAlignment.Center;

                if (@event.ManuallyClassified)
                {
                    tick.TickClassifiedUsingFixtureList.Visibility     = Visibility.Collapsed;
                    tick.TickClassifiedUsingMachineLearning.Visibility = Visibility.Collapsed;
                }
                else if (@event.ClassifiedUsingFixtureList)
                {
                    tick.TickManuallyClassified.Visibility             = Visibility.Collapsed;
                    tick.TickClassifiedUsingMachineLearning.Visibility = Visibility.Collapsed;
                }
                else
                {
                    tick.TickManuallyClassified.Visibility         = Visibility.Collapsed;
                    tick.TickClassifiedUsingFixtureList.Visibility = Visibility.Collapsed;
                }
                panelTicks.Children.Add(tick);
            }

            if (@event.ManuallyApproved)
            {
                var tick = new ApprovalTick();
                tick.Padding           = new Thickness(0, 1, 4, 1);
                tick.VerticalAlignment = VerticalAlignment.Center;
                panelTicks.Children.Add(tick);
            }

            panel.Children.Add(panelTicks);

            Image image = new Image();

            image.Style  = (Style)ResourceLocator.FindResource("ImageStyle");
            image.Source = TwGui.GetImage(@event.FixtureClass.ImageFilename);

            Border border = new Border();

            border.Margin            = new Thickness(3, 0, 0, 0);
            border.Style             = (Style)ResourceLocator.FindResource("FixtureBorderStyle");
            border.Background        = TwBrushes.FrozenSolidColorBrush(@event.FixtureClass.Color);
            border.VerticalAlignment = VerticalAlignment.Top;
            border.Child             = image;
            panel.Children.Add(border);

            var label = new TextBlock();

            label.Text    = showFriendlyName ? @event.FixtureClass.FriendlyName : @event.FixtureClass.ShortName;
            label.Padding = new Thickness(3, 0, 0, 0);
            panel.Children.Add(label);

            if (@event.FirstCycle)
            {
                label                = new TextBlock();
                label.FontSize       = 8;
                label.BaselineOffset = 10;
                label.Text           = "1";
                if ([email protected])
                {
                    label.FontStyle = FontStyles.Italic;
                }
                label.Padding = new Thickness(3, 0, 0, 0);
                panel.Children.Add(label);
            }
            else if (@event.ManuallyClassifiedFirstCycle)
            {
                label                = new TextBlock();
                label.FontSize       = 8;
                label.BaselineOffset = 10;
                label.Text           = "0";
                label.Padding        = new Thickness(3, 0, 0, 0);
                panel.Children.Add(label);
            }

            //if (!string.IsNullOrEmpty(@event.UserNotes)) {
            //    label = new TextBlock();
            //    label.Padding = new Thickness(3, 0, 0, 0);
            //    label.Text = "N";
            //    panel.Children.Add(label);
            //}

            this.Content = panel;
        }