Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 33a760489e |
4
PKGBUILD
4
PKGBUILD
@@ -1,12 +1,12 @@
|
|||||||
pkgname=fantasize
|
pkgname=fantasize
|
||||||
pkgver=0.1.9
|
pkgver=0.2.0
|
||||||
pkgrel=1
|
pkgrel=1
|
||||||
pkgdesc='C++ fan control for Linux'
|
pkgdesc='C++ fan control for Linux'
|
||||||
url='https://github.com/Tabascl/fantasize.git'
|
url='https://github.com/Tabascl/fantasize.git'
|
||||||
source=("$pkgname-$pkgver.tar.gz::https://github.com/Tabascl/fantasize/archive/refs/tags/v$pkgver.tar.gz")
|
source=("$pkgname-$pkgver.tar.gz::https://github.com/Tabascl/fantasize/archive/refs/tags/v$pkgver.tar.gz")
|
||||||
arch=('x86_64')
|
arch=('x86_64')
|
||||||
license=('GPL3')
|
license=('GPL3')
|
||||||
makedepends=('git' 'cmake' 'nlohmann-json' 'boost' 'cuda')
|
makedepends=('git' 'cmake' 'nlohmann-json' 'boost')
|
||||||
sha256sums=('SKIP')
|
sha256sums=('SKIP')
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
|
|||||||
@@ -10,9 +10,9 @@ find_package(Boost 1.74 COMPONENTS program_options log log_setup date_time REQUI
|
|||||||
add_executable(${PROJECT_NAME}
|
add_executable(${PROJECT_NAME}
|
||||||
src/main.cxx
|
src/main.cxx
|
||||||
src/sensor/LMSensorsFacade.cxx
|
src/sensor/LMSensorsFacade.cxx
|
||||||
src/sensor/GPUSensorsFacade.cxx
|
# src/sensor/GPUSensorsFacade.cxx
|
||||||
src/sensor/Sensor.cxx
|
src/sensor/Sensor.cxx
|
||||||
src/sensor/NvidiaSensor.cxx
|
# src/sensor/NvidiaSensor.cxx
|
||||||
src/sensor/LMSensor.cxx
|
src/sensor/LMSensor.cxx
|
||||||
src/pwm/PWMControl.cxx
|
src/pwm/PWMControl.cxx
|
||||||
src/pwm/PWMControlFacade.cxx
|
src/pwm/PWMControlFacade.cxx
|
||||||
@@ -30,8 +30,10 @@ add_executable(${PROJECT_NAME}
|
|||||||
|
|
||||||
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 20)
|
set_property(TARGET ${PROJECT_NAME} PROPERTY CXX_STANDARD 20)
|
||||||
|
|
||||||
target_include_directories(${PROJECT_NAME} PUBLIC include /opt/cuda)
|
# target_include_directories(${PROJECT_NAME} PUBLIC include /opt/cuda)
|
||||||
target_link_libraries(${PROJECT_NAME} PUBLIC sensors nvidia-ml nlohmann_json::nlohmann_json tbb ${Boost_LIBRARIES})
|
target_include_directories(${PROJECT_NAME} PUBLIC include)
|
||||||
|
# target_link_libraries(${PROJECT_NAME} PUBLIC sensors nvidia-ml nlohmann_json::nlohmann_json tbb ${Boost_LIBRARIES})
|
||||||
|
target_link_libraries(${PROJECT_NAME} PUBLIC sensors nlohmann_json::nlohmann_json tbb ${Boost_LIBRARIES})
|
||||||
|
|
||||||
install(TARGETS ${PROJECT_NAME} DESTINATION usr/local/bin)
|
install(TARGETS ${PROJECT_NAME} DESTINATION usr/local/bin)
|
||||||
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/unit/fantasize.service DESTINATION usr/lib/systemd/system)
|
install(FILES ${CMAKE_CURRENT_SOURCE_DIR}/unit/fantasize.service DESTINATION usr/lib/systemd/system)
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
#include <App.h>
|
#include <App.h>
|
||||||
|
|
||||||
#define PROJECT_VERSION "v0.1.9"
|
#define PROJECT_VERSION "v0.2.0"
|
||||||
|
|
||||||
namespace po = boost::program_options;
|
namespace po = boost::program_options;
|
||||||
namespace logging = boost::log;
|
namespace logging = boost::log;
|
||||||
@@ -29,32 +29,26 @@ App app;
|
|||||||
|
|
||||||
static int doInitialSetup = 0;
|
static int doInitialSetup = 0;
|
||||||
|
|
||||||
void
|
void signal_handler(int s) { app.Shutdown(); }
|
||||||
signal_handler(int s)
|
|
||||||
{
|
|
||||||
app.Shutdown();
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void InitLogging(bool verbose) {
|
||||||
InitLogging(bool verbose)
|
|
||||||
{
|
|
||||||
logging::add_console_log(
|
logging::add_console_log(
|
||||||
std::clog,
|
std::clog,
|
||||||
logging::keywords::format =
|
logging::keywords::format =
|
||||||
(logging::expressions::stream
|
(logging::expressions::stream
|
||||||
<< "["
|
<< "["
|
||||||
<< logging::expressions::format_date_time<boost::posix_time::ptime>(
|
<< logging::expressions::format_date_time<boost::posix_time::ptime>(
|
||||||
"TimeStamp", "%Y-%m-%d %H:%M:%S")
|
"TimeStamp", "%Y-%m-%d %H:%M:%S")
|
||||||
<< "]["
|
<< "]["
|
||||||
<< logging::expressions::format_named_scope(
|
<< logging::expressions::format_named_scope(
|
||||||
"Scope", logging::keywords::format = "%c")
|
"Scope", logging::keywords::format = "%c")
|
||||||
<< "]"
|
<< "]"
|
||||||
<< "[" << logging::trivial::severity << "] "
|
<< "[" << logging::trivial::severity << "] "
|
||||||
<< logging::expressions::smessage));
|
<< logging::expressions::smessage));
|
||||||
|
|
||||||
logging::add_common_attributes();
|
logging::add_common_attributes();
|
||||||
logging::core::get()->add_global_attribute(
|
logging::core::get()->add_global_attribute(
|
||||||
"Scope", logging::attributes::named_scope());
|
"Scope", logging::attributes::named_scope());
|
||||||
|
|
||||||
BOOST_LOG_FUNCTION();
|
BOOST_LOG_FUNCTION();
|
||||||
|
|
||||||
@@ -66,9 +60,7 @@ InitLogging(bool verbose)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
int
|
int main(int argc, char **argv) {
|
||||||
main(int argc, char** argv)
|
|
||||||
{
|
|
||||||
BOOST_LOG_FUNCTION()
|
BOOST_LOG_FUNCTION()
|
||||||
BOOST_LOG_TRIVIAL(info) << "Version: " << PROJECT_VERSION;
|
BOOST_LOG_TRIVIAL(info) << "Version: " << PROJECT_VERSION;
|
||||||
|
|
||||||
@@ -77,8 +69,8 @@ main(int argc, char** argv)
|
|||||||
|
|
||||||
po::options_description desc("Allowed options");
|
po::options_description desc("Allowed options");
|
||||||
desc.add_options()("help,h", "produce help message")(
|
desc.add_options()("help,h", "produce help message")(
|
||||||
"setup,s", po::bool_switch(), "run initial setup")(
|
"setup,s", po::bool_switch(),
|
||||||
"verbose,v", po::bool_switch(), "print debug info");
|
"run initial setup")("verbose,v", po::bool_switch(), "print debug info");
|
||||||
|
|
||||||
po::variables_map vm;
|
po::variables_map vm;
|
||||||
po::store(po::parse_command_line(argc, argv, desc), vm);
|
po::store(po::parse_command_line(argc, argv, desc), vm);
|
||||||
@@ -98,7 +90,7 @@ main(int argc, char** argv)
|
|||||||
app.Init();
|
app.Init();
|
||||||
app.NormalOperation();
|
app.NormalOperation();
|
||||||
}
|
}
|
||||||
} catch (const std::exception& e) {
|
} catch (const std::exception &e) {
|
||||||
std::cout << "An exception was caught: " << e.what() << std::endl;
|
std::cout << "An exception was caught: " << e.what() << std::endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -11,8 +11,9 @@ vector<shared_ptr<Sensor>> SensorManager::TemperatureSensors() {
|
|||||||
|
|
||||||
tempSensors = mLMSensorsFacade->TemperatureSensors();
|
tempSensors = mLMSensorsFacade->TemperatureSensors();
|
||||||
|
|
||||||
auto gpuSensors = mGPUSensorsFacade->TemperatureSensors();
|
// auto gpuSensors = mGPUSensorsFacade->TemperatureSensors();
|
||||||
tempSensors.insert(tempSensors.end(), gpuSensors.begin(), gpuSensors.end());
|
// tempSensors.insert(tempSensors.end(), gpuSensors.begin(),
|
||||||
|
// gpuSensors.end());
|
||||||
|
|
||||||
return tempSensors;
|
return tempSensors;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user