diff --git a/ObjetosSim/Decorativos/ucCustomImage.xaml.cs b/ObjetosSim/Decorativos/ucCustomImage.xaml.cs index 6b62d43..556f76e 100644 --- a/ObjetosSim/Decorativos/ucCustomImage.xaml.cs +++ b/ObjetosSim/Decorativos/ucCustomImage.xaml.cs @@ -1,7 +1,7 @@ using CommunityToolkit.Mvvm.ComponentModel; using LibS7Adv; using System.Windows; -using System.Windows.Controls; +using System.Windows.Controls; using System.Windows.Media; using CtrEditor.FuncionesBase; using System.ComponentModel; @@ -75,8 +75,8 @@ namespace CtrEditor.ObjetosSim private bool vertical_Flip; - [JsonIgnore] [ObservableProperty] + [property: JsonIgnore] public ImageSource imageSource_oculta; private void OnImagePathChanged(string value) diff --git a/ObjetosSim/Estaticos/ucVMmotorSim.xaml.cs b/ObjetosSim/Estaticos/ucVMmotorSim.xaml.cs index 831e12e..e29dcdd 100644 --- a/ObjetosSim/Estaticos/ucVMmotorSim.xaml.cs +++ b/ObjetosSim/Estaticos/ucVMmotorSim.xaml.cs @@ -34,8 +34,8 @@ namespace CtrEditor.ObjetosSim set => SetProperty(ref nombre, value); } - [JsonIgnore] [ObservableProperty] + [property: JsonIgnore] public ImageSource imageSource_oculta; [ObservableProperty] @@ -222,9 +222,9 @@ namespace CtrEditor.ObjetosSim else Data.Actual_Position = 0; - // Read ControlWord and track the raw response - var rawResponse = plc.LeerTagDInt($"\"DB MotorSimulate\".Motors[{DB_Motor}].ControlWord"); - int controlWord = rawResponse ?? 0; + // Read ControlWord and track the raw response + var rawResponse = plc.LeerTagDInt($"\"DB MotorSimulate\".Motors[{DB_Motor}].ControlWord"); + int controlWord = rawResponse ?? 0; var control = VMMotorBitPacker.UnpackControlWord(controlWord); diff --git a/ObjetosSim/osBase.cs b/ObjetosSim/osBase.cs index a2c9e6c..939d815 100644 --- a/ObjetosSim/osBase.cs +++ b/ObjetosSim/osBase.cs @@ -71,8 +71,8 @@ namespace CtrEditor.ObjetosSim [JsonIgnore] private System.Threading.Timer timer = null; - [JsonIgnore] [ObservableProperty] + [property: JsonIgnore] [property: Hidden] public bool isVisFilter; @@ -344,28 +344,28 @@ namespace CtrEditor.ObjetosSim private bool isUpdatingFromFramePlate = false; // Variables para rotación orbital alrededor del FramePlate - [JsonIgnore] [ObservableProperty] + [property: JsonIgnore] [property: Hidden] private float framePlate_RelativeX; - [JsonIgnore] [ObservableProperty] + [property: JsonIgnore] [property: Hidden] private float framePlate_RelativeY; - [JsonIgnore] [ObservableProperty] + [property: JsonIgnore] [property: Hidden] private float framePlate_InitialAngle; - [JsonIgnore] [ObservableProperty] + [property: JsonIgnore] [property: Hidden] private float framePlate_PivotX; - [JsonIgnore] [ObservableProperty] + [property: JsonIgnore] [property: Hidden] private float framePlate_PivotY; diff --git a/Serialization/StateSerializer.cs b/Serialization/StateSerializer.cs index 3fa305b..afe4ebc 100644 --- a/Serialization/StateSerializer.cs +++ b/Serialization/StateSerializer.cs @@ -257,7 +257,12 @@ namespace CtrEditor.Serialization ObjectCreationHandling = ObjectCreationHandling.Replace, ConstructorHandling = ConstructorHandling.AllowNonPublicDefaultConstructor, Error = HandleDeserializationError, - Converters = { new SafeImageSourceConverter() } + Converters = { new SafeImageSourceConverter() }, + // Configuración para respetar atributos JsonIgnore de Newtonsoft.Json + ContractResolver = new Newtonsoft.Json.Serialization.DefaultContractResolver + { + IgnoreSerializableAttribute = false + } }; }