diff --git a/AVRsack.xcodeproj/project.pbxproj b/AVRsack.xcodeproj/project.pbxproj index d8f8a9a..7f16e7d 100644 --- a/AVRsack.xcodeproj/project.pbxproj +++ b/AVRsack.xcodeproj/project.pbxproj @@ -14,6 +14,7 @@ 9501D80C1A17025C0034C530 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9501D80A1A17025C0034C530 /* MainMenu.xib */; }; 9501D8181A17025C0034C530 /* AVRsackTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9501D8171A17025C0034C530 /* AVRsackTests.swift */; }; 950AB9271A296A160033A9DA /* ProjIcon.icns in Resources */ = {isa = PBXBuildFile; fileRef = 950AB9261A296A160033A9DA /* ProjIcon.icns */; }; + 950AB9291A2D4F9B0033A9DA /* ASSerial.swift in Sources */ = {isa = PBXBuildFile; fileRef = 950AB9281A2D4F9B0033A9DA /* ASSerial.swift */; }; 951CD1741A23C9FC0066C1A1 /* ASBuilder.swift in Sources */ = {isa = PBXBuildFile; fileRef = 951CD1731A23C9FC0066C1A1 /* ASBuilder.swift */; }; 951CD1771A2615000066C1A1 /* BuildProject in Resources */ = {isa = PBXBuildFile; fileRef = 951CD1761A2615000066C1A1 /* BuildProject */; }; 95468DDF1A228BE600668EE2 /* ASHardware.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95468DDE1A228BE600668EE2 /* ASHardware.swift */; }; @@ -73,6 +74,7 @@ 9501D8161A17025C0034C530 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; 9501D8171A17025C0034C530 /* AVRsackTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AVRsackTests.swift; sourceTree = ""; }; 950AB9261A296A160033A9DA /* ProjIcon.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = ProjIcon.icns; path = IconResources/ProjIcon.icns; sourceTree = ""; }; + 950AB9281A2D4F9B0033A9DA /* ASSerial.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ASSerial.swift; sourceTree = ""; }; 951CD1731A23C9FC0066C1A1 /* ASBuilder.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ASBuilder.swift; sourceTree = ""; }; 951CD1761A2615000066C1A1 /* BuildProject */ = {isa = PBXFileReference; explicitFileType = text.script.ruby; fileEncoding = 4; path = BuildProject; sourceTree = ""; }; 95468DDE1A228BE600668EE2 /* ASHardware.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ASHardware.swift; sourceTree = ""; }; @@ -167,6 +169,7 @@ 9501D8031A17025C0034C530 /* ASProjDoc.swift */, 95BF80EA1A185C9E0004A693 /* ASFileTree.swift */, 95468DDE1A228BE600668EE2 /* ASHardware.swift */, + 950AB9281A2D4F9B0033A9DA /* ASSerial.swift */, 951CD1731A23C9FC0066C1A1 /* ASBuilder.swift */, 951CD1761A2615000066C1A1 /* BuildProject */, ); @@ -341,6 +344,7 @@ 9501D8041A17025C0034C530 /* ASProjDoc.swift in Sources */, 95468DDF1A228BE600668EE2 /* ASHardware.swift in Sources */, 951CD1741A23C9FC0066C1A1 /* ASBuilder.swift in Sources */, + 950AB9291A2D4F9B0033A9DA /* ASSerial.swift in Sources */, 9501D8021A17025C0034C530 /* ASApplication.swift in Sources */, 95BF80EB1A185C9E0004A693 /* ASFileTree.swift in Sources */, ); diff --git a/AVRsack/ASProjDoc.swift b/AVRsack/ASProjDoc.swift index 20452de..192c2bd 100644 --- a/AVRsack/ASProjDoc.swift +++ b/AVRsack/ASProjDoc.swift @@ -292,5 +292,18 @@ class ASProjDoc: NSDocument, NSOutlineViewDelegate { builder.cleanProject() selectNode(files.buildLog) } + + func serialPorts() -> [String] { + return ASSerial.ports() + } + + func boards() -> [String] { + return [String](ASHardware.instance().boards.keys) + } + + func programmers() -> [String] { + return [String](ASHardware.instance().programmers.keys) + } + } diff --git a/AVRsack/ASSerial.swift b/AVRsack/ASSerial.swift new file mode 100644 index 0000000..392ebdc --- /dev/null +++ b/AVRsack/ASSerial.swift @@ -0,0 +1,22 @@ +// +// ASSerial.swift +// AVRsack +// +// Created by Matthias Neeracher on 12/2/14. +// Copyright © 2014 Aere Perennius. All rights reserved. +// + +import Foundation + +class ASSerial { + class func ports() -> [String] { + let devices = NSFileManager.defaultManager().contentsOfDirectoryAtPath("/dev", error: nil)! + var cuDevs = [String]() + for dev in devices as [String] { + if dev.substringToIndex(dev.startIndex.successor().successor()) == "cu" { + cuDevs.append("/dev/"+dev) + } + } + return cuDevs + } +} \ No newline at end of file diff --git a/AVRsack/Base.lproj/ASProjDoc.xib b/AVRsack/Base.lproj/ASProjDoc.xib index e1f4ba7..0b1d452 100644 --- a/AVRsack/Base.lproj/ASProjDoc.xib +++ b/AVRsack/Base.lproj/ASProjDoc.xib @@ -95,23 +95,92 @@ - - - - - - - - + - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -120,6 +189,10 @@ + + + + @@ -128,6 +201,7 @@ + diff --git a/AVRsack/Images.xcassets/CleanIcon.imageset/CleanIcon 1x.png b/AVRsack/Images.xcassets/CleanIcon.imageset/CleanIcon 1x.png index 123d4aa..ba56f5b 100644 Binary files a/AVRsack/Images.xcassets/CleanIcon.imageset/CleanIcon 1x.png and b/AVRsack/Images.xcassets/CleanIcon.imageset/CleanIcon 1x.png differ diff --git a/AVRsack/Images.xcassets/CleanIcon.imageset/CleanIcon 2x.png b/AVRsack/Images.xcassets/CleanIcon.imageset/CleanIcon 2x.png index 7f8270a..e5cbebc 100644 Binary files a/AVRsack/Images.xcassets/CleanIcon.imageset/CleanIcon 2x.png and b/AVRsack/Images.xcassets/CleanIcon.imageset/CleanIcon 2x.png differ diff --git a/AVRsack/Images.xcassets/CleanIcon.imageset/CleanIcon 3x.png b/AVRsack/Images.xcassets/CleanIcon.imageset/CleanIcon 3x.png index e6164d3..fe9e0f4 100644 Binary files a/AVRsack/Images.xcassets/CleanIcon.imageset/CleanIcon 3x.png and b/AVRsack/Images.xcassets/CleanIcon.imageset/CleanIcon 3x.png differ