瀏覽代碼

- 모드 편집시 장치선택 화면 오류 수정중

KaRam Kim 8 年之前
父節點
當前提交
0c91a3266b

File diff suppressed because it is too large
+ 2015 - 42
OneCable/Classes/CommonUI/CommandClassControlNodeView.xib


+ 1 - 1
OneCable/Classes/CommonUI/DeviceNodePopupView.m

@@ -190,7 +190,7 @@
         tcell.chkSelect.checked = [tcell.chkSelect getCheckStatusFromValue];
     }
     
-    
+    NSLog(@"SubItem : %@", subItem);
     CommandClassControlNodeView *controlView = _controlViewArray.count > indexPath.row ? _controlViewArray[indexPath.row] : nil;
     if (!controlView) {
         controlView = [CommandClassControlNodeView viewForCommandClass:subItem.cmdclsType];

+ 5 - 2
OneCable/Classes/CommonUI/DeviceSelectPopupView.m

@@ -86,7 +86,7 @@
 
 - (id)initFromNibWithRefDevices:(NSMutableArray<ItemModel> *)refDevices
                        typeCode:(NSString*)typeCode {
-
+    
     id popup = [self initFromNib];
     
     _typeCode = typeCode;
@@ -97,8 +97,8 @@
     return popup;
 }
 
+
 - (void)initTableViewAsDefaultStyle:(CustomTableView *)tableView {
-    
     tableView.dataSource = self;
     tableView.delegate = self;
     
@@ -108,6 +108,9 @@
     tableView.tableFooterView = [[UIView alloc] init]; //this call table events;
 }
 
+- (void)didMoveToSuperview {
+    
+}
 
 - (void)setRefDevices:(NSMutableArray<ItemModel> *)refDevices {
     _refDevices = refDevices;

+ 1 - 1
OneCable/Classes/Definitions.h

@@ -193,7 +193,7 @@ static NSInteger kMaxTimeOut = 60;      //운영
 
 //50 - Scenes
 #define API_GET_SCENE           @"/scenes"
-#define API_GET_SCENE_DETAIL_HOMEMODE   @"/mode_scenes/%@"
+#define API_GET_SCENE_DETAIL_HOMEMODE   @"/customer/%@/group/%@/mode/%@/rule"
 #define API_POST_SCENE_HOMEMODE @"/mode_scenes/%@"
 
 #define API_POST_SCENE_EXECUTE  @"/scenes/%@/execution"

+ 1 - 1
OneCable/Classes/Model/ModeModel.h

@@ -17,7 +17,7 @@
 @property (copy, nonatomic) NSString *homegrpSceneId;
 @property (copy, nonatomic) NSString *deleteCnt;
 
-
+@property (readonly, nonatomic) NSString *imgName;
 
 - (instancetype)initWithSubItem:(ItemSubModel *)subItem;
 

+ 17 - 0
OneCable/Classes/Model/ModeModel.m

@@ -32,6 +32,23 @@
     return self;
 }
 
+-(NSString *)imgName
+{
+    NSString *result = @"";
+    if ([_basicModeCode isEqualToString:HOME_MODE_MORNING]) {
+        result = @"common_homemode_icon_wakeup_on";
+    } else if ([_basicModeCode isEqualToString:HOME_MODE_AWAY]) {
+        result = @"common_homemode_icon_outing_on";
+    } else if ([_basicModeCode isEqualToString:HOME_MODE_HOME]) {
+        result = @"common_homemode_icon_homecoming_on";
+    } else if ([_basicModeCode isEqualToString:HOME_MODE_NIGHT]) {
+        result = @"common_homemode_icon_sleep_on";
+    }
+    
+    return result;
+}
+
+
 @end
 
 

+ 1 - 1
OneCable/Classes/ViewControllers/MainScreens/HomeModeMovementViewController.m

@@ -51,7 +51,7 @@
     HomeModeSettingsViewController *vc =[CommonUtil instantiateViewControllerWithIdentifier:@"HomeModeSettingsViewController" storyboardName:@"Main"];
     
     ModeModel *mode = [_modeArray objectKey:@"basicModeCode" eqaulToString:modeCode];
-
+//    NSLog(@"Mode : %@", mode);
     vc.mode = mode;
     
     [self.navigationController pushViewController:vc animated:YES];

+ 12 - 4
OneCable/Classes/ViewControllers/MainScreens/HomeModeSettingsViewController.m

@@ -63,6 +63,7 @@
 }
 
 - (void)prepareViewDidLoad {
+    _lbTitle.text = [NSString stringWithFormat:@"%@ 모드 설정", _mode.modeName];
     [self requestDeviceListForHome];
 }
 
@@ -99,7 +100,9 @@
 //현재 모드에 설정된 액션 리스트를 조회함
 - (void)requestSceneDetailsByHomeMode {
     
-    NSString *path = [NSString stringWithFormat:API_GET_SCENE_DETAIL_HOMEMODE, _mode.modeId];
+    NSArray *arr = @[_mode.modeId];
+    NSString *path = [[JDFacade facade] getUrlWithCustAndGroupID:API_GET_SCENE_DETAIL_HOMEMODE arguments:arr];
+//    NSString *path = [NSString stringWithFormat:API_GET_SCENE_DETAIL_HOMEMODE, _mode.modeId];
     
     [[RequestHandler handler] sendAsyncGetRequestAPIPath:path parameters:nil modelClass:[ItemSubListModel class] completion:^(id responseObject) {
         if (!responseObject) {//응답결과가 잘못되었거나 없을 경우,
@@ -202,8 +205,9 @@
     
     if (section == 0) {
         HomeSettingsTitleTableViewCell *tcell = (HomeSettingsTitleTableViewCell *)[tableView dequeueReusableCellWithIdentifier:@"TitleCellIdentifier"];
-        [tcell.imgvMode sd_setImageWithURL:[NSURL URLWithString:_mode.imageFileName] placeholderImage:nil options:SDWebImageRefreshCached];
-        tcell.lblModeTitle.text = _mode.modeName;
+//        [tcell.imgvMode sd_setImageWithURL:[NSURL URLWithString:_mode.imageFileName] placeholderImage:nil options:SDWebImageRefreshCached];
+        tcell.imgvMode.image = [UIImage imageNamed:_mode.imgName];
+        tcell.lblModeTitle.text = [NSString stringWithFormat:@"%@모드 실행시,\n동작할 장치를 선택하세요.",_mode.modeName];
         
         cell = tcell;
     } else if (section == 1) {
@@ -299,8 +303,11 @@
     
     [popup showWithCompletion:^(CustomAlertView *alertView, NSInteger buttonIndex) {
         if (buttonIndex == 0) {//ok
+            // todo : 수정하기
+            NSLog(@"selectedDevices : %@", popup.selectedDevices[0]);
             DeviceNodePopupView *npopup = [[DeviceNodePopupView alloc] initFromNib];
             npopup.refDevice = popup.selectedDevices[0];
+
             npopup.typeCode = ksItemTypeCodeTrigger;
             
             [npopup showWithCompletion:^(CustomAlertView *alertView, NSInteger buttonIndex) {
@@ -362,7 +369,8 @@
 }
 
 - (IBAction)btnCancelTouched:(id)sender {
-    [[self navigationController] popToRootViewControllerAnimated:YES];
+    [[self navigationController] popViewControllerAnimated:YES];
+//    [[self navigationController] popToRootViewControllerAnimated:YES];
 //    [self dismissViewControllerAnimated:YES completion:nil];
 }