示例#1
0
        public MainWindow()
        {
            InitializeComponent();

            WindowState = WindowState.Maximized;

            // Assume the screen size won't change after the app starts.
            var xScreen = SystemParameters.PrimaryScreenWidth;
            var yScreen = SystemParameters.PrimaryScreenHeight;

            RobotArm = new RobotArm(
                xScreen / 2.0,
                yScreen / 2.0,
                Math.Min(xScreen, yScreen) / 2.0,
                Settings1.Default.RobotType == "Swift" ? ((IArm) new UArmSwiftPro()) : ((IArm) new UArmMetal()));

            _settings   = new Settings(RobotArm);
            DataContext = _settings;

            Background = new SolidColorBrush(_settings.BackgroundColor);

            if (_settings.RobotControl)
            {
                RobotArm.Connect();
                RobotArm.ArmDown(false); // Lift the arm.
            }

            SetDrawingAttributesFromSettings(inkCanvas.DefaultDrawingAttributes);

            LoadInkOnStartup();
        }
示例#2
0
        public MainWindow()
        {
            InitializeComponent();

            WindowState = WindowState.Maximized;

            // Assume the screen size won't change after the app starts.
            var xScreen = SystemParameters.PrimaryScreenWidth;
            var yScreen = SystemParameters.PrimaryScreenHeight;

            RobotArm = new RobotArm(
                xScreen / 2.0,
                yScreen / 2.0,
                Math.Min(xScreen, yScreen) / 2.0,
                Settings1.Default.RobotType == "Swift" ? ((IArm) new UArmSwiftPro()) : ((IArm) new UArmMetal()));

            _settings   = new Settings(RobotArm);
            DataContext = _settings;

            Background = new SolidColorBrush(_settings.BackgroundColor);

            if (_settings.RobotControl)
            {
                RobotArm.Connect();
                RobotArm.ArmDown(false); // Lift the arm.
            }

            SetDrawingAttributesFromSettings(inkCanvas.DefaultDrawingAttributes);

            LoadInkOnStartup();

            this.SetDrawingZoneRectangle(0);                 // set the init drawing zone rectangle
            this.areaText.Visibility = Visibility.Collapsed; // init as collapsed
            this.Create_SaveFile_Directory();                // init the save file directory in the AppX folder
        }