public CollectionDataWindow(string layer, UUTViewModel uut)
 {
     InitializeComponent();
     this.layer   = layer;
     this.uut     = uut;
     this.Loaded += CollectionDataWindow_Loaded;
 }
Пример #2
0
        private void btnSave_Click(object sender, RoutedEventArgs e)
        {
            MaxCode = numericCount.IncrementText;
            if (MaxCode.ToInt32() > numericCount.MaxWidth)
            {
                MsgBox.WarningShow("超出最大数配置", "");
                return;
            }

            UUTViewModel      = new UUTViewModel();
            UUTViewModel.Code = txtCode.Text;

            IsAllLayer        = ckbAllLayer.IsChecked.GetValueOrDefault();
            IsAllTC           = ckbAllTC.IsChecked.GetValueOrDefault();
            this.DialogResult = true;
        }
Пример #3
0
        private void ViewUUTData(UUTViewModel uut)
        {
            var window = new CollectionDataWindow(Name, uut);

            window.ShowDialog();
        }
        private void AddUUT(Configs.LayerViewModel layerSource)
        {
            if (layerSource == null)
            {
                return;
            }

            var window = new UUTConfigWindow();
            var dialog = window.ShowDialog();

            if (dialog.GetValueOrDefault())
            {
                if (window.IsAllTC && window.IsAllLayer)
                {
                    int max = window.MaxCode.ToInt32();
                    foreach (var tc in TCList)
                    {
                        foreach (var layer in tc.LayerList)
                        {
                            layer.UUTList.Clear();
                            for (int i = 1; i <= max; i++)
                            {
                                var uut = new UUTViewModel {
                                    Code = i.ToString()
                                };
                                uut.Init();
                                layer.UUTList.Add(uut);
                            }
                        }
                    }
                }
                else if (window.IsAllTC == false && window.IsAllLayer)
                {
                    var tc  = getTC(layerSource);
                    int max = window.MaxCode.ToInt32();
                    if (max > 0)
                    {
                        foreach (var layer in tc.LayerList)
                        {
                            layer.UUTList.Clear();
                            for (int i = 1; i <= max; i++)
                            {
                                var uut = new UUTViewModel {
                                    Code = i.ToString()
                                };
                                uut.Init();
                                layer.UUTList.Add(uut);
                            }
                        }
                    }
                }
                else
                {
                    int max = window.MaxCode.ToInt32();
                    if (max > 0)
                    {
                        for (int i = 1; i <= max; i++)
                        {
                            var uut = new UUTViewModel {
                                Code = i.ToString()
                            };
                            uut.Init();
                            layerSource.UUTList.Add(uut);
                        }
                    }
                    else
                    {
                        layerSource.UUTList.Add(window.UUTViewModel);
                    }
                }
            }
        }