Add serial window
This commit is contained in:
parent
e905f08f76
commit
41773412f5
|
@ -19,6 +19,8 @@
|
|||
95468DDF1A228BE600668EE2 /* ASHardware.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95468DDE1A228BE600668EE2 /* ASHardware.swift */; };
|
||||
95468DE31A228E1300668EE2 /* Defaults.plist in Resources */ = {isa = PBXBuildFile; fileRef = 95468DE21A228E1300668EE2 /* Defaults.plist */; };
|
||||
95539B681A3E7EAF00D8595C /* ASSerial.mm in Sources */ = {isa = PBXBuildFile; fileRef = 95539B671A3E7EAF00D8595C /* ASSerial.mm */; };
|
||||
956005F41A4EF79D00327007 /* ASSerialWin.swift in Sources */ = {isa = PBXBuildFile; fileRef = 956005F21A4EF79D00327007 /* ASSerialWin.swift */; };
|
||||
956005F51A4EF79D00327007 /* ASSerialWin.xib in Resources */ = {isa = PBXBuildFile; fileRef = 956005F31A4EF79D00327007 /* ASSerialWin.xib */; };
|
||||
95A7C6401A38914300EF1963 /* ASPreferences.xib in Resources */ = {isa = PBXBuildFile; fileRef = 95A7C63E1A38914300EF1963 /* ASPreferences.xib */; };
|
||||
95A7C6461A3894C900EF1963 /* ASPreferences.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95A7C6451A3894C900EF1963 /* ASPreferences.swift */; };
|
||||
95BF80EB1A185C9E0004A693 /* ASFileTree.swift in Sources */ = {isa = PBXBuildFile; fileRef = 95BF80EA1A185C9E0004A693 /* ASFileTree.swift */; };
|
||||
|
@ -83,6 +85,8 @@
|
|||
95468DE21A228E1300668EE2 /* Defaults.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Defaults.plist; sourceTree = "<group>"; };
|
||||
95539B661A3E7EAF00D8595C /* ASSerial.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ASSerial.h; sourceTree = "<group>"; };
|
||||
95539B671A3E7EAF00D8595C /* ASSerial.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ASSerial.mm; sourceTree = "<group>"; };
|
||||
956005F21A4EF79D00327007 /* ASSerialWin.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ASSerialWin.swift; sourceTree = "<group>"; };
|
||||
956005F31A4EF79D00327007 /* ASSerialWin.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = ASSerialWin.xib; sourceTree = "<group>"; };
|
||||
958D76811A17DA1C00917D96 /* AVRsack-Bridging-Header.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "AVRsack-Bridging-Header.h"; sourceTree = "<group>"; };
|
||||
95A7C63F1A38914300EF1963 /* Base */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = Base; path = Base.lproj/ASPreferences.xib; sourceTree = "<group>"; };
|
||||
95A7C6451A3894C900EF1963 /* ASPreferences.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ASPreferences.swift; sourceTree = "<group>"; };
|
||||
|
@ -182,6 +186,7 @@
|
|||
95539B661A3E7EAF00D8595C /* ASSerial.h */,
|
||||
95539B671A3E7EAF00D8595C /* ASSerial.mm */,
|
||||
95DF20661A45A6090013D1B5 /* ASSketchBook.swift */,
|
||||
956005F21A4EF79D00327007 /* ASSerialWin.swift */,
|
||||
);
|
||||
name = Source;
|
||||
sourceTree = "<group>";
|
||||
|
@ -193,6 +198,7 @@
|
|||
950AB9261A296A160033A9DA /* ProjIcon.icns */,
|
||||
9501D80A1A17025C0034C530 /* MainMenu.xib */,
|
||||
9501D8051A17025C0034C530 /* ASProjDoc.xib */,
|
||||
956005F31A4EF79D00327007 /* ASSerialWin.xib */,
|
||||
95A7C63E1A38914300EF1963 /* ASPreferences.xib */,
|
||||
95468DE21A228E1300668EE2 /* Defaults.plist */,
|
||||
);
|
||||
|
@ -331,6 +337,7 @@
|
|||
files = (
|
||||
95A7C6401A38914300EF1963 /* ASPreferences.xib in Resources */,
|
||||
95468DE31A228E1300668EE2 /* Defaults.plist in Resources */,
|
||||
956005F51A4EF79D00327007 /* ASSerialWin.xib in Resources */,
|
||||
9501D8071A17025C0034C530 /* ASProjDoc.xib in Resources */,
|
||||
950AB9271A296A160033A9DA /* ProjIcon.icns in Resources */,
|
||||
9501D8091A17025C0034C530 /* Images.xcassets in Resources */,
|
||||
|
@ -353,6 +360,7 @@
|
|||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
956005F41A4EF79D00327007 /* ASSerialWin.swift in Sources */,
|
||||
9501D8041A17025C0034C530 /* ASProjDoc.swift in Sources */,
|
||||
95539B681A3E7EAF00D8595C /* ASSerial.mm in Sources */,
|
||||
95468DDF1A228BE600668EE2 /* ASHardware.swift in Sources */,
|
||||
|
|
|
@ -91,6 +91,8 @@ class ASBuilder {
|
|||
if variantPath != nil {
|
||||
args.append("variant_path="+variantPath!)
|
||||
}
|
||||
args.append("usb_vid="+(boardProp["build.vid"] ?? "null"));
|
||||
args.append("usb_pid="+(boardProp["build.pid"] ?? "null"));
|
||||
args.append("--")
|
||||
args += files.paths
|
||||
task!.arguments = args;
|
||||
|
@ -113,8 +115,10 @@ class ASBuilder {
|
|||
let libPath = (ASLibraries.instance().directories as NSArray).componentsJoinedByString(":")
|
||||
let boardProp = ASHardware.instance().boards[board]!
|
||||
let progProp = ASHardware.instance().programmers[programmer]
|
||||
let proto = boardProp["upload.protocol"] ?? progProp?["protocol"]
|
||||
let speed = boardProp["upload.speed"] ?? progProp?["speed"]
|
||||
let hasBootloader = boardProp["upload.protocol"] != nil
|
||||
let leonardish = hasBootloader && (boardProp["bootloader.path"] ?? "").hasPrefix("caterina")
|
||||
let proto = hasBootloader ? boardProp["upload.protocol"] : progProp?["protocol"]
|
||||
let speed = hasBootloader ? boardProp["upload.speed"] : progProp?["speed"]
|
||||
let verbosity = NSUserDefaults.standardUserDefaults().integerForKey("UploadVerbosity")
|
||||
var args = Array<String>(count: verbosity, repeatedValue: "-v")
|
||||
args += [
|
||||
|
@ -125,6 +129,28 @@ class ASBuilder {
|
|||
args.append("-b")
|
||||
args.append(speed!)
|
||||
}
|
||||
|
||||
//
|
||||
// For Leonardo & the like, reset by opening port at 1200 baud
|
||||
//
|
||||
if leonardish {
|
||||
if verbosity > 0 {
|
||||
logOut.writeData("Opening \(port) at 1200 baud\n".dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: true)!)
|
||||
}
|
||||
if let dummyConnection = ASSerial.openPort(port, withSpeed: 1200) {
|
||||
ASSerial.restorePort(dummyConnection.fileDescriptor)
|
||||
dummyConnection.closeFile()
|
||||
sleep(5)
|
||||
for (var retry=0; retry < 10; ++retry) {
|
||||
if (NSFileManager.defaultManager().fileExistsAtPath(port)) {
|
||||
if verbosity > 0 {
|
||||
logOut.writeData("Found port \(port) after \(retry) attempts.\n".dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: true)!)
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
let cmdLine = task!.launchPath+" "+(args as NSArray).componentsJoinedByString(" ")+"\n"
|
||||
logOut.writeData(cmdLine.dataUsingEncoding(NSUTF8StringEncoding, allowLossyConversion: true)!)
|
||||
task!.arguments = args;
|
||||
|
|
|
@ -38,8 +38,8 @@ class ASProjDoc: NSDocument, NSOutlineViewDelegate, NSMenuDelegate {
|
|||
var mainEditor : ASFileNode?
|
||||
var currentTheme : UInt = 0
|
||||
var fontSize : UInt = 12
|
||||
var themeObserver : AnyObject?
|
||||
var serialObserver : AnyObject?
|
||||
var themeObserver : AnyObject!
|
||||
var serialObserver : AnyObject!
|
||||
dynamic var board = "uno"
|
||||
dynamic var programmer = "arduino"
|
||||
dynamic var port : String = ""
|
||||
|
@ -102,8 +102,8 @@ class ASProjDoc: NSDocument, NSOutlineViewDelegate, NSMenuDelegate {
|
|||
}
|
||||
override func finalize() {
|
||||
saveCurEditor()
|
||||
NSNotificationCenter.defaultCenter().removeObserver(themeObserver!)
|
||||
NSNotificationCenter.defaultCenter().removeObserver(serialObserver!)
|
||||
NSNotificationCenter.defaultCenter().removeObserver(themeObserver)
|
||||
NSNotificationCenter.defaultCenter().removeObserver(serialObserver)
|
||||
}
|
||||
|
||||
override func windowControllerDidLoadNib(aController: NSWindowController) {
|
||||
|
@ -485,5 +485,9 @@ class ASProjDoc: NSDocument, NSOutlineViewDelegate, NSMenuDelegate {
|
|||
}
|
||||
buildProject(sender)
|
||||
}
|
||||
|
||||
@IBAction func serialConnect(sender: AnyObject) {
|
||||
ASSerialWin.showWindowWithPort(port)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -14,5 +14,6 @@ extern NSString * kASSerialPortsChanged;
|
|||
|
||||
+ (NSArray *) ports;
|
||||
+ (NSFileHandle *)openPort:(NSString *) port withSpeed:(int)speed;
|
||||
+ (void)restorePort:(int)fileDescriptor;
|
||||
|
||||
@end
|
||||
|
|
|
@ -9,8 +9,11 @@
|
|||
#import "ASSerial.h"
|
||||
|
||||
#include <dispatch/dispatch.h>
|
||||
#include <termios.h>
|
||||
#include <sys/ioctl.h>
|
||||
|
||||
static dispatch_source_t watchSlashDev;
|
||||
static NSMutableDictionary * savedAttrs;
|
||||
|
||||
NSString * kASSerialPortsChanged = @"PortsChanged";
|
||||
|
||||
|
@ -35,4 +38,39 @@ NSString * kASSerialPortsChanged = @"PortsChanged";
|
|||
return cuPorts;
|
||||
}
|
||||
|
||||
+ (NSFileHandle *)openPort:(NSString *)port withSpeed:(int)speed {
|
||||
int fd = open([port UTF8String], O_RDWR | O_NOCTTY | O_NONBLOCK);
|
||||
if (fd < 0)
|
||||
return nil;
|
||||
if (ioctl(fd, TIOCEXCL) < 0)
|
||||
goto failed;
|
||||
termios origAttr, newAttr;
|
||||
if (tcgetattr(fd, &origAttr) < 0)
|
||||
goto failed;
|
||||
newAttr = origAttr;
|
||||
cfmakeraw(&newAttr);
|
||||
cfsetspeed(&newAttr, speed);
|
||||
newAttr.c_cflag |= CS8 | CCTS_OFLOW | CRTS_IFLOW;
|
||||
newAttr.c_cflag &= ~(PARENB);
|
||||
tcsetattr(fd, TCSANOW, &newAttr);
|
||||
if (!savedAttrs) {
|
||||
savedAttrs = [NSMutableDictionary dictionary];
|
||||
}
|
||||
[savedAttrs setObject:[NSData dataWithBytes:&origAttr length:sizeof(origAttr)] forKey:[NSNumber numberWithInt:fd]];
|
||||
|
||||
return [[NSFileHandle alloc] initWithFileDescriptor:fd closeOnDealloc:NO];
|
||||
failed:
|
||||
close(fd);
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
+ (void)restorePort:(int)fileDescriptor {
|
||||
NSNumber * fd = [NSNumber numberWithInt:fileDescriptor];
|
||||
if (NSData * attr = [savedAttrs objectForKey:fd]) {
|
||||
tcsetattr(fileDescriptor, TCSADRAIN, (termios *)[attr bytes]);
|
||||
[savedAttrs removeObjectForKey:fd];
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
110
AVRsack/ASSerialWin.swift
Normal file
110
AVRsack/ASSerialWin.swift
Normal file
|
@ -0,0 +1,110 @@
|
|||
//
|
||||
// ASSerialWin.swift
|
||||
// AVRsack
|
||||
//
|
||||
// Created by Matthias Neeracher on 27/12/14.
|
||||
// Copyright (c) 2014 Aere Perennius. All rights reserved.
|
||||
//
|
||||
|
||||
import Cocoa
|
||||
|
||||
private var serialInstances = [String : ASSerialWin]()
|
||||
|
||||
class ASSerialWin: NSWindowController {
|
||||
@IBOutlet weak var portPopUp : NSPopUpButton!
|
||||
@IBOutlet weak var inputLine : NSTextField!
|
||||
@IBOutlet weak var logView : ACEView!
|
||||
|
||||
var baudRate : Int32 = 9600 {
|
||||
didSet(oldRate) {
|
||||
if portHandle != nil {
|
||||
connect(self) // Disconnect existing
|
||||
connect(self) // Reconnect
|
||||
}
|
||||
}
|
||||
}
|
||||
var sendCR = false
|
||||
var sendLF = true
|
||||
var port = ""
|
||||
var serialData = ""
|
||||
var serialObserver : AnyObject!
|
||||
dynamic var portHandle : NSFileHandle?
|
||||
|
||||
class func showWindowWithPort(port: String) {
|
||||
if let existing = serialInstances[port] {
|
||||
existing.showWindow(self)
|
||||
} else {
|
||||
let newInstance = ASSerialWin(port:port)
|
||||
serialInstances[port] = newInstance
|
||||
newInstance.showWindow(self)
|
||||
}
|
||||
}
|
||||
|
||||
convenience init(port: String) {
|
||||
self.init(windowNibName:"ASSerialWin")
|
||||
self.port = port
|
||||
var nc = NSNotificationCenter.defaultCenter()
|
||||
serialObserver = nc.addObserverForName(kASSerialPortsChanged, object: nil, queue: nil, usingBlock: { (NSNotification) in
|
||||
self.rebuildPortMenu()
|
||||
})
|
||||
}
|
||||
|
||||
override func finalize() {
|
||||
NSNotificationCenter.defaultCenter().removeObserver(serialObserver)
|
||||
serialInstances.removeValueForKey(port)
|
||||
}
|
||||
|
||||
override func windowDidLoad() {
|
||||
logView.setReadOnly(true)
|
||||
logView.setShowPrintMargin(false)
|
||||
rebuildPortMenu()
|
||||
window?.title = port
|
||||
connect(self)
|
||||
super.windowDidLoad()
|
||||
}
|
||||
|
||||
func rebuildPortMenu() {
|
||||
portPopUp.removeAllItems()
|
||||
portPopUp.addItemsWithTitles(ASSerial.ports())
|
||||
portPopUp.selectItemWithTitle(port)
|
||||
}
|
||||
|
||||
@IBAction func selectPort(item: AnyObject) {
|
||||
port = (item as NSPopUpButton).titleOfSelectedItem!
|
||||
window?.title = port
|
||||
}
|
||||
|
||||
@IBAction func sendInput(AnyObject) {
|
||||
}
|
||||
|
||||
@IBAction func connect(AnyObject) {
|
||||
if portHandle != nil {
|
||||
ASSerial.restorePort(portHandle!.fileDescriptor)
|
||||
portHandle!.closeFile()
|
||||
portHandle = nil
|
||||
} else {
|
||||
portHandle = ASSerial.openPort(port, withSpeed: baudRate)
|
||||
if portHandle != nil {
|
||||
serialData = ""
|
||||
logView.setString(serialData)
|
||||
portHandle!.readabilityHandler = {(handle) in
|
||||
let newData = handle.availableData
|
||||
let newString = NSString(data: newData, encoding: NSASCIIStringEncoding)!
|
||||
self.serialData += newString
|
||||
dispatch_async(dispatch_get_main_queue(), { () -> Void in
|
||||
self.logView.setString(self.serialData)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var connectButtonTitle : String {
|
||||
get {
|
||||
return (portHandle != nil) ? "Disconnect" : "Connect"
|
||||
}
|
||||
}
|
||||
class func keyPathsForValuesAffectingConnectButtonTitle() -> NSSet {
|
||||
return NSSet(object: "portHandle")
|
||||
}
|
||||
}
|
218
AVRsack/ASSerialWin.xib
Normal file
218
AVRsack/ASSerialWin.xib
Normal file
|
@ -0,0 +1,218 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="6250" systemVersion="14C79" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="6250"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="ASSerialWin" customModule="AVRsack" customModuleProvider="target">
|
||||
<connections>
|
||||
<outlet property="inputLine" destination="rIR-2b-lAh" id="85R-3S-YGk"/>
|
||||
<outlet property="logView" destination="ta6-x2-NZt" id="0cN-zX-5mJ"/>
|
||||
<outlet property="portPopUp" destination="P3j-nY-jrB" id="6Gi-rp-uM4"/>
|
||||
<outlet property="window" destination="F0z-JX-Cv5" id="gIp-Ho-8D9"/>
|
||||
</connections>
|
||||
</customObject>
|
||||
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
|
||||
<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="751" height="403"/>
|
||||
<rect key="screenRect" x="0.0" y="0.0" width="1440" height="877"/>
|
||||
<view key="contentView" id="se5-gp-TjO">
|
||||
<rect key="frame" x="0.0" y="0.0" width="751" height="403"/>
|
||||
<autoresizingMask key="autoresizingMask"/>
|
||||
<subviews>
|
||||
<textField verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="rIR-2b-lAh">
|
||||
<rect key="frame" x="0.0" y="0.0" width="651" height="22"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="22" id="Y1V-fL-RCq"/>
|
||||
</constraints>
|
||||
<textFieldCell key="cell" scrollable="YES" lineBreakMode="clipping" selectable="YES" editable="YES" state="on" borderStyle="bezel" drawsBackground="YES" id="EBj-i4-UsA">
|
||||
<font key="font" metaFont="system"/>
|
||||
<color key="textColor" name="textColor" catalog="System" colorSpace="catalog"/>
|
||||
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
|
||||
</textFieldCell>
|
||||
<connections>
|
||||
<action selector="sendInput:" target="-2" id="X4Z-Nx-aRk"/>
|
||||
<binding destination="-2" name="enabled" keyPath="portHandle" id="4ct-gM-GrV">
|
||||
<dictionary key="options">
|
||||
<string key="NSValueTransformerName">NSIsNotNil</string>
|
||||
</dictionary>
|
||||
</binding>
|
||||
</connections>
|
||||
</textField>
|
||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="MOe-eO-fyb">
|
||||
<rect key="frame" x="651" y="-1" width="50" height="22"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="height" constant="20" id="eLx-yy-gCn"/>
|
||||
<constraint firstAttribute="width" constant="50" id="vaT-Kd-3pn"/>
|
||||
</constraints>
|
||||
<buttonCell key="cell" type="smallSquare" title="Send" bezelStyle="smallSquare" imagePosition="overlaps" alignment="center" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="Xt6-lT-b4z">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="sendInput:" target="-2" id="oTn-KE-mXZ"/>
|
||||
<binding destination="-2" name="enabled" keyPath="portHandle" id="pX6-Xy-5IQ">
|
||||
<dictionary key="options">
|
||||
<string key="NSValueTransformerName">NSIsNotNil</string>
|
||||
</dictionary>
|
||||
</binding>
|
||||
</connections>
|
||||
</button>
|
||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="H05-Rp-UzR">
|
||||
<rect key="frame" x="701" y="-1" width="50" height="22"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="50" id="FWw-BQ-WKa"/>
|
||||
<constraint firstAttribute="height" constant="20" id="s7i-ZT-S7W"/>
|
||||
</constraints>
|
||||
<buttonCell key="cell" type="smallSquare" title="Now" bezelStyle="smallSquare" imagePosition="overlaps" alignment="center" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" id="vZ4-fd-aE8">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
</button>
|
||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="YB5-mV-vY7">
|
||||
<rect key="frame" x="336" y="372" width="35" height="19"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="35" id="M1a-Tj-gbw"/>
|
||||
</constraints>
|
||||
<buttonCell key="cell" type="recessed" title="CR" bezelStyle="recessed" alignment="center" state="on" borderStyle="border" inset="2" id="SpZ-Qv-eXn">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES" changeBackground="YES" changeGray="YES"/>
|
||||
<font key="font" metaFont="systemBold" size="12"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<binding destination="-2" name="value" keyPath="sendCR" id="HSR-Ct-mvX"/>
|
||||
</connections>
|
||||
</button>
|
||||
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="P3j-nY-jrB">
|
||||
<rect key="frame" x="20" y="369" width="200" height="25"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="200" id="Pcu-k9-a3F"/>
|
||||
</constraints>
|
||||
<popUpButtonCell key="cell" type="roundTextured" title="Item 1" bezelStyle="texturedRounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="border" imageScaling="proportionallyDown" inset="2" selectedItem="1gh-oB-cvv" id="dH3-sr-yK8">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="menu"/>
|
||||
<menu key="menu" id="dld-b3-fF6">
|
||||
<items>
|
||||
<menuItem title="Item 1" state="on" id="1gh-oB-cvv"/>
|
||||
<menuItem title="Item 2" id="dOl-ce-EBm"/>
|
||||
<menuItem title="Item 3" id="md7-eV-5UJ"/>
|
||||
</items>
|
||||
</menu>
|
||||
</popUpButtonCell>
|
||||
</popUpButton>
|
||||
<popUpButton verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="efl-ex-LQ4">
|
||||
<rect key="frame" x="228" y="369" width="100" height="25"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="100" id="aVR-Sh-ml8"/>
|
||||
</constraints>
|
||||
<popUpButtonCell key="cell" type="roundTextured" title="19200 baud" bezelStyle="texturedRounded" alignment="left" lineBreakMode="truncatingTail" state="on" borderStyle="border" tag="19200" imageScaling="proportionallyDown" inset="2" selectedItem="RuE-wb-cfx" id="Q1O-jv-TY5">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="menu"/>
|
||||
<menu key="menu" id="zhD-RA-600">
|
||||
<items>
|
||||
<menuItem title="300 baud" tag="300" id="WMN-Od-fdj" userLabel="300 baud"/>
|
||||
<menuItem title="1200 baud" tag="1200" id="Foo-2N-MQb" userLabel="1200 baud"/>
|
||||
<menuItem title="2400 baud" tag="2400" id="jkv-KB-7Vc" userLabel="2400 baud"/>
|
||||
<menuItem title="4800 baud" tag="4800" id="Efs-B8-jLD">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem title="9600 baud" tag="9600" id="x7Y-Ul-fJv">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem title="14400 baud" tag="14400" id="jYi-Pk-iBz">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem title="19200 baud" state="on" tag="19200" id="RuE-wb-cfx">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem title="28800 baud" tag="28800" id="sW4-7s-Knn">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem title="38400 baud" tag="38400" id="YVg-iX-49U">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem title="57600 baud" tag="57600" id="xwJ-6c-zDK">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem title="115200 baud" tag="115200" id="get-rX-rev">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
<menuItem title="230400 baud" tag="230400" id="33o-mv-833">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
</items>
|
||||
</menu>
|
||||
</popUpButtonCell>
|
||||
<connections>
|
||||
<binding destination="-2" name="selectedTag" keyPath="baudRate" id="pDO-CA-0VU"/>
|
||||
</connections>
|
||||
</popUpButton>
|
||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="LrH-O2-kmq">
|
||||
<rect key="frame" x="379" y="372" width="35" height="19"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="35" id="raR-vK-kQ1"/>
|
||||
</constraints>
|
||||
<buttonCell key="cell" type="recessed" title="LF" bezelStyle="recessed" alignment="center" state="on" borderStyle="border" inset="2" id="J4k-mA-Des">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES" changeBackground="YES" changeGray="YES"/>
|
||||
<font key="font" metaFont="systemBold" size="12"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<binding destination="-2" name="value" keyPath="sendLF" id="VbY-fJ-J9E"/>
|
||||
</connections>
|
||||
</button>
|
||||
<button verticalHuggingPriority="750" translatesAutoresizingMaskIntoConstraints="NO" id="r6K-Jm-mZe">
|
||||
<rect key="frame" x="651" y="369" width="80" height="25"/>
|
||||
<constraints>
|
||||
<constraint firstAttribute="width" constant="80" id="0VI-Yv-M9O"/>
|
||||
</constraints>
|
||||
<buttonCell key="cell" type="squareTextured" title="Connect" alternateTitle="Disconnect" bezelStyle="texturedSquare" alignment="center" state="on" borderStyle="border" inset="2" id="leF-uH-PU3">
|
||||
<behavior key="behavior" pushIn="YES" lightByBackground="YES" lightByGray="YES"/>
|
||||
<font key="font" metaFont="system"/>
|
||||
</buttonCell>
|
||||
<connections>
|
||||
<action selector="connect:" target="-2" id="8wr-LK-b6p"/>
|
||||
<binding destination="-2" name="title" keyPath="connectButtonTitle" id="E2G-J3-sGe"/>
|
||||
</connections>
|
||||
</button>
|
||||
<customView translatesAutoresizingMaskIntoConstraints="NO" id="ta6-x2-NZt" customClass="ACEView">
|
||||
<rect key="frame" x="0.0" y="20" width="751" height="343"/>
|
||||
</customView>
|
||||
</subviews>
|
||||
<constraints>
|
||||
<constraint firstItem="MOe-eO-fyb" firstAttribute="baseline" secondItem="H05-Rp-UzR" secondAttribute="baseline" id="1lu-Th-ZWy"/>
|
||||
<constraint firstAttribute="bottom" secondItem="H05-Rp-UzR" secondAttribute="bottom" id="3yV-pC-gLd"/>
|
||||
<constraint firstItem="ta6-x2-NZt" firstAttribute="leading" secondItem="rIR-2b-lAh" secondAttribute="leading" id="3yl-1R-D3G"/>
|
||||
<constraint firstItem="LrH-O2-kmq" firstAttribute="centerY" secondItem="r6K-Jm-mZe" secondAttribute="centerY" id="6lX-PM-B49"/>
|
||||
<constraint firstItem="P3j-nY-jrB" firstAttribute="leading" secondItem="se5-gp-TjO" secondAttribute="leading" constant="20" symbolic="YES" id="77p-ZO-9Li"/>
|
||||
<constraint firstItem="ta6-x2-NZt" firstAttribute="trailing" secondItem="H05-Rp-UzR" secondAttribute="trailing" id="8GP-Eq-sFq"/>
|
||||
<constraint firstItem="r6K-Jm-mZe" firstAttribute="leading" relation="greaterThanOrEqual" secondItem="LrH-O2-kmq" secondAttribute="trailing" constant="8" symbolic="YES" id="Fmj-AX-OLl"/>
|
||||
<constraint firstItem="P3j-nY-jrB" firstAttribute="top" secondItem="se5-gp-TjO" secondAttribute="top" constant="10" id="R9e-ne-2Uq"/>
|
||||
<constraint firstItem="LrH-O2-kmq" firstAttribute="leading" secondItem="YB5-mV-vY7" secondAttribute="trailing" constant="8" symbolic="YES" id="Txe-Zl-aYz"/>
|
||||
<constraint firstItem="YB5-mV-vY7" firstAttribute="leading" secondItem="efl-ex-LQ4" secondAttribute="trailing" constant="8" symbolic="YES" id="Uc0-iA-Qbi"/>
|
||||
<constraint firstItem="efl-ex-LQ4" firstAttribute="baseline" secondItem="P3j-nY-jrB" secondAttribute="baseline" id="XLQ-85-9yK"/>
|
||||
<constraint firstAttribute="trailing" secondItem="r6K-Jm-mZe" secondAttribute="trailing" constant="20" symbolic="YES" id="Y5v-lS-PaP"/>
|
||||
<constraint firstItem="MOe-eO-fyb" firstAttribute="leading" secondItem="rIR-2b-lAh" secondAttribute="trailing" id="Zbk-LU-Ff1"/>
|
||||
<constraint firstAttribute="bottom" secondItem="ta6-x2-NZt" secondAttribute="bottom" constant="20" symbolic="YES" id="bsR-t3-YF5"/>
|
||||
<constraint firstItem="efl-ex-LQ4" firstAttribute="leading" secondItem="P3j-nY-jrB" secondAttribute="trailing" constant="8" symbolic="YES" id="cLW-5d-9Sf"/>
|
||||
<constraint firstItem="H05-Rp-UzR" firstAttribute="leading" secondItem="MOe-eO-fyb" secondAttribute="trailing" id="cXy-nX-qgy"/>
|
||||
<constraint firstAttribute="trailing" secondItem="H05-Rp-UzR" secondAttribute="trailing" id="dii-07-TA9"/>
|
||||
<constraint firstItem="ta6-x2-NZt" firstAttribute="top" secondItem="P3j-nY-jrB" secondAttribute="bottom" constant="8" symbolic="YES" id="f7E-bv-epu"/>
|
||||
<constraint firstItem="rIR-2b-lAh" firstAttribute="leading" secondItem="se5-gp-TjO" secondAttribute="leading" id="oK1-50-wsP"/>
|
||||
<constraint firstItem="LrH-O2-kmq" firstAttribute="baseline" secondItem="YB5-mV-vY7" secondAttribute="baseline" id="s4q-VN-G9l"/>
|
||||
<constraint firstItem="MOe-eO-fyb" firstAttribute="baseline" secondItem="rIR-2b-lAh" secondAttribute="baseline" id="t7L-ad-xpD"/>
|
||||
<constraint firstItem="H05-Rp-UzR" firstAttribute="top" secondItem="MOe-eO-fyb" secondAttribute="top" id="te2-kl-pfy"/>
|
||||
<constraint firstItem="efl-ex-LQ4" firstAttribute="centerY" secondItem="YB5-mV-vY7" secondAttribute="centerY" id="zgD-Re-nSq"/>
|
||||
</constraints>
|
||||
</view>
|
||||
<connections>
|
||||
<outlet property="delegate" destination="-2" id="0bl-1N-AYu"/>
|
||||
</connections>
|
||||
<point key="canvasLocation" x="271.5" y="416.5"/>
|
||||
</window>
|
||||
<menuItem title="Item" id="LMX-DA-dj7">
|
||||
<modifierMask key="keyEquivalentModifierMask"/>
|
||||
</menuItem>
|
||||
</objects>
|
||||
</document>
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="7096" systemVersion="14C82" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="6250" systemVersion="14C79" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
|
||||
<dependencies>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="7096"/>
|
||||
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="6250"/>
|
||||
</dependencies>
|
||||
<objects>
|
||||
<customObject id="-2" userLabel="File's Owner" customClass="ASProjDoc" customModule="AVRsack">
|
||||
|
@ -114,6 +114,12 @@
|
|||
<action selector="disassembleProject:" target="-2" id="idL-cS-KK9"/>
|
||||
</connections>
|
||||
</toolbarItem>
|
||||
<toolbarItem implicitItemIdentifier="509BEB7C-6259-4D29-952B-6CA05671EADC" label="Connect" paletteLabel="Connect" tag="-1" image="ConnIcon" autovalidates="NO" id="5gL-i2-xOK">
|
||||
<connections>
|
||||
<action selector="serialConnect:" target="-2" id="zIs-rA-Ger"/>
|
||||
<binding destination="-2" name="enabled" keyPath="hasValidPort" id="VV7-dW-3xH"/>
|
||||
</connections>
|
||||
</toolbarItem>
|
||||
<toolbarItem implicitItemIdentifier="2B98B0B2-C192-4A20-9C17-8CDBD6A9002F" label="Clean" paletteLabel="Clean" tag="-1" image="CleanIcon" id="lGv-lT-Eh9">
|
||||
<connections>
|
||||
<action selector="cleanProject:" target="-1" id="LzL-6C-IDi"/>
|
||||
|
@ -210,6 +216,7 @@
|
|||
<toolbarItem reference="vAE-60-8kd"/>
|
||||
<toolbarItem reference="Lt2-Z7-7Pg"/>
|
||||
<toolbarItem reference="r8E-ar-tLo"/>
|
||||
<toolbarItem reference="5gL-i2-xOK"/>
|
||||
<toolbarItem reference="FYt-ZW-Epr"/>
|
||||
<toolbarItem reference="ln2-Ky-MBg"/>
|
||||
</defaultToolbarItems>
|
||||
|
@ -224,6 +231,7 @@
|
|||
<resources>
|
||||
<image name="BuildIcon" width="32" height="32"/>
|
||||
<image name="CleanIcon" width="32" height="32"/>
|
||||
<image name="ConnIcon" width="32" height="32"/>
|
||||
<image name="DisassIcon" width="32" height="32"/>
|
||||
<image name="UploadIcon" width="32" height="32"/>
|
||||
</resources>
|
||||
|
|
BIN
AVRsack/Images.xcassets/ConnIcon.imageset/ConnectIcon 1x.png
vendored
Normal file
BIN
AVRsack/Images.xcassets/ConnIcon.imageset/ConnectIcon 1x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.8 KiB |
BIN
AVRsack/Images.xcassets/ConnIcon.imageset/ConnectIcon 2x.png
vendored
Normal file
BIN
AVRsack/Images.xcassets/ConnIcon.imageset/ConnectIcon 2x.png
vendored
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.0 KiB |
22
AVRsack/Images.xcassets/ConnIcon.imageset/Contents.json
vendored
Normal file
22
AVRsack/Images.xcassets/ConnIcon.imageset/Contents.json
vendored
Normal file
|
@ -0,0 +1,22 @@
|
|||
{
|
||||
"images" : [
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "1x",
|
||||
"filename" : "ConnectIcon 1x.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "2x",
|
||||
"filename" : "ConnectIcon 2x.png"
|
||||
},
|
||||
{
|
||||
"idiom" : "universal",
|
||||
"scale" : "3x"
|
||||
}
|
||||
],
|
||||
"info" : {
|
||||
"version" : 1,
|
||||
"author" : "xcode"
|
||||
}
|
||||
}
|
BIN
Artwork/ConnectIcon.artx/Preview/preview.png
Normal file
BIN
Artwork/ConnectIcon.artx/Preview/preview.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 86 KiB |
BIN
Artwork/ConnectIcon.artx/QuickLook/Preview.pdf
Normal file
BIN
Artwork/ConnectIcon.artx/QuickLook/Preview.pdf
Normal file
Binary file not shown.
BIN
Artwork/ConnectIcon.artx/doc.thread
Normal file
BIN
Artwork/ConnectIcon.artx/doc.thread
Normal file
Binary file not shown.
Loading…
Reference in New Issue
Block a user