diff --git a/Docsis Toolkit.xcodeproj/project.pbxproj b/Docsis Toolkit.xcodeproj/project.pbxproj index def5088..b715c07 100644 --- a/Docsis Toolkit.xcodeproj/project.pbxproj +++ b/Docsis Toolkit.xcodeproj/project.pbxproj @@ -11,13 +11,15 @@ E2218CA91EF2D37B004298F6 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E2218CA81EF2D37B004298F6 /* Assets.xcassets */; }; E2218CDE1EF2D461004298F6 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = E2218CDC1EF2D461004298F6 /* MainMenu.xib */; }; E2218CDF1EF2D461004298F6 /* SettingsWindowController.xib in Resources */ = {isa = PBXBuildFile; fileRef = E2218CDD1EF2D461004298F6 /* SettingsWindowController.xib */; }; - E2218CE31EF2D54A004298F6 /* buildnum.ver in Resources */ = {isa = PBXBuildFile; fileRef = E2218CE11EF2D54A004298F6 /* buildnum.ver */; }; - E2218CE41EF2D54A004298F6 /* BumpBuildNumber.py in Resources */ = {isa = PBXBuildFile; fileRef = E2218CE21EF2D54A004298F6 /* BumpBuildNumber.py */; }; - E2218D0D1EF2D68F004298F6 /* XMLDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = E2218D0A1EF2D68F004298F6 /* XMLDictionary.m */; }; E2218D111EF2D6F1004298F6 /* SettingsWindowController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2218D101EF2D6F1004298F6 /* SettingsWindowController.swift */; }; E2218D151EF2E470004298F6 /* ConnectionLossOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2218D141EF2E470004298F6 /* ConnectionLossOperation.swift */; }; - E2218D171EF2E4EA004298F6 /* Shared.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2218D161EF2E4EA004298F6 /* Shared.swift */; }; E2218D191EF2F0D8004298F6 /* FrequencyOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2218D181EF2F0D8004298F6 /* FrequencyOperation.swift */; }; + E2218D241EF3267F004298F6 /* XMLDictionary.m in Sources */ = {isa = PBXBuildFile; fileRef = E2218D231EF3267F004298F6 /* XMLDictionary.m */; }; + E2218D2C1EF3271F004298F6 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2218D2B1EF3271F004298F6 /* AppDelegate.swift */; }; + E2218D301EF3271F004298F6 /* Document.swift in Sources */ = {isa = PBXBuildFile; fileRef = E2218D2F1EF3271F004298F6 /* Document.swift */; }; + 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 */; }; /* End PBXBuildFile section */ /* Begin PBXContainerItemProxy section */ @@ -28,6 +30,13 @@ remoteGlobalIDString = E2218CE51EF2D577004298F6; remoteInfo = "Bump Logger4"; }; + E2218D451EF32863004298F6 /* PBXContainerItemProxy */ = { + isa = PBXContainerItemProxy; + containerPortal = E2218C7A1EF2D2B5004298F6 /* Project object */; + proxyType = 1; + remoteGlobalIDString = E2218D3D1EF32803004298F6; + remoteInfo = "Bump Graphic Analysis 2"; + }; /* End PBXContainerItemProxy section */ /* Begin PBXFileReference section */ @@ -39,13 +48,21 @@ E2218CDD1EF2D461004298F6 /* SettingsWindowController.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = SettingsWindowController.xib; sourceTree = ""; }; E2218CE11EF2D54A004298F6 /* buildnum.ver */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = buildnum.ver; sourceTree = ""; }; E2218CE21EF2D54A004298F6 /* BumpBuildNumber.py */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.script.python; path = BumpBuildNumber.py; sourceTree = ""; }; - E2218D051EF2D68F004298F6 /* Logger4-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "Logger4-Bridging-Header.h"; sourceTree = ""; }; - E2218D081EF2D68F004298F6 /* XMLDictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = XMLDictionary.h; sourceTree = ""; }; - E2218D0A1EF2D68F004298F6 /* XMLDictionary.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = XMLDictionary.m; sourceTree = ""; }; E2218D101EF2D6F1004298F6 /* SettingsWindowController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = SettingsWindowController.swift; sourceTree = ""; }; E2218D141EF2E470004298F6 /* ConnectionLossOperation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ConnectionLossOperation.swift; sourceTree = ""; }; - E2218D161EF2E4EA004298F6 /* Shared.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Shared.swift; sourceTree = ""; }; E2218D181EF2F0D8004298F6 /* FrequencyOperation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FrequencyOperation.swift; sourceTree = ""; }; + E2218D211EF3267F004298F6 /* Logger4-Bridging-Header.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = "Logger4-Bridging-Header.h"; path = "Logger4/Logger4-Bridging-Header.h"; sourceTree = ""; }; + E2218D221EF3267F004298F6 /* XMLDictionary.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = XMLDictionary.h; path = Logger4/XMLDictionary.h; sourceTree = ""; }; + E2218D231EF3267F004298F6 /* XMLDictionary.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = XMLDictionary.m; path = Logger4/XMLDictionary.m; sourceTree = ""; }; + E2218D291EF3271F004298F6 /* Graphic Analysis 2.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Graphic Analysis 2.app"; sourceTree = BUILT_PRODUCTS_DIR; }; + E2218D2B1EF3271F004298F6 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = ""; }; + E2218D2F1EF3271F004298F6 /* Document.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Document.swift; sourceTree = ""; }; + E2218D361EF3271F004298F6 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; + E2218D3A1EF32764004298F6 /* Graph.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; path = Graph.icns; sourceTree = ""; }; + E2218D411EF32843004298F6 /* buildnum.ver */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = buildnum.ver; sourceTree = ""; }; + 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 = ""; }; /* End PBXFileReference section */ /* Begin PBXFrameworksBuildPhase section */ @@ -56,6 +73,13 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + E2218D261EF3271F004298F6 /* Frameworks */ = { + isa = PBXFrameworksBuildPhase; + buildActionMask = 2147483647; + files = ( + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXFrameworksBuildPhase section */ /* Begin PBXGroup section */ @@ -64,6 +88,7 @@ children = ( E2218CA71EF2D35B004298F6 /* Shared Resources */, E2218C991EF2D345004298F6 /* Logger4 */, + E2218D2A1EF3271F004298F6 /* Graphic Analysis 2 */, E2218C831EF2D2B5004298F6 /* Products */, ); sourceTree = ""; @@ -72,6 +97,7 @@ isa = PBXGroup; children = ( E2218C981EF2D345004298F6 /* Logger4.app */, + E2218D291EF3271F004298F6 /* Graphic Analysis 2.app */, ); name = Products; sourceTree = ""; @@ -79,8 +105,9 @@ E2218C991EF2D345004298F6 /* Logger4 */ = { isa = PBXGroup; children = ( - E2218CEB1EF2D648004298F6 /* Swift */, + E2218D041EF2D67B004298F6 /* Obj-C */, E2218CDA1EF2D43A004298F6 /* Support Files */, + E2218CEB1EF2D648004298F6 /* Swift */, ); path = Logger4; sourceTree = ""; @@ -89,7 +116,6 @@ isa = PBXGroup; children = ( E2218CA81EF2D37B004298F6 /* Assets.xcassets */, - E2218D041EF2D67B004298F6 /* Obj-C */, ); name = "Shared Resources"; sourceTree = ""; @@ -128,7 +154,6 @@ E2218D121EF2D754004298F6 /* Delegates */, E2218D131EF2E443004298F6 /* Operations */, E2218D0F1EF2D6E5004298F6 /* Views */, - E2218D161EF2E4EA004298F6 /* Shared.swift */, ); name = Swift; sourceTree = ""; @@ -136,11 +161,12 @@ E2218D041EF2D67B004298F6 /* Obj-C */ = { isa = PBXGroup; children = ( - E2218D081EF2D68F004298F6 /* XMLDictionary.h */, - E2218D0A1EF2D68F004298F6 /* XMLDictionary.m */, - E2218D051EF2D68F004298F6 /* Logger4-Bridging-Header.h */, + E2218D211EF3267F004298F6 /* Logger4-Bridging-Header.h */, + E2218D221EF3267F004298F6 /* XMLDictionary.h */, + E2218D231EF3267F004298F6 /* XMLDictionary.m */, ); name = "Obj-C"; + path = ..; sourceTree = ""; }; E2218D0F1EF2D6E5004298F6 /* Views */ = { @@ -168,6 +194,77 @@ name = Operations; sourceTree = ""; }; + E2218D2A1EF3271F004298F6 /* Graphic Analysis 2 */ = { + isa = PBXGroup; + children = ( + E2218D4D1EF329AE004298F6 /* Swift */, + E2218D3C1EF327CA004298F6 /* Support Files */, + ); + path = "Graphic Analysis 2"; + sourceTree = ""; + }; + E2218D3C1EF327CA004298F6 /* Support Files */ = { + isa = PBXGroup; + children = ( + E2218D3A1EF32764004298F6 /* Graph.icns */, + E2218D361EF3271F004298F6 /* Info.plist */, + E2218D471EF328F3004298F6 /* Versioning */, + E2218D481EF328FC004298F6 /* UI */, + ); + name = "Support Files"; + sourceTree = ""; + }; + E2218D471EF328F3004298F6 /* Versioning */ = { + isa = PBXGroup; + children = ( + E2218D411EF32843004298F6 /* buildnum.ver */, + E2218D421EF32843004298F6 /* BumpBuildNumber.py */, + ); + name = Versioning; + sourceTree = ""; + }; + E2218D481EF328FC004298F6 /* UI */ = { + isa = PBXGroup; + children = ( + E2218D4B1EF329A6004298F6 /* GraphDetailsController.xib */, + E2218D491EF32917004298F6 /* MainMenu.xib */, + ); + name = UI; + sourceTree = ""; + }; + E2218D4D1EF329AE004298F6 /* Swift */ = { + isa = PBXGroup; + children = ( + E2218D4E1EF329B4004298F6 /* Delegate */, + E2218D4F1EF329C0004298F6 /* Operations */, + E2218D501EF329D0004298F6 /* Views */, + ); + name = Swift; + sourceTree = ""; + }; + E2218D4E1EF329B4004298F6 /* Delegate */ = { + isa = PBXGroup; + children = ( + E2218D2B1EF3271F004298F6 /* AppDelegate.swift */, + ); + name = Delegate; + sourceTree = ""; + }; + E2218D4F1EF329C0004298F6 /* Operations */ = { + isa = PBXGroup; + children = ( + ); + name = Operations; + sourceTree = ""; + }; + E2218D501EF329D0004298F6 /* Views */ = { + isa = PBXGroup; + children = ( + E2218D2F1EF3271F004298F6 /* Document.swift */, + ); + name = Views; + sourceTree = ""; + }; /* End PBXGroup section */ /* Begin PBXLegacyTarget section */ @@ -185,6 +282,20 @@ passBuildSettingsInEnvironment = 1; productName = "Bump Logger4"; }; + E2218D3D1EF32803004298F6 /* Bump Graphic Analysis 2 */ = { + isa = PBXLegacyTarget; + buildArgumentsString = "\"$PROJECT_DIR/Graphic Analysis 2/BumpBuildNumber.py\" \"$PROJECT_DIR/Graphic Analysis 2/buildnum.ver\" \"$PROJECT_DIR/Graphic Analysis 2/Info.plist\""; + buildConfigurationList = E2218D3E1EF32803004298F6 /* Build configuration list for PBXLegacyTarget "Bump Graphic Analysis 2" */; + buildPhases = ( + ); + buildToolPath = /usr/bin/python; + buildWorkingDirectory = "$PROJECT_DIR/Graphic Analysis 2"; + dependencies = ( + ); + name = "Bump Graphic Analysis 2"; + passBuildSettingsInEnvironment = 1; + productName = "Bump Graphic Analysis 2"; + }; /* End PBXLegacyTarget section */ /* Begin PBXNativeTarget section */ @@ -206,6 +317,24 @@ productReference = E2218C981EF2D345004298F6 /* Logger4.app */; productType = "com.apple.product-type.application"; }; + E2218D281EF3271F004298F6 /* Graphic Analysis 2 */ = { + isa = PBXNativeTarget; + buildConfigurationList = E2218D371EF3271F004298F6 /* Build configuration list for PBXNativeTarget "Graphic Analysis 2" */; + buildPhases = ( + E2218D251EF3271F004298F6 /* Sources */, + E2218D261EF3271F004298F6 /* Frameworks */, + E2218D271EF3271F004298F6 /* Resources */, + ); + buildRules = ( + ); + dependencies = ( + E2218D461EF32863004298F6 /* PBXTargetDependency */, + ); + name = "Graphic Analysis 2"; + productName = "Graphic Analysis 2"; + productReference = E2218D291EF3271F004298F6 /* Graphic Analysis 2.app */; + productType = "com.apple.product-type.application"; + }; /* End PBXNativeTarget section */ /* Begin PBXProject section */ @@ -227,6 +356,16 @@ DevelopmentTeam = 795KPDV76S; ProvisioningStyle = Automatic; }; + E2218D281EF3271F004298F6 = { + CreatedOnToolsVersion = 8.3.3; + DevelopmentTeam = 795KPDV76S; + ProvisioningStyle = Automatic; + }; + E2218D3D1EF32803004298F6 = { + CreatedOnToolsVersion = 8.3.3; + DevelopmentTeam = 795KPDV76S; + ProvisioningStyle = Automatic; + }; }; }; buildConfigurationList = E2218C7D1EF2D2B5004298F6 /* Build configuration list for PBXProject "Docsis Toolkit" */; @@ -244,6 +383,8 @@ targets = ( E2218C971EF2D345004298F6 /* Logger4 */, E2218CE51EF2D577004298F6 /* Bump Logger4 */, + E2218D281EF3271F004298F6 /* Graphic Analysis 2 */, + E2218D3D1EF32803004298F6 /* Bump Graphic Analysis 2 */, ); }; /* End PBXProject section */ @@ -256,8 +397,16 @@ E2218CA91EF2D37B004298F6 /* Assets.xcassets in Resources */, E2218CDF1EF2D461004298F6 /* SettingsWindowController.xib in Resources */, E2218CDE1EF2D461004298F6 /* MainMenu.xib in Resources */, - E2218CE31EF2D54A004298F6 /* buildnum.ver in Resources */, - E2218CE41EF2D54A004298F6 /* BumpBuildNumber.py in Resources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; + E2218D271EF3271F004298F6 /* Resources */ = { + isa = PBXResourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + E2218D3B1EF32764004298F6 /* Graph.icns in Resources */, + E2218D4C1EF329A6004298F6 /* GraphDetailsController.xib in Resources */, + E2218D4A1EF32917004298F6 /* MainMenu.xib in Resources */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -268,8 +417,7 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( - E2218D171EF2E4EA004298F6 /* Shared.swift in Sources */, - E2218D0D1EF2D68F004298F6 /* XMLDictionary.m in Sources */, + E2218D241EF3267F004298F6 /* XMLDictionary.m in Sources */, E2218D111EF2D6F1004298F6 /* SettingsWindowController.swift in Sources */, E2218D151EF2E470004298F6 /* ConnectionLossOperation.swift in Sources */, E2218D191EF2F0D8004298F6 /* FrequencyOperation.swift in Sources */, @@ -277,6 +425,15 @@ ); runOnlyForDeploymentPostprocessing = 0; }; + E2218D251EF3271F004298F6 /* Sources */ = { + isa = PBXSourcesBuildPhase; + buildActionMask = 2147483647; + files = ( + E2218D2C1EF3271F004298F6 /* AppDelegate.swift in Sources */, + E2218D301EF3271F004298F6 /* Document.swift in Sources */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; /* End PBXSourcesBuildPhase section */ /* Begin PBXTargetDependency section */ @@ -285,6 +442,11 @@ target = E2218CE51EF2D577004298F6 /* Bump Logger4 */; targetProxy = E2218CE91EF2D601004298F6 /* PBXContainerItemProxy */; }; + E2218D461EF32863004298F6 /* PBXTargetDependency */ = { + isa = PBXTargetDependency; + target = E2218D3D1EF32803004298F6 /* Bump Graphic Analysis 2 */; + targetProxy = E2218D451EF32863004298F6 /* PBXContainerItemProxy */; + }; /* End PBXTargetDependency section */ /* Begin XCBuildConfiguration section */ @@ -393,7 +555,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.weebly.alikja.Logger4; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_OBJC_BRIDGING_HEADER = "Logger4-Bridging-Header.h"; + SWIFT_OBJC_BRIDGING_HEADER = "Logger4/Logger4-Bridging-Header.h"; SWIFT_OPTIMIZATION_LEVEL = "-Onone"; SWIFT_VERSION = 3.0; }; @@ -412,7 +574,7 @@ PRODUCT_BUNDLE_IDENTIFIER = com.weebly.alikja.Logger4; PRODUCT_NAME = "$(TARGET_NAME)"; PROVISIONING_PROFILE_SPECIFIER = ""; - SWIFT_OBJC_BRIDGING_HEADER = "Logger4-Bridging-Header.h"; + SWIFT_OBJC_BRIDGING_HEADER = "Logger4/Logger4-Bridging-Header.h"; SWIFT_VERSION = 3.0; }; name = Release; @@ -442,6 +604,63 @@ }; name = Release; }; + E2218D381EF3271F004298F6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon-GA2"; + CODE_SIGN_IDENTITY = "Mac Developer"; + COMBINE_HIDPI_IMAGES = YES; + DEVELOPMENT_TEAM = 795KPDV76S; + INFOPLIST_FILE = "Graphic Analysis 2/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.weebly.alikja.Graphic-Analysis-2"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 3.0; + }; + name = Debug; + }; + E2218D391EF3271F004298F6 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + ASSETCATALOG_COMPILER_APPICON_NAME = "AppIcon-GA2"; + CODE_SIGN_IDENTITY = "Mac Developer"; + COMBINE_HIDPI_IMAGES = YES; + DEVELOPMENT_TEAM = 795KPDV76S; + INFOPLIST_FILE = "Graphic Analysis 2/Info.plist"; + LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks"; + PRODUCT_BUNDLE_IDENTIFIER = "com.weebly.alikja.Graphic-Analysis-2"; + PRODUCT_NAME = "$(TARGET_NAME)"; + PROVISIONING_PROFILE_SPECIFIER = ""; + SWIFT_VERSION = 3.0; + }; + name = Release; + }; + E2218D3F1EF32803004298F6 /* Debug */ = { + isa = XCBuildConfiguration; + buildSettings = { + DEBUGGING_SYMBOLS = YES; + DEBUG_INFORMATION_FORMAT = dwarf; + DEVELOPMENT_TEAM = 795KPDV76S; + GCC_GENERATE_DEBUGGING_SYMBOLS = YES; + GCC_OPTIMIZATION_LEVEL = 0; + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Debug; + }; + E2218D401EF32803004298F6 /* Release */ = { + isa = XCBuildConfiguration; + buildSettings = { + DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym"; + DEVELOPMENT_TEAM = 795KPDV76S; + OTHER_CFLAGS = ""; + OTHER_LDFLAGS = ""; + PRODUCT_NAME = "$(TARGET_NAME)"; + }; + name = Release; + }; /* End XCBuildConfiguration section */ /* Begin XCConfigurationList section */ @@ -470,6 +689,22 @@ ); defaultConfigurationIsVisible = 0; }; + E2218D371EF3271F004298F6 /* Build configuration list for PBXNativeTarget "Graphic Analysis 2" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + E2218D381EF3271F004298F6 /* Debug */, + E2218D391EF3271F004298F6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; + E2218D3E1EF32803004298F6 /* Build configuration list for PBXLegacyTarget "Bump Graphic Analysis 2" */ = { + isa = XCConfigurationList; + buildConfigurations = ( + E2218D3F1EF32803004298F6 /* Debug */, + E2218D401EF32803004298F6 /* Release */, + ); + defaultConfigurationIsVisible = 0; + }; /* End XCConfigurationList section */ }; rootObject = E2218C7A1EF2D2B5004298F6 /* Project object */; 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 cb814a8..5194c70 100644 --- a/Docsis Toolkit.xcodeproj/xcuserdata/Kili2.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist +++ b/Docsis Toolkit.xcodeproj/xcuserdata/Kili2.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist @@ -42,11 +42,11 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Logger4/AppDelegate.swift" - timestampString = "519236096.282816" + timestampString = "519247235.495795" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "93" - endingLineNumber = "93" + startingLineNumber = "95" + endingLineNumber = "95" landmarkName = "applicationDidFinishLaunching(_:)" landmarkType = "7"> @@ -74,14 +74,238 @@ ignoreCount = "0" continueAfterRunningActions = "No" filePath = "Logger4/AppDelegate.swift" - timestampString = "519236096.282816" + timestampString = "519247235.495795" startingColumnNumber = "9223372036854775807" endingColumnNumber = "9223372036854775807" - startingLineNumber = "110" - endingLineNumber = "110" + startingLineNumber = "112" + endingLineNumber = "112" landmarkName = "logFails(_:)" 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 new file mode 100644 index 0000000..886851d --- /dev/null +++ b/Docsis Toolkit.xcodeproj/xcuserdata/Kili2.xcuserdatad/xcschemes/Graphic Analysis 2.xcscheme @@ -0,0 +1,91 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Docsis Toolkit.xcodeproj/xcuserdata/Kili2.xcuserdatad/xcschemes/xcschememanagement.plist b/Docsis Toolkit.xcodeproj/xcuserdata/Kili2.xcuserdatad/xcschemes/xcschememanagement.plist index 38cbb54..724b758 100644 --- a/Docsis Toolkit.xcodeproj/xcuserdata/Kili2.xcuserdatad/xcschemes/xcschememanagement.plist +++ b/Docsis Toolkit.xcodeproj/xcuserdata/Kili2.xcuserdatad/xcschemes/xcschememanagement.plist @@ -4,6 +4,11 @@ SchemeUserState + Graphic Analysis 2.xcscheme + + orderHint + 1 + Logger4.xcscheme orderHint @@ -27,6 +32,16 @@ primary + E2218D281EF3271F004298F6 + + primary + + + E2218D3D1EF32803004298F6 + + primary + + diff --git a/Graphic Analysis 2/AppDelegate.swift b/Graphic Analysis 2/AppDelegate.swift new file mode 100644 index 0000000..a0a1078 --- /dev/null +++ b/Graphic Analysis 2/AppDelegate.swift @@ -0,0 +1,26 @@ +// +// AppDelegate.swift +// Graphic Analysis 2 +// +// Created by Kilian Hofmann on 15.06.17. +// Copyright © 2017 Kilian Hofmann. All rights reserved. +// + +import Cocoa + +@NSApplicationMain +class AppDelegate: NSObject, NSApplicationDelegate { + + + + func applicationDidFinishLaunching(_ aNotification: Notification) { + // Insert code here to initialize your application + } + + func applicationWillTerminate(_ aNotification: Notification) { + // Insert code here to tear down your application + } + + +} + diff --git a/Graphic Analysis 2/BumpBuildNumber.py b/Graphic Analysis 2/BumpBuildNumber.py new file mode 100644 index 0000000..94adde8 --- /dev/null +++ b/Graphic Analysis 2/BumpBuildNumber.py @@ -0,0 +1,111 @@ +#!/usr/bin/env python +# +# Bump build number in Info.plist files if a source file have changed. +# +# usage: bump_buildnum.py buildnum.ver Info.plist [ ... Info.plist ] +# +# andy@trojanfoe.com, 2014. +# + +import sys, os, subprocess, re + +def read_verfile(name): + version = None + build = None + verfile = open(name, "r") + for line in verfile: + match = re.match(r"^version\s+(\S+)", line) + if match: + version = match.group(1).rstrip() + match = re.match(r"^build\s+(\S+)", line) + if match: + build = int(match.group(1).rstrip()) + verfile.close() + return (version, build) + +def write_verfile(name, version, build): + verfile = open(name, "w") + verfile.write("version {0}\n".format(version)) + verfile.write("build {0}\n".format(build)) + verfile.close() + return True + +def set_plist_version(plistname, version, build): + if not os.path.exists(plistname): + print("{0} does not exist".format(plistname)) + return False + + plistbuddy = '/usr/libexec/Plistbuddy' + if not os.path.exists(plistbuddy): + print("{0} does not exist".format(plistbuddy)) + return False + + cmdline = [plistbuddy, + "-c", "Set CFBundleShortVersionString {0}".format(version), + "-c", "Set CFBundleVersion {0}".format(build), + plistname] + if subprocess.call(cmdline) != 0: + print("Failed to update {0}".format(plistname)) + return False + + print("Updated {0} with v{1} ({2})".format(plistname, version, build)) + return True + +def should_bump(vername, dirname): + verstat = os.stat(vername) + allnames = [] + for dirname, dirnames, filenames in os.walk(dirname): + for filename in filenames: + allnames.append(os.path.join(dirname, filename)) + + for filename in allnames: + filestat = os.stat(filename) + if filestat.st_mtime > verstat.st_mtime: + print("{0} is newer than {1}".format(filename, vername)) + return True + + return False + +def upver(vername): + (version, build) = read_verfile(vername) + if version == None or build == None: + print("Failed to read version/build from {0}".format(vername)) + return False + + # Bump the version number if any files in the same directory as the version file + # have changed, including sub-directories. + srcdir = os.path.dirname(vername) + bump = should_bump(vername, srcdir) + + if bump: + build += 1 + print("Incremented to build {0}".format(build)) + write_verfile(vername, version, build) + print("Written {0}".format(vername)) + else: + print("Staying at build {0}".format(build)) + + return (version, build) + +if __name__ == "__main__": + if os.environ.has_key('ACTION') and os.environ['ACTION'] == 'clean': + print("{0}: Not running while cleaning".format(sys.argv[0])) + sys.exit(0) + + if len(sys.argv) < 3: + print("Usage: {0} buildnum.ver Info.plist [... Info.plist]".format(sys.argv[0])) + sys.exit(1) + vername = sys.argv[1] + + (version_orig, build_orig) = read_verfile(vername) + + (version, build) = upver(vername) + if version == None or build == None: + sys.exit(2) + + if (version_orig, build_orig) < (version, build): + for i in range(2, len(sys.argv)): + plistname = sys.argv[i] + set_plist_version(plistname, version, build) + + sys.exit(0) \ No newline at end of file diff --git a/Graphic Analysis 2/Document.swift b/Graphic Analysis 2/Document.swift new file mode 100644 index 0000000..a695ea2 --- /dev/null +++ b/Graphic Analysis 2/Document.swift @@ -0,0 +1,44 @@ +// +// Document.swift +// Graphic Analysis 2 +// +// Created by Kilian Hofmann on 15.06.17. +// Copyright © 2017 Kilian Hofmann. All rights reserved. +// + +import Cocoa + +class Document: NSDocument { + + override init() { + super.init() + // Add your subclass-specific initialization here. + } + + override class func autosavesInPlace() -> Bool { + return true + } + + 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 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 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) + } + + +} + diff --git a/Graphic Analysis 2/Graph.icns b/Graphic Analysis 2/Graph.icns new file mode 100644 index 0000000..44e8156 Binary files /dev/null and b/Graphic Analysis 2/Graph.icns differ diff --git a/Graphic Analysis 2/GraphDetailsController.xib b/Graphic Analysis 2/GraphDetailsController.xib new file mode 100644 index 0000000..95b2661 --- /dev/null +++ b/Graphic Analysis 2/GraphDetailsController.xib @@ -0,0 +1,140 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Graphic Analysis 2/Info.plist b/Graphic Analysis 2/Info.plist new file mode 100644 index 0000000..acf7390 --- /dev/null +++ b/Graphic Analysis 2/Info.plist @@ -0,0 +1,81 @@ + + + + + CFBundleDevelopmentRegion + en + CFBundleDocumentTypes + + + CFBundleTypeExtensions + + docsisplist2 + + CFBundleTypeIconFile + Graph + CFBundleTypeName + Document + CFBundleTypeOSTypes + + ???? + + CFBundleTypeRole + Viewer + LSItemContentTypes + + com.alikja.DocumentType.docsisplist2 + + LSTypeIsPackage + 1 + NSDocumentClass + $(PRODUCT_MODULE_NAME).Document + + + CFBundleExecutable + $(EXECUTABLE_NAME) + CFBundleIdentifier + $(PRODUCT_BUNDLE_IDENTIFIER) + CFBundleInfoDictionaryVersion + 6.0 + CFBundleName + $(PRODUCT_NAME) + CFBundlePackageType + APPL + CFBundleShortVersionString + 2.0 + CFBundleVersion + 2 + LSApplicationCategoryType + public.app-category.utilities + LSMinimumSystemVersion + $(MACOSX_DEPLOYMENT_TARGET) + NSHumanReadableCopyright + Copyright © 2017 Kilian Hofmann. All rights reserved. + NSMainNibFile + MainMenu + NSPrincipalClass + NSApplication + UTExportedTypeDeclarations + + + UTTypeConformsTo + + com.apple.package + + UTTypeDescription + DocumentType + UTTypeIconFile + Graph + UTTypeIdentifier + com.alikja.DocumentType.docsisplist2 + UTTypeTagSpecification + + public.filename-extension + + docsisplist2 + + + + + + diff --git a/Graphic Analysis 2/MainMenu.xib b/Graphic Analysis 2/MainMenu.xib new file mode 100644 index 0000000..31bdac9 --- /dev/null +++ b/Graphic Analysis 2/MainMenu.xib @@ -0,0 +1,115 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Graphic Analysis 2/buildnum.ver b/Graphic Analysis 2/buildnum.ver new file mode 100644 index 0000000..eca97fd --- /dev/null +++ b/Graphic Analysis 2/buildnum.ver @@ -0,0 +1,2 @@ +version 2.0 +build 2 diff --git a/Logger4-Bridging-Header.h b/Logger4-Bridging-Header.h deleted file mode 100644 index 39c04d8..0000000 --- a/Logger4-Bridging-Header.h +++ /dev/null @@ -1,6 +0,0 @@ -// -// Use this file to import your target's public headers that you would like to -// expose to Swift. -// - -#import "XMLDictionary.h" diff --git a/Logger4/AppDelegate.swift b/Logger4/AppDelegate.swift index 4a178b6..e3bbb45 100644 --- a/Logger4/AppDelegate.swift +++ b/Logger4/AppDelegate.swift @@ -105,8 +105,8 @@ class AppDelegate: NSObject, NSApplicationDelegate { // MARK: - Logging Functions func logFreqs(_: Timer) { -// let frequencyOperation: FrequencyOperation = FrequencyOperation() -// OperationQueue.main.addOperation(frequencyOperation) + let frequencyOperation: FrequencyOperation = FrequencyOperation() + OperationQueue.main.addOperation(frequencyOperation) } func logFails(_: Timer) { diff --git a/Logger4/ConnectionLossOperation.swift b/Logger4/ConnectionLossOperation.swift index 8c3353c..77874f3 100644 --- a/Logger4/ConnectionLossOperation.swift +++ b/Logger4/ConnectionLossOperation.swift @@ -1,6 +1,6 @@ // // ConnectionLossOperation.swift -// Docsis Toolkit +// Logger4 // // Created by Kilian Hofmann on 15.06.17. // Copyright © 2017 Kilian Hofmann. All rights reserved. @@ -44,7 +44,21 @@ class ConnectionLossOperation: Operation { data, response, error in if error != nil && data == nil && self.result2 { - log(entry, path: file) + let fileH: FileHandle? = FileHandle(forUpdatingAtPath: file) + if fileH == nil { + do{ + try entry.write(toFile: file, atomically: true, encoding: .utf8) + } + catch { + NSLog("WRITE TO FILE FAILED\n"); + } + } else { + fileH?.seekToEndOfFile(); + let data = (entry as NSString).data(using: String.Encoding.utf8.rawValue) + fileH?.write(data!) + fileH?.closeFile() + } + self.result2 = false; NSLog("Internet loss logged!") } @@ -56,7 +70,20 @@ class ConnectionLossOperation: Operation { data, response, error in if error != nil && data == nil && self.result1 { - log(entry, path: file) + let fileH: FileHandle? = FileHandle(forUpdatingAtPath: file) + if fileH == nil { + do{ + try entry.write(toFile: file, atomically: true, encoding: .utf8) + } + catch { + NSLog("WRITE TO FILE \(file) FAILED\n"); + } + } else { + fileH?.seekToEndOfFile(); + let data = (entry as NSString).data(using: String.Encoding.utf8.rawValue) + fileH?.write(data!) + fileH?.closeFile() + } self.result1 = false; NSLog("Internet loss logged!") } diff --git a/Logger4/FrequencyOperation.swift b/Logger4/FrequencyOperation.swift index 087a3e1..258a0c4 100644 --- a/Logger4/FrequencyOperation.swift +++ b/Logger4/FrequencyOperation.swift @@ -1,6 +1,6 @@ // // FrequencyOperation.swift -// Docsis Toolkit +// Logger4 // // Created by Kilian Hofmann on 15.06.17. // Copyright © 2017 Kilian Hofmann. All rights reserved. @@ -17,6 +17,12 @@ class FrequencyOperation: Operation { let modulationAdjust: NSDictionary = ["qpsk": "-1.18", "8qam": "-0.21", "16qam": "-0.21", "32qam" : "0", "64qam": "0", "128qam": "0.05"] // XML Parser let parser: XMLDictionaryParser = XMLDictionaryParser() + // Data handling + var downstream: Data? + var upstream: Data? + var upstreamBool: Bool = false + var downstreamBool: Bool = false + var dir: NSString = "" override init() { @@ -30,7 +36,7 @@ class FrequencyOperation: Operation { let fileManager: FileManager = FileManager.default // Make all relevant directories if not present pthread_mutex_lock(&((NSApp.delegate as! AppDelegate).lock)) - let dir: NSString = NSString(format: "~/KDLog/%@.docsisplist2/%@/%@", start[2], start[1], start[0]) + dir = NSString(format: "~/KDLog/%@.docsisplist2/%@/%@/", start[2], start[1], start[0]) do { try fileManager.createDirectory(atPath: dir.expandingTildeInPath, withIntermediateDirectories: true, attributes: nil) } @@ -38,5 +44,232 @@ class FrequencyOperation: Operation { NSLog("ERROR ON SUBDIRECTORY CREATION: \(error.localizedDescription)") } pthread_mutex_unlock(&((NSApp.delegate as! AppDelegate).lock)) + // URL Requests + let requestDownstream: URLRequest = URLRequest.init(url: URL.init(string: UserDefaults.standard.string(forKey: "downstream")!)!, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 4) + let requestUpstream: URLRequest = URLRequest.init(url: URL.init(string: UserDefaults.standard.string(forKey: "upstream")!)!, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 4) + // Tasks + let taskDownstream: URLSessionDataTask = (NSApp.delegate as! AppDelegate).urlSession.dataTask(with: requestDownstream){data, response, error in + pthread_mutex_lock(&(NSApp.delegate as! AppDelegate).lock) + self.downstream = data + self.downstreamBool = true + self.handleData(date: time) + pthread_mutex_unlock(&(NSApp.delegate as! AppDelegate).lock) + } + + let taskUpstream: URLSessionDataTask = (NSApp.delegate as! AppDelegate).urlSession.dataTask(with: requestUpstream){data, response, error in + pthread_mutex_lock(&(NSApp.delegate as! AppDelegate).lock) + self.upstream = data + self.upstreamBool = true + self.handleData(date: time) + pthread_mutex_unlock(&(NSApp.delegate as! AppDelegate).lock) + } + // Start + taskUpstream.resume() + taskDownstream.resume() + } + + func handleData(date: Date) { + // Both returned successfully + if upstream != nil && downstream != nil { + // Parse data + upstreamBool = false + downstreamBool = false + let dictionaryUpstream: Dictionary? = parser.dictionary(with: upstream) + let dictionaryDownstream: Dictionary? = parser.dictionary(with: downstream) + upstream = nil + downstream = nil + // Tracking padding adding + var filesModified: [String] = [] + + // Upstream is valid + if dictionaryUpstream != nil{ + var entry: String = "" + var file: NSString = "" + // Grab channels + let channels: AnyObject = (dictionaryUpstream!["upstream_channel"]) as AnyObject + // We have multiple channels + if channels is [Dictionary] { + // Simplify + let channels: [Dictionary] = (channels as! [Dictionary]) + // Step through channels + for index in 0.. = channels[index] + // We do not have an error + if channel["upstream_modulation"] != nil && (channel["frequency"] as! String) != "status_error" { + // Grab power rating in dBmV + let powerInt: Double? = Double(channel["power_level"] as! String) + // We have valid power rating + if powerInt != nil { + // Grab modulation data + let modulation: NSObject = ((channel["upstream_modulation"]!)["modulation"])! as! NSObject + // Grab power adjustment see DOCSIS 3.0 Specification for more Information) + var adjust: String = "" + if modulation.isKind(of: NSArray.self) { + adjust = modulationAdjust[(((modulation as! NSArray)[0] as! NSDictionary)["mod_type"]!) as! String]! as! String + } else{ + adjust = modulationAdjust[((modulation as! NSDictionary)["mod_type"]!) as! String]! as! String + } + let adjustInt: Double = Double(adjust)! + // Add timestamp and power to file entry + entry = "\((NSApp.delegate as! AppDelegate).justTime.string(from: date));\(String(powerInt! + adjustInt));" + // Add threshold to file entry + switch channels.count { + case 2: + entry += "\(upstreamTwo[modulationAdjust.allKeys(for: adjust)[0] as! String]!)" + case 3: + entry += "\(upstreamThreeOrFour[modulationAdjust.allKeys(for: adjust)[0] as! String]!)" + case 4: + entry += "\(upstreamThreeOrFour[modulationAdjust.allKeys(for: adjust)[0] as! String]!)" + default: + entry += "NaN" + } + // Add ranging status + entry += ";\(channel["ranging_status"] as! String)\n" + // Add file name to path + file = dir.appending("Upstream \(channel["frequency"]!).csv") as NSString + // Track modification + filesModified.append("Upstream \(channel["frequency"]!).csv") + // Write to file + logFreq(header: ";Power Level;Threshold;Ranging Status\n", file: file, entry: entry) + } + } + } + } + // We have a single channel + else if channels is Dictionary { + // Grab channel + let channel: Dictionary = channels as! Dictionary + // We do not have an error + if channel["upstream_modulation"] != nil && channel["frequency"] as! String != "status_error" { + // Grab power rating in dBmV + let powerInt: Double? = Double(channel["power_level"] as! String) + // We have valid power rating + if powerInt != nil { + // Grab modulation data + let modulation: NSObject = ((channel["upstream_modulation"]!)["modulation"])! as! NSObject + // Grab power adjustment see DOCSIS 3.0 Specification for more Information) + var adjust: String = "" + if modulation.isKind(of: NSArray.self) { + adjust = modulationAdjust[(((modulation as! NSArray)[0] as! NSDictionary)["mod_type"]!) as! String]! as! String + } else{ + adjust = modulationAdjust[((modulation as! NSDictionary)["mod_type"]!) as! String]! as! String + } + let adjustInt: Double = Double(adjust)! + // Add data to entry + entry = "\((NSApp.delegate as! AppDelegate).justTime.string(from: date));\(String(powerInt! + adjustInt));\(upstreamOne[modulationAdjust.allKeys(for: adjust)[0] as! String]!);\(channel["ranging_status"] as! String)\n" + // Add file name to path + file = dir.appending("Upstream \(channel["frequency"]!).csv") as NSString + // Track modifiction + filesModified.append("Upstream \(channel["frequency"]!).csv") + // Write to file + logFreq(header: ";Power Level;Threshold;Ranging Status\n", file: file, entry: entry) + } + } + } + } + // Downstream is valid + if dictionaryDownstream != nil { + var entry: String = "" + var file: NSString = "" + // Grab channels + let channels: AnyObject = (dictionaryDownstream!["downstream_channel"]) as AnyObject + // We have multiple channels + if channels is [Dictionary] { + // Simplify + let channels: [Dictionary] = channels as! [Dictionary] + // Step through channels + for index in 0.. = channels[index] + // We do not have an error + if channel["frequency"] as! String != "status_error" { + // Add data to entry + entry = "\((NSApp.delegate as! AppDelegate).justTime.string(from: date));\(channel["power_level"]!);\(channel["snr"]!)\n" + // Add file name to path + file = dir.appending("Downstream \(channel["frequency"]!).csv") as NSString + // Tracking modification + filesModified.append("Downstream \(channel["frequency"]!).csv") + // Write to file + logFreq(header: ";Power;SNR\n", file: file, entry: entry) + } + } + } + // We have a single channel + else if channels is Dictionary { + // Grab channel + let channel: Dictionary = channels as! Dictionary + // We do not have an error + if channel["frequency"] as! String != "status_error" { + // Add data to entry + entry = "\((NSApp.delegate as! AppDelegate).justTime.string(from: date));\(channel["power_level"]!);\(channel["snr"]!)\n" + // Add file name to path + file = dir.appending("Downstream \(channel["frequency"]!).csv") as NSString + // Tracking modification + filesModified.append("Downstream \(channel["frequency"]!).csv") + // Write to file + logFreq(header: ";Power;SNR\n", file: file, entry: entry) + } + } + // Update if not modified + let fileManager = FileManager.default + // Get all filenames in directory + let enumerator:FileManager.DirectoryEnumerator = fileManager.enumerator(atPath: dir.expandingTildeInPath)! + // Step through files + for element in enumerator { + // Check if modified + if !filesModified.contains(element as! String) && (element as! String).contains(".csv") { + logDummie(dir: dir, element: element as! String, date: date) + } + } + } + // Update if both nil (no connection to modem possible) + else if (upstreamBool && downstreamBool) { + upstreamBool = false + downstreamBool = false + let fileManager = FileManager.default + // Get all filenames in directory + let enumerator:FileManager.DirectoryEnumerator = fileManager.enumerator(atPath: dir.expandingTildeInPath)! + // Step through files + for element in enumerator { + logDummie(dir: dir, element: element as! String, date: date) + } + } + } + } + + func logFreq(header: String, file: NSString, entry: String) { + let fileManager = FileManager.default + if !fileManager.fileExists(atPath: file.expandingTildeInPath) { + do { + try header.write(toFile: file.expandingTildeInPath, atomically: true, encoding: .utf8) + } + catch { + NSLog("WRITE TO FILE \(file.expandingTildeInPath) FAILED\n"); + return + } + } + let fileH: FileHandle? = FileHandle(forUpdatingAtPath: file.expandingTildeInPath) + fileH?.seekToEndOfFile() + let data: Data = (entry as NSString).data(using: String.Encoding.utf8.rawValue)! + fileH?.write(data) + fileH?.closeFile() + } + + func logDummie(dir: NSString, element: String, date: Date) { + // Get file + let file: FileHandle? = FileHandle(forUpdatingAtPath: dir.expandingTildeInPath.appending(element)) + if file != nil { + // Write appropriate null entry to file + file?.seekToEndOfFile(); + var data: Data?; + if element.contains("Upstream") { + data = ("\((NSApp.delegate as! AppDelegate).justTime.string(from: date));-;-;-\n" as NSString).data(using: String.Encoding.utf8.rawValue) + } else { + data = ("\((NSApp.delegate as! AppDelegate).justTime.string(from: date));-;-\n" as NSString).data(using: String.Encoding.utf8.rawValue) + } + file?.write(data!) + file?.closeFile() + } } } diff --git a/Logger4/Info.plist b/Logger4/Info.plist index 703c2a0..f1f78b7 100644 --- a/Logger4/Info.plist +++ b/Logger4/Info.plist @@ -17,7 +17,9 @@ CFBundleShortVersionString 4.0 CFBundleVersion - 13 + 26 + LSApplicationCategoryType + public.app-category.utilities LSMinimumSystemVersion $(MACOSX_DEPLOYMENT_TARGET) LSUIElement diff --git a/Logger4/Logger4-Bridging-Header.h b/Logger4/Logger4-Bridging-Header.h new file mode 100644 index 0000000..d253cb4 --- /dev/null +++ b/Logger4/Logger4-Bridging-Header.h @@ -0,0 +1,6 @@ +// +// Use this file to import your target's public headers that you would like to +// expose to Swift. +// + +#import "XMLDictionary.h" diff --git a/Logger4/SettingsWindowController.swift b/Logger4/SettingsWindowController.swift index 5ac8409..468298e 100644 --- a/Logger4/SettingsWindowController.swift +++ b/Logger4/SettingsWindowController.swift @@ -1,6 +1,6 @@ // // SettingsWindowController.swift -// Logger3 +// Logger4 // // Created by Kilian Hofmann on 15.08.16. // Copyright © 2016 Kilian Hofmann. All rights reserved. diff --git a/Logger4/Shared.swift b/Logger4/Shared.swift deleted file mode 100644 index 5163f5c..0000000 --- a/Logger4/Shared.swift +++ /dev/null @@ -1,26 +0,0 @@ -// -// Shared.swift -// Docsis Toolkit -// -// Created by Kilian Hofmann on 15.06.17. -// Copyright © 2017 Kilian Hofmann. All rights reserved. -// - -import Cocoa - -func log(_ entry: String, path: String) { - let file: FileHandle? = FileHandle(forUpdatingAtPath: path) - if file == nil { - do{ - try (entry).write(toFile: path, atomically: true, encoding: String.Encoding.utf8) - } - catch { - NSLog("WRITE TO FILE FAILED\n"); - } - } else { - file?.seekToEndOfFile(); - let data = (entry as NSString).data(using: String.Encoding.utf8.rawValue) - file?.write(data!) - file?.closeFile() - } -} diff --git a/XMLDictionary.h b/Logger4/XMLDictionary.h similarity index 100% rename from XMLDictionary.h rename to Logger4/XMLDictionary.h diff --git a/XMLDictionary.m b/Logger4/XMLDictionary.m similarity index 100% rename from XMLDictionary.m rename to Logger4/XMLDictionary.m diff --git a/Logger4/buildnum.ver b/Logger4/buildnum.ver index 3501c27..48c2f33 100644 --- a/Logger4/buildnum.ver +++ b/Logger4/buildnum.ver @@ -1,2 +1,2 @@ version 4.0 -build 13 +build 26