Compare commits
No commits in common. "dc164e96ef17012673f836ae3ff5739b6e358c6a" and "9f41401e40d0c53f3df481423a43c15110ac0e40" have entirely different histories.
dc164e96ef
...
9f41401e40
1
App.xaml
1
App.xaml
|
@ -20,7 +20,6 @@
|
||||||
<local:SubclassFilterConverter x:Key="SubclassFilterConverterosBuscarCoincidencias"
|
<local:SubclassFilterConverter x:Key="SubclassFilterConverterosBuscarCoincidencias"
|
||||||
TargetType="{x:Type osExtraccion:osBuscarCoincidencias}" />
|
TargetType="{x:Type osExtraccion:osBuscarCoincidencias}" />
|
||||||
<local:SubclassFilterConverter x:Key="SubclassFilterConverterosVMMotor" TargetType="{x:Type os:osVMmotorSim}" />
|
<local:SubclassFilterConverter x:Key="SubclassFilterConverterosVMMotor" TargetType="{x:Type os:osVMmotorSim}" />
|
||||||
<local:UnsavedChangesConverter x:Key="UnsavedChangesConverter"/>
|
|
||||||
</Application.Resources>
|
</Application.Resources>
|
||||||
</Application>
|
</Application>
|
||||||
|
|
||||||
|
|
|
@ -1,668 +0,0 @@
|
||||||
[
|
|
||||||
{
|
|
||||||
"$type": "CtrEditor.ObjetosSim.Extraccion_Datos.osExtraccionTag, CtrEditor",
|
|
||||||
"AutoCreated": false,
|
|
||||||
"RemoverDesdeSimulacion": false,
|
|
||||||
"Nombre": "Ingresos E0.0",
|
|
||||||
"Extraer": false,
|
|
||||||
"New_Row": false,
|
|
||||||
"Id_Search_Templates": "Ingresos Plate Group",
|
|
||||||
"Tag_extract": "E3.0\n",
|
|
||||||
"Collumn_name": "IO",
|
|
||||||
"Collumn_number": 2,
|
|
||||||
"Copy_Number": 0,
|
|
||||||
"Show_Debug_Window": false,
|
|
||||||
"Opacity_oculto": 0.1,
|
|
||||||
"Id": {
|
|
||||||
"Value": 1202
|
|
||||||
},
|
|
||||||
"Show_On_This_Page": false,
|
|
||||||
"Left": 2.0471327,
|
|
||||||
"Top": 8.451157,
|
|
||||||
"Ancho": 1.3239104,
|
|
||||||
"Alto": 0.19122289,
|
|
||||||
"Angulo": 0.0,
|
|
||||||
"Enable_On_All_Pages": true,
|
|
||||||
"ShowOnThisPagesList": [
|
|
||||||
"94102.80_SE00_Página_050.png",
|
|
||||||
"94102.80_SE00_Página_051.png",
|
|
||||||
"94102.80_SE00_Página_052.png",
|
|
||||||
"94102.80_SE00_Página_053.png",
|
|
||||||
"94102.80_SE00_Página_054.png",
|
|
||||||
"94102.80_SE00_Página_055.png",
|
|
||||||
"94102.80_SE00_Página_056.png",
|
|
||||||
"94102.80_SE00_Página_057.png",
|
|
||||||
"94102.80_SE00_Página_058.png",
|
|
||||||
"94102.80_SE00_Página_059.png",
|
|
||||||
"94102.80_SE00_Página_060.png",
|
|
||||||
"94102.80_SE00_Página_061.png",
|
|
||||||
"94102.80_SE00_Página_062.png",
|
|
||||||
"94102.80_SE00_Página_063.png",
|
|
||||||
"94102.80_SE00_Página_064.png",
|
|
||||||
"94102.80_SE00_Página_065.png",
|
|
||||||
"94102.80_SE00_Página_066.png",
|
|
||||||
"94102.80_SE00_Página_067.png",
|
|
||||||
"94102.80_SE00_Página_068.png",
|
|
||||||
"94102.80_SE00_Página_069.png"
|
|
||||||
],
|
|
||||||
"Cloned": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"$type": "CtrEditor.ObjetosSim.Extraccion_Datos.osExtraccionTag, CtrEditor",
|
|
||||||
"AutoCreated": false,
|
|
||||||
"RemoverDesdeSimulacion": false,
|
|
||||||
"Nombre": "Ingresos Desc Italiano",
|
|
||||||
"Extraer": false,
|
|
||||||
"New_Row": false,
|
|
||||||
"Id_Search_Templates": "Ingresos Plate Group",
|
|
||||||
"Tag_extract": "MARCIA ASCIUGATORE\n",
|
|
||||||
"Collumn_name": "Description Italian",
|
|
||||||
"Collumn_number": 3,
|
|
||||||
"Copy_Number": 0,
|
|
||||||
"Show_Debug_Window": false,
|
|
||||||
"Opacity_oculto": 0.1,
|
|
||||||
"Id": {
|
|
||||||
"Value": 1203
|
|
||||||
},
|
|
||||||
"Show_On_This_Page": false,
|
|
||||||
"Left": 2.0339866,
|
|
||||||
"Top": 9.252491,
|
|
||||||
"Ancho": 1.3151709,
|
|
||||||
"Alto": 0.26124278,
|
|
||||||
"Angulo": 0.0,
|
|
||||||
"Enable_On_All_Pages": true,
|
|
||||||
"ShowOnThisPagesList": [
|
|
||||||
"94102.80_SE00_Página_050.png",
|
|
||||||
"94102.80_SE00_Página_051.png",
|
|
||||||
"94102.80_SE00_Página_052.png",
|
|
||||||
"94102.80_SE00_Página_053.png",
|
|
||||||
"94102.80_SE00_Página_054.png",
|
|
||||||
"94102.80_SE00_Página_055.png",
|
|
||||||
"94102.80_SE00_Página_056.png",
|
|
||||||
"94102.80_SE00_Página_057.png",
|
|
||||||
"94102.80_SE00_Página_058.png",
|
|
||||||
"94102.80_SE00_Página_059.png",
|
|
||||||
"94102.80_SE00_Página_060.png",
|
|
||||||
"94102.80_SE00_Página_061.png",
|
|
||||||
"94102.80_SE00_Página_062.png",
|
|
||||||
"94102.80_SE00_Página_063.png",
|
|
||||||
"94102.80_SE00_Página_064.png",
|
|
||||||
"94102.80_SE00_Página_065.png",
|
|
||||||
"94102.80_SE00_Página_066.png",
|
|
||||||
"94102.80_SE00_Página_067.png",
|
|
||||||
"94102.80_SE00_Página_068.png",
|
|
||||||
"94102.80_SE00_Página_069.png"
|
|
||||||
],
|
|
||||||
"Cloned": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"$type": "CtrEditor.ObjetosSim.Extraccion_Datos.osExtraccionTag, CtrEditor",
|
|
||||||
"AutoCreated": false,
|
|
||||||
"RemoverDesdeSimulacion": false,
|
|
||||||
"Nombre": "Ingresos Desc English",
|
|
||||||
"Extraer": false,
|
|
||||||
"New_Row": false,
|
|
||||||
"Id_Search_Templates": "Ingresos Plate Group",
|
|
||||||
"Tag_extract": "EMERGENCY PRESSED\nELECTRICAL CABINET\n",
|
|
||||||
"Collumn_name": "Description English",
|
|
||||||
"Collumn_number": 4,
|
|
||||||
"Copy_Number": 0,
|
|
||||||
"Show_Debug_Window": false,
|
|
||||||
"Opacity_oculto": 0.1,
|
|
||||||
"Id": {
|
|
||||||
"Value": 1204
|
|
||||||
},
|
|
||||||
"Show_On_This_Page": false,
|
|
||||||
"Left": 2.0329113,
|
|
||||||
"Top": 9.509013,
|
|
||||||
"Ancho": 1.323141,
|
|
||||||
"Alto": 0.2408835,
|
|
||||||
"Angulo": 0.0,
|
|
||||||
"Enable_On_All_Pages": true,
|
|
||||||
"ShowOnThisPagesList": [
|
|
||||||
"94102.80_SE00_Página_050.png",
|
|
||||||
"94102.80_SE00_Página_051.png",
|
|
||||||
"94102.80_SE00_Página_052.png",
|
|
||||||
"94102.80_SE00_Página_053.png",
|
|
||||||
"94102.80_SE00_Página_054.png",
|
|
||||||
"94102.80_SE00_Página_055.png",
|
|
||||||
"94102.80_SE00_Página_056.png",
|
|
||||||
"94102.80_SE00_Página_057.png",
|
|
||||||
"94102.80_SE00_Página_058.png",
|
|
||||||
"94102.80_SE00_Página_059.png",
|
|
||||||
"94102.80_SE00_Página_060.png",
|
|
||||||
"94102.80_SE00_Página_061.png",
|
|
||||||
"94102.80_SE00_Página_062.png",
|
|
||||||
"94102.80_SE00_Página_063.png",
|
|
||||||
"94102.80_SE00_Página_064.png",
|
|
||||||
"94102.80_SE00_Página_065.png",
|
|
||||||
"94102.80_SE00_Página_066.png",
|
|
||||||
"94102.80_SE00_Página_067.png",
|
|
||||||
"94102.80_SE00_Página_068.png",
|
|
||||||
"94102.80_SE00_Página_069.png"
|
|
||||||
],
|
|
||||||
"Cloned": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"$type": "CtrEditor.ObjetosSim.Extraccion_Datos.osExtraccionTag, CtrEditor",
|
|
||||||
"AutoCreated": false,
|
|
||||||
"RemoverDesdeSimulacion": false,
|
|
||||||
"Nombre": "Ingresos Card",
|
|
||||||
"Extraer": false,
|
|
||||||
"New_Row": false,
|
|
||||||
"Id_Search_Templates": "Ingresos Plate Group",
|
|
||||||
"Tag_extract": "A45311\n",
|
|
||||||
"Collumn_name": "Card",
|
|
||||||
"Collumn_number": 5,
|
|
||||||
"Copy_Number": 0,
|
|
||||||
"Show_Debug_Window": false,
|
|
||||||
"Opacity_oculto": 0.1,
|
|
||||||
"Id": {
|
|
||||||
"Value": 1260
|
|
||||||
},
|
|
||||||
"Show_On_This_Page": false,
|
|
||||||
"Left": 2.2931812,
|
|
||||||
"Top": 9.125617,
|
|
||||||
"Ancho": 0.3932013,
|
|
||||||
"Alto": 0.11076093,
|
|
||||||
"Angulo": 0.0,
|
|
||||||
"Enable_On_All_Pages": true,
|
|
||||||
"ShowOnThisPagesList": [
|
|
||||||
"94102.80_SE00_Página_050.png",
|
|
||||||
"94102.80_SE00_Página_051.png",
|
|
||||||
"94102.80_SE00_Página_052.png",
|
|
||||||
"94102.80_SE00_Página_053.png",
|
|
||||||
"94102.80_SE00_Página_054.png",
|
|
||||||
"94102.80_SE00_Página_055.png",
|
|
||||||
"94102.80_SE00_Página_056.png",
|
|
||||||
"94102.80_SE00_Página_057.png",
|
|
||||||
"94102.80_SE00_Página_058.png",
|
|
||||||
"94102.80_SE00_Página_059.png",
|
|
||||||
"94102.80_SE00_Página_060.png",
|
|
||||||
"94102.80_SE00_Página_061.png",
|
|
||||||
"94102.80_SE00_Página_062.png",
|
|
||||||
"94102.80_SE00_Página_063.png",
|
|
||||||
"94102.80_SE00_Página_064.png",
|
|
||||||
"94102.80_SE00_Página_065.png",
|
|
||||||
"94102.80_SE00_Página_066.png",
|
|
||||||
"94102.80_SE00_Página_067.png",
|
|
||||||
"94102.80_SE00_Página_068.png",
|
|
||||||
"94102.80_SE00_Página_069.png"
|
|
||||||
],
|
|
||||||
"Cloned": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"$type": "CtrEditor.ObjetosSim.Extraccion_Datos.osExtraccionTag, CtrEditor",
|
|
||||||
"AutoCreated": false,
|
|
||||||
"RemoverDesdeSimulacion": false,
|
|
||||||
"Nombre": "Ingresos Pin",
|
|
||||||
"Extraer": false,
|
|
||||||
"New_Row": false,
|
|
||||||
"Id_Search_Templates": "Ingresos Plate Group",
|
|
||||||
"Tag_extract": "",
|
|
||||||
"Collumn_name": "Pin",
|
|
||||||
"Collumn_number": 7,
|
|
||||||
"Copy_Number": 0,
|
|
||||||
"Show_Debug_Window": false,
|
|
||||||
"Opacity_oculto": 0.1,
|
|
||||||
"Id": {
|
|
||||||
"Value": 1264
|
|
||||||
},
|
|
||||||
"Show_On_This_Page": false,
|
|
||||||
"Left": 2.6119895,
|
|
||||||
"Top": 8.204032,
|
|
||||||
"Ancho": 0.16785541,
|
|
||||||
"Alto": 0.15966734,
|
|
||||||
"Angulo": 0.0,
|
|
||||||
"Enable_On_All_Pages": true,
|
|
||||||
"ShowOnThisPagesList": [
|
|
||||||
"94102.80_SE00_Página_050.png",
|
|
||||||
"94102.80_SE00_Página_051.png",
|
|
||||||
"94102.80_SE00_Página_052.png",
|
|
||||||
"94102.80_SE00_Página_053.png",
|
|
||||||
"94102.80_SE00_Página_054.png",
|
|
||||||
"94102.80_SE00_Página_055.png",
|
|
||||||
"94102.80_SE00_Página_056.png",
|
|
||||||
"94102.80_SE00_Página_057.png",
|
|
||||||
"94102.80_SE00_Página_058.png",
|
|
||||||
"94102.80_SE00_Página_059.png",
|
|
||||||
"94102.80_SE00_Página_060.png",
|
|
||||||
"94102.80_SE00_Página_061.png",
|
|
||||||
"94102.80_SE00_Página_062.png",
|
|
||||||
"94102.80_SE00_Página_063.png",
|
|
||||||
"94102.80_SE00_Página_064.png",
|
|
||||||
"94102.80_SE00_Página_065.png",
|
|
||||||
"94102.80_SE00_Página_066.png",
|
|
||||||
"94102.80_SE00_Página_067.png",
|
|
||||||
"94102.80_SE00_Página_068.png",
|
|
||||||
"94102.80_SE00_Página_069.png"
|
|
||||||
],
|
|
||||||
"Cloned": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"$type": "CtrEditor.ObjetosSim.Extraccion_Datos.osBuscarCoincidencias, CtrEditor",
|
|
||||||
"AutoCreated": false,
|
|
||||||
"RemoverDesdeSimulacion": false,
|
|
||||||
"Nombre": "Ingresos Plate Group",
|
|
||||||
"Search_rectangles": [
|
|
||||||
"200.6319122314453,815.1671752929688,137.59445190429688,161.43350219726562",
|
|
||||||
"350.22589111328125,815.4871215820312,137.59445190429688,161.43350219726562",
|
|
||||||
"499.9798583984375,815.4871215820312,137.59445190429688,161.43350219726562",
|
|
||||||
"649.7338256835938,815.4871215820312,137.59445190429688,161.43350219726562",
|
|
||||||
"799.6477661132812,815.4871215820312,137.59445190429688,161.43350219726562",
|
|
||||||
"949.2417602539062,815.4871215820312,137.59445190429688,161.43350219726562",
|
|
||||||
"1099.15576171875,815.4871215820312,137.59445190429688,161.43350219726562",
|
|
||||||
"1248.90966796875,815.4871215820312,137.59445190429688,161.43350219726562"
|
|
||||||
],
|
|
||||||
"Search_templates": false,
|
|
||||||
"Export_ocr": false,
|
|
||||||
"Opacity_oculto": 0.1,
|
|
||||||
"Show_debug_ocr": false,
|
|
||||||
"Threshold": 0.6,
|
|
||||||
"Coincidencias": 8,
|
|
||||||
"Id": {
|
|
||||||
"Value": 1201
|
|
||||||
},
|
|
||||||
"Show_On_This_Page": false,
|
|
||||||
"Left": 2.0069747,
|
|
||||||
"Top": 8.15955,
|
|
||||||
"Ancho": 1.3769451,
|
|
||||||
"Alto": 1.6148156,
|
|
||||||
"Angulo": 0.0,
|
|
||||||
"Enable_On_All_Pages": true,
|
|
||||||
"ShowOnThisPagesList": [
|
|
||||||
"94102.80_SE00_Página_050.png",
|
|
||||||
"94102.80_SE00_Página_051.png",
|
|
||||||
"94102.80_SE00_Página_052.png",
|
|
||||||
"94102.80_SE00_Página_053.png",
|
|
||||||
"94102.80_SE00_Página_054.png",
|
|
||||||
"94102.80_SE00_Página_055.png",
|
|
||||||
"94102.80_SE00_Página_056.png",
|
|
||||||
"94102.80_SE00_Página_057.png",
|
|
||||||
"94102.80_SE00_Página_058.png",
|
|
||||||
"94102.80_SE00_Página_059.png",
|
|
||||||
"94102.80_SE00_Página_060.png",
|
|
||||||
"94102.80_SE00_Página_061.png",
|
|
||||||
"94102.80_SE00_Página_062.png",
|
|
||||||
"94102.80_SE00_Página_063.png",
|
|
||||||
"94102.80_SE00_Página_064.png",
|
|
||||||
"94102.80_SE00_Página_065.png",
|
|
||||||
"94102.80_SE00_Página_066.png",
|
|
||||||
"94102.80_SE00_Página_067.png",
|
|
||||||
"94102.80_SE00_Página_068.png",
|
|
||||||
"94102.80_SE00_Página_069.png"
|
|
||||||
],
|
|
||||||
"Cloned": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"$type": "CtrEditor.ObjetosSim.Extraccion_Datos.osExtraccionTag, CtrEditor",
|
|
||||||
"AutoCreated": false,
|
|
||||||
"RemoverDesdeSimulacion": false,
|
|
||||||
"Nombre": "Page",
|
|
||||||
"Extraer": false,
|
|
||||||
"New_Row": false,
|
|
||||||
"Tag_extract": "690\n",
|
|
||||||
"Collumn_name": "Extraccion Tags",
|
|
||||||
"Collumn_number": 1,
|
|
||||||
"Copy_Number": 0,
|
|
||||||
"Show_Debug_Window": false,
|
|
||||||
"Opacity_oculto": 0.1,
|
|
||||||
"Id": {
|
|
||||||
"Value": 1231
|
|
||||||
},
|
|
||||||
"Show_On_This_Page": false,
|
|
||||||
"Left": 13.666122,
|
|
||||||
"Top": 10.413534,
|
|
||||||
"Ancho": 0.81436056,
|
|
||||||
"Alto": 0.2296054,
|
|
||||||
"Angulo": 0.0,
|
|
||||||
"Enable_On_All_Pages": true,
|
|
||||||
"ShowOnThisPagesList": [
|
|
||||||
"94102.80_SE00_Página_050.png",
|
|
||||||
"94102.80_SE00_Página_051.png",
|
|
||||||
"94102.80_SE00_Página_052.png",
|
|
||||||
"94102.80_SE00_Página_053.png",
|
|
||||||
"94102.80_SE00_Página_054.png",
|
|
||||||
"94102.80_SE00_Página_055.png",
|
|
||||||
"94102.80_SE00_Página_056.png",
|
|
||||||
"94102.80_SE00_Página_057.png",
|
|
||||||
"94102.80_SE00_Página_058.png",
|
|
||||||
"94102.80_SE00_Página_059.png",
|
|
||||||
"94102.80_SE00_Página_060.png",
|
|
||||||
"94102.80_SE00_Página_061.png",
|
|
||||||
"94102.80_SE00_Página_062.png",
|
|
||||||
"94102.80_SE00_Página_063.png",
|
|
||||||
"94102.80_SE00_Página_064.png",
|
|
||||||
"94102.80_SE00_Página_065.png",
|
|
||||||
"94102.80_SE00_Página_066.png",
|
|
||||||
"94102.80_SE00_Página_067.png",
|
|
||||||
"94102.80_SE00_Página_068.png",
|
|
||||||
"94102.80_SE00_Página_069.png",
|
|
||||||
"94102.80_SE00_Página_070.png",
|
|
||||||
"94102.80_SE00_Página_071.png",
|
|
||||||
"94102.80_SE00_Página_072.png",
|
|
||||||
"94102.80_SE00_Página_073.png",
|
|
||||||
"94102.80_SE00_Página_074.png",
|
|
||||||
"94102.80_SE00_Página_075.png"
|
|
||||||
],
|
|
||||||
"Cloned": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"$type": "CtrEditor.ObjetosSim.Extraccion_Datos.osExtraccionTag, CtrEditor",
|
|
||||||
"AutoCreated": false,
|
|
||||||
"RemoverDesdeSimulacion": false,
|
|
||||||
"Nombre": "Salidas A0.0",
|
|
||||||
"Extraer": false,
|
|
||||||
"New_Row": false,
|
|
||||||
"Id_Search_Templates": "Salidas Plate Group",
|
|
||||||
"Tag_extract": "E3.0\n",
|
|
||||||
"Collumn_name": "IO",
|
|
||||||
"Collumn_number": 2,
|
|
||||||
"Copy_Number": 0,
|
|
||||||
"Show_Debug_Window": false,
|
|
||||||
"Opacity_oculto": 0.1,
|
|
||||||
"Id": {
|
|
||||||
"Value": 63
|
|
||||||
},
|
|
||||||
"Show_On_This_Page": false,
|
|
||||||
"Left": 2.038601,
|
|
||||||
"Top": 2.4818933,
|
|
||||||
"Ancho": 1.3239104,
|
|
||||||
"Alto": 0.19122289,
|
|
||||||
"Angulo": 0.0,
|
|
||||||
"Enable_On_All_Pages": true,
|
|
||||||
"ShowOnThisPagesList": [
|
|
||||||
"94102.80_SE00_Página_070.png",
|
|
||||||
"94102.80_SE00_Página_071.png",
|
|
||||||
"94102.80_SE00_Página_072.png",
|
|
||||||
"94102.80_SE00_Página_073.png",
|
|
||||||
"94102.80_SE00_Página_074.png",
|
|
||||||
"94102.80_SE00_Página_075.png"
|
|
||||||
],
|
|
||||||
"Cloned": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"$type": "CtrEditor.ObjetosSim.Extraccion_Datos.osExtraccionTag, CtrEditor",
|
|
||||||
"AutoCreated": false,
|
|
||||||
"RemoverDesdeSimulacion": false,
|
|
||||||
"Nombre": "Salidas Desc Italiano",
|
|
||||||
"Extraer": false,
|
|
||||||
"New_Row": false,
|
|
||||||
"Id_Search_Templates": "Salidas Plate Group",
|
|
||||||
"Tag_extract": "MARCIA ASCIUGATORE\n",
|
|
||||||
"Collumn_name": "Description Italian",
|
|
||||||
"Collumn_number": 3,
|
|
||||||
"Copy_Number": 0,
|
|
||||||
"Show_Debug_Window": false,
|
|
||||||
"Opacity_oculto": 0.1,
|
|
||||||
"Id": {
|
|
||||||
"Value": 64
|
|
||||||
},
|
|
||||||
"Show_On_This_Page": false,
|
|
||||||
"Left": 2.0427365,
|
|
||||||
"Top": 1.3802159,
|
|
||||||
"Ancho": 1.3151709,
|
|
||||||
"Alto": 0.26124278,
|
|
||||||
"Angulo": 0.0,
|
|
||||||
"Enable_On_All_Pages": true,
|
|
||||||
"ShowOnThisPagesList": [
|
|
||||||
"94102.80_SE00_Página_070.png",
|
|
||||||
"94102.80_SE00_Página_071.png",
|
|
||||||
"94102.80_SE00_Página_072.png",
|
|
||||||
"94102.80_SE00_Página_073.png",
|
|
||||||
"94102.80_SE00_Página_074.png",
|
|
||||||
"94102.80_SE00_Página_075.png"
|
|
||||||
],
|
|
||||||
"Cloned": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"$type": "CtrEditor.ObjetosSim.Extraccion_Datos.osExtraccionTag, CtrEditor",
|
|
||||||
"AutoCreated": false,
|
|
||||||
"RemoverDesdeSimulacion": false,
|
|
||||||
"Nombre": "Salidas Desc English",
|
|
||||||
"Extraer": false,
|
|
||||||
"New_Row": false,
|
|
||||||
"Id_Search_Templates": "Salidas Plate Group",
|
|
||||||
"Tag_extract": "EMERGENCY PRESSED\nELECTRICAL CABINET\n",
|
|
||||||
"Collumn_name": "Description English",
|
|
||||||
"Collumn_number": 4,
|
|
||||||
"Copy_Number": 0,
|
|
||||||
"Show_Debug_Window": false,
|
|
||||||
"Opacity_oculto": 0.1,
|
|
||||||
"Id": {
|
|
||||||
"Value": 65
|
|
||||||
},
|
|
||||||
"Show_On_This_Page": false,
|
|
||||||
"Left": 2.0372825,
|
|
||||||
"Top": 1.6332868,
|
|
||||||
"Ancho": 1.323141,
|
|
||||||
"Alto": 0.2408835,
|
|
||||||
"Angulo": 0.0,
|
|
||||||
"Enable_On_All_Pages": true,
|
|
||||||
"ShowOnThisPagesList": [
|
|
||||||
"94102.80_SE00_Página_070.png",
|
|
||||||
"94102.80_SE00_Página_071.png",
|
|
||||||
"94102.80_SE00_Página_072.png",
|
|
||||||
"94102.80_SE00_Página_073.png",
|
|
||||||
"94102.80_SE00_Página_074.png",
|
|
||||||
"94102.80_SE00_Página_075.png"
|
|
||||||
],
|
|
||||||
"Cloned": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"$type": "CtrEditor.ObjetosSim.Extraccion_Datos.osExtraccionTag, CtrEditor",
|
|
||||||
"AutoCreated": false,
|
|
||||||
"RemoverDesdeSimulacion": false,
|
|
||||||
"Nombre": "Salidas Card",
|
|
||||||
"Extraer": false,
|
|
||||||
"New_Row": false,
|
|
||||||
"Id_Search_Templates": "Salidas Plate Group",
|
|
||||||
"Tag_extract": "A45311\n",
|
|
||||||
"Collumn_name": "Card",
|
|
||||||
"Collumn_number": 5,
|
|
||||||
"Copy_Number": 0,
|
|
||||||
"Show_Debug_Window": false,
|
|
||||||
"Opacity_oculto": 0.1,
|
|
||||||
"Id": {
|
|
||||||
"Value": 66
|
|
||||||
},
|
|
||||||
"Show_On_This_Page": false,
|
|
||||||
"Left": 2.3019588,
|
|
||||||
"Top": 1.9661419,
|
|
||||||
"Ancho": 0.3932013,
|
|
||||||
"Alto": 0.11076093,
|
|
||||||
"Angulo": 0.0,
|
|
||||||
"Enable_On_All_Pages": true,
|
|
||||||
"ShowOnThisPagesList": [
|
|
||||||
"94102.80_SE00_Página_070.png",
|
|
||||||
"94102.80_SE00_Página_071.png",
|
|
||||||
"94102.80_SE00_Página_072.png",
|
|
||||||
"94102.80_SE00_Página_073.png",
|
|
||||||
"94102.80_SE00_Página_074.png",
|
|
||||||
"94102.80_SE00_Página_075.png"
|
|
||||||
],
|
|
||||||
"Cloned": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"$type": "CtrEditor.ObjetosSim.Extraccion_Datos.osExtraccionTag, CtrEditor",
|
|
||||||
"AutoCreated": false,
|
|
||||||
"RemoverDesdeSimulacion": false,
|
|
||||||
"Nombre": "Salidas Pin",
|
|
||||||
"Extraer": false,
|
|
||||||
"New_Row": false,
|
|
||||||
"Id_Search_Templates": "Salidas Plate Group",
|
|
||||||
"Tag_extract": "",
|
|
||||||
"Collumn_name": "Pin",
|
|
||||||
"Collumn_number": 7,
|
|
||||||
"Copy_Number": 0,
|
|
||||||
"Show_Debug_Window": false,
|
|
||||||
"Opacity_oculto": 0.1,
|
|
||||||
"Id": {
|
|
||||||
"Value": 68
|
|
||||||
},
|
|
||||||
"Show_On_This_Page": false,
|
|
||||||
"Left": 2.613817,
|
|
||||||
"Top": 2.771892,
|
|
||||||
"Ancho": 0.16785541,
|
|
||||||
"Alto": 0.15966734,
|
|
||||||
"Angulo": 0.0,
|
|
||||||
"Enable_On_All_Pages": true,
|
|
||||||
"ShowOnThisPagesList": [
|
|
||||||
"94102.80_SE00_Página_070.png",
|
|
||||||
"94102.80_SE00_Página_071.png",
|
|
||||||
"94102.80_SE00_Página_072.png",
|
|
||||||
"94102.80_SE00_Página_073.png",
|
|
||||||
"94102.80_SE00_Página_074.png",
|
|
||||||
"94102.80_SE00_Página_075.png"
|
|
||||||
],
|
|
||||||
"Cloned": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"$type": "CtrEditor.ObjetosSim.Extraccion_Datos.osBuscarCoincidencias, CtrEditor",
|
|
||||||
"AutoCreated": false,
|
|
||||||
"RemoverDesdeSimulacion": false,
|
|
||||||
"Nombre": "Salidas Plate Group",
|
|
||||||
"Search_rectangles": [
|
|
||||||
"200.471923828125,134.23458862304688,137.59445190429688,161.43350219726562",
|
|
||||||
"350.22589111328125,134.39459228515625,137.59445190429688,161.43350219726562",
|
|
||||||
"499.8198547363281,134.55458068847656,137.59445190429688,161.43350219726562",
|
|
||||||
"649.5738525390625,134.55458068847656,137.59445190429688,161.43350219726562",
|
|
||||||
"799.3278198242188,134.55458068847656,137.59445190429688,161.43350219726562",
|
|
||||||
"949.2417602539062,134.55458068847656,137.59445190429688,161.43350219726562",
|
|
||||||
"1098.9957275390625,134.55458068847656,137.59445190429688,161.43350219726562",
|
|
||||||
"1248.749755859375,134.55458068847656,137.59445190429688,161.43350219726562",
|
|
||||||
"1398.503662109375,134.87457275390625,137.59445190429688,161.43350219726562"
|
|
||||||
],
|
|
||||||
"Search_templates": false,
|
|
||||||
"Export_ocr": false,
|
|
||||||
"Opacity_oculto": 0.1,
|
|
||||||
"Show_debug_ocr": false,
|
|
||||||
"Threshold": 0.6,
|
|
||||||
"Coincidencias": 9,
|
|
||||||
"Id": {
|
|
||||||
"Value": 69
|
|
||||||
},
|
|
||||||
"Show_On_This_Page": false,
|
|
||||||
"Left": 2.0056293,
|
|
||||||
"Top": 1.3495445,
|
|
||||||
"Ancho": 1.3769451,
|
|
||||||
"Alto": 1.6148156,
|
|
||||||
"Angulo": 0.0,
|
|
||||||
"Enable_On_All_Pages": true,
|
|
||||||
"ShowOnThisPagesList": [
|
|
||||||
"94102.80_SE00_Página_070.png",
|
|
||||||
"94102.80_SE00_Página_071.png",
|
|
||||||
"94102.80_SE00_Página_072.png",
|
|
||||||
"94102.80_SE00_Página_073.png",
|
|
||||||
"94102.80_SE00_Página_074.png",
|
|
||||||
"94102.80_SE00_Página_075.png"
|
|
||||||
],
|
|
||||||
"Cloned": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"$type": "CtrEditor.ObjetosSim.Extraccion_Datos.osExtraccionTag, CtrEditor",
|
|
||||||
"AutoCreated": false,
|
|
||||||
"RemoverDesdeSimulacion": false,
|
|
||||||
"Nombre": "Descrip Pagina",
|
|
||||||
"Extraer": false,
|
|
||||||
"New_Row": false,
|
|
||||||
"Tag_extract": "690\n",
|
|
||||||
"Collumn_name": "Descrip Pagina",
|
|
||||||
"Collumn_number": 1,
|
|
||||||
"Copy_Number": 0,
|
|
||||||
"Show_Debug_Window": false,
|
|
||||||
"Opacity_oculto": 0.1,
|
|
||||||
"Id": {
|
|
||||||
"Value": 70
|
|
||||||
},
|
|
||||||
"Show_On_This_Page": false,
|
|
||||||
"Left": 7.490359,
|
|
||||||
"Top": 10.734316,
|
|
||||||
"Ancho": 1.8668232,
|
|
||||||
"Alto": 0.17921503,
|
|
||||||
"Angulo": 0.0,
|
|
||||||
"Enable_On_All_Pages": true,
|
|
||||||
"ShowOnThisPagesList": [
|
|
||||||
"94102.80_SE00_Página_050.png",
|
|
||||||
"94102.80_SE00_Página_051.png",
|
|
||||||
"94102.80_SE00_Página_052.png",
|
|
||||||
"94102.80_SE00_Página_053.png",
|
|
||||||
"94102.80_SE00_Página_054.png",
|
|
||||||
"94102.80_SE00_Página_055.png",
|
|
||||||
"94102.80_SE00_Página_056.png",
|
|
||||||
"94102.80_SE00_Página_057.png",
|
|
||||||
"94102.80_SE00_Página_058.png",
|
|
||||||
"94102.80_SE00_Página_059.png",
|
|
||||||
"94102.80_SE00_Página_060.png",
|
|
||||||
"94102.80_SE00_Página_061.png",
|
|
||||||
"94102.80_SE00_Página_062.png",
|
|
||||||
"94102.80_SE00_Página_063.png",
|
|
||||||
"94102.80_SE00_Página_064.png",
|
|
||||||
"94102.80_SE00_Página_065.png",
|
|
||||||
"94102.80_SE00_Página_066.png",
|
|
||||||
"94102.80_SE00_Página_067.png",
|
|
||||||
"94102.80_SE00_Página_068.png",
|
|
||||||
"94102.80_SE00_Página_069.png",
|
|
||||||
"94102.80_SE00_Página_070.png",
|
|
||||||
"94102.80_SE00_Página_071.png",
|
|
||||||
"94102.80_SE00_Página_072.png",
|
|
||||||
"94102.80_SE00_Página_073.png",
|
|
||||||
"94102.80_SE00_Página_074.png",
|
|
||||||
"94102.80_SE00_Página_075.png"
|
|
||||||
],
|
|
||||||
"Cloned": false
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"$type": "CtrEditor.ObjetosSim.Extraccion_Datos.osExtraccionTag, CtrEditor",
|
|
||||||
"AutoCreated": false,
|
|
||||||
"RemoverDesdeSimulacion": false,
|
|
||||||
"Nombre": "Comessa",
|
|
||||||
"Extraer": false,
|
|
||||||
"New_Row": false,
|
|
||||||
"Tag_extract": "690\n",
|
|
||||||
"Collumn_name": "Comessa",
|
|
||||||
"Collumn_number": 1,
|
|
||||||
"Copy_Number": 0,
|
|
||||||
"Show_Debug_Window": false,
|
|
||||||
"Opacity_oculto": 0.1,
|
|
||||||
"Id": {
|
|
||||||
"Value": 71
|
|
||||||
},
|
|
||||||
"Show_On_This_Page": false,
|
|
||||||
"Left": 11.119476,
|
|
||||||
"Top": 10.6297865,
|
|
||||||
"Ancho": 0.5749816,
|
|
||||||
"Alto": 0.14187858,
|
|
||||||
"Angulo": 0.0,
|
|
||||||
"Enable_On_All_Pages": true,
|
|
||||||
"ShowOnThisPagesList": [
|
|
||||||
"94102.80_SE00_Página_050.png",
|
|
||||||
"94102.80_SE00_Página_051.png",
|
|
||||||
"94102.80_SE00_Página_052.png",
|
|
||||||
"94102.80_SE00_Página_053.png",
|
|
||||||
"94102.80_SE00_Página_054.png",
|
|
||||||
"94102.80_SE00_Página_055.png",
|
|
||||||
"94102.80_SE00_Página_056.png",
|
|
||||||
"94102.80_SE00_Página_057.png",
|
|
||||||
"94102.80_SE00_Página_058.png",
|
|
||||||
"94102.80_SE00_Página_059.png",
|
|
||||||
"94102.80_SE00_Página_060.png",
|
|
||||||
"94102.80_SE00_Página_061.png",
|
|
||||||
"94102.80_SE00_Página_062.png",
|
|
||||||
"94102.80_SE00_Página_063.png",
|
|
||||||
"94102.80_SE00_Página_064.png",
|
|
||||||
"94102.80_SE00_Página_065.png",
|
|
||||||
"94102.80_SE00_Página_066.png",
|
|
||||||
"94102.80_SE00_Página_067.png",
|
|
||||||
"94102.80_SE00_Página_068.png",
|
|
||||||
"94102.80_SE00_Página_069.png",
|
|
||||||
"94102.80_SE00_Página_070.png",
|
|
||||||
"94102.80_SE00_Página_071.png",
|
|
||||||
"94102.80_SE00_Página_072.png",
|
|
||||||
"94102.80_SE00_Página_073.png",
|
|
||||||
"94102.80_SE00_Página_074.png",
|
|
||||||
"94102.80_SE00_Página_075.png"
|
|
||||||
],
|
|
||||||
"Cloned": false
|
|
||||||
}
|
|
||||||
]
|
|
|
@ -1,27 +0,0 @@
|
||||||
using System.Windows.Data;
|
|
||||||
using System.Windows;
|
|
||||||
|
|
||||||
namespace CtrEditor
|
|
||||||
{
|
|
||||||
public class UnsavedChangesConverter : IValueConverter
|
|
||||||
{
|
|
||||||
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
|
||||||
{
|
|
||||||
if (value is string path)
|
|
||||||
{
|
|
||||||
var viewModel = Application.Current.MainWindow?.DataContext as MainViewModel;
|
|
||||||
if (viewModel?.HasUnsavedChanges == true)
|
|
||||||
{
|
|
||||||
return $"{path} *";
|
|
||||||
}
|
|
||||||
return path;
|
|
||||||
}
|
|
||||||
return string.Empty;
|
|
||||||
}
|
|
||||||
|
|
||||||
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
|
|
||||||
{
|
|
||||||
throw new NotImplementedException();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
111
MainViewModel.cs
111
MainViewModel.cs
|
@ -19,8 +19,6 @@ using ClosedXML.Excel;
|
||||||
using CtrEditor.PopUps;
|
using CtrEditor.PopUps;
|
||||||
using System.Windows.Data;
|
using System.Windows.Data;
|
||||||
using CommunityToolkit.Mvvm.Input;
|
using CommunityToolkit.Mvvm.Input;
|
||||||
using System.Text.RegularExpressions;
|
|
||||||
using System.Collections.Specialized;
|
|
||||||
|
|
||||||
|
|
||||||
namespace CtrEditor
|
namespace CtrEditor
|
||||||
|
@ -105,20 +103,11 @@ namespace CtrEditor
|
||||||
[ObservableProperty]
|
[ObservableProperty]
|
||||||
private bool isSimulationRunning;
|
private bool isSimulationRunning;
|
||||||
|
|
||||||
[ObservableProperty]
|
|
||||||
private bool hasUnsavedChanges;
|
|
||||||
|
|
||||||
partial void OnIsSimulationRunningChanged(bool value)
|
partial void OnIsSimulationRunningChanged(bool value)
|
||||||
{
|
{
|
||||||
CommandManager.InvalidateRequerySuggested(); // Notificar que el estado de los comandos ha cambiado
|
CommandManager.InvalidateRequerySuggested(); // Notificar que el estado de los comandos ha cambiado
|
||||||
}
|
}
|
||||||
|
|
||||||
partial void OnHasUnsavedChangesChanged(bool value)
|
|
||||||
{
|
|
||||||
// Notificar el cambio del título indirectamente a través de directorioTrabajo
|
|
||||||
OnPropertyChanged(nameof(directorioTrabajo));
|
|
||||||
}
|
|
||||||
|
|
||||||
public string directorioTrabajo
|
public string directorioTrabajo
|
||||||
{
|
{
|
||||||
get => EstadoPersistente.Instance.directorio;
|
get => EstadoPersistente.Instance.directorio;
|
||||||
|
@ -196,29 +185,12 @@ namespace CtrEditor
|
||||||
{
|
{
|
||||||
if (value != null)
|
if (value != null)
|
||||||
{
|
{
|
||||||
if (HasUnsavedChanges)
|
|
||||||
{
|
|
||||||
var result = MessageBox.Show("There are unsaved changes. Do you want to save them?",
|
|
||||||
"Save Changes",
|
|
||||||
MessageBoxButton.YesNoCancel);
|
|
||||||
|
|
||||||
if (result == MessageBoxResult.Cancel)
|
|
||||||
{
|
|
||||||
OnPropertyChanged(nameof(SelectedImage)); // Restore previous selection
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else if (result == MessageBoxResult.Yes)
|
|
||||||
{
|
|
||||||
SaveStateObjetosSimulables();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
StopSimulation();
|
StopSimulation();
|
||||||
ImageSelected?.Invoke(this, datosDeTrabajo.Imagenes[value]);
|
// SaveStateObjetosSimulables(); // Guarda el estado antes de cambiar la imagen
|
||||||
|
ImageSelected?.Invoke(this, datosDeTrabajo.Imagenes[value]); // Dispara el evento con la nueva ruta de imagen
|
||||||
LoadStateObjetosSimulables();
|
LoadStateObjetosSimulables();
|
||||||
EstadoPersistente.Instance.imagen = value;
|
EstadoPersistente.Instance.imagen = value;
|
||||||
EstadoPersistente.Instance.GuardarEstado();
|
EstadoPersistente.Instance.GuardarEstado();
|
||||||
HasUnsavedChanges = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -274,7 +246,7 @@ namespace CtrEditor
|
||||||
PLCViewModel = new PLCViewModel();
|
PLCViewModel = new PLCViewModel();
|
||||||
|
|
||||||
_timerPLCUpdate = new DispatcherTimer();
|
_timerPLCUpdate = new DispatcherTimer();
|
||||||
_timerPLCUpdate.Interval = TimeSpan.FromMilliseconds(50); // ajusta el intervalo según sea necesario
|
_timerPLCUpdate.Interval = TimeSpan.FromMilliseconds(2); // ajusta el intervalo según sea necesario
|
||||||
_timerPLCUpdate.Tick += OnRefreshEvent;
|
_timerPLCUpdate.Tick += OnRefreshEvent;
|
||||||
|
|
||||||
InitializeTipoSimulableList();
|
InitializeTipoSimulableList();
|
||||||
|
@ -282,7 +254,7 @@ namespace CtrEditor
|
||||||
ItemDoubleClickCommand = new ParameterizedRelayCommand(ExecuteDoubleClick);
|
ItemDoubleClickCommand = new ParameterizedRelayCommand(ExecuteDoubleClick);
|
||||||
|
|
||||||
_timerSimulacion = new DispatcherTimer();
|
_timerSimulacion = new DispatcherTimer();
|
||||||
_timerSimulacion.Interval = TimeSpan.FromMilliseconds(10); // ajusta el intervalo según sea necesario
|
_timerSimulacion.Interval = TimeSpan.FromMilliseconds(1); // ajusta el intervalo según sea necesario
|
||||||
_timerSimulacion.Tick += OnTickSimulacion;
|
_timerSimulacion.Tick += OnTickSimulacion;
|
||||||
|
|
||||||
StartSimulationCommand = new RelayCommand(StartSimulation);
|
StartSimulationCommand = new RelayCommand(StartSimulation);
|
||||||
|
@ -308,12 +280,6 @@ namespace CtrEditor
|
||||||
|
|
||||||
stopwatch_Sim = new Stopwatch();
|
stopwatch_Sim = new Stopwatch();
|
||||||
stopwatch_Sim.Start();
|
stopwatch_Sim.Start();
|
||||||
|
|
||||||
ObjetosSimulables.CollectionChanged += (s, e) =>
|
|
||||||
{
|
|
||||||
if (e.Action != NotifyCollectionChangedAction.Move)
|
|
||||||
HasUnsavedChanges = true;
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OsListFilter_PropertyChanged(object? sender, PropertyChangedEventArgs e)
|
private void OsListFilter_PropertyChanged(object? sender, PropertyChangedEventArgs e)
|
||||||
|
@ -362,11 +328,8 @@ namespace CtrEditor
|
||||||
if (NuevoOsBase != null)
|
if (NuevoOsBase != null)
|
||||||
{
|
{
|
||||||
if (CrearUserControlDesdeObjetoSimulable(NuevoOsBase))
|
if (CrearUserControlDesdeObjetoSimulable(NuevoOsBase))
|
||||||
{
|
|
||||||
// Añadir el nuevo osBase a la colección de objetos simulables
|
// Añadir el nuevo osBase a la colección de objetos simulables
|
||||||
ObjetosSimulables.Add(NuevoOsBase);
|
ObjetosSimulables.Add(NuevoOsBase);
|
||||||
HasUnsavedChanges = true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return NuevoOsBase;
|
return NuevoOsBase;
|
||||||
}
|
}
|
||||||
|
@ -401,7 +364,6 @@ namespace CtrEditor
|
||||||
ObjetosSimulables.Remove(osObjeto);
|
ObjetosSimulables.Remove(osObjeto);
|
||||||
if (osObjeto.VisualRepresentation != null)
|
if (osObjeto.VisualRepresentation != null)
|
||||||
MainWindow.EliminarUserControlDelCanvas(osObjeto.VisualRepresentation);
|
MainWindow.EliminarUserControlDelCanvas(osObjeto.VisualRepresentation);
|
||||||
HasUnsavedChanges = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -436,16 +398,13 @@ namespace CtrEditor
|
||||||
if (NuevoObjetoDuplicado != null)
|
if (NuevoObjetoDuplicado != null)
|
||||||
{
|
{
|
||||||
NuevoObjetoDuplicado.Id.ObtenerNuevaID();
|
NuevoObjetoDuplicado.Id.ObtenerNuevaID();
|
||||||
string nombre = Regex.IsMatch(NuevoObjetoDuplicado.Nombre, @"_\d+$")
|
string nombre = NuevoObjetoDuplicado.Nombre + "_" + NuevoObjetoDuplicado.Id.Value;
|
||||||
? Regex.Replace(NuevoObjetoDuplicado.Nombre, @"_\d+$", $"_{NuevoObjetoDuplicado.Id.Value}")
|
|
||||||
: NuevoObjetoDuplicado.Nombre + "_" + NuevoObjetoDuplicado.Id.Value;
|
|
||||||
|
|
||||||
NuevoObjetoDuplicado.Nombre = nombre;
|
NuevoObjetoDuplicado.Nombre = nombre;
|
||||||
NuevoObjetoDuplicado.Left += OffsetX;
|
NuevoObjetoDuplicado.Left += OffsetX;
|
||||||
NuevoObjetoDuplicado.Top += OffsetY;
|
NuevoObjetoDuplicado.Top += OffsetY;
|
||||||
ObjetosSimulables.Add(NuevoObjetoDuplicado);
|
ObjetosSimulables.Add(NuevoObjetoDuplicado);
|
||||||
CrearUserControlDesdeObjetoSimulable(NuevoObjetoDuplicado);
|
CrearUserControlDesdeObjetoSimulable(NuevoObjetoDuplicado);
|
||||||
HasUnsavedChanges = true;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
|
@ -460,26 +419,13 @@ namespace CtrEditor
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public void EliminarObjetoSeleccionado()
|
private void EliminarUserControl()
|
||||||
{
|
{
|
||||||
if (SelectedItemOsList is osBase objEliminar)
|
if (SelectedItemOsList is osBase objEliminar)
|
||||||
{
|
|
||||||
var result = MessageBox.Show($"¿Está seguro que desea eliminar el objeto '{objEliminar.Nombre}'?",
|
|
||||||
"Confirmar eliminación",
|
|
||||||
MessageBoxButton.YesNo,
|
|
||||||
MessageBoxImage.Question);
|
|
||||||
|
|
||||||
if (result == MessageBoxResult.Yes)
|
|
||||||
{
|
{
|
||||||
RemoverObjetoSimulable(objEliminar);
|
RemoverObjetoSimulable(objEliminar);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
private void EliminarUserControl()
|
|
||||||
{
|
|
||||||
EliminarObjetoSeleccionado();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
private void EliminarTodosCommand()
|
private void EliminarTodosCommand()
|
||||||
|
@ -710,7 +656,6 @@ namespace CtrEditor
|
||||||
|
|
||||||
// Guarda el libro de Excel.
|
// Guarda el libro de Excel.
|
||||||
workbook.SaveAs(filePath);
|
workbook.SaveAs(filePath);
|
||||||
HasUnsavedChanges = false;
|
|
||||||
}
|
}
|
||||||
catch (IOException ex)
|
catch (IOException ex)
|
||||||
{
|
{
|
||||||
|
@ -779,8 +724,6 @@ namespace CtrEditor
|
||||||
|
|
||||||
private void OnTickSimulacion(object sender, EventArgs e)
|
private void OnTickSimulacion(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var stopwatch = Stopwatch.StartNew(); // Start measuring time
|
|
||||||
|
|
||||||
// Detener el cronómetro y obtener el tiempo transcurrido en milisegundos
|
// Detener el cronómetro y obtener el tiempo transcurrido en milisegundos
|
||||||
var elapsedMilliseconds = stopwatch_Sim.Elapsed.TotalMilliseconds - stopwatch_SimModel_last;
|
var elapsedMilliseconds = stopwatch_Sim.Elapsed.TotalMilliseconds - stopwatch_SimModel_last;
|
||||||
stopwatch_SimModel_last = stopwatch_Sim.Elapsed.TotalMilliseconds;
|
stopwatch_SimModel_last = stopwatch_Sim.Elapsed.TotalMilliseconds;
|
||||||
|
@ -806,8 +749,6 @@ namespace CtrEditor
|
||||||
RemoverObjetoSimulable(objetoSimulable);
|
RemoverObjetoSimulable(objetoSimulable);
|
||||||
}
|
}
|
||||||
|
|
||||||
stopwatch.Stop(); // Stop measuring time
|
|
||||||
//Debug.WriteLine($"OnTickSimulacion execution time: {stopwatch.TotalMilliseconds} ms");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ConnectPLC()
|
private void ConnectPLC()
|
||||||
|
@ -827,41 +768,19 @@ namespace CtrEditor
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<osBase> objetosSimulablesLlamados = new List<osBase>();
|
|
||||||
|
|
||||||
private void OnRefreshEvent(object sender, EventArgs e)
|
private void OnRefreshEvent(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
var stopwatch = Stopwatch.StartNew(); // Start measuring time
|
|
||||||
|
|
||||||
if (PLCViewModel.IsConnected)
|
if (PLCViewModel.IsConnected)
|
||||||
{
|
{
|
||||||
// Detener el cronómetro y obtener el tiempo transcurrido en milisegundos
|
// Detener el cronómetro y obtener el tiempo transcurrido en milisegundos
|
||||||
var elapsedMilliseconds = stopwatch_Sim.Elapsed.TotalMilliseconds - stopwatch_SimPLC_last;
|
var elapsedMilliseconds = stopwatch_Sim.Elapsed.TotalMilliseconds - stopwatch_SimPLC_last;
|
||||||
stopwatch_SimPLC_last = stopwatch_Sim.Elapsed.TotalMilliseconds;
|
stopwatch_SimPLC_last = stopwatch_Sim.Elapsed.TotalMilliseconds;
|
||||||
|
|
||||||
|
|
||||||
// Reiniciar el cronómetro para la próxima medición
|
// Reiniciar el cronómetro para la próxima medición
|
||||||
var remainingObjetosSimulables = ObjetosSimulables.Except(objetosSimulablesLlamados).ToList();
|
foreach (var objetoSimulable in ObjetosSimulables)
|
||||||
|
|
||||||
foreach (var objetoSimulable in remainingObjetosSimulables)
|
|
||||||
{
|
|
||||||
var objStopwatch = Stopwatch.StartNew();
|
|
||||||
objetoSimulable.UpdatePLC(PLCViewModel, (int)elapsedMilliseconds);
|
objetoSimulable.UpdatePLC(PLCViewModel, (int)elapsedMilliseconds);
|
||||||
objStopwatch.Stop();
|
|
||||||
|
|
||||||
objetosSimulablesLlamados.Add(objetoSimulable);
|
|
||||||
|
|
||||||
if (stopwatch.Elapsed.TotalMilliseconds >= 10)
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (remainingObjetosSimulables.Count == 0)
|
|
||||||
{
|
|
||||||
objetosSimulablesLlamados.Clear();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
stopwatch.Stop(); // Stop measuring time
|
|
||||||
Debug.WriteLine($"OnRefreshEvent: {stopwatch.Elapsed.TotalMilliseconds} ms");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OpenWorkDirectory()
|
private void OpenWorkDirectory()
|
||||||
|
@ -927,8 +846,6 @@ namespace CtrEditor
|
||||||
// Restaurar las propiedades originales de los objetos
|
// Restaurar las propiedades originales de los objetos
|
||||||
foreach (var obj in ObjetosSimulables)
|
foreach (var obj in ObjetosSimulables)
|
||||||
obj.RestaurarDatosNoSerializables();
|
obj.RestaurarDatosNoSerializables();
|
||||||
|
|
||||||
HasUnsavedChanges = false;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1038,17 +955,7 @@ namespace CtrEditor
|
||||||
|
|
||||||
private void Exit()
|
private void Exit()
|
||||||
{
|
{
|
||||||
if (HasUnsavedChanges)
|
Save();
|
||||||
{
|
|
||||||
var result = MessageBox.Show("There are unsaved changes. Do you want to save them?",
|
|
||||||
"Save Changes",
|
|
||||||
MessageBoxButton.YesNoCancel);
|
|
||||||
|
|
||||||
if (result == MessageBoxResult.Cancel)
|
|
||||||
return;
|
|
||||||
else if (result == MessageBoxResult.Yes)
|
|
||||||
SaveStateObjetosSimulables();
|
|
||||||
}
|
|
||||||
Application.Current.Shutdown();
|
Application.Current.Shutdown();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -5,7 +5,7 @@
|
||||||
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit" xmlns:sys="clr-namespace:System;assembly=mscorlib"
|
||||||
xmlns:ObjetosSim="clr-namespace:CtrEditor.ObjetosSim"
|
xmlns:ObjetosSim="clr-namespace:CtrEditor.ObjetosSim"
|
||||||
xmlns:ObjetosExtraccion="clr-namespace:CtrEditor.ObjetosSim.Extraccion_Datos" x:Class="CtrEditor.MainWindow"
|
xmlns:ObjetosExtraccion="clr-namespace:CtrEditor.ObjetosSim.Extraccion_Datos" x:Class="CtrEditor.MainWindow"
|
||||||
Height="900" Width="1600" WindowState="Maximized" ResizeMode="CanResize" Title="{Binding directorioTrabajo, Converter={StaticResource UnsavedChangesConverter}}"
|
Height="900" Width="1600" WindowState="Maximized" ResizeMode="CanResize" Title="{Binding directorioTrabajo}"
|
||||||
Icon="/app2.png">
|
Icon="/app2.png">
|
||||||
|
|
||||||
<Window.DataContext>
|
<Window.DataContext>
|
||||||
|
|
|
@ -49,6 +49,7 @@ namespace CtrEditor
|
||||||
private bool _isResizingUserControl = false;
|
private bool _isResizingUserControl = false;
|
||||||
private bool _isDraggingUserControl = false;
|
private bool _isDraggingUserControl = false;
|
||||||
private bool _isMovingUserControl = false;
|
private bool _isMovingUserControl = false;
|
||||||
|
private double _initialAngleUserControl;
|
||||||
private TextBlock _angleDisplayTextBlock;
|
private TextBlock _angleDisplayTextBlock;
|
||||||
|
|
||||||
public MainWindow()
|
public MainWindow()
|
||||||
|
@ -65,11 +66,7 @@ namespace CtrEditor
|
||||||
ImagenEnTrabajoCanvas.MouseDown += Canvas_MouseDown_Panning;
|
ImagenEnTrabajoCanvas.MouseDown += Canvas_MouseDown_Panning;
|
||||||
ImagenEnTrabajoCanvas.MouseMove += Canvas_MouseMove_Panning;
|
ImagenEnTrabajoCanvas.MouseMove += Canvas_MouseMove_Panning;
|
||||||
ImagenEnTrabajoCanvas.MouseUp += Canvas_MouseUp_Panning;
|
ImagenEnTrabajoCanvas.MouseUp += Canvas_MouseUp_Panning;
|
||||||
|
|
||||||
// Agregar el evento KeyDown a la ventana
|
|
||||||
this.KeyDown += MainWindow_KeyDown;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void MainWindow_Loaded(object sender, RoutedEventArgs e)
|
private void MainWindow_Loaded(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (DataContext is MainViewModel viewModel)
|
if (DataContext is MainViewModel viewModel)
|
||||||
|
@ -106,7 +103,7 @@ namespace CtrEditor
|
||||||
SuscribirEventos(userControl);
|
SuscribirEventos(userControl);
|
||||||
|
|
||||||
// Añade el UserControl al Canvas
|
// Añade el UserControl al Canvas
|
||||||
Canvas.SetZIndex(userControl, ((int)dataContainer.ZIndex_Base() + dataContainer.zIndex_fromFrames));
|
Canvas.SetZIndex(userControl, ((int)dataContainer.ZIndex()));
|
||||||
ImagenEnTrabajoCanvas.Children.Add(userControl);
|
ImagenEnTrabajoCanvas.Children.Add(userControl);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -159,6 +156,7 @@ namespace CtrEditor
|
||||||
rotateTransform = new RotateTransform();
|
rotateTransform = new RotateTransform();
|
||||||
userControl.RenderTransform = rotateTransform;
|
userControl.RenderTransform = rotateTransform;
|
||||||
}
|
}
|
||||||
|
_initialAngleUserControl = rotateTransform.Angle;
|
||||||
|
|
||||||
// Establecer el punto inicial de referencia para el cálculo de rotación
|
// Establecer el punto inicial de referencia para el cálculo de rotación
|
||||||
_startPointUserControl = new Point(rotateTransform.CenterX, rotateTransform.CenterY);
|
_startPointUserControl = new Point(rotateTransform.CenterX, rotateTransform.CenterY);
|
||||||
|
@ -228,8 +226,6 @@ namespace CtrEditor
|
||||||
}
|
}
|
||||||
|
|
||||||
private async void TimerCallbackRemoveResizeRectangles(object state)
|
private async void TimerCallbackRemoveResizeRectangles(object state)
|
||||||
{
|
|
||||||
if (Application.Current != null)
|
|
||||||
{
|
{
|
||||||
Application.Current.Dispatcher.Invoke(() =>
|
Application.Current.Dispatcher.Invoke(() =>
|
||||||
{
|
{
|
||||||
|
@ -237,7 +233,6 @@ namespace CtrEditor
|
||||||
MakeResizeRectanglesTransparent();
|
MakeResizeRectanglesTransparent();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public void PauseTimerRemoveResizeRectangles()
|
public void PauseTimerRemoveResizeRectangles()
|
||||||
{
|
{
|
||||||
|
@ -401,20 +396,8 @@ namespace CtrEditor
|
||||||
|
|
||||||
private Point lastMousePosition;
|
private Point lastMousePosition;
|
||||||
|
|
||||||
private void MarkUnsavedChanges()
|
|
||||||
{
|
|
||||||
if (DataContext is MainViewModel viewModel)
|
|
||||||
{
|
|
||||||
if (_isMovingUserControl || _isRotatingUserControl || _isResizingUserControl || _isDraggingUserControl)
|
|
||||||
{
|
|
||||||
viewModel.HasUnsavedChanges = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void UserControl_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
|
private void UserControl_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
|
||||||
{
|
{
|
||||||
MarkUnsavedChanges();
|
|
||||||
if (_isResizingUserControl && resizeRectangles != null && resizeRectangles.Contains(sender))
|
if (_isResizingUserControl && resizeRectangles != null && resizeRectangles.Contains(sender))
|
||||||
{
|
{
|
||||||
_isResizingUserControl = false;
|
_isResizingUserControl = false;
|
||||||
|
@ -431,7 +414,6 @@ namespace CtrEditor
|
||||||
AddResizeRectangles(_currentDraggingControl);
|
AddResizeRectangles(_currentDraggingControl);
|
||||||
_isResizingUserControl = _isRotatingUserControl = _isDraggingUserControl = false;
|
_isResizingUserControl = _isRotatingUserControl = _isDraggingUserControl = false;
|
||||||
_isMovingUserControl = false;
|
_isMovingUserControl = false;
|
||||||
|
|
||||||
// Ocultar el TextBlock de ángulo
|
// Ocultar el TextBlock de ángulo
|
||||||
if (_angleDisplayTextBlock != null)
|
if (_angleDisplayTextBlock != null)
|
||||||
{
|
{
|
||||||
|
@ -729,7 +711,7 @@ namespace CtrEditor
|
||||||
|
|
||||||
private void ZoomTimer_Tick(object sender, EventArgs e)
|
private void ZoomTimer_Tick(object sender, EventArgs e)
|
||||||
{
|
{
|
||||||
double elapsedMilliseconds = _stopwatch.Elapsed.TotalMilliseconds;
|
double elapsedMilliseconds = _stopwatch.ElapsedMilliseconds;
|
||||||
|
|
||||||
if (elapsedMilliseconds >= _ZoomDuration)
|
if (elapsedMilliseconds >= _ZoomDuration)
|
||||||
{
|
{
|
||||||
|
@ -823,15 +805,6 @@ namespace CtrEditor
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void MainWindow_KeyDown(object sender, KeyEventArgs e)
|
|
||||||
{
|
|
||||||
if (e.Key == Key.Delete && DataContext is MainViewModel viewModel)
|
|
||||||
{
|
|
||||||
viewModel.EliminarObjetoSeleccionado();
|
|
||||||
e.Handled = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class FloatValidationRule : ValidationRule
|
public class FloatValidationRule : ValidationRule
|
||||||
|
|
|
@ -36,16 +36,6 @@ namespace CtrEditor.ObjetosSim
|
||||||
set => SetProperty(ref nombre, value);
|
set => SetProperty(ref nombre, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
[ObservableProperty]
|
|
||||||
[property: Description("Layer index to add to Objects on the Frame")]
|
|
||||||
[property: Category("Layer:")]
|
|
||||||
int zindex_FramePlate;
|
|
||||||
|
|
||||||
partial void OnZindex_FramePlateChanged(int value)
|
|
||||||
{
|
|
||||||
UpdateZIndex(value);
|
|
||||||
}
|
|
||||||
|
|
||||||
[ObservableProperty]
|
[ObservableProperty]
|
||||||
Color color;
|
Color color;
|
||||||
[ObservableProperty]
|
[ObservableProperty]
|
||||||
|
@ -73,59 +63,29 @@ namespace CtrEditor.ObjetosSim
|
||||||
[property: Category("Encoders:")]
|
[property: Category("Encoders:")]
|
||||||
public float offset_encoder_X;
|
public float offset_encoder_X;
|
||||||
|
|
||||||
partial void OnK_encoder_XChanged(float value)
|
|
||||||
{
|
|
||||||
UpdatePosition();
|
|
||||||
}
|
|
||||||
|
|
||||||
partial void OnOffset_encoder_XChanged(float value)
|
|
||||||
{
|
|
||||||
UpdatePosition();
|
|
||||||
}
|
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
private osEncoderMotorLineal EncoderX;
|
private osEncoderMotorLineal EncoderX;
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
private bool isUpdatingFromEncoderX = false;
|
private float EncoderXValue;
|
||||||
|
|
||||||
partial void OnEncoder_XChanged(string value)
|
partial void OnEncoder_XChanged(string value)
|
||||||
{
|
{
|
||||||
if (EncoderX != null)
|
|
||||||
EncoderX.PropertyChanged -= OnEncoderXPropertyChanged;
|
|
||||||
if (_mainViewModel != null && value != null && value.Length > 0)
|
if (_mainViewModel != null && value != null && value.Length > 0)
|
||||||
{
|
{
|
||||||
EncoderX = (osEncoderMotorLineal)_mainViewModel.ObjetosSimulables.FirstOrDefault(s => (s is osEncoderMotorLineal && s.Nombre == value), null);
|
EncoderX = (osEncoderMotorLineal)_mainViewModel.ObjetosSimulables.FirstOrDefault(s => (s is osEncoderMotorLineal && s.Nombre == value), null);
|
||||||
if (EncoderX != null)
|
|
||||||
EncoderX.PropertyChanged += OnEncoderXPropertyChanged;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void OnEncoderXPropertyChanged(object sender, PropertyChangedEventArgs e)
|
public override void UpdateControl(int elapsedMilliseconds)
|
||||||
{
|
|
||||||
if (!isUpdatingFromEncoderX)
|
|
||||||
{
|
|
||||||
isUpdatingFromEncoderX = true;
|
|
||||||
// Actualizamos el nombre si este fue modificado
|
|
||||||
if (e.PropertyName == nameof(osEncoderMotorLineal.Nombre))
|
|
||||||
Group_Panel = ((osEncoderMotorLineal)sender).Nombre;
|
|
||||||
|
|
||||||
if (e.PropertyName == nameof(osEncoderMotorLineal.Valor_Actual))
|
|
||||||
{
|
|
||||||
UpdatePosition();
|
|
||||||
}
|
|
||||||
|
|
||||||
isUpdatingFromEncoderX = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void UpdatePosition()
|
|
||||||
{
|
{
|
||||||
if (EncoderX == null)
|
if (EncoderX == null)
|
||||||
return;
|
return;
|
||||||
if (K_encoder_X == 0)
|
if (K_encoder_X == 0)
|
||||||
return;
|
return;
|
||||||
|
if (EncoderXValue != EncoderX.Valor_Actual)
|
||||||
Left = (EncoderX.Valor_Actual / k_encoder_X) + offset_encoder_X;
|
Left = (EncoderX.Valor_Actual / k_encoder_X) + offset_encoder_X;
|
||||||
|
EncoderXValue = EncoderX.Valor_Actual;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void TopChanging(float oldValue, float newValue)
|
public override void TopChanging(float oldValue, float newValue)
|
||||||
|
@ -144,7 +104,6 @@ namespace CtrEditor.ObjetosSim
|
||||||
Alto_Titulo = 0.2f;
|
Alto_Titulo = 0.2f;
|
||||||
Color = Colors.WhiteSmoke;
|
Color = Colors.WhiteSmoke;
|
||||||
Titulo = "Frame";
|
Titulo = "Frame";
|
||||||
Zindex_FramePlate = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void ucLoaded()
|
public override void ucLoaded()
|
||||||
|
@ -152,7 +111,6 @@ namespace CtrEditor.ObjetosSim
|
||||||
base.ucLoaded();
|
base.ucLoaded();
|
||||||
// El UserControl se ha cargado
|
// El UserControl se ha cargado
|
||||||
OnEncoder_XChanged(Encoder_X);
|
OnEncoder_XChanged(Encoder_X);
|
||||||
UpdateZIndex(Zindex_FramePlate);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void ucUnLoaded()
|
public override void ucUnLoaded()
|
||||||
|
@ -167,7 +125,6 @@ namespace CtrEditor.ObjetosSim
|
||||||
public partial class ucFramePlate : UserControl, IDataContainer
|
public partial class ucFramePlate : UserControl, IDataContainer
|
||||||
{
|
{
|
||||||
public osBase? Datos { get; set; }
|
public osBase? Datos { get; set; }
|
||||||
public int zIndex_fromFrames { get; set; }
|
|
||||||
|
|
||||||
public ucFramePlate()
|
public ucFramePlate()
|
||||||
{
|
{
|
||||||
|
@ -184,7 +141,7 @@ namespace CtrEditor.ObjetosSim
|
||||||
Datos?.ucUnLoaded();
|
Datos?.ucUnLoaded();
|
||||||
}
|
}
|
||||||
public void Highlight(bool State) { }
|
public void Highlight(bool State) { }
|
||||||
public ZIndexEnum ZIndex_Base()
|
public ZIndexEnum ZIndex()
|
||||||
{
|
{
|
||||||
return ZIndexEnum.Decorativos;
|
return ZIndexEnum.Decorativos;
|
||||||
}
|
}
|
||||||
|
|
|
@ -70,7 +70,6 @@ namespace CtrEditor.ObjetosSim
|
||||||
public partial class ucTextPlate : UserControl, IDataContainer
|
public partial class ucTextPlate : UserControl, IDataContainer
|
||||||
{
|
{
|
||||||
public osBase? Datos { get; set; }
|
public osBase? Datos { get; set; }
|
||||||
public int zIndex_fromFrames { get; set; }
|
|
||||||
|
|
||||||
public ucTextPlate()
|
public ucTextPlate()
|
||||||
{
|
{
|
||||||
|
@ -87,7 +86,7 @@ namespace CtrEditor.ObjetosSim
|
||||||
Datos?.ucUnLoaded();
|
Datos?.ucUnLoaded();
|
||||||
}
|
}
|
||||||
public void Highlight(bool State) { }
|
public void Highlight(bool State) { }
|
||||||
public ZIndexEnum ZIndex_Base()
|
public ZIndexEnum ZIndex()
|
||||||
{
|
{
|
||||||
return ZIndexEnum.Decorativos;
|
return ZIndexEnum.Decorativos;
|
||||||
}
|
}
|
||||||
|
|
|
@ -168,7 +168,6 @@ namespace CtrEditor.ObjetosSim
|
||||||
public partial class ucBotella : UserControl, IDataContainer
|
public partial class ucBotella : UserControl, IDataContainer
|
||||||
{
|
{
|
||||||
public osBase? Datos { get; set; }
|
public osBase? Datos { get; set; }
|
||||||
public int zIndex_fromFrames { get; set; }
|
|
||||||
|
|
||||||
public ucBotella()
|
public ucBotella()
|
||||||
{
|
{
|
||||||
|
@ -186,7 +185,7 @@ namespace CtrEditor.ObjetosSim
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Highlight(bool State) { }
|
public void Highlight(bool State) { }
|
||||||
public ZIndexEnum ZIndex_Base()
|
public ZIndexEnum ZIndex()
|
||||||
{
|
{
|
||||||
return ZIndexEnum.Dinamicos;
|
return ZIndexEnum.Dinamicos;
|
||||||
}
|
}
|
||||||
|
|
|
@ -154,7 +154,6 @@ namespace CtrEditor.ObjetosSim
|
||||||
public partial class ucBotellaCuello : UserControl, IDataContainer
|
public partial class ucBotellaCuello : UserControl, IDataContainer
|
||||||
{
|
{
|
||||||
public osBase? Datos { get; set; }
|
public osBase? Datos { get; set; }
|
||||||
public int zIndex_fromFrames { get; set; }
|
|
||||||
|
|
||||||
public ucBotellaCuello()
|
public ucBotellaCuello()
|
||||||
{
|
{
|
||||||
|
@ -172,7 +171,7 @@ namespace CtrEditor.ObjetosSim
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Highlight(bool State) { }
|
public void Highlight(bool State) { }
|
||||||
public ZIndexEnum ZIndex_Base()
|
public ZIndexEnum ZIndex()
|
||||||
{
|
{
|
||||||
return ZIndexEnum.Dinamicos;
|
return ZIndexEnum.Dinamicos;
|
||||||
}
|
}
|
||||||
|
|
|
@ -194,7 +194,6 @@ namespace CtrEditor.ObjetosSim
|
||||||
public partial class ucBottGenerator : UserControl, IDataContainer
|
public partial class ucBottGenerator : UserControl, IDataContainer
|
||||||
{
|
{
|
||||||
public osBase? Datos { get; set; }
|
public osBase? Datos { get; set; }
|
||||||
public int zIndex_fromFrames { get; set; }
|
|
||||||
|
|
||||||
public ucBottGenerator()
|
public ucBottGenerator()
|
||||||
{
|
{
|
||||||
|
@ -211,7 +210,7 @@ namespace CtrEditor.ObjetosSim
|
||||||
Datos?.ucUnLoaded();
|
Datos?.ucUnLoaded();
|
||||||
}
|
}
|
||||||
public void Highlight(bool State) { }
|
public void Highlight(bool State) { }
|
||||||
public ZIndexEnum ZIndex_Base()
|
public ZIndexEnum ZIndex()
|
||||||
{
|
{
|
||||||
return ZIndexEnum.Generadores;
|
return ZIndexEnum.Generadores;
|
||||||
}
|
}
|
||||||
|
|
|
@ -157,7 +157,6 @@ namespace CtrEditor.ObjetosSim
|
||||||
public partial class ucFiller : UserControl, IDataContainer
|
public partial class ucFiller : UserControl, IDataContainer
|
||||||
{
|
{
|
||||||
public osBase? Datos { get; set; }
|
public osBase? Datos { get; set; }
|
||||||
public int zIndex_fromFrames { get; set; }
|
|
||||||
|
|
||||||
public ucFiller()
|
public ucFiller()
|
||||||
{
|
{
|
||||||
|
@ -182,7 +181,7 @@ namespace CtrEditor.ObjetosSim
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void Highlight(bool State) { }
|
public void Highlight(bool State) { }
|
||||||
public ZIndexEnum ZIndex_Base()
|
public ZIndexEnum ZIndex()
|
||||||
{
|
{
|
||||||
return ZIndexEnum.Generadores;
|
return ZIndexEnum.Generadores;
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,7 +89,6 @@ namespace CtrEditor.ObjetosSim
|
||||||
public partial class ucTanque : UserControl, IDataContainer
|
public partial class ucTanque : UserControl, IDataContainer
|
||||||
{
|
{
|
||||||
public osBase? Datos { get; set; }
|
public osBase? Datos { get; set; }
|
||||||
public int zIndex_fromFrames { get; set; }
|
|
||||||
|
|
||||||
public ucTanque()
|
public ucTanque()
|
||||||
{
|
{
|
||||||
|
@ -106,7 +105,7 @@ namespace CtrEditor.ObjetosSim
|
||||||
Datos?.ucUnLoaded();
|
Datos?.ucUnLoaded();
|
||||||
}
|
}
|
||||||
public void Highlight(bool State) { }
|
public void Highlight(bool State) { }
|
||||||
public ZIndexEnum ZIndex_Base()
|
public ZIndexEnum ZIndex()
|
||||||
{
|
{
|
||||||
return ZIndexEnum.Generadores;
|
return ZIndexEnum.Generadores;
|
||||||
}
|
}
|
||||||
|
|
|
@ -110,7 +110,6 @@ namespace CtrEditor.ObjetosSim
|
||||||
public partial class ucDescarte : UserControl, IDataContainer
|
public partial class ucDescarte : UserControl, IDataContainer
|
||||||
{
|
{
|
||||||
public osBase? Datos { get; set; }
|
public osBase? Datos { get; set; }
|
||||||
public int zIndex_fromFrames { get; set; }
|
|
||||||
|
|
||||||
public ucDescarte()
|
public ucDescarte()
|
||||||
{
|
{
|
||||||
|
@ -132,7 +131,7 @@ namespace CtrEditor.ObjetosSim
|
||||||
Datos?.ucUnLoaded();
|
Datos?.ucUnLoaded();
|
||||||
}
|
}
|
||||||
public void Highlight(bool State) { }
|
public void Highlight(bool State) { }
|
||||||
public ZIndexEnum ZIndex_Base()
|
public ZIndexEnum ZIndex()
|
||||||
{
|
{
|
||||||
return ZIndexEnum.Descarte;
|
return ZIndexEnum.Descarte;
|
||||||
}
|
}
|
||||||
|
|
|
@ -80,7 +80,6 @@ namespace CtrEditor.ObjetosSim
|
||||||
public partial class ucGuia : UserControl, IDataContainer
|
public partial class ucGuia : UserControl, IDataContainer
|
||||||
{
|
{
|
||||||
public osBase? Datos { get; set; }
|
public osBase? Datos { get; set; }
|
||||||
public int zIndex_fromFrames { get; set; }
|
|
||||||
|
|
||||||
public ucGuia()
|
public ucGuia()
|
||||||
{
|
{
|
||||||
|
@ -97,7 +96,7 @@ namespace CtrEditor.ObjetosSim
|
||||||
Datos?.ucUnLoaded();
|
Datos?.ucUnLoaded();
|
||||||
}
|
}
|
||||||
public void Highlight(bool State) { }
|
public void Highlight(bool State) { }
|
||||||
public ZIndexEnum ZIndex_Base()
|
public ZIndexEnum ZIndex()
|
||||||
{
|
{
|
||||||
return ZIndexEnum.Guias;
|
return ZIndexEnum.Guias;
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,6 @@ using LibS7Adv;
|
||||||
using CtrEditor.Simulacion;
|
using CtrEditor.Simulacion;
|
||||||
using Xceed.Wpf.Toolkit.PropertyGrid.Attributes;
|
using Xceed.Wpf.Toolkit.PropertyGrid.Attributes;
|
||||||
using CtrEditor.FuncionesBase;
|
using CtrEditor.FuncionesBase;
|
||||||
using System.Text.Json.Serialization;
|
|
||||||
|
|
||||||
namespace CtrEditor.ObjetosSim
|
namespace CtrEditor.ObjetosSim
|
||||||
{
|
{
|
||||||
|
@ -67,29 +66,24 @@ namespace CtrEditor.ObjetosSim
|
||||||
[property: ItemsSource(typeof(osBaseItemsSource<osVMmotorSim>))]
|
[property: ItemsSource(typeof(osBaseItemsSource<osVMmotorSim>))]
|
||||||
string id_Motor;
|
string id_Motor;
|
||||||
|
|
||||||
[JsonIgnore]
|
|
||||||
private PropertyChangedEventHandler motorPropertyChangedHandler;
|
|
||||||
|
|
||||||
partial void OnId_MotorChanged(string value)
|
partial void OnId_MotorChanged(string value)
|
||||||
{
|
{
|
||||||
if (Motor != null && motorPropertyChangedHandler != null)
|
|
||||||
Motor.PropertyChanged -= motorPropertyChangedHandler;
|
|
||||||
|
|
||||||
if (_mainViewModel != null && !string.IsNullOrEmpty(value))
|
|
||||||
{
|
|
||||||
Motor = (osVMmotorSim)_mainViewModel.ObjetosSimulables.FirstOrDefault(s => s is osVMmotorSim motor && motor.Nombre == value);
|
|
||||||
if (Motor != null)
|
if (Motor != null)
|
||||||
|
Motor.PropertyChanged -= OnMotorPropertyChanged;
|
||||||
|
if (_mainViewModel != null && value != null && value.Length > 0)
|
||||||
{
|
{
|
||||||
motorPropertyChangedHandler = (sender, e) =>
|
Motor = (osVMmotorSim)_mainViewModel.ObjetosSimulables.FirstOrDefault(s => (s is osVMmotorSim && s.Nombre == value), null);
|
||||||
|
if (Motor != null)
|
||||||
|
Motor.PropertyChanged += OnMotorPropertyChanged;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnMotorPropertyChanged(object sender, PropertyChangedEventArgs e)
|
||||||
{
|
{
|
||||||
if (e.PropertyName == nameof(osVMmotorSim.Nombre))
|
if (e.PropertyName == nameof(osVMmotorSim.Nombre))
|
||||||
{
|
{
|
||||||
Id_Motor = ((osVMmotorSim)sender).Nombre;
|
Id_Motor = ((osVMmotorSim)sender).Nombre;
|
||||||
}
|
}
|
||||||
};
|
|
||||||
Motor.PropertyChanged += motorPropertyChangedHandler;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void AnguloChanged(float value)
|
public override void AnguloChanged(float value)
|
||||||
|
@ -178,7 +172,6 @@ namespace CtrEditor.ObjetosSim
|
||||||
public partial class ucTransporteCurva : UserControl, IDataContainer
|
public partial class ucTransporteCurva : UserControl, IDataContainer
|
||||||
{
|
{
|
||||||
public osBase? Datos { get; set; }
|
public osBase? Datos { get; set; }
|
||||||
public int zIndex_fromFrames { get; set; }
|
|
||||||
|
|
||||||
public ucTransporteCurva()
|
public ucTransporteCurva()
|
||||||
{
|
{
|
||||||
|
@ -195,7 +188,7 @@ namespace CtrEditor.ObjetosSim
|
||||||
Datos?.ucUnLoaded();
|
Datos?.ucUnLoaded();
|
||||||
}
|
}
|
||||||
public void Highlight(bool State) { }
|
public void Highlight(bool State) { }
|
||||||
public ZIndexEnum ZIndex_Base()
|
public ZIndexEnum ZIndex()
|
||||||
{
|
{
|
||||||
return ZIndexEnum.Estaticos;
|
return ZIndexEnum.Estaticos;
|
||||||
}
|
}
|
||||||
|
|
|
@ -7,7 +7,6 @@ using LibS7Adv;
|
||||||
using CtrEditor.Simulacion;
|
using CtrEditor.Simulacion;
|
||||||
using Xceed.Wpf.Toolkit.PropertyGrid.Attributes;
|
using Xceed.Wpf.Toolkit.PropertyGrid.Attributes;
|
||||||
using CtrEditor.FuncionesBase;
|
using CtrEditor.FuncionesBase;
|
||||||
using System.Text.Json.Serialization;
|
|
||||||
|
|
||||||
namespace CtrEditor.ObjetosSim
|
namespace CtrEditor.ObjetosSim
|
||||||
{
|
{
|
||||||
|
@ -75,29 +74,24 @@ namespace CtrEditor.ObjetosSim
|
||||||
[property: ItemsSource(typeof(osBaseItemsSource<osVMmotorSim>))]
|
[property: ItemsSource(typeof(osBaseItemsSource<osVMmotorSim>))]
|
||||||
string id_Motor;
|
string id_Motor;
|
||||||
|
|
||||||
[JsonIgnore]
|
|
||||||
private PropertyChangedEventHandler motorPropertyChangedHandler;
|
|
||||||
|
|
||||||
partial void OnId_MotorChanged(string value)
|
partial void OnId_MotorChanged(string value)
|
||||||
{
|
{
|
||||||
if (Motor != null && motorPropertyChangedHandler != null)
|
|
||||||
Motor.PropertyChanged -= motorPropertyChangedHandler;
|
|
||||||
|
|
||||||
if (_mainViewModel != null && !string.IsNullOrEmpty(value))
|
|
||||||
{
|
|
||||||
Motor = (osVMmotorSim)_mainViewModel.ObjetosSimulables.FirstOrDefault(s => s is osVMmotorSim motor && motor.Nombre == value);
|
|
||||||
if (Motor != null)
|
if (Motor != null)
|
||||||
|
Motor.PropertyChanged -= OnMotorPropertyChanged;
|
||||||
|
if (_mainViewModel != null && value != null && value.Length > 0)
|
||||||
{
|
{
|
||||||
motorPropertyChangedHandler = (sender, e) =>
|
Motor = (osVMmotorSim)_mainViewModel.ObjetosSimulables.FirstOrDefault(s => (s is osVMmotorSim && s.Nombre == value), null);
|
||||||
|
if (Motor != null)
|
||||||
|
Motor.PropertyChanged += OnMotorPropertyChanged;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnMotorPropertyChanged(object sender, PropertyChangedEventArgs e)
|
||||||
{
|
{
|
||||||
if (e.PropertyName == nameof(osVMmotorSim.Nombre))
|
if (e.PropertyName == nameof(osVMmotorSim.Nombre))
|
||||||
{
|
{
|
||||||
Id_Motor = ((osVMmotorSim)sender).Nombre;
|
Id_Motor = ((osVMmotorSim)sender).Nombre;
|
||||||
}
|
}
|
||||||
};
|
|
||||||
Motor.PropertyChanged += motorPropertyChangedHandler;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void AltoChanged(float value)
|
public override void AltoChanged(float value)
|
||||||
|
@ -206,7 +200,6 @@ namespace CtrEditor.ObjetosSim
|
||||||
public partial class ucTransporteGuias : UserControl, IDataContainer
|
public partial class ucTransporteGuias : UserControl, IDataContainer
|
||||||
{
|
{
|
||||||
public osBase? Datos { get; set; }
|
public osBase? Datos { get; set; }
|
||||||
public int zIndex_fromFrames { get; set; }
|
|
||||||
|
|
||||||
public ucTransporteGuias()
|
public ucTransporteGuias()
|
||||||
{
|
{
|
||||||
|
@ -223,7 +216,7 @@ namespace CtrEditor.ObjetosSim
|
||||||
Datos?.ucUnLoaded();
|
Datos?.ucUnLoaded();
|
||||||
}
|
}
|
||||||
public void Highlight(bool State) { }
|
public void Highlight(bool State) { }
|
||||||
public ZIndexEnum ZIndex_Base()
|
public ZIndexEnum ZIndex()
|
||||||
{
|
{
|
||||||
return ZIndexEnum.Estaticos;
|
return ZIndexEnum.Estaticos;
|
||||||
}
|
}
|
||||||
|
|
|
@ -369,7 +369,6 @@ namespace CtrEditor.ObjetosSim
|
||||||
public partial class ucTransporteGuiasUnion : UserControl, IDataContainer
|
public partial class ucTransporteGuiasUnion : UserControl, IDataContainer
|
||||||
{
|
{
|
||||||
public osBase? Datos { get; set; }
|
public osBase? Datos { get; set; }
|
||||||
public int zIndex_fromFrames { get; set; }
|
|
||||||
|
|
||||||
public ucTransporteGuiasUnion()
|
public ucTransporteGuiasUnion()
|
||||||
{
|
{
|
||||||
|
@ -386,7 +385,7 @@ namespace CtrEditor.ObjetosSim
|
||||||
Datos?.ucUnLoaded();
|
Datos?.ucUnLoaded();
|
||||||
}
|
}
|
||||||
public void Highlight(bool State) { }
|
public void Highlight(bool State) { }
|
||||||
public ZIndexEnum ZIndex_Base()
|
public ZIndexEnum ZIndex()
|
||||||
{
|
{
|
||||||
return ZIndexEnum.Estaticos;
|
return ZIndexEnum.Estaticos;
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
Height="{Binding Alto, Converter={StaticResource MeterToPixelConverter}}"
|
Height="{Binding Alto, Converter={StaticResource MeterToPixelConverter}}"
|
||||||
Fill="{StaticResource BeltBrush}">
|
Fill="{StaticResource BeltBrush}">
|
||||||
</Rectangle>
|
</Rectangle>
|
||||||
<Viewbox
|
<Viewbox Canvas.Top="{Binding AltoGuia, Converter={StaticResource MeterToPixelConverter}}"
|
||||||
Width="{Binding Ancho, Converter={StaticResource MeterToPixelConverter}}"
|
Width="{Binding Ancho, Converter={StaticResource MeterToPixelConverter}}"
|
||||||
Height="{Binding Alto, Converter={StaticResource MeterToPixelConverter}}" Stretch="Uniform">
|
Height="{Binding Alto, Converter={StaticResource MeterToPixelConverter}}" Stretch="Uniform">
|
||||||
<Label Content="{Binding Nombre}" VerticalAlignment="Center" HorizontalAlignment="Center" FontWeight="Bold"
|
<Label Content="{Binding Nombre}" VerticalAlignment="Center" HorizontalAlignment="Center" FontWeight="Bold"
|
||||||
|
|
|
@ -6,7 +6,6 @@ using CtrEditor.Simulacion;
|
||||||
using Xceed.Wpf.Toolkit.PropertyGrid.Attributes;
|
using Xceed.Wpf.Toolkit.PropertyGrid.Attributes;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
using CtrEditor.FuncionesBase;
|
using CtrEditor.FuncionesBase;
|
||||||
using System.Text.Json.Serialization;
|
|
||||||
|
|
||||||
namespace CtrEditor.ObjetosSim
|
namespace CtrEditor.ObjetosSim
|
||||||
{
|
{
|
||||||
|
@ -72,29 +71,24 @@ namespace CtrEditor.ObjetosSim
|
||||||
[property: ItemsSource(typeof(osBaseItemsSource<osVMmotorSim>))]
|
[property: ItemsSource(typeof(osBaseItemsSource<osVMmotorSim>))]
|
||||||
string id_Motor;
|
string id_Motor;
|
||||||
|
|
||||||
[JsonIgnore]
|
|
||||||
private PropertyChangedEventHandler motorPropertyChangedHandler;
|
|
||||||
|
|
||||||
partial void OnId_MotorChanged(string value)
|
partial void OnId_MotorChanged(string value)
|
||||||
{
|
{
|
||||||
if (Motor != null && motorPropertyChangedHandler != null)
|
|
||||||
Motor.PropertyChanged -= motorPropertyChangedHandler;
|
|
||||||
|
|
||||||
if (_mainViewModel != null && !string.IsNullOrEmpty(value))
|
|
||||||
{
|
|
||||||
Motor = (osVMmotorSim)_mainViewModel.ObjetosSimulables.FirstOrDefault(s => s is osVMmotorSim motor && motor.Nombre == value);
|
|
||||||
if (Motor != null)
|
if (Motor != null)
|
||||||
|
Motor.PropertyChanged -= OnMotorPropertyChanged;
|
||||||
|
if (_mainViewModel != null && value != null && value.Length > 0)
|
||||||
{
|
{
|
||||||
motorPropertyChangedHandler = (sender, e) =>
|
Motor = (osVMmotorSim)_mainViewModel.ObjetosSimulables.FirstOrDefault(s => (s is osVMmotorSim && s.Nombre == value), null);
|
||||||
|
if (Motor != null)
|
||||||
|
Motor.PropertyChanged += OnMotorPropertyChanged;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OnMotorPropertyChanged(object sender, PropertyChangedEventArgs e)
|
||||||
{
|
{
|
||||||
if (e.PropertyName == nameof(osVMmotorSim.Nombre))
|
if (e.PropertyName == nameof(osVMmotorSim.Nombre))
|
||||||
{
|
{
|
||||||
Id_Motor = ((osVMmotorSim)sender).Nombre;
|
Id_Motor = ((osVMmotorSim)sender).Nombre;
|
||||||
}
|
}
|
||||||
};
|
|
||||||
Motor.PropertyChanged += motorPropertyChangedHandler;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -176,7 +170,6 @@ namespace CtrEditor.ObjetosSim
|
||||||
public partial class ucTransporteTTop : UserControl, IDataContainer
|
public partial class ucTransporteTTop : UserControl, IDataContainer
|
||||||
{
|
{
|
||||||
public osBase? Datos { get; set; }
|
public osBase? Datos { get; set; }
|
||||||
public int zIndex_fromFrames { get; set; }
|
|
||||||
|
|
||||||
public ucTransporteTTop()
|
public ucTransporteTTop()
|
||||||
{
|
{
|
||||||
|
@ -193,7 +186,7 @@ namespace CtrEditor.ObjetosSim
|
||||||
Datos?.ucUnLoaded();
|
Datos?.ucUnLoaded();
|
||||||
}
|
}
|
||||||
public void Highlight(bool State) { }
|
public void Highlight(bool State) { }
|
||||||
public ZIndexEnum ZIndex_Base()
|
public ZIndexEnum ZIndex()
|
||||||
{
|
{
|
||||||
return ZIndexEnum.Estaticos;
|
return ZIndexEnum.Estaticos;
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,6 @@ using CommunityToolkit.Mvvm.ComponentModel;
|
||||||
using CtrEditor.FuncionesBase;
|
using CtrEditor.FuncionesBase;
|
||||||
using LibS7Adv;
|
using LibS7Adv;
|
||||||
using Newtonsoft.Json;
|
using Newtonsoft.Json;
|
||||||
using System.Diagnostics;
|
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
|
@ -45,9 +44,6 @@ namespace CtrEditor.ObjetosSim
|
||||||
Tamano += Delta_Width + Delta_Height;
|
Tamano += Delta_Width + Delta_Height;
|
||||||
}
|
}
|
||||||
|
|
||||||
[ObservableProperty]
|
|
||||||
public float refresh_Time_ms;
|
|
||||||
|
|
||||||
[ObservableProperty]
|
[ObservableProperty]
|
||||||
public float proporcional_Speed;
|
public float proporcional_Speed;
|
||||||
|
|
||||||
|
@ -110,7 +106,6 @@ namespace CtrEditor.ObjetosSim
|
||||||
Max_Speed_for_Ramp = 100;
|
Max_Speed_for_Ramp = 100;
|
||||||
TiempoRampa = 3;
|
TiempoRampa = 3;
|
||||||
ImageSource_oculta = ImageFromPath("/imagenes/motor2.png");
|
ImageSource_oculta = ImageFromPath("/imagenes/motor2.png");
|
||||||
Refresh_Time_ms = 500;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void UpdateGeometryStart()
|
public override void UpdateGeometryStart()
|
||||||
|
@ -118,36 +113,17 @@ namespace CtrEditor.ObjetosSim
|
||||||
// Se llama antes de la simulacion
|
// Se llama antes de la simulacion
|
||||||
|
|
||||||
}
|
}
|
||||||
|
public override void UpdatePLC(PLCViewModel plc, int elapsedMilliseconds)
|
||||||
[JsonIgnore]
|
|
||||||
private float elapsedTimeAccumulator = 0;
|
|
||||||
|
|
||||||
public override void UpdatePLC(PLCViewModel plc, int TotalMilliseconds)
|
|
||||||
{
|
{
|
||||||
Stopwatch stopwatch = new Stopwatch();
|
motState.UpdatePLC(plc, this, elapsedMilliseconds);
|
||||||
stopwatch.Start();
|
|
||||||
|
|
||||||
elapsedTimeAccumulator += TotalMilliseconds;
|
|
||||||
float randomFactor = (float)(new Random().NextDouble() * 0.1); // 10% random factor
|
|
||||||
float adjustedRefreshTime = Refresh_Time_ms * (1 + randomFactor);
|
|
||||||
|
|
||||||
if (elapsedTimeAccumulator >= adjustedRefreshTime)
|
|
||||||
{
|
|
||||||
motState.UpdatePLC(plc, this, TotalMilliseconds);
|
|
||||||
elapsedTimeAccumulator = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
Velocidad = (Proporcional_Speed / 100) * (motState.STATUS_VFD_ACT_Speed_Hz / 10);
|
Velocidad = (Proporcional_Speed / 100) * (motState.STATUS_VFD_ACT_Speed_Hz / 10);
|
||||||
Sentido_contrario = motState.OUT_Reversal;
|
Sentido_contrario = motState.OUT_Reversal;
|
||||||
|
|
||||||
stopwatch.Stop();
|
|
||||||
Debug.WriteLine($" osVMmotorSim : {Nombre} : {stopwatch.Elapsed.TotalMilliseconds} ms");
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void UpdateControl(int TotalMilliseconds)
|
public override void UpdateControl(int elapsedMilliseconds)
|
||||||
{
|
{
|
||||||
// Calculamos la velocidad
|
// Calculamos la velocidad
|
||||||
motState.UpdateSpeed(Max_Speed_for_Ramp, TiempoRampa, TotalMilliseconds);
|
motState.UpdateSpeed(Max_Speed_for_Ramp, TiempoRampa, elapsedMilliseconds);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -164,7 +140,6 @@ namespace CtrEditor.ObjetosSim
|
||||||
public partial class ucVMmotorSim : UserControl, IDataContainer
|
public partial class ucVMmotorSim : UserControl, IDataContainer
|
||||||
{
|
{
|
||||||
public osBase? Datos { get; set; }
|
public osBase? Datos { get; set; }
|
||||||
public int zIndex_fromFrames { get; set; }
|
|
||||||
|
|
||||||
public ucVMmotorSim()
|
public ucVMmotorSim()
|
||||||
{
|
{
|
||||||
|
@ -181,7 +156,7 @@ namespace CtrEditor.ObjetosSim
|
||||||
Datos?.ucUnLoaded();
|
Datos?.ucUnLoaded();
|
||||||
}
|
}
|
||||||
public void Highlight(bool State) { }
|
public void Highlight(bool State) { }
|
||||||
public ZIndexEnum ZIndex_Base()
|
public ZIndexEnum ZIndex()
|
||||||
{
|
{
|
||||||
return ZIndexEnum.Estaticos;
|
return ZIndexEnum.Estaticos;
|
||||||
}
|
}
|
||||||
|
@ -201,7 +176,7 @@ namespace CtrEditor.ObjetosSim
|
||||||
public bool OUT_Reversal;
|
public bool OUT_Reversal;
|
||||||
public float OUT_OUT_VFD_REQ_Speed_Hz;
|
public float OUT_OUT_VFD_REQ_Speed_Hz;
|
||||||
|
|
||||||
public void UpdatePLC(PLCViewModel plc, osVMmotorSim Data, int TotalMilliseconds)
|
public void UpdatePLC(PLCViewModel plc, osVMmotorSim Data, int elapsedMilliseconds)
|
||||||
{
|
{
|
||||||
var DB_Motor = Data.PLC_DB_Motor;
|
var DB_Motor = Data.PLC_DB_Motor;
|
||||||
|
|
||||||
|
@ -245,9 +220,9 @@ namespace CtrEditor.ObjetosSim
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private float CalcSpeedRamp(float max_Speed_for_Ramp, float TiempoRampa, float actual, float expected, int TotalMilliseconds)
|
private float CalcSpeedRamp(float max_Speed_for_Ramp, float TiempoRampa, float actual, float expected, int elapsedMilliseconds)
|
||||||
{
|
{
|
||||||
float hzIncrementsRamp = (max_Speed_for_Ramp * 10) / (TiempoRampa * (1000.0f / TotalMilliseconds));
|
float hzIncrementsRamp = (max_Speed_for_Ramp * 10) / (TiempoRampa * (1000.0f / elapsedMilliseconds));
|
||||||
float delta = expected - actual;
|
float delta = expected - actual;
|
||||||
// Conrtolar si la diferencia no es mayor de lo que falta
|
// Conrtolar si la diferencia no es mayor de lo que falta
|
||||||
if (Math.Abs(hzIncrementsRamp) > Math.Abs(delta))
|
if (Math.Abs(hzIncrementsRamp) > Math.Abs(delta))
|
||||||
|
@ -258,14 +233,12 @@ namespace CtrEditor.ObjetosSim
|
||||||
return hzIncrementsRamp;
|
return hzIncrementsRamp;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void UpdateSpeed(float max_Speed_for_Ramp, float TiempoRampa, int TotalMilliseconds)
|
public void UpdateSpeed(float max_Speed_for_Ramp, float TiempoRampa, int elapsedMilliseconds)
|
||||||
{
|
{
|
||||||
// Calculamos la velocidad
|
// Calculamos la velocidad
|
||||||
STATUS_VFD_ACT_Speed_Hz += CalcSpeedRamp(max_Speed_for_Ramp, TiempoRampa, STATUS_VFD_ACT_Speed_Hz, OUT_OUT_VFD_REQ_Speed_Hz, TotalMilliseconds);
|
STATUS_VFD_ACT_Speed_Hz += CalcSpeedRamp(max_Speed_for_Ramp, TiempoRampa, STATUS_VFD_ACT_Speed_Hz, OUT_OUT_VFD_REQ_Speed_Hz, elapsedMilliseconds);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -19,10 +19,6 @@ using System.ComponentModel;
|
||||||
using ClosedXML.Excel;
|
using ClosedXML.Excel;
|
||||||
using Colors = System.Windows.Media.Colors;
|
using Colors = System.Windows.Media.Colors;
|
||||||
using CtrEditor.FuncionesBase;
|
using CtrEditor.FuncionesBase;
|
||||||
using System.Drawing;
|
|
||||||
using System.Windows.Shapes;
|
|
||||||
using System.Drawing.Imaging;
|
|
||||||
using Emgu.CV.Structure;
|
|
||||||
|
|
||||||
namespace CtrEditor.ObjetosSim.Extraccion_Datos
|
namespace CtrEditor.ObjetosSim.Extraccion_Datos
|
||||||
{
|
{
|
||||||
|
@ -377,10 +373,6 @@ namespace CtrEditor.ObjetosSim.Extraccion_Datos
|
||||||
// Método para convertir BitmapSource a Mat
|
// Método para convertir BitmapSource a Mat
|
||||||
private Mat BitmapSourceToMat(BitmapSource bitmapSource)
|
private Mat BitmapSourceToMat(BitmapSource bitmapSource)
|
||||||
{
|
{
|
||||||
if (bitmapSource == null)
|
|
||||||
throw new ArgumentNullException(nameof(bitmapSource));
|
|
||||||
|
|
||||||
// Convierte BitmapSource a Bitmap
|
|
||||||
Bitmap bitmap;
|
Bitmap bitmap;
|
||||||
using (MemoryStream outStream = new MemoryStream())
|
using (MemoryStream outStream = new MemoryStream())
|
||||||
{
|
{
|
||||||
|
@ -389,10 +381,7 @@ namespace CtrEditor.ObjetosSim.Extraccion_Datos
|
||||||
enc.Save(outStream);
|
enc.Save(outStream);
|
||||||
bitmap = new Bitmap(outStream);
|
bitmap = new Bitmap(outStream);
|
||||||
}
|
}
|
||||||
|
return bitmap.ToMat();
|
||||||
// Convierte directamente a Mat usando Image<Bgr, byte>
|
|
||||||
Image<Bgr, byte> image = bitmap.ToImage<Bgr, byte>();
|
|
||||||
return image.Mat;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void ucLoaded()
|
public override void ucLoaded()
|
||||||
|
@ -408,7 +397,6 @@ namespace CtrEditor.ObjetosSim.Extraccion_Datos
|
||||||
public partial class ucBuscarCoincidencias : UserControl, IDataContainer
|
public partial class ucBuscarCoincidencias : UserControl, IDataContainer
|
||||||
{
|
{
|
||||||
public osBase? Datos { get; set; }
|
public osBase? Datos { get; set; }
|
||||||
public int zIndex_fromFrames { get; set; }
|
|
||||||
|
|
||||||
public ucBuscarCoincidencias()
|
public ucBuscarCoincidencias()
|
||||||
{
|
{
|
||||||
|
@ -425,7 +413,7 @@ namespace CtrEditor.ObjetosSim.Extraccion_Datos
|
||||||
Datos?.ucUnLoaded();
|
Datos?.ucUnLoaded();
|
||||||
}
|
}
|
||||||
public void Highlight(bool State) { }
|
public void Highlight(bool State) { }
|
||||||
public ZIndexEnum ZIndex_Base()
|
public ZIndexEnum ZIndex()
|
||||||
{
|
{
|
||||||
return ZIndexEnum.Estaticos;
|
return ZIndexEnum.Estaticos;
|
||||||
}
|
}
|
||||||
|
|
|
@ -175,7 +175,6 @@ namespace CtrEditor.ObjetosSim.Extraccion_Datos
|
||||||
public partial class ucExtraccionTag : UserControl, IDataContainer
|
public partial class ucExtraccionTag : UserControl, IDataContainer
|
||||||
{
|
{
|
||||||
public osBase? Datos { get; set; }
|
public osBase? Datos { get; set; }
|
||||||
public int zIndex_fromFrames { get; set; }
|
|
||||||
|
|
||||||
public ucExtraccionTag()
|
public ucExtraccionTag()
|
||||||
{
|
{
|
||||||
|
@ -221,7 +220,7 @@ namespace CtrEditor.ObjetosSim.Extraccion_Datos
|
||||||
datos.Angulo += Angle;
|
datos.Angulo += Angle;
|
||||||
}
|
}
|
||||||
public void Highlight(bool State) { }
|
public void Highlight(bool State) { }
|
||||||
public ZIndexEnum ZIndex_Base()
|
public ZIndexEnum ZIndex()
|
||||||
{
|
{
|
||||||
return ZIndexEnum.ExtraccionTag;
|
return ZIndexEnum.ExtraccionTag;
|
||||||
}
|
}
|
||||||
|
|
|
@ -143,7 +143,6 @@ namespace CtrEditor.ObjetosSim
|
||||||
public partial class ucBoton : UserControl, IDataContainer
|
public partial class ucBoton : UserControl, IDataContainer
|
||||||
{
|
{
|
||||||
public osBase? Datos { get; set; }
|
public osBase? Datos { get; set; }
|
||||||
public int zIndex_fromFrames { get; set; }
|
|
||||||
|
|
||||||
public ucBoton()
|
public ucBoton()
|
||||||
{
|
{
|
||||||
|
@ -184,7 +183,7 @@ namespace CtrEditor.ObjetosSim
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
public void Highlight(bool State) { }
|
public void Highlight(bool State) { }
|
||||||
public ZIndexEnum ZIndex_Base()
|
public ZIndexEnum ZIndex()
|
||||||
{
|
{
|
||||||
return ZIndexEnum.Estaticos;
|
return ZIndexEnum.Estaticos;
|
||||||
}
|
}
|
||||||
|
|
|
@ -132,7 +132,6 @@ namespace CtrEditor.ObjetosSim
|
||||||
public partial class ucEncoderMotor : UserControl, IDataContainer
|
public partial class ucEncoderMotor : UserControl, IDataContainer
|
||||||
{
|
{
|
||||||
public osBase? Datos { get; set; }
|
public osBase? Datos { get; set; }
|
||||||
public int zIndex_fromFrames { get; set; }
|
|
||||||
|
|
||||||
public ucEncoderMotor()
|
public ucEncoderMotor()
|
||||||
{
|
{
|
||||||
|
@ -153,7 +152,7 @@ namespace CtrEditor.ObjetosSim
|
||||||
|
|
||||||
public void Highlight(bool State) { }
|
public void Highlight(bool State) { }
|
||||||
|
|
||||||
public ZIndexEnum ZIndex_Base()
|
public ZIndexEnum ZIndex()
|
||||||
{
|
{
|
||||||
return ZIndexEnum.Estaticos;
|
return ZIndexEnum.Estaticos;
|
||||||
}
|
}
|
||||||
|
|
|
@ -124,7 +124,6 @@ namespace CtrEditor.ObjetosSim
|
||||||
public partial class ucEncoderMotorLineal : UserControl, IDataContainer
|
public partial class ucEncoderMotorLineal : UserControl, IDataContainer
|
||||||
{
|
{
|
||||||
public osBase? Datos { get; set; }
|
public osBase? Datos { get; set; }
|
||||||
public int zIndex_fromFrames { get; set; }
|
|
||||||
|
|
||||||
public ucEncoderMotorLineal()
|
public ucEncoderMotorLineal()
|
||||||
{
|
{
|
||||||
|
@ -145,7 +144,7 @@ namespace CtrEditor.ObjetosSim
|
||||||
|
|
||||||
public void Highlight(bool State) { }
|
public void Highlight(bool State) { }
|
||||||
|
|
||||||
public ZIndexEnum ZIndex_Base()
|
public ZIndexEnum ZIndex()
|
||||||
{
|
{
|
||||||
return ZIndexEnum.Estaticos;
|
return ZIndexEnum.Estaticos;
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,8 +43,8 @@ namespace CtrEditor.ObjetosSim
|
||||||
{
|
{
|
||||||
if (value)
|
if (value)
|
||||||
{
|
{
|
||||||
var dTime = Stopwatch.Elapsed.TotalMilliseconds - stopwatch_last;
|
var dTime = Stopwatch.ElapsedMilliseconds - stopwatch_last;
|
||||||
stopwatch_last = Stopwatch.Elapsed.TotalMilliseconds;
|
stopwatch_last = Stopwatch.ElapsedMilliseconds;
|
||||||
Tiempo_Pulso = (float)dTime;
|
Tiempo_Pulso = (float)dTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -146,7 +146,25 @@ namespace CtrEditor.ObjetosSim
|
||||||
}
|
}
|
||||||
public override void UpdatePLC(PLCViewModel plc, int elapsedMilliseconds)
|
public override void UpdatePLC(PLCViewModel plc, int elapsedMilliseconds)
|
||||||
{
|
{
|
||||||
|
if (Motor != null)
|
||||||
|
{
|
||||||
|
if (Motor is osVMmotorSim motor)
|
||||||
|
{
|
||||||
|
VelocidadActual = motor.Velocidad;
|
||||||
|
|
||||||
|
// Calcular la cantidad de giros por segundo
|
||||||
|
double girosPorSegundo = (VelocidadActual / 100.0) * Giros_segundo_a_100;
|
||||||
|
|
||||||
|
// Calcular la fracción del segundo que ha pasado
|
||||||
|
double segundosTranscurridos = elapsedMilliseconds / 1000.0;
|
||||||
|
|
||||||
|
// Calcular el incremento de ángulo
|
||||||
|
double incrementoAngulo = (girosPorSegundo * 360.0) * segundosTranscurridos;
|
||||||
|
|
||||||
|
// Actualizar el ángulo
|
||||||
|
Angulo = (float) (Angulo + incrementoAngulo) % 360;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool DetectarDiente()
|
public bool DetectarDiente()
|
||||||
|
@ -189,28 +207,7 @@ namespace CtrEditor.ObjetosSim
|
||||||
public override void UpdateControl(int elapsedMilliseconds)
|
public override void UpdateControl(int elapsedMilliseconds)
|
||||||
{
|
{
|
||||||
// Calculamos la velocidad
|
// Calculamos la velocidad
|
||||||
if (Motor != null)
|
|
||||||
{
|
|
||||||
if (Motor is osVMmotorSim motor)
|
|
||||||
{
|
|
||||||
if (motor.Sentido_contrario)
|
|
||||||
VelocidadActual = -motor.Velocidad;
|
|
||||||
else
|
|
||||||
VelocidadActual = motor.Velocidad;
|
|
||||||
|
|
||||||
// Calcular la cantidad de giros por segundo
|
|
||||||
double girosPorSegundo = (VelocidadActual / 100.0) * Giros_segundo_a_100;
|
|
||||||
|
|
||||||
// Calcular la fracción del segundo que ha pasado
|
|
||||||
double segundosTranscurridos = elapsedMilliseconds / 1000.0;
|
|
||||||
|
|
||||||
// Calcular el incremento de ángulo
|
|
||||||
double incrementoAngulo = (girosPorSegundo * 360.0) * segundosTranscurridos;
|
|
||||||
|
|
||||||
// Actualizar el ángulo
|
|
||||||
Angulo = (float)(Angulo + incrementoAngulo) % 360;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void ucLoaded()
|
public override void ucLoaded()
|
||||||
|
@ -225,7 +222,6 @@ namespace CtrEditor.ObjetosSim
|
||||||
public partial class ucGearEncoder : UserControl, IDataContainer
|
public partial class ucGearEncoder : UserControl, IDataContainer
|
||||||
{
|
{
|
||||||
public osBase? Datos { get; set; }
|
public osBase? Datos { get; set; }
|
||||||
public int zIndex_fromFrames { get; set; }
|
|
||||||
|
|
||||||
public ucGearEncoder()
|
public ucGearEncoder()
|
||||||
{
|
{
|
||||||
|
@ -242,7 +238,7 @@ namespace CtrEditor.ObjetosSim
|
||||||
Datos?.ucUnLoaded();
|
Datos?.ucUnLoaded();
|
||||||
}
|
}
|
||||||
public void Highlight(bool State) { }
|
public void Highlight(bool State) { }
|
||||||
public ZIndexEnum ZIndex_Base()
|
public ZIndexEnum ZIndex()
|
||||||
{
|
{
|
||||||
return ZIndexEnum.Estaticos;
|
return ZIndexEnum.Estaticos;
|
||||||
}
|
}
|
||||||
|
|
|
@ -61,12 +61,12 @@ namespace CtrEditor.ObjetosSim
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!value) {
|
if (!value) {
|
||||||
Lenght_positive_pulse = (float) (timer.Elapsed.TotalMilliseconds - timer_lastPositive);
|
Lenght_positive_pulse = (float) (timer.ElapsedMilliseconds- timer_lastPositive);
|
||||||
timer_lastNegative = timer.Elapsed.TotalMilliseconds;
|
timer_lastNegative = timer.ElapsedMilliseconds;
|
||||||
} else
|
} else
|
||||||
{
|
{
|
||||||
Lenght_negative_pulse = (float)(timer.Elapsed.TotalMilliseconds - timer_lastNegative);
|
Lenght_negative_pulse = (float)(timer.ElapsedMilliseconds - timer_lastNegative);
|
||||||
timer_lastPositive = timer.Elapsed.TotalMilliseconds;
|
timer_lastPositive = timer.ElapsedMilliseconds;
|
||||||
Lenght_FP_to_FP = Lenght_positive_pulse + Lenght_negative_pulse;
|
Lenght_FP_to_FP = Lenght_positive_pulse + Lenght_negative_pulse;
|
||||||
Frecuency = (Frecuency * (filter_Frecuency - 1) + (1000 / Lenght_FP_to_FP)) / filter_Frecuency;
|
Frecuency = (Frecuency * (filter_Frecuency - 1) + (1000 / Lenght_FP_to_FP)) / filter_Frecuency;
|
||||||
}
|
}
|
||||||
|
@ -223,7 +223,6 @@ namespace CtrEditor.ObjetosSim
|
||||||
public partial class ucPhotocell : UserControl, IDataContainer
|
public partial class ucPhotocell : UserControl, IDataContainer
|
||||||
{
|
{
|
||||||
public osBase? Datos { get; set; }
|
public osBase? Datos { get; set; }
|
||||||
public int zIndex_fromFrames { get; set; }
|
|
||||||
|
|
||||||
public ucPhotocell()
|
public ucPhotocell()
|
||||||
{
|
{
|
||||||
|
@ -240,7 +239,7 @@ namespace CtrEditor.ObjetosSim
|
||||||
Datos?.ucUnLoaded();
|
Datos?.ucUnLoaded();
|
||||||
}
|
}
|
||||||
public void Highlight(bool State) { }
|
public void Highlight(bool State) { }
|
||||||
public ZIndexEnum ZIndex_Base()
|
public ZIndexEnum ZIndex()
|
||||||
{
|
{
|
||||||
return ZIndexEnum.Fotocelula;
|
return ZIndexEnum.Fotocelula;
|
||||||
}
|
}
|
||||||
|
|
|
@ -72,7 +72,6 @@ namespace CtrEditor.ObjetosSim
|
||||||
public partial class ucSensTemperatura : UserControl, IDataContainer
|
public partial class ucSensTemperatura : UserControl, IDataContainer
|
||||||
{
|
{
|
||||||
public osBase? Datos { get; set; }
|
public osBase? Datos { get; set; }
|
||||||
public int zIndex_fromFrames { get; set; }
|
|
||||||
|
|
||||||
public ucSensTemperatura()
|
public ucSensTemperatura()
|
||||||
{
|
{
|
||||||
|
@ -89,7 +88,7 @@ namespace CtrEditor.ObjetosSim
|
||||||
Datos?.ucUnLoaded();
|
Datos?.ucUnLoaded();
|
||||||
}
|
}
|
||||||
public void Highlight(bool State) { }
|
public void Highlight(bool State) { }
|
||||||
public ZIndexEnum ZIndex_Base()
|
public ZIndexEnum ZIndex()
|
||||||
{
|
{
|
||||||
return ZIndexEnum.Estaticos;
|
return ZIndexEnum.Estaticos;
|
||||||
}
|
}
|
||||||
|
|
|
@ -109,7 +109,6 @@ namespace CtrEditor.ObjetosSim
|
||||||
public partial class ucAnalogTag : UserControl, IDataContainer
|
public partial class ucAnalogTag : UserControl, IDataContainer
|
||||||
{
|
{
|
||||||
public osBase? Datos { get; set; }
|
public osBase? Datos { get; set; }
|
||||||
public int zIndex_fromFrames { get; set; }
|
|
||||||
|
|
||||||
public ucAnalogTag()
|
public ucAnalogTag()
|
||||||
{
|
{
|
||||||
|
@ -126,7 +125,7 @@ namespace CtrEditor.ObjetosSim
|
||||||
Datos?.ucUnLoaded();
|
Datos?.ucUnLoaded();
|
||||||
}
|
}
|
||||||
public void Highlight(bool State) { }
|
public void Highlight(bool State) { }
|
||||||
public ZIndexEnum ZIndex_Base()
|
public ZIndexEnum ZIndex()
|
||||||
{
|
{
|
||||||
return ZIndexEnum.Estaticos;
|
return ZIndexEnum.Estaticos;
|
||||||
}
|
}
|
||||||
|
|
|
@ -89,7 +89,6 @@ namespace CtrEditor.ObjetosSim
|
||||||
public partial class ucBoolTag : UserControl, IDataContainer
|
public partial class ucBoolTag : UserControl, IDataContainer
|
||||||
{
|
{
|
||||||
public osBase? Datos { get; set; }
|
public osBase? Datos { get; set; }
|
||||||
public int zIndex_fromFrames { get; set; }
|
|
||||||
|
|
||||||
public ucBoolTag()
|
public ucBoolTag()
|
||||||
{
|
{
|
||||||
|
@ -106,7 +105,7 @@ namespace CtrEditor.ObjetosSim
|
||||||
Datos?.ucUnLoaded();
|
Datos?.ucUnLoaded();
|
||||||
}
|
}
|
||||||
public void Highlight(bool State) { }
|
public void Highlight(bool State) { }
|
||||||
public ZIndexEnum ZIndex_Base()
|
public ZIndexEnum ZIndex()
|
||||||
{
|
{
|
||||||
return ZIndexEnum.Estaticos;
|
return ZIndexEnum.Estaticos;
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,7 +53,6 @@ namespace CtrEditor.ObjetosSim
|
||||||
public partial class ucConsensGeneric : UserControl, IDataContainer
|
public partial class ucConsensGeneric : UserControl, IDataContainer
|
||||||
{
|
{
|
||||||
public osBase? Datos { get; set; }
|
public osBase? Datos { get; set; }
|
||||||
public int zIndex_fromFrames { get; set; }
|
|
||||||
|
|
||||||
public ucConsensGeneric()
|
public ucConsensGeneric()
|
||||||
{
|
{
|
||||||
|
@ -70,7 +69,7 @@ namespace CtrEditor.ObjetosSim
|
||||||
Datos?.ucUnLoaded();
|
Datos?.ucUnLoaded();
|
||||||
}
|
}
|
||||||
public void Highlight(bool State) { }
|
public void Highlight(bool State) { }
|
||||||
public ZIndexEnum ZIndex_Base()
|
public ZIndexEnum ZIndex()
|
||||||
{
|
{
|
||||||
return ZIndexEnum.Estaticos;
|
return ZIndexEnum.Estaticos;
|
||||||
}
|
}
|
||||||
|
|
|
@ -263,7 +263,6 @@ namespace CtrEditor.ObjetosSim
|
||||||
public partial class ucTrace3 : UserControl, IDataContainer
|
public partial class ucTrace3 : UserControl, IDataContainer
|
||||||
{
|
{
|
||||||
public osBase? Datos { get; set; }
|
public osBase? Datos { get; set; }
|
||||||
public int zIndex_fromFrames { get; set; }
|
|
||||||
|
|
||||||
public ucTrace3()
|
public ucTrace3()
|
||||||
{
|
{
|
||||||
|
@ -296,7 +295,7 @@ namespace CtrEditor.ObjetosSim
|
||||||
}
|
}
|
||||||
public float Angle() { return 0; } public void Rotate(float Angle) { }
|
public float Angle() { return 0; } public void Rotate(float Angle) { }
|
||||||
public void Highlight(bool State) { }
|
public void Highlight(bool State) { }
|
||||||
public ZIndexEnum ZIndex_Base()
|
public ZIndexEnum ZIndex()
|
||||||
{
|
{
|
||||||
return ZIndexEnum.Trace;
|
return ZIndexEnum.Trace;
|
||||||
}
|
}
|
||||||
|
|
|
@ -96,7 +96,7 @@ namespace CtrEditor.ObjetosSim
|
||||||
}
|
}
|
||||||
if (data.Count > 50)
|
if (data.Count > 50)
|
||||||
data.RemoveAt(0);
|
data.RemoveAt(0);
|
||||||
if (stopwatch.Elapsed.TotalMilliseconds > 1000)
|
if (stopwatch.ElapsedMilliseconds > 1000)
|
||||||
{
|
{
|
||||||
stopwatch.Reset();
|
stopwatch.Reset();
|
||||||
stopwatch.Start();
|
stopwatch.Start();
|
||||||
|
@ -128,7 +128,6 @@ namespace CtrEditor.ObjetosSim
|
||||||
public partial class ucTraceSimple : UserControl, IDataContainer
|
public partial class ucTraceSimple : UserControl, IDataContainer
|
||||||
{
|
{
|
||||||
public osBase? Datos { get; set; }
|
public osBase? Datos { get; set; }
|
||||||
public int zIndex_fromFrames { get; set; }
|
|
||||||
|
|
||||||
public ucTraceSimple()
|
public ucTraceSimple()
|
||||||
{
|
{
|
||||||
|
@ -161,7 +160,7 @@ namespace CtrEditor.ObjetosSim
|
||||||
}
|
}
|
||||||
public float Angle() { return 0; } public void Rotate(float Angle) { }
|
public float Angle() { return 0; } public void Rotate(float Angle) { }
|
||||||
public void Highlight(bool State) { }
|
public void Highlight(bool State) { }
|
||||||
public ZIndexEnum ZIndex_Base()
|
public ZIndexEnum ZIndex()
|
||||||
{
|
{
|
||||||
return ZIndexEnum.Trace;
|
return ZIndexEnum.Trace;
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,17 +9,14 @@ using System.Diagnostics;
|
||||||
using System.IO;
|
using System.IO;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Forms;
|
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using System.Windows.Media.Animation;
|
using System.Windows.Media.Animation;
|
||||||
using System.Windows.Media.Imaging;
|
using System.Windows.Media.Imaging;
|
||||||
using System.Windows.Shapes;
|
using System.Windows.Shapes;
|
||||||
using Tesseract;
|
using Tesseract;
|
||||||
using Xceed.Wpf.Toolkit.PropertyGrid.Attributes;
|
using Xceed.Wpf.Toolkit.PropertyGrid.Attributes;
|
||||||
using Application = System.Windows.Application;
|
|
||||||
using ItemCollection = Xceed.Wpf.Toolkit.PropertyGrid.Attributes.ItemCollection;
|
using ItemCollection = Xceed.Wpf.Toolkit.PropertyGrid.Attributes.ItemCollection;
|
||||||
using JsonIgnoreAttribute = Newtonsoft.Json.JsonIgnoreAttribute;
|
using JsonIgnoreAttribute = Newtonsoft.Json.JsonIgnoreAttribute;
|
||||||
using UserControl = System.Windows.Controls.UserControl;
|
|
||||||
|
|
||||||
namespace CtrEditor.ObjetosSim
|
namespace CtrEditor.ObjetosSim
|
||||||
{
|
{
|
||||||
|
@ -33,9 +30,8 @@ namespace CtrEditor.ObjetosSim
|
||||||
{
|
{
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
osBase? Datos { get; set; }
|
osBase? Datos { get; set; }
|
||||||
int zIndex_fromFrames { get; set; }
|
|
||||||
void Highlight(bool State);
|
void Highlight(bool State);
|
||||||
ZIndexEnum ZIndex_Base();
|
ZIndexEnum ZIndex();
|
||||||
}
|
}
|
||||||
|
|
||||||
public class DataSaveToSerialize
|
public class DataSaveToSerialize
|
||||||
|
@ -64,6 +60,19 @@ namespace CtrEditor.ObjetosSim
|
||||||
{
|
{
|
||||||
public virtual string Nombre { get; set; } = "osBase";
|
public virtual string Nombre { get; set; } = "osBase";
|
||||||
|
|
||||||
|
public osBase()
|
||||||
|
{
|
||||||
|
if (float.IsNaN(Left))
|
||||||
|
{
|
||||||
|
Left = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (float.IsNaN(Top))
|
||||||
|
{
|
||||||
|
Top = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
private Storyboard _storyboard;
|
private Storyboard _storyboard;
|
||||||
[JsonIgnore]
|
[JsonIgnore]
|
||||||
|
@ -278,19 +287,7 @@ namespace CtrEditor.ObjetosSim
|
||||||
{
|
{
|
||||||
FramePlate = (osFramePlate)_mainViewModel.ObjetosSimulables.FirstOrDefault(s => (s is osFramePlate && s.Nombre == value), null);
|
FramePlate = (osFramePlate)_mainViewModel.ObjetosSimulables.FirstOrDefault(s => (s is osFramePlate && s.Nombre == value), null);
|
||||||
if (FramePlate != null)
|
if (FramePlate != null)
|
||||||
{
|
|
||||||
FramePlate.PropertyChanged += OnFramePlatePropertyChanged;
|
FramePlate.PropertyChanged += OnFramePlatePropertyChanged;
|
||||||
UpdateZIndex(FramePlate.Zindex_FramePlate);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
protected void UpdateZIndex(int zIndex)
|
|
||||||
{
|
|
||||||
if (_visualRepresentation is IDataContainer dataContainer)
|
|
||||||
{
|
|
||||||
dataContainer.zIndex_fromFrames = zIndex;
|
|
||||||
Canvas.SetZIndex(_visualRepresentation, zIndex + ((int)dataContainer.ZIndex_Base()));
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -315,9 +312,6 @@ namespace CtrEditor.ObjetosSim
|
||||||
OnMoveResizeRotate();
|
OnMoveResizeRotate();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (e.PropertyName == nameof(osFramePlate.Zindex_FramePlate))
|
|
||||||
UpdateZIndex(((osFramePlate)sender).Zindex_FramePlate);
|
|
||||||
|
|
||||||
isUpdatingFromFramePlate = false;
|
isUpdatingFromFramePlate = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1031,23 +1025,6 @@ namespace CtrEditor.ObjetosSim
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void OnPropertyChanged(PropertyChangedEventArgs e)
|
|
||||||
{
|
|
||||||
base.OnPropertyChanged(e);
|
|
||||||
|
|
||||||
// Don't mark changes for certain properties
|
|
||||||
if (e.PropertyName != nameof(Top) &&
|
|
||||||
e.PropertyName != nameof(Left) &&
|
|
||||||
e.PropertyName != nameof(Ancho) &&
|
|
||||||
e.PropertyName != nameof(Angulo) &&
|
|
||||||
Cloned == false &&
|
|
||||||
e.PropertyName != nameof(Show_On_This_Page) &&
|
|
||||||
_mainViewModel != null)
|
|
||||||
{
|
|
||||||
_mainViewModel.HasUnsavedChanges = true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class UniqueId
|
public class UniqueId
|
||||||
|
@ -1179,9 +1156,9 @@ namespace CtrEditor.ObjetosSim
|
||||||
|
|
||||||
public bool SenalFiltrada()
|
public bool SenalFiltrada()
|
||||||
{
|
{
|
||||||
if (_stopwatch_ON.Elapsed.TotalMilliseconds > (Tiempo_ON_s * 1000))
|
if (_stopwatch_ON.ElapsedMilliseconds > (Tiempo_ON_s * 1000))
|
||||||
_senalFiltrada = true;
|
_senalFiltrada = true;
|
||||||
if (_stopwatch_OFF.Elapsed.TotalMilliseconds > (Tiempo_OFF_s * 1000))
|
if (_stopwatch_OFF.ElapsedMilliseconds > (Tiempo_OFF_s * 1000))
|
||||||
_senalFiltrada = false;
|
_senalFiltrada = false;
|
||||||
|
|
||||||
return _senalFiltrada;
|
return _senalFiltrada;
|
||||||
|
|
Loading…
Reference in New Issue