Bladeren bron

160622 노드 추가 후 노드 이름 변경 버그 수정

eunmi.kim 8 jaren geleden
bovenliggende
commit
e2fc781a90

+ 2 - 2
OneCable/Base.lproj/HomeHub.storyboard

@@ -4020,7 +4020,7 @@
                                                 <rect key="frame" x="0.0" y="0.0" width="160" height="50"/>
                                                 <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
                                                 <fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
-                                                <state key="normal" title="취소" backgroundImage="common_button_bg">
+                                                <state key="normal" title="취소" backgroundImage="common_button_left_bg">
                                                     <color key="titleColor" red="0.53333333329999999" green="0.56078431370000004" blue="0.6588235294" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                                 </state>
                                                 <state key="highlighted" backgroundImage="common_button_bg_press"/>
@@ -4037,7 +4037,7 @@
                                                 <rect key="frame" x="160" y="0.0" width="160" height="50"/>
                                                 <color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
                                                 <fontDescription key="fontDescription" type="boldSystem" pointSize="17"/>
-                                                <state key="normal" title="확인" backgroundImage="common_button_bg">
+                                                <state key="normal" title="확인" backgroundImage="common_button_left_bg">
                                                     <color key="titleColor" red="0.011764705882352941" green="0.60392156862745094" blue="0.87450980392156863" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
                                                 </state>
                                                 <state key="highlighted" backgroundImage="common_button_bg_press"/>

+ 4 - 5
OneCable/Classes/Handler/BLEServiceHandler.m

@@ -526,8 +526,8 @@
         //NSLog(@"characteristic : %@", characteristic.UUID);
 
 //        [self readValueSetNotifyValueForCharacteristic:characteristic peripheral:peripheral];
-        [peripheral setNotifyValue:YES forCharacteristic:characteristic];
-        [peripheral readValueForCharacteristic:characteristic];
+//        [peripheral setNotifyValue:YES forCharacteristic:characteristic];
+//        [peripheral readValueForCharacteristic:characteristic];
     }
     
 }
@@ -535,10 +535,9 @@
 
 - (void)peripheral:(CBPeripheral *)peripheral didUpdateValueForCharacteristic:(CBCharacteristic *)characteristic error:(NSError *)error {
     
-    NSLog(@"Incoming: [%@], %@, %@",
+    NSLog(@"Incoming: [%@], %@",
           [self getChrName:characteristic],
-          [self asciiStringValue:characteristic],
-          [self hexStringValue:characteristic]);
+          [self asciiStringValue:characteristic]);
     
     [self updateValueForDelegateWithCharacteristic:characteristic];
 }

+ 1 - 1
OneCable/Classes/ViewControllers/HomeHubScreens/HomeHubViewController.m

