Ticket #1027: mythtv-showacpitemperature-revised.patch
File mythtv-showacpitemperature-revised.patch, 1.8 KB (added by , 19 years ago) |
---|
-
mainserver.cpp
3856 3856 QDomElement mInfo = pDoc->createElement("MachineInfo"); 3857 3857 QDomElement storage = pDoc->createElement("Storage" ); 3858 3858 QDomElement load = pDoc->createElement("Load" ); 3859 QDomElement thermal = pDoc->createElement("Thermal" ); 3859 3860 QDomElement guide = pDoc->createElement("Guide" ); 3860 3861 3861 3862 root.appendChild (mInfo ); … … 3884 3885 load.setAttribute("avg3", rgdAverages[2]); 3885 3886 } 3886 3887 3888 // ACPI temperature ----------------- 3889 ifstream inp("/proc/acpi/thermal_zone/THRM/temperature"); 3890 std::string msg, temperature; 3891 3892 if(inp) { 3893 inp >> msg >> temperature; 3894 if(inp) { 3895 temperature += " degrees Celsius"; 3896 3897 // only add element if temperature could be read 3898 mInfo.appendChild(thermal); 3899 thermal.setAttribute("temperature", temperature); 3900 } 3901 } 3902 3887 3903 // Guide Data --------------------- 3888 3904 3889 3905 QDateTime GuideDataThrough; -
httpstatus.cpp
697 697 } 698 698 } 699 699 700 // ACPI temperature ------------------ 701 702 node = info.namedItem( "Thermal" ); 703 704 if (!node.isNull()) 705 { 706 QDomElement e = node.toElement(); 707 708 if (!e.isNull()) 709 { 710 std::string temperature = e.attribute( "temperature" , "0" ); 711 712 os << " Current CPU temperature: " 713 << temperature 714 << ".<br />\r\n"; 715 } 716 } 717 700 718 // Guide Info --------------------- 701 719 702 720 node = info.namedItem( "Guide" );