using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; using static System.Runtime.InteropServices.JavaScript.JSType; using System.Numerics; using System.Windows.Markup; namespace CtrEditor.ObjetosSim { /// /// Interaction logic for ucTransporteTTop.xaml /// /// public class osTransporteTTop : osBase { private string _nombre = "Transporte TTOP"; private float frictionCoefficient; private float velMax50hz; // en metros por minuto private float tiempoRampa; private bool esMarcha; private Rectangle Data = new Rectangle(); public override float Left { get => Data.Left; set { Data.Left = value; if (_visualRepresentation != null) Canvas.SetLeft(_visualRepresentation, value); OnPropertyChanged(nameof(Left)); } } public override float Top { get => Data.Top; set { Data.Top = value; if (_visualRepresentation != null) Canvas.SetTop(_visualRepresentation, value); OnPropertyChanged(nameof(Top)); } } public float Ancho { get => Data.Width; set { Data.Width = value; OnPropertyChanged(nameof(Ancho)); } } public float Alto { get => Data.Height; set { Data.Height = value; OnPropertyChanged(nameof(Alto)); } } public float Angulo { get => Data.Angle; set { Data.Angle = value; OnPropertyChanged(nameof(Angulo)); } } public float VelocidadActual { get => Data.Speed; set { Data.Speed = value; OnPropertyChanged(nameof(VelocidadActual)); } } public float FrictionCoefficient { get => frictionCoefficient; set => frictionCoefficient = value; } public float VelMax50hz { get => velMax50hz; set => velMax50hz = value; } public float TiempoRampa { get => tiempoRampa; set => tiempoRampa = value; } public bool EsMarcha { get => esMarcha; set => esMarcha = value; } public osTransporteTTop() { Ancho = 100; Alto = 10; } public override void ConnectSimManager(SimulationManager simulationManager) { simulationManager.rectangles.Add(Data); } public override void UpdateControl() { } } public partial class ucTransporteTTop : UserControl, IDataContainer { public osBase? Datos { get; set; } public ucTransporteTTop() { InitializeComponent(); } public void Resize(float width, float height) { if (Datos is osTransporteTTop datos) datos.Ancho = width; } public void Move(float Left, float Top) { if (Datos != null) { Datos.Left = Left; Datos.Top = Top; } } public void Rotate(float Angle) { if (Datos != null) if (Datos is osTransporteTTop datos) datos.Angulo = Angle; } public void Highlight(bool State) { } } }