Fix property dependencies

This commit is contained in:
Matthias Neeracher 2014-12-10 03:51:26 +01:00 committed by Matthias Neeracher
parent e13c8d4b0e
commit a35827233d
2 changed files with 9 additions and 10 deletions

View File

@ -108,7 +108,7 @@ class ASBuilder {
let progProp = ASHardware.instance().programmers[programmer] let progProp = ASHardware.instance().programmers[programmer]
let proto = boardProp["upload.protocol"] ?? progProp?["protocol"] let proto = boardProp["upload.protocol"] ?? progProp?["protocol"]
let speed = boardProp["upload.speed"] ?? progProp?["speed"] let speed = boardProp["upload.speed"] ?? progProp?["speed"]
var args = ["-v", "-v", "-v", "-v", "-D", var args = ["-v", "-v", "-v",
"-C", "/usr/local/CrossPack-AVR/etc/avrdude.conf", "-C", "/usr/local/CrossPack-AVR/etc/avrdude.conf",
"-p", boardProp["build.mcu"]!, "-c", proto!, "-P", port, "-p", boardProp["build.mcu"]!, "-c", proto!, "-P", port,
"-U", "flash:w:build/"+board+"/"+dir.lastPathComponent+".hex:i"] "-U", "flash:w:build/"+board+"/"+dir.lastPathComponent+".hex:i"]

View File

@ -40,13 +40,9 @@ class ASProjDoc: NSDocument, NSOutlineViewDelegate, NSMenuDelegate {
var fontSize : UInt = 12 var fontSize : UInt = 12
var themeObserver : AnyObject? var themeObserver : AnyObject?
var serialObserver : AnyObject? var serialObserver : AnyObject?
var board = "uno" dynamic var board = "uno"
var programmer = "arduino" dynamic var programmer = "arduino"
dynamic var port : String = "" { dynamic var port : String = ""
didSet {
}
}
var recentBoards = [String]() var recentBoards = [String]()
var recentProgrammers = [String]() var recentProgrammers = [String]()
var logModified = NSDate.distantPast() as NSDate var logModified = NSDate.distantPast() as NSDate
@ -384,7 +380,7 @@ class ASProjDoc: NSDocument, NSOutlineViewDelegate, NSMenuDelegate {
set (newBoard) { set (newBoard) {
for (ident, prop) in ASHardware.instance().boards { for (ident, prop) in ASHardware.instance().boards {
if prop["name"] == newBoard { if prop["name"] == newBoard {
setValue(ident, forKey: "board") board = ident
pushToFront(&recentBoards, board) pushToFront(&recentBoards, board)
@ -414,7 +410,7 @@ class ASProjDoc: NSDocument, NSOutlineViewDelegate, NSMenuDelegate {
set (newProg) { set (newProg) {
for (ident, prop) in ASHardware.instance().programmers { for (ident, prop) in ASHardware.instance().programmers {
if prop["name"] == newProg { if prop["name"] == newProg {
setValue(ident, forKey:"programmer") programmer = ident
pushToFront(&recentProgrammers, programmer) pushToFront(&recentProgrammers, programmer)
@ -460,6 +456,9 @@ class ASProjDoc: NSDocument, NSOutlineViewDelegate, NSMenuDelegate {
return (ASSerial.instance().ports() as NSArray).containsObject(port) return (ASSerial.instance().ports() as NSArray).containsObject(port)
} }
} }
class func keyPathsForValuesAffectingHasValidPort() -> NSSet {
return NSSet(object: "port")
}
var canUpload : Bool { var canUpload : Bool {
get { get {