Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initialize thread count from model instead of showing "1" by default. #317

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="1" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="sya-ll-mpl">
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="sya-ll-mpl">
<rect key="frame" x="250.5" y="10" width="6.5" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,15 @@ class InferenceViewController: UIViewController {
var resolution: CGSize = CGSize.zero
var maxResults: Int = 0
var threadCountLimit: Int = 0
var threadCount: Int {
get {
return currentThreadCount
}
set(value) {
currentThreadCount = value
threadStepper?.value = Double(value)
}
}
private var currentThreadCount: Int = 0
private var infoTextColor = UIColor.black

Expand All @@ -96,6 +105,7 @@ class InferenceViewController: UIViewController {
threadStepper.maximumValue = Double(threadCountLimit)
threadStepper.minimumValue = Double(minThreadCount)
threadStepper.value = Double(currentThreadCount)
stepperValueLabel.text = "\(currentThreadCount)"

// Set the info text color on iOS 11 and higher.
if #available(iOS 11, *) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ class ViewController: UIViewController {
inferenceViewController?.maxResults = tempModelDataHandler.resultCount
inferenceViewController?.threadCountLimit = tempModelDataHandler.threadCountLimit
inferenceViewController?.delegate = self

inferenceViewController?.threadCount = tempModelDataHandler.threadCount
}
}

Expand Down