OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2016 The WebRTC project authors. All Rights Reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 15 matching lines...) Expand all Loading... | |
26 // ./event_log_visualizer event_log160330.dump | python | 26 // ./event_log_visualizer event_log160330.dump | python |
27 | 27 |
28 if (!series_list_.empty()) { | 28 if (!series_list_.empty()) { |
29 printf("color_count = %zu\n", series_list_.size()); | 29 printf("color_count = %zu\n", series_list_.size()); |
30 printf( | 30 printf( |
31 "hls_colors = [(i*1.0/color_count, 0.25+i*0.5/color_count, 0.8) for i " | 31 "hls_colors = [(i*1.0/color_count, 0.25+i*0.5/color_count, 0.8) for i " |
32 "in range(color_count)]\n"); | 32 "in range(color_count)]\n"); |
33 printf("rgb_colors = [colorsys.hls_to_rgb(*hls) for hls in hls_colors]\n"); | 33 printf("rgb_colors = [colorsys.hls_to_rgb(*hls) for hls in hls_colors]\n"); |
34 | 34 |
35 for (size_t i = 0; i < series_list_.size(); i++) { | 35 for (size_t i = 0; i < series_list_.size(); i++) { |
36 printf("\n# === Series: %s ===\n", series_list_[i].label.c_str()); | |
philipel
2017/04/18 12:54:24
Makes it easier to debug the generated python code
| |
36 // List x coordinates | 37 // List x coordinates |
37 printf("x%zu = [", i); | 38 printf("x%zu = [", i); |
38 if (series_list_[i].points.size() > 0) | 39 if (series_list_[i].points.size() > 0) |
39 printf("%G", series_list_[i].points[0].x); | 40 printf("%G", series_list_[i].points[0].x); |
40 for (size_t j = 1; j < series_list_[i].points.size(); j++) | 41 for (size_t j = 1; j < series_list_[i].points.size(); j++) |
41 printf(", %G", series_list_[i].points[j].x); | 42 printf(", %G", series_list_[i].points[j].x); |
42 printf("]\n"); | 43 printf("]\n"); |
43 | 44 |
44 // List y coordinates | 45 // List y coordinates |
45 printf("y%zu = [", i); | 46 printf("y%zu = [", i); |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
111 } | 112 } |
112 | 113 |
113 Plot* PythonPlotCollection::AppendNewPlot() { | 114 Plot* PythonPlotCollection::AppendNewPlot() { |
114 Plot* plot = new PythonPlot(); | 115 Plot* plot = new PythonPlot(); |
115 plots_.push_back(std::unique_ptr<Plot>(plot)); | 116 plots_.push_back(std::unique_ptr<Plot>(plot)); |
116 return plot; | 117 return plot; |
117 } | 118 } |
118 | 119 |
119 } // namespace plotting | 120 } // namespace plotting |
120 } // namespace webrtc | 121 } // namespace webrtc |
OLD | NEW |