Properly expose trailing edge devices in python bindings
Showing 2 of 11 files from the diff.
Newly tracked file
src/control_devices/CCPACSTrailingEdgeDevices.cpp
created.
Newly tracked file
src/control_devices/CCPACSTrailingEdgeDevices.h
created.
Other files ignored by Codecov
src/generated/CPACSTrailingEdgeDevices.cpp
has changed.
src/generated/CPACSTrailingEdgeDevice.cpp
has changed.
src/generated/CPACSTrailingEdgeDevice.h
has changed.
cpacs_gen_input/CustomTypes.txt
has changed.
tests/unittests/tiglControlSurfaceDevice.cpp
has changed.
src/generated/CPACSTrailingEdgeDevices.h
has changed.
bindings/python_internal/configuration.i
has changed.
src/generated/CPACSControlSurfaces.h
has changed.
src/generated/CPACSControlSurfaces.cpp
has changed.
@@ -0,0 +1,68 @@
Loading
1 | + | /* |
|
2 | + | * Copyright (C) 2007-2021 German Aerospace Center (DLR/SC) |
|
3 | + | * |
|
4 | + | * Created: 2021-02-05 Jan Kleinert <Jan.Kleinert@dlr.de> |
|
5 | + | * |
|
6 | + | * Licensed under the Apache License, Version 2.0 (the "License"); |
|
7 | + | * you may not use this file except in compliance with the License. |
|
8 | + | * You may obtain a copy of the License at |
|
9 | + | * |
|
10 | + | * http://www.apache.org/licenses/LICENSE-2.0 |
|
11 | + | * |
|
12 | + | * Unless required by applicable law or agreed to in writing, software |
|
13 | + | * distributed under the License is distributed on an "AS IS" BASIS, |
|
14 | + | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
15 | + | * See the License for the specific language governing permissions and |
|
16 | + | * limitations under the License. |
|
17 | + | */ |
|
18 | + | /** |
|
19 | + | * @file |
|
20 | + | * @brief Implementation of CPACS trailing edge devices |
|
21 | + | */ |
|
22 | + | ||
23 | + | #include "CTiglError.h" |
|
24 | + | #include "CCPACSTrailingEdgeDevice.h" |
|
25 | + | #include "CCPACSTrailingEdgeDevices.h" |
|
26 | + | ||
27 | + | namespace tigl { |
|
28 | + | ||
29 | + | CCPACSTrailingEdgeDevices::CCPACSTrailingEdgeDevices(CCPACSControlSurfaces* parent, CTiglUIDManager* uidMgr) |
|
30 | + | : generated::CPACSTrailingEdgeDevices(parent, uidMgr) {} |
|
31 | + | ||
32 | + | // Returns the total count of trailing edge devices in a configuration |
|
33 | + | int CCPACSTrailingEdgeDevices::GetTrailingEdgeDeviceCount() const |
|
34 | + | { |
|
35 | + | return static_cast<int>(m_trailingEdgeDevices.size()); |
|
36 | + | } |
|
37 | + | ||
38 | + | // Returns the trailing edge device for a given index. |
|
39 | + | CCPACSTrailingEdgeDevice& CCPACSTrailingEdgeDevices::GetTrailingEdgeDevice(int index) const |
|
40 | + | { |
|
41 | + | index --; |
|
42 | + | if (index < 0 || index >= GetTrailingEdgeDeviceCount()) { |
|
43 | + | throw CTiglError("Invalid index in CCPACSTrailingEdgeDevices::GetTrailingEdgeDevice", TIGL_INDEX_ERROR); |
|
44 | + | } |
|
45 | + | return *m_trailingEdgeDevices[index]; |
|
46 | + | } |
|
47 | + | ||
48 | + | // Returns the trailing edge device for a given UID. |
|
49 | + | CCPACSTrailingEdgeDevice& CCPACSTrailingEdgeDevices::GetTrailingEdgeDevice(const std::string& UID) const |
|
50 | + | { |
|
51 | + | return *m_trailingEdgeDevices[GetTrailingEdgeDeviceIndex(UID)-1]; |
|
52 | + | } |
|
53 | + | ||
54 | + | // Returns the trailing edge device index for a given UID. |
|
55 | + | int CCPACSTrailingEdgeDevices::GetTrailingEdgeDeviceIndex(const std::string& UID) const |
|
56 | + | { |
|
57 | + | for (int i=0; i < GetTrailingEdgeDeviceCount(); i++) { |
|
58 | + | const std::string tmpUID(m_trailingEdgeDevices[i]->GetUID()); |
|
59 | + | if (tmpUID == UID) { |
|
60 | + | return i+1; |
|
61 | + | } |
|
62 | + | } |
|
63 | + | ||
64 | + | // UID not there |
|
65 | + | throw CTiglError("Invalid UID in CCPACSTrailingEdgeDevices::GetTrailingEdgeDeviceIndex", TIGL_UID_ERROR); |
|
66 | + | } |
|
67 | + | ||
68 | + | } // namespace tigl |
@@ -0,0 +1,50 @@
Loading
1 | + | /* |
|
2 | + | * Copyright (C) 2007-2021 German Aerospace Center (DLR/SC) |
|
3 | + | * |
|
4 | + | * Created: 2021-02-05 Jan Kleinert <Jan.Kleinert@dlr.de> |
|
5 | + | * |
|
6 | + | * Licensed under the Apache License, Version 2.0 (the "License"); |
|
7 | + | * you may not use this file except in compliance with the License. |
|
8 | + | * You may obtain a copy of the License at |
|
9 | + | * |
|
10 | + | * http://www.apache.org/licenses/LICENSE-2.0 |
|
11 | + | * |
|
12 | + | * Unless required by applicable law or agreed to in writing, software |
|
13 | + | * distributed under the License is distributed on an "AS IS" BASIS, |
|
14 | + | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
|
15 | + | * See the License for the specific language governing permissions and |
|
16 | + | * limitations under the License. |
|
17 | + | */ |
|
18 | + | /** |
|
19 | + | * @file |
|
20 | + | * @brief Implementation of CPACS trailing edge devices |
|
21 | + | */ |
|
22 | + | ||
23 | + | #ifndef CCPACSTRAILINGEDGEDEVICES_H |
|
24 | + | #define CCPACSTRAILINGEDGEDEVICES_H |
|
25 | + | ||
26 | + | #include "generated/CPACSTrailingEdgeDevices.h" |
|
27 | + | ||
28 | + | namespace tigl { |
|
29 | + | ||
30 | + | class CCPACSTrailingEdgeDevices : public generated::CPACSTrailingEdgeDevices |
|
31 | + | { |
|
32 | + | public: |
|
33 | + | TIGL_EXPORT CCPACSTrailingEdgeDevices(CCPACSControlSurfaces* parent, CTiglUIDManager* uidMgr); |
|
34 | + | ||
35 | + | // Returns the total count of trailing edge devices in a configuration |
|
36 | + | TIGL_EXPORT int GetTrailingEdgeDeviceCount() const; |
|
37 | + | ||
38 | + | // Returns the trailing edge device for a given index. |
|
39 | + | TIGL_EXPORT CCPACSTrailingEdgeDevice& GetTrailingEdgeDevice(int index) const; |
|
40 | + | ||
41 | + | // Returns the trailing edge device for a given UID. |
|
42 | + | TIGL_EXPORT CCPACSTrailingEdgeDevice& GetTrailingEdgeDevice(const std::string& UID) const; |
|
43 | + | ||
44 | + | // Returns the trailing edge device index for a given UID. |
|
45 | + | TIGL_EXPORT int GetTrailingEdgeDeviceIndex(const std::string& UID) const; |
|
46 | + | }; |
|
47 | + | ||
48 | + | } // namespace tigl |
|
49 | + | ||
50 | + | #endif |
Files | Coverage |
---|---|
src | 69.70% |
Project Totals (428 files) | 69.70% |
628598172
623130018
626344929
721154351
724644696
728110808
731688837
735016556
737282731
739700909
743337311
641435199
609147170
612654343
616195626
619663284
598128027
601475129
685166009
688774861
678223067
606850483
672195644
674642237
666643937
669890812
659713298
663186539
542235302
540968196
546682125
544414578
553335314
550041415
559809552
556616316
565024162
562859064
591228781
644890273
576857442
573562913
587788312
583313540
634413446
715718634
570347536
567238717
656195376
652790824
718024360
604627793
580161342
585533410
594681393
703584386
630949059
710505721
694181855
648112582
699999318
696491631
637907072
707134524
650429478
681696217
713409868
691920924
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file.
The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files.
The size and color of each slice is representing the number of statements and the coverage, respectively.