Skip to content

Commit 91b1f02

Browse files
author
Gary Vandergaast
committedNov 1, 2018
Last commit on branch before merger.
1 parent f4ded3c commit 91b1f02

File tree

7 files changed

+34
-9
lines changed

7 files changed

+34
-9
lines changed
 

‎.DS_Store

0 Bytes
Binary file not shown.

‎BLEWeather4 Changes.docx

79 Bytes
Binary file not shown.

‎Basic Chat/BLECentralViewController.swift

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
// Created by Trevor Beaton on 11/29/16.
66
// Copyright © 2016 Vanguard Logic LLC. All rights reserved.
77
//
8-
// Modified by Gary Vandergaast 2018 October
8+
// Modified by Gary Vandergaast 2018 October 29
99

1010
import Foundation
1111
import UIKit

‎Basic Chat/Base.lproj/Main.storyboard

+16-3
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,14 @@
173173
<action selector="goToChart:" destination="aQA-m6-Bjv" eventType="touchUpInside" id="RCs-Ti-eGZ"/>
174174
</connections>
175175
</button>
176+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="L" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="6v5-uI-Qkk">
177+
<rect key="frame" x="351" y="14" width="16" height="16"/>
178+
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
179+
<color key="backgroundColor" red="0.99813264608383179" green="0.410429447889328" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
180+
<fontDescription key="fontDescription" type="system" pointSize="12"/>
181+
<nil key="textColor"/>
182+
<nil key="highlightedColor"/>
183+
</label>
176184
</subviews>
177185
<color key="backgroundColor" white="0.33333333333333331" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
178186
<constraints>
@@ -216,6 +224,7 @@
216224
</navigationItem>
217225
<connections>
218226
<outlet property="battColor" destination="pyL-wG-WP2" id="d8T-bX-862"/>
227+
<outlet property="blinkLamp" destination="6v5-uI-Qkk" id="L6k-ED-upZ"/>
219228
<outlet property="humLabel" destination="Uv3-jW-OvO" id="KUc-ue-AhG"/>
220229
<outlet property="newLabel" destination="A2j-Dg-dTR" id="0tU-dD-9gj"/>
221230
<outlet property="scrollView" destination="fEQ-Id-Qp8" id="FsD-lV-H8p"/>
@@ -245,15 +254,19 @@
245254
<view contentMode="scaleToFill" ambiguous="YES" translatesAutoresizingMaskIntoConstraints="NO" id="xwx-tt-h2V">
246255
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
247256
<subviews>
248-
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" fixedFrame="YES" scrollEnabled="NO" editable="NO" text="Raw data." textAlignment="natural" selectable="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ee1-eA-ZdH">
249-
<rect key="frame" x="26" y="28" width="323" height="584"/>
250-
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
257+
<textView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" scrollEnabled="NO" editable="NO" text="Raw data." textAlignment="natural" selectable="NO" translatesAutoresizingMaskIntoConstraints="NO" id="ee1-eA-ZdH">
258+
<rect key="frame" x="0.0" y="0.0" width="375" height="33"/>
251259
<color key="backgroundColor" red="0.92143100499999997" green="0.92145264149999995" blue="0.92144101860000005" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
252260
<fontDescription key="fontDescription" type="system" pointSize="14"/>
253261
<textInputTraits key="textInputTraits" autocapitalizationType="sentences"/>
254262
</textView>
255263
</subviews>
256264
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
265+
<constraints>
266+
<constraint firstItem="ee1-eA-ZdH" firstAttribute="leading" secondItem="xwx-tt-h2V" secondAttribute="leading" id="DMS-f8-EtV"/>
267+
<constraint firstItem="ee1-eA-ZdH" firstAttribute="top" secondItem="xwx-tt-h2V" secondAttribute="top" id="Gnp-gP-lw6"/>
268+
<constraint firstAttribute="trailing" secondItem="ee1-eA-ZdH" secondAttribute="trailing" id="c5D-kU-rSo"/>
269+
</constraints>
257270
</view>
258271
</subviews>
259272
<constraints>

‎Basic Chat/ChartViewController.swift

+3-3
Original file line numberDiff line numberDiff line change
@@ -43,17 +43,17 @@ class ChartViewController: UIViewController, CBPeripheralManagerDelegate {
4343
let myAttributes3 = [NSAttributedString.Key.font: thisFont!, NSAttributedString.Key.foregroundColor: UIColor.darkGray]
4444

4545
countValue = self.rawDataList.text.count
46-
let countString = String(countValue)
46+
// print(countValue)
4747

48-
let modString = NSAttributedString(string: " " + (characteristicASCIIValue as String) + " " + countString + addToString, attributes: myAttributes3)
48+
let modString = NSAttributedString(string: " " + (characteristicASCIIValue as String) + addToString, attributes: myAttributes3)
4949
let textText = NSMutableAttributedString(attributedString: self.buildupAsciiText!)
5050

5151
textText.append(modString)
5252

5353
self.buildupAsciiText = textText
5454
self.rawDataList.attributedText = self.buildupAsciiText
5555

56-
if countValue >= 650 {
56+
if countValue >= 562 {
5757
self.buildupAsciiText = NSAttributedString(string: "")
5858
}
5959
}

‎Basic Chat/UartModuleViewController.swift

+14-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//
55
// Created by Trevor Beaton on 12/4/16.
66
// Copyright © 2016 Vanguard Logic LLC. All rights reserved.
7-
//
7+
// Modified by Gary Vandergaast 2018 November 1
88

99

1010
import UIKit
@@ -13,7 +13,8 @@ import CoreBluetooth
1313
class UartModuleViewController: UIViewController, CBPeripheralManagerDelegate {
1414

1515
//UI
16-
@IBOutlet weak var baseTextView: UITextView!
16+
17+
@IBOutlet weak var blinkLamp: UILabel!
1718
@IBOutlet weak var humLabel: UILabel!
1819
@IBOutlet weak var newLabel: UILabel!
1920
@IBOutlet weak var scrollView: UIScrollView!
@@ -25,9 +26,11 @@ class UartModuleViewController: UIViewController, CBPeripheralManagerDelegate {
2526
private var consoleAsciiText:NSAttributedString? = NSAttributedString(string: "")
2627
var tValue : Double = 0
2728
var tempDataArray = Array(repeating: 0.0, count: 10)
29+
var blinker : Bool = true
2830

2931
override func viewDidLoad() {
3032
super.viewDidLoad()
33+
blinkLamp.text = ""
3134

3235
self.navigationItem.backBarButtonItem = UIBarButtonItem(title:"Back", style:.plain, target:nil, action:nil)
3336

@@ -99,6 +102,15 @@ class UartModuleViewController: UIViewController, CBPeripheralManagerDelegate {
99102
self.newLabel.text = tempString
100103
self.humLabel.text = humString
101104

105+
if self.blinker == true {
106+
self.blinkLamp.backgroundColor = UIColor.red
107+
self.blinker = false
108+
} else {
109+
self.blinkLamp.backgroundColor = UIColor.orange
110+
self.blinker = true
111+
}
112+
113+
102114
let battValue = String(labelString[battRange])
103115

104116
if battValue == "b"

0 commit comments

Comments
 (0)
Please sign in to comment.