From 237ea122e097ddc00d53fbb1b720af1f6d055d09 Mon Sep 17 00:00:00 2001 From: Kilian Hofmann Date: Thu, 22 Jun 2017 18:28:20 +0200 Subject: [PATCH] Small fixes, Graph performance issue resolved --- .../xcdebugger/Breakpoints_v2.xcbkptlist | 113 ++++++++++++++++++ .../xcschemes/Graphic Analysis 2.xcscheme | 2 +- FileOperations.swift | 4 +- Graphic Analysis 2/FrequencyGraph.swift | 54 ++++++--- Graphic Analysis 2/GraphWindow.swift | 75 ++++++++++-- Graphic Analysis 2/GraphWindow.xib | 22 +++- Graphic Analysis 2/Info.plist | 2 +- Graphic Analysis 2/buildnum.ver | 2 +- 8 files changed, 242 insertions(+), 32 deletions(-) diff --git a/Docsis Toolkit.xcodeproj/xcuserdata/Kili2.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist b/Docsis Toolkit.xcodeproj/xcuserdata/Kili2.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist index 75aeee7..c399d3b 100644 --- a/Docsis Toolkit.xcodeproj/xcuserdata/Kili2.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/Docsis Toolkit.xcodeproj/xcuserdata/Kili2.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -19,5 +19,118 @@ landmarkType = "7"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Docsis Toolkit.xcodeproj/xcuserdata/Kili2.xcuserdatad/xcschemes/Graphic Analysis 2.xcscheme b/Docsis Toolkit.xcodeproj/xcuserdata/Kili2.xcuserdatad/xcschemes/Graphic Analysis 2.xcscheme index 0eeadbe..1276c65 100644 --- a/Docsis Toolkit.xcodeproj/xcuserdata/Kili2.xcuserdatad/xcschemes/Graphic Analysis 2.xcscheme +++ b/Docsis Toolkit.xcodeproj/xcuserdata/Kili2.xcuserdatad/xcschemes/Graphic Analysis 2.xcscheme @@ -65,7 +65,7 @@ + isEnabled = "NO"> diff --git a/FileOperations.swift b/FileOperations.swift index b98a572..ba14551 100644 --- a/FileOperations.swift +++ b/FileOperations.swift @@ -14,7 +14,7 @@ class FileOperations: NSObject { // 15 in threshold indicates some error static func encodeTimeStamp(stamp: String, threshold: String) -> UInt32 { - let mappingEncode: Dictionary = ["-" : 0, "62.81": 1, "58.21": 2, "57": 3, "59.81": 4, "55.21": 5, "54": 6, "56.81": 7, "52.21": 8, "51": 9] + let mappingEncode: Dictionary = ["-" : 0, "62.81": 1, "58.21": 2, "57": 3, "59.81": 4, "55.21": 5, "54": 6, "56.18": 7, "52.21": 8, "51": 9] let separated: Array = stamp.components(separatedBy: ":") let hours: UInt32 = UInt32(separated[0])! << 16 let minutes: UInt32 = UInt32(separated[1])! << 10 @@ -24,7 +24,7 @@ class FileOperations: NSObject { } static func decodeTimestamp(stamp: UInt32) -> (String, String) { - let mappingDecode: Dictionary = [0: "-", 1: "62.81", 2: "58.21", 3: "57", 4: "59.81", 5: "55.21", 6: "54", 7: "56.81", 8: "52.21", 9: "51"] + let mappingDecode: Dictionary = [0: "-", 1: "62.81", 2: "58.21", 3: "57", 4: "59.81", 5: "55.21", 6: "54", 7: "56.18", 8: "52.21", 9: "51", 15: "-"] let threshold: UInt32 = stamp & 0b1111 let seconds: UInt32 = (stamp >> 4) & 0b111111 let minutes: UInt32 = (stamp >> 10) & 0b111111 diff --git a/Graphic Analysis 2/FrequencyGraph.swift b/Graphic Analysis 2/FrequencyGraph.swift index 76e9c3d..80bfca3 100644 --- a/Graphic Analysis 2/FrequencyGraph.swift +++ b/Graphic Analysis 2/FrequencyGraph.swift @@ -34,10 +34,13 @@ class FrequencyGraph: NSView { var cursor: NSBezierPath = NSBezierPath.init() // Superview var content: FlippedView! + // Indicator + var indicator: NSProgressIndicator! - init(upstream: Bool, frame: CGRect, superview: FlippedView) { + init(upstream: Bool, frame: CGRect, superview: FlippedView, indicator: NSProgressIndicator) { super.init(frame: frame) self.upstream = upstream + self.indicator = indicator let tracking: NSTrackingArea = NSTrackingArea(rect: self.bounds, options: [.mouseEnteredAndExited, .mouseMoved, .activeInActiveApp, .inVisibleRect], owner: self, userInfo: nil) self.addTrackingArea(tracking) @@ -94,6 +97,10 @@ class FrequencyGraph: NSView { func initView(operation: GraphLoadOperation) { // Setup Indicator + indicator.doubleValue = 0 + indicator.isHidden = false + indicator.minValue = 0 + indicator.maxValue = Double(data.count) // Zero line let zero: NSBezierPath = NSBezierPath() zero.move(to: NSPoint(x: 5, y: zeroOffset)) @@ -101,10 +108,24 @@ class FrequencyGraph: NSView { self.timePaths.append(zero) // Add data points var lastWasSkipped: Bool = false + // + var lastLossIndex: Int = 0 for point in 0.. Bool { - opQueue.cancelAllOperations() - collectionViewItem?.isSelected = false - collectionViewItem?.view.layer?.borderColor = NSColor.clear.cgColor + for op in loadingQueue1.operations { + if !op.isFinished { + return false + } + } + for op in loadingQueue2.operations { + if !op.isFinished { + return false + } + } + for op in loadingQueue3.operations { + if !op.isFinished { + return false + } + } + for op in loadingQueue4.operations { + if !op.isFinished { + return false + } + } + collectionViewItem.collectionView.deselectAll(self) return true } } diff --git a/Graphic Analysis 2/GraphWindow.xib b/Graphic Analysis 2/GraphWindow.xib index 3bad7c2..e4d2861 100644 --- a/Graphic Analysis 2/GraphWindow.xib +++ b/Graphic Analysis 2/GraphWindow.xib @@ -8,6 +8,10 @@ + + + + @@ -46,12 +50,28 @@ + + + + + + + + + + + + + + + + - + diff --git a/Graphic Analysis 2/Info.plist b/Graphic Analysis 2/Info.plist index c49ca82..ac79b6e 100644 --- a/Graphic Analysis 2/Info.plist +++ b/Graphic Analysis 2/Info.plist @@ -44,7 +44,7 @@ CFBundleShortVersionString 2.1 CFBundleVersion - 461 + 480 LSApplicationCategoryType public.app-category.utilities LSMinimumSystemVersion diff --git a/Graphic Analysis 2/buildnum.ver b/Graphic Analysis 2/buildnum.ver index d88db36..fa95810 100644 --- a/Graphic Analysis 2/buildnum.ver +++ b/Graphic Analysis 2/buildnum.ver @@ -1,2 +1,2 @@ version 2.1 -build 461 +build 480