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; namespace CtrEditor.ObjetosSim { /// /// Interaction logic for ucTransporteGuias.xaml /// public class osTransporteGuias : osBase { private string _nombre = "Transporte Guias"; private float frictionCoefficient; private float velMax50hz; // en metros por minuto private float tiempoRampa; private bool esMarcha; private Rectangle Geometria = new Rectangle(); public override float Left { get => Geometria.Left; set { Geometria.Left = value; CanvasSetLeftinMeter(value); OnPropertyChanged(nameof(Left)); } } public override float Top { get => Geometria.Top; set { Geometria.Top = value; CanvasSetTopinMeter(value); OnPropertyChanged(nameof(Top)); } } public float Ancho { get => Geometria.Length; set { Geometria.Length = value; OnPropertyChanged(nameof(Ancho)); } } public float Alto { get => Geometria.Width; set { Geometria.Width = value; OnPropertyChanged(nameof(Alto)); } } public float Angulo { get => Geometria.Angle; set { Geometria.Angle = value; OnPropertyChanged(nameof(Angulo)); } } public float VelocidadActual { get => Geometria.Speed; set { Geometria.Speed = value; OnPropertyChanged(nameof(VelocidadActual)); } } public override string Nombre { get => _nombre; set { if (_nombre != value) { _nombre = value; OnPropertyChanged(nameof(Nombre)); } } } 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 osTransporteGuias() { Ancho = 1; Alto = 0.10f; } public override void ConnectSimManager(SimulationManager simulationManager) { simulationManager.rectangles.Add(Geometria); } public override void UpdateControl() { } } public partial class ucTransporteGuias : UserControl, IDataContainer { public osBase? Datos { get; set; } public ucTransporteGuias() { InitializeComponent(); } public void Resize(float width, float height) { if (Datos is osTransporteGuias datos) datos.Ancho = PixelToMeter.Instance.calc.PixelsToMeters(width); } public void Move(float LeftPixels, float TopPixels) { if (Datos != null) { Datos.Left = PixelToMeter.Instance.calc.PixelsToMeters(LeftPixels); Datos.Top = PixelToMeter.Instance.calc.PixelsToMeters(TopPixels); } } public void Rotate(float Angle) { if (Datos != null) if (Datos is osTransporteGuias datos) datos.Angulo = Angle; } public void Highlight(bool State) { } public int ZIndex() { return 1; } } }