2024-05-02 11:06:45 -03:00
|
|
|
|
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;
|
2024-05-04 15:35:06 -03:00
|
|
|
|
using static System.Runtime.InteropServices.JavaScript.JSType;
|
2024-05-06 12:31:45 -03:00
|
|
|
|
using System.Numerics;
|
|
|
|
|
using System.Windows.Markup;
|
2024-05-02 11:06:45 -03:00
|
|
|
|
|
2024-05-04 06:00:52 -03:00
|
|
|
|
namespace CtrEditor.ObjetosSim
|
2024-05-02 11:06:45 -03:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
2024-05-04 06:00:52 -03:00
|
|
|
|
/// Interaction logic for ucTransporteTTop.xaml
|
2024-05-02 11:06:45 -03:00
|
|
|
|
/// </summary>
|
2024-05-04 06:00:52 -03:00
|
|
|
|
///
|
|
|
|
|
|
|
|
|
|
public class osTransporteTTop : osBase
|
2024-05-02 11:06:45 -03:00
|
|
|
|
{
|
2024-05-04 15:35:06 -03:00
|
|
|
|
private string _nombre = "Transporte TTOP";
|
|
|
|
|
|
2024-05-06 12:31:45 -03:00
|
|
|
|
private float frictionCoefficient;
|
|
|
|
|
private float velMax50hz; // en metros por minuto
|
|
|
|
|
private float tiempoRampa;
|
|
|
|
|
private bool esMarcha;
|
2024-05-04 15:35:06 -03:00
|
|
|
|
|
2024-05-08 08:41:26 -03:00
|
|
|
|
private Rectangle Geometria = new Rectangle();
|
2024-05-06 12:31:45 -03:00
|
|
|
|
|
|
|
|
|
public override float Left
|
|
|
|
|
{
|
2024-05-08 08:41:26 -03:00
|
|
|
|
get => Geometria.Left;
|
2024-05-06 12:31:45 -03:00
|
|
|
|
set
|
|
|
|
|
{
|
2024-05-08 08:41:26 -03:00
|
|
|
|
Geometria.Left = value;
|
|
|
|
|
CanvasSetLeftinMeter(value);
|
2024-05-06 12:31:45 -03:00
|
|
|
|
OnPropertyChanged(nameof(Left));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
public override float Top
|
|
|
|
|
{
|
2024-05-08 08:41:26 -03:00
|
|
|
|
get => Geometria.Top;
|
2024-05-04 15:35:06 -03:00
|
|
|
|
set
|
|
|
|
|
{
|
2024-05-08 08:41:26 -03:00
|
|
|
|
Geometria.Top = value;
|
|
|
|
|
CanvasSetTopinMeter(value);
|
2024-05-06 12:31:45 -03:00
|
|
|
|
OnPropertyChanged(nameof(Top));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public float Ancho {
|
2024-05-08 08:41:26 -03:00
|
|
|
|
get => Geometria.Length;
|
2024-05-06 12:31:45 -03:00
|
|
|
|
set
|
|
|
|
|
{
|
2024-05-08 08:41:26 -03:00
|
|
|
|
Geometria.Length = value;
|
2024-05-04 15:35:06 -03:00
|
|
|
|
OnPropertyChanged(nameof(Ancho));
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-05-06 12:31:45 -03:00
|
|
|
|
public float Alto {
|
2024-05-08 08:41:26 -03:00
|
|
|
|
get => Geometria.Width;
|
2024-05-04 15:35:06 -03:00
|
|
|
|
set
|
|
|
|
|
{
|
2024-05-08 08:41:26 -03:00
|
|
|
|
Geometria.Width = value;
|
2024-05-04 15:35:06 -03:00
|
|
|
|
OnPropertyChanged(nameof(Alto));
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-05-08 03:00:31 -03:00
|
|
|
|
|
2024-05-06 12:31:45 -03:00
|
|
|
|
public float Angulo
|
2024-05-04 15:35:06 -03:00
|
|
|
|
{
|
2024-05-08 08:41:26 -03:00
|
|
|
|
get => Geometria.Angle;
|
2024-05-04 15:35:06 -03:00
|
|
|
|
set
|
|
|
|
|
{
|
2024-05-08 08:41:26 -03:00
|
|
|
|
Geometria.Angle = value;
|
2024-05-04 15:35:06 -03:00
|
|
|
|
OnPropertyChanged(nameof(Angulo));
|
|
|
|
|
}
|
|
|
|
|
}
|
2024-05-06 12:31:45 -03:00
|
|
|
|
public float VelocidadActual
|
|
|
|
|
{
|
2024-05-08 08:41:26 -03:00
|
|
|
|
get => Geometria.Speed;
|
2024-05-06 12:31:45 -03:00
|
|
|
|
set {
|
2024-05-08 08:41:26 -03:00
|
|
|
|
Geometria.Speed = value;
|
2024-05-06 12:31:45 -03:00
|
|
|
|
OnPropertyChanged(nameof(VelocidadActual));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-08 03:00:31 -03:00
|
|
|
|
public override string Nombre
|
|
|
|
|
{
|
|
|
|
|
get => _nombre;
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (_nombre != value)
|
|
|
|
|
{
|
|
|
|
|
_nombre = value;
|
|
|
|
|
OnPropertyChanged(nameof(Nombre));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-06 12:31:45 -03:00
|
|
|
|
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; }
|
2024-05-04 15:35:06 -03:00
|
|
|
|
|
|
|
|
|
public osTransporteTTop()
|
|
|
|
|
{
|
2024-05-08 08:41:26 -03:00
|
|
|
|
Ancho = 1;
|
|
|
|
|
Alto = 0.10f;
|
2024-05-04 15:35:06 -03:00
|
|
|
|
}
|
2024-05-04 06:00:52 -03:00
|
|
|
|
|
2024-05-06 12:31:45 -03:00
|
|
|
|
public override void ConnectSimManager(SimulationManager simulationManager)
|
|
|
|
|
{
|
2024-05-08 08:41:26 -03:00
|
|
|
|
simulationManager.rectangles.Add(Geometria);
|
2024-05-06 12:31:45 -03:00
|
|
|
|
}
|
2024-05-10 20:40:51 -03:00
|
|
|
|
public override void UpdateGeometry()
|
|
|
|
|
{
|
|
|
|
|
// Se llama antes de la simulacion
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-06 12:31:45 -03:00
|
|
|
|
public override void UpdateControl()
|
2024-05-03 05:13:25 -03:00
|
|
|
|
{
|
|
|
|
|
}
|
2024-05-06 12:31:45 -03:00
|
|
|
|
|
2024-05-02 11:06:45 -03:00
|
|
|
|
}
|
2024-05-03 03:58:21 -03:00
|
|
|
|
|
2024-05-04 15:35:06 -03:00
|
|
|
|
public partial class ucTransporteTTop : UserControl, IDataContainer
|
2024-05-04 06:00:52 -03:00
|
|
|
|
{
|
2024-05-04 15:35:06 -03:00
|
|
|
|
public osBase? Datos { get; set; }
|
|
|
|
|
|
2024-05-04 06:00:52 -03:00
|
|
|
|
public ucTransporteTTop()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
}
|
2024-05-06 12:31:45 -03:00
|
|
|
|
public void Resize(float width, float height)
|
2024-05-04 15:35:06 -03:00
|
|
|
|
{
|
|
|
|
|
if (Datos is osTransporteTTop datos)
|
2024-05-08 08:41:26 -03:00
|
|
|
|
datos.Ancho = PixelToMeter.Instance.calc.PixelsToMeters(width);
|
2024-05-04 15:35:06 -03:00
|
|
|
|
}
|
2024-05-08 03:00:31 -03:00
|
|
|
|
public void Move(float LeftPixels, float TopPixels)
|
2024-05-04 15:35:06 -03:00
|
|
|
|
{
|
|
|
|
|
if (Datos != null)
|
|
|
|
|
{
|
2024-05-08 08:41:26 -03:00
|
|
|
|
Datos.Left = PixelToMeter.Instance.calc.PixelsToMeters(LeftPixels);
|
|
|
|
|
Datos.Top = PixelToMeter.Instance.calc.PixelsToMeters(TopPixels);
|
2024-05-04 15:35:06 -03:00
|
|
|
|
}
|
|
|
|
|
}
|
2024-05-06 12:31:45 -03:00
|
|
|
|
public void Rotate(float Angle) {
|
2024-05-04 15:35:06 -03:00
|
|
|
|
if (Datos != null)
|
|
|
|
|
if (Datos is osTransporteTTop datos)
|
|
|
|
|
datos.Angulo = Angle;
|
|
|
|
|
}
|
2024-05-04 16:27:04 -03:00
|
|
|
|
public void Highlight(bool State) { }
|
2024-05-08 03:00:31 -03:00
|
|
|
|
public int ZIndex()
|
|
|
|
|
{
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-04 06:00:52 -03:00
|
|
|
|
}
|
2024-05-02 11:06:45 -03:00
|
|
|
|
}
|
2024-05-04 15:35:06 -03:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|