Antes de refactorizar a varias clases

This commit is contained in:
Miguel 2025-07-19 10:00:52 +02:00
parent 01d5df1c86
commit 81ade6f8f0
7 changed files with 2296 additions and 1897 deletions

View File

@ -1411,8 +1411,352 @@
"streaming_count": 3,
"prefix": "dar"
}
},
{
"timestamp": "2025-07-18T15:11:14.294668",
"level": "info",
"event_type": "Application started",
"message": "Application initialization completed successfully",
"details": {}
},
{
"timestamp": "2025-07-18T15:11:14.321092",
"level": "info",
"event_type": "plc_connection",
"message": "Successfully connected to PLC 10.1.33.11",
"details": {
"ip": "10.1.33.11",
"rack": 0,
"slot": 2
}
},
{
"timestamp": "2025-07-18T15:11:14.325574",
"level": "info",
"event_type": "dataset_activated",
"message": "Dataset activated: DAR",
"details": {
"dataset_id": "dar",
"variables_count": 4,
"streaming_count": 3,
"prefix": "dar"
}
},
{
"timestamp": "2025-07-18T15:11:51.299652",
"level": "info",
"event_type": "dataset_deactivated",
"message": "Dataset deactivated: DAR",
"details": {
"dataset_id": "dar"
}
},
{
"timestamp": "2025-07-18T15:11:51.303633",
"level": "info",
"event_type": "streaming_stopped",
"message": "Multi-dataset streaming stopped: 1 datasets deactivated",
"details": {}
},
{
"timestamp": "2025-07-18T15:11:51.306353",
"level": "info",
"event_type": "plc_disconnection",
"message": "Disconnected from PLC 10.1.33.11",
"details": {}
},
{
"timestamp": "2025-07-18T15:14:25.443703",
"level": "info",
"event_type": "Application started",
"message": "Application initialization completed successfully",
"details": {}
},
{
"timestamp": "2025-07-18T15:14:32.201432",
"level": "error",
"event_type": "streaming_error",
"message": "Cannot start streaming: PLC not connected",
"details": {}
},
{
"timestamp": "2025-07-18T15:14:38.523861",
"level": "info",
"event_type": "plc_connection",
"message": "Successfully connected to PLC 10.1.33.11",
"details": {
"ip": "10.1.33.11",
"rack": 0,
"slot": 2
}
},
{
"timestamp": "2025-07-18T15:14:41.291500",
"level": "info",
"event_type": "dataset_activated",
"message": "Dataset activated: DAR",
"details": {
"dataset_id": "dar",
"variables_count": 4,
"streaming_count": 3,
"prefix": "dar"
}
},
{
"timestamp": "2025-07-18T15:14:41.294494",
"level": "info",
"event_type": "streaming_started",
"message": "Multi-dataset streaming started: 1 datasets activated",
"details": {
"activated_datasets": 1,
"total_datasets": 2,
"udp_host": "127.0.0.1",
"udp_port": 9870
}
},
{
"timestamp": "2025-07-18T16:03:07.780616",
"level": "info",
"event_type": "Application started",
"message": "Application initialization completed successfully",
"details": {}
},
{
"timestamp": "2025-07-18T16:03:07.801197",
"level": "info",
"event_type": "plc_connection",
"message": "Successfully connected to PLC 10.1.33.11",
"details": {
"ip": "10.1.33.11",
"rack": 0,
"slot": 2
}
},
{
"timestamp": "2025-07-18T16:03:07.805174",
"level": "info",
"event_type": "dataset_activated",
"message": "Dataset activated: DAR",
"details": {
"dataset_id": "dar",
"variables_count": 4,
"streaming_count": 3,
"prefix": "dar"
}
},
{
"timestamp": "2025-07-18T16:07:14.134957",
"level": "info",
"event_type": "dataset_csv_file_created",
"message": "New CSV file created after variable modification for dataset 'DAR': dar_16_07_14.csv",
"details": {
"dataset_id": "dar",
"file_path": "records\\18-07-2025\\dar_16_07_14.csv",
"variables_count": 3,
"reason": "variable_modification"
}
},
{
"timestamp": "2025-07-18T16:07:14.138946",
"level": "info",
"event_type": "variable_removed",
"message": "Variable removed from dataset 'DAR': PEW300",
"details": {
"dataset_id": "dar",
"name": "PEW300",
"removed_config": {
"area": "pew",
"offset": 300,
"type": "word",
"streaming": false
}
}
},
{
"timestamp": "2025-07-18T16:07:14.460648",
"level": "info",
"event_type": "dataset_csv_file_created",
"message": "New CSV file created after variable modification for dataset 'DAR': dar_16_07_14.csv",
"details": {
"dataset_id": "dar",
"file_path": "records\\18-07-2025\\dar_16_07_14.csv",
"variables_count": 4,
"reason": "variable_modification"
}
},
{
"timestamp": "2025-07-18T16:07:14.465179",
"level": "info",
"event_type": "variable_added",
"message": "Variable added to dataset 'DAR': UR62_PEW -> PEW300 (word)",
"details": {
"dataset_id": "dar",
"name": "UR62_PEW",
"area": "pew",
"db": null,
"offset": 300,
"bit": null,
"type": "word",
"streaming": false
}
},
{
"timestamp": "2025-07-18T16:07:19.834364",
"level": "info",
"event_type": "dataset_deactivated",
"message": "Dataset deactivated: DAR",
"details": {
"dataset_id": "dar"
}
},
{
"timestamp": "2025-07-18T16:07:19.838351",
"level": "info",
"event_type": "streaming_stopped",
"message": "Multi-dataset streaming stopped: 1 datasets deactivated",
"details": {}
},
{
"timestamp": "2025-07-18T16:07:50.834816",
"level": "info",
"event_type": "variable_added",
"message": "Variable added to dataset 'DAR': UR29_PEW -> PEW304 (word)",
"details": {
"dataset_id": "dar",
"name": "UR29_PEW",
"area": "pew",
"db": null,
"offset": 304,
"bit": null,
"type": "word",
"streaming": false
}
},
{
"timestamp": "2025-07-18T16:08:15.313118",
"level": "info",
"event_type": "variable_removed",
"message": "Variable removed from dataset 'DAR': CTS306_Conditi",
"details": {
"dataset_id": "dar",
"name": "CTS306_Conditi",
"removed_config": {
"area": "db",
"offset": 18,
"type": "real",
"streaming": true,
"db": 2124
}
}
},
{
"timestamp": "2025-07-18T16:08:50.490326",
"level": "info",
"event_type": "variable_removed",
"message": "Variable removed from dataset 'DAR': UR62_Brix",
"details": {
"dataset_id": "dar",
"name": "UR62_Brix",
"removed_config": {
"area": "db",
"offset": 18,
"type": "real",
"streaming": true,
"db": 2122
}
}
},
{
"timestamp": "2025-07-18T16:08:50.750605",
"level": "info",
"event_type": "variable_added",
"message": "Variable added to dataset 'DAR': UR62_Brix -> DB1011.1296 (real)",
"details": {
"dataset_id": "dar",
"name": "UR62_Brix",
"area": "db",
"db": 1011,
"offset": 1296,
"bit": null,
"type": "real",
"streaming": false
}
},
{
"timestamp": "2025-07-18T16:09:30.790847",
"level": "info",
"event_type": "variable_added",
"message": "Variable added to dataset 'DAR': UR29_Brix -> DB1011.1322 (real)",
"details": {
"dataset_id": "dar",
"name": "UR29_Brix",
"area": "db",
"db": 1011,
"offset": 1322,
"bit": null,
"type": "real",
"streaming": false
}
},
{
"timestamp": "2025-07-18T16:14:37.452312",
"level": "info",
"event_type": "variable_added",
"message": "Variable added to dataset 'DAR': CTS306_PV -> DB1011.1328 (real)",
"details": {
"dataset_id": "dar",
"name": "CTS306_PV",
"area": "db",
"db": 1011,
"offset": 1328,
"bit": null,
"type": "real",
"streaming": false
}
},
{
"timestamp": "2025-07-18T16:14:46.295741",
"level": "info",
"event_type": "config_change",
"message": "PLC configuration updated: 10.1.33.11:0/2",
"details": {
"old_config": {
"ip": "10.1.33.11",
"rack": 0,
"slot": 2
},
"new_config": {
"ip": "10.1.33.11",
"rack": 0,
"slot": 2
}
}
},
{
"timestamp": "2025-07-18T16:14:48.200032",
"level": "info",
"event_type": "dataset_activated",
"message": "Dataset activated: DAR",
"details": {
"dataset_id": "dar",
"variables_count": 6,
"streaming_count": 1,
"prefix": "dar"
}
},
{
"timestamp": "2025-07-18T16:14:48.203024",
"level": "info",
"event_type": "streaming_started",
"message": "Multi-dataset streaming started: 1 datasets activated",
"details": {
"activated_datasets": 1,
"total_datasets": 2,
"udp_host": "127.0.0.1",
"udp_port": 9870
}
}
],
"last_updated": "2025-07-18T10:02:33.093596",
"total_entries": 128
"last_updated": "2025-07-18T16:14:48.203024",
"total_entries": 157
}

