Exemplo n.º 1
0
        private void AllLoadsClicked(object sender, RoutedEventArgs e)
        {
            CheckBox  cb = sender as CheckBox;
            ViewModel vm = this.DataContext as ViewModel;

            if (cb.IsChecked ?? false)
            {
                vm.UpdateColumn();
                Loadcb.IsEnabled  = false;
                Ptb.IsEnabled     = false;
                Mxtoptb.IsEnabled = false;
                Mxbottb.IsEnabled = false;
                Mytoptb.IsEnabled = false;
                Mybottb.IsEnabled = false;
            }
            else
            {
                vm.UpdateColumn();
                Loadcb.IsEnabled  = true;
                Ptb.IsEnabled     = true;
                Mxtoptb.IsEnabled = true;
                Mxbottb.IsEnabled = true;
                Mytoptb.IsEnabled = true;
                Mybottb.IsEnabled = true;
            }
            vm.UpdateLoad();
        }
Exemplo n.º 2
0
        private void FireLoadChanged(object sender, RoutedEventArgs e)
        {
            ViewModel vm   = this.DataContext as ViewModel;
            Column    col  = vm.SelectedColumn;
            string    load = (sender as ComboBox).SelectedValue as string;

            if (load == "0.7*[selected]")
            {
                //Load fl = col.SelectedLoad.Name == "ALL LOADS" ? col.Loads[1] : col.SelectedLoad;
                Load fl = col.SelectedLoad;
                col.FireLoad = new Load()
                {
                    Name = "0.7*[selected]",
                    P    = 0.7 * fl.P,
                    MEdx = 0.7 * fl.MEdx,
                    MEdy = 0.7 * fl.MEdy,
                };
            }
            else if (load != null)
            {
                col.FireLoad = col.Loads.First(c => c.Name == load);
            }
            else
            {
                col.FireLoad = col.Loads[0];
            }
            vm.UpdateLoad();
        }
Exemplo n.º 3
0
        private void LoadSelectionChanged(object sender, RoutedEventArgs e)
        {
            ComboBox  cb    = sender as ComboBox;
            ViewModel vm    = cb.DataContext as ViewModel;
            Column    col   = vm.SelectedColumn;
            string    lname = cb.SelectedValue as string ?? col.Loads[0].Name;

            col.SelectedLoad = vm.SelectedColumn.Loads.First(l => l.Name == lname);

            if (col?.FireLoad?.Name == "0.7*[selected]")
            {
                //Load fl = col.SelectedLoad.Name == "ALL LOADS" ? col.Loads[1] : col.SelectedLoad;
                Load fl = col.SelectedLoad;
                col.FireLoad = new Load()
                {
                    Name = "0.7*[selected]",
                    P    = 0.7 * fl.P,
                    MEdx = 0.7 * fl.MEdx,
                    MEdy = 0.7 * fl.MEdy,
                };
                vm.UpdateFire();
            }

            vm.UpdateLoad();
        }
Exemplo n.º 4
0
        private void UpdateM3Bot(object sender, RoutedEventArgs e)
        {
            TextBox   tb = sender as TextBox;
            ViewModel vm = this.DataContext as ViewModel;

            try
            {
                double m = Convert.ToDouble(tb.Text);
                if (m != vm.SelectedColumn.SelectedLoad.MyBot)
                {
                    vm.SelectedColumn.SelectedLoad.MyBot = m;
                    vm.UpdateLoad();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }
Exemplo n.º 5
0
        private void UpdateP(object sender, RoutedEventArgs e)
        {
            TextBox   tb  = sender as TextBox;
            ViewModel vm  = this.DataContext as ViewModel;
            Column    col = vm.SelectedColumn;

            try
            {
                double p = Convert.ToDouble(tb.Text);
                if (p != col.SelectedLoad.P)
                {
                    col.SelectedLoad.P = p;
                    vm.UpdateLoad();
                }
            }
            catch (Exception ex)
            {
                MessageBox.Show(ex.Message);
            }
        }