@@ -187,7 +187,7 @@
         
         if (hubInfo.isUpdateSoftware) {
             
-            tcell.lblUpdate.text = [NSString stringWithFormat:@"소프웨어: 업데이트 버전%@",
+            tcell.lblUpdate.text = [NSString stringWithFormat:@"소프웨어: 업데이트 버전%@",
                                     hubInfo.lastSoftwareVersion];
         }
         if (hubInfo.isUpdateFirmware) {

+ 9 - 0
OneCable/Classes/ViewControllers/ThingsScreens/ChangeDeviceNamePopupView.m

@@ -35,6 +35,9 @@
             self = (ChangeDeviceNamePopupView *)view;
             self.deviceDetailModel = detailModel;
             
+            NSLog(@"initFromNib : %@", detailModel);
+    
+            
             //XIB의 경우, 현재 화면 사이즈로 맞춰줘야 함.
             self.frame = [UIScreen mainScreen].bounds;
             self.lblTitle.text = NSLocalizedString(@"이름 변경", @"이름 변경");
@@ -77,6 +80,8 @@
     
     [super show];
     
+    NSLog(@"showChangeDevice : %@", _deviceModel);
+    
     _deviceModel = deviceModel;
     changeDevicePopup = YES;
     
@@ -108,6 +113,10 @@
     
     NSDictionary *parameters;
     
+    NSLog(@"_deviceModel : %@, %@", _deviceModel, _deviceModel.deviceId);
+    
+    NSLog(@"_deviceDetailModel : %@, %@", _deviceDetailModel, _deviceDetailModel.deviceId);
+    
     if (_deviceModel != nil) {
         parameters = @{@"device_id": _deviceModel.deviceId,
                        @"prd_user_name" : _txtInputDeviceName.text.trim};

+ 10 - 4
OneCable/Classes/ViewControllers/ThingsScreens/ThingsAddCompleteViewController.m

@@ -9,7 +9,7 @@
 #import "ThingsAddCompleteViewController.h"
 #import "ChangeDeviceNamePopupView.h"
 
-@interface ThingsAddCompleteViewController () {
+@interface ThingsAddCompleteViewController ()<changeDeviceNameDelegate> {
 
 }
 @end
@@ -18,7 +18,7 @@
 #pragma mark - Class Definition
 
 @implementation ThingsAddCompleteViewController
-@synthesize deviceDetailModel;
+//@synthesize deviceDetailModel;
 
 - (void)viewDidLoad {
     [super viewDidLoad];
@@ -72,11 +72,17 @@
 // 이름 변경
 - (IBAction)btnChangeTouched:(id)sender {
 
-    ChangeDeviceNamePopupView *popup = [[ChangeDeviceNamePopupView alloc]initFromNib:deviceDetailModel];
-    popup.deviceDetailModel = deviceDetailModel;
+    ChangeDeviceNamePopupView *popup = [[ChangeDeviceNamePopupView alloc]initFromNib:_deviceDetailModel];
+    popup.deviceDetailModel = _deviceDetailModel;
+    popup.delegate = self;
     [popup show];
 }
 
+- (void)changeDeviceName:(NSString *)deviceName {
+    
+    [self btnCompleteTouched:nil];
+}
+
 -(void)receiveSocketData:(NSNotification *)notification
 {
     _btnChange.enabled = YES;

+ 4 - 10
OneCable/Classes/ViewControllers/ThingsScreens/ThingsAddIncludeViewController.m

@@ -221,13 +221,6 @@
 #pragma mark - SocketService
 - (void) socketDidReceiveMessage:(id)message result:(SocketModel *)result
 {
-    NSLog(@"Result Info : %@", result);
-    NSLog(@"Result Info : %@", message);
-    
-//    if (result.messageType) {
-//        <#statements#>
-//    }
-    NSLog(@"Message Type : %@", result.messageType);
     if ([result.messageType isEquestToIgnoreCase:MSG_TYPE_DEVICE_COMMAND]) {
         CommandModel *response = (CommandModel *)message;
         if (result.isSuccess) {
@@ -323,11 +316,12 @@
     else if ([result.messageType isEquestToIgnoreCase:MSG_TYPE_NODE_REGIST_RES]) {
 //        [self requestIncludeDevice:NO];
         [self startLoading:NO];
-        
+
         DeviceDetailModel *detailModel = [DeviceDetailModel new];
-        detailModel.deviceId = _selectHub.deviceId;
+        detailModel.deviceId = _selectHub != nil ? _selectHub.deviceId : _addDevice.deviceId;
         detailModel.nodeId = [notification.object objectForKey:@"node_id"];
-        
+        detailModel.deviceId = [notification.object objectForKey:@"device_id"];
+
         ThingsAddCompleteViewController *vc = [CommonUtil instantiateViewControllerWithIdentifier:@"ThingsAddCompleteViewController" storyboardName:@"Things"];
         vc.deviceDetailModel = detailModel;
         vc.isDeleteMode = NO;

+ 0 - 3
OneCable/Classes/ViewControllers/ThingsScreens/ThingsAddInitViewController.m

@@ -181,9 +181,6 @@
 #pragma mark - SocketService
 - (void) socketDidReceiveMessage:(id)message result:(SocketModel *)result
 {
-    NSLog(@"Result Info : %@", result);
-    NSLog(@"Result Info : %@", message);
-    
     //    if (result.messageType) {
     //        <#statements#>
     //    }

+ 4 - 0
OneCable/Classes/ViewControllers/ThingsScreens/ThingsAddViewController.m

@@ -179,9 +179,13 @@
     }
     
     NSDictionary *info = _addableDeviceList[indexPath.row];
+    
+    NSLog(@"info : %@", info);
+    
     DeviceModel *addDevice = [[DeviceModel alloc] init];
     addDevice.prdName = info[@"deviceName"];
     addDevice.cmdclsTypeId = info[@"deviceKey"];
+    
     ThingsAddStartViewController *vc = (ThingsAddStartViewController *)[CommonUtil instantiateViewControllerWithIdentifier:@"ThingsAddStartViewController" storyboardName:@"Things"];
     vc.addDevice = addDevice;
     vc.selectHub = _selectHub;