Java Code Examples for com.grarak.kerneladiutor.utils.Utils#stringToLong()

The following examples show how to use com.grarak.kerneladiutor.utils.Utils#stringToLong() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Screen.java    From KA27 with Apache License 2.0 6 votes vote down vote up
public static List < String > getColorCalibration() {
    List < String > list = new ArrayList < > ();
    if (SCREEN_CALIBRATION != null) {
        if (SCREEN_CALIBRATION.equals(SCREEN_SAMOLED_COLOR_RED)) {
            long red = Utils.stringToLong(Utils.readFile(SCREEN_SAMOLED_COLOR_RED));
            long green = Utils.stringToLong(Utils.readFile(SCREEN_SAMOLED_COLOR_GREEN));
            long blue = Utils.stringToLong(Utils.readFile(SCREEN_SAMOLED_COLOR_BLUE));
            list.add(String.valueOf(red / 10000000));
            list.add(String.valueOf(green / 10000000));
            list.add(String.valueOf(blue / 10000000));
        } else {
            String value = Utils.readFile(SCREEN_CALIBRATION);
            if (value != null) {
                for (String color: value.split(" ")) {
                    if (SCREEN_CALIBRATION.equals(SCREEN_COLOR_CONTROL))
                        list.add(String.valueOf(Utils.stringToLong(color) / 10000000));
                    else list.add(color);
                }
            }
        }
    }
    return list;
}
 
Example 2
Source File: Screen.java    From kernel_adiutor with Apache License 2.0 6 votes vote down vote up
public static List<String> getColorCalibration() {
    List<String> list = new ArrayList<>();
    if (SCREEN_CALIBRATION != null) {
        if (SCREEN_CALIBRATION.equals(SCREEN_SAMOLED_COLOR_RED)) {
            long red = Utils.stringToLong(Utils.readFile(SCREEN_SAMOLED_COLOR_RED));
            long green = Utils.stringToLong(Utils.readFile(SCREEN_SAMOLED_COLOR_GREEN));
            long blue = Utils.stringToLong(Utils.readFile(SCREEN_SAMOLED_COLOR_BLUE));
            list.add(String.valueOf(red / 10000000));
            list.add(String.valueOf(green / 10000000));
            list.add(String.valueOf(blue / 10000000));
        } else {
            String value = Utils.readFile(SCREEN_CALIBRATION);
            if (value != null) {
                for (String color : value.split(" ")) {
                    if (SCREEN_CALIBRATION.equals(SCREEN_COLOR_CONTROL))
                        list.add(String.valueOf(Utils.stringToLong(color) / 10000000));
                    else list.add(color);
                }
            }
        }
    }
    return list;
}
 
Example 3
Source File: CPU.java    From KA27 with Apache License 2.0 5 votes vote down vote up
public Usage(String stats) {
    if (stats == null) return;

    String[] values = stats.replace("  ", " ").split(" ");
    this.stats = new long[values.length - 1];
    for (int i = 0; i < this.stats.length; i++)
        this.stats[i] = Utils.stringToLong(values[i + 1]);
}
 
Example 4
Source File: CPU.java    From kernel_adiutor with Apache License 2.0 5 votes vote down vote up
public Usage(String stats) {
    if (stats == null) return;

    String[] values = stats.replace("  ", " ").split(" ");
    this.stats = new long[values.length - 1];
    for (int i = 0; i < this.stats.length; i++)
        this.stats[i] = Utils.stringToLong(values[i + 1]);
}
 
Example 5
Source File: CPU.java    From KA27 with Apache License 2.0 4 votes vote down vote up
public static String getTemp() {
    double temp = Utils.stringToLong(Utils.readFile(TEMP_FILE));
    if (temp > 1000) temp /= 1000;
    else if (temp > 200) temp /= 10;
    return Utils.formatCelsius(temp) + " " + Utils.celsiusToFahrenheit(temp);
}
 
Example 6
Source File: CPU.java    From kernel_adiutor with Apache License 2.0 4 votes vote down vote up
public static String getTemp() {
    double temp = Utils.stringToLong(Utils.readFile(TEMP_FILE));
    if (temp > 1000) temp /= 1000;
    else if (temp > 200) temp /= 10;
    return Utils.formatCelsius(temp) + " " + Utils.celsiusToFahrenheit(temp);
}