feat: Fans module removed. All features of this module are available in the Sensors module.

This commit is contained in:
Serhiy Mytrovtsiy
2022-02-03 18:32:33 +01:00
parent 755fc3ff67
commit b2dbf41531
8 changed files with 0 additions and 1097 deletions

View File

@@ -1,24 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>$(PRODUCT_BUNDLE_PACKAGE_TYPE)</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>$(CURRENT_PROJECT_VERSION)</string>
<key>NSHumanReadableCopyright</key>
<string>Copyright © 2020 Serhiy Mytrovtsiy. All rights reserved.</string>
</dict>
</plist>

View File

@@ -1,50 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Name</key>
<string>Fans</string>
<key>State</key>
<false/>
<key>Widgets</key>
<dict>
<key>label</key>
<dict>
<key>Default</key>
<false/>
<key>Order</key>
<integer>0</integer>
</dict>
<key>sensors</key>
<dict>
<key>Default</key>
<true/>
<key>Preview</key>
<dict>
<key>Values</key>
<string>2160 RPM,1990 RPM</string>
</dict>
<key>Order</key>
<integer>1</integer>
</dict>
<key>bar_chart</key>
<dict>
<key>Default</key>
<false/>
<key>Preview</key>
<dict>
<key>Value</key>
<string>0.12,0.14</string>
<key>Color</key>
<true/>
</dict>
<key>Unsupported colors</key>
<array>
<string>pressure</string>
</array>
<key>Order</key>
<integer>2</integer>
</dict>
</dict>
</dict>
</plist>

View File

@@ -1,106 +0,0 @@
//
// main.swift
// Fans
//
// Created by Serhiy Mytrovtsiy on 20/10/2020.
// Using Swift 5.0.
// Running on macOS 10.15.
//
// Copyright © 2020 Serhiy Mytrovtsiy. All rights reserved.
//
import Cocoa
import Kit
public struct Fan {
public let id: Int
public let name: String
public let minSpeed: Double
public let maxSpeed: Double
public var value: Double
public var mode: FanMode
var state: Bool {
get {
return Store.shared.bool(key: "fan_\(self.id)", defaultValue: true)
}
}
var formattedValue: String {
get {
return "\(Int(value))"
}
}
}
public class Fans: Module {
private var fansReader: FansReader
private var settingsView: Settings
private let popupView: Popup
public init() {
self.fansReader = FansReader()
self.settingsView = Settings("Fans", list: &self.fansReader.list)
self.popupView = Popup()
super.init(
popup: self.popupView,
settings: self.settingsView
)
guard self.available else { return }
self.popupView.setup(self.fansReader.list)
self.settingsView.callback = { [unowned self] in
self.checkIfNoSensorsEnabled()
self.fansReader.read()
}
self.settingsView.setInterval = { [unowned self] value in
self.fansReader.setInterval(value)
}
self.fansReader.callbackHandler = { [unowned self] value in
self.usageCallback(value)
}
self.fansReader.readyCallback = { [unowned self] in
self.readyHandler()
}
self.addReader(self.fansReader)
}
public override func isAvailable() -> Bool {
return SMC.shared.getValue("FNum") != nil && SMC.shared.getValue("FNum") != 0 && !self.fansReader.list.isEmpty
}
private func checkIfNoSensorsEnabled() {
if self.fansReader.list.filter({ $0.state }).isEmpty {
NotificationCenter.default.post(name: .toggleModule, object: nil, userInfo: ["module": self.config.name, "state": false])
}
}
private func usageCallback(_ raw: [Fan]?) {
guard let value = raw, self.enabled else {
return
}
self.popupView.usageCallback(value)
var list: [KeyValue_t] = []
var flatList: [[ColorValue]] = []
value.forEach { (f: Fan) in
if f.state {
list.append(KeyValue_t(key: "Fan#\(f.id)", value: f.formattedValue))
flatList.append([ColorValue(((f.value*100)/f.maxSpeed)/100)])
}
}
self.widgets.filter{ $0.isActive }.forEach { (w: Widget) in
switch w.item {
case let widget as SensorsWidget: widget.setValues(list)
case let widget as BarChart: widget.setValue(flatList)
default: break
}
}
}
}

View File

