aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/MachineStudio/Tango.MachineStudio.UI/Console/ConsoleManager.cs
blob: e2d525d95979fefa00cf5a240be834f1cdcb4b86 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tango.Core.DI;
using Tango.MachineStudio.Common.Modules;

namespace Tango.MachineStudio.UI.Console
{
    public class ConsoleManager
    {
        public TangoIOC TangoIOC { get; set; }
        private Action<String> _writeLine;

        public ConsoleManager(Action<String> writeLine)
        {
            _writeLine = writeLine;
            TangoIOC = TangoIOC.Default;
        }

        public void WriteLine(String text)
        {
            _writeLine(text);
        }

        public void InvokeUI(Action action)
        {
            Core.Helpers.ThreadsHelper.InvokeUI(action);
        }

        public void StartModule(String name)
        {
            IStudioModuleLoader loader = TangoIOC.Default.GetInstance<IStudioModuleLoader>();
            var module = loader.AllModules.SingleOrDefault(x => x.Name == name);
            TangoIOC.Default.GetInstance<ViewModels.MainViewVM>().StartModule(module);
        }
    }
}
e" IsExpanded="True" FontSize="{StaticResource TangoExpanderHeaderFontSize}"> <controls:TableGrid Margin="10" RowHeight="70" MakeFirstColumnVerticalAlignmentBottom="False" TextElement.FontSize="{StaticResource TangoDefaultFontSize}"> <TextBlock VerticalAlignment="Center">Enable External Bridge Service</TextBlock> <touch:TouchToggleSlider Style="{StaticResource TangoToggleButtonGrayAccent}" HorizontalAlignment="Right" Margin="0 0 110 0" Width="90" IsChecked="{Binding Machine.EnableExternalBridge}"></touch:TouchToggleSlider> <TextBlock VerticalAlignment="Bottom">External Bridge Password</TextBlock> <touch:TouchTextBox IsPassword="True" HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="200" Text="{Binding Machine.ExternalBridgePassword}" KeyboardContainer="{Binding ElementName=Container}"></touch:TouchTextBox> </controls:TableGrid> </touch:TouchExpander> <!--JOBS--> <touch:TouchExpander Margin="0 20 0 0" Header="JOBS" IsExpanded="True" FontSize="{StaticResource TangoExpanderHeaderFontSize}"> <controls:TableGrid Margin="10" RowHeight="70" MakeFirstColumnVerticalAlignmentBottom="False" TextElement.FontSize="{StaticResource TangoDefaultFontSize}"> <TextBlock VerticalAlignment="Center">Supported Job Types</TextBlock> <ItemsControl ItemsSource="{Binding SelectedJobTypes}"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <WrapPanel IsItemsHost="True" Orientation="Horizontal" /> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> <ItemsControl.ItemTemplate> <DataTemplate> <touch:TouchToggleButton IsChecked="{Binding IsSelected}" Content="{Binding Data}" CornerRadius="5" CheckedContent="{Binding Data}" Padding="10" Margin="5"> <touch:TouchToggleButton.Style> <Style TargetType="touch:TouchToggleButton"> <Setter Property="Background" Value="{StaticResource TangoGrayBrush}"></Setter> <Style.Triggers> <Trigger Property="IsChecked" Value="True"> <Setter Property="Background" Value="{StaticResource TangoMidAccentBrush}"></Setter> </Trigger> </Style.Triggers> </Style> </touch:TouchToggleButton.Style> </touch:TouchToggleButton> </DataTemplate> </ItemsControl.ItemTemplate> </ItemsControl> <TextBlock VerticalAlignment="Bottom">Default Media</TextBlock> <touch:TouchComboBox HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="200" ItemsSource="{Binding Adapter.Rmls}" SelectedItem="{Binding Machine.DefaultRml}" DisplayMemberPath="Name"></touch:TouchComboBox> <TextBlock VerticalAlignment="Bottom">Default Color Space/Catalog</TextBlock> <touch:TouchComboBox HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="200" ItemsSource="{Binding Adapter.ColorSpaces}" SelectedItem="{Binding Machine.DefaultColorSpace}" DisplayMemberPath="Name"></touch:TouchComboBox> <TextBlock VerticalAlignment="Bottom">Default Spool</TextBlock> <touch:TouchComboBox HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="200" ItemsSource="{Binding Adapter.SpoolTypes}" SelectedItem="{Binding Machine.DefaultSpoolType}" DisplayMemberPath="Name"></touch:TouchComboBox> <TextBlock VerticalAlignment="Bottom">Default Segment Length</TextBlock> <touch:TouchNumericTextBox HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="200" Minimum="1" Maximum="1000" Value="{Binding Machine.DefaultSegmentLength}" HasDecimalPoint="True" KeyboardContainer="{Binding ElementName=Container}"></touch:TouchNumericTextBox> </controls:TableGrid> </touch:TouchExpander> </StackPanel> </touch:LightTouchScrollViewer> </Grid> </Grid> </DockPanel> </Grid> </Grid> </UserControl>