Fixed critical bug in loss logging functions (pointer realloced to early)
Implemented Converter tool -> needs refactoring toward non document based
This commit is contained in:
parent
086c8a0f94
commit
ca171e44f3
29
Converter/AppDelegate.swift
Normal file
29
Converter/AppDelegate.swift
Normal file
@ -0,0 +1,29 @@
|
||||
//
|
||||
// AppDelegate.swift
|
||||
// Converter
|
||||
//
|
||||
// Created by Kilian Hofmann on 20.06.17.
|
||||
// Copyright © 2017 Kilian Hofmann. All rights reserved.
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
|
||||
@NSApplicationMain
|
||||
class AppDelegate: NSObject, NSApplicationDelegate {
|
||||
|
||||
var isConverting: Bool = false
|
||||
|
||||
func applicationDidFinishLaunching(_ aNotification: Notification) {
|
||||
// Insert code here to initialize your application
|
||||
}
|
||||
|
||||
func applicationWillTerminate(_ aNotification: Notification) {
|
||||
// Insert code here to tear down your application
|
||||
}
|
||||
|
||||
func applicationShouldTerminate(_ sender: NSApplication) -> NSApplicationTerminateReply {
|
||||
guard isConverting else { return NSApplicationTerminateReply.terminateNow }
|
||||
return NSApplicationTerminateReply.terminateCancel
|
||||
}
|
||||
}
|
||||
|
||||
58
Converter/Assets.xcassets/AppIcon.appiconset/Contents.json
Normal file
58
Converter/Assets.xcassets/AppIcon.appiconset/Contents.json
Normal file
@ -0,0 +1,58 @@
|
||||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "16x16",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "16x16",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "32x32",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "32x32",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "128x128",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "128x128",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "256x256",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "256x256",
|
||||
"scale" : "2x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "512x512",
|
||||
"scale" : "1x"
|
||||
},
|
||||
{
|
||||
"idiom" : "mac",
|
||||
"size" : "512x512",
|
||||
"scale" : "2x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
||||
225
Converter/Base.lproj/Main.storyboard
Normal file
225
Converter/Base.lproj/Main.storyboard
Normal file
@ -0,0 +1,225 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="12121" systemVersion="16G16b" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<dependencies>
|
||||
<deployment identifier="macosx"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="12121"/>
|
||||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
|
||||
</dependencies>
|
||||
<scenes>
|
||||
<!--Application-->
|
||||
<scene sceneID="JPo-4y-FX3">
|
||||
<objects>
|
||||
<application id="hnw-xV-0zn" sceneMemberID="viewController">
|
||||
<menu key="mainMenu" title="Main Menu" systemMenu="main" id="AYu-sK-qS6">
|
||||
<items>
|
||||
<menuItem title="Converter" id="1Xt-HY-uBw">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Converter" systemMenu="apple" id="uQy-DD-JDr">
|
||||
<items>
|
||||
<menuItem title="About Converter" id="5kV-Vb-QxS">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="orderFrontStandardAboutPanel:" target="Ady-hI-5gd" id="Exp-CZ-Vem"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="VOq-y0-SEH"/>
|
||||
<menuItem title="Hide Converter" keyEquivalent="h" id="Olw-nP-bQN">
|
||||
<connections>
|
||||
<action selector="hide:" target="Ady-hI-5gd" id="PnN-Uc-m68"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Hide Others" keyEquivalent="h" id="Vdr-fp-XzO">
|
||||
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
|
||||
<connections>
|
||||
<action selector="hideOtherApplications:" target="Ady-hI-5gd" id="VT4-aY-XCT"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Show All" id="Kd2-mp-pUS">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="unhideAllApplications:" target="Ady-hI-5gd" id="Dhg-Le-xox"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="kCx-OE-vgT"/>
|
||||
<menuItem title="Quit Converter" keyEquivalent="q" id="4sb-4s-VLi">
|
||||
<connections>
|
||||
<action selector="terminate:" target="Ady-hI-5gd" id="Te7-pn-YzF"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="File" id="dMs-cI-mzQ">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="File" id="bib-Uj-vzu">
|
||||
<items>
|
||||
<menuItem title="Open…" keyEquivalent="o" id="IAo-SY-fd9">
|
||||
<connections>
|
||||
<action selector="openDocument:" target="Ady-hI-5gd" id="bVn-NM-KNZ"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
<menuItem title="Window" id="aUF-d1-5bR">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<menu key="submenu" title="Window" systemMenu="window" id="Td7-aD-5lo">
|
||||
<items>
|
||||
<menuItem title="Minimize" keyEquivalent="m" id="OY7-WF-poV">
|
||||
<connections>
|
||||
<action selector="performMiniaturize:" target="Ady-hI-5gd" id="VwT-WD-YPe"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem title="Zoom" id="R4o-n2-Eq4">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="performZoom:" target="Ady-hI-5gd" id="DIl-cC-cCs"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
<menuItem isSeparatorItem="YES" id="eu3-7i-yIM"/>
|
||||
<menuItem title="Bring All to Front" id="LE2-aR-0XJ">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
<connections>
|
||||
<action selector="arrangeInFront:" target="Ady-hI-5gd" id="DRN-fu-gQh"/>
|
||||
</connections>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="Voe-Tx-rLC" id="PrD-fu-P6m"/>
|
||||
</connections>
|
||||
</application>
|
||||
<customObject id="Voe-Tx-rLC" customClass="AppDelegate" customModule="Converter" customModuleProvider="target"/>
|
||||
<customObject id="Ady-hI-5gd" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="75" y="0.0"/>
|
||||
</scene>
|
||||
<!--Window Controller-->
|
||||
<scene sceneID="R2V-B0-nI4">
|
||||
<objects>
|
||||
<windowController storyboardIdentifier="Document Window Controller" id="jGA-0Y-lOj" sceneMemberID="viewController">
|
||||
<window key="window" title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" releasedWhenClosed="NO" showsToolbarButton="NO" visibleAtLaunch="NO" animationBehavior="default" id="Ckk-yw-fiv">
|
||||
<windowStyleMask key="styleMask" titled="YES" closable="YES"/>
|
||||
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
|
||||
<rect key="contentRect" x="196" y="240" width="480" height="270"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1680" height="1027"/>
|
||||
</window>
|
||||
<connections>
|
||||
<segue destination="5gI-5U-AMq" kind="relationship" relationship="window.shadowedContentViewController" id="nsd-lR-9xd"/>
|
||||
</connections>
|
||||
</windowController>
|
||||
<customObject id="6f7-a7-6o1" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="75" y="250"/>
|
||||
</scene>
|
||||
<!--View Controller-->
|
||||
<scene sceneID="hIz-AP-VOD">
|
||||
<objects>
|
||||
<viewController id="5gI-5U-AMq" customClass="ViewController" customModule="Converter" customModuleProvider="target" sceneMemberID="viewController">
|
||||
<view key="view" wantsLayer="YES" id="ERx-hH-rdd">
|
||||
<rect key="frame" x="0.0" y="0.0" width="227" height="297"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" allowsCharacterPickerTouchBarItem="NO" translatesAutoresizingMaskIntoConstraints="NO" id="hzt-CW-CBb">
|
||||
<rect key="frame" x="18" y="260" width="90" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Months in file:" id="TqK-dx-p75">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" allowsCharacterPickerTouchBarItem="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Fu9-FO-AvC">
|
||||
<rect key="frame" x="18" y="235" width="74" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Days in file:" id="0Oc-SD-wvm">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" allowsCharacterPickerTouchBarItem="NO" translatesAutoresizingMaskIntoConstraints="NO" id="QiI-iy-HKb">
|
||||
<rect key="frame" x="18" y="210" width="132" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Total amount of files:" id="rGw-YE-Eg4">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<button verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="v8x-Dd-KVt">
|
||||
<rect key="frame" x="10" y="174" width="89" height="32"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<buttonCell key="cell" type="push" title="Convert" bezelStyle="rounded" alignment="center" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="SeP-bt-Zu9">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="convertWithSender:" target="5gI-5U-AMq" id="n9e-uo-hco"/>
|
||||
</connections>
|
||||
</button>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" allowsCharacterPickerTouchBarItem="NO" translatesAutoresizingMaskIntoConstraints="NO" id="li2-hD-gp8">
|
||||
<rect key="frame" x="101" y="181" width="108" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="File %d out of %d" id="XNh-EM-ytf">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" allowsCharacterPickerTouchBarItem="NO" translatesAutoresizingMaskIntoConstraints="NO" id="XDX-Xk-VvX">
|
||||
<rect key="frame" x="158" y="210" width="49" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Label" id="4xa-6K-g1m">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" allowsCharacterPickerTouchBarItem="NO" translatesAutoresizingMaskIntoConstraints="NO" id="R5m-y0-Wxj">
|
||||
<rect key="frame" x="158" y="235" width="51" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Label" id="QEa-E3-1AL">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" allowsCharacterPickerTouchBarItem="NO" translatesAutoresizingMaskIntoConstraints="NO" id="N3D-YL-UMx">
|
||||
<rect key="frame" x="158" y="260" width="49" height="17"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" sendsActionOnEndEditing="YES" title="Label" id="Xn7-If-8GA">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="controlColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
<textField verticalHuggingPriority="750" fixedFrame="YES" allowsCharacterPickerTouchBarItem="NO" translatesAutoresizingMaskIntoConstraints="NO" id="jdB-hN-Uzl">
|
||||
<rect key="frame" x="16" y="151" width="189" height="22"/>
|
||||
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMinY="YES"/>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" sendsActionOnEndEditing="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="Zmq-Ps-mau">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
</textField>
|
||||
</subviews>
|
||||
</view>
|
||||
<connections>
|
||||
<outlet property="convert" destination="v8x-Dd-KVt" id="fRt-s9-UZj"/>
|
||||
<outlet property="days" destination="R5m-y0-Wxj" id="5zG-pX-1UY"/>
|
||||
<outlet property="files" destination="XDX-Xk-VvX" id="UK2-tq-iol"/>
|
||||
<outlet property="inPath" destination="jdB-hN-Uzl" id="gE1-Nh-rtC"/>
|
||||
<outlet property="months" destination="N3D-YL-UMx" id="Inh-DW-egq"/>
|
||||
<outlet property="progress" destination="li2-hD-gp8" id="CMp-XL-Cka"/>
|
||||
</connections>
|
||||
</viewController>
|
||||
<customObject id="2Tp-Fl-jBw" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
|
||||
</objects>
|
||||
<point key="canvasLocation" x="-51.5" y="668.5"/>
|
||||
</scene>
|
||||
</scenes>
|
||||
</document>
|
||||
71
Converter/Document.swift
Normal file
71
Converter/Document.swift
Normal file
@ -0,0 +1,71 @@
|
||||
//
|
||||
// Document.swift
|
||||
// Converter
|
||||
//
|
||||
// Created by Kilian Hofmann on 20.06.17.
|
||||
// Copyright © 2017 Kilian Hofmann. All rights reserved.
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
|
||||
class Document: NSDocument {
|
||||
|
||||
var file: FileWrapper!
|
||||
|
||||
override class func autosavesInPlace() -> Bool {
|
||||
return false
|
||||
}
|
||||
|
||||
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)
|
||||
windowController.window?.delegate = self
|
||||
|
||||
var Files: [String : [String : FileWrapper]] = [:]
|
||||
|
||||
var months: Int = (file.fileWrappers?.count)!
|
||||
if (file.fileWrappers?.contains(where: {$0.0 == ".DS_Store" }))! {
|
||||
months -= 1
|
||||
}
|
||||
(windowControllers.first?.contentViewController as! ViewController).months.stringValue = "\(months)"
|
||||
var days: Int = 0
|
||||
var files: Int = 0
|
||||
for months in file.fileWrappers! {
|
||||
guard months.value.isDirectory else { continue }
|
||||
days += (months.value.fileWrappers?.count)!
|
||||
if (months.value.fileWrappers?.contains(where: {$0.0 == ".DS_Store" }))! {
|
||||
days -= 1
|
||||
}
|
||||
for days in months.value.fileWrappers! {
|
||||
guard days.value.isDirectory else { continue }
|
||||
files += (days.value.fileWrappers?.count)!
|
||||
if (days.value.fileWrappers?.contains(where: {$0.0 == ".DS_Store" }))! {
|
||||
files -= 1
|
||||
}
|
||||
if (days.value.fileWrappers?.contains(where: {$0.0 == "Content.plist" }))! {
|
||||
files -= 1
|
||||
}
|
||||
Files[months.key] = (months.value.fileWrappers!)
|
||||
}
|
||||
}
|
||||
(windowControllers.first?.contentViewController as! ViewController).days.stringValue = "\(days)"
|
||||
(windowControllers.first?.contentViewController as! ViewController).files.stringValue = "\(files)"
|
||||
(windowControllers.first?.contentViewController as! ViewController).fileWrappers = Files
|
||||
(windowControllers.first?.contentViewController as! ViewController).filesTotal = files
|
||||
}
|
||||
|
||||
override func read(from fileWrapper: FileWrapper, ofType typeName: String) throws {
|
||||
file = fileWrapper
|
||||
}
|
||||
}
|
||||
|
||||
extension Document: NSWindowDelegate {
|
||||
|
||||
func windowShouldClose(_ sender: Any) -> Bool {
|
||||
guard (NSApp.delegate as! AppDelegate).isConverting else { return true }
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
53
Converter/Info.plist
Normal file
53
Converter/Info.plist
Normal file
@ -0,0 +1,53 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleDocumentTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>CFBundleTypeExtensions</key>
|
||||
<array>
|
||||
<string>docsisplist2</string>
|
||||
</array>
|
||||
<key>CFBundleTypeIconFile</key>
|
||||
<string></string>
|
||||
<key>CFBundleTypeName</key>
|
||||
<string>DocumentType</string>
|
||||
<key>CFBundleTypeOSTypes</key>
|
||||
<array>
|
||||
<string>????</string>
|
||||
</array>
|
||||
<key>CFBundleTypeRole</key>
|
||||
<string>Viewer</string>
|
||||
<key>NSDocumentClass</key>
|
||||
<string>$(PRODUCT_MODULE_NAME).Document</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>$(EXECUTABLE_NAME)</string>
|
||||
<key>CFBundleIconFile</key>
|
||||
<string></string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>$(PRODUCT_NAME)</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>$(MACOSX_DEPLOYMENT_TARGET)</string>
|
||||
<key>NSHumanReadableCopyright</key>
|
||||
<string>Copyright © 2017 Kilian Hofmann. All rights reserved.</string>
|
||||
<key>NSMainStoryboardFile</key>
|
||||
<string>Main</string>
|
||||
<key>NSPrincipalClass</key>
|
||||
<string>NSApplication</string>
|
||||
</dict>
|
||||
</plist>
|
||||
114
Converter/ViewController.swift
Normal file
114
Converter/ViewController.swift
Normal file
@ -0,0 +1,114 @@
|
||||
//
|
||||
// ViewController.swift
|
||||
// Converter
|
||||
//
|
||||
// Created by Kilian Hofmann on 20.06.17.
|
||||
// Copyright © 2017 Kilian Hofmann. All rights reserved.
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
|
||||
class ViewController: NSViewController {
|
||||
|
||||
@IBOutlet var months: NSTextField!
|
||||
@IBOutlet var days: NSTextField!
|
||||
@IBOutlet var files: NSTextField!
|
||||
@IBOutlet var progress: NSTextField!
|
||||
@IBOutlet var convert: NSButton!
|
||||
@IBOutlet var inPath: NSTextField!
|
||||
|
||||
var fileWrappers: [String : [String : FileWrapper]]!
|
||||
var filesDone: Int = 0
|
||||
var filesTotal: Int = 0
|
||||
|
||||
override func viewDidLoad() {
|
||||
super.viewDidLoad()
|
||||
|
||||
// Do any additional setup after loading the view.
|
||||
}
|
||||
|
||||
@IBAction func convert(sender: NSButton) {
|
||||
convert.isEnabled = false
|
||||
(NSApp.delegate as! AppDelegate).isConverting = true
|
||||
progress.stringValue = "File \(self.filesDone) of \(self.filesTotal)"
|
||||
|
||||
let opQueue: OperationQueue = OperationQueue()
|
||||
let fileQueue: OperationQueue = OperationQueue()
|
||||
fileQueue.maxConcurrentOperationCount = 4
|
||||
|
||||
let myActivity = ProcessInfo.processInfo.beginActivity(options: .userInitiated, reason: "Converting")
|
||||
opQueue.addOperation {
|
||||
defer {
|
||||
fileQueue.waitUntilAllOperationsAreFinished()
|
||||
ProcessInfo.processInfo.endActivity(myActivity)
|
||||
OperationQueue.main.addOperation {
|
||||
self.convert.isEnabled = true
|
||||
(NSApp.delegate as! AppDelegate).isConverting = false
|
||||
}
|
||||
}
|
||||
|
||||
let inP: String = self.inPath.stringValue
|
||||
|
||||
for month in 1...12 {
|
||||
for day in 1...31 {
|
||||
let path: String = inP + String(format: "/%02d", month) + String(format: "/%02d", day)
|
||||
do {
|
||||
let directory = try FileWrapper(url: URL(fileURLWithPath: path), options: .immediate)
|
||||
for file in directory.fileWrappers! {
|
||||
if file.key == "KDLog.txt" {
|
||||
let pathOut = path.appending("/" + file.key.replacingOccurrences(of: ".txt", with: ".hex")).replacingOccurrences(of: ".docsisplist2", with: "C.docsisplist2")
|
||||
//print(path.appending(file.key) + " to " + pathOut)
|
||||
self.makeSubDir(path: pathOut.replacingOccurrences(of: file.key.replacingOccurrences(of: ".txt", with: ".hex"), with: ""))
|
||||
FileOperations.convertLoss(log: path.appending("/" + file.key), toFile: pathOut)
|
||||
OperationQueue.main.addOperation {
|
||||
self.filesDone += 1
|
||||
self.progress.stringValue = "File \(self.filesDone) of \(self.filesTotal)"
|
||||
}
|
||||
} else if file.key.contains("Upstream") {
|
||||
let pathOut = path.appending("/" + file.key.replacingOccurrences(of: ".csv", with: ".hex")).replacingOccurrences(of: ".docsisplist2", with: "C.docsisplist2")
|
||||
//print(path.appending(file.key) + " to " + pathOut)
|
||||
self.makeSubDir(path: pathOut.replacingOccurrences(of: file.key.replacingOccurrences(of: ".csv", with: ".hex"), with: ""))
|
||||
FileOperations.convertUpstream(log: path.appending("/" + file.key), toFile: pathOut)
|
||||
OperationQueue.main.addOperation {
|
||||
self.filesDone += 1
|
||||
self.progress.stringValue = "File \(self.filesDone) of \(self.filesTotal)"
|
||||
}
|
||||
} else if file.key.contains("Downstream") {
|
||||
let pathOut = path.appending("/" + file.key.replacingOccurrences(of: ".csv", with: ".hex")).replacingOccurrences(of: ".docsisplist2", with: "C.docsisplist2")
|
||||
//print(path.appending(file.key) + " to " + pathOut)
|
||||
self.makeSubDir(path: pathOut.replacingOccurrences(of: file.key.replacingOccurrences(of: ".csv", with: ".hex"), with: ""))
|
||||
FileOperations.convertDownstream(log: path.appending("/" + file.key), toFile: pathOut)
|
||||
OperationQueue.main.addOperation {
|
||||
self.filesDone += 1
|
||||
self.progress.stringValue = "File \(self.filesDone) of \(self.filesTotal)"
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch _ { continue }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func makeSubDir(path: String) {
|
||||
// Check if directory exists, create or exit
|
||||
let fileManager = FileManager.default
|
||||
var directory: ObjCBool = ObjCBool(false)
|
||||
let exists: Bool = fileManager.fileExists(atPath: (path as NSString).expandingTildeInPath, isDirectory: &directory)
|
||||
if exists && directory.boolValue {
|
||||
} else if exists {
|
||||
NSLog("FILE WITH NAME KDLog EXISTS, REMOVE IT")
|
||||
exit(1);
|
||||
}
|
||||
else {
|
||||
do {
|
||||
try fileManager.createDirectory(atPath: (path as NSString).expandingTildeInPath, withIntermediateDirectories: true, attributes: nil)
|
||||
}
|
||||
catch let error as NSError {
|
||||
NSLog("ERROR ON DIRECTORY CREATION: \(error.localizedDescription)")
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -35,6 +35,7 @@
|
||||
E2268DF91EF7095100C97726 /* PDFTitle.xib in Resources */ = {isa = PBXBuildFile; fileRef = E2268DF71EF7095100C97726 /* PDFTitle.xib */; };
|
||||
E23E2C621EF7FE530009D376 /* FileOperations.swift in Sources */ = {isa = PBXBuildFile; fileRef = E23E2C611EF7FE530009D376 /* FileOperations.swift */; };
|
||||
E23E2C631EF7FE530009D376 /* FileOperations.swift in Sources */ = {isa = PBXBuildFile; fileRef = E23E2C611EF7FE530009D376 /* FileOperations.swift */; };
|
||||
E25E24941EFB186000F39C01 /* GraphLoadOperation.swift in Sources */ = {isa = PBXBuildFile; fileRef = E25E24931EFB186000F39C01 /* GraphLoadOperation.swift */; };
|
||||
E262463E1EF55BCE00EAA4A6 /* GraphWindow.swift in Sources */ = {isa = PBXBuildFile; fileRef = E262463C1EF55BCE00EAA4A6 /* GraphWindow.swift */; };
|
||||
E262463F1EF55BCE00EAA4A6 /* GraphWindow.xib in Resources */ = {isa = PBXBuildFile; fileRef = E262463D1EF55BCE00EAA4A6 /* GraphWindow.xib */; };
|
||||
E26246441EF5E64900EAA4A6 /* PDFDraw.swift in Sources */ = {isa = PBXBuildFile; fileRef = E26246421EF5E64900EAA4A6 /* PDFDraw.swift */; };
|
||||
@ -43,6 +44,12 @@
|
||||
E26246491EF6688400EAA4A6 /* PDFItemViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E26246481EF6688400EAA4A6 /* PDFItemViewController.swift */; };
|
||||
E27A9DB51EF995C1000BC7A3 /* FrequencyGraph.swift in Sources */ = {isa = PBXBuildFile; fileRef = E27A9DB41EF995C1000BC7A3 /* FrequencyGraph.swift */; };
|
||||
E27A9DB91EF99C20000BC7A3 /* FlippedView.swift in Sources */ = {isa = PBXBuildFile; fileRef = E27A9DB81EF99C20000BC7A3 /* FlippedView.swift */; };
|
||||
E27A9DC11EF9B7FD000BC7A3 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = E27A9DC01EF9B7FD000BC7A3 /* AppDelegate.swift */; };
|
||||
E27A9DC31EF9B7FD000BC7A3 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E27A9DC21EF9B7FD000BC7A3 /* ViewController.swift */; };
|
||||
E27A9DC51EF9B7FD000BC7A3 /* Document.swift in Sources */ = {isa = PBXBuildFile; fileRef = E27A9DC41EF9B7FD000BC7A3 /* Document.swift */; };
|
||||
E27A9DC71EF9B7FD000BC7A3 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = E27A9DC61EF9B7FD000BC7A3 /* Assets.xcassets */; };
|
||||
E27A9DCA1EF9B7FD000BC7A3 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = E27A9DC81EF9B7FD000BC7A3 /* Main.storyboard */; };
|
||||
E27A9DCF1EF9D0E3000BC7A3 /* FileOperations.swift in Sources */ = {isa = PBXBuildFile; fileRef = E23E2C611EF7FE530009D376 /* FileOperations.swift */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXContainerItemProxy section */
|
||||
@ -99,6 +106,7 @@
|
||||
E2268DF61EF7095100C97726 /* PDFTitle.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PDFTitle.swift; sourceTree = "<group>"; };
|
||||
E2268DF71EF7095100C97726 /* PDFTitle.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = PDFTitle.xib; sourceTree = "<group>"; };
|
||||
E23E2C611EF7FE530009D376 /* FileOperations.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FileOperations.swift; sourceTree = "<group>"; };
|
||||
E25E24931EFB186000F39C01 /* GraphLoadOperation.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GraphLoadOperation.swift; sourceTree = "<group>"; };
|
||||
E262463C1EF55BCE00EAA4A6 /* GraphWindow.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = GraphWindow.swift; sourceTree = "<group>"; };
|
||||
E262463D1EF55BCE00EAA4A6 /* GraphWindow.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = GraphWindow.xib; sourceTree = "<group>"; };
|
||||
E26246421EF5E64900EAA4A6 /* PDFDraw.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PDFDraw.swift; sourceTree = "<group>"; };
|
||||
@ -107,6 +115,13 @@
|
||||
E26246481EF6688400EAA4A6 /* PDFItemViewController.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PDFItemViewController.swift; sourceTree = "<group>"; };
|
||||
E27A9DB41EF995C1000BC7A3 /* FrequencyGraph.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FrequencyGraph.swift; sourceTree = "<group>"; };
|
||||
E27A9DB81EF99C20000BC7A3 /* FlippedView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FlippedView.swift; sourceTree = "<group>"; };
|
||||
E27A9DBE1EF9B7FD000BC7A3 /* Converter.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Converter.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
E27A9DC01EF9B7FD000BC7A3 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
|
||||
E27A9DC21EF9B7FD000BC7A3 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
|
||||
E27A9DC41EF9B7FD000BC7A3 /* Document.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Document.swift; sourceTree = "<group>"; };
|
||||
E27A9DC61EF9B7FD000BC7A3 /* Assets.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Assets.xcassets; sourceTree = "<group>"; };
|
||||
E27A9DC91EF9B7FD000BC7A3 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; name = Base; path = Base.lproj/Main.storyboard; sourceTree = "<group>"; };
|
||||
E27A9DCB1EF9B7FD000BC7A3 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
@ -125,6 +140,13 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
E27A9DBB1EF9B7FD000BC7A3 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
@ -134,6 +156,7 @@
|
||||
E2218CA71EF2D35B004298F6 /* Shared Resources */,
|
||||
E2218C991EF2D345004298F6 /* Logger4 */,
|
||||
E2218D2A1EF3271F004298F6 /* Graphic Analysis 2 */,
|
||||
E27A9DBF1EF9B7FD000BC7A3 /* Converter */,
|
||||
E2218C831EF2D2B5004298F6 /* Products */,
|
||||
E2218D651EF463B4004298F6 /* Frameworks */,
|
||||
);
|
||||
@ -144,6 +167,7 @@
|
||||
children = (
|
||||
E2218C981EF2D345004298F6 /* Logger4.app */,
|
||||
E2218D291EF3271F004298F6 /* Graphic Analysis 2.app */,
|
||||
E27A9DBE1EF9B7FD000BC7A3 /* Converter.app */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
@ -303,6 +327,7 @@
|
||||
E2218D4F1EF329C0004298F6 /* Operations */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
E25E24931EFB186000F39C01 /* GraphLoadOperation.swift */,
|
||||
);
|
||||
name = Operations;
|
||||
sourceTree = "<group>";
|
||||
@ -395,6 +420,19 @@
|
||||
name = Swift;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
E27A9DBF1EF9B7FD000BC7A3 /* Converter */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
E27A9DC01EF9B7FD000BC7A3 /* AppDelegate.swift */,
|
||||
E27A9DC21EF9B7FD000BC7A3 /* ViewController.swift */,
|
||||
E27A9DC41EF9B7FD000BC7A3 /* Document.swift */,
|
||||
E27A9DC61EF9B7FD000BC7A3 /* Assets.xcassets */,
|
||||
E27A9DC81EF9B7FD000BC7A3 /* Main.storyboard */,
|
||||
E27A9DCB1EF9B7FD000BC7A3 /* Info.plist */,
|
||||
);
|
||||
path = Converter;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXLegacyTarget section */
|
||||
@ -465,6 +503,23 @@
|
||||
productReference = E2218D291EF3271F004298F6 /* Graphic Analysis 2.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
E27A9DBD1EF9B7FD000BC7A3 /* Converter */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = E27A9DCC1EF9B7FD000BC7A3 /* Build configuration list for PBXNativeTarget "Converter" */;
|
||||
buildPhases = (
|
||||
E27A9DBA1EF9B7FD000BC7A3 /* Sources */,
|
||||
E27A9DBB1EF9B7FD000BC7A3 /* Frameworks */,
|
||||
E27A9DBC1EF9B7FD000BC7A3 /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = Converter;
|
||||
productName = Converter;
|
||||
productReference = E27A9DBE1EF9B7FD000BC7A3 /* Converter.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
@ -496,6 +551,11 @@
|
||||
DevelopmentTeam = 795KPDV76S;
|
||||
ProvisioningStyle = Automatic;
|
||||
};
|
||||
E27A9DBD1EF9B7FD000BC7A3 = {
|
||||
CreatedOnToolsVersion = 8.3.3;
|
||||
DevelopmentTeam = 795KPDV76S;
|
||||
ProvisioningStyle = Automatic;
|
||||
};
|
||||
};
|
||||
};
|
||||
buildConfigurationList = E2218C7D1EF2D2B5004298F6 /* Build configuration list for PBXProject "Docsis Toolkit" */;
|
||||
@ -515,6 +575,7 @@
|
||||
E2218CE51EF2D577004298F6 /* Bump Logger4 */,
|
||||
E2218D281EF3271F004298F6 /* Graphic Analysis 2 */,
|
||||
E2218D3D1EF32803004298F6 /* Bump Graphic Analysis 2 */,
|
||||
E27A9DBD1EF9B7FD000BC7A3 /* Converter */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
@ -548,6 +609,15 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
E27A9DBC1EF9B7FD000BC7A3 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
E27A9DC71EF9B7FD000BC7A3 /* Assets.xcassets in Resources */,
|
||||
E27A9DCA1EF9B7FD000BC7A3 /* Main.storyboard in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
@ -574,6 +644,7 @@
|
||||
E2218D621EF41415004298F6 /* CollectionViewMonth.swift in Sources */,
|
||||
E23E2C631EF7FE530009D376 /* FileOperations.swift in Sources */,
|
||||
E2218D601EF40E23004298F6 /* CollectionViewYear.swift in Sources */,
|
||||
E25E24941EFB186000F39C01 /* GraphLoadOperation.swift in Sources */,
|
||||
E262463E1EF55BCE00EAA4A6 /* GraphWindow.swift in Sources */,
|
||||
E26246491EF6688400EAA4A6 /* PDFItemViewController.swift in Sources */,
|
||||
E2218D641EF45F37004298F6 /* LossDistributionPie.swift in Sources */,
|
||||
@ -586,6 +657,17 @@
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
E27A9DBA1EF9B7FD000BC7A3 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
E27A9DCF1EF9D0E3000BC7A3 /* FileOperations.swift in Sources */,
|
||||
E27A9DC31EF9B7FD000BC7A3 /* ViewController.swift in Sources */,
|
||||
E27A9DC11EF9B7FD000BC7A3 /* AppDelegate.swift in Sources */,
|
||||
E27A9DC51EF9B7FD000BC7A3 /* Document.swift in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXTargetDependency section */
|
||||
@ -601,6 +683,17 @@
|
||||
};
|
||||
/* End PBXTargetDependency section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
E27A9DC81EF9B7FD000BC7A3 /* Main.storyboard */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
E27A9DC91EF9B7FD000BC7A3 /* Base */,
|
||||
);
|
||||
name = Main.storyboard;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
E2218C8F1EF2D2B5004298F6 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
@ -818,6 +911,36 @@
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
E27A9DCD1EF9B7FD000BC7A3 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
DEVELOPMENT_TEAM = 795KPDV76S;
|
||||
INFOPLIST_FILE = Converter/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.12;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.weebly.alikja.Converter;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 3.0;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
E27A9DCE1EF9B7FD000BC7A3 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
|
||||
COMBINE_HIDPI_IMAGES = YES;
|
||||
DEVELOPMENT_TEAM = 795KPDV76S;
|
||||
INFOPLIST_FILE = Converter/Info.plist;
|
||||
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/../Frameworks";
|
||||
MACOSX_DEPLOYMENT_TARGET = 10.12;
|
||||
PRODUCT_BUNDLE_IDENTIFIER = com.weebly.alikja.Converter;
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
SWIFT_VERSION = 3.0;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
@ -866,6 +989,15 @@
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
E27A9DCC1EF9B7FD000BC7A3 /* Build configuration list for PBXNativeTarget "Converter" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
E27A9DCD1EF9B7FD000BC7A3 /* Debug */,
|
||||
E27A9DCE1EF9B7FD000BC7A3 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = E2218C7A1EF2D2B5004298F6 /* Project object */;
|
||||
|
||||
@ -0,0 +1,91 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<Scheme
|
||||
LastUpgradeVersion = "0830"
|
||||
version = "1.3">
|
||||
<BuildAction
|
||||
parallelizeBuildables = "YES"
|
||||
buildImplicitDependencies = "YES">
|
||||
<BuildActionEntries>
|
||||
<BuildActionEntry
|
||||
buildForTesting = "YES"
|
||||
buildForRunning = "YES"
|
||||
buildForProfiling = "YES"
|
||||
buildForArchiving = "YES"
|
||||
buildForAnalyzing = "YES">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "E27A9DBD1EF9B7FD000BC7A3"
|
||||
BuildableName = "Converter.app"
|
||||
BlueprintName = "Converter"
|
||||
ReferencedContainer = "container:Docsis Toolkit.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildActionEntry>
|
||||
</BuildActionEntries>
|
||||
</BuildAction>
|
||||
<TestAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES">
|
||||
<Testables>
|
||||
</Testables>
|
||||
<MacroExpansion>
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "E27A9DBD1EF9B7FD000BC7A3"
|
||||
BuildableName = "Converter.app"
|
||||
BlueprintName = "Converter"
|
||||
ReferencedContainer = "container:Docsis Toolkit.xcodeproj">
|
||||
</BuildableReference>
|
||||
</MacroExpansion>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</TestAction>
|
||||
<LaunchAction
|
||||
buildConfiguration = "Debug"
|
||||
selectedDebuggerIdentifier = "Xcode.DebuggerFoundation.Debugger.LLDB"
|
||||
selectedLauncherIdentifier = "Xcode.DebuggerFoundation.Launcher.LLDB"
|
||||
launchStyle = "0"
|
||||
useCustomWorkingDirectory = "NO"
|
||||
ignoresPersistentStateOnLaunch = "NO"
|
||||
debugDocumentVersioning = "YES"
|
||||
debugServiceExtension = "internal"
|
||||
allowLocationSimulation = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "E27A9DBD1EF9B7FD000BC7A3"
|
||||
BuildableName = "Converter.app"
|
||||
BlueprintName = "Converter"
|
||||
ReferencedContainer = "container:Docsis Toolkit.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
<AdditionalOptions>
|
||||
</AdditionalOptions>
|
||||
</LaunchAction>
|
||||
<ProfileAction
|
||||
buildConfiguration = "Release"
|
||||
shouldUseLaunchSchemeArgsEnv = "YES"
|
||||
savedToolIdentifier = ""
|
||||
useCustomWorkingDirectory = "NO"
|
||||
debugDocumentVersioning = "YES">
|
||||
<BuildableProductRunnable
|
||||
runnableDebuggingMode = "0">
|
||||
<BuildableReference
|
||||
BuildableIdentifier = "primary"
|
||||
BlueprintIdentifier = "E27A9DBD1EF9B7FD000BC7A3"
|
||||
BuildableName = "Converter.app"
|
||||
BlueprintName = "Converter"
|
||||
ReferencedContainer = "container:Docsis Toolkit.xcodeproj">
|
||||
</BuildableReference>
|
||||
</BuildableProductRunnable>
|
||||
</ProfileAction>
|
||||
<AnalyzeAction
|
||||
buildConfiguration = "Debug">
|
||||
</AnalyzeAction>
|
||||
<ArchiveAction
|
||||
buildConfiguration = "Release"
|
||||
revealArchiveInOrganizer = "YES">
|
||||
</ArchiveAction>
|
||||
</Scheme>
|
||||
@ -9,6 +9,11 @@
|
||||
<key>orderHint</key>
|
||||
<integer>2</integer>
|
||||
</dict>
|
||||
<key>Converter.xcscheme</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
<integer>3</integer>
|
||||
</dict>
|
||||
<key>Graphic Analysis 2.xcscheme</key>
|
||||
<dict>
|
||||
<key>orderHint</key>
|
||||
@ -47,6 +52,11 @@
|
||||
<key>primary</key>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>E27A9DBD1EF9B7FD000BC7A3</key>
|
||||
<dict>
|
||||
<key>primary</key>
|
||||
<true/>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
|
||||
@ -29,7 +29,7 @@ class FileOperations: NSObject {
|
||||
let seconds: UInt32 = (stamp >> 4) & 0b111111
|
||||
let minutes: UInt32 = (stamp >> 10) & 0b111111
|
||||
let hours: UInt32 = (stamp >> 16) & 0b11111
|
||||
return ("\(hours):\(minutes):\(seconds)", mappingDecode[threshold] ?? "\(15)")
|
||||
return ("\(String(format: "%02d", hours)):\(String(format: "%02d", minutes)):\(String(format: "%02d", seconds))", mappingDecode[threshold] ?? "\(15)")
|
||||
|
||||
}
|
||||
|
||||
@ -39,7 +39,6 @@ class FileOperations: NSObject {
|
||||
let dataToWrite = encodeTimeStamp(stamp: data, threshold: "")
|
||||
let file: UnsafeMutableRawPointer = UnsafeMutableRawPointer.allocate(bytes: 3, alignedTo: 1)
|
||||
file.storeBytes(of: dataToWrite, as: UInt32.self)
|
||||
file.deallocate(bytes: 3, alignedTo: 1)
|
||||
do {
|
||||
let fileData: NSMutableData = try NSMutableData(contentsOf: URL(fileURLWithPath: path))
|
||||
fileData.append(file, length: 3)
|
||||
@ -49,6 +48,17 @@ class FileOperations: NSObject {
|
||||
fileData.append(file, length: 3)
|
||||
fileData.write(to: URL(fileURLWithPath: path), atomically: true)
|
||||
}
|
||||
file.deallocate(bytes: 3, alignedTo: 1)
|
||||
}
|
||||
|
||||
static func log(data: String, toData out: inout Data) {
|
||||
let dataToWrite = encodeTimeStamp(stamp: data, threshold: "")
|
||||
let file: UnsafeMutableRawPointer = UnsafeMutableRawPointer.allocate(bytes: 3, alignedTo: 1)
|
||||
file.storeBytes(of: dataToWrite, as: UInt32.self)
|
||||
let fileData: NSMutableData = NSMutableData()
|
||||
fileData.append(file, length: 3)
|
||||
out.append(fileData as Data)
|
||||
file.deallocate(bytes: 3, alignedTo: 1)
|
||||
}
|
||||
|
||||
static func load(log Data: NSData) -> [String]? {
|
||||
@ -94,6 +104,25 @@ class FileOperations: NSObject {
|
||||
}
|
||||
}
|
||||
|
||||
static func logUpstream(data: String, toData out: inout Data) {
|
||||
let separated: Array<String> = data.components(separatedBy: ";")
|
||||
var encodedTime: UInt32 = encodeTimeStamp(stamp: separated[0], threshold: separated[2])
|
||||
// NaN Used for -
|
||||
var encodedPower: Int32 = Int32.min
|
||||
if (Double(separated[1]) != nil) {
|
||||
encodedPower = Int32(Double(Double(separated[1])! * 100.0))
|
||||
}
|
||||
var stringSize: UInt8 = UInt8(separated[3].lengthOfBytes(using: .ascii))
|
||||
|
||||
let fileContent: NSMutableData = NSMutableData()
|
||||
fileContent.append(&stringSize, length: 1)
|
||||
fileContent.append(&encodedTime, length: 3)
|
||||
fileContent.append(&encodedPower, length: 4)
|
||||
fileContent.append(separated[3].data(using: .ascii)!)
|
||||
|
||||
out.append(fileContent as Data)
|
||||
}
|
||||
|
||||
static func logDownstream(data: String, toFrequencyLog path: String) {
|
||||
let separated: Array<String> = data.components(separatedBy: ";")
|
||||
var encodedTime: UInt32 = encodeTimeStamp(stamp: separated[0], threshold: "")
|
||||
@ -117,6 +146,25 @@ class FileOperations: NSObject {
|
||||
fileContent.write(to: URL(fileURLWithPath: path), atomically: true)
|
||||
}
|
||||
}
|
||||
|
||||
static func logDownstream(data: String, toData out: inout Data) {
|
||||
let separated: Array<String> = data.components(separatedBy: ";")
|
||||
var encodedTime: UInt32 = encodeTimeStamp(stamp: separated[0], threshold: "")
|
||||
// NaN Used for -
|
||||
var encodedPower: Int32 = Int32.min
|
||||
if (Double(separated[1]) != nil) {
|
||||
encodedPower = Int32(Double(Double(separated[1])! * 100.0))
|
||||
}
|
||||
var encodedSNR = UInt8(separated[2]) ?? UInt8.max
|
||||
|
||||
let fileContent: NSMutableData = NSMutableData()
|
||||
fileContent.append(&encodedTime, length: 3)
|
||||
fileContent.append(&encodedPower, length: 4)
|
||||
fileContent.append(&encodedSNR, length: 1)
|
||||
|
||||
out.append(fileContent as Data)
|
||||
}
|
||||
|
||||
|
||||
// MARK: - Frequency loading (decoding)
|
||||
|
||||
@ -230,4 +278,53 @@ class FileOperations: NSObject {
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// MARK: - Convert
|
||||
|
||||
static func convertLoss(log path: String, toFile pathOut: String) {
|
||||
do {
|
||||
var data: [String] = NSString(data: try NSData(contentsOfFile: path) as Data, encoding: String.Encoding.ascii.rawValue)!.components(separatedBy: "\n")
|
||||
data.removeLast()
|
||||
var dataOut: Data = Data()
|
||||
for entry in data {
|
||||
log(data: entry, toData: &dataOut)
|
||||
}
|
||||
(dataOut as NSData).write(toFile: pathOut, atomically: true)
|
||||
} catch {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
static func convertUpstream(log path: String, toFile pathOut: String) {
|
||||
do {
|
||||
var data: [String] = NSString(data: try NSData(contentsOfFile: path) as Data, encoding: String.Encoding.ascii.rawValue)!.components(separatedBy: "\n")
|
||||
data.removeLast()
|
||||
data.removeFirst()
|
||||
var dataOut: Data = Data()
|
||||
for var entry in data {
|
||||
if entry.components(separatedBy: ";").count < 4 {
|
||||
entry.append(";-")
|
||||
}
|
||||
logUpstream(data: entry, toData: &dataOut)
|
||||
}
|
||||
(dataOut as NSData).write(toFile: pathOut, atomically: true)
|
||||
} catch {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
static func convertDownstream(log path: String, toFile pathOut: String) {
|
||||
do {
|
||||
var data: [String] = NSString(data: try NSData(contentsOfFile: path) as Data, encoding: String.Encoding.ascii.rawValue)!.components(separatedBy: "\n")
|
||||
data.removeLast()
|
||||
data.removeFirst()
|
||||
var dataOut: Data = Data()
|
||||
for entry in data {
|
||||
logDownstream(data: entry, toData: &dataOut)
|
||||
}
|
||||
(dataOut as NSData).write(toFile: pathOut, atomically: true)
|
||||
} catch {
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -92,7 +92,7 @@ class FrequencyGraph: NSView {
|
||||
}
|
||||
}
|
||||
|
||||
func initView() {
|
||||
func initView(operation: GraphLoadOperation) {
|
||||
// Setup Indicator
|
||||
// Zero line
|
||||
let zero: NSBezierPath = NSBezierPath()
|
||||
@ -102,6 +102,9 @@ class FrequencyGraph: NSView {
|
||||
// Add data points
|
||||
var lastWasSkipped: Bool = false
|
||||
for point in 0..<data.count {
|
||||
if operation.isCancelled {
|
||||
return
|
||||
}
|
||||
// Get values
|
||||
let level: Double? = Double(data[point].components(separatedBy: ";")[1])
|
||||
let threshold: Double? = Double(data[point].components(separatedBy: ";")[2])
|
||||
|
||||
36
Graphic Analysis 2/GraphLoadOperation.swift
Normal file
36
Graphic Analysis 2/GraphLoadOperation.swift
Normal file
@ -0,0 +1,36 @@
|
||||
//
|
||||
// GraphLoadOperation.swift
|
||||
// Docsis Toolkit
|
||||
//
|
||||
// Created by Kilian Hofmann on 21.06.17.
|
||||
// Copyright © 2017 Kilian Hofmann. All rights reserved.
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
|
||||
class GraphLoadOperation: Operation {
|
||||
|
||||
var graph: FrequencyGraph!
|
||||
var item: FileWrapper!
|
||||
var downstream: Bool!
|
||||
|
||||
init(graph: FrequencyGraph, item: FileWrapper, downstream: Bool) {
|
||||
self.graph = graph
|
||||
self.item = item
|
||||
self.downstream = downstream
|
||||
}
|
||||
|
||||
override func main() {
|
||||
if isCancelled {
|
||||
return
|
||||
}
|
||||
if downstream {
|
||||
graph.data = FileOperations.loadDownstream(log: item.regularFileContents! as NSData)!
|
||||
} else {
|
||||
graph.data = FileOperations.loadUpstream(log: item.regularFileContents! as NSData)!
|
||||
}
|
||||
let keyString: String = item.filename!.components(separatedBy: " ")[1]
|
||||
graph.frequency = Double(keyString.substring(to: keyString.index(keyString.endIndex, offsetBy: -4)))! / 1000000
|
||||
graph.initView(operation: self)
|
||||
}
|
||||
}
|
||||
@ -12,6 +12,7 @@ class GraphWindow: NSWindowController {
|
||||
|
||||
var collectionViewItem: CollectionViewItemMonth!
|
||||
@IBOutlet var scrollView: NSScrollView!
|
||||
let opQueue: OperationQueue = OperationQueue()
|
||||
|
||||
override var windowNibName: String! {
|
||||
return "GraphWindow"
|
||||
@ -24,6 +25,7 @@ class GraphWindow: NSWindowController {
|
||||
init(collectionViewItem: CollectionViewItemMonth) {
|
||||
super.init(window: nil)
|
||||
self.collectionViewItem = collectionViewItem
|
||||
opQueue.maxConcurrentOperationCount = 4
|
||||
}
|
||||
|
||||
override func windowDidLoad() {
|
||||
@ -49,25 +51,13 @@ class GraphWindow: NSWindowController {
|
||||
for item in upstreamFiles {
|
||||
let graph: FrequencyGraph = FrequencyGraph(upstream: true, frame: NSMakeRect(0, CGFloat(numGraphs * FrequencyGraph.graphSizeWithSeparator), CGFloat(FrequencyGraph.maxGraphSize), CGFloat(FrequencyGraph.graphSize)), superview: content)
|
||||
graph.dataLoss = collectionViewItem.distribution
|
||||
graph.data = FileOperations.loadUpstream(log: item.regularFileContents! as NSData)!
|
||||
let keyString: String = item.filename!.components(separatedBy: " ")[1]
|
||||
graph.frequency = Double(keyString.substring(to: keyString.index(keyString.endIndex, offsetBy: -4)))! / 1000000
|
||||
let opQueue: OperationQueue = OperationQueue()
|
||||
opQueue.addOperation {
|
||||
graph.initView()
|
||||
}
|
||||
opQueue.addOperation(GraphLoadOperation(graph: graph, item: item, downstream: false))
|
||||
numGraphs += 1
|
||||
}
|
||||
for item in downstreamFiles {
|
||||
let graph: FrequencyGraph = FrequencyGraph(upstream: false, frame: NSMakeRect(0, CGFloat(numGraphs * FrequencyGraph.graphSizeWithSeparator), CGFloat(FrequencyGraph.maxGraphSize), CGFloat(FrequencyGraph.graphSize)), superview: content)
|
||||
graph.dataLoss = collectionViewItem.distribution
|
||||
graph.data = FileOperations.loadDownstream(log: item.regularFileContents! as NSData)!
|
||||
let keyString: String = item.filename!.components(separatedBy: " ")[1]
|
||||
graph.frequency = Double(keyString.substring(to: keyString.index(keyString.endIndex, offsetBy: -4)))! / 1000000
|
||||
let opQueue: OperationQueue = OperationQueue()
|
||||
opQueue.addOperation {
|
||||
graph.initView()
|
||||
}
|
||||
opQueue.addOperation(GraphLoadOperation(graph: graph, item: item, downstream: true))
|
||||
numGraphs += 1
|
||||
}
|
||||
}
|
||||
@ -75,6 +65,7 @@ class GraphWindow: NSWindowController {
|
||||
|
||||
extension GraphWindow: NSWindowDelegate {
|
||||
func windowShouldClose(_ sender: Any) -> Bool {
|
||||
opQueue.cancelAllOperations()
|
||||
collectionViewItem?.isSelected = false
|
||||
collectionViewItem?.view.layer?.borderColor = NSColor.clear.cgColor
|
||||
return true
|
||||
|
||||
@ -16,33 +16,33 @@
|
||||
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
|
||||
<window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" releasedWhenClosed="NO" animationBehavior="default" id="F0z-JX-Cv5">
|
||||
<windowStyleMask key="styleMask" titled="YES" closable="YES" miniaturizable="YES" resizable="YES"/>
|
||||
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
|
||||
<rect key="contentRect" x="196" y="240" width="480" height="270"/>
|
||||
<windowPositionMask key="initialPositionMask" bottomStrut="YES"/>
|
||||
<rect key="contentRect" x="240" y="267" width="853" height="533"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1280" height="800"/>
|
||||
<view key="contentView" wantsLayer="YES" id="se5-gp-TjO">
|
||||
<rect key="frame" x="0.0" y="0.0" width="480" height="270"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="853" height="533"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<scrollView fixedFrame="YES" horizontalLineScroll="10" horizontalPageScroll="10" verticalLineScroll="10" verticalPageScroll="10" translatesAutoresizingMaskIntoConstraints="NO" id="N7f-tq-7VU">
|
||||
<rect key="frame" x="20" y="20" width="440" height="251"/>
|
||||
<rect key="frame" x="20" y="20" width="813" height="493"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<clipView key="contentView" ambiguous="YES" id="cR7-yI-MsB">
|
||||
<rect key="frame" x="1" y="1" width="438" height="249"/>
|
||||
<rect key="frame" x="1" y="1" width="811" height="491"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
<subviews>
|
||||
<view fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Aer-4J-rbN">
|
||||
<rect key="frame" x="0.0" y="0.0" width="423" height="234"/>
|
||||
<rect key="frame" x="0.0" y="0.0" width="796" height="476"/>
|
||||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
|
||||
</view>
|
||||
</subviews>
|
||||
<color key="backgroundColor" name="disabledControlTextColor" catalog="System" colorSpace="catalog"/>
|
||||
</clipView>
|
||||
<scroller key="horizontalScroller" verticalHuggingPriority="750" horizontal="YES" id="zjd-Nw-zvr">
|
||||
<rect key="frame" x="1" y="234" width="438" height="16"/>
|
||||
<rect key="frame" x="1" y="476" width="811" height="16"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</scroller>
|
||||
<scroller key="verticalScroller" verticalHuggingPriority="750" doubleValue="1" horizontal="NO" id="Aon-x3-aqt">
|
||||
<rect key="frame" x="423" y="1" width="16" height="249"/>
|
||||
<rect key="frame" x="796" y="1" width="16" height="491"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
</scroller>
|
||||
</scrollView>
|
||||
@ -51,6 +51,7 @@
|
||||
<connections>
|
||||
<outlet property="delegate" destination="-2" id="0bl-1N-AYu"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="292" y="185.5"/>
|
||||
</window>
|
||||
</objects>
|
||||
</document>
|
||||
|
||||
@ -44,7 +44,7 @@
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>2.1</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>454</string>
|
||||
<string>461</string>
|
||||
<key>LSApplicationCategoryType</key>
|
||||
<string>public.app-category.utilities</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
|
||||
@ -46,9 +46,8 @@ class PDFItemViewController: NSViewController {
|
||||
month.stringValue = monthName
|
||||
guard dayFW != nil else { return }
|
||||
day.textColor = NSColor.black
|
||||
guard let log = dayFW?.fileWrappers?["KDLog.txt"] else { return }
|
||||
guard var logA = String(data: log.regularFileContents!, encoding: .utf8)?.components(separatedBy: "\n") else { return }
|
||||
logA.removeLast()
|
||||
guard let log = dayFW?.fileWrappers?["KDLog.hex"] else { return }
|
||||
guard let logA = FileOperations.load(log: log.regularFileContents! as NSData) else { return }
|
||||
loss.stringValue = "\(logA.count)"
|
||||
var am: [Int] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
||||
var pm: [Int] = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
|
||||
|
||||
@ -1,2 +1,2 @@
|
||||
version 2.1
|
||||
build 454
|
||||
build 461
|
||||
|
||||
@ -15,9 +15,9 @@
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>4.1</string>
|
||||
<string>4.2</string>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>48</string>
|
||||
<string>49</string>
|
||||
<key>LSApplicationCategoryType</key>
|
||||
<string>public.app-category.utilities</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
|
||||
@ -1,2 +1,2 @@
|
||||
version 4.1
|
||||
build 48
|
||||
version 4.2
|
||||
build 49
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user