mirror of
				https://github.com/hyperion-project/hyperion.ng.git
				synced 2025-03-01 10:33:28 +00:00 
			
		
		
		
	No functional changes, but - files have been renamed - the device name is now "file" not "test" Former-commit-id: 3fbc03c3fe1d764654c1d28ebb80562ce6276ab1
		
			
				
	
	
		
			42 lines
		
	
	
		
			817 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			42 lines
		
	
	
		
			817 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| #pragma once
 | |
| 
 | |
| // STL includes0
 | |
| #include <fstream>
 | |
| 
 | |
| // Leddevice includes
 | |
| #include <leddevice/LedDevice.h>
 | |
| 
 | |
| ///
 | |
| /// Implementation of the LedDevice that write the led-colors to an
 | |
| /// ASCII-textfile('/home/pi/LedDevice.out')
 | |
| ///
 | |
| class LedDeviceFile : public LedDevice
 | |
| {
 | |
| public:
 | |
| 	///
 | |
| 	/// Constructs the test-device, which opens an output stream to the file
 | |
| 	///
 | |
| 	LedDeviceFile(const std::string& output);
 | |
| 
 | |
| 	///
 | |
| 	/// Destructor of this test-device
 | |
| 	///
 | |
| 	virtual ~LedDeviceFile();
 | |
| 
 | |
| 	///
 | |
| 	/// Writes the given led-color values to the output stream
 | |
| 	///
 | |
| 	/// @param ledValues The color-value per led
 | |
| 	///
 | |
| 	/// @return Zero on success else negative
 | |
| 	///
 | |
| 	virtual int write(const std::vector<ColorRgb> & ledValues);
 | |
| 
 | |
| 	/// Switch the leds off
 | |
| 	virtual int switchOff();
 | |
| 
 | |
| private:
 | |
| 	/// The outputstream
 | |
| 	std::ofstream _ofs;
 | |
| };
 |