Beispiel #1
0
        private void Item_Settings_Click(object sender, RoutedEventArgs e)
        {
            Window_Settings Wsettings = new Window_Settings(DesignCanvas, data, SelectedPosition, BorderWindowSize);

            Wsettings.Owner = App.Current.MainWindow;
            Wsettings.ShowDialog();
        }
        /// <summary>
        /// Metoda wyolywana w odpowiedzi na klikniecie "ustawien"
        /// Otwiera nowe okno
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Button_Settings_OnClick(object sender, RoutedEventArgs e)
        {
            Window_Settings wdswSettings = new Window_Settings(ApplicationProfile, lcm);

            wdswSettings.ShowDialog();

            if (wdswSettings.needsSettingsUpdate)                                                                                                                                          // Jesli zaszly zmiany
            {
                this.ApplicationProfile = wdswSettings.Get_New_Settings();                                                                                                                 // Zapisujemy je do zmiennej
                Stop_Data_Aqquire       = true;                                                                                                                                            // Zmieniamy flage aby Ambi nie wysylalo danych
                channelsManagement      = new ChannelsManagement(ApplicationProfile.ChannelSettings, (int)SystemParameters.PrimaryScreenHeight, (int)SystemParameters.PrimaryScreenWidth); // Ustawienia
                Stop_Data_Aqquire       = false;                                                                                                                                           // Zmieniamy flage na nowo
            }

            if (this.ApplicationProfile.BaudRate != serialDeviceController.Baud_rate)
            {
                Stop_Data_Aqquire      = true;                                  // Upewniamy sie ze nie bedzie wysylania danych
                serialDeviceController = ApplicationProfile.LastCOMconnected == "" ? new DeviceController(ApplicationProfile.BaudRate) : new DeviceController(ApplicationProfile.BaudRate, ApplicationProfile.LastCOMconnected);
                Stop_Data_Aqquire      = false;                                 // Flaga zmieniona - kontroler COM zajmie sie sprawa nie wysylania
            }
        }
Beispiel #3
0
        private void TestTypeCall_OnMenuClick(TestType_ControlN.MenuEventType type, object sender)
        {
            Debug.WriteLine(type);
            int posTypeC = ((TestType_ControlN)sender).Position;

            switch (type)
            {
            case TestType_ControlN.MenuEventType.Up:
                if (posTypeC > 0)
                {
                    MovePage(posTypeC, posTypeC - 1);
                }
                break;

            case TestType_ControlN.MenuEventType.Down:
                if ((posTypeC + 1) < data.pages.Count)
                {
                    MovePage(posTypeC, posTypeC + 1);
                }
                break;

            case TestType_ControlN.MenuEventType.Duplicate:
                DuplicateCurrentPage(posTypeC);
                break;

            case TestType_ControlN.MenuEventType.Delete:
                if (data.pages[posTypeC].isUnlocked)
                {
                    DeletePage(posTypeC);
                }
                else
                {
                    if (MessageBox.Show(Strings.ResStrings.RemoveLockedPage, Strings.ResStrings.RemoveLockedPageTitle, MessageBoxButton.YesNo, MessageBoxImage.Warning) == MessageBoxResult.Yes)
                    {
                        DeletePage(posTypeC);
                    }
                }
                break;

            case TestType_ControlN.MenuEventType.Customize:

                Canvas          canvas    = CanvasSaveLoad.LoadSpecificCanvas(data, posTypeC);
                Window_Settings Wsettings = new Window_Settings(canvas, data, posTypeC, BorderWindowSize);
                Wsettings.Owner = this;
                Wsettings.ShowDialog();
                UpdateCanvasIcon(posTypeC);
                break;

            case TestType_ControlN.MenuEventType.MoveTo:

                DWindow_MoveTo movetoW = new DWindow_MoveTo(data.pages.Count);
                movetoW.Owner = this;
                movetoW.ShowDialog();

                if (movetoW.isOK)
                {
                    MovePage(posTypeC, movetoW.MoveTo);
                }

                break;

            case TestType_ControlN.MenuEventType.Lock:
                data.pages[posTypeC].isUnlocked = !data.pages[posTypeC].isUnlocked;
                ((TestType_ControlN)sender).UpdateLocked(!data.pages[posTypeC].isUnlocked);

                if (SelectedPosition == posTypeC)
                {
                    SetLockOnCanvas(!data.pages[posTypeC].isUnlocked);
                    LockButton.SetCheckedNoCall(!data.pages[posTypeC].isUnlocked);
                }

                break;

            case TestType_ControlN.MenuEventType.Hide:
                data.pages[posTypeC].isHidden = !data.pages[posTypeC].isHidden;
                ((TestType_ControlN)sender).UpdateHidden(data.pages[posTypeC].isHidden);

                if (SelectedPosition == posTypeC)
                {
                    HiddenPageButton.SetCheckedNoCall(data.pages[posTypeC].isHidden);
                }
                break;
            }
        }