fan param

pull/724/head
FlightlessMango 2 years ago
parent 425b98ae9a
commit 65e70c9cfb

@ -925,6 +925,19 @@ void HudElements::framecount(){
}
}
void HudElements::fan(){
if (HUDElements.params->enabled[OVERLAY_PARAM_ENABLED_fan] && fan_speed != -1) {
ImGui::TableNextRow(); ImGui::TableNextColumn();
ImGui::TextColored(HUDElements.colors.engine, "%s", "FAN");
ImGui::TableNextColumn();
right_aligned_text(HUDElements.colors.text,HUDElements.ralign_width, "%i", fan_speed);
ImGui::SameLine(0, 1.0f);
ImGui::PushFont(HUDElements.sw_stats->font1);
ImGui::Text("RPM");
ImGui::PopFont();
}
}
void HudElements::graphs(){
ImGui::TableNextRow(); ImGui::TableNextColumn();
ImGui::Dummy(ImVec2(0.0f, real_font_size.y));
@ -1080,6 +1093,7 @@ void HudElements::sort_elements(const std::pair<std::string, std::string>& optio
if (param == "debug") { ordered_functions.push_back({gamescope_frame_timing, value}); }
if (param == "gamepad_battery") { ordered_functions.push_back({gamepad_battery, value}); }
if (param == "framecount") { ordered_functions.push_back({framecount, value}); }
if (param == "fan") { ordered_functions.push_back({gamescope_fsr, value}); }
if (param == "graphs"){
if (!HUDElements.params->enabled[OVERLAY_PARAM_ENABLED_graphs])
HUDElements.params->enabled[OVERLAY_PARAM_ENABLED_graphs] = true;
@ -1110,6 +1124,7 @@ void HudElements::legacy_elements(){
ordered_functions.push_back({vram, value});
ordered_functions.push_back({ram, value});
ordered_functions.push_back({battery, value});
ordered_functions.push_back({fan, value});
ordered_functions.push_back({gamescope_fsr, value});
ordered_functions.push_back({fps, value});
ordered_functions.push_back({fps_only, value});

@ -63,6 +63,7 @@ class HudElements{
static void gamescope_frame_timing();
static void gamepad_battery();
static void framecount();
static void fan();
void convert_colors(const struct overlay_params& params);
void convert_colors(bool do_conv, const struct overlay_params& params);

@ -47,6 +47,7 @@ double min_frametime, max_frametime;
bool gpu_metrics_exists = false;
bool steam_focused = false;
vector<float> frametime_data(200,0.f);
int fan_speed;
void init_spdlog()
{
@ -86,6 +87,7 @@ void FpsLimiter(struct fps_limit& stats){
void update_hw_info(const struct overlay_params& params, uint32_t vendorID)
{
update_fan();
if (params.enabled[OVERLAY_PARAM_ENABLED_cpu_stats] || logger->is_active()) {
cpuStats.UpdateCPUData();
@ -824,3 +826,11 @@ std::string get_device_name(int32_t vendorID, int32_t deviceID)
#endif
return desc;
}
void update_fan(){
// This just handles steam deck fan for now
if (read_line("/sys/class/hwmon/hwmon8/name").find("jupiter") != string::npos)
fan_speed = stoi(read_line("/sys/class/hwmon/hwmon8/fan1_input"));
else
fan_speed = -1;
}

@ -149,6 +149,7 @@ extern std::deque<logData> graph_data;
extern overlay_params *_params;
extern double min_frametime, max_frametime;
extern bool steam_focused;
extern int fan_speed;
void init_spdlog();
void position_layer(struct swapchain_stats& data, const struct overlay_params& params, const ImVec2& window_size);
@ -173,6 +174,7 @@ extern void process_control_socket(struct instance_data *instance_data);
#ifdef HAVE_DBUS
void render_mpris_metadata(const overlay_params& params, mutexed_metadata& meta, uint64_t frame_timing);
#endif
void update_fan();
#endif //MANGOAPP_LAYER
#endif //MANGOHUD_OVERLAY_H

@ -81,6 +81,7 @@ typedef unsigned long KeySym;
OVERLAY_PARAM_BOOL(gamepad_battery) \
OVERLAY_PARAM_BOOL(gamepad_battery_icon) \
OVERLAY_PARAM_BOOL(hide_fsr_sharpness) \
OVERLAY_PARAM_BOOL(fan) \
OVERLAY_PARAM_CUSTOM(fps_sampling_period) \
OVERLAY_PARAM_CUSTOM(output_folder) \
OVERLAY_PARAM_CUSTOM(output_file) \

Loading…
Cancel
Save