mirror of
				https://github.com/hyperion-project/hyperion.ng.git
				synced 2025-03-01 10:33:28 +00:00 
			
		
		
		
	Remove algo source
This commit is contained in:
		@@ -568,11 +568,11 @@
 | 
			
		||||
    "edt_dev_enum_sub_min_cool_adjust": "Subtract cool white",
 | 
			
		||||
    "edt_dev_enum_sub_min_warm_adjust": "Subtract warm white",
 | 
			
		||||
    "edt_dev_enum_subtract_minimum": "Subtract minimum",
 | 
			
		||||
    "edt_dev_enum_hyperserial_cold_white": "Hyperserial, cold white",
 | 
			
		||||
    "edt_dev_enum_hyperserial_neutral_white": "Hyperserial, neutral white",
 | 
			
		||||
    "edt_dev_enum_wled_auto": "Wled auto",
 | 
			
		||||
    "edt_dev_enum_wled_auto_max": "Wled auto max",
 | 
			
		||||
    "edt_dev_enum_wled_auto_accurate": "Wled auto accurate",
 | 
			
		||||
    "edt_dev_enum_cold_white": "Cold white",
 | 
			
		||||
    "edt_dev_enum_neutral_white": "Neutral white",
 | 
			
		||||
    "edt_dev_enum_auto": "Auto",
 | 
			
		||||
    "edt_dev_enum_auto_max": "Auto max",
 | 
			
		||||
    "edt_dev_enum_auto_accurate": "Auto accurate",
 | 
			
		||||
    "edt_dev_enum_white_off": "White off",
 | 
			
		||||
    "edt_dev_general_autostart_title": "Autostart",
 | 
			
		||||
    "edt_dev_general_autostart_title_info": "The LED device is switched-on during startup or not",
 | 
			
		||||
 
 | 
			
		||||
@@ -12,11 +12,11 @@ namespace RGBW {
 | 
			
		||||
		SUB_MIN_WARM_ADJUST,
 | 
			
		||||
		SUB_MIN_COOL_ADJUST,
 | 
			
		||||
		WHITE_OFF,
 | 
			
		||||
        HYPERSERIAL_COLD_WHITE,
 | 
			
		||||
        HYPERSERIAL_NEUTRAL_WHITE,
 | 
			
		||||
        WLED_AUTO,
 | 
			
		||||
        WLED_AUTO_MAX,
 | 
			
		||||
        WLED_AUTO_ACCURATE
 | 
			
		||||
        COLD_WHITE,
 | 
			
		||||
        NEUTRAL_WHITE,
 | 
			
		||||
        AUTO,
 | 
			
		||||
        AUTO_MAX,
 | 
			
		||||
        AUTO_ACCURATE
 | 
			
		||||
	};
 | 
			
		||||
 | 
			
		||||
	WhiteAlgorithm stringToWhiteAlgorithm(const QString& str);
 | 
			
		||||
 
 | 
			
		||||
@@ -45,11 +45,11 @@
 | 
			
		||||
					"edt_dev_enum_subtract_minimum",
 | 
			
		||||
					"edt_dev_enum_sub_min_cool_adjust",
 | 
			
		||||
					"edt_dev_enum_sub_min_warm_adjust",
 | 
			
		||||
					"edt_dev_enum_hyperserial_cold_white",
 | 
			
		||||
					"edt_dev_enum_hyperserial_neutral_white",
 | 
			
		||||
					"edt_dev_enum_wled_auto",
 | 
			
		||||
					"edt_dev_enum_wled_auto_max",
 | 
			
		||||
					"edt_dev_enum_wled_auto_accurate",
 | 
			
		||||
					"edt_dev_enum_cold_white",
 | 
			
		||||
					"edt_dev_enum_neutral_white",
 | 
			
		||||
					"edt_dev_enum_auto",
 | 
			
		||||
					"edt_dev_enum_auto_max",
 | 
			
		||||
					"edt_dev_enum_auto_accurate",
 | 
			
		||||
					"edt_dev_enum_white_off"
 | 
			
		||||
				]
 | 
			
		||||
			},
 | 
			
		||||
 
 | 
			
		||||
