diff --git a/Docsis Toolkit.xcodeproj/project.pbxproj b/Docsis Toolkit.xcodeproj/project.pbxproj index b715c07..6641047 100644 --- a/Docsis Toolkit.xcodeproj/project.pbxproj +++ b/Docsis Toolkit.xcodeproj/project.pbxproj @@ -20,6 +20,10 @@ E2218D3B1EF32764004298F6 /* Graph.icns in Resources */ = {isa = PBXBuildFile; fileRef = E2218D3A1EF32764004298F6 /* Graph.icns */; }; E2218D4A1EF32917004298F6 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = E2218D491EF32917004298F6 /* MainMenu.xib */; }; E2218D4C1EF329A6004298F6 /* GraphDetailsController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E2218D4B1EF329A6004298F6 /* GraphDetailsController.xib */; }; + E2218D521EF32AC6004298F6 /* GraphDetailsController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2218D511EF32AC6004298F6 /* GraphDetailsController.swift */; }; + E2218D541EF32BC4004298F6 /* Document.xib in Resources */ = {isa = PBXBuildFile; fileRef = E2218D531EF32BC4004298F6 /* Document.xib */; }; + E2218D571EF335E6004298F6 /* CollectionViewItem.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2218D551EF335E6004298F6 /* CollectionViewItem.swift */; }; + E2218D581EF335E6004298F6 /* CollectionViewItem.xib in Resources */ = {isa = PBXBuildFile; fileRef = E2218D561EF335E6004298F6 /* CollectionViewItem.xib */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -63,6 +67,10 @@ E2218D421EF32843004298F6 /* BumpBuildNumber.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = BumpBuildNumber.py; sourceTree = ""; }; E2218D491EF32917004298F6 /* MainMenu.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = MainMenu.xib; sourceTree = ""; }; E2218D4B1EF329A6004298F6 /* GraphDetailsController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = GraphDetailsController.xib; sourceTree = ""; }; + E2218D511EF32AC6004298F6 /* GraphDetailsController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GraphDetailsController.swift; sourceTree = ""; }; + E2218D531EF32BC4004298F6 /* Document.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = Document.xib; sourceTree = ""; }; + E2218D551EF335E6004298F6 /* CollectionViewItem.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CollectionViewItem.swift; sourceTree = ""; }; + E2218D561EF335E6004298F6 /* CollectionViewItem.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = CollectionViewItem.xib; sourceTree = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -226,6 +234,8 @@ E2218D481EF328FC004298F6 /* UI */ = { isa = PBXGroup; children = ( + E2218D561EF335E6004298F6 /* CollectionViewItem.xib */, + E2218D531EF32BC4004298F6 /* Document.xib */, E2218D4B1EF329A6004298F6 /* GraphDetailsController.xib */, E2218D491EF32917004298F6 /* MainMenu.xib */, ); @@ -260,7 +270,9 @@ E2218D501EF329D0004298F6 /* Views */ = { isa = PBXGroup; children = ( + E2218D551EF335E6004298F6 /* CollectionViewItem.swift */, E2218D2F1EF3271F004298F6 /* Document.swift */, + E2218D511EF32AC6004298F6 /* GraphDetailsController.swift */, ); name = Views; sourceTree = ""; @@ -404,8 +416,10 @@ isa = PBXResourcesBuildPhase; buildActionMask = 2147483647; files = ( + E2218D541EF32BC4004298F6 /* Document.xib in Resources */, E2218D3B1EF32764004298F6 /* Graph.icns in Resources */, E2218D4C1EF329A6004298F6 /* GraphDetailsController.xib in Resources */, + E2218D581EF335E6004298F6 /* CollectionViewItem.xib in Resources */, E2218D4A1EF32917004298F6 /* MainMenu.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; @@ -430,6 +444,8 @@ buildActionMask = 2147483647; files = ( E2218D2C1EF3271F004298F6 /* AppDelegate.swift in Sources */, + E2218D571EF335E6004298F6 /* CollectionViewItem.swift in Sources */, + E2218D521EF32AC6004298F6 /* GraphDetailsController.swift in Sources */, E2218D301EF3271F004298F6 /* Document.swift in Sources */, ); runOnlyForDeploymentPostprocessing = 0; 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 5194c70..06dfd81 100644 --- a/Docsis Toolkit.xcodeproj/xcuserdata/Kili2.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/Docsis Toolkit.xcodeproj/xcuserdata/Kili2.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -9,13 +9,13 @@ shouldBeEnabled = "No" ignoreCount = "0" continueAfterRunningActions = "No" - filePath = "Logger4/ConnectionLossOPeration.swift" - timestampString = "519237162.594064" + filePath = "Graphic Analysis 2/Document.swift" + timestampString = "519261172.601414" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "31" - endingLineNumber = "31" - landmarkName = "main()" + startingLineNumber = "30" + endingLineNumber = "30" + landmarkName = "read(from:ofType:)" landmarkType = "7"> @@ -25,13 +25,13 @@ shouldBeEnabled = "No" ignoreCount = "0" continueAfterRunningActions = "No" - filePath = "Logger4/ConnectionLossOPeration.swift" - timestampString = "519235674.132779" + filePath = "Graphic Analysis 2/Document.swift" + timestampString = "519261024.627231" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "15" - endingLineNumber = "15" - landmarkName = "init()" + startingLineNumber = "37" + endingLineNumber = "37" + landmarkName = "read(from:ofType:)" landmarkType = "7"> @@ -41,13 +41,13 @@ shouldBeEnabled = "No" ignoreCount = "0" continueAfterRunningActions = "No" - filePath = "Logger4/AppDelegate.swift" - timestampString = "519247235.495795" + filePath = "Graphic Analysis 2/Document.swift" + timestampString = "519261038.139381" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "95" - endingLineNumber = "95" - landmarkName = "applicationDidFinishLaunching(_:)" + startingLineNumber = "38" + endingLineNumber = "38" + landmarkName = "read(from:ofType:)" landmarkType = "7"> @@ -57,253 +57,13 @@ shouldBeEnabled = "No" ignoreCount = "0" continueAfterRunningActions = "No" - filePath = "Logger4/ConnectionLossOperation.swift" - timestampString = "519236096.282816" + filePath = "Graphic Analysis 2/Document.swift" + timestampString = "519262298.166938" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "19" - endingLineNumber = "19" - landmarkName = "main()" - landmarkType = "7"> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Graphic Analysis 2/AppDelegate.swift b/Graphic Analysis 2/AppDelegate.swift index a0a1078..ac48b76 100644 --- a/Graphic Analysis 2/AppDelegate.swift +++ b/Graphic Analysis 2/AppDelegate.swift @@ -21,6 +21,8 @@ class AppDelegate: NSObject, NSApplicationDelegate { // Insert code here to tear down your application } - + func applicationShouldOpenUntitledFile(_ sender: NSApplication) -> Bool { + return false + } } diff --git a/Graphic Analysis 2/CollectionViewItem.swift b/Graphic Analysis 2/CollectionViewItem.swift new file mode 100644 index 0000000..fe9443d --- /dev/null +++ b/Graphic Analysis 2/CollectionViewItem.swift @@ -0,0 +1,20 @@ +// +// CollectionViewItem.swift +// Docsis Toolkit +// +// Created by Kilian Hofmann on 15.06.17. +// Copyright © 2017 Kilian Hofmann. All rights reserved. +// + +import Cocoa + +class CollectionViewItem: NSCollectionViewItem { + + @IBOutlet var month: NSTextField! + + override func viewDidLoad() { + super.viewDidLoad() + view.wantsLayer = true + view.layer?.backgroundColor = NSColor.white.cgColor + } +} diff --git a/Graphic Analysis 2/CollectionViewItem.xib b/Graphic Analysis 2/CollectionViewItem.xib new file mode 100644 index 0000000..4b40529 --- /dev/null +++ b/Graphic Analysis 2/CollectionViewItem.xib @@ -0,0 +1,318 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Graphic Analysis 2/Document.swift b/Graphic Analysis 2/Document.swift index a695ea2..908e620 100644 --- a/Graphic Analysis 2/Document.swift +++ b/Graphic Analysis 2/Document.swift @@ -10,35 +10,63 @@ import Cocoa class Document: NSDocument { + var year: FileWrapper? + var months: [FileWrapper?] = [nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil, nil] + @IBOutlet var collectionView: NSCollectionView! + override init() { super.init() // Add your subclass-specific initialization here. } - + override class func autosavesInPlace() -> Bool { - return true + return false + } + + override var windowNibName: String? { + return "Document" } - override func makeWindowControllers() { - // Returns the Storyboard that contains your Document window. - let storyboard = NSStoryboard(name: "Main", bundle: nil) - let windowController = storyboard.instantiateController(withIdentifier: "Document Window Controller") as! NSWindowController - self.addWindowController(windowController) + override func read(from fileWrapper: FileWrapper, ofType typeName: String) throws { + year = fileWrapper + for entry in fileWrapper.fileWrappers! { + guard let month = Int(entry.key) else { + continue + } + months[month-1] = entry.value + } + //throw NSError(domain: NSOSStatusErrorDomain, code: unimpErr, userInfo: nil) } - - override func data(ofType typeName: String) throws -> Data { - // Insert code here to write your document to data of the specified type. If outError != nil, ensure that you create and set an appropriate error when returning nil. - // You can also choose to override fileWrapperOfType:error:, writeToURL:ofType:error:, or writeToURL:ofType:forSaveOperation:originalContentsURL:error: instead. - throw NSError(domain: NSOSStatusErrorDomain, code: unimpErr, userInfo: nil) + + override func windowControllerDidLoadNib(_ windowController: NSWindowController) { + // Setup collection layout + let flowLayout = NSCollectionViewFlowLayout() + flowLayout.itemSize = NSSize(width: 228, height: 211) + flowLayout.sectionInset = EdgeInsets(top: 10, left: 10, bottom: 10, right: 10) + flowLayout.minimumInteritemSpacing = 10 + flowLayout.minimumLineSpacing = 10 + collectionView.collectionViewLayout = flowLayout + // Performance + collectionView.superview?.wantsLayer = true } - - override func read(from data: Data, ofType typeName: String) throws { - // Insert code here to read your document from the given data of the specified type. If outError != nil, ensure that you create and set an appropriate error when returning false. - // You can also choose to override readFromFileWrapper:ofType:error: or readFromURL:ofType:error: instead. - // If you override either of these, you should also override -isEntireFileLoaded to return false if the contents are lazily loaded. - throw NSError(domain: NSOSStatusErrorDomain, code: unimpErr, userInfo: nil) + + override func shouldCloseWindowController(_ windowController: NSWindowController, delegate: Any?, shouldClose shouldCloseSelector: Selector?, contextInfo: UnsafeMutableRawPointer?) { + super.shouldCloseWindowController(windowController, delegate: delegate, shouldClose: shouldCloseSelector, contextInfo: contextInfo) } - - +} + +extension Document : NSCollectionViewDataSource { + + func collectionView(_ collectionView: NSCollectionView, numberOfItemsInSection section: Int) -> Int { + return 12 + } + + func collectionView(_ itemForRepresentedObjectAtcollectionView: NSCollectionView, itemForRepresentedObjectAt indexPath: IndexPath) -> NSCollectionViewItem { + let item = collectionView.makeItem(withIdentifier: "CollectionViewItem", for: indexPath) + guard let item2 = item as? CollectionViewItem else {return item } + item2.month.stringValue = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"][indexPath.item] + return item2 + } + } diff --git a/Graphic Analysis 2/Document.xib b/Graphic Analysis 2/Document.xib new file mode 100644 index 0000000..20badfb --- /dev/null +++ b/Graphic Analysis 2/Document.xib @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Graphic Analysis 2/GraphDetailsController.swift b/Graphic Analysis 2/GraphDetailsController.swift new file mode 100644 index 0000000..158ef45 --- /dev/null +++ b/Graphic Analysis 2/GraphDetailsController.swift @@ -0,0 +1,35 @@ +// +// GraphDetailsController.swift +// Graphic Analysis 2 +// +// Created by Kilian Hofmann on 12.09.16. +// Copyright © 2016 Kilian Hofmann. All rights reserved. +// + +import Cocoa + +class GraphDetailsController: NSViewController { + + @IBOutlet var freq: NSTextField! + @IBOutlet var power: NSTextField! + @IBOutlet var snr: NSTextField! + @IBOutlet var time: NSTextField! + @IBOutlet var ranging: NSTextField! + + var freq_str: String = "" + var power_str: String = "" + var snr_str: String = "" + var time_str: String = "" + var ranging_str: String = ""; + + override func viewWillAppear() { + super.viewWillAppear() + // Do view setup here. + freq.stringValue = freq_str + power.stringValue = power_str + snr.stringValue = snr_str + time.stringValue = time_str + ranging.stringValue = ranging_str + } + +} diff --git a/Graphic Analysis 2/Info.plist b/Graphic Analysis 2/Info.plist index acf7390..14636dc 100644 --- a/Graphic Analysis 2/Info.plist +++ b/Graphic Analysis 2/Info.plist @@ -44,7 +44,7 @@ CFBundleShortVersionString 2.0 CFBundleVersion - 2 + 64 LSApplicationCategoryType public.app-category.utilities LSMinimumSystemVersion diff --git a/Graphic Analysis 2/MainMenu.xib b/Graphic Analysis 2/MainMenu.xib index 31bdac9..1751a1b 100644 --- a/Graphic Analysis 2/MainMenu.xib +++ b/Graphic Analysis 2/MainMenu.xib @@ -1,8 +1,8 @@ - + - + @@ -12,104 +12,105 @@ - + - + - + - + - + - + - - + + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - + - + - - + + - + - + - + - + - + - + - + - - + + - + + diff --git a/Graphic Analysis 2/buildnum.ver b/Graphic Analysis 2/buildnum.ver index eca97fd..3ed2650 100644 --- a/Graphic Analysis 2/buildnum.ver +++ b/Graphic Analysis 2/buildnum.ver @@ -1,2 +1,2 @@ version 2.0 -build 2 +build 64