temp commit

This commit is contained in:
Johan Degraeve 2019-09-22 00:04:02 +02:00
parent 67c6290667
commit 62bc57e9e0
9 changed files with 112 additions and 6 deletions

View File

@ -47,6 +47,10 @@
F821CF9722AE589E005C1E43 /* HealthKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = F821CF9622AE589E005C1E43 /* HealthKit.framework */; };
F821CF9D22AEF483005C1E43 /* BGReadingSpeaker.swift in Sources */ = {isa = PBXBuildFile; fileRef = F821CF9C22AEF483005C1E43 /* BGReadingSpeaker.swift */; };
F856CE5B22EDC8E50083E436 /* ConstantsBluetoothPairing.swift in Sources */ = {isa = PBXBuildFile; fileRef = F856CE5A22EDC8E50083E436 /* ConstantsBluetoothPairing.swift */; };
F85C4A962336C5E100D6A86F /* M5Stack+CoreDataClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = F85C4A952336C5E100D6A86F /* M5Stack+CoreDataClass.swift */; };
F85C4A972336C5E100D6A86F /* M5Stack+CoreDataProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = F85C4A942336C5E100D6A86F /* M5Stack+CoreDataProperties.swift */; };
F85C4A9A2336CE8E00D6A86F /* M5StacksViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F85C4A992336CE8E00D6A86F /* M5StacksViewController.swift */; };
F85C4A9D2336D05100D6A86F /* M5StackViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = F85C4A9C2336D05100D6A86F /* M5StackViewController.swift */; };
F85DC2ED21CFE2F500B9F74A /* BgReading+CoreDataProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = F85DC2E721CFE2F500B9F74A /* BgReading+CoreDataProperties.swift */; };
F85DC2EF21CFE2F500B9F74A /* Sensor+CoreDataProperties.swift in Sources */ = {isa = PBXBuildFile; fileRef = F85DC2E921CFE2F500B9F74A /* Sensor+CoreDataProperties.swift */; };
F85DC2F321CFE3D400B9F74A /* Calibration+CoreDataClass.swift in Sources */ = {isa = PBXBuildFile; fileRef = F85DC2F021CFE3D400B9F74A /* Calibration+CoreDataClass.swift */; };
@ -264,6 +268,10 @@
F846CDD623046BAE00DCF016 /* pt */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = pt; path = pt.lproj/SettingsViews.strings; sourceTree = "<group>"; };
F856CE5A22EDC8E50083E436 /* ConstantsBluetoothPairing.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConstantsBluetoothPairing.swift; sourceTree = "<group>"; };
F85C4A93233632EC00D6A86F /* xdrip v2.xcdatamodel */ = {isa = PBXFileReference; lastKnownFileType = wrapper.xcdatamodel; path = "xdrip v2.xcdatamodel"; sourceTree = "<group>"; };
F85C4A942336C5E100D6A86F /* M5Stack+CoreDataProperties.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = "M5Stack+CoreDataProperties.swift"; path = "/Users/johandegraeve/OneDrive/Xcode Projects/xdrip/xdrip/Core Data/classes/M5Stack+CoreDataProperties.swift"; sourceTree = "<absolute>"; };
F85C4A952336C5E100D6A86F /* M5Stack+CoreDataClass.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = "M5Stack+CoreDataClass.swift"; path = "/Users/johandegraeve/OneDrive/Xcode Projects/xdrip/xdrip/Core Data/classes/M5Stack+CoreDataClass.swift"; sourceTree = "<absolute>"; };
F85C4A992336CE8E00D6A86F /* M5StacksViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = M5StacksViewController.swift; sourceTree = "<group>"; };
F85C4A9C2336D05100D6A86F /* M5StackViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = M5StackViewController.swift; sourceTree = "<group>"; };
F85DC2E721CFE2F500B9F74A /* BgReading+CoreDataProperties.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = "BgReading+CoreDataProperties.swift"; path = "../Extensions/BgReading+CoreDataProperties.swift"; sourceTree = "<group>"; };
F85DC2E921CFE2F500B9F74A /* Sensor+CoreDataProperties.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; name = "Sensor+CoreDataProperties.swift"; path = "../Extensions/Sensor+CoreDataProperties.swift"; sourceTree = "<group>"; };
F85DC2F021CFE3D400B9F74A /* Calibration+CoreDataClass.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Calibration+CoreDataClass.swift"; sourceTree = "<group>"; };
@ -746,6 +754,23 @@
path = Speak;
sourceTree = "<group>";
};
F85C4A982336CE0400D6A86F /* M5StacksViewController */ = {
isa = PBXGroup;
children = (
F85C4A9B2336D03D00D6A86F /* M5StackViewController */,
F85C4A992336CE8E00D6A86F /* M5StacksViewController.swift */,
);
path = M5StacksViewController;
sourceTree = "<group>";
};
F85C4A9B2336D03D00D6A86F /* M5StackViewController */ = {
isa = PBXGroup;
children = (
F85C4A9C2336D05100D6A86F /* M5StackViewController.swift */,
);
path = M5StackViewController;
sourceTree = "<group>";
};
F85DC29B21CFCEB800B9F74A /* Recovered References */ = {
isa = PBXGroup;
children = (
@ -870,6 +895,7 @@
F8A389EE2335751D0010F405 /* M5StackNavigationController */ = {
isa = PBXGroup;
children = (
F85C4A982336CE0400D6A86F /* M5StacksViewController */,
F8A389EF233575DD0010F405 /* M5StackNavigationController.swift */,
);
path = M5StackNavigationController;
@ -1281,6 +1307,8 @@
F85DC2E721CFE2F500B9F74A /* BgReading+CoreDataProperties.swift */,
F85DC2F021CFE3D400B9F74A /* Calibration+CoreDataClass.swift */,
F867E25D2252ADAB000FD265 /* Calibration+CoreDataProperties.swift */,
F85C4A952336C5E100D6A86F /* M5Stack+CoreDataClass.swift */,
F85C4A942336C5E100D6A86F /* M5Stack+CoreDataProperties.swift */,
F85DC2F121CFE3D400B9F74A /* Sensor+CoreDataClass.swift */,
F85DC2E921CFE2F500B9F74A /* Sensor+CoreDataProperties.swift */,
);
@ -1546,6 +1574,7 @@
F80610C4222D4E4D00D8F236 /* ActionClosureable-extension.swift in Sources */,
F8B3A835227F08AC004BA588 /* PickerViewController.swift in Sources */,
F821CF9522ADB0D7005C1E43 /* HealthKitManager.swift in Sources */,
F85C4A9A2336CE8E00D6A86F /* M5StacksViewController.swift in Sources */,
F8B3A81D227DEC92004BA588 /* CalibrationsAccessor.swift in Sources */,
F8A54AE122D911BA00934E7A /* SensorDataTxMessage.swift in Sources */,
F821CF9D22AEF483005C1E43 /* BGReadingSpeaker.swift in Sources */,
@ -1593,6 +1622,7 @@
F8025C0A21D94FD700ECF0C0 /* CBManagerState.swift in Sources */,
F8B3A80A227A3D11004BA588 /* TextsAlertTypeSettings.swift in Sources */,
F8A1586D22EDB9BE007F5B5D /* ConstantsDexcomFollower.swift in Sources */,
F85C4A962336C5E100D6A86F /* M5Stack+CoreDataClass.swift in Sources */,
F8B3A850227F26F8004BA588 /* AlertTypesSettingsViewController.swift in Sources */,
F8A7407022DBB24800967CFC /* BluconTransmitterOpCode.swift in Sources */,
F8EA6CAD21BC2CA40082976B /* BluetoothTransmitter.swift in Sources */,
@ -1637,6 +1667,8 @@
F8A389CF232AE2EA0010F405 /* M5StackSettingsViewController.swift in Sources */,
F821CF5E229BF43A005C1E43 /* BgReading+NightScout.swift in Sources */,
F8A389EB233175A10010F405 /* SettingsViewM5StackSettingsViewModel.swift in Sources */,
F85C4A9D2336D05100D6A86F /* M5StackViewController.swift in Sources */,
F85C4A972336C5E100D6A86F /* M5Stack+CoreDataProperties.swift in Sources */,
F8A54ADE22D911BA00934E7A /* AESCrypt.m in Sources */,
F8A54ADC22D911BA00934E7A /* AuthChallengeTxMessage.swift in Sources */,
F8025C1321DA683400ECF0C0 /* Data.swift in Sources */,

View File

@ -0,0 +1,21 @@
import Foundation
import CoreData
public class M5Stack: NSManagedObject {
/// create M5Stack
init(address: String, name: String, nsManagedObjectContext:NSManagedObjectContext) {
super.init(entity: entity, insertInto: nsManagedObjectContext)
self.address = address
self.name = name
}
private override init(entity: NSEntityDescription, insertInto context: NSManagedObjectContext?) {
super.init(entity: entity, insertInto: context)
}
}

View File

@ -0,0 +1,23 @@
//
// M5Stack+CoreDataProperties.swift
//
//
// Created by Johan Degraeve on 21/09/2019.
//
//
import Foundation
import CoreData
extension M5Stack {
@nonobjc public class func fetchRequest() -> NSFetchRequest<M5Stack> {
return NSFetchRequest<M5Stack>(entityName: "M5Stack")
}
@NSManaged public var address: String?
@NSManaged public var name: String?
@NSManaged public var blepassword: String?
}

View File

@ -55,7 +55,7 @@
<relationship name="bgreadings" toMany="YES" deletionRule="Deny" destinationEntity="BgReading" inverseName="calibration" inverseEntity="BgReading" syncable="YES"/>
<relationship name="sensor" maxCount="1" deletionRule="Nullify" destinationEntity="Sensor" inverseName="calibrations" inverseEntity="Sensor" syncable="YES"/>
</entity>
<entity name="M5Stack" representedClassName="M5Stack" syncable="YES" codeGenerationType="class">
<entity name="M5Stack" representedClassName=".M5Stack" syncable="YES" codeGenerationType="class">
<attribute name="address" optional="YES" attributeType="String" syncable="YES"/>
<attribute name="blepassword" optional="YES" attributeType="String" syncable="YES"/>
<attribute name="name" optional="YES" attributeType="String" syncable="YES"/>

View File

@ -398,6 +398,21 @@
</objects>
<point key="canvasLocation" x="2582" y="565"/>
</scene>
<!--M5 Stacks Settings View Controller-->
<scene sceneID="0Ef-2k-ynF">
<objects>
<viewController id="E45-Z1-hcE" userLabel="M5 Stacks Settings View Controller" customClass="M5StacksViewController" customModule="xdrip" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" contentMode="scaleToFill" id="i06-al-mW1">
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<viewLayoutGuide key="safeArea" id="EvW-JA-i05"/>
</view>
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="ajO-AG-xfd" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="3582" y="-134"/>
</scene>
<!--Alert Settings View Controller-->
<scene sceneID="sgW-JX-gdP">
<objects>

View File

@ -0,0 +1,5 @@
import Foundation
final class M5StackViewController: UIViewController {
}

View File

@ -0,0 +1,6 @@
import Foundation
/// uiviewcontroller to show list of M5Stacks, first uiviewcontroller when clicking the M5Stack tab
final class M5StacksViewController: UIViewController {
}

View File

@ -14,7 +14,7 @@ final class AlertSettingsViewController: UIViewController {
@IBOutlet weak var topLabelOutlet: UILabel!
// done button, to confirm changes
/// done button, to confirm changes
@IBAction func doneButtonAction(_ sender: UIBarButtonItem) {
alertEntryAsNSObject.alertkind = alertSettingsViewControllerData.alertKind
@ -31,7 +31,7 @@ final class AlertSettingsViewController: UIViewController {
@IBOutlet weak var doneButtonOutlet: UIBarButtonItem!
// to delete the alertentry
/// to delete the alertentry
@IBAction func trashButtonAction(_ sender: UIBarButtonItem) {
// delete the alertentry
if let alertEntry = alertEntryAsNSObject {

View File

@ -12,14 +12,14 @@ fileprivate enum Setting:Int, CaseIterable {
case value = 2
}
/// AlertSettingsViewController and NewAlertSettingsViewController have similar functionality, ie the first is about updating an existing alertEntry, the other is about creatiing a new one.
/// AlertSettingsViewController and NewAlertSettingsViewController have similar functionality, ie the first is about updating an existing alertEntry, the other is about creating a new one.
///
/// AlertSettingsViewController is doing a performsegue towards NewAlertSettingsViewController. That only works with different UIViewControllers (that's why it's two), but the functionality in it is 90% the same.
///
/// to avoid code duplication, all relevant code is writtein in the class AlertSettingsViewControllerData, which conforms to the protocols UITableViewDataSource, UITableViewDelegate
///
/// the classes AlertSettingsViewController and NewAlertSettingsViewController will have a property of type AlertSettingsViewControllerData, and the tableView in each of them will use that property as delegate and datasource
class AlertSettingsViewControllerData:NSObject, UITableViewDataSource, UITableViewDelegate {
/// the classes AlertSettingsViewController and NewAlertSettingsViewController have a property of type AlertSettingsViewControllerData, and the tableView in each of them uses that property as delegate and datasource
class AlertSettingsViewControllerData: NSObject, UITableViewDataSource, UITableViewDelegate {
// MARK:- properties
@ -31,21 +31,25 @@ class AlertSettingsViewControllerData:NSObject, UITableViewDataSource, UITableVi
/// value of alertEntry being modified
public var value:Int16
/// will be used to compare original value to changed value, to detect changes on the screen
private let tempValue:Int16
/// alertKind of alertEntry being modified
public var alertKind:Int16
/// will be used to compare original value to changed value, to detect changes on the screen
private let tempAlertKind:Int16
/// alertType of alertEntry being modified, default nil because it can't be initialized
public var alertType:AlertType
/// will be used to compare original value to changed value, to detect changes on the screen
private let tempAlertType:AlertType
/// when modifying the start value, this is the minimum value
public var minimumStart:Int16
/// when modifying the start value , this is the maximum value
public var maximumStart:Int16 = Int16(24 * 60 - 1) // default one minute before midnight