-
Notifications
You must be signed in to change notification settings - Fork 0
/
Build_Warning_Filters.txt
363 lines (274 loc) · 11.7 KB
/
Build_Warning_Filters.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
Public Enum suppliers
AutosarCenter = 1
Elektrobit
SoftwarePlatform
ST
End Enum
Function Build_Warnings_Filters(Optional Sheetname As Worksheet, Optional supplier As String, Optional Functionality As String) As Integer
'Select the workbook to filter
Dim QReport As Workbook
Dim WorkbookPath As String
WorkbookPath = Sheetname.Range("A66")
Set QReport = Workbooks.Open(WorkbookPath, True, True)
Dim count As Integer
'Filter for Supplier , Functionality
QReport.Worksheets("Compiler and Assembler Warnings").Range("A:W").AutoFilter Field:=9, Criteria1:=Functionality
QReport.Worksheets("Compiler and Assembler Warnings").Range("A:W").AutoFilter Field:=12, Criteria1:=supplier
With QReport.Worksheets("Compiler and Assembler Warnings")
Set rnData = .UsedRange
With rnData
QReport.Worksheets("Compiler and Assembler Warnings").Select
For Each rngarea In .SpecialCells(xlCellTypeVisible).Areas
lcount = lcount + rngarea.Rows.count
Next
count = lcount - 1
End With
End With
Build_Warnings_Filters = count
End Function
Function Build_Warnings_Functionality_Only(Optional Sheetname As Worksheet, Optional Functionality As String) As Integer
'Select the workbook to filter
Dim QReport As Workbook
Dim WorkbookPath As String
WorkbookPath = Sheetname.Range("A66")
Set QReport = Workbooks.Open(WorkbookPath, True, True)
Dim count As Integer
QReport.Worksheets("Compiler and Assembler Warnings").ShowAllData
'Filter for Functionality
QReport.Worksheets("Compiler and Assembler Warnings").Range("A:W").AutoFilter Field:=9, Criteria1:=Functionality
With QReport.Worksheets("Compiler and Assembler Warnings")
Set rnData = .UsedRange
With rnData
QReport.Worksheets("Compiler and Assembler Warnings").Select
For Each rngarea In .SpecialCells(xlCellTypeVisible).Areas
lcount = lcount + rngarea.Rows.count
Next
count = lcount - 1
End With
End With
Build_Warnings_Functionality_Only = count
End Function
Function Build_Warnings_Total(Optional Sheetname1 As Worksheet, Optional Supplier1 As String, Optional Functionality1 As String) As Integer
Build_Warnings_Total = Build_Warnings_Filters(Sheetname1, Supplier1, Functionality1)
End Function
Sub Build_Warnings_Total_All(Optional Sheetname As Worksheet, Optional FuncTableRange As String)
Call Build_Warnings_Supplier_Total(Sheetname, FuncTableRange, AutosarCenter)
Call Build_Warnings_Supplier_Total(Sheetname, FuncTableRange, Elektrobit)
Call Build_Warnings_Supplier_Total(Sheetname, FuncTableRange, SoftwarePlatform)
Call Build_Warnings_Supplier_Total(Sheetname, FuncTableRange, ST)
End Sub
Sub Build_Warnings_Supplier_Total(Optional Sheetname As Worksheet, Optional FuncTableRange As String, Optional SupplierNo As supplier)
Dim RowNumberMax As Long
RowNumberMax = 53
Dim myRange As Range
Dim Temp As Long
Static RowNumber As Long
RowNumber = 2 + SupplierNo
Set myRange = Sheetname.Range(FuncTableRange)
Do While RowNumber < RowNumberMax - 5
Temp = Temp + myRange.Cells(RowNumber - 1, 1)
RowNumber = RowNumber + 5
Loop
myRange.Cells(RowNumberMax + SupplierNo - 1, 1).Value = Temp
End Sub
Function Build_Warnings_Functionality(Optional Sheetname As Worksheet, Optional Functionality2 As String, Optional Subfunctionality2 As Variant)
Sheetname.Range("AZ3").Value = Build_Warnings_Total(Sheetname, "AutosarCenter", Functionality2)
Sheetname.Range("AZ4").Value = Build_Warnings_Total(Sheetname, "Elektrobit", Functionality2)
Sheetname.Range("AZ5").Value = Build_Warnings_Total(Sheetname, "SoftwarePlatform", Functionality2)
Sheetname.Range("AZ6").Value = Build_Warnings_Total(Sheetname, "ST", Functionality2)
Sheetname.Range("AZ2").Value = Sheetname.Range("AZ3") + Sheetname.Range("AZ4") + Sheetname.Range("AZ5") + Sheetname.Range("AZ6")
Build_Warnings_Functionality = Sheetname.Range("AZ2").Value
End Function
Function Build_Warnings_Module(Optional Sheetname As Worksheet, Optional FuncTableRange As String, Optional FuncTableOffset As Integer)
Dim ColumnNumber As Long
Dim CurrentColumnNumber As Long
Dim TempColumnNumber As Long
Dim RowNumberMax As Long
CurrentColumnNumber = Sheetname.Range(FuncTableRange).Column
TempColumnNumber = Sheetname.Range("AZ2:AZ6").Column
ColumnNumber = TempColumnNumber - CurrentColumnNumber + 1
RowNumberMax = 6 + FuncTableOffset
Dim myRange As Range
Dim RowNumber As Long
RowNumber = 2 + FuncTableOffset
Set myRange = Sheetname.Range(FuncTableRange)
For RowNumber = RowNumber To RowNumberMax - 1
myRange.Cells(RowNumber, 1).Value = myRange.Cells(RowNumber - FuncTableOffset, ColumnNumber)
Next RowNumber
End Function
Sub CalculateBuildWarnings(Optional Sheetname As Worksheet, Optional TableRange As String, Optional ColumnName As String)
Dim SubFun As Variant
SubFun = Array("Code", "Configuration")
Dim CICDTableOffset As Integer
Dim CORETableOffset As Integer
Dim MMGTTableOffset As Integer
Dim EBCOMTableOffset As Integer
Dim IOTableOffset As Integer
Dim MEMTableOffset As Integer
Dim RTETableOffset As Integer
Dim SYSTEMTableOffset As Integer
Dim COMGWTableOffset As Integer
Dim TempCell As String
CICDTableOffset = 0
CORETableOffset = 5
MMGTTableOffset = 10
EBCOMTableOffset = 15
IOTableOffset = 20
MEMTableOffset = 25
RTETableOffset = 30
SYSTEMTableOffset = 35
COMGWTableOffset = 40
TempCell = ColumnName & "2"
Sheetname.Range(TempCell).Value = Build_Warnings_Functionality(Sheetname, Sheetname.Range("A2"))
Call Build_Warnings_Module(Sheetname, TableRange, CICDTableOffset)
TempCell = ColumnName & "7"
Sheetname.Range(TempCell).Value = Build_Warnings_Functionality(Sheetname, Sheetname.Range("A7"))
Call Build_Warnings_Module(Sheetname, TableRange, CORETableOffset)
TempCell = ColumnName & "12"
Sheetname.Range(TempCell).Value = Build_Warnings_Functionality(Sheetname, Sheetname.Range("A12"))
Call Build_Warnings_Module(Sheetname, TableRange, MMGTTableOffset)
TempCell = ColumnName & "17"
Sheetname.Range(TempCell).Value = Build_Warnings_Functionality(Sheetname, Sheetname.Range("A17"))
Call Build_Warnings_Module(Sheetname, TableRange, EBCOMTableOffset)
TempCell = ColumnName & "22"
Sheetname.Range(TempCell).Value = Build_Warnings_Functionality(Sheetname, Sheetname.Range("A22"))
Call Build_Warnings_Module(Sheetname, TableRange, IOTableOffset)
TempCell = ColumnName & "27"
Sheetname.Range(TempCell).Value = Build_Warnings_Functionality(Sheetname, Sheetname.Range("A27"))
Call Build_Warnings_Module(Sheetname, TableRange, MEMTableOffset)
TempCell = ColumnName & "32"
Sheetname.Range(TempCell).Value = Build_Warnings_Functionality(Sheetname, Sheetname.Range("A32"))
Call Build_Warnings_Module(Sheetname, TableRange, RTETableOffset)
TempCell = ColumnName & "37"
Sheetname.Range(TempCell).Value = Build_Warnings_Functionality(Sheetname, Sheetname.Range("A37"))
Call Build_Warnings_Module(Sheetname, TableRange, SYSTEMTableOffset)
TempCell = ColumnName & "42"
Sheetname.Range(TempCell).Value = Build_Warnings_Functionality(Sheetname, Sheetname.Range("A42"))
Call Build_Warnings_Module(Sheetname, TableRange, COMGWTableOffset)
TempCell = ColumnName & "49"
Sheetname.Range(TempCell).Value = Build_Warnings_Functionality_Only(Sheetname, Sheetname.Range("A49"))
TempCell = ColumnName & "50"
Sheetname.Range(TempCell).Value = Build_Warnings_Functionality_Only(Sheetname, Sheetname.Range("A50"))
TempCell = ColumnName & "51"
Sheetname.Range(TempCell).Value = Build_Warnings_Functionality_Only(Sheetname, Sheetname.Range("A51"))
Call Build_Warnings_Total_All(Sheetname, TableRange)
End Sub
Sub CalculateBuildWarnings_BCM2M()
'Select the workbook to filter
Dim QReport As Workbook
Dim WorkbookPath As String
WorkbookPath = Sheet7.Range("A66")
Set QReport = Workbooks.Open(WorkbookPath, True, True)
Dim FileName As String
Dim TableRange As String
Dim ColumnName As String
FileName = "Warnings_BCM_2M"
TableRange = Sheet7.Range("A62")
ColumnName = Sheet7.Range("A64")
Call CalculateBuildWarnings(Sheet7, TableRange, ColumnName)
Application.Goto Sheet7.Range("N1"), False
Call DrawChart(Sheet7, FileName, ColumnName)
QReport.Close False
End Sub
Sub CalculateBuildWarnings_BCM4M()
'Select the workbook to filter
Dim QReport As Workbook
Dim WorkbookPath As String
WorkbookPath = Sheet8.Range("A66")
Set QReport = Workbooks.Open(WorkbookPath, True, True)
Dim FileName As String
Dim TableRange As String
Dim ColumnName As String
FileName = "Warnings_BCM_4M"
TableRange = Sheet8.Range("A62")
ColumnName = Sheet8.Range("A64")
Call CalculateBuildWarnings(Sheet8, TableRange, ColumnName)
Application.Goto Sheet8.Range("Z1"), False
Call DrawChart(Sheet8, FileName, ColumnName)
QReport.Close False
End Sub
Sub CalculateBuildWarnings_BCM10M()
'Select the workbook to filter
Dim QReport As Workbook
Dim WorkbookPath As String
WorkbookPath = Sheet14.Range("A66")
Set QReport = Workbooks.Open(WorkbookPath, True, True)
Dim FileName As String
Dim TableRange As String
Dim ColumnName As String
FileName = "Warnings_BCM_10M"
TableRange = Sheet14.Range("A62")
ColumnName = Sheet14.Range("A64")
Call CalculateBuildWarnings(Sheet14, TableRange, ColumnName)
Application.Goto Sheet14.Range("Z1"), False
Call DrawChart(Sheet14, FileName, ColumnName)
QReport.Close False
End Sub
Sub CalculateBuildWarnings_COMGW2M()
'Select the workbook to filter
Dim QReport As Workbook
Dim WorkbookPath As String
WorkbookPath = Sheet9.Range("A66")
Set QReport = Workbooks.Open(WorkbookPath, True, True)
Dim FileName As String
Dim TableRange As String
Dim ColumnName As String
FileName = "Warnings_COMGW_2M"
TableRange = Sheet9.Range("A62")
ColumnName = Sheet9.Range("A64")
Call CalculateBuildWarnings(Sheet9, TableRange, ColumnName)
Application.Goto Sheet9.Range("N1"), False
Call DrawChart(Sheet9, FileName, ColumnName)
QReport.Close False
End Sub
Sub CalculateBuildWarnings_COMGW4M()
'Select the workbook to filter
Dim QReport As Workbook
Dim WorkbookPath As String
WorkbookPath = Sheet10.Range("A66")
Set QReport = Workbooks.Open(WorkbookPath, True, True)
Dim FileName As String
Dim TableRange As String
Dim ColumnName As String
FileName = "Warnings_COMGW_4M"
TableRange = Sheet10.Range("A62")
ColumnName = Sheet10.Range("A64")
Call CalculateBuildWarnings(Sheet10, TableRange, ColumnName)
Application.Goto Sheet10.Range("Z1"), False
Call DrawChart(Sheet10, FileName, ColumnName)
QReport.Close False
End Sub
Sub CalculateBuildWarnings_COMGW6M()
'Select the workbook to filter
Dim QReport As Workbook
Dim WorkbookPath As String
WorkbookPath = Sheet11.Range("A66")
Set QReport = Workbooks.Open(WorkbookPath, True, True)
Dim FileName As String
Dim TableRange As String
Dim ColumnName As String
FileName = "Warnings_COMGW_6M"
TableRange = Sheet11.Range("A62")
ColumnName = Sheet11.Range("A64")
Call CalculateBuildWarnings(Sheet11, TableRange, ColumnName)
Application.Goto Sheet11.Range("Z1"), False
Call DrawChart(Sheet11, FileName, ColumnName)
QReport.Close False
End Sub
Sub CalculateBuildWarnings_COMGW10M()
'Select the workbook to filter
Dim QReport As Workbook
Dim WorkbookPath As String
WorkbookPath = Sheet12.Range("A66")
Set QReport = Workbooks.Open(WorkbookPath, True, True)
Dim FileName As String
Dim TableRange As String
Dim ColumnName As String
FileName = "Warnings_COMGW_10M"
TableRange = Sheet12.Range("A62")
ColumnName = Sheet12.Range("A64")
Call CalculateBuildWarnings(Sheet12, TableRange, ColumnName)
Application.Goto Sheet12.Range("N1"), False
Call DrawChart(Sheet12, FileName, ColumnName)
QReport.Close False
End Sub