2024-05-11 11:58:55 -03:00
|
|
|
|
using CtrEditor.Convertidores;
|
2024-05-11 15:55:44 -03:00
|
|
|
|
using CtrEditor.Siemens;
|
2024-05-11 11:58:55 -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-14 03:15:54 -03:00
|
|
|
|
using CtrEditor.Simulacion;
|
2024-05-11 11:58:55 -03:00
|
|
|
|
|
|
|
|
|
namespace CtrEditor.ObjetosSim
|
|
|
|
|
{
|
|
|
|
|
/// <summary>
|
|
|
|
|
/// Interaction logic for ucVMmotorSim.xaml
|
|
|
|
|
/// </summary>
|
|
|
|
|
public class osVMmotorSim : osBase
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Otros datos y métodos relevantes para la simulación
|
|
|
|
|
|
|
|
|
|
private string _nombre = "VetroMeccanica Motor";
|
|
|
|
|
private float _tamano;
|
|
|
|
|
private float _left;
|
|
|
|
|
private float _top;
|
|
|
|
|
private float _numeroMotor;
|
|
|
|
|
|
|
|
|
|
public float Tamano
|
|
|
|
|
{
|
|
|
|
|
get => _tamano;
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
_tamano = value;
|
|
|
|
|
OnPropertyChanged(nameof(Tamano));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public float PLC_NumeroMotor
|
|
|
|
|
{
|
|
|
|
|
get => _numeroMotor;
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
_numeroMotor = value;
|
|
|
|
|
OnPropertyChanged(nameof(PLC_NumeroMotor));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public override float Left
|
|
|
|
|
{
|
|
|
|
|
get => _left;
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
_left = value;
|
|
|
|
|
CanvasSetLeftinMeter(value);
|
|
|
|
|
OnPropertyChanged(nameof(Left));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
public override float Top
|
|
|
|
|
{
|
|
|
|
|
get => _top;
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
_top = value;
|
|
|
|
|
CanvasSetTopinMeter(value);
|
|
|
|
|
OnPropertyChanged(nameof(Top));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public override string Nombre
|
|
|
|
|
{
|
|
|
|
|
get => _nombre;
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
if (_nombre != value)
|
|
|
|
|
{
|
|
|
|
|
_nombre = value;
|
|
|
|
|
OnPropertyChanged(nameof(Nombre));
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public osVMmotorSim()
|
|
|
|
|
{
|
|
|
|
|
Tamano = 0.30f;
|
2024-05-11 15:55:44 -03:00
|
|
|
|
PLC_NumeroMotor = 31;
|
2024-05-11 11:58:55 -03:00
|
|
|
|
}
|
|
|
|
|
|
2024-05-14 03:15:54 -03:00
|
|
|
|
public override void UpdateGeometryStart()
|
2024-05-11 11:58:55 -03:00
|
|
|
|
{
|
|
|
|
|
// Se llama antes de la simulacion
|
|
|
|
|
|
2024-05-14 03:15:54 -03:00
|
|
|
|
}
|
|
|
|
|
public override void UpdateGeometryStep()
|
|
|
|
|
{
|
2024-05-11 11:58:55 -03:00
|
|
|
|
}
|
2024-05-11 15:55:44 -03:00
|
|
|
|
public override void UpdatePLC(PLCModel plc) { }
|
2024-05-11 11:58:55 -03:00
|
|
|
|
|
|
|
|
|
public override void UpdateControl()
|
|
|
|
|
{
|
2024-05-11 15:55:44 -03:00
|
|
|
|
|
2024-05-11 11:58:55 -03:00
|
|
|
|
}
|
2024-05-14 03:15:54 -03:00
|
|
|
|
public override void ucLoaded()
|
|
|
|
|
{
|
|
|
|
|
// El UserControl ya se ha cargado y podemos obtener las coordenadas para
|
|
|
|
|
// crear el objeto de simulacion
|
|
|
|
|
}
|
|
|
|
|
|
2024-05-11 11:58:55 -03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public partial class ucVMmotorSim : UserControl, IDataContainer
|
|
|
|
|
{
|
|
|
|
|
public osBase? Datos { get; set; }
|
|
|
|
|
|
|
|
|
|
public ucVMmotorSim()
|
|
|
|
|
{
|
|
|
|
|
InitializeComponent();
|
|
|
|
|
}
|
|
|
|
|
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;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|