45 lines
786 B
C++
45 lines
786 B
C++
|
#include "lightmux.h"
|
||
|
|
||
|
LightMux::LightMux()
|
||
|
{
|
||
|
temperatur = warmest_temperature;
|
||
|
brightness = 0;
|
||
|
}
|
||
|
|
||
|
|
||
|
void LightMux::decBrightness(){
|
||
|
brightness--;
|
||
|
if(brightness < 0){
|
||
|
brightness = 0;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
void LightMux::incBrightness(){
|
||
|
brightness++;
|
||
|
if(brightness > 100){
|
||
|
brightness = 100;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
void LightMux::warm_Temperature(){
|
||
|
temperatur = temperatur - steps_temperature;
|
||
|
if(temperatur < warmest_temperature){
|
||
|
temperatur = warmest_temperature;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
void LightMux::cold_Temperature(){
|
||
|
temperatur = temperatur + steps_temperature;
|
||
|
if(temperatur > coldest_temperature){
|
||
|
temperatur = coldest_temperature;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
int LightMux::getBrightness(){
|
||
|
return brightness;
|
||
|
}
|
||
|
|
||
|
int LightMux::getTemperature(){
|
||
|
return temperatur;
|
||
|
}
|