@@ -1,526 +0,0 @@
//
// settings.swift
// Fans
//
// Created by Serhiy Mytrovtsiy on 21/10/2020.
// Using Swift 5.0.
// Running on macOS 10.15.
//
// Copyright © 2020 Serhiy Mytrovtsiy. All rights reserved.
//
import Cocoa
import Kit
internal class Popup: NSStackView, Popup_p {
public var sizeCallback: ((NSSize) -> Void)? = nil
private var list: [Int: FanView] = [:]
public init() {
super.init(frame: NSRect(x: 0, y: 0, width: Constants.Popup.width, height: 0))
self.orientation = .vertical
self.spacing = Constants.Popup.margins
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
internal func setup(_ values: [Fan]) {
values.forEach { (f: Fan) in
let view = FanView(f, width: self.frame.width, callback: self.recalculateHeight)
self.list[f.id] = view
self.addArrangedSubview(view)
}
self.recalculateHeight()
}
internal func usageCallback(_ values: [Fan]) {
DispatchQueue.main.async(execute: {
if self.window?.isVisible ?? false {
values.forEach { (f: Fan) in
if self.list[f.id] != nil {
self.list[f.id]?.update(f)
}
}
}
})
}
private func recalculateHeight() {
let h = self.arrangedSubviews.map({ $0.bounds.height + self.spacing }).reduce(0, +) - self.spacing
if self.frame.size.height != h {
self.setFrameSize(NSSize(width: self.frame.width, height: h))
self.sizeCallback?(self.frame.size)
}
}
}
internal class FanView: NSStackView {
public var sizeCallback: (() -> Void)
private var fan: Fan
private var ready: Bool = false
private var valueField: NSTextField? = nil
private var percentageField: NSTextField? = nil
private var sliderValueField: NSTextField? = nil
private var slider: NSSlider? = nil
private var controlView: NSView? = nil
private var modeButtons: ModeButtons? = nil
private var debouncer: DispatchWorkItem? = nil
private var minBtn: NSButton? = nil
private var maxBtn: NSButton? = nil
private var speedState: Bool {
get {
return Store.shared.bool(key: "Fans_speed", defaultValue: false)
}
}
private var speedValue: Int? {
get {
if !Store.shared.exist(key: "fan_\(self.fan.id)_speed") {
return nil
}
return Store.shared.int(key: "fan_\(self.fan.id)_speed", defaultValue: Int(self.fan.minSpeed))
}
set {
if let value = newValue {
Store.shared.set(key: "fan_\(self.fan.id)_speed", value: value)
} else {
Store.shared.remove("fan_\(self.fan.id)_speed")
}
}
}
private var speed: Double {
get {
if let v = self.speedValue, self.speedState {
return Double(v)
}
return self.fan.value
}
}
private var resetModeAfterSleep: Bool = false
public init(_ fan: Fan, width: CGFloat, callback: @escaping (() -> Void)) {
self.fan = fan
self.sizeCallback = callback
let inset: CGFloat = 5
super.init(frame: NSRect(x: 0, y: 0, width: width - (inset*2), height: 0))
self.controlView = self.control()
self.orientation = .vertical
self.alignment = .centerX
self.distribution = .fillProportionally
self.spacing = 0
self.edgeInsets = NSEdgeInsets(top: inset, left: inset, bottom: inset, right: inset)
self.wantsLayer = true
self.layer?.cornerRadius = 2
self.layer?.backgroundColor = NSColor.red.cgColor
self.addArrangedSubview(self.nameAndSpeed())
self.addArrangedSubview(self.keyAndPercentage())
self.addArrangedSubview(self.mode())
if let view = self.controlView, fan.mode == .forced {
self.addArrangedSubview(view)
}
let h = self.arrangedSubviews.map({ $0.bounds.height }).reduce(0, +) + (inset*2)
self.setFrameSize(NSSize(width: self.frame.width, height: h))
self.sizeCallback()
NSWorkspace.shared.notificationCenter.addObserver(self, selector: #selector(self.wakeListener), name: NSWorkspace.didWakeNotification, object: nil)
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
deinit {
NSWorkspace.shared.notificationCenter.removeObserver(self)
}
override func updateLayer() {
self.layer?.backgroundColor = isDarkMode ? NSColor(hexString: "#111111", alpha: 0.25).cgColor : NSColor(hexString: "#f5f5f5", alpha: 1).cgColor
}
private func nameAndSpeed() -> NSView {
let row: NSView = NSView(frame: NSRect(x: 0, y: 0, width: self.frame.width, height: 16))
row.heightAnchor.constraint(equalToConstant: row.bounds.height).isActive = true
let valueWidth: CGFloat = 80
let nameField: NSTextField = TextView(frame: NSRect(
x: 0,
y: 0,
width: row.frame.width - valueWidth,
height: row.frame.height
))
nameField.stringValue = self.fan.name
nameField.cell?.truncatesLastVisibleLine = true
let valueField: NSTextField = TextView(frame: NSRect(
x: row.frame.width - valueWidth,
y: 0,
width: valueWidth,
height: row.frame.height
))
valueField.font = NSFont.systemFont(ofSize: 13, weight: .regular)
valueField.stringValue = self.fan.formattedValue
valueField.alignment = .right
row.addSubview(nameField)
row.addSubview(valueField)
self.valueField = valueField
return row
}
private func keyAndPercentage() -> NSView {
let row: NSView = NSView(frame: NSRect(x: 0, y: 0, width: self.frame.width, height: 14))
row.heightAnchor.constraint(equalToConstant: row.bounds.height).isActive = true
let value = self.fan.value
var percentage = ""
if value != 1 && self.fan.maxSpeed != 1 {
percentage = "\((100*Int(value)) / Int(self.fan.maxSpeed))%"
}
let percentageWidth: CGFloat = 40
let keyField: NSTextField = TextView(frame: NSRect(
x: 0,
y: 0,
width: row.frame.width - percentageWidth,
height: row.frame.height
))
keyField.font = NSFont.systemFont(ofSize: 11, weight: .light)
keyField.textColor = .secondaryLabelColor
keyField.stringValue = "Fan #\(self.fan.id)"
keyField.alignment = .left
let percentageField: NSTextField = TextView(frame: NSRect(
x: row.frame.width - percentageWidth,
y: 0,
width: percentageWidth,
height: row.frame.height
))
percentageField.font = NSFont.systemFont(ofSize: 11, weight: .light)
percentageField.textColor = .secondaryLabelColor
percentageField.stringValue = percentage
percentageField.alignment = .right
row.addSubview(keyField)
row.addSubview(percentageField)
self.percentageField = percentageField
return row
}
private func mode() -> NSView {
let view: NSView = NSView(frame: NSRect(x: 0, y: 0, width: self.frame.width, height: 30))
view.heightAnchor.constraint(equalToConstant: view.bounds.height).isActive = true
let buttons = ModeButtons(frame: NSRect(
x: 0,
y: 4,
width: view.frame.width,
height: view.frame.height - 8
), mode: self.fan.mode)
buttons.callback = { [weak self] (mode: FanMode) in
if let fan = self?.fan, fan.mode != mode {
self?.fan.mode = mode
SMCHelper.shared.setFanMode(fan.id, mode: mode.rawValue)
}
self?.toggleControlView(mode == .forced)
}
buttons.turbo = { [weak self] in
if let fan = self?.fan {
if self?.fan.mode != .forced {
self?.fan.mode = .forced
SMCHelper.shared.setFanMode(fan.id, mode: FanMode.forced.rawValue)
}
SMCHelper.shared.setFanSpeed(fan.id, speed: Int(fan.maxSpeed))
}
self?.toggleControlView(false)
}
view.addSubview(buttons)
self.modeButtons = buttons
return view
}
private func control() -> NSView {
let view: NSView = NSView(frame: NSRect(x: 0, y: 0, width: self.frame.width, height: 46))
view.identifier = NSUserInterfaceItemIdentifier(rawValue: "control")
view.heightAnchor.constraint(equalToConstant: view.bounds.height).isActive = true
let controls: NSStackView = NSStackView(frame: NSRect(x: 0, y: 14, width: view.frame.width, height: 30))
controls.orientation = .horizontal
controls.spacing = 0
let slider: NSSlider = NSSlider(frame: NSRect(x: 0, y: 0, width: view.frame.width, height: 26))
slider.minValue = self.fan.minSpeed
slider.maxValue = self.fan.maxSpeed
slider.doubleValue = self.speed
slider.isContinuous = true
slider.action = #selector(self.sliderCallback)
slider.target = self
let levels: NSView = NSView(frame: NSRect(x: 0, y: 0, width: view.frame.width, height: 16))
let minBtn: NSButton = NSButton(frame: NSRect(x: 0, y: 0, width: 50, height: levels.frame.height))
minBtn.title = "\(Int(self.fan.minSpeed))"
minBtn.toolTip = localizedString("Min")
minBtn.setButtonType(.toggle)
minBtn.isBordered = false
minBtn.target = self
minBtn.state = .off
minBtn.action = #selector(self.setMin)
minBtn.wantsLayer = true
minBtn.layer?.cornerRadius = 3
minBtn.layer?.borderWidth = 1
minBtn.layer?.borderColor = NSColor.lightGray.cgColor
let valueField: NSTextField = TextView(frame: NSRect(x: 80, y: 0, width: levels.frame.width - 160, height: levels.frame.height))
valueField.font = NSFont.systemFont(ofSize: 11, weight: .light)
valueField.textColor = .secondaryLabelColor
valueField.alignment = .center
let maxBtn: NSButton = NSButton(frame: NSRect(x: levels.frame.width - 50, y: 0, width: 50, height: levels.frame.height))
maxBtn.title = "\(Int(self.fan.maxSpeed))"
maxBtn.toolTip = localizedString("Max")
maxBtn.setButtonType(.toggle)
maxBtn.isBordered = false
maxBtn.target = self
maxBtn.state = .off
maxBtn.wantsLayer = true
maxBtn.action = #selector(self.setMax)
maxBtn.layer?.cornerRadius = 3
maxBtn.layer?.borderWidth = 1
maxBtn.layer?.borderColor = NSColor.lightGray.cgColor
controls.addArrangedSubview(slider)
levels.addSubview(minBtn)
levels.addSubview(valueField)
levels.addSubview(maxBtn)
view.addSubview(controls)
view.addSubview(levels)
self.slider = slider
self.sliderValueField = valueField
self.minBtn = minBtn
self.maxBtn = maxBtn
return view
}
private func toggleControlView(_ state: Bool) {
guard let view = self.controlView else {
return
}
if state {
self.slider?.doubleValue = self.speed
if self.speedState {
self.setSpeed(value: Int(self.speed), then: {
DispatchQueue.main.async {
self.sliderValueField?.textColor = .systemBlue
}
})
}
self.addArrangedSubview(view)
} else {
self.sliderValueField?.stringValue = ""
self.sliderValueField?.textColor = .secondaryLabelColor
self.minBtn?.state = .off
self.maxBtn?.state = .off
view.removeFromSuperview()
}
let h = self.arrangedSubviews.map({ $0.bounds.height }).reduce(0, +) + 10
self.setFrameSize(NSSize(width: self.frame.width, height: h))
self.sizeCallback()
}
private func setSpeed(value: Int, then: @escaping () -> Void = {}) {
self.sliderValueField?.stringValue = "\(value) RPM"
self.sliderValueField?.textColor = .secondaryLabelColor
self.speedValue = value
self.debouncer?.cancel()
let task = DispatchWorkItem { [weak self] in
DispatchQueue.global(qos: .userInteractive).async { [weak self] in
if let id = self?.fan.id {
SMCHelper.shared.setFanSpeed(id, speed: value)
}
then()
}
}
self.debouncer = task
DispatchQueue.main.asyncAfter(deadline: DispatchTime.now() + 0.3, execute: task)
}
@objc private func sliderCallback(_ sender: NSSlider) {
let value = sender.doubleValue
self.minBtn?.state = .off
self.maxBtn?.state = .off
self.setSpeed(value: Int(value), then: {
DispatchQueue.main.async {
self.sliderValueField?.textColor = .systemBlue
}
})
}
@objc func setMin(_ sender: NSButton) {
self.slider?.doubleValue = self.fan.minSpeed
self.maxBtn?.state = .off
self.setSpeed(value: Int(self.fan.minSpeed))
}
@objc func setMax(_ sender: NSButton) {
self.slider?.doubleValue = self.fan.maxSpeed
self.minBtn?.state = .off
self.setSpeed(value: Int(self.fan.maxSpeed))
}
@objc private func wakeListener(aNotification: NSNotification) {
self.resetModeAfterSleep = true
}
public func update(_ value: Fan) {
DispatchQueue.main.async(execute: {
if (self.window?.isVisible ?? false) || !self.ready {
self.fan.value = value.value
var percentage = ""
if value.value != 1 && self.fan.maxSpeed != 1 {
percentage = "\((100*Int(value.value)) / Int(self.fan.maxSpeed))%"
}
self.percentageField?.stringValue = percentage
self.valueField?.stringValue = value.formattedValue
if self.resetModeAfterSleep && value.mode != .automatic {
if self.sliderValueField?.stringValue != "" && self.slider?.doubleValue != value.value {
self.slider?.doubleValue = value.value
self.sliderValueField?.stringValue = ""
}
self.modeButtons?.setManualMode()
self.resetModeAfterSleep = false
}
self.ready = true
}
})
}
}
private class ModeButtons: NSStackView {
public var callback: (FanMode) -> Void = {_ in }
public var turbo: () -> Void = {}
private var autoBtn: NSButton = NSButton(title: localizedString("Automatic"), target: nil, action: #selector(autoMode))
private var manualBtn: NSButton = NSButton(title: localizedString("Manual"), target: nil, action: #selector(manualMode))
private var turboBtn: NSButton = NSButton(image: NSImage(named: NSImage.Name("ac_unit"))!, target: nil, action: #selector(turboMode))
public init(frame: NSRect, mode: FanMode) {
super.init(frame: frame)
self.orientation = .horizontal
self.alignment = .centerY
self.distribution = .fillProportionally
self.spacing = 0
self.wantsLayer = true
self.layer?.cornerRadius = 3
self.layer?.borderWidth = 1
self.layer?.borderColor = NSColor.lightGray.cgColor
let modes: NSStackView = NSStackView(frame: NSRect(x: 0, y: 0, width: self.frame.width, height: self.frame.height))
modes.orientation = .horizontal
modes.alignment = .centerY
modes.distribution = .fillEqually
self.autoBtn.setButtonType(.toggle)
self.autoBtn.isBordered = false
self.autoBtn.target = self
self.autoBtn.state = mode == .automatic ? .on : .off
self.manualBtn.setButtonType(.toggle)
self.manualBtn.isBordered = false
self.manualBtn.target = self
self.manualBtn.state = mode == .forced ? .on : .off
modes.addArrangedSubview(self.autoBtn)
modes.addArrangedSubview(self.manualBtn)
self.turboBtn.setButtonType(.toggle)
self.turboBtn.isBordered = false
self.turboBtn.target = self
NSLayoutConstraint.activate([
self.turboBtn.widthAnchor.constraint(equalToConstant: 26),
self.turboBtn.heightAnchor.constraint(equalToConstant: self.frame.height),
modes.heightAnchor.constraint(equalToConstant: self.frame.height)
])
self.addArrangedSubview(modes)
self.addArrangedSubview(self.turboBtn)
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
@objc private func autoMode(_ sender: NSButton) {
if sender.state.rawValue == 0 {
self.autoBtn.state = .on
return
}
self.manualBtn.state = .off
self.turboBtn.state = .off
self.callback(.automatic)
}
@objc private func manualMode(_ sender: NSButton) {
if sender.state.rawValue == 0 {
self.manualBtn.state = .on
return
}
self.autoBtn.state = .off
self.turboBtn.state = .off
self.callback(.forced)
}
@objc private func turboMode(_ sender: NSButton) {
if sender.state.rawValue == 0 {
self.turboBtn.state = .on
return
}
self.manualBtn.state = .off
self.autoBtn.state = .off
self.turbo()
}
public func setManualMode() {
self.manualBtn.state = .on
self.autoBtn.state = .off
self.turboBtn.state = .off
self.callback(.forced)
}
}

View File

@@ -1,61 +0,0 @@
//
// readers.swift
// Fans
//
// Created by Serhiy Mytrovtsiy on 20/10/2020.
// Using Swift 5.0.
// Running on macOS 10.15.
//
// Copyright © 2020 Serhiy Mytrovtsiy. All rights reserved.
//
import Cocoa
import Kit
internal class FansReader: Reader<[Fan]> {
internal var list: [Fan] = []
init() {
super.init()
guard let count = SMC.shared.getValue("FNum") else {
return
}
debug("Found \(Int(count)) fans", log: self.log)
for i in 0..<Int(count) {
self.list.append(Fan(
id: i,
name: SMC.shared.getStringValue("F\(i)ID") ?? "\(localizedString("Fan")) #\(i)",
minSpeed: SMC.shared.getValue("F\(i)Mn") ?? 1,
maxSpeed: SMC.shared.getValue("F\(i)Mx") ?? 1,
value: SMC.shared.getValue("F\(i)Ac") ?? 0,
mode: self.getFanMode(i)
))
}
}
public override func read() {
for i in 0..<self.list.count {
self.list[i].value = SMC.shared.getValue("F\(self.list[i].id)Ac") ?? 0
}
self.callback(self.list)
}
private func getFanMode(_ id: Int) -> FanMode {
let fansMode: Int = Int(SMC.shared.getValue("FS! ") ?? 0)
var mode: FanMode = .automatic
if fansMode == 0 {
mode = .automatic
} else if fansMode == 3 {
mode = .forced
} else if fansMode == 1 && id == 0 {
mode = .forced
} else if fansMode == 2 && id == 1 {
mode = .forced
}
return mode
}
}

View File

@@ -1,142 +0,0 @@
//
// settings.swift
// Fans
//
// Created by Serhiy Mytrovtsiy on 20/10/2020.
// Using Swift 5.0.
// Running on macOS 10.15.
//
// Copyright © 2020 Serhiy Mytrovtsiy. All rights reserved.
//
import Cocoa
import Kit
internal class Settings: NSStackView, Settings_v {
private var updateIntervalValue: Int = 1
private var speedState: Bool = false
private let title: String
private var button: NSPopUpButton?
private let list: UnsafeMutablePointer<[Fan]>
public var callback: (() -> Void) = {}
public var setInterval: ((_ value: Int) -> Void) = {_ in }
public init(_ title: String, list: UnsafeMutablePointer<[Fan]>) {
self.title = title
self.list = list
super.init(frame: NSRect(x: 0, y: 0, width: 0, height: 0))
self.wantsLayer = true
self.orientation = .vertical
self.distribution = .gravityAreas
self.edgeInsets = NSEdgeInsets(
top: Constants.Settings.margin,
left: Constants.Settings.margin,
bottom: Constants.Settings.margin,
right: Constants.Settings.margin
)
self.spacing = Constants.Settings.margin
self.updateIntervalValue = Store.shared.int(key: "\(self.title)_updateInterval", defaultValue: self.updateIntervalValue)
if Store.shared.exist(key: "\(self.title)_label") {
Store.shared.remove("\(self.title)_label")
}
self.speedState = Store.shared.bool(key: "\(self.title)_speed", defaultValue: self.speedState)
}
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
public func load(widgets: [widget_t]) {
self.subviews.forEach{ $0.removeFromSuperview() }
self.addArrangedSubview(selectSettingsRowV1(
title: localizedString("Update interval"),
action: #selector(changeUpdateInterval),
items: ReaderUpdateIntervals.map{ "\($0) sec" },
selected: "\(self.updateIntervalValue) sec"
))
self.addArrangedSubview(toggleSettingRow(
title: localizedString("Save the fan speed"),
action: #selector(toggleSpeedState),
state: self.speedState
))
let header = NSStackView()
header.heightAnchor.constraint(equalToConstant: Constants.Settings.row).isActive = true
header.spacing = 0
let titleField: NSTextField = LabelField(frame: NSRect(x: 0, y: 0, width: 0, height: 0), localizedString("Fans"))
titleField.font = NSFont.systemFont(ofSize: 13, weight: .medium)
titleField.textColor = .labelColor
header.addArrangedSubview(titleField)
header.addArrangedSubview(NSView())
self.addArrangedSubview(header)
let container = NSStackView()
container.orientation = .vertical
container.edgeInsets = NSEdgeInsets(
top: 0,
left: Constants.Settings.margin,
bottom: 0,
right: Constants.Settings.margin
)
container.spacing = 0
self.list.pointee.forEach { (f: Fan) in
let row: NSView = toggleSettingRow(
title: f.name,
action: #selector(self.handleSelection),
state: f.state
)
row.subviews.filter{ $0 is NSControl }.forEach { (control: NSView) in
control.identifier = NSUserInterfaceItemIdentifier(rawValue: "\(f.id)")
}
container.addArrangedSubview(row)
}
self.addArrangedSubview(container)
}
@objc private func handleSelection(_ sender: NSControl) {
guard let id = sender.identifier else { return }
var state: NSControl.StateValue? = nil
if #available(OSX 10.15, *) {
state = sender is NSSwitch ? (sender as! NSSwitch).state: nil
} else {
state = sender is NSButton ? (sender as! NSButton).state: nil
}
Store.shared.set(key: "fan_\(id.rawValue)", value: state! == NSControl.StateValue.on)
self.callback()
}
@objc private func changeUpdateInterval(_ sender: NSMenuItem) {
if let value = Int(sender.title.replacingOccurrences(of: " sec", with: "")) {
self.updateIntervalValue = value
Store.shared.set(key: "\(self.title)_updateInterval", value: value)
self.setInterval(value)
}
}
@objc private func toggleSpeedState(_ sender: NSControl) {
var state: NSControl.StateValue? = nil
if #available(OSX 10.15, *) {
state = sender is NSSwitch ? (sender as! NSSwitch).state: nil
} else {
state = sender is NSButton ? (sender as! NSButton).state: nil
}
self.speedState = state! == .on ? true : false
Store.shared.set(key: "\(self.title)_speed", value: self.speedState)
self.callback()
}
}

View File

@@ -39,7 +39,6 @@
9A2847D62666AA9C00EC1F6D /* Kit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9A2846F72666A9CC00EC1F6D /* Kit.framework */; };
9A2847DB2666AAA000EC1F6D /* Kit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9A2846F72666A9CC00EC1F6D /* Kit.framework */; };
9A2847E02666AAA400EC1F6D /* Kit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9A2846F72666A9CC00EC1F6D /* Kit.framework */; };
9A2847E52666AAA900EC1F6D /* Kit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9A2846F72666A9CC00EC1F6D /* Kit.framework */; };
9A2848082666AB3000EC1F6D /* updater.sh in Resources */ = {isa = PBXBuildFile; fileRef = 9A2848012666AB2F00EC1F6D /* updater.sh */; };
9A2848092666AB3000EC1F6D /* Store.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A2848022666AB2F00EC1F6D /* Store.swift */; };
9A28480A2666AB3000EC1F6D /* SystemKit.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A2848032666AB2F00EC1F6D /* SystemKit.swift */; };
@@ -59,7 +58,6 @@
9A3E17EA247B07BF00449CD1 /* popup.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A3E17E9247B07BF00449CD1 /* popup.swift */; };
9A46BF36266D6E17001A1117 /* i18n.py in Resources */ = {isa = PBXBuildFile; fileRef = 9A46BF35266D6E17001A1117 /* i18n.py */; };
9A46BF8A266D7D00001A1117 /* smc in CopyFiles */ = {isa = PBXBuildFile; fileRef = 9ADE6FD8265D032100D2FBA8 /* smc */; settings = {ATTRIBUTES = (CodeSignOnCopy, ); }; };
9A46C047266D85DE001A1117 /* smc.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9ADE7038265D059000D2FBA8 /* smc.swift */; };
9A46C05F266D85F8001A1117 /* smc.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9ADE7038265D059000D2FBA8 /* smc.swift */; };
9A46C06B266D8602001A1117 /* smc.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9ADE7038265D059000D2FBA8 /* smc.swift */; };
9A46C077266D8606001A1117 /* smc.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9ADE7038265D059000D2FBA8 /* smc.swift */; };
@@ -70,8 +68,6 @@
9A58DEA424B3647600716A9F /* settings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A58DEA324B3647600716A9F /* settings.swift */; };
9A5A8447271895B700BC40A4 /* Reachability.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A5A8446271895B700BC40A4 /* Reachability.swift */; };
9A5AF11B2469CE9B00684737 /* popup.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A5AF11A2469CE9B00684737 /* popup.swift */; };
9A65654A253F20EF0096B607 /* settings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A656549253F20EF0096B607 /* settings.swift */; };
9A656562253F788A0096B607 /* popup.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A656561253F788A0096B607 /* popup.swift */; };
9A6CFC0122A1C9F5001E782D /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 9A6CFC0022A1C9F5001E782D /* Assets.xcassets */; };
9A6EEBBE2685259500897371 /* Logger.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A6EEBBD2685259500897371 /* Logger.swift */; };
9A81C74D24499C7000825D92 /* AppSettings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A81C74B24499C7000825D92 /* AppSettings.swift */; };
@@ -82,11 +78,6 @@
9A81C76A2449A43600825D92 /* readers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A81C7682449A43600825D92 /* readers.swift */; };
9A8AE0A326921A2A00B13054 /* Server.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A8AE0A226921A2A00B13054 /* Server.swift */; };
9A8B923D2696445C00FD6D83 /* settings.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A8B923C2696445C00FD6D83 /* settings.swift */; };
9A8DE58E253DEFA9006A748F /* Fans.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9A8DE587253DEFA9006A748F /* Fans.framework */; };
9A8DE58F253DEFA9006A748F /* Fans.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9A8DE587253DEFA9006A748F /* Fans.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
9A8DE5E4253DF4E2006A748F /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A8DE5E3253DF4E2006A748F /* main.swift */; };
9A8DE5FC253DF658006A748F /* config.plist in Resources */ = {isa = PBXBuildFile; fileRef = 9A8DE5FB253DF658006A748F /* config.plist */; };
9A8DE609253DF740006A748F /* readers.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A8DE608253DF740006A748F /* readers.swift */; };
9A90E19024EAD2BB00471E9A /* GPU.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 9A90E18924EAD2BB00471E9A /* GPU.framework */; };
9A90E19124EAD2BB00471E9A /* GPU.framework in Embed Frameworks */ = {isa = PBXBuildFile; fileRef = 9A90E18924EAD2BB00471E9A /* GPU.framework */; settings = {ATTRIBUTES = (CodeSignOnCopy, RemoveHeadersOnCopy, ); }; };
9A90E19624EAD35F00471E9A /* main.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9A90E19524EAD35F00471E9A /* main.swift */; };
@@ -207,13 +198,6 @@
remoteGlobalIDString = 9A2846F62666A9CC00EC1F6D;
remoteInfo = Kit;
};
9A2847E72666AAA900EC1F6D /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 9A1410ED229E721100D29793 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 9A2846F62666A9CC00EC1F6D;
remoteInfo = Kit;
};
9A3E17D1247A94AF00449CD1 /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 9A1410ED229E721100D29793 /* Project object */;
@@ -228,13 +212,6 @@
remoteGlobalIDString = 9A81C7552449A41400825D92;
remoteInfo = Memory;
};
9A8DE58C253DEFA9006A748F /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 9A1410ED229E721100D29793 /* Project object */;
proxyType = 1;
remoteGlobalIDString = 9A8DE586253DEFA9006A748F;
remoteInfo = Fans;
};
9A90E18E24EAD2BB00471E9A /* PBXContainerItemProxy */ = {
isa = PBXContainerItemProxy;
containerPortal = 9A1410ED229E721100D29793 /* Project object */;
@@ -296,7 +273,6 @@
9A2846FF2666A9CC00EC1F6D /* Kit.framework in Embed Frameworks */,
9ABFF8FE248BEBCB00C9041A /* Battery.framework in Embed Frameworks */,
9A3E17D4247A94AF00449CD1 /* Net.framework in Embed Frameworks */,
9A8DE58F253DEFA9006A748F /* Fans.framework in Embed Frameworks */,
9A90E19124EAD2BB00471E9A /* GPU.framework in Embed Frameworks */,
9A97CED22537331B00742D8F /* CPU.framework in Embed Frameworks */,
);
@@ -398,8 +374,6 @@
9A5A8446271895B700BC40A4 /* Reachability.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Reachability.swift; sourceTree = "<group>"; };
9A5AF11A2469CE9B00684737 /* popup.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = popup.swift; sourceTree = "<group>"; };
9A5F0503256A9135002FF75F /* nb */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = nb; path = nb.lproj/Localizable.strings; sourceTree = "<group>"; };
9A656549253F20EF0096B607 /* settings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = settings.swift; sourceTree = "<group>"; };
9A656561253F788A0096B607 /* popup.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = popup.swift; sourceTree = "<group>"; };
9A6CFC0022A1C9F5001E782D /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
9A6EEBBD2685259500897371 /* Logger.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Logger.swift; sourceTree = "<group>"; };
9A81C74B24499C7000825D92 /* AppSettings.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AppSettings.swift; sourceTree = "<group>"; };
@@ -410,11 +384,6 @@
9A81C7682449A43600825D92 /* readers.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = readers.swift; sourceTree = "<group>"; };
9A8AE0A226921A2A00B13054 /* Server.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Server.swift; sourceTree = "<group>"; };
9A8B923C2696445C00FD6D83 /* settings.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = settings.swift; sourceTree = "<group>"; };
9A8DE587253DEFA9006A748F /* Fans.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Fans.framework; sourceTree = BUILT_PRODUCTS_DIR; };
9A8DE58A253DEFA9006A748F /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
9A8DE5E3253DF4E2006A748F /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = "<group>"; };
9A8DE5FB253DF658006A748F /* config.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = config.plist; sourceTree = "<group>"; };
9A8DE608253DF740006A748F /* readers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = readers.swift; sourceTree = "<group>"; };
9A90E18924EAD2BB00471E9A /* GPU.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = GPU.framework; sourceTree = BUILT_PRODUCTS_DIR; };
9A90E18C24EAD2BB00471E9A /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
9A90E19524EAD35F00471E9A /* main.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = main.swift; sourceTree = "<group>"; };
@@ -493,7 +462,6 @@
9A11AAD6266FD77F000C1C05 /* Bluetooth.framework in Frameworks */,
9A2846FE2666A9CC00EC1F6D /* Kit.framework in Frameworks */,
9A81C75D2449A41400825D92 /* RAM.framework in Frameworks */,
9A8DE58E253DEFA9006A748F /* Fans.framework in Frameworks */,
9A3E17D3247A94AF00449CD1 /* Net.framework in Frameworks */,
9A90E19024EAD2BB00471E9A /* GPU.framework in Frameworks */,
9A97CED12537331B00742D8F /* CPU.framework in Frameworks */,
@@ -531,14 +499,6 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
9A8DE584253DEFA9006A748F /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
9A2847E52666AAA900EC1F6D /* Kit.framework in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
9A90E18624EAD2BB00471E9A /* Frameworks */ = {
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
@@ -628,7 +588,6 @@
9AE29AD5249A50350071B02D /* Sensors.framework */,
9A90E18924EAD2BB00471E9A /* GPU.framework */,
9A97CECA2537331B00742D8F /* CPU.framework */,
9A8DE587253DEFA9006A748F /* Fans.framework */,
9ADE6FD8265D032100D2FBA8 /* smc */,
9A2846F72666A9CC00EC1F6D /* Kit.framework */,
9A11AACF266FD77F000C1C05 /* Bluetooth.framework */,
@@ -769,19 +728,6 @@
path = RAM;
sourceTree = "<group>";
};
9A8DE588253DEFA9006A748F /* Fans */ = {
isa = PBXGroup;
children = (
9A8DE5E3253DF4E2006A748F /* main.swift */,
9A8DE608253DF740006A748F /* readers.swift */,
9A656549253F20EF0096B607 /* settings.swift */,
9A656561253F788A0096B607 /* popup.swift */,
9A8DE58A253DEFA9006A748F /* Info.plist */,
9A8DE5FB253DF658006A748F /* config.plist */,
);
path = Fans;
sourceTree = "<group>";
};
9A90E18A24EAD2BB00471E9A /* GPU */ = {
isa = PBXGroup;
children = (
@@ -841,7 +787,6 @@
9A81C7572449A41400825D92 /* RAM */,
9AF9EE0324648751005D2270 /* Disk */,
9AE29AD6249A50350071B02D /* Sensors */,
9A8DE588253DEFA9006A748F /* Fans */,
9A3E17CD247A94AF00449CD1 /* Net */,
9ABFF8F7248BEBCB00C9041A /* Battery */,
9A11AAD0266FD77F000C1C05 /* Bluetooth */,
@@ -931,13 +876,6 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
9A8DE582253DEFA9006A748F /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
files = (
);
runOnlyForDeploymentPostprocessing = 0;
};
9A90E18424EAD2BB00471E9A /* Headers */ = {
isa = PBXHeadersBuildPhase;
buildActionMask = 2147483647;
@@ -1018,7 +956,6 @@
9AE29ADB249A50350071B02D /* PBXTargetDependency */,
9A90E18F24EAD2BB00471E9A /* PBXTargetDependency */,
9A97CED02537331B00742D8F /* PBXTargetDependency */,
9A8DE58D253DEFA9006A748F /* PBXTargetDependency */,
9A2846FD2666A9CC00EC1F6D /* PBXTargetDependency */,
9A11AAD5266FD77F000C1C05 /* PBXTargetDependency */,
);
@@ -1107,25 +1044,6 @@
productReference = 9A81C7562449A41400825D92 /* RAM.framework */;
productType = "com.apple.product-type.framework";
};
9A8DE586253DEFA9006A748F /* Fans */ = {
isa = PBXNativeTarget;
buildConfigurationList = 9A8DE592253DEFA9006A748F /* Build configuration list for PBXNativeTarget "Fans" */;
buildPhases = (
9A8DE582253DEFA9006A748F /* Headers */,
9A8DE583253DEFA9006A748F /* Sources */,
9A8DE584253DEFA9006A748F /* Frameworks */,
9A8DE585253DEFA9006A748F /* Resources */,
);
buildRules = (
);
dependencies = (
9A2847E82666AAA900EC1F6D /* PBXTargetDependency */,
);
name = Fans;
productName = Fans;
productReference = 9A8DE587253DEFA9006A748F /* Fans.framework */;
productType = "com.apple.product-type.framework";
};
9A90E18824EAD2BB00471E9A /* GPU */ = {
isa = PBXNativeTarget;
buildConfigurationList = 9A90E19424EAD2BB00471E9A /* Build configuration list for PBXNativeTarget "GPU" */;
@@ -1281,10 +1199,6 @@
CreatedOnToolsVersion = 11.4.1;
LastSwiftMigration = 1140;
};
9A8DE586253DEFA9006A748F = {
CreatedOnToolsVersion = 12.0.1;
LastSwiftMigration = 1200;
};
9A90E18824EAD2BB00471E9A = {
CreatedOnToolsVersion = 11.6;
LastSwiftMigration = 1160;
@@ -1361,7 +1275,6 @@
9A3E17CB247A94AF00449CD1 /* Net */,
9ABFF8F5248BEBCB00C9041A /* Battery */,
9AE29AD4249A50350071B02D /* Sensors */,
9A8DE586253DEFA9006A748F /* Fans */,
9A11AACE266FD77F000C1C05 /* Bluetooth */,
);
};
@@ -1418,14 +1331,6 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
9A8DE585253DEFA9006A748F /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
9A8DE5FC253DF658006A748F /* config.plist in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
9A90E18724EAD2BB00471E9A /* Resources */ = {
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
@@ -1578,18 +1483,6 @@
);
runOnlyForDeploymentPostprocessing = 0;
};
9A8DE583253DEFA9006A748F /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
9A46C047266D85DE001A1117 /* smc.swift in Sources */,
9A8DE609253DF740006A748F /* readers.swift in Sources */,
9A8DE5E4253DF4E2006A748F /* main.swift in Sources */,
9A656562253F788A0096B607 /* popup.swift in Sources */,
9A65654A253F20EF0096B607 /* settings.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
9A90E18524EAD2BB00471E9A /* Sources */ = {
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
@@ -1712,11 +1605,6 @@
target = 9A2846F62666A9CC00EC1F6D /* Kit */;
targetProxy = 9A2847E22666AAA400EC1F6D /* PBXContainerItemProxy */;
};
9A2847E82666AAA900EC1F6D /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 9A2846F62666A9CC00EC1F6D /* Kit */;
targetProxy = 9A2847E72666AAA900EC1F6D /* PBXContainerItemProxy */;
};
9A3E17D2247A94AF00449CD1 /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 9A3E17CB247A94AF00449CD1 /* Net */;
@@ -1727,11 +1615,6 @@
target = 9A81C7552449A41400825D92 /* RAM */;
targetProxy = 9A81C75B2449A41400825D92 /* PBXContainerItemProxy */;
};
9A8DE58D253DEFA9006A748F /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 9A8DE586253DEFA9006A748F /* Fans */;
targetProxy = 9A8DE58C253DEFA9006A748F /* PBXContainerItemProxy */;
};
9A90E18F24EAD2BB00471E9A /* PBXTargetDependency */ = {
isa = PBXTargetDependency;
target = 9A90E18824EAD2BB00471E9A /* GPU */;
@@ -2284,67 +2167,6 @@
};
name = Release;
};
9A8DE590253DEFA9006A748F /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = RP2S87B72W;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = Modules/Fans/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
"@loader_path/Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.13;
PRODUCT_BUNDLE_IDENTIFIER = eu.exelban.Stats.Fans;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
SWIFT_OPTIMIZATION_LEVEL = "-Onone";
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Debug;
};
9A8DE591253DEFA9006A748F /* Release */ = {
isa = XCBuildConfiguration;
buildSettings = {
CLANG_ENABLE_MODULES = YES;
CODE_SIGN_IDENTITY = "";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = RP2S87B72W;
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
INFOPLIST_FILE = Modules/Fans/Info.plist;
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
LD_RUNPATH_SEARCH_PATHS = (
"$(inherited)",
"@executable_path/../Frameworks",
"@loader_path/Frameworks",
);
MACOSX_DEPLOYMENT_TARGET = 10.13;
PRODUCT_BUNDLE_IDENTIFIER = eu.exelban.Stats.Fans;
PRODUCT_NAME = "$(TARGET_NAME:c99extidentifier)";
SKIP_INSTALL = YES;
SWIFT_VERSION = 5.0;
VERSIONING_SYSTEM = "apple-generic";
VERSION_INFO_PREFIX = "";
};
name = Release;
};
9A90E19224EAD2BB00471E9A /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
@@ -2776,15 +2598,6 @@
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
9A8DE592253DEFA9006A748F /* Build configuration list for PBXNativeTarget "Fans" */ = {
isa = XCConfigurationList;
buildConfigurations = (
9A8DE590253DEFA9006A748F /* Debug */,
9A8DE591253DEFA9006A748F /* Release */,
);
defaultConfigurationIsVisible = 0;
defaultConfigurationName = Release;
};
9A90E19424EAD2BB00471E9A /* Build configuration list for PBXNativeTarget "GPU" */ = {
isa = XCConfigurationList;
buildConfigurations = (

View File

@@ -28,7 +28,6 @@ var modules: [Module] = [
RAM(),
Disk(),
Sensors(),
Fans(),
Network(),
Battery(),
Bluetooth()