@@ -21,29 +21,26 @@ WhiteAlgorithm stringToWhiteAlgorithm(const QString& str)
 | 
			
		||||
	{
 | 
			
		||||
		return WhiteAlgorithm::SUB_MIN_COOL_ADJUST;
 | 
			
		||||
	}
 | 
			
		||||
    if (str == "hyperserial_cold_white")
 | 
			
		||||
    if (str == "cold_white")
 | 
			
		||||
    {
 | 
			
		||||
        return WhiteAlgorithm::HYPERSERIAL_COLD_WHITE;
 | 
			
		||||
        return WhiteAlgorithm::COLD_WHITE;
 | 
			
		||||
    }
 | 
			
		||||
    if (str == "hyperserial_neutral_white")
 | 
			
		||||
    if (str == "neutral_white")
 | 
			
		||||
    {
 | 
			
		||||
        return WhiteAlgorithm::HYPERSERIAL_NEUTRAL_WHITE;
 | 
			
		||||
        return WhiteAlgorithm::NEUTRAL_WHITE;
 | 
			
		||||
    }
 | 
			
		||||
    if (str == "wled_auto")
 | 
			
		||||
    if (str == "auto")
 | 
			
		||||
    {
 | 
			
		||||
        return WhiteAlgorithm::WLED_AUTO;
 | 
			
		||||
        return WhiteAlgorithm::AUTO;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (str == "wled_auto_max")
 | 
			
		||||
    if (str == "auto_max")
 | 
			
		||||
    {
 | 
			
		||||
        return WhiteAlgorithm::WLED_AUTO_MAX;
 | 
			
		||||
        return WhiteAlgorithm::AUTO_MAX;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (str == "wled_auto_accurate")
 | 
			
		||||
    if (str == "auto_accurate")
 | 
			
		||||
    {
 | 
			
		||||
        return WhiteAlgorithm::WLED_AUTO_ACCURATE;
 | 
			
		||||
        return WhiteAlgorithm::AUTO_ACCURATE;
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    if (str.isEmpty() || str == "white_off")
 | 
			
		||||
	{
 | 
			
		||||
		return WhiteAlgorithm::WHITE_OFF;
 | 
			
		||||
@@ -103,7 +100,7 @@ void Rgb_to_Rgbw(ColorRgb input, ColorRgbw * output, WhiteAlgorithm algorithm)
 | 
			
		||||
			break;
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
        case WhiteAlgorithm::WLED_AUTO_MAX:
 | 
			
		||||
        case WhiteAlgorithm::AUTO_MAX:
 | 
			
		||||
        {
 | 
			
		||||
            output->red = input.red;
 | 
			
		||||
            output->green = input.green;
 | 
			
		||||
@@ -112,7 +109,7 @@ void Rgb_to_Rgbw(ColorRgb input, ColorRgbw * output, WhiteAlgorithm algorithm)
 | 
			
		||||
            break;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        case WhiteAlgorithm::WLED_AUTO_ACCURATE:
 | 
			
		||||
        case WhiteAlgorithm::AUTO_ACCURATE:
 | 
			
		||||
        {
 | 
			
		||||
            output->white = input.red < input.green ? (input.red < input.blue ? input.red : input.blue) : (input.green < input.blue ? input.green : input.blue);
 | 
			
		||||
            output->red = input.red - output->white;
 | 
			
		||||
@@ -121,7 +118,7 @@ void Rgb_to_Rgbw(ColorRgb input, ColorRgbw * output, WhiteAlgorithm algorithm)
 | 
			
		||||
            break;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        case WhiteAlgorithm::WLED_AUTO:
 | 
			
		||||
        case WhiteAlgorithm::AUTO:
 | 
			
		||||
        {
 | 
			
		||||
 | 
			
		||||
            output->red = input.red;
 | 
			
		||||
@@ -130,8 +127,8 @@ void Rgb_to_Rgbw(ColorRgb input, ColorRgbw * output, WhiteAlgorithm algorithm)
 | 
			
		||||
            output->white = input.red < input.green ? (input.red < input.blue ? input.red : input.blue) : (input.green < input.blue ? input.green : input.blue);
 | 
			
		||||
            break;
 | 
			
		||||
        }
 | 
			
		||||
        case WhiteAlgorithm::HYPERSERIAL_NEUTRAL_WHITE:
 | 
			
		||||
        case WhiteAlgorithm::HYPERSERIAL_COLD_WHITE:
 | 
			
		||||
        case WhiteAlgorithm::NEUTRAL_WHITE:
 | 
			
		||||
        case WhiteAlgorithm::COLD_WHITE:
 | 
			
		||||
        {
 | 
			
		||||
            //cold white config
 | 
			
		||||
            uint8_t gain = 0xFF;
 | 
			
		||||
@@ -139,7 +136,7 @@ void Rgb_to_Rgbw(ColorRgb input, ColorRgbw * output, WhiteAlgorithm algorithm)
 | 
			
		||||
            uint8_t green = 0xA0;
 | 
			
		||||
            uint8_t blue = 0xA0;
 | 
			
		||||
 | 
			
		||||
            if (algorithm == WhiteAlgorithm::HYPERSERIAL_NEUTRAL_WHITE) {
 | 
			
		||||
            if (algorithm == WhiteAlgorithm::NEUTRAL_WHITE) {
 | 
			
		||||
                gain = 0xFF;
 | 
			
		||||
                red = 0xB0;
 | 
			
		||||
                green = 0xB0;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user