You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
			
				
					25 lines
				
				560 B
			
		
		
			
		
	
	
					25 lines
				
				560 B
			| 
								 
											3 years ago
										 
									 | 
							
								#pragma once
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#include <QPixmap>
							 | 
						||
| 
								 | 
							
								#include <QPointF>
							 | 
						||
| 
								 | 
							
								#include <vector>
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								#include "tools/cabana/dbc/dbcmanager.h"
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								class Sparkline {
							 | 
						||
| 
								 | 
							
								public:
							 | 
						||
| 
								 | 
							
								  void update(const MessageId &msg_id, const cabana::Signal *sig, double last_msg_ts, int range, QSize size);
							 | 
						||
| 
								 | 
							
								  const QSize size() const { return pixmap.size() / pixmap.devicePixelRatio(); }
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								  QPixmap pixmap;
							 | 
						||
| 
								 | 
							
								  double min_val = 0;
							 | 
						||
| 
								 | 
							
								  double max_val = 0;
							 | 
						||
| 
								 | 
							
								  double last_ts = 0;
							 | 
						||
| 
								 | 
							
								  int time_range = 0;
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								private:
							 | 
						||
| 
								 | 
							
								  void render(const QColor &color, QSize size);
							 | 
						||
| 
								 | 
							
								  std::vector<QPointF> values;
							 | 
						||
| 
								 | 
							
								  std::vector<QPointF> points;
							 | 
						||
| 
								 | 
							
								};
							 |