Update placing DPMS and applying tags
This commit is contained in:
parent
452894ecd5
commit
48b4d84e42
@ -1,156 +0,0 @@
|
|||||||
UL13_8_DPM1
|
|
||||||
UL13_1_VFD1 11.200.1.30
|
|
||||||
UL13_2_VFD1 11.200.1.31
|
|
||||||
UL13_3_VFD1 11.200.1.32
|
|
||||||
UL13_4_VFD1 11.200.1.33
|
|
||||||
UL13_5_VFD1 11.200.1.34
|
|
||||||
UL13_6_VFD1 11.200.1.35
|
|
||||||
UL13_7_VFD1 11.200.1.36
|
|
||||||
UL13_8A_VFD1 11.200.1.37
|
|
||||||
UL13_8B_VFD1 11.200.1.38
|
|
||||||
UL13_9_VFD1 11.200.1.39
|
|
||||||
UL13_10_VFD1 11.200.1.40
|
|
||||||
UL13_11_VFD1 11.200.1.41
|
|
||||||
UL14_1_EX1 11.200.1.42
|
|
||||||
UL14_3_VFD1 11.200.1.43
|
|
||||||
UL14_4_VFD1 11.200.1.44
|
|
||||||
UL14_5_VFD1 11.200.1.45
|
|
||||||
UL14_6_VFD1 11.200.1.46
|
|
||||||
UL14_7_VFD1 11.200.1.47
|
|
||||||
UL14_8_VFD1 11.200.1.48
|
|
||||||
UL14_9_VFD1 11.200.1.49
|
|
||||||
UL14_10_VFD1 11.200.1.50
|
|
||||||
UL13_1_FIO1 11.200.1.51
|
|
||||||
UL14_1_FIO1 11.200.1.52
|
|
||||||
UL15_4_DPM1
|
|
||||||
UL15_1_EX1 11.200.1.53
|
|
||||||
UL15_3_VFD1 11.200.1.54
|
|
||||||
UL15_4_VFD1 11.200.1.55
|
|
||||||
UL15_5_VFD1 11.200.1.56
|
|
||||||
UL15_6_VFD1 11.200.1.57
|
|
||||||
UL15_7_VFD1 11.200.1.58
|
|
||||||
UL15_8_VFD1 11.200.1.59
|
|
||||||
UL15_9_VFD1 11.200.1.60
|
|
||||||
UL15_10_VFD1 11.200.1.61
|
|
||||||
UL15_11_VFD1 11.200.1.62
|
|
||||||
UL15_1_FIO1 11.200.1.63
|
|
||||||
UL16_2_DPM1
|
|
||||||
UL16_1_VFD1 11.200.1.64
|
|
||||||
UL16_2_VFD1 11.200.1.65
|
|
||||||
UL16_4_VFD1 11.200.1.66
|
|
||||||
UL16_5_VFD1 11.200.1.67
|
|
||||||
UL16_6_VFD1 11.200.1.68
|
|
||||||
UL16_7_VFD1 11.200.1.69
|
|
||||||
UL16_8_VFD1 11.200.1.70
|
|
||||||
UL16_9_VFD1 11.200.1.71
|
|
||||||
UL17_1_EX1 11.200.1.72
|
|
||||||
UL17_3_VFD1 11.200.1.73
|
|
||||||
UL17_4_VFD1 11.200.1.74
|
|
||||||
UL17_5_VFD1 11.200.1.75
|
|
||||||
UL17_6_VFD1 11.200.1.76
|
|
||||||
UL17_7_VFD1 11.200.1.77
|
|
||||||
UL17_8_VFD1 11.200.1.78
|
|
||||||
UL17_9_VFD1 11.200.1.79
|
|
||||||
UL17_10_VFD1 11.200.1.80
|
|
||||||
UL16_1_FIO1 11.200.1.81
|
|
||||||
UL17_1_FIO1 11.200.1.82
|
|
||||||
UL18_4_DPM1
|
|
||||||
UL18_1_EX1 11.200.1.83
|
|
||||||
UL18_3_VFD1 11.200.1.84
|
|
||||||
UL18_4_VFD1 11.200.1.85
|
|
||||||
UL18_5_VFD1 11.200.1.86
|
|
||||||
UL18_6_VFD1 11.200.1.87
|
|
||||||
UL18_7_VFD1 11.200.1.88
|
|
||||||
UL18_8_VFD1 11.200.1.89
|
|
||||||
UL18_9_VFD1 11.200.1.90
|
|
||||||
UL18_10_VFD1 11.200.1.91
|
|
||||||
UL18_11_VFD1 11.200.1.92
|
|
||||||
UL18_12_VFD1 11.200.1.93
|
|
||||||
UL18_13A_VFD1 11.200.1.94
|
|
||||||
UL18_13B_VFD1 11.200.1.95
|
|
||||||
UL18_14_VFD1 11.200.1.96
|
|
||||||
UL18_15_VFD1 11.200.1.97
|
|
||||||
UL18_16_VFD1 11.200.1.98
|
|
||||||
UL18_1_FIO1 11.200.1.99
|
|
||||||
UL19_2_DPM1
|
|
||||||
UL19_1_VFD1 11.200.1.100
|
|
||||||
UL19_2_VFD1 11.200.1.101
|
|
||||||
UL19_3_VFD1 11.200.1.102
|
|
||||||
UL19_4_VFD1 11.200.1.103
|
|
||||||
UL19_5_VFD1 11.200.1.104
|
|
||||||
UL19_6_VFD1 11.200.1.105
|
|
||||||
UL19_7_VFD1 11.200.1.106
|
|
||||||
UL19_8_VFD1 11.200.1.107
|
|
||||||
UL19_9_VFD1 11.200.1.108
|
|
||||||
UL20_1_EX1 11.200.1.109
|
|
||||||
UL20_3_VFD1 11.200.1.110
|
|
||||||
UL20_4_VFD1 11.200.1.111
|
|
||||||
UL20_5_VFD1 11.200.1.112
|
|
||||||
UL20_6_VFD1 11.200.1.113
|
|
||||||
UL20_7_VFD1 11.200.1.114
|
|
||||||
UL20_8_VFD1 11.200.1.115
|
|
||||||
UL20_9_VFD1 11.200.1.116
|
|
||||||
UL19_1_FIO1 11.200.1.117
|
|
||||||
UL20_1_FIO1 11.200.1.118
|
|
||||||
UL21_11_DPM1
|
|
||||||
UL21_1_EX1 11.200.1.119
|
|
||||||
UL21_3_VFD1 11.200.1.120
|
|
||||||
UL21_4_VFD1 11.200.1.121
|
|
||||||
UL21_5_VFD1 11.200.1.122
|
|
||||||
UL21_6_VFD1 11.200.1.123
|
|
||||||
UL21_7_VFD1 11.200.1.124
|
|
||||||
UL21_8_VFD1 11.200.1.125
|
|
||||||
UL21_9_VFD1 11.200.1.126
|
|
||||||
UL21_10_VFD1 11.200.1.127
|
|
||||||
UL21_11_VFD1 11.200.1.128
|
|
||||||
UL21_12_VFD1 11.200.1.129
|
|
||||||
UL21_13_VFD1 11.200.1.130
|
|
||||||
UL21_14A_VFD1 11.200.1.131
|
|
||||||
UL21_14B_VFD1 11.200.1.132
|
|
||||||
UL21_15_VFD1 11.200.1.133
|
|
||||||
UL21_16_VFD1 11.200.1.134
|
|
||||||
UL21_17_VFD1 11.200.1.135
|
|
||||||
UL21_1_FIO1 11.200.1.136
|
|
||||||
PS5_7_DPM1
|
|
||||||
PS5_1_VFD1 11.200.1.137
|
|
||||||
PS5_2_VFD1 11.200.1.138
|
|
||||||
PS5_3_VFD1 11.200.1.139
|
|
||||||
PS5_4_VFD1 11.200.1.140
|
|
||||||
PS5_5_VFD1 11.200.1.141
|
|
||||||
PS5_6_VFD1 11.200.1.142
|
|
||||||
PS5_7_VFD1 11.200.1.143
|
|
||||||
PS5_8_VFD1 11.200.1.144
|
|
||||||
PS5_9_VFD1 11.200.1.145
|
|
||||||
PS5_10_VFD1 11.200.1.146
|
|
||||||
PS5_11_VFD1 11.200.1.147
|
|
||||||
PS5_12_VFD1 11.200.1.148
|
|
||||||
PS5_13_VFD1 11.200.1.149
|
|
||||||
PS6_7_DPM1
|
|
||||||
PS6_1_VFD1 11.200.1.150
|
|
||||||
PS6_2_VFD1 11.200.1.151
|
|
||||||
PS6_3_VFD1 11.200.1.152
|
|
||||||
PS6_4_VFD1 11.200.1.153
|
|
||||||
PS6_5_VFD1 11.200.1.154
|
|
||||||
PS6_6_VFD1 11.200.1.155
|
|
||||||
PS6_7_VFD1 11.200.1.156
|
|
||||||
PS6_8_VFD1 11.200.1.157
|
|
||||||
PS6_9_VFD1 11.200.1.158
|
|
||||||
PS6_10_VFD1 11.200.1.159
|
|
||||||
PS6_11_VFD1 11.200.1.160
|
|
||||||
PS6_12_VFD1 11.200.1.161
|
|
||||||
PS6_13_VFD1 11.200.1.162
|
|
||||||
PS7_7_DPM1
|
|
||||||
PS7_1_VFD1 11.200.1.163
|
|
||||||
PS7_2_VFD1 11.200.1.164
|
|
||||||
PS7_3_VFD1 11.200.1.165
|
|
||||||
PS7_4_VFD1 11.200.1.166
|
|
||||||
PS7_5_VFD1 11.200.1.167
|
|
||||||
PS7_6_VFD1 11.200.1.168
|
|
||||||
PS7_7_VFD1 11.200.1.169
|
|
||||||
PS7_8_VFD1 11.200.1.170
|
|
||||||
PS7_9_VFD1 11.200.1.171
|
|
||||||
PS7_10_VFD1 11.200.1.172
|
|
||||||
PS7_11_VFD1 11.200.1.173
|
|
||||||
PS7_12_VFD1 11.200.1.174
|
|
||||||
PS7_13_VFD1 11.200.1.175
|
|
||||||
PS7_14_VFD1 11.200.1.176
|
|
||||||
186
PLACE DPMS/MCM01_COMPLETE_EXAMPLE.csv
Normal file
186
PLACE DPMS/MCM01_COMPLETE_EXAMPLE.csv
Normal file
@ -0,0 +1,186 @@
|
|||||||
|
DPM,DPM_IP,Name,PartNumber,IP
|
||||||
|
UL1_4_DPM1,11.200.1.2,UL1_1_EX1,FMH,11.200.1.30
|
||||||
|
UL1_4_DPM1,11.200.1.2,UL1_3_VFD1,35S-6D4-P111,11.200.1.31
|
||||||
|
UL1_4_DPM1,11.200.1.2,UL1_4_VFD1,35S-6D4-P111,11.200.1.32
|
||||||
|
UL1_4_DPM1,11.200.1.2,UL1_5_VFD1,35S-6D3-P101,11.200.1.33
|
||||||
|
UL1_4_DPM1,11.200.1.2,UL1_6_VFD1,35S-6D3-P101,11.200.1.34
|
||||||
|
UL1_4_DPM1,11.200.1.2,UL1_7_VFD1,35S-6D3-P101,11.200.1.35
|
||||||
|
UL1_4_DPM1,11.200.1.2,UL1_8_VFD1,35S-6D3-P101,11.200.1.36
|
||||||
|
UL1_4_DPM1,11.200.1.2,UL1_9_VFD1,35S-6D4-P111,11.200.1.37
|
||||||
|
UL1_4_DPM1,11.200.1.2,UL1_10A_VFD1,35S-6D3-P101,11.200.1.38
|
||||||
|
UL1_4_DPM1,11.200.1.2,UL1_10B_VFD1,35S-6D3-P101,11.200.1.39
|
||||||
|
UL1_4_DPM1,11.200.1.2,UL1_11_VFD1,35S-6D2-P101,11.200.1.40
|
||||||
|
UL1_4_DPM1,11.200.1.2,UL1_12_VFD1,35S-6D2-P101,11.200.1.41
|
||||||
|
UL1_4_DPM1,11.200.1.2,UL1_13_VFD1,35S-6D4-P111,11.200.1.42
|
||||||
|
UL1_4_DPM1,11.200.1.2,UL1_3_FIO1,5032-8IOLM12DR,11.200.1.43
|
||||||
|
UL1_4_DPM1,11.200.1.2,UL1_13_FIO1,5032-8IOLM12DR,11.200.1.216
|
||||||
|
UL2_4_DPM1,11.200.1.3,UL2_1_EX1,FMH,11.200.1.44
|
||||||
|
UL2_4_DPM1,11.200.1.3,UL2_3_VFD1,35S-6D4-P111,11.200.1.45
|
||||||
|
UL2_4_DPM1,11.200.1.3,UL2_4_VFD1,35S-6D4-P111,11.200.1.46
|
||||||
|
UL2_4_DPM1,11.200.1.3,UL2_5_VFD1,35S-6D2-P101,11.200.1.47
|
||||||
|
UL2_4_DPM1,11.200.1.3,UL2_6_VFD1,35S-6D3-P101,11.200.1.48
|
||||||
|
UL2_4_DPM1,11.200.1.3,UL2_7_VFD1,35S-6D3-P101,11.200.1.49
|
||||||
|
UL2_4_DPM1,11.200.1.3,UL2_8_VFD1,35S-6D3-P101,11.200.1.50
|
||||||
|
UL2_4_DPM1,11.200.1.3,UL2_9_VFD1,35S-6D3-P101,11.200.1.51
|
||||||
|
UL2_4_DPM1,11.200.1.3,UL2_10_VFD1,35S-6D2-P101,11.200.1.52
|
||||||
|
UL2_4_DPM1,11.200.1.3,UL3_1_VFD1,35S-6D2-P101,11.200.1.53
|
||||||
|
UL2_4_DPM1,11.200.1.3,UL3_2_VFD1,35S-6D5-P111,11.200.1.54
|
||||||
|
UL2_4_DPM1,11.200.1.3,UL3_3_VFD1,35S-6D2-P101,11.200.1.55
|
||||||
|
UL2_4_DPM1,11.200.1.3,UL3_4_VFD1,35S-6D2-P101,11.200.1.56
|
||||||
|
UL2_4_DPM1,11.200.1.3,UL3_5_VFD1,35S-6D3-P101,11.200.1.57
|
||||||
|
UL2_4_DPM1,11.200.1.3,UL3_6_VFD1,35S-6D3-P101,11.200.1.58
|
||||||
|
UL2_4_DPM1,11.200.1.3,UL3_7_VFD1,35S-6D3-P101,11.200.1.59
|
||||||
|
UL2_4_DPM1,11.200.1.3,UL3_8_VFD1,35S-6D3-P101,11.200.1.60
|
||||||
|
UL2_4_DPM1,11.200.1.3,UL3_9_VFD1,35S-6D2-P101,11.200.1.61
|
||||||
|
UL2_4_DPM1,11.200.1.3,UL2_3_FIO1,5032-8IOLM12DR,11.200.1.62
|
||||||
|
UL2_4_DPM1,11.200.1.3,UL3_2_FIO1,5032-8IOLM12DR,11.200.1.63
|
||||||
|
UL4_4_DPM1,11.200.1.4,UL4_1_EX1,FMH,11.200.1.64
|
||||||
|
UL4_4_DPM1,11.200.1.4,UL4_3_VFD1,35S-6D4-P111,11.200.1.65
|
||||||
|
UL4_4_DPM1,11.200.1.4,UL4_4_VFD1,35S-6D4-P111,11.200.1.66
|
||||||
|
UL4_4_DPM1,11.200.1.4,UL4_5_VFD1,35S-6D3-P101,11.200.1.67
|
||||||
|
UL4_4_DPM1,11.200.1.4,UL4_6_VFD1,35S-6D3-P101,11.200.1.68
|
||||||
|
UL4_4_DPM1,11.200.1.4,UL4_7_VFD1,35S-6D3-P101,11.200.1.69
|
||||||
|
UL4_4_DPM1,11.200.1.4,UL4_8_VFD1,35S-6D3-P101,11.200.1.70
|
||||||
|
UL4_4_DPM1,11.200.1.4,UL4_9_VFD1,35S-6D4-P111,11.200.1.71
|
||||||
|
UL4_4_DPM1,11.200.1.4,UL4_10A_VFD1,35S-6D3-P101,11.200.1.72
|
||||||
|
UL4_4_DPM1,11.200.1.4,UL4_10B_VFD1,35S-6D3-P101,11.200.1.73
|
||||||
|
UL4_4_DPM1,11.200.1.4,UL4_11_VFD1,35S-6D2-P101,11.200.1.74
|
||||||
|
UL4_4_DPM1,11.200.1.4,UL4_12_VFD1,35S-6D2-P101,11.200.1.75
|
||||||
|
UL4_4_DPM1,11.200.1.4,UL4_13_VFD1,35S-6D4-P111,11.200.1.76
|
||||||
|
UL4_4_DPM1,11.200.1.4,UL4_3_FIO1,5032-8IOLM12DR,11.200.1.77
|
||||||
|
UL4_4_DPM1,11.200.1.4,UL4_13_FIO1,5032-8IOLM12DR,11.200.1.217
|
||||||
|
UL5_4_DPM1,11.200.1.5,UL5_1_EX1,FMH,11.200.1.78
|
||||||
|
UL5_4_DPM1,11.200.1.5,UL5_3_VFD1,35S-6D4-P111,11.200.1.79
|
||||||
|
UL5_4_DPM1,11.200.1.5,UL5_4_VFD1,35S-6D4-P111,11.200.1.80
|
||||||
|
UL5_4_DPM1,11.200.1.5,UL5_5_VFD1,35S-6D2-P101,11.200.1.81
|
||||||
|
UL5_4_DPM1,11.200.1.5,UL5_6_VFD1,35S-6D3-P101,11.200.1.82
|
||||||
|
UL5_4_DPM1,11.200.1.5,UL5_7_VFD1,35S-6D3-P101,11.200.1.83
|
||||||
|
UL5_4_DPM1,11.200.1.5,UL5_8_VFD1,35S-6D3-P101,11.200.1.84
|
||||||
|
UL5_4_DPM1,11.200.1.5,UL5_9_VFD1,35S-6D3-P101,11.200.1.85
|
||||||
|
UL5_4_DPM1,11.200.1.5,UL5_10_VFD1,35S-6D2-P101,11.200.1.86
|
||||||
|
UL5_4_DPM1,11.200.1.5,UL6_1_VFD1,35S-6D2-P101,11.200.1.87
|
||||||
|
UL5_4_DPM1,11.200.1.5,UL6_2_VFD1,35S-6D5-P111,11.200.1.88
|
||||||
|
UL5_4_DPM1,11.200.1.5,UL6_3_VFD1,35S-6D2-P101,11.200.1.89
|
||||||
|
UL5_4_DPM1,11.200.1.5,UL6_4_VFD1,35S-6D2-P101,11.200.1.90
|
||||||
|
UL5_4_DPM1,11.200.1.5,UL6_5_VFD1,35S-6D3-P101,11.200.1.91
|
||||||
|
UL5_4_DPM1,11.200.1.5,UL6_6_VFD1,35S-6D3-P101,11.200.1.92
|
||||||
|
UL5_4_DPM1,11.200.1.5,UL6_7_VFD1,35S-6D3-P101,11.200.1.93
|
||||||
|
UL5_4_DPM1,11.200.1.5,UL6_8_VFD1,35S-6D3-P101,11.200.1.94
|
||||||
|
UL5_4_DPM1,11.200.1.5,UL6_9_VFD1,35S-6D2-P101,11.200.1.95
|
||||||
|
UL5_4_DPM1,11.200.1.5,UL5_3_FIO1,5032-8IOLM12DR,11.200.1.96
|
||||||
|
UL5_4_DPM1,11.200.1.5,UL6_2_FIO1,5032-8IOLM12DR,11.200.1.97
|
||||||
|
UL7_4_DPM1,11.200.1.6,UL7_1_EX1,FMH,11.200.1.98
|
||||||
|
UL7_4_DPM1,11.200.1.6,UL7_3_VFD1,35S-6D4-P111,11.200.1.99
|
||||||
|
UL7_4_DPM1,11.200.1.6,UL7_4_VFD1,35S-6D4-P111,11.200.1.100
|
||||||
|
UL7_4_DPM1,11.200.1.6,UL7_5_VFD1,35S-6D3-P101,11.200.1.101
|
||||||
|
UL7_4_DPM1,11.200.1.6,UL7_6_VFD1,35S-6D3-P101,11.200.1.102
|
||||||
|
UL7_4_DPM1,11.200.1.6,UL7_7_VFD1,35S-6D3-P101,11.200.1.103
|
||||||
|
UL7_4_DPM1,11.200.1.6,UL7_8_VFD1,35S-6D3-P101,11.200.1.104
|
||||||
|
UL7_4_DPM1,11.200.1.6,UL7_9_VFD1,35S-6D4-P111,11.200.1.105
|
||||||
|
UL7_4_DPM1,11.200.1.6,UL7_10A_VFD1,35S-6D3-P101,11.200.1.106
|
||||||
|
UL7_4_DPM1,11.200.1.6,UL7_10B_VFD1,35S-6D3-P101,11.200.1.107
|
||||||
|
UL7_4_DPM1,11.200.1.6,UL7_11_VFD1,35S-6D2-P101,11.200.1.108
|
||||||
|
UL7_4_DPM1,11.200.1.6,UL7_12_VFD1,35S-6D2-P101,11.200.1.109
|
||||||
|
UL7_4_DPM1,11.200.1.6,UL7_13_VFD1,35S-6D4-P111,11.200.1.110
|
||||||
|
UL7_4_DPM1,11.200.1.6,UL7_3_FIO1,5032-8IOLM12DR,11.200.1.111
|
||||||
|
UL7_4_DPM1,11.200.1.6,PDP1_FIO1,5032-8IOLM12DR,11.200.1.210
|
||||||
|
UL7_4_DPM1,11.200.1.6,PDP1_PMM1,1420-V2-ENT,11.200.1.211
|
||||||
|
UL7_4_DPM1,11.200.1.6,PDP2_FIO1,5032-8IOLM12DR,11.200.1.212
|
||||||
|
UL7_4_DPM1,11.200.1.6,PDP2_PMM1,1420-V2-ENT,11.200.1.213
|
||||||
|
UL7_4_DPM1,11.200.1.6,UL7_13_FIO1,5032-8IOLM12DR,11.200.1.218
|
||||||
|
UL8_3_DPM1,11.200.1.7,UL8_1_VFD1,35S-6D2-P101,11.200.1.112
|
||||||
|
UL8_3_DPM1,11.200.1.7,UL8_2_VFD1,35S-6D5-P111,11.200.1.113
|
||||||
|
UL8_3_DPM1,11.200.1.7,UL8_3_VFD1,35S-6D2-P101,11.200.1.114
|
||||||
|
UL8_3_DPM1,11.200.1.7,UL8_4_VFD1,35S-6D2-P101,11.200.1.115
|
||||||
|
UL8_3_DPM1,11.200.1.7,UL8_5_VFD1,35S-6D3-P101,11.200.1.116
|
||||||
|
UL8_3_DPM1,11.200.1.7,UL8_6_VFD1,35S-6D3-P101,11.200.1.117
|
||||||
|
UL8_3_DPM1,11.200.1.7,UL8_7_VFD1,35S-6D3-P101,11.200.1.118
|
||||||
|
UL8_3_DPM1,11.200.1.7,UL8_8_VFD1,35S-6D3-P101,11.200.1.119
|
||||||
|
UL8_3_DPM1,11.200.1.7,UL8_9_VFD1,35S-6D2-P101,11.200.1.120
|
||||||
|
UL8_3_DPM1,11.200.1.7,UL9_1_EX1,FMH,11.200.1.121
|
||||||
|
UL8_3_DPM1,11.200.1.7,UL9_3_VFD1,35S-6D4-P111,11.200.1.122
|
||||||
|
UL8_3_DPM1,11.200.1.7,UL9_4_VFD1,35S-6D4-P111,11.200.1.123
|
||||||
|
UL8_3_DPM1,11.200.1.7,UL9_5_VFD1,35S-6D2-P101,11.200.1.124
|
||||||
|
UL8_3_DPM1,11.200.1.7,UL9_6_VFD1,35S-6D3-P101,11.200.1.125
|
||||||
|
UL8_3_DPM1,11.200.1.7,UL9_7_VFD1,35S-6D3-P101,11.200.1.126
|
||||||
|
UL8_3_DPM1,11.200.1.7,UL9_8_VFD1,35S-6D3-P101,11.200.1.127
|
||||||
|
UL8_3_DPM1,11.200.1.7,UL9_9_VFD1,35S-6D3-P101,11.200.1.128
|
||||||
|
UL8_3_DPM1,11.200.1.7,UL9_10_VFD1,35S-6D3-P101,11.200.1.129
|
||||||
|
UL8_3_DPM1,11.200.1.7,UL9_11_VFD1,35S-6D2-P101,11.200.1.130
|
||||||
|
UL8_3_DPM1,11.200.1.7,UL8_2_FIO1,5032-8IOLM12DR,11.200.1.131
|
||||||
|
UL8_3_DPM1,11.200.1.7,UL9_3_FIO1,5032-8IOLM12DR,11.200.1.132
|
||||||
|
UL10_3_DPM1,11.200.1.8,UL10_1_VFD1,35S-6D2-P101,11.200.1.133
|
||||||
|
UL10_3_DPM1,11.200.1.8,UL10_2_VFD1,35S-6D5-P111,11.200.1.134
|
||||||
|
UL10_3_DPM1,11.200.1.8,UL10_3_VFD1,35S-6D2-P101,11.200.1.135
|
||||||
|
UL10_3_DPM1,11.200.1.8,UL10_4_VFD1,35S-6D3-P101,11.200.1.136
|
||||||
|
UL10_3_DPM1,11.200.1.8,UL10_5_VFD1,35S-6D3-P101,11.200.1.137
|
||||||
|
UL10_3_DPM1,11.200.1.8,UL10_6_VFD1,35S-6D3-P101,11.200.1.138
|
||||||
|
UL10_3_DPM1,11.200.1.8,UL10_7_VFD1,35S-6D3-P101,11.200.1.139
|
||||||
|
UL10_3_DPM1,11.200.1.8,UL10_8_VFD1,35S-6D3-P101,11.200.1.140
|
||||||
|
UL10_3_DPM1,11.200.1.8,UL10_9_VFD1,35S-6D3-P101,11.200.1.141
|
||||||
|
UL10_3_DPM1,11.200.1.8,UL10_10_VFD1,35S-6D2-P101,11.200.1.142
|
||||||
|
UL10_3_DPM1,11.200.1.8,UL10_2_FIO1,5032-8IOLM12DR,11.200.1.143
|
||||||
|
UL10_3_DPM1,11.200.1.8,UL12_1_EX1,FMH,11.200.1.159
|
||||||
|
UL10_3_DPM1,11.200.1.8,UL12_3_VFD1,35S-6D4-P111,11.200.1.160
|
||||||
|
UL10_3_DPM1,11.200.1.8,UL12_4_VFD1,35S-6D4-P111,11.200.1.161
|
||||||
|
UL10_3_DPM1,11.200.1.8,UL12_5_VFD1,35S-6D2-P101,11.200.1.162
|
||||||
|
UL10_3_DPM1,11.200.1.8,UL12_6_VFD1,35S-6D3-P101,11.200.1.163
|
||||||
|
UL10_3_DPM1,11.200.1.8,UL12_7_VFD1,35S-6D3-P101,11.200.1.164
|
||||||
|
UL10_3_DPM1,11.200.1.8,UL12_8_VFD1,35S-6D3-P101,11.200.1.165
|
||||||
|
UL10_3_DPM1,11.200.1.8,UL12_9_VFD1,35S-6D3-P101,11.200.1.166
|
||||||
|
UL10_3_DPM1,11.200.1.8,UL12_10_VFD1,35S-6D2-P101,11.200.1.167
|
||||||
|
UL10_3_DPM1,11.200.1.8,UL12_3_FIO1,5032-8IOLM12DR,11.200.1.168
|
||||||
|
UL11_10_DPM1,11.200.1.9,UL11_1_EX1,CALJAN,11.200.1.144
|
||||||
|
UL11_10_DPM1,11.200.1.9,UL11_3_VFD1,35S-6D4-P111,11.200.1.145
|
||||||
|
UL11_10_DPM1,11.200.1.9,UL11_4_VFD1,35S-6D4-P111,11.200.1.146
|
||||||
|
UL11_10_DPM1,11.200.1.9,UL11_5_VFD1,35S-6D3-P101,11.200.1.147
|
||||||
|
UL11_10_DPM1,11.200.1.9,UL11_6_VFD1,35S-6D3-P101,11.200.1.148
|
||||||
|
UL11_10_DPM1,11.200.1.9,UL11_7_VFD1,35S-6D3-P101,11.200.1.149
|
||||||
|
UL11_10_DPM1,11.200.1.9,UL11_8_VFD1,35S-6D3-P101,11.200.1.150
|
||||||
|
UL11_10_DPM1,11.200.1.9,UL11_9_VFD1,35S-6D4-P111,11.200.1.151
|
||||||
|
UL11_10_DPM1,11.200.1.9,UL11_10A_VFD1,35S-6D3-P101,11.200.1.152
|
||||||
|
UL11_10_DPM1,11.200.1.9,UL11_10B_VFD1,35S-6D3-P101,11.200.1.153
|
||||||
|
UL11_10_DPM1,11.200.1.9,UL11_11_VFD1,35S-6D2-P101,11.200.1.154
|
||||||
|
UL11_10_DPM1,11.200.1.9,UL11_12_VFD1,35S-6D2-P101,11.200.1.155
|
||||||
|
UL11_10_DPM1,11.200.1.9,UL11_13_VFD1,35S-6D4-P111,11.200.1.156
|
||||||
|
UL11_10_DPM1,11.200.1.9,UL11_3_FIO1,5032-8IOLM12DR,11.200.1.158
|
||||||
|
UL11_10_DPM1,11.200.1.9,UL11_13_FIO1,5032-8IOLM12DR,11.200.1.219
|
||||||
|
PS1_4_DPM1,11.200.1.10,PS1_1_VFD1,35S-6D2-P101,11.200.1.169
|
||||||
|
PS1_4_DPM1,11.200.1.10,PS1_2_VFD1,35S-6D2-P101,11.200.1.170
|
||||||
|
PS1_4_DPM1,11.200.1.10,PS1_3_VFD1,35S-6D2-P101,11.200.1.171
|
||||||
|
PS1_4_DPM1,11.200.1.10,PS1_4_VFD1,35S-6D5-P111,11.200.1.172
|
||||||
|
PS1_4_DPM1,11.200.1.10,PS1_5_VFD1,35S-6D4-P111,11.200.1.173
|
||||||
|
PS1_4_DPM1,11.200.1.10,PS2_1_VFD1,35S-6D2-P101,11.200.1.174
|
||||||
|
PS1_4_DPM1,11.200.1.10,PS2_2_VFD1,35S-6D3-P101,11.200.1.175
|
||||||
|
PS1_4_DPM1,11.200.1.10,PS2_3_VFD1,35S-6D4-P111,11.200.1.176
|
||||||
|
PS1_4_DPM1,11.200.1.10,PS2_4_VFD1,35S-6D2-P101,11.200.1.177
|
||||||
|
PS1_4_DPM1,11.200.1.10,PS2_5_VFD1,35S-6D5-P111,11.200.1.178
|
||||||
|
PS1_4_DPM1,11.200.1.10,PS2_6_VFD1,35S-6D3-P101,11.200.1.179
|
||||||
|
PS1_4_DPM1,11.200.1.10,PDP6_FIO1,5032-8IOLM12DR,11.200.1.214
|
||||||
|
PS1_4_DPM1,11.200.1.10,PDP6_PMM1,1420-V2-ENT,11.200.1.215
|
||||||
|
PS3_3_DPM1,11.200.1.11,PS3_1_VFD1,35S-6D2-P101,11.200.1.180
|
||||||
|
PS3_3_DPM1,11.200.1.11,PS3_2_VFD1,35S-6D3-P101,11.200.1.181
|
||||||
|
PS3_3_DPM1,11.200.1.11,PS3_3_VFD1,35S-6D3-P101,11.200.1.182
|
||||||
|
PS3_3_DPM1,11.200.1.11,PS3_4_VFD1,35S-6D2-P101,11.200.1.183
|
||||||
|
PS3_3_DPM1,11.200.1.11,PS3_5_VFD1,35S-6D4-P111,11.200.1.184
|
||||||
|
PS3_3_DPM1,11.200.1.11,PS3_6_VFD1,35S-6D4-P111,11.200.1.185
|
||||||
|
PS3_3_DPM1,11.200.1.11,PS3_7_VFD1,35S-6D6-P111,11.200.1.186
|
||||||
|
PS3_3_DPM1,11.200.1.11,PS3_8_VFD1,35S-6D3-P101,11.200.1.187
|
||||||
|
PS3_3_DPM1,11.200.1.11,PS3_9_VFD1,35S-6D4-P111,11.200.1.188
|
||||||
|
PS3_3_DPM1,11.200.1.11,PS3_10_VFD1,35S-6D4-P111,11.200.1.189
|
||||||
|
PS3_3_DPM1,11.200.1.11,PS3_11_VFD1,35S-6D3-P101,11.200.1.190
|
||||||
|
PS3_3_DPM1,11.200.1.11,PS3_12_VFD1,35S-6D3-P101,11.200.1.191
|
||||||
|
PS4_7_DPM1,11.200.1.12,PS4_1_VFD1,35S-6D2-P101,11.200.1.192
|
||||||
|
PS4_7_DPM1,11.200.1.12,PS4_2_VFD1,35S-6D3-P101,11.200.1.193
|
||||||
|
PS4_7_DPM1,11.200.1.12,PS4_3_VFD1,35S-6D2-P101,11.200.1.194
|
||||||
|
PS4_7_DPM1,11.200.1.12,PS4_4_VFD1,35S-6D3-P101,11.200.1.195
|
||||||
|
PS4_7_DPM1,11.200.1.12,PS4_5_VFD1,35S-6D4-P111,11.200.1.196
|
||||||
|
PS4_7_DPM1,11.200.1.12,PS4_6_VFD1,35S-6D5-P111,11.200.1.197
|
||||||
|
PS4_7_DPM1,11.200.1.12,PS4_7_VFD1,35S-6D5-P111,11.200.1.198
|
||||||
|
PS4_7_DPM1,11.200.1.12,PS4_8_VFD1,35S-6D4-P111,11.200.1.199
|
||||||
|
PS4_7_DPM1,11.200.1.12,PS4_9_VFD1,35S-6D3-P101,11.200.1.200
|
||||||
|
PS4_7_DPM1,11.200.1.12,PS4_10_VFD1,35S-6D6-P111,11.200.1.201
|
||||||
|
PS4_7_DPM1,11.200.1.12,PS4_11_VFD1,35S-6D4-P111,11.200.1.202
|
||||||
|
PS4_7_DPM1,11.200.1.12,PS4_12_VFD1,35S-6D3-P101,11.200.1.203
|
||||||
|
PS4_7_DPM1,11.200.1.12,PS4_13_VFD1,35S-6D3-P101,11.200.1.204
|
||||||
|
PS4_7_DPM1,11.200.1.12,PS4_14_VFD1,35S-6D3-P101,11.200.1.205
|
||||||
|
1075
PLACE DPMS/device_mapping.txt
Normal file
1075
PLACE DPMS/device_mapping.txt
Normal file
File diff suppressed because it is too large
Load Diff
@ -1,33 +1,68 @@
|
|||||||
MCM01
|
MCM01
|
||||||
DPM1_UL1_4 11.200.1.2
|
PS1_4_DPM1 11.200.1.10
|
||||||
UL2_4_DPM1 11.200.1.3
|
PS3_3_DPM1 11.200.1.11
|
||||||
|
PS4_7_DPM1 11.200.1.12
|
||||||
|
UL10_3_DPM1 11.200.1.8
|
||||||
|
UL11_10_DPM1 11.200.1.9
|
||||||
|
UL1_4_DPM1 11.200.1.2
|
||||||
|
UL2_4_DPM1 11.200.1.3
|
||||||
|
UL4_4_DPM1 11.200.1.4
|
||||||
|
UL5_4_DPM1 11.200.1.5
|
||||||
|
UL7_4_DPM1 11.200.1.6
|
||||||
|
UL8_3_DPM1 11.200.1.7
|
||||||
MCM02
|
MCM02
|
||||||
UL2_4_DPM1 11.200.1.3
|
PS5_7_DPM1 11.200.1.8
|
||||||
DPM3_UL4_4 11.200.1.4
|
PS6_7_DPM1 11.200.1.9
|
||||||
DPM4_UL5_4 11.200.1.5
|
PS7_7_DPM1 11.200.1.10
|
||||||
|
UL13_8_DPM1 11.200.1.2
|
||||||
|
UL15_4_DPM1 11.200.1.3
|
||||||
|
UL16_2_DPM1 11.200.1.4
|
||||||
|
UL18_4_DPM1 11.200.1.5
|
||||||
|
UL19_2_DPM1 11.200.1.6
|
||||||
|
UL21_11_DPM1 11.200.1.7
|
||||||
MCM03
|
MCM03
|
||||||
UL2_4_DPM1 11.200.1.3
|
NCP1_1_DPM1 11.200.1.2
|
||||||
DPM3_UL4_4 11.200.1.4
|
NCP1_2_DPM1 11.200.1.3
|
||||||
DPM4_UL5_4 11.200.1.5
|
NCP1_3_DPM1 11.200.1.4
|
||||||
DPM5_UL7_4 11.200.1.6
|
NCP1_5_DPM1 11.200.1.5
|
||||||
MCM04
|
MCM04
|
||||||
DPM1_UL1_4 11.200.1.2
|
FL1034_2_DPM1 11.200.1.5
|
||||||
UL2_4_DPM1 11.200.1.3
|
FL3016_2_DPM1 11.200.1.6
|
||||||
DPM3_UL4_4 11.200.1.4
|
PRS3_5_DPM1 11.200.1.2
|
||||||
DPM4_UL5_4 11.200.1.5
|
PS10_2_DPM1 11.200.1.4
|
||||||
DPM1_UL1_4 11.200.1.2
|
PS11_7_DPM1 11.200.1.3
|
||||||
UL2_4_DPM1 11.200.1.3
|
VSA_DPM1 11.200.1.7
|
||||||
DPM3_UL4_4 11.200.1.4
|
VSA_DPM2 11.200.1.8
|
||||||
DPM4_UL5_4 11.200.1.5
|
VSA_DPM3 11.200.1.9
|
||||||
DPM1_UL1_4 11.200.1.7
|
VSC_DPM1 11.200.1.10
|
||||||
UL2_4_DPM1 11.200.1.6
|
VSC_DPM2 11.200.1.11
|
||||||
DPM3_UL4_4 11.200.1.5
|
VSC_DPM3 11.200.1.12
|
||||||
DPM4_UL5_4 11.200.1.12
|
|
||||||
MCM05
|
MCM05
|
||||||
UL2_4_DPM1 11.200.1.3
|
FL2086_DPM1 11.200.1.4
|
||||||
DPM3_UL4_4 11.200.1.4
|
FL4070_DPM1 11.200.1.5
|
||||||
DPM4_UL5_4 11.200.1.5
|
PRS1_3_DPM1 11.200.1.2
|
||||||
DPM5_UL7_4 11.200.1.6
|
PS8_5_DPM1 11.200.1.3
|
||||||
UL2_4_DPM1 11.200.1.6
|
VSB_DPM1 11.200.1.9
|
||||||
DPM3_UL4_4 11.200.1.5
|
VSB_DPM2 11.200.1.10
|
||||||
DPM4_UL5_4 11.200.1.12
|
VSB_DPM3 11.200.1.11
|
||||||
|
VSD_DPM1 11.200.1.6
|
||||||
|
VSD_DPM2 11.200.1.7
|
||||||
|
VSD_DPM3 11.200.1.8
|
||||||
|
MCM06
|
||||||
|
NCP1_15_DPM1 11.200.1.2
|
||||||
|
NCS1_6_DPM1 11.200.1.3
|
||||||
|
NCS1_DPM1 11.200.1.5
|
||||||
|
NCS1_DPM2 11.200.1.6
|
||||||
|
NCS2_4_DPM1 11.200.1.4
|
||||||
|
NCS2_DPM1 11.200.1.7
|
||||||
|
NCS2_DPM2 11.200.1.8
|
||||||
|
MCM07
|
||||||
|
BYAB_12_DPM1 11.200.1.4
|
||||||
|
BYAB_7_DPM1 11.200.1.5
|
||||||
|
BYAC_8_DPM1 11.200.1.10
|
||||||
|
BYAD_3_DPM1 11.200.1.8
|
||||||
|
BYAD_5_DPM1 11.200.1.6
|
||||||
|
BYBC_3_DPM1 11.200.1.3
|
||||||
|
BYCA_3_DPM1 11.200.1.2
|
||||||
|
BYDA_4_DPM1 11.200.1.7
|
||||||
|
BYDA_6_DPM1 11.200.1.9
|
||||||
|
|||||||
188
PLACE DPMS/extract_mcm_mappings.py
Normal file
188
PLACE DPMS/extract_mcm_mappings.py
Normal file
@ -0,0 +1,188 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
"""
|
||||||
|
Script to extract both DPM mappings and device mappings from MCM CSV files
|
||||||
|
Generates two output files:
|
||||||
|
1. dpm_mapping.txt - DPM names and their IP addresses
|
||||||
|
2. device_mapping.txt - DPM names with all their devices and device IPs
|
||||||
|
|
||||||
|
YOU WILL NEED TO HAVE THE MCM CSV FILES IN THE CURRENT DIRECTORY
|
||||||
|
WITH NAME MCM*_COMPLETE.csv
|
||||||
|
"""
|
||||||
|
|
||||||
|
import csv
|
||||||
|
import glob
|
||||||
|
import os
|
||||||
|
from collections import OrderedDict, defaultdict
|
||||||
|
|
||||||
|
def extract_mcm_data():
|
||||||
|
"""Extract both DPM and device data from all MCM CSV files"""
|
||||||
|
|
||||||
|
# Find all MCM CSV files
|
||||||
|
csv_files = glob.glob("MCM*_COMPLETE.csv")
|
||||||
|
csv_files.sort() # Sort to ensure consistent order (MCM01, MCM02, etc.)
|
||||||
|
|
||||||
|
if not csv_files:
|
||||||
|
print("No MCM*_COMPLETE.csv files found in current directory")
|
||||||
|
return None, None
|
||||||
|
|
||||||
|
# Dictionary to store MCM -> list of (DPM, DPM_IP) pairs for DPM mapping
|
||||||
|
mcm_dpm_data = OrderedDict()
|
||||||
|
|
||||||
|
# Dictionary to store MCM -> DPM -> list of (Device_Name, Device_IP) pairs for device mapping
|
||||||
|
mcm_device_data = OrderedDict()
|
||||||
|
|
||||||
|
total_dpms_processed = 0
|
||||||
|
total_devices_processed = 0
|
||||||
|
|
||||||
|
for csv_file in csv_files:
|
||||||
|
# Extract MCM number from filename (e.g., MCM01_COMPLETE.csv -> MCM01)
|
||||||
|
mcm_name = os.path.splitext(csv_file)[0].replace("_COMPLETE", "")
|
||||||
|
|
||||||
|
print(f"Processing {csv_file}...")
|
||||||
|
|
||||||
|
# Set to store unique DPM, DPM_IP combinations for this MCM
|
||||||
|
unique_dpms = set()
|
||||||
|
|
||||||
|
# Dictionary to store DPM -> list of devices for this MCM
|
||||||
|
dpm_devices = defaultdict(list)
|
||||||
|
|
||||||
|
try:
|
||||||
|
with open(csv_file, 'r', newline='', encoding='utf-8-sig') as file: # utf-8-sig handles BOM
|
||||||
|
reader = csv.DictReader(file)
|
||||||
|
|
||||||
|
row_count = 0
|
||||||
|
device_count = 0
|
||||||
|
for row in reader:
|
||||||
|
row_count += 1
|
||||||
|
dpm = row.get('DPM', '').strip()
|
||||||
|
dpm_ip = row.get('DPM_IP', '').strip()
|
||||||
|
device_name = row.get('Name', '').strip()
|
||||||
|
device_ip = row.get('IP', '').strip()
|
||||||
|
|
||||||
|
# Collect DPM data (for dpm_mapping.txt)
|
||||||
|
if dpm and dpm_ip:
|
||||||
|
unique_dpms.add((dpm, dpm_ip))
|
||||||
|
|
||||||
|
# Collect device data (for device_mapping.txt)
|
||||||
|
if dpm and device_name and device_ip:
|
||||||
|
dpm_devices[dpm].append((device_name, device_ip))
|
||||||
|
device_count += 1
|
||||||
|
|
||||||
|
print(f" Processed {row_count} rows, found {device_count} devices")
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
print(f"Error reading {csv_file}: {e}")
|
||||||
|
continue
|
||||||
|
|
||||||
|
# Store DPM mapping data
|
||||||
|
mcm_dpm_data[mcm_name] = sorted(list(unique_dpms))
|
||||||
|
|
||||||
|
# Store device mapping data (sort DPMs and their devices)
|
||||||
|
sorted_dpm_devices = OrderedDict()
|
||||||
|
for dpm in sorted(dpm_devices.keys()):
|
||||||
|
# Sort devices by IP address (extract IP and convert to sortable format)
|
||||||
|
def ip_sort_key(device_tuple):
|
||||||
|
device_name, device_ip = device_tuple
|
||||||
|
try:
|
||||||
|
# Split IP address and convert to integers for proper sorting
|
||||||
|
ip_parts = device_ip.split('.')
|
||||||
|
return tuple(int(part) for part in ip_parts)
|
||||||
|
except (ValueError, AttributeError):
|
||||||
|
# If IP parsing fails, fall back to string sorting
|
||||||
|
return (999, 999, 999, 999) # Put invalid IPs at the end
|
||||||
|
|
||||||
|
sorted_devices = sorted(dpm_devices[dpm], key=ip_sort_key)
|
||||||
|
sorted_dpm_devices[dpm] = sorted_devices
|
||||||
|
mcm_device_data[mcm_name] = sorted_dpm_devices
|
||||||
|
|
||||||
|
# Statistics
|
||||||
|
dpms_in_mcm = len(unique_dpms)
|
||||||
|
devices_in_mcm = sum(len(devices) for devices in sorted_dpm_devices.values())
|
||||||
|
total_dpms_processed += dpms_in_mcm
|
||||||
|
total_devices_processed += devices_in_mcm
|
||||||
|
|
||||||
|
print(f" Found {dpms_in_mcm} unique DPMs with {devices_in_mcm} total devices")
|
||||||
|
|
||||||
|
print(f"\nOverall totals: {total_dpms_processed} DPMs, {total_devices_processed} devices")
|
||||||
|
return mcm_dpm_data, mcm_device_data
|
||||||
|
|
||||||
|
def write_dpm_mapping(mcm_dpm_data, output_file="dpm_mapping.txt"):
|
||||||
|
"""Write the DPM mapping data in the same format as dpm_mapping.txt"""
|
||||||
|
|
||||||
|
try:
|
||||||
|
with open(output_file, 'w', encoding='utf-8') as file:
|
||||||
|
for mcm_name, dpm_list in mcm_dpm_data.items():
|
||||||
|
# Write MCM header
|
||||||
|
file.write(f"{mcm_name}\n")
|
||||||
|
|
||||||
|
# Write DPM entries
|
||||||
|
for dpm, dpm_ip in dpm_list:
|
||||||
|
file.write(f"{dpm}\t{dpm_ip}\n")
|
||||||
|
|
||||||
|
print(f"DPM mapping written to {output_file}")
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
print(f"Error writing DPM mapping file: {e}")
|
||||||
|
|
||||||
|
def write_device_mapping(mcm_device_data, output_file="device_mapping.txt"):
|
||||||
|
"""Write the device mapping data in the same format as device_mapping.txt"""
|
||||||
|
|
||||||
|
try:
|
||||||
|
with open(output_file, 'w', encoding='utf-8') as file:
|
||||||
|
for mcm_name, dpm_devices in mcm_device_data.items():
|
||||||
|
# Write MCM header
|
||||||
|
file.write(f"{mcm_name}\n")
|
||||||
|
|
||||||
|
# Write each DPM and its devices
|
||||||
|
for dpm, devices in dpm_devices.items():
|
||||||
|
# Write DPM header
|
||||||
|
file.write(f"{dpm}\n")
|
||||||
|
|
||||||
|
# Write device entries
|
||||||
|
for device_name, device_ip in devices:
|
||||||
|
file.write(f"{device_name}\t{device_ip}\n")
|
||||||
|
|
||||||
|
print(f"Device mapping written to {output_file}")
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
print(f"Error writing device mapping file: {e}")
|
||||||
|
|
||||||
|
def main():
|
||||||
|
"""Main function"""
|
||||||
|
print("Extracting MCM mapping data from CSV files...")
|
||||||
|
print("=" * 60)
|
||||||
|
|
||||||
|
# Extract data from CSV files
|
||||||
|
mcm_dpm_data, mcm_device_data = extract_mcm_data()
|
||||||
|
|
||||||
|
if not mcm_dpm_data or not mcm_device_data:
|
||||||
|
print("No data extracted. Please check that MCM*_COMPLETE.csv files exist.")
|
||||||
|
return
|
||||||
|
|
||||||
|
print("\nWriting output files...")
|
||||||
|
print("=" * 60)
|
||||||
|
|
||||||
|
# Write both output files
|
||||||
|
write_dpm_mapping(mcm_dpm_data)
|
||||||
|
write_device_mapping(mcm_device_data)
|
||||||
|
|
||||||
|
# Print summary
|
||||||
|
print("\nSummary:")
|
||||||
|
print("=" * 60)
|
||||||
|
total_dpms = 0
|
||||||
|
total_devices = 0
|
||||||
|
|
||||||
|
for mcm_name in mcm_dpm_data.keys():
|
||||||
|
dpm_count = len(mcm_dpm_data[mcm_name])
|
||||||
|
device_count = sum(len(devices) for devices in mcm_device_data[mcm_name].values())
|
||||||
|
total_dpms += dpm_count
|
||||||
|
total_devices += device_count
|
||||||
|
print(f"{mcm_name}: {dpm_count} DPMs, {device_count} devices")
|
||||||
|
|
||||||
|
print(f"\nTotal: {total_dpms} DPMs with {total_devices} devices across all MCM files")
|
||||||
|
print("\nOutput files generated:")
|
||||||
|
print("- dpm_mapping.txt (DPM names and IP addresses)")
|
||||||
|
print("- device_mapping.txt (DPM devices and their IP addresses)")
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
315
PLACE DPMS/multi_mcm_device_mapping.py
Normal file
315
PLACE DPMS/multi_mcm_device_mapping.py
Normal file
@ -0,0 +1,315 @@
|
|||||||
|
"""
|
||||||
|
Multi-MCM Device Mapping Script
|
||||||
|
This script processes ALL MCMs from a device_mapping.txt file simultaneously.
|
||||||
|
It creates separate folders for each MCM with their respective DPM configurations.
|
||||||
|
|
||||||
|
The input file should have the following format:
|
||||||
|
MCM01
|
||||||
|
DPM_NAME1
|
||||||
|
DEVICE_NAME1 DEVICE_IP1
|
||||||
|
DEVICE_NAME2 DEVICE_IP2
|
||||||
|
...
|
||||||
|
DPM_NAME2
|
||||||
|
...
|
||||||
|
MCM02
|
||||||
|
DPM_NAME1
|
||||||
|
...
|
||||||
|
"""
|
||||||
|
|
||||||
|
import json
|
||||||
|
import os
|
||||||
|
import shutil
|
||||||
|
|
||||||
|
def generate_config(num_vfds, num_fios, device_list, dpm_label, mcm_name):
|
||||||
|
if num_vfds + num_fios > 24:
|
||||||
|
raise ValueError("Error: Total number of elements cannot exceed 24 slots.")
|
||||||
|
if len(device_list) != num_vfds + num_fios:
|
||||||
|
raise ValueError(f"Error: Expected {num_vfds + num_fios} device names, but got {len(device_list)}.")
|
||||||
|
|
||||||
|
# Predefined positions and labels for devices (up to 24)
|
||||||
|
positions = [
|
||||||
|
{"x": 0.0232, "y": 0.4991}, {"x": 0.0230, "y": 0.6677}, {"x": 0.0216, "y": 0.8333}, # 3
|
||||||
|
{"x": 0.0229, "y": 0.3333}, {"x": 0.0229, "y": 0.1667}, {"x": 0.0244, "y": 0.0000}, # 6
|
||||||
|
{"x": 0.5000, "y": 0.0000}, {"x": 0.6250, "y": 0.0000}, {"x": 0.7500, "y": 0.0000}, # 9
|
||||||
|
{"x": 0.3750, "y": 0.0000}, {"x": 0.2516, "y": 0.0019}, {"x": 0.1245, "y": 0.0000}, # 12
|
||||||
|
{"x": 0.8509, "y": 0.3332}, {"x": 0.8514, "y": 0.1667}, {"x": 0.8528, "y": 0.0000}, # 15
|
||||||
|
{"x": 0.8509, "y": 0.4988}, {"x": 0.8501, "y": 0.6639}, {"x": 0.8515, "y": 0.8329}, # 18
|
||||||
|
{"x": 0.3740, "y": 0.8324}, {"x": 0.2481, "y": 0.8324}, {"x": 0.1222, "y": 0.8333}, # 21
|
||||||
|
{"x": 0.5026, "y": 0.8314}, {"x": 0.6245, "y": 0.8314}, {"x": 0.7536, "y": 0.8351} # 24
|
||||||
|
]
|
||||||
|
|
||||||
|
label_positions = [
|
||||||
|
{"x": 0.0094, "y": 0.5394}, {"x": 0.0068, "y": 0.7315}, {"x": 0.0068, "y": 0.8981}, # 3
|
||||||
|
{"x": 0.0068, "y": 0.3986}, {"x": 0.0068, "y": 0.2324}, {"x": 0.0068, "y": 0.0653}, # 6
|
||||||
|
{"x": 0.5117, "y": 0.1662}, {"x": 0.6312, "y": 0.1664}, {"x": 0.7500, "y": 0.1664}, # 9
|
||||||
|
{"x": 0.3864, "y": 0.1664}, {"x": 0.3150, "y": 0.1682}, {"x": 0.2072, "y": 0.1646}, # 12
|
||||||
|
{"x": 0.9470, "y": 0.3943}, {"x": 0.9470, "y": 0.2276}, {"x": 0.9470, "y": 0.0619}, # 15
|
||||||
|
{"x": 0.9470, "y": 0.5610}, {"x": 0.9470, "y": 0.7257}, {"x": 0.9470, "y": 0.8927}, # 18
|
||||||
|
{"x": 0.4587, "y": 0.8896}, {"x": 0.3311, "y": 0.8887}, {"x": 0.2071, "y": 0.8886}, # 21
|
||||||
|
{"x": 0.5887, "y": 0.8886}, {"x": 0.7106, "y": 0.8886}, {"x": 0.8344, "y": 0.9247} # 24
|
||||||
|
]
|
||||||
|
|
||||||
|
total_devices = num_vfds + num_fios
|
||||||
|
# Build tagProps per rules, using the provided MCM name and device types
|
||||||
|
# Index 0 must be the DPM tag; indices 1..N are device tags
|
||||||
|
dpm_tag = f"System/{mcm_name}/IO_BLOCK/DPM/{dpm_label}"
|
||||||
|
device_tags = []
|
||||||
|
for device_data in device_list:
|
||||||
|
name, _ip = device_data.split()
|
||||||
|
upper_name = name.upper()
|
||||||
|
if "VFD" in upper_name:
|
||||||
|
device_tags.append(f"System/{mcm_name}/Conveyor/VFD/{name}")
|
||||||
|
elif "TIPPER" in upper_name or "ST" in upper_name:
|
||||||
|
device_tags.append(f"System/{mcm_name}/Conveyor/Tipper/{name}")
|
||||||
|
elif "EX" in upper_name or "EXTENDO" in upper_name:
|
||||||
|
# For EXTENDO devices, ensure the tag name ends with EX1
|
||||||
|
tag_name = name.replace("_EXTENDO", "_EX1") if "_EXTENDO" in name else name
|
||||||
|
device_tags.append(f"System/{mcm_name}/Conveyor/EXTENDO/{tag_name}")
|
||||||
|
elif "ZMX" in upper_name:
|
||||||
|
device_tags.append(f"System/{mcm_name}/PE/ZMX/{name}")
|
||||||
|
elif "PMM" in upper_name:
|
||||||
|
device_tags.append(f"System/{mcm_name}/{name}")
|
||||||
|
elif "SIO" in upper_name:
|
||||||
|
device_tags.append(f"System/{mcm_name}/IO_BLOCK/SIO/{name}")
|
||||||
|
elif "PLC" in upper_name:
|
||||||
|
device_tags.append(f"System/{mcm_name}/Rack")
|
||||||
|
else:
|
||||||
|
# Default to FIO when not explicitly matched otherwise
|
||||||
|
device_tags.append(f"System/{mcm_name}/IO_BLOCK/FIO/{name}")
|
||||||
|
tag_props = [dpm_tag] + device_tags
|
||||||
|
con_lines_visible = [True] * total_devices + [False] * (24 - total_devices)
|
||||||
|
|
||||||
|
# Generate propConfig for con_lines bindings
|
||||||
|
prop_config = {}
|
||||||
|
for i in range(total_devices):
|
||||||
|
prop_config[f"props.params.con_lines[{i}]"] = {
|
||||||
|
"binding": {
|
||||||
|
"config": {
|
||||||
|
"fallbackDelay": 2.5,
|
||||||
|
"mode": "indirect",
|
||||||
|
# Device tags start at index 1 in view.params.tagProps
|
||||||
|
"references": {"0": f"{{view.params.tagProps[{i+1}]}}", "fc": "{session.custom.fc}"},
|
||||||
|
"tagPath": "[{fc}_SCADA_TAG_PROVIDER]{0}/Communication_Faulted"
|
||||||
|
},
|
||||||
|
"transforms": [
|
||||||
|
{"expression": "coalesce({value},{view.params.forceFaultStatus},false)", "type": "expression"},
|
||||||
|
{"fallback": False, "inputType": "scalar", "mappings": [{"input": False, "output": True}], "outputType": "scalar", "type": "map"}
|
||||||
|
],
|
||||||
|
"type": "tag"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Base configuration
|
||||||
|
config = {
|
||||||
|
"custom": {},
|
||||||
|
"params": {"tagProps": tag_props},
|
||||||
|
"props": {"defaultSize": {"height": 1080, "width": 1920}},
|
||||||
|
"root": {
|
||||||
|
"children": [],
|
||||||
|
"meta": {"name": "root"},
|
||||||
|
"position": {"x": 0.6348, "y": -0.1546},
|
||||||
|
"props": {"mode": "percent"},
|
||||||
|
"type": "ia.container.coord"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
# Add DPM component
|
||||||
|
config["root"]["children"].append({
|
||||||
|
"meta": {"name": "DPM"},
|
||||||
|
"position": {"x": 0, "y": 0, "height": 1, "width": 1},
|
||||||
|
"propConfig": prop_config,
|
||||||
|
"props": {
|
||||||
|
# Include tagProps with index 0 set to the DPM tag
|
||||||
|
"params": {"con_lines": [False] * 24, "con_lines_visible": con_lines_visible, "in": False, "out": False, "tagProps": [dpm_tag] + ["value"] * 9},
|
||||||
|
"path": "Windows/Tabs/Enternet Windows/Components/DPM_TO_HUB"
|
||||||
|
},
|
||||||
|
"type": "ia.display.view"
|
||||||
|
})
|
||||||
|
|
||||||
|
# Process all devices
|
||||||
|
for i, device_data in enumerate(device_list):
|
||||||
|
name, ip = device_data.split()
|
||||||
|
|
||||||
|
# Determine device type and component path
|
||||||
|
upper_name = name.upper()
|
||||||
|
is_vfd = "VFD" in upper_name
|
||||||
|
is_ex = "EX" in upper_name or "EXTENDO" in upper_name
|
||||||
|
is_zmx = "ZMX" in upper_name
|
||||||
|
is_pmm = "PMM" in upper_name
|
||||||
|
is_tipper = "TIPPER" in upper_name or "ST" in upper_name
|
||||||
|
is_plc = "PLC" in upper_name
|
||||||
|
|
||||||
|
# Set component name (remove common suffixes)
|
||||||
|
component_name = name.replace("_VFD1", "").replace("_EX1", "")
|
||||||
|
|
||||||
|
# Determine component path based on device type
|
||||||
|
if is_ex:
|
||||||
|
component_path = "EXTENDO"
|
||||||
|
elif is_vfd:
|
||||||
|
component_path = "APF"
|
||||||
|
elif is_zmx:
|
||||||
|
component_path = "ZMX"
|
||||||
|
elif is_pmm:
|
||||||
|
component_path = "PMM"
|
||||||
|
elif is_tipper:
|
||||||
|
component_path = "TIPPER"
|
||||||
|
elif is_plc:
|
||||||
|
component_path = "PLC"
|
||||||
|
else:
|
||||||
|
component_path = "FIO_SIO"
|
||||||
|
|
||||||
|
# Adjust X position for all non-VFD devices at positions 12-18 (1-based)
|
||||||
|
component_x = positions[i]["x"]
|
||||||
|
label_x = label_positions[i]["x"]
|
||||||
|
if not is_vfd and 11 <= i <= 17:
|
||||||
|
component_x += 0.007
|
||||||
|
label_x += 0.007
|
||||||
|
|
||||||
|
# Add device component with params.tagProps[0] set to this device's tag path
|
||||||
|
device_tag_props = [device_tags[i]] + ["value"] * 9
|
||||||
|
config["root"]["children"].append({
|
||||||
|
"meta": {"name": component_name},
|
||||||
|
"position": {"height": 0.1667, "width": 0.125, "x": component_x, "y": positions[i]["y"]},
|
||||||
|
"props": {
|
||||||
|
"params": {"tagProps": device_tag_props},
|
||||||
|
"path": f"Windows/Tabs/Enternet Windows/Components/{component_path}"
|
||||||
|
},
|
||||||
|
"type": "ia.display.view"
|
||||||
|
})
|
||||||
|
|
||||||
|
# Add device label
|
||||||
|
config["root"]["children"].append({
|
||||||
|
"meta": {"name": f"{component_name}_label"},
|
||||||
|
"position": {"height": 0.0358, "width": 0.0547 if is_vfd else 0.0427, "x": label_x, "y": label_positions[i]["y"]},
|
||||||
|
"props": {"text": f"{name} {ip}", "textStyle": {"fontSize": "1vmin", "key": "value"}},
|
||||||
|
"type": "ia.display.label"
|
||||||
|
})
|
||||||
|
|
||||||
|
# Add DPM label
|
||||||
|
config["root"]["children"].append({
|
||||||
|
"meta": {"name": "DPM_label"},
|
||||||
|
"position": {"height": 0.0694, "width": 0.101, "x": 0.5831, "y": 0.6342},
|
||||||
|
"props": {"text": dpm_label, "textStyle": {"fontSize": "2vmin"}},
|
||||||
|
"type": "ia.display.label"
|
||||||
|
})
|
||||||
|
|
||||||
|
return config
|
||||||
|
|
||||||
|
def parse_all_mcm_data(file_path):
|
||||||
|
"""Parse device mapping file containing multiple MCMs"""
|
||||||
|
all_mcms = {}
|
||||||
|
current_mcm = None
|
||||||
|
current_dpm = None
|
||||||
|
|
||||||
|
with open(file_path, 'r') as f:
|
||||||
|
for line in f:
|
||||||
|
line = line.strip()
|
||||||
|
if not line:
|
||||||
|
continue
|
||||||
|
|
||||||
|
# Check if this is a device row (has tab or space separator with exactly 2 parts)
|
||||||
|
is_device_row = ('\t' in line and len(line.split('\t')) == 2) or (' ' in line and len(line.split(' ')) == 2)
|
||||||
|
|
||||||
|
if not is_device_row:
|
||||||
|
# Header row: either MCM name or DPM name
|
||||||
|
if line.upper().startswith('MCM'):
|
||||||
|
# New MCM section
|
||||||
|
current_mcm = line
|
||||||
|
all_mcms[current_mcm] = {}
|
||||||
|
current_dpm = None
|
||||||
|
else:
|
||||||
|
# DPM name
|
||||||
|
if current_mcm is None:
|
||||||
|
print(f"Warning: Found DPM '{line}' before any MCM header. Skipping.")
|
||||||
|
continue
|
||||||
|
current_dpm = line
|
||||||
|
all_mcms[current_mcm][current_dpm] = []
|
||||||
|
else:
|
||||||
|
# Device row
|
||||||
|
if current_mcm is None or current_dpm is None:
|
||||||
|
print(f"Warning: Found device '{line}' before MCM/DPM headers. Skipping.")
|
||||||
|
continue
|
||||||
|
|
||||||
|
parts = line.split('\t') if '\t' in line else line.split(' ')
|
||||||
|
all_mcms[current_mcm][current_dpm].append((parts[0].strip(), parts[1].strip()))
|
||||||
|
|
||||||
|
return all_mcms
|
||||||
|
|
||||||
|
def copy_files_to_dpm_folder(dpm_folder):
|
||||||
|
"""Copy resource.json and thumbnail.png to DPM folder"""
|
||||||
|
script_dir = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
for file_name in ["resource.json", "thumbnail.png"]:
|
||||||
|
source = os.path.join(script_dir, file_name)
|
||||||
|
if os.path.exists(source):
|
||||||
|
shutil.copy2(source, os.path.join(dpm_folder, file_name))
|
||||||
|
|
||||||
|
def create_mcm_folders(all_mcms):
|
||||||
|
"""Create folders and configurations for all MCMs"""
|
||||||
|
total_mcms = len(all_mcms)
|
||||||
|
total_dpms = sum(len(dpms) for dpms in all_mcms.values())
|
||||||
|
total_devices = sum(len(devices) for mcm_dpms in all_mcms.values() for devices in mcm_dpms.values())
|
||||||
|
|
||||||
|
print(f"Processing {total_mcms} MCMs with {total_dpms} DPMs and {total_devices} total devices...")
|
||||||
|
print("=" * 70)
|
||||||
|
|
||||||
|
for mcm_name, dpms in all_mcms.items():
|
||||||
|
print(f"\nProcessing {mcm_name}...")
|
||||||
|
mcm_folder = mcm_name
|
||||||
|
os.makedirs(mcm_folder, exist_ok=True)
|
||||||
|
|
||||||
|
mcm_dpms = len(dpms)
|
||||||
|
mcm_devices = sum(len(devices) for devices in dpms.values())
|
||||||
|
print(f" {mcm_dpms} DPMs, {mcm_devices} devices")
|
||||||
|
|
||||||
|
for dpm_name, devices in dpms.items():
|
||||||
|
print(f" Processing {dpm_name} with {len(devices)} devices...")
|
||||||
|
dpm_folder = os.path.join(mcm_folder, dpm_name)
|
||||||
|
os.makedirs(dpm_folder, exist_ok=True)
|
||||||
|
|
||||||
|
try:
|
||||||
|
# Count device types and create config
|
||||||
|
num_vfds = sum(1 for name, _ in devices if '_VFD' in name)
|
||||||
|
num_fios = len(devices) - num_vfds
|
||||||
|
device_list = [f"{name} {ip}" for name, ip in devices]
|
||||||
|
|
||||||
|
config = generate_config(num_vfds, num_fios, device_list, dpm_name, mcm_name)
|
||||||
|
|
||||||
|
# Save view.json and copy files
|
||||||
|
with open(os.path.join(dpm_folder, "view.json"), 'w') as f:
|
||||||
|
json.dump(config, f, indent=2)
|
||||||
|
copy_files_to_dpm_folder(dpm_folder)
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
print(f" Error processing {dpm_name}: {e}")
|
||||||
|
|
||||||
|
print("\n" + "=" * 70)
|
||||||
|
print(f"Summary: Created {total_mcms} MCM folders with {total_dpms} DPM subfolders")
|
||||||
|
|
||||||
|
def main():
|
||||||
|
# Get the directory where this script is located
|
||||||
|
script_dir = os.path.dirname(os.path.abspath(__file__))
|
||||||
|
input_file = os.path.join(script_dir, "device_mapping.txt")
|
||||||
|
|
||||||
|
try:
|
||||||
|
if not os.path.exists(input_file):
|
||||||
|
print(f"Error: File '{input_file}' not found.")
|
||||||
|
print("Please ensure device_mapping.txt exists in the same directory as this script.")
|
||||||
|
return
|
||||||
|
|
||||||
|
print("Multi-MCM Device Mapping Script")
|
||||||
|
print("=" * 70)
|
||||||
|
print(f"Reading from: {input_file}")
|
||||||
|
|
||||||
|
all_mcms = parse_all_mcm_data(input_file)
|
||||||
|
if not all_mcms:
|
||||||
|
print("No MCM data found in the input file.")
|
||||||
|
return
|
||||||
|
|
||||||
|
create_mcm_folders(all_mcms)
|
||||||
|
print("Completed successfully! Check the MCM folders.")
|
||||||
|
|
||||||
|
except Exception as e:
|
||||||
|
print(f"An error occurred: {str(e)}")
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
main()
|
||||||
|
Before Width: | Height: | Size: 144 KiB After Width: | Height: | Size: 144 KiB |
@ -3,33 +3,45 @@ import os
|
|||||||
import re
|
import re
|
||||||
|
|
||||||
def clean_device_name(name):
|
def clean_device_name(name):
|
||||||
"""Remove _Line and _END suffixes from device name for tag path"""
|
"""Remove _Line, _END, _EN suffixes and trailing D from device name for tag path"""
|
||||||
# Remove _Line, _Line_1, _Line_2, etc.
|
# Remove _Line, _Line_1, _Line_2, etc.
|
||||||
name = re.sub(r'_Line(_\d+)?$', '', name)
|
name = re.sub(r'_Line(_\d+)?$', '', name)
|
||||||
# Remove _END
|
# Remove _END
|
||||||
name = re.sub(r'_END$', '', name)
|
name = re.sub(r'_END$', '', name)
|
||||||
|
# Remove _EN
|
||||||
|
name = name.replace('_EN', '')
|
||||||
|
# Remove trailing D for EPC devices (e.g., PS2_8_EPC2D -> PS2_8_EPC2)
|
||||||
|
if 'EPC' in name and name.endswith('D'):
|
||||||
|
name = name[:-1]
|
||||||
return name
|
return name
|
||||||
|
|
||||||
# Use the same classification logic as generate-tags.py with modifications for PR/GS/EX
|
# Use the same classification logic as generate-tags.py with modifications for PR/GS/EN/EX
|
||||||
def classify_device(name):
|
def classify_device(name):
|
||||||
|
|
||||||
skip_keywords = ["Image", "Button", "Camera", "image", "ERSC", "DIV"]
|
skip_keywords = ["Image", "Button", "Camera", "image", "ERSC", "DIV"]
|
||||||
|
|
||||||
# Handle EX (EXTENDO) devices first
|
# Handle EX (EXTENDO) devices first
|
||||||
if "EX" in name:
|
if "EX" in name:
|
||||||
return {"folder": "Conveyor/EXTENDO", "typeId": "Conveyor/EXTENDO", "tagType": "UdtInstance", "name": name}
|
return {"folder": "Conveyor/EXTENDO", "typeId": "Conveyor/EXTENDO", "tagType": "UdtInstance", "name": name}
|
||||||
|
|
||||||
|
# Handle TIPPER devices
|
||||||
|
if "TIPPER" in name:
|
||||||
|
return {"folder": "Conveyor/Tipper", "typeId": "Conveyor/Tipper", "tagType": "UdtInstance", "name": name}
|
||||||
|
|
||||||
# Always IO_BLOCK if ends with FIO{num}, SIO{num}, DPM{num}
|
# Always IO_BLOCK if ends with FIO{num}, SIO{num}, DPM{num}
|
||||||
if any(re.search(rf'{kw}\d+$', name) for kw in ["FIO", "SIO", "DPM"]):
|
if any(re.search(rf'{kw}\d+$', name) for kw in ["FIO", "SIO", "DPM"]):
|
||||||
for kw in ["FIO", "SIO", "DPM"]:
|
for kw in ["FIO", "SIO", "DPM"]:
|
||||||
if re.search(rf'{kw}\d+$', name):
|
if re.search(rf'{kw}\d+$', name):
|
||||||
return {"folder": f"IO_BLOCK/{kw}", "typeId": "IO_BLOCK", "tagType": "UdtInstance", "name": name}
|
return {"folder": f"IO_BLOCK/{kw}", "typeId": "IO_BLOCK", "tagType": "UdtInstance", "name": name}
|
||||||
|
|
||||||
# Handle PR and GS suffixes - remove them for tag path but keep original name for classification
|
# Handle PR, GS, and EN suffixes - remove them for tag path but keep original name for classification
|
||||||
original_name = name
|
original_name = name
|
||||||
if "_PR1" in name:
|
if "_PR1" in name:
|
||||||
name = name.replace("_PR1", "")
|
name = name.replace("_PR1", "")
|
||||||
elif "_GS1" in name:
|
elif "_GS1" in name:
|
||||||
name = name.replace("_GS1", "")
|
name = name.replace("_GS1", "")
|
||||||
|
elif "_EN" in name:
|
||||||
|
name = re.sub(r'_EN\d*', '', name) # Remove _EN, _EN1, _EN2, etc.
|
||||||
|
|
||||||
if any(kw in name for kw in skip_keywords):
|
if any(kw in name for kw in skip_keywords):
|
||||||
return None
|
return None
|
||||||
@ -73,12 +85,13 @@ def classify_device(name):
|
|||||||
else:
|
else:
|
||||||
return {"folder": "Chute/D2C", "typeId": "Chute/D2C", "tagType": "UdtInstance", "name": name}
|
return {"folder": "Chute/D2C", "typeId": "Chute/D2C", "tagType": "UdtInstance", "name": name}
|
||||||
|
|
||||||
|
|
||||||
# Conveyor rules - everything else is VFD
|
# Conveyor rules - everything else is VFD
|
||||||
return {"folder": "Conveyor/VFD", "typeId": "Conveyor/VFD", "tagType": "UdtInstance", "name": name + "_VFD1"}
|
return {"folder": "Conveyor/VFD", "typeId": "Conveyor/VFD", "tagType": "UdtInstance", "name": name + "_VFD1"}
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
# Path to the Detailed-Views directory
|
# Path to the Detailed-Views directory
|
||||||
base_path = r"C:\Program Files\Inductive Automation\Ignition\data\projects\SAT9_SCADA\com.inductiveautomation.perspective\views\Detailed-Views"
|
base_path = r"C:\Program Files\Inductive Automation\Ignition\data\projects\CNO8_SCADA\com.inductiveautomation.perspective\views\Detailed-Views"
|
||||||
|
|
||||||
if not os.path.exists(base_path):
|
if not os.path.exists(base_path):
|
||||||
print(f"Error: Path not found: {base_path}")
|
print(f"Error: Path not found: {base_path}")
|
||||||
|
|||||||
@ -8,7 +8,7 @@ import os
|
|||||||
import re
|
import re
|
||||||
import copy
|
import copy
|
||||||
|
|
||||||
default_view_path = r"c:\Program Files\Inductive Automation\Ignition\data\projects\SAT9_SCADA\com.inductiveautomation.perspective\views\Detailed-Views"
|
default_view_path = r"C:\Program Files\Inductive Automation\Ignition\data\projects\CNO8_SCADA\com.inductiveautomation.perspective\views\Detailed-Views"
|
||||||
|
|
||||||
def merge_tags(t1, t2):
|
def merge_tags(t1, t2):
|
||||||
"""
|
"""
|
||||||
@ -39,13 +39,28 @@ def merge_tags(t1, t2):
|
|||||||
return copy.deepcopy(t1) if t2 is None else copy.deepcopy(t2)
|
return copy.deepcopy(t1) if t2 is None else copy.deepcopy(t2)
|
||||||
|
|
||||||
# Filtering and classification rules
|
# Filtering and classification rules
|
||||||
def classify_device(name):
|
def classify_device(name, mcm_device_name):
|
||||||
skip_keywords = ["Line", "Image", "Button", "Camera", "END", "image", "PR", "GS", "ERSC", "DIV"]
|
|
||||||
|
skip_keywords = ["Line", "Image", "Button", "Camera", "END", "image", "PR", "GS", "ERSC", "DIV", "EN"]
|
||||||
|
|
||||||
|
# Create parameters structure for all UdtInstance tags
|
||||||
|
def create_parameters(mcm_name):
|
||||||
|
return {
|
||||||
|
"parameters": {
|
||||||
|
"MCM": {
|
||||||
|
"dataType": "String",
|
||||||
|
"value": mcm_name
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
# Always IO_BLOCK if ends with FIO{num}, SIO{num}, DPM{num}
|
# Always IO_BLOCK if ends with FIO{num}, SIO{num}, DPM{num}
|
||||||
if any(re.search(rf'{kw}\d+$', name) for kw in ["FIO", "SIO", "DPM"]):
|
if any(re.search(rf'{kw}\d+$', name) for kw in ["FIO", "SIO", "DPM"]):
|
||||||
for kw in ["FIO", "SIO", "DPM"]:
|
for kw in ["FIO", "SIO", "DPM"]:
|
||||||
if re.search(rf'{kw}\d+$', name):
|
if re.search(rf'{kw}\d+$', name):
|
||||||
return {"folder": f"IO_BLOCK/{kw}", "typeId": "IO_BLOCK", "tagType": "UdtInstance", "name": name}
|
result = {"folder": f"IO_BLOCK/{kw}", "typeId": "IO_BLOCK", "tagType": "UdtInstance", "name": name}
|
||||||
|
result.update(create_parameters(mcm_device_name))
|
||||||
|
return result
|
||||||
# Skip if PR is in name (unless above rule matched)
|
# Skip if PR is in name (unless above rule matched)
|
||||||
if "PR" in name:
|
if "PR" in name:
|
||||||
return None
|
return None
|
||||||
@ -53,36 +68,68 @@ def classify_device(name):
|
|||||||
return None
|
return None
|
||||||
# EPC goes to Station/EPC
|
# EPC goes to Station/EPC
|
||||||
if "EPC" in name:
|
if "EPC" in name:
|
||||||
return {"folder": "Station/EPC", "typeId": "Station/EPC", "tagType": "UdtInstance", "name": name}
|
result = {"folder": "Station/EPC", "typeId": "Station/EPC", "tagType": "UdtInstance", "name": name}
|
||||||
|
result.update(create_parameters(mcm_device_name))
|
||||||
|
return result
|
||||||
# SS1 and SS2 go to Station/SS_PB
|
# SS1 and SS2 go to Station/SS_PB
|
||||||
if "SS1" in name or "SS2" in name:
|
if "SS1" in name or "SS2" in name:
|
||||||
return {"folder": "Station/SS_PB", "typeId": "Station/SS_PB", "tagType": "UdtInstance", "name": name}
|
result = {"folder": "Station/SS_PB", "typeId": "Station/SS_PB", "tagType": "UdtInstance", "name": name}
|
||||||
|
result.update(create_parameters(mcm_device_name))
|
||||||
|
return result
|
||||||
# _S1 and _S2 go to Station/S_PB
|
# _S1 and _S2 go to Station/S_PB
|
||||||
if "_S1" in name or "_S2" in name:
|
if "_S1" in name or "_S2" in name:
|
||||||
return {"folder": "Station/S_PB", "typeId": "Station/S_PB", "tagType": "UdtInstance", "name": name}
|
result = {"folder": "Station/S_PB", "typeId": "Station/S_PB", "tagType": "UdtInstance", "name": name}
|
||||||
|
result.update(create_parameters(mcm_device_name))
|
||||||
|
return result
|
||||||
# S01...JR is Station/Chute_JR
|
# S01...JR is Station/Chute_JR
|
||||||
if name.startswith("S01") and "JR" in name:
|
if name.startswith("S01") and "JR" in name:
|
||||||
return {"folder": "Station/Chute_JR", "typeId": "Station/Chute_JR", "tagType": "UdtInstance", "name": name}
|
result = {"folder": "Station/Chute_JR", "typeId": "Station/Chute_JR", "tagType": "UdtInstance", "name": name}
|
||||||
|
result.update(create_parameters(mcm_device_name))
|
||||||
|
return result
|
||||||
# JR always goes to Station/JR
|
# JR always goes to Station/JR
|
||||||
if "JR" in name:
|
if "JR" in name:
|
||||||
return {"folder": "Station/JR", "typeId": "Station/JR", "tagType": "UdtInstance", "name": name}
|
result = {"folder": "Station/JR", "typeId": "Station/JR", "tagType": "UdtInstance", "name": name}
|
||||||
|
result.update(create_parameters(mcm_device_name))
|
||||||
|
return result
|
||||||
# IO_BLOCK (priority over CH)
|
# IO_BLOCK (priority over CH)
|
||||||
if any(kw in name for kw in ["DPM", "FIO", "SIO", "HUB"]):
|
if any(kw in name for kw in ["DPM", "FIO", "SIO", "HUB"]):
|
||||||
for kw in ["DPM", "FIO", "SIO", "HUB"]:
|
for kw in ["DPM", "FIO", "SIO", "HUB"]:
|
||||||
if kw in name:
|
if kw in name:
|
||||||
return {"folder": f"IO_BLOCK/{kw}", "typeId": "IO_BLOCK", "tagType": "UdtInstance", "name": name}
|
result = {"folder": f"IO_BLOCK/{kw}", "typeId": "IO_BLOCK", "tagType": "UdtInstance", "name": name}
|
||||||
|
result.update(create_parameters(mcm_device_name))
|
||||||
|
return result
|
||||||
|
# Tipper rule (before Chute rules)
|
||||||
|
if "TIPPER" in name:
|
||||||
|
result = {"folder": "Conveyor/Tipper", "typeId": "Conveyor/Tipper", "tagType": "UdtInstance", "name": name}
|
||||||
|
result.update(create_parameters(mcm_device_name))
|
||||||
|
return result
|
||||||
|
# Extendo rule
|
||||||
|
if "EX" in name:
|
||||||
|
result = {"folder": "Conveyor/Extendo", "typeId": "Conveyor/Extendo", "tagType": "UdtInstance", "name": name}
|
||||||
|
result.update(create_parameters(mcm_device_name))
|
||||||
|
return result
|
||||||
# New rules for Chute (only if not PR or JR)
|
# New rules for Chute (only if not PR or JR)
|
||||||
if "FL" in name and "CH" in name:
|
if "FL" in name and "CH" in name:
|
||||||
return {"folder": "Chute/FL_CHUTE", "typeId": "Chute/FL_CHUTE", "tagType": "UdtInstance", "name": name}
|
result = {"folder": "Chute/FL_CHUTE", "typeId": "Chute/FL_CHUTE", "tagType": "UdtInstance", "name": name}
|
||||||
|
result.update(create_parameters(mcm_device_name))
|
||||||
|
return result
|
||||||
if "CH" in name:
|
if "CH" in name:
|
||||||
return {"folder": "Chute/Chute", "typeId": "Chute/Chute", "tagType": "UdtInstance", "name": name}
|
result = {"folder": "Chute/Chute", "typeId": "Chute/Chute", "tagType": "UdtInstance", "name": name}
|
||||||
|
result.update(create_parameters(mcm_device_name))
|
||||||
|
return result
|
||||||
if name.startswith("S01") and name[-1].isdigit():
|
if name.startswith("S01") and name[-1].isdigit():
|
||||||
if int(name[-1]) % 2 == 0:
|
if int(name[-1]) % 2 == 0:
|
||||||
return {"folder": "Chute/PalletBuild", "typeId": "Chute/PalletBuild", "tagType": "UdtInstance", "name": name}
|
result = {"folder": "Chute/PalletBuild", "typeId": "Chute/PalletBuild", "tagType": "UdtInstance", "name": name}
|
||||||
|
result.update(create_parameters(mcm_device_name))
|
||||||
|
return result
|
||||||
else:
|
else:
|
||||||
return {"folder": "Chute/D2C", "typeId": "Chute/D2C", "tagType": "UdtInstance", "name": name}
|
result = {"folder": "Chute/D2C", "typeId": "Chute/D2C", "tagType": "UdtInstance", "name": name}
|
||||||
|
result.update(create_parameters(mcm_device_name))
|
||||||
|
return result
|
||||||
# Conveyor rules - everything else is VFD
|
# Conveyor rules - everything else is VFD
|
||||||
return {"folder": "Conveyor/VFD", "typeId": "Conveyor/VFD", "tagType": "UdtInstance", "name": name + "_VFD1"}
|
result = {"folder": "Conveyor/VFD", "typeId": "Conveyor/VFD", "tagType": "UdtInstance", "name": name + "_VFD1"}
|
||||||
|
result.update(create_parameters(mcm_device_name))
|
||||||
|
return result
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
# Iterate through all subfolders in the default_view_path
|
# Iterate through all subfolders in the default_view_path
|
||||||
@ -109,20 +156,27 @@ def main():
|
|||||||
mcm_device_name = None
|
mcm_device_name = None
|
||||||
seen_names = set() # Track seen names to avoid duplicates
|
seen_names = set() # Track seen names to avoid duplicates
|
||||||
|
|
||||||
|
# First pass: find MCM device name
|
||||||
|
for child in children:
|
||||||
|
meta = child.get("meta", {})
|
||||||
|
name = meta.get("name")
|
||||||
|
if name and "MCM" in name:
|
||||||
|
mcm_device_name = name
|
||||||
|
break
|
||||||
|
|
||||||
|
if not mcm_device_name:
|
||||||
|
mcm_device_name = folder_name # fallback to folder name if not found
|
||||||
|
|
||||||
|
# Second pass: classify devices
|
||||||
for child in children:
|
for child in children:
|
||||||
meta = child.get("meta", {})
|
meta = child.get("meta", {})
|
||||||
name = meta.get("name")
|
name = meta.get("name")
|
||||||
if name and name not in seen_names: # Only process if not seen before
|
if name and name not in seen_names: # Only process if not seen before
|
||||||
seen_names.add(name)
|
seen_names.add(name)
|
||||||
if mcm_device_name is None and "MCM" in name:
|
classified = classify_device(name, mcm_device_name)
|
||||||
mcm_device_name = name
|
|
||||||
classified = classify_device(name)
|
|
||||||
if classified:
|
if classified:
|
||||||
devices.append(classified)
|
devices.append(classified)
|
||||||
|
|
||||||
if not mcm_device_name:
|
|
||||||
mcm_device_name = folder_name # fallback to folder name if not found
|
|
||||||
|
|
||||||
# Initialize folder structure
|
# Initialize folder structure
|
||||||
folders = {
|
folders = {
|
||||||
"IO_BLOCK": {
|
"IO_BLOCK": {
|
||||||
@ -146,7 +200,9 @@ def main():
|
|||||||
},
|
},
|
||||||
"Conveyor": {
|
"Conveyor": {
|
||||||
"VFD": [],
|
"VFD": [],
|
||||||
"APF": []
|
"APF": [],
|
||||||
|
"Tipper": [],
|
||||||
|
"Extendo": []
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -271,6 +327,16 @@ def main():
|
|||||||
"name": "APF",
|
"name": "APF",
|
||||||
"tagType": "Folder",
|
"tagType": "Folder",
|
||||||
"tags": folders["Conveyor"]["APF"]
|
"tags": folders["Conveyor"]["APF"]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Tipper",
|
||||||
|
"tagType": "Folder",
|
||||||
|
"tags": folders["Conveyor"]["Tipper"]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"name": "Extendo",
|
||||||
|
"tagType": "Folder",
|
||||||
|
"tags": folders["Conveyor"]["Extendo"]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|||||||
13
TAGS/test_generate.py
Normal file
13
TAGS/test_generate.py
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
"""
|
||||||
|
Test script to verify the parameter structure generation
|
||||||
|
"""
|
||||||
|
import json
|
||||||
|
from generate_tags import classify_device
|
||||||
|
|
||||||
|
# Test the classify_device function
|
||||||
|
test_name = "ULC1_8_DPM1"
|
||||||
|
mcm_name = "MCM01"
|
||||||
|
|
||||||
|
result = classify_device(test_name, mcm_name)
|
||||||
|
print("Test result:")
|
||||||
|
print(json.dumps(result, indent=2))
|
||||||
Loading…
x
Reference in New Issue
Block a user