2024-05-23 14:56:14 -03:00
|
|
|
|
using CommunityToolkit.Mvvm.ComponentModel;
|
|
|
|
|
using CtrEditor.Convertidores;
|
|
|
|
|
using CtrEditor.Siemens;
|
|
|
|
|
using System.Windows;
|
|
|
|
|
using System.Windows.Controls;
|
|
|
|
|
|
|
|
|
|
|
2024-05-25 07:53:34 -03:00
|
|
|
|
namespace CtrEditor.ObjetosSim
|
2024-05-23 14:56:14 -03:00
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Interaction logic for ucConsensGeneric.xaml
|
|
|
|
|
/// </summary>
|
|
|
|
|
public partial class osConsensGeneric : osBase, IosBase
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
public TagsConsensos Consensos = new TagsConsensos();
|
|
|
|
|
|
|
|
|
|
[ObservableProperty]
|
|
|
|
|
public List<string> tags;
|
|
|
|
|
|
|
|
|
|
// Otros datos y métodos relevantes para la simulación
|
|
|
|
|
|
|
|
|
|
public static string NombreClase()
|
|
|
|
|
{
|
|
|
|
|
return "Consensi";
|
|
|
|
|
}
|
|
|
|
|
private string nombre = NombreClase();
|
|
|
|
|
public override string Nombre
|
|
|
|
|
{
|
|
|
|
|
get => nombre;
|
|
|
|
|
set => SetProperty(ref nombre, value);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[ObservableProperty]
|
|
|
|
|
public float tamano;
|
|
|
|
|
|
|
|
|
|
public override void ucLoaded()
|
|
|
|
|
{
|
|
|
|
|
// El UserControl ya se ha cargado y podemos obtener las coordenadas para
|
|
|
|
|
// crear el objeto de simulacion
|
|
|
|
|
ActualizarLeftTop();
|
|
|
|
|
|
|
|
|
|
if (_visualRepresentation is ucConsensGeneric uc)
|
|
|
|
|
Tags = UserControlFactory.CargarPropiedadesosDatosTags(Consensos, uc.PanelEdicion, null);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public partial class ucConsensGeneric : UserControl, IDataContainer
|
|
|
|
|
{
|
|
|
|
|
public osBase? Datos { get; set; }
|
|
|
|
|
|
|
|
|
|
public ucConsensGeneric()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
this.Loaded += OnLoaded;
|
|
|
|
|
this.Unloaded += OnUnloaded;
|
|
|
|
|
}
|
|
|
|
|
private void OnLoaded(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
Datos?.ucLoaded();
|
|
|
|
|
}
|
|
|
|
|
private void OnUnloaded(object sender, RoutedEventArgs e)
|
|
|
|
|
{
|
|
|
|
|
Datos?.ucUnLoaded();
|
|
|
|
|
}
|
|
|
|
|
public void Resize(float width, float height) { }
|
|
|
|
|
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) { }
|
|
|
|
|
public void Highlight(bool State) { }
|
|
|
|
|
public int ZIndex()
|
|
|
|
|
{
|
|
|
|
|
return 10;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public class TagsConsensos
|
|
|
|
|
{
|
|
|
|
|
public string Tag { get; set; }
|
|
|
|
|
public bool Consenso_Uscita { get; set; }
|
|
|
|
|
public string Velocidad { get; set; }
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|