fix: Trying to fix #86 - KVO triggered from the thermal log queue.

This commit is contained in:
macmade
2024-06-20 22:21:49 +02:00
parent 24e059e30c
commit 0d34958878
3 changed files with 9 additions and 7 deletions

View File

@@ -34,6 +34,7 @@ public class InfoViewController: NSViewController
@objc public private( set ) dynamic var speedLimit: Int = 0
@objc public private( set ) dynamic var temperature: Int = 0
@objc public private( set ) dynamic var thermalPressure: Int = 0
@objc public private( set ) dynamic var hasSensors: Bool = false
public var onUpdate: ( () -> Void )?
@@ -115,6 +116,8 @@ public class InfoViewController: NSViewController
private func update()
{
self.hasSensors = self.log.sensors.isEmpty == false
if let n = self.log.schedulerLimit?.intValue
{
self.schedulerLimit = n

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="21507" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<deployment identifier="macosx"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="21507"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="22690"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication">
@@ -651,8 +651,7 @@
<action selector="performMiniaturize:" target="-1" id="VwT-WD-YPe"/>
</connections>
</menuItem>
<menuItem title="Zoom" id="R4o-n2-Eq4">
<modifierMask key="keyEquivalentModifierMask"/>
<menuItem title="Zoom" keyEquivalent="⎋" id="R4o-n2-Eq4">
<connections>
<action selector="performZoom:" target="-1" id="DIl-cC-cCs"/>
</connections>
@@ -705,9 +704,9 @@
</items>
</menu>
<connections>
<binding destination="Voe-Tx-rLC" name="hidden" keyPath="self.infoViewController.log.sensors" id="I5E-xc-zkg">
<binding destination="Voe-Tx-rLC" name="hidden" keyPath="self.infoViewController.hasSensors" id="Iwh-ax-u58">
<dictionary key="options">
<string key="NSValueTransformerName">DictionaryIsEmpty</string>
<string key="NSValueTransformerName">NSNegateBoolean</string>
</dictionary>
</binding>
</connections>