diff --git a/Foil/AppDelegate.swift b/Foil/AppDelegate.swift index f12dd62..098d342 100644 --- a/Foil/AppDelegate.swift +++ b/Foil/AppDelegate.swift @@ -10,9 +10,6 @@ import Cocoa @NSApplicationMain class AppDelegate: NSObject, NSApplicationDelegate { - - - func applicationDidFinishLaunching(_ aNotification: Notification) { // Insert code here to initialize your application } diff --git a/Foil/Base.lproj/Main.storyboard b/Foil/Base.lproj/Main.storyboard index fb54775..e8441c6 100644 --- a/Foil/Base.lproj/Main.storyboard +++ b/Foil/Base.lproj/Main.storyboard @@ -11,11 +11,11 @@ - + - + - + @@ -29,7 +29,7 @@ - + @@ -47,7 +47,7 @@ - + @@ -640,7 +640,7 @@ - + @@ -659,7 +659,7 @@ - + diff --git a/Foil/FoilViewController.swift b/Foil/FoilViewController.swift index 8e8f755..15670ea 100644 --- a/Foil/FoilViewController.swift +++ b/Foil/FoilViewController.swift @@ -36,7 +36,8 @@ class FoilViewController: NSViewController, MTKViewDelegate { static let FoilNumSimulationConfigs = FoilSimulationConfigTable.count - var _view: MTKView { guard let v = self.view as? MTKView else { fatalError() }; return v } +// var _view: MTKView { guard let v = self.view as? MTKView else { fatalError() }; return v } + var _view: MTKView { (self.view as? MTKView)! } var renderer: FoilRenderer! var simulation: FoilSimulation! diff --git a/Simulation/FoilSimulation.swift b/Simulation/FoilSimulation.swift index af1b88a..a87473c 100644 --- a/Simulation/FoilSimulation.swift +++ b/Simulation/FoilSimulation.swift @@ -69,6 +69,11 @@ class FoilSimulation { let config: FoilSimulationConfig + let simulationDispatchQueue = DispatchQueue( + label: "simulator.q", qos: .default, attributes: [/*serial*/], + target: DispatchQueue.global(qos: .default) + ) + // When set to true, stop an asynchronously executed simulation var halt = false @@ -112,7 +117,7 @@ class FoilSimulation { func runAsyncWithUpdateHandler( updateHandler: @escaping FoilDataUpdateHandler, dataProvider: @escaping FoilFullDatasetProvider ) { - DispatchQueue.global(qos: .default).async { + simulationDispatchQueue.async { self.commandQueue = self.device.makeCommandQueue() self.runAsyncLoopWithUpdateHandler(updateHandler: updateHandler)