Exemple #1
0
        public List <Vehiculo> ObtenerVehiculos()
        {
            SqlConnection   con       = null;
            List <Vehiculo> vehiculos = new List <Vehiculo>();

            try
            {
                con = new Conexion().ConexionBD();
                SqlCommand cmd = new SqlCommand("spObtenerVehiculos", con);
                cmd.CommandType = CommandType.StoredProcedure;
                SqlDataReader dr = cmd.ExecuteReader();
                if (dr.Read())
                {
                    //vehiculos = DataReaderMapToList<Vehiculo>(dr);
                    while (dr.Read())
                    {
                        ExObject user = new ExObject();
                        user.Identificador = (Decimal)dr["Identificador"];
                        user.Descripcion   = (String)dr["Descripcion"];
                        vehiculos.Add(user);
                    }
                }
            }
            catch (Exception ex)
            {
                vehiculos = null;
                throw ex;
            }
            finally { con.Close(); }
            return(vehiculos);
        }
Exemple #2
0
        private void GenNet_Click(object sender, RoutedEventArgs e)
        {
            Solve.IsEnabled = true;

            double width   = WidthSlider.Value;
            double lenght  = LenghtSlider.Value;
            double height  = HeightSlider.Value;
            int    wS      = int.Parse(WidthSlices.Text);
            int    lS      = int.Parse(LenghtSlices.Text);
            int    hS      = int.Parse(HeightSlices.Text);
            double force   = PressureSlider.Value;
            int    T       = PressureComboBox.SelectedIndex;
            double Pausson = Double.Parse(Puasson.Text);

            obj         = new ExObject(width, lenght, height, wS, lS, hS, Pausson, force, T);
            DataContext = new ExObjectView(obj);

            NQP.Text = "Nodes quantity: " + obj.AKT.Count;
            NEL.Text = "Finite elements quantity: " + obj.nel;
        }
Exemple #3
0
        public ExObjectView(ExObject obj)
        {
            InitializeComponent();

            RotateTransform3D myRotateTransform = new RotateTransform3D(new AxisAngleRotation3D(new Vector3D(1, 0, 1), 180));

            Vector3DAnimation myVectorAnimation = new Vector3DAnimation(new Vector3D(0, 0, 0.5), new Duration(TimeSpan.FromSeconds(40)));

            myVectorAnimation.AccelerationRatio = 0.1;
            myVectorAnimation.DecelerationRatio = 0.1;
            myVectorAnimation.RepeatBehavior    = RepeatBehavior.Forever;

            myRotateTransform.Rotation.BeginAnimation(AxisAngleRotation3D.AxisProperty, myVectorAnimation);

            objTransformGroup.Children.Add(myRotateTransform);

            foreach (var node in obj.AKT)
            {
                double       width   = (node.IsIntermediate) ? 0.05 : 0.1;
                byte         opacity = (node.IsIntermediate) ? (byte)100 : (byte)255;
                Model3DGroup cube    = GetCubeMode(node.X - (obj.Width / 2), (node.Z - (obj.Height / 2)) * (-1), node.Y - (obj.Length / 2), width, Color.FromArgb(opacity, 55, 200, 0));
                objGroup.Children.Add(cube);
            }
        }
 public InterpreterVisitor(Environment environment, ExObject hostObject)
 {
     env = environment;
     obj = hostObject;
 }