From fa6b7573c742f22eaa77d778ff911c0a42df6a05 Mon Sep 17 00:00:00 2001 From: Miguel Date: Sun, 21 Apr 2024 10:22:36 +0200 Subject: [PATCH] new file: CopyPaste.py new file: DB SIPA Supervision.db new file: DB_SIPA_Supervision_Excel.xlsx new file: DB_Structure.csv new file: DB_Structure.xlsx new file: DB_Structure.xml new file: DB_to_Excel.py new file: ExpandDB.py new file: ExportData.py new file: __pycache__/ExpandDB.cpython-310.pyc new file: __pycache__/ExportData.cpython-310.pyc new file: db_definitions.json new file: udt_definitions.json --- CopyPaste.py | 28 + DB SIPA Supervision.db | 250 +++++++ DB_SIPA_Supervision_Excel.xlsx | Bin 0 -> 9180 bytes DB_Structure.csv | 176 +++++ DB_Structure.xlsx | Bin 0 -> 10125 bytes DB_Structure.xml | 924 +++++++++++++++++++++++++ DB_to_Excel.py | 172 +++++ ExpandDB.py | 125 ++++ ExportData.py | 74 ++ __pycache__/ExpandDB.cpython-310.pyc | Bin 0 -> 2846 bytes __pycache__/ExportData.cpython-310.pyc | Bin 0 -> 2244 bytes db_definitions.json | 30 + udt_definitions.json | 194 ++++++ 13 files changed, 1973 insertions(+) create mode 100644 CopyPaste.py create mode 100644 DB SIPA Supervision.db create mode 100644 DB_SIPA_Supervision_Excel.xlsx create mode 100644 DB_Structure.csv create mode 100644 DB_Structure.xlsx create mode 100644 DB_Structure.xml create mode 100644 DB_to_Excel.py create mode 100644 ExpandDB.py create mode 100644 ExportData.py create mode 100644 __pycache__/ExpandDB.cpython-310.pyc create mode 100644 __pycache__/ExportData.cpython-310.pyc create mode 100644 db_definitions.json create mode 100644 udt_definitions.json diff --git a/CopyPaste.py b/CopyPaste.py new file mode 100644 index 0000000..9265593 --- /dev/null +++ b/CopyPaste.py @@ -0,0 +1,28 @@ +def calculate_offsets(db_struct, current_offset=0): + """ + Recursively calculate byte offsets for each field in the DB structure, + applying general alignment rules except inside arrays. + """ + if isinstance(db_struct, dict): + for key, value in db_struct.items(): + if isinstance(value, dict) and 'type' in value: + is_array_element = value.get('is_array_element', False) + type_name = value['type'] + size = type_sizes.get(type_name, 1) + + if 'String' in type_name: + match = re.match(r'String\[(\d+)\]', type_name) + if match: + size = int(match.group(1)) + 2 # String length + 2 for the null terminator and length prefix + + if not is_array_element and current_offset % 2 != 0: + current_offset += 1 # Align to the next even offset if it's not an array element + + value['offset'] = current_offset + current_offset += size + + # Recursively handle nested structures + if isinstance(value, dict): + current_offset = calculate_offsets(value, current_offset) + + return current_offset diff --git a/DB SIPA Supervision.db b/DB SIPA Supervision.db new file mode 100644 index 0000000..9c8a32b --- /dev/null +++ b/DB SIPA Supervision.db @@ -0,0 +1,250 @@ +TYPE "UDT SIPA SV Main" +VERSION : 0.1 + STRUCT + N1 : DInt; // .DB_IOT.USERLEVEL + N2 : String[81]; // .DB_IOT.USERNAME + N3 : String[81]; // .DB_IOT.NOME_RICETTA + N4 : Int; // .DB_IOT.NEXT_MAINT_CYCLES + N5 : Struct // .DB_IOT.NEXT_MAINT_ITEM + V1 : String[254]; + V2 : String[254]; + V3 : String[254]; + V4 : String[254]; + V5 : String[8]; + END_STRUCT; + N6 : Array[1..3] of Real; // .DB_IOT.ELECTRIC_VOLTAGE_PHASE_D + N7 : Array[1..3] of Real; // .DB_IOT.ELECTRIC_CURRENT_PHASE_D + N8 : Real; // .DB_IOT.ELECTRIC_POWER_D + N9 : Real; // .DB_IOT.ELECTRIC_POWER_FACTOR_D + N10 : Real; // .DB_IOT.ELECTRIC_POWER_HOUR_D + N11 : Real; // .DB_IOT.ELECTRIC_POWER_WH + END_STRUCT; + +END_TYPE + +TYPE "UDT SIPA SV Section" +VERSION : 0.1 + STRUCT + N1 : DInt; // .DB_IOT.STATO_MACCHINA + N2 : DInt; // .DB_IOT.ALLARME_FERMO + N3 : DInt; // .DB_IOT.WARNING_ATTIVO (che compromette produzione) + N4 : Int; // .DB_IOT.STATO_OPERATIVO (Semaforo) + N5 : Int; // .DB_IOT.MODO_OPERATIVO (Prod,Simula,Man, ecc) + N6 : DInt; // .DB_IOT.ALARM_STOP_NO + N7 : Struct // .DB_IOT.COUNTER + V1 : DInt; // PIECES_TOT + V2 : DInt; // PIECES_OK + V3 : DInt; // PIECES_KO_1 + V4 : DInt; // PIECES_KO_2 + V5 : DInt; // PIECES_KO_3 + V6 : DInt; // PIECES_KO_4 + V7 : DInt; // PIECES_KO_5 + V8 : DInt; // PIECES_KO_6 + V9 : DInt; // PIECES_KO_7 + V10 : DInt; // PIECES_KO_8 + V11 : DInt; // PIECES_KO_9 + V12 : DInt; // PIECES_KO_10 + V13 : DInt; // T_ALARM_HOURS + V14 : DInt; // T_DRY_CYCLE_HOURS + V15 : DInt; // T_POWERED_HOURS + V16 : DInt; // T_PRODUCT_100_HOURS + V17 : DInt; // T_PRODUCT_0_HOURS + V18 : DInt; // T_STOP_HOURS + V19 : Int; // T_ALARM_MINUTES + V20 : Int; // T_DRY_CYCLE_MINUTES + V21 : Int; // T_POWERED_MINUTES + V22 : Int; // T_PRODUCT_100_MINUTES + V23 : Int; // T_PRODUCT_0_MINUTES + V24 : Int; // T_STOP_MINUTES + END_STRUCT; + END_STRUCT; + +END_TYPE + +DATA_BLOCK "DB SIPA Supervision" +{ S7_Optimized_Access := 'FALSE' } +VERSION : 0.1 +NON_RETAIN + STRUCT + MAIN : "UDT SIPA SV Main"; + SECT1 : "UDT SIPA SV Section"; + SECT2 : "UDT SIPA SV Section"; + SECT3 : "UDT SIPA SV Section"; + SECT4 : "UDT SIPA SV Section"; + SECT5 : "UDT SIPA SV Section"; + END_STRUCT; + + +BEGIN + MAIN.N1 := 9; + MAIN.N2 := 'superuser '; + MAIN.N3 := '0,4 L Petaloid Base'; + MAIN.N4 := 0; + MAIN.N5.V1 := 'testo da inserire'; + MAIN.N5.V2 := ''; + MAIN.N5.V3 := ''; + MAIN.N5.V4 := ''; + MAIN.N5.V5 := ''; + MAIN.N6[1] := 0.0; + MAIN.N6[2] := 0.0; + MAIN.N6[3] := 0.0; + MAIN.N7[1] := 0.0; + MAIN.N7[2] := 0.0; + MAIN.N7[3] := 0.0; + MAIN.N8 := 0.0; + MAIN.N9 := 0.0; + MAIN.N10 := 0.0; + MAIN.N11 := 0.0; + SECT1.N1 := 2; + SECT1.N2 := 0; + SECT1.N3 := 0; + SECT1.N4 := 3; + SECT1.N5 := 2; + SECT1.N6 := 0; + SECT1.N7.V1 := 0; + SECT1.N7.V2 := 0; + SECT1.N7.V3 := 0; + SECT1.N7.V4 := 0; + SECT1.N7.V5 := 0; + SECT1.N7.V6 := 0; + SECT1.N7.V7 := 0; + SECT1.N7.V8 := 0; + SECT1.N7.V9 := 0; + SECT1.N7.V10 := 0; + SECT1.N7.V11 := 0; + SECT1.N7.V12 := 0; + SECT1.N7.V13 := 0; + SECT1.N7.V14 := 0; + SECT1.N7.V15 := 0; + SECT1.N7.V16 := 0; + SECT1.N7.V17 := 0; + SECT1.N7.V18 := 0; + SECT1.N7.V19 := 0; + SECT1.N7.V20 := 0; + SECT1.N7.V21 := 0; + SECT1.N7.V22 := 0; + SECT1.N7.V23 := 0; + SECT1.N7.V24 := 0; + SECT2.N1 := 0; + SECT2.N2 := 0; + SECT2.N3 := 0; + SECT2.N4 := 0; + SECT2.N5 := 0; + SECT2.N6 := 0; + SECT2.N7.V1 := 0; + SECT2.N7.V2 := 0; + SECT2.N7.V3 := 0; + SECT2.N7.V4 := 0; + SECT2.N7.V5 := 0; + SECT2.N7.V6 := 0; + SECT2.N7.V7 := 0; + SECT2.N7.V8 := 0; + SECT2.N7.V9 := 0; + SECT2.N7.V10 := 0; + SECT2.N7.V11 := 0; + SECT2.N7.V12 := 0; + SECT2.N7.V13 := 0; + SECT2.N7.V14 := 0; + SECT2.N7.V15 := 0; + SECT2.N7.V16 := 0; + SECT2.N7.V17 := 0; + SECT2.N7.V18 := 0; + SECT2.N7.V19 := 0; + SECT2.N7.V20 := 0; + SECT2.N7.V21 := 0; + SECT2.N7.V22 := 0; + SECT2.N7.V23 := 0; + SECT2.N7.V24 := 0; + SECT3.N1 := 0; + SECT3.N2 := 0; + SECT3.N3 := 0; + SECT3.N4 := 0; + SECT3.N5 := 0; + SECT3.N6 := 0; + SECT3.N7.V1 := 0; + SECT3.N7.V2 := 0; + SECT3.N7.V3 := 0; + SECT3.N7.V4 := 0; + SECT3.N7.V5 := 0; + SECT3.N7.V6 := 0; + SECT3.N7.V7 := 0; + SECT3.N7.V8 := 0; + SECT3.N7.V9 := 0; + SECT3.N7.V10 := 0; + SECT3.N7.V11 := 0; + SECT3.N7.V12 := 0; + SECT3.N7.V13 := 0; + SECT3.N7.V14 := 0; + SECT3.N7.V15 := 0; + SECT3.N7.V16 := 0; + SECT3.N7.V17 := 0; + SECT3.N7.V18 := 0; + SECT3.N7.V19 := 0; + SECT3.N7.V20 := 0; + SECT3.N7.V21 := 0; + SECT3.N7.V22 := 0; + SECT3.N7.V23 := 0; + SECT3.N7.V24 := 0; + SECT4.N1 := 0; + SECT4.N2 := 0; + SECT4.N3 := 0; + SECT4.N4 := 0; + SECT4.N5 := 0; + SECT4.N6 := 0; + SECT4.N7.V1 := 0; + SECT4.N7.V2 := 0; + SECT4.N7.V3 := 0; + SECT4.N7.V4 := 0; + SECT4.N7.V5 := 0; + SECT4.N7.V6 := 0; + SECT4.N7.V7 := 0; + SECT4.N7.V8 := 0; + SECT4.N7.V9 := 0; + SECT4.N7.V10 := 0; + SECT4.N7.V11 := 0; + SECT4.N7.V12 := 0; + SECT4.N7.V13 := 0; + SECT4.N7.V14 := 0; + SECT4.N7.V15 := 0; + SECT4.N7.V16 := 0; + SECT4.N7.V17 := 0; + SECT4.N7.V18 := 0; + SECT4.N7.V19 := 0; + SECT4.N7.V20 := 0; + SECT4.N7.V21 := 0; + SECT4.N7.V22 := 0; + SECT4.N7.V23 := 0; + SECT4.N7.V24 := 0; + SECT5.N1 := 0; + SECT5.N2 := 0; + SECT5.N3 := 0; + SECT5.N4 := 0; + SECT5.N5 := 0; + SECT5.N6 := 0; + SECT5.N7.V1 := 0; + SECT5.N7.V2 := 0; + SECT5.N7.V3 := 0; + SECT5.N7.V4 := 0; + SECT5.N7.V5 := 0; + SECT5.N7.V6 := 0; + SECT5.N7.V7 := 0; + SECT5.N7.V8 := 0; + SECT5.N7.V9 := 0; + SECT5.N7.V10 := 0; + SECT5.N7.V11 := 0; + SECT5.N7.V12 := 0; + SECT5.N7.V13 := 0; + SECT5.N7.V14 := 0; + SECT5.N7.V15 := 0; + SECT5.N7.V16 := 0; + SECT5.N7.V17 := 0; + SECT5.N7.V18 := 0; + SECT5.N7.V19 := 0; + SECT5.N7.V20 := 0; + SECT5.N7.V21 := 0; + SECT5.N7.V22 := 0; + SECT5.N7.V23 := 0; + SECT5.N7.V24 := 0; + +END_DATA_BLOCK + diff --git a/DB_SIPA_Supervision_Excel.xlsx b/DB_SIPA_Supervision_Excel.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..48e46d637fab00c463b03cbb90b1e5000078a87a GIT binary patch literal 9180 zcmaia2RNKd`#uppYP2MJ5Tf@W%IZCY=%RPKtM``GO9VmGi0Ba{!Ag+Tg6M(}yE@TV zZ&82CI{$Ny@B6O5z3lt$JoDVoJ@?GK*E}H(jrZ1TWA5$o4{5mXyy9leC4y0$yuBx|Ax^VWRN#~IaKW2d z?(qaW^}}RKY<9(#(k5$4OhM3|K}-hwgj#fMgrWr*vroA$lW@#|u!fDUUtu95*zc=x zN$9$@8G2$1VeT!gGCxD#jYLS zaM&YjUL9zGI{jc@c{Js1nLO@xIwT#sdi;XUw~RbZR5gIe5h`O4&**LrN@|=H{B{gZb@ZFGE4^Wsp$^a?ja|`xd&k9-Sa_flOppAaYV zF0Oz}{*BCe+Y|M>swEv?Ul>v?mDEV%jHl>))a4+{(Koad<<%I!^R9f| zy}2?jfzkIBCTa%|xvm0v$0__%N6MXt(`=*|&t zg4n?dtAeUKtJv2#oa~d~YtZ54;^usd`<0Gcx6;$sAB)Ad4AIx3WX0QI`_)@RAmt5y z(Z?87T~kX!PZ_8Dp@d<0{g+d(;9RXTbEMDXskGV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A^G(>{htp$0nz&PQ|EVk`wz#U{sj2*+|F-vB&0e&e;@;TmdpnIqPeL?xt^v_-DKc=LVzfAw!v;GP2=NkAA0OHaAnY(|lh<}>@ hIoba)htU2X^S`FPvOF64tp+ym`v!>f>66?4{s$8zfNlT) literal 0 HcmV?d00001 diff --git a/DB_Structure.xml b/DB_Structure.xml new file mode 100644 index 0000000..a842c56 --- /dev/null +++ b/DB_Structure.xml @@ -0,0 +1,924 @@ + + + + +
+ "UDT SIPA SV Main" + + + + + DInt + .DB_IOT.USERLEVEL + 0 + + + String[81] + .DB_IOT.USERNAME + 4 + + + String[81] + .DB_IOT.NOME_RICETTA + 88 + + + Int + .DB_IOT.NEXT_MAINT_CYCLES + 172 + + + + String[254] + + 174 + + + String[254] + + 430 + + + String[254] + + 686 + + + String[254] + + 942 + + + String[8] + + 1198 + + + + .DB_IOT.ELECTRIC_VOLTAGE_PHASE_D + + Real + true + 1208 + + + Real + true + 1212 + + + Real + true + 1216 + + + + .DB_IOT.ELECTRIC_CURRENT_PHASE_D + + Real + true + 1220 + + + Real + true + 1224 + + + Real + true + 1228 + + + + Real + .DB_IOT.ELECTRIC_POWER_D + 1232 + + + Real + .DB_IOT.ELECTRIC_POWER_FACTOR_D + 1236 + + + Real + .DB_IOT.ELECTRIC_POWER_HOUR_D + 1240 + + + Real + .DB_IOT.ELECTRIC_POWER_WH + 1244 + + + + 0 +
+ + "UDT SIPA SV Section" + + + + + DInt + .DB_IOT.STATO_MACCHINA + 1664 + + + DInt + .DB_IOT.ALLARME_FERMO + 1668 + + + DInt + .DB_IOT.WARNING_ATTIVO (che compromette produzione) + 1672 + + + Int + .DB_IOT.STATO_OPERATIVO (Semaforo) + 1676 + + + Int + .DB_IOT.MODO_OPERATIVO (Prod,Simula,Man, ecc) + 1678 + + + DInt + .DB_IOT.ALARM_STOP_NO + 1680 + + + + DInt + PIECES_TOT + 1684 + + + DInt + PIECES_OK + 1688 + + + DInt + PIECES_KO_1 + 1692 + + + DInt + PIECES_KO_2 + 1696 + + + DInt + PIECES_KO_3 + 1700 + + + DInt + PIECES_KO_4 + 1704 + + + DInt + PIECES_KO_5 + 1708 + + + DInt + PIECES_KO_6 + 1712 + + + DInt + PIECES_KO_7 + 1716 + + + DInt + PIECES_KO_8 + 1720 + + + DInt + PIECES_KO_9 + 1724 + + + DInt + PIECES_KO_10 + 1728 + + + DInt + T_ALARM_HOURS + 1732 + + + DInt + T_DRY_CYCLE_HOURS + 1736 + + + DInt + T_POWERED_HOURS + 1740 + + + DInt + T_PRODUCT_100_HOURS + 1744 + + + DInt + T_PRODUCT_0_HOURS + 1748 + + + DInt + T_STOP_HOURS + 1752 + + + Int + T_ALARM_MINUTES + 1756 + + + Int + T_DRY_CYCLE_MINUTES + 1758 + + + Int + T_POWERED_MINUTES + 1760 + + + Int + T_PRODUCT_100_MINUTES + 1762 + + + Int + T_PRODUCT_0_MINUTES + 1764 + + + Int + T_STOP_MINUTES + 1766 + + + + + 1248 + + + "UDT SIPA SV Section" + + + + + DInt + .DB_IOT.STATO_MACCHINA + 1664 + + + DInt + .DB_IOT.ALLARME_FERMO + 1668 + + + DInt + .DB_IOT.WARNING_ATTIVO (che compromette produzione) + 1672 + + + Int + .DB_IOT.STATO_OPERATIVO (Semaforo) + 1676 + + + Int + .DB_IOT.MODO_OPERATIVO (Prod,Simula,Man, ecc) + 1678 + + + DInt + .DB_IOT.ALARM_STOP_NO + 1680 + + + + DInt + PIECES_TOT + 1684 + + + DInt + PIECES_OK + 1688 + + + DInt + PIECES_KO_1 + 1692 + + + DInt + PIECES_KO_2 + 1696 + + + DInt + PIECES_KO_3 + 1700 + + + DInt + PIECES_KO_4 + 1704 + + + DInt + PIECES_KO_5 + 1708 + + + DInt + PIECES_KO_6 + 1712 + + + DInt + PIECES_KO_7 + 1716 + + + DInt + PIECES_KO_8 + 1720 + + + DInt + PIECES_KO_9 + 1724 + + + DInt + PIECES_KO_10 + 1728 + + + DInt + T_ALARM_HOURS + 1732 + + + DInt + T_DRY_CYCLE_HOURS + 1736 + + + DInt + T_POWERED_HOURS + 1740 + + + DInt + T_PRODUCT_100_HOURS + 1744 + + + DInt + T_PRODUCT_0_HOURS + 1748 + + + DInt + T_STOP_HOURS + 1752 + + + Int + T_ALARM_MINUTES + 1756 + + + Int + T_DRY_CYCLE_MINUTES + 1758 + + + Int + T_POWERED_MINUTES + 1760 + + + Int + T_PRODUCT_100_MINUTES + 1762 + + + Int + T_PRODUCT_0_MINUTES + 1764 + + + Int + T_STOP_MINUTES + 1766 + + + + + 1352 + + + "UDT SIPA SV Section" + + + + + DInt + .DB_IOT.STATO_MACCHINA + 1664 + + + DInt + .DB_IOT.ALLARME_FERMO + 1668 + + + DInt + .DB_IOT.WARNING_ATTIVO (che compromette produzione) + 1672 + + + Int + .DB_IOT.STATO_OPERATIVO (Semaforo) + 1676 + + + Int + .DB_IOT.MODO_OPERATIVO (Prod,Simula,Man, ecc) + 1678 + + + DInt + .DB_IOT.ALARM_STOP_NO + 1680 + + + + DInt + PIECES_TOT + 1684 + + + DInt + PIECES_OK + 1688 + + + DInt + PIECES_KO_1 + 1692 + + + DInt + PIECES_KO_2 + 1696 + + + DInt + PIECES_KO_3 + 1700 + + + DInt + PIECES_KO_4 + 1704 + + + DInt + PIECES_KO_5 + 1708 + + + DInt + PIECES_KO_6 + 1712 + + + DInt + PIECES_KO_7 + 1716 + + + DInt + PIECES_KO_8 + 1720 + + + DInt + PIECES_KO_9 + 1724 + + + DInt + PIECES_KO_10 + 1728 + + + DInt + T_ALARM_HOURS + 1732 + + + DInt + T_DRY_CYCLE_HOURS + 1736 + + + DInt + T_POWERED_HOURS + 1740 + + + DInt + T_PRODUCT_100_HOURS + 1744 + + + DInt + T_PRODUCT_0_HOURS + 1748 + + + DInt + T_STOP_HOURS + 1752 + + + Int + T_ALARM_MINUTES + 1756 + + + Int + T_DRY_CYCLE_MINUTES + 1758 + + + Int + T_POWERED_MINUTES + 1760 + + + Int + T_PRODUCT_100_MINUTES + 1762 + + + Int + T_PRODUCT_0_MINUTES + 1764 + + + Int + T_STOP_MINUTES + 1766 + + + + + 1456 + + + "UDT SIPA SV Section" + + + + + DInt + .DB_IOT.STATO_MACCHINA + 1664 + + + DInt + .DB_IOT.ALLARME_FERMO + 1668 + + + DInt + .DB_IOT.WARNING_ATTIVO (che compromette produzione) + 1672 + + + Int + .DB_IOT.STATO_OPERATIVO (Semaforo) + 1676 + + + Int + .DB_IOT.MODO_OPERATIVO (Prod,Simula,Man, ecc) + 1678 + + + DInt + .DB_IOT.ALARM_STOP_NO + 1680 + + + + DInt + PIECES_TOT + 1684 + + + DInt + PIECES_OK + 1688 + + + DInt + PIECES_KO_1 + 1692 + + + DInt + PIECES_KO_2 + 1696 + + + DInt + PIECES_KO_3 + 1700 + + + DInt + PIECES_KO_4 + 1704 + + + DInt + PIECES_KO_5 + 1708 + + + DInt + PIECES_KO_6 + 1712 + + + DInt + PIECES_KO_7 + 1716 + + + DInt + PIECES_KO_8 + 1720 + + + DInt + PIECES_KO_9 + 1724 + + + DInt + PIECES_KO_10 + 1728 + + + DInt + T_ALARM_HOURS + 1732 + + + DInt + T_DRY_CYCLE_HOURS + 1736 + + + DInt + T_POWERED_HOURS + 1740 + + + DInt + T_PRODUCT_100_HOURS + 1744 + + + DInt + T_PRODUCT_0_HOURS + 1748 + + + DInt + T_STOP_HOURS + 1752 + + + Int + T_ALARM_MINUTES + 1756 + + + Int + T_DRY_CYCLE_MINUTES + 1758 + + + Int + T_POWERED_MINUTES + 1760 + + + Int + T_PRODUCT_100_MINUTES + 1762 + + + Int + T_PRODUCT_0_MINUTES + 1764 + + + Int + T_STOP_MINUTES + 1766 + + + + + 1560 + + + "UDT SIPA SV Section" + + + + + DInt + .DB_IOT.STATO_MACCHINA + 1664 + + + DInt + .DB_IOT.ALLARME_FERMO + 1668 + + + DInt + .DB_IOT.WARNING_ATTIVO (che compromette produzione) + 1672 + + + Int + .DB_IOT.STATO_OPERATIVO (Semaforo) + 1676 + + + Int + .DB_IOT.MODO_OPERATIVO (Prod,Simula,Man, ecc) + 1678 + + + DInt + .DB_IOT.ALARM_STOP_NO + 1680 + + + + DInt + PIECES_TOT + 1684 + + + DInt + PIECES_OK + 1688 + + + DInt + PIECES_KO_1 + 1692 + + + DInt + PIECES_KO_2 + 1696 + + + DInt + PIECES_KO_3 + 1700 + + + DInt + PIECES_KO_4 + 1704 + + + DInt + PIECES_KO_5 + 1708 + + + DInt + PIECES_KO_6 + 1712 + + + DInt + PIECES_KO_7 + 1716 + + + DInt + PIECES_KO_8 + 1720 + + + DInt + PIECES_KO_9 + 1724 + + + DInt + PIECES_KO_10 + 1728 + + + DInt + T_ALARM_HOURS + 1732 + + + DInt + T_DRY_CYCLE_HOURS + 1736 + + + DInt + T_POWERED_HOURS + 1740 + + + DInt + T_PRODUCT_100_HOURS + 1744 + + + DInt + T_PRODUCT_0_HOURS + 1748 + + + DInt + T_STOP_HOURS + 1752 + + + Int + T_ALARM_MINUTES + 1756 + + + Int + T_DRY_CYCLE_MINUTES + 1758 + + + Int + T_POWERED_MINUTES + 1760 + + + Int + T_PRODUCT_100_MINUTES + 1762 + + + Int + T_PRODUCT_0_MINUTES + 1764 + + + Int + T_STOP_MINUTES + 1766 + + + + + 1664 + +
+
+
\ No newline at end of file diff --git a/DB_to_Excel.py b/DB_to_Excel.py new file mode 100644 index 0000000..334865a --- /dev/null +++ b/DB_to_Excel.py @@ -0,0 +1,172 @@ +import re +import json +import pandas as pd +from ExportData import * +from ExpandDB import * + + +def clean_line(line): + """Clean line from BOM and extra spaces or quotes.""" + # Remove UTF-8 BOM if exists and strip trailing/leading whitespace + line = line.replace("\ufeff", "").strip() + # Standardize TYPE and DATA_BLOCK definitions to ensure they're properly captured + line = re.sub(r'\s*TYPE\s+"?', 'TYPE "', line) + line = re.sub(r'\s*DATA_BLOCK\s+"?', 'DATA_BLOCK "', line) + return line + + +def extract_name(line): + """Extract the name from TYPE or DATA_BLOCK definition line.""" + # Attempt to find a quoted name first + match = re.search(r'(TYPE|DATA_BLOCK)\s+"([^"]+)"', line) + if match: + return match.group(2).strip() # The name is within quotes + + # If no quoted name, find an unquoted name + match = re.search(r"(TYPE|DATA_BLOCK)\s+(\S+)", line) + if match: + return match.group(2).strip() # The name is without quotes + + +def parse_udts(lines): + udt_json = {} + udt_name = None + nested_structs = [] + current_struct = None + is_within_struct = False + + for line in lines: + line = clean_line(line) + if "TYPE" in line and "END_TYPE" not in line: + udt_name = extract_name(line) + udt_json[udt_name] = {} + current_struct = udt_json[udt_name] + print(f"Created UDT: {udt_name}") + elif "END_TYPE" in line: + print(f"Completed UDT: {udt_name}") + udt_name = None + nested_structs = [] + current_struct = None + is_within_struct = False + elif "STRUCT" in line and "END_STRUCT" not in line and udt_name is not None: + struct_name = ( + "Struct" if "STRUCT" == line.strip() else line.split(":")[0].strip() + ) + new_struct = {} + current_struct[struct_name] = new_struct + nested_structs.append(current_struct) + current_struct = new_struct + is_within_struct = True + print(f"Created STRUCT: {struct_name}") + elif "END_STRUCT" in line and udt_name is not None: + current_struct = nested_structs.pop() if nested_structs else None + is_within_struct = bool(nested_structs) + print(f"Closed STRUCT in UDT '{udt_name}'") + elif udt_name and ":" in line and is_within_struct: + parts = line.split(":") + field_name = parts[0].strip() + field_details = parts[1].strip().split("//") + field_type = ( + field_details[0].replace(";", "").strip() + ) # Removing ';' from field type + field_comment = parts[1].split("//")[1].strip() if "//" in parts[1] else "" + if "Struct" in field_type: + new_struct = {} + current_struct[field_name] = new_struct + nested_structs.append(current_struct) + current_struct = new_struct + print(f"Opened inline STRUCT at field '{field_name}'") + else: + current_struct[field_name] = { + "type": field_type, + "comment": field_comment, + } + print( + f"Added field '{field_name}' to STRUCT: Type={field_type}, Comment={field_comment}" + ) + + return udt_json + + +def parse_dbs(lines, udts): + db_json = {} + db_name = None + nested_structs = [] + current_struct = None + is_within_struct = False + + for line in lines: + line = clean_line(line) + if "DATA_BLOCK" in line and "END_DATA_BLOCK" not in line: + db_name = extract_name(line) + db_json[db_name] = {} + current_struct = db_json[db_name] + print(f"Created DATA_BLOCK: {db_name}") + elif "END_DATA_BLOCK" in line: + print(f"Completed DATA_BLOCK: {db_name}") + db_name = None + nested_structs = [] + current_struct = None + is_within_struct = False + elif "STRUCT" in line and "END_STRUCT" not in line and db_name is not None: + struct_name = ( + "Struct" if "STRUCT" == line.strip() else line.split(":")[0].strip() + ) + new_struct = {} + current_struct[struct_name] = new_struct + nested_structs.append(current_struct) + current_struct = new_struct + is_within_struct = True + print(f"Created STRUCT in DB '{db_name}': {struct_name}") + elif "END_STRUCT" in line and db_name is not None: + current_struct = nested_structs.pop() if nested_structs else None + is_within_struct = bool(nested_structs) + print(f"Closed STRUCT in DB '{db_name}'") + elif db_name and ":" in line and is_within_struct: + parts = line.split(":") + field_name = parts[0].strip() + field_details = parts[1].strip().split("//") + field_type = ( + field_details[0].replace(";", "").strip() + ) # Removing ';' from field type + field_comment = parts[1].split("//")[1].strip() if "//" in parts[1] else "" + if "Struct" in field_type: + new_struct = {} + current_struct[field_name] = new_struct + nested_structs.append(current_struct) + current_struct = new_struct + print(f"Opened inline STRUCT at field '{field_name}' in DB '{db_name}'") + else: + current_struct[field_name] = { + "type": field_type, + "comment": field_comment, + } + print( + f"Added field '{field_name}' to STRUCT in DB '{db_name}': Type={field_type}, Comment={field_comment}" + ) + + return db_json + + +if __name__ == "__main__": + file_path = "DB SIPA Supervision.db" + with open(file_path, "r", encoding="utf-8-sig") as file: + lines = file.readlines() + + udt_json = parse_udts(lines) + db_json = parse_dbs(lines, udt_json) + + expand_dbs(udt_json, db_json) # Expand DBs with UDT definitions + + for db_name, db_content in db_json.items(): + calculate_offsets( + db_content + ) # Calculate offsets including special handling for Bool and String + + # Display the expanded DBs as a table + df = display_as_table(db_json) + save_dataframe_to_file(df) # Save the DataFrame to a CSV file + save_dataframe_to_excel(df) # Optionally, save the DataFrame to an Excel file + + # Save JSON data to an XML file + save_json_to_xml(db_json) diff --git a/ExpandDB.py b/ExpandDB.py new file mode 100644 index 0000000..9f4e7e4 --- /dev/null +++ b/ExpandDB.py @@ -0,0 +1,125 @@ +import re +import json +import pandas as pd + +def expand_udt_references(db_struct, udts): + """ + Recursively expand UDT references in the given DB structure using the UDT definitions. + This function specifically expands fields designated as 'type' which reference UDTs. + """ + if isinstance(db_struct, dict): + for key, value in list(db_struct.items()): + if isinstance(value, dict): + # Recurse into dictionaries + expand_udt_references(value, udts) + elif isinstance(value, str) and key == "type": # Only expand 'type' fields + type_name = value.strip( + '"' + ) # Remove quotes which may wrap UDT names with spaces + if type_name in udts: + # Replace the UDT reference with its definition, if it exists + db_struct["fields"] = udts[ + type_name + ].copy() # Assume structure to insert is under 'fields' + print(f"Expanded UDT '{type_name}' at field '{key}' ") + elif isinstance(db_struct, list): + for item in db_struct: + expand_udt_references(item, udts) + + +def handle_array_types(db_struct): + """ + Handle array types once all UDTs are expanded. + This function modifies the structure in place. + """ + if isinstance(db_struct, dict): + for key, value in list(db_struct.items()): + if isinstance(value, dict): + handle_array_types(value) + elif isinstance(value, str): + # Parsing array definitions, e.g., "Array[1..3] of Real" + match = re.match(r"Array\[(\d+)\.\.(\d+)\] of (\w+)", value) + if match: + lower_bound, upper_bound, base_type = ( + int(match.group(1)), + int(match.group(2)), + match.group(3), + ) + # Expand this field into multiple fields + db_struct.pop(key) # Remove the original field + for i in range(lower_bound, upper_bound + 1): + db_struct[f"{key}_{i}"] = {"type": base_type, 'is_array_element': True} + print( + f"Expanded field '{key}' into array fields: {key}_{lower_bound} to {key}_{upper_bound} of type {base_type}" + ) + + +type_sizes = { + "Int": 2, + "DInt": 4, + "Word": 2, + "Real": 4, + "Bool": 2, # We'll adjust this dynamically based on context (1 byte if alone, 1 bit if grouped) + "String": 1, # This will be multiplied by the specified size in brackets [n] +} + + +def calculate_offsets(db_struct, current_offset=0, parent=None): + """ + Recursively calculate byte offsets for each field in the DB structure considering special types. + """ + last_key_was_bool = False + if isinstance(db_struct, dict): + for key, value in list(db_struct.items()): + if isinstance(value, dict): + if "type" in value: + type_name = value["type"] + is_array_element = value.get('is_array_element', False) + size = type_sizes.get( + type_name, 0 + ) # Default to 1 byte if type is not recognized + + if not is_array_element and current_offset % 2 != 0: + current_offset += 1 # Align to the next even offset if it's not an array element + + # Special handling for String types + if "String" in type_name: + match = re.match(r"String\[(\d+)\]", type_name) + if match: + length = int(match.group(1)) + size = length + 2 # Account for null-termination and string length prefix + else: + size = type_sizes.get(type_name, 1) # Default to generic size if not an array + + # Adjusting Bool sizes based on grouping + if type_name == "Bool": + if last_key_was_bool: # This is a grouped bool + size = 0.125 # One bit per Bool if grouped + else: + size = 2 # Bools use a full byte if not grouped + last_key_was_bool = True + else: + last_key_was_bool = False + + value["offset"] = current_offset + current_offset += size + + current_offset = calculate_offsets( + value, current_offset, value + ) # Recurse into nested structs + elif isinstance(db_struct, list): + for item in db_struct: + current_offset = calculate_offsets(item, current_offset, parent) + return current_offset + + +def expand_dbs(udts, dbs): + """ + Expand all UDT references in all DBs and then handle array types. + """ + for db_name, db_content in dbs.items(): + print(f"Expanding DB: {db_name}") + expand_udt_references(db_content, udts) + handle_array_types(db_content) + calculate_offsets(db_content) + print(f"Completed expansion for DB: {db_name}") diff --git a/ExportData.py b/ExportData.py new file mode 100644 index 0000000..a178f54 --- /dev/null +++ b/ExportData.py @@ -0,0 +1,74 @@ +import xmltodict +import pandas as pd + +def save_json_to_xml(json_data, filename="DB_Structure.xml"): + """ + Convert JSON data to XML and save it to a file. + """ + xml_data = xmltodict.unparse({"root": json_data}, pretty=True) + with open(filename, "w") as xml_file: + xml_file.write(xml_data) + print(f"XML data saved to {filename}") + + +def save_dataframe_to_excel(df, filename="DB_Structure.xlsx"): + """ + Save the provided DataFrame to an Excel file. + """ + df.to_excel(filename, index=False) + print(f"Data saved to {filename}") + + +def save_dataframe_to_file(df, filename="DB_Structure.csv"): + """ + Save the provided DataFrame to a CSV file. + """ + df.to_csv(filename, index=False) + print(f"Data saved to {filename}") + + +def collect_data_for_table(db_struct, parent_prefix="", collected_data=[]): + """ + Recursively collect data from the DB structure to display in a tabular format, + omitting 'fields' and 'Struct' in the names. + """ + if isinstance(db_struct, dict): + for key, value in db_struct.items(): + # Skip 'fields' and 'Struct' keys in the name path + if key == 'fields' or key == 'Struct': + next_prefix = parent_prefix # Continue with the current prefix + else: + next_prefix = f"{parent_prefix}.{key}" if parent_prefix else key + + if isinstance(value, dict) and 'type' in value: # Directly a field with 'type' + field_data = { + "Nombre": next_prefix, + "Tipo": value.get('type', 'N/A'), + "Offset": value.get('offset', 'N/A'), + "Comentario": value.get('comment', 'N/A') + } + collected_data.append(field_data) + + # Recursively handle nested dictionaries and lists + if isinstance(value, dict) or isinstance(value, list): + collect_data_for_table(value, next_prefix, collected_data) + elif isinstance(db_struct, list): + for index, item in enumerate(db_struct): + item_prefix = f"{parent_prefix}[{index}]" if parent_prefix else f"[{index}]" + collect_data_for_table(item, item_prefix, collected_data) + + return collected_data + + +def display_as_table(dbs): + """ + Convert collected DB data into a pandas DataFrame and display it. + """ + all_data = [] + for db_name, db_content in dbs.items(): + print(f"Processing DB: {db_name}") + db_data = collect_data_for_table(db_content) + all_data.extend(db_data) + + df = pd.DataFrame(all_data) + return df diff --git a/__pycache__/ExpandDB.cpython-310.pyc b/__pycache__/ExpandDB.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3d88268966987ebe93990d488915d896ca599c6a GIT binary patch literal 2846 zcmZuzL2ul~73K_wTrPJd%WiB#soM}mP=*>mqd~djxEf>Y?!q6!RgB3?!?9z3$2Om~ZpFP;wc57VHTrWQ1oVW7%7k zME1Xk_hPv&Q#tsI?e*kPuE8gf?0zu1a*kPpdj+S*>WcBCsPCefzrxs{4JeE?X%k1Nw-At-XU6JzVdq+9b5qt+ z-$_HHIww?~8W~Perpe*w0A`*H_RY`-PrkvKfRWi#>wq=iJ zYAbtkSQdvb7DCHfP3#1DJY_#{aW}zY{XM^QjHi`sErwfJZoAph;#=9hQQxH{)@y8z zT{$7k!a7lv#=5Aq>d3h3-S#JQX(unX??UX?M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-310.pyc b/__pycache__/ExportData.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..3b9b39873c2f4845abdbab6ea9d2d0fe82d29585 GIT binary patch literal 2244 zcma)7&2QX96!(nBUaymEwrQJ|4^^&&6fK}21X4wX3N+gaQP?69XjxJ%j%PNw_1fE+ z*)&k5MP;sYJN{;MPBN!k&7@0tle?TfBwd%E;y$kd#rP7h^AISH&uu$>%IEn4 ztbE?!iw~V{jgxh!b^3RZ=5&sl?W?_YEk}tSNwK;+$P$V_rVoQTfNu>xbsGll+$Efp zPD(iC?jt&(nwEsKefrbF#4X(ex1@)JIJX?`F^4((E^+eUZAV>r0K52p4WDM*FUe!) z3EhWX?twnF@q1we&svf12&tn_)^Bzq9_u*LMRfbKPop^Jk&1Ujlxp0Hqkfu+Rm)?T zEDF8R0vm@?XuW61gU)yfxvT_a&aa@QqTZhf9l4fx0P*PjyOr8yV7M-4n{Lu7s3X;Bk^Ap%X7bx`9eHI(-yT4X&| z4GXX|=dA7M>pouAoAIH!&(M|zTO#rt5HBQbqIUk%cG-mUVB5R@%eH83{i_o>bzPnU zZh0C8w8RIE;4W*2Jd1xY<|iyz{s0-EP=A?8d9!OzUN}IEi z?KrYsdL=smoZ#LewUmEM)sW)BFKptM^njHR8GHjW)DjGLS>DqVLyBx?X9E z|Gw9?(%C1V?aQETZ4!W9xz(#))WCtlBa5z#d}ejLxJgdYm~(@>KAel>o={)VvuT` z=G)OqKNT5QD;7&uD%4v+K1_KmZ#BgezdC6A>Wm?)hUvYb7`vUfJ~DpM?<)cLkrV@{ zZNv({Qw+AG=(3G;SakiH_CPmWEAW3T)54H%47t+^Oqi-PS31rUz#R)i9-z)Z8Fw2* z`tcB;h#QurN}J`W11#Y5z@#3SmkCoB`Dh?ytVJvA*7;Vi@<(?8;0*5T0SNZf-EL#b zE_j7v?me+*yq!23iSAr3c4r4oXw9{U;v1z_APPsn=l$y(Vc= zpDfcQN@+;&_5Te0GwwX0KQKT1qe&vtAdFhRgaFU%@qw6um1@Ic+nGRrIdE+DpMiXW z{0GP)C7tyP=s4~^ftn!DZ5Zb3eP6Q!uOx?16(x2PI=*2;KkFvPo`@iO5N06iwuua( zt;FgC%wd~3&L~~w!*~&JJrN2bw+#X=M=f8jfT|T5peu|I?!>^+Avg77&}{k8m$y_m zh_k9|m>NXOHj)qs=mWr{p(Afq&bMgs0p&>BL@h`a<_ zEg}*9VOp%Fmv9QC2b1wDW92)ru#Ln5ss$z+7c1dJpsgYno`d%X1s`SN3P#S}9XJ8p M8irxe2<9*T4Ug1IYXATM literal 0 HcmV?d00001 diff --git a/db_definitions.json b/db_definitions.json new file mode 100644 index 0000000..9273b31 --- /dev/null +++ b/db_definitions.json @@ -0,0 +1,30 @@ +{ + "DB SIPA Supervision": { + "root": { + "MAIN": { + "type": "\"UDT SIPA SV Main\";", + "comment": "" + }, + "SECT1": { + "type": "\"UDT SIPA SV Section\";", + "comment": "" + }, + "SECT2": { + "type": "\"UDT SIPA SV Section\";", + "comment": "" + }, + "SECT3": { + "type": "\"UDT SIPA SV Section\";", + "comment": "" + }, + "SECT4": { + "type": "\"UDT SIPA SV Section\";", + "comment": "" + }, + "SECT5": { + "type": "\"UDT SIPA SV Section\";", + "comment": "" + } + } + } +} \ No newline at end of file diff --git a/udt_definitions.json b/udt_definitions.json new file mode 100644 index 0000000..27c3c5c --- /dev/null +++ b/udt_definitions.json @@ -0,0 +1,194 @@ +{ + "UDT SIPA SV Main": { + "root": { + "N1": { + "type": "DInt;", + "comment": ".DB_IOT.USERLEVEL" + }, + "N2": { + "type": "String[81];", + "comment": ".DB_IOT.USERNAME" + }, + "N3": { + "type": "String[81];", + "comment": ".DB_IOT.NOME_RICETTA" + }, + "N4": { + "type": "Int;", + "comment": ".DB_IOT.NEXT_MAINT_CYCLES" + }, + "N5": { + "V1": { + "type": "String[254];", + "comment": "" + }, + "V2": { + "type": "String[254];", + "comment": "" + }, + "V3": { + "type": "String[254];", + "comment": "" + }, + "V4": { + "type": "String[254];", + "comment": "" + }, + "V5": { + "type": "String[8];", + "comment": "" + } + }, + "N6": { + "type": "Array[1..3] of Real;", + "comment": ".DB_IOT.ELECTRIC_VOLTAGE_PHASE_D" + }, + "N7": { + "type": "Array[1..3] of Real;", + "comment": ".DB_IOT.ELECTRIC_CURRENT_PHASE_D" + }, + "N8": { + "type": "Real;", + "comment": ".DB_IOT.ELECTRIC_POWER_D" + }, + "N9": { + "type": "Real;", + "comment": ".DB_IOT.ELECTRIC_POWER_FACTOR_D" + }, + "N10": { + "type": "Real;", + "comment": ".DB_IOT.ELECTRIC_POWER_HOUR_D" + }, + "N11": { + "type": "Real;", + "comment": ".DB_IOT.ELECTRIC_POWER_WH" + } + } + }, + "UDT SIPA SV Section": { + "root": { + "N1": { + "type": "DInt;", + "comment": ".DB_IOT.STATO_MACCHINA" + }, + "N2": { + "type": "DInt;", + "comment": ".DB_IOT.ALLARME_FERMO" + }, + "N3": { + "type": "DInt;", + "comment": ".DB_IOT.WARNING_ATTIVO (che compromette produzione)" + }, + "N4": { + "type": "Int;", + "comment": ".DB_IOT.STATO_OPERATIVO (Semaforo)" + }, + "N5": { + "type": "Int;", + "comment": ".DB_IOT.MODO_OPERATIVO (Prod,Simula,Man, ecc)" + }, + "N6": { + "type": "DInt;", + "comment": ".DB_IOT.ALARM_STOP_NO" + }, + "N7": { + "V1": { + "type": "DInt;", + "comment": "PIECES_TOT" + }, + "V2": { + "type": "DInt;", + "comment": "PIECES_OK" + }, + "V3": { + "type": "DInt;", + "comment": "PIECES_KO_1" + }, + "V4": { + "type": "DInt;", + "comment": "PIECES_KO_2" + }, + "V5": { + "type": "DInt;", + "comment": "PIECES_KO_3" + }, + "V6": { + "type": "DInt;", + "comment": "PIECES_KO_4" + }, + "V7": { + "type": "DInt;", + "comment": "PIECES_KO_5" + }, + "V8": { + "type": "DInt;", + "comment": "PIECES_KO_6" + }, + "V9": { + "type": "DInt;", + "comment": "PIECES_KO_7" + }, + "V10": { + "type": "DInt;", + "comment": "PIECES_KO_8" + }, + "V11": { + "type": "DInt;", + "comment": "PIECES_KO_9" + }, + "V12": { + "type": "DInt;", + "comment": "PIECES_KO_10" + }, + "V13": { + "type": "DInt;", + "comment": "T_ALARM_HOURS" + }, + "V14": { + "type": "DInt;", + "comment": "T_DRY_CYCLE_HOURS" + }, + "V15": { + "type": "DInt;", + "comment": "T_POWERED_HOURS" + }, + "V16": { + "type": "DInt;", + "comment": "T_PRODUCT_100_HOURS" + }, + "V17": { + "type": "DInt;", + "comment": "T_PRODUCT_0_HOURS" + }, + "V18": { + "type": "DInt;", + "comment": "T_STOP_HOURS" + }, + "V19": { + "type": "Int;", + "comment": "T_ALARM_MINUTES" + }, + "V20": { + "type": "Int;", + "comment": "T_DRY_CYCLE_MINUTES" + }, + "V21": { + "type": "Int;", + "comment": "T_POWERED_MINUTES" + }, + "V22": { + "type": "Int;", + "comment": "T_PRODUCT_100_MINUTES" + }, + "V23": { + "type": "Int;", + "comment": "T_PRODUCT_0_MINUTES" + }, + "V24": { + "type": "Int;", + "comment": "T_STOP_MINUTES" + } + } + } + } +} \ No newline at end of file