0
core/config_manager.py Normal file
View File

1916
core/plc_client.py Normal file

File diff suppressed because it is too large Load Diff

0
core/streamer.py Normal file
View File

1877
main.py

File diff suppressed because it is too large Load Diff

View File

@ -4,19 +4,6 @@
"name": "DAR",
"prefix": "dar",
"variables": {
"PEW300": {
"area": "pew",
"offset": 300,
"type": "word",
"streaming": false
},
"UR62_Brix": {
"area": "db",
"offset": 18,
"type": "real",
"streaming": true,
"db": 2122
},
"UR29_Brix_Digital": {
"area": "db",
"offset": 40,
@ -24,18 +11,45 @@
"streaming": true,
"db": 2120
},
"CTS306_Conditi": {
"UR62_PEW": {
"area": "pew",
"offset": 300,
"type": "word",
"streaming": false
},
"UR29_PEW": {
"area": "pew",
"offset": 304,
"type": "word",
"streaming": false
},
"UR62_Brix": {
"area": "db",
"offset": 18,
"offset": 1296,
"type": "real",
"streaming": true,
"db": 2124
"db": 1011
},
"UR29_Brix": {
"area": "db",
"offset": 1322,
"type": "real",
"streaming": true,
"db": 1011
},
"CTS306_PV": {
"area": "db",
"offset": 1328,
"type": "real",
"streaming": true,
"db": 1011
}
},
"streaming_variables": [
"UR29_Brix_Digital",
"UR62_Brix",
"CTS306_Conditi"
"UR29_Brix",
"CTS306_PV"
],
"sampling_interval": 0.2,
"enabled": true,
@ -56,5 +70,5 @@
],
"current_dataset_id": "dar",
"version": "1.0",
"last_update": "2025-07-18T10:02:33.090888"
"last_update": "2025-07-18T16:14:57.607742"
}

View File

@ -7,5 +7,5 @@
]
},
"auto_recovery_enabled": true,
"last_update": "2025-07-18T10:02:33.096712"
"last_update": "2025-07-18T16:14:48.202036"
}