|
|
@@ -84,7 +84,7 @@
|
|
|
@interface ThingsDetailViewController () <UITableViewDataSource, UITableViewDelegate ,changeDeviceNameDelegate> {
|
|
|
|
|
|
DeviceDetailModel *_deviceDetail;
|
|
|
- ModifyDeviceNamePopupView *_mpopup;
|
|
|
+// ModifyDeviceNamePopupView *_mpopup;
|
|
|
NSArray<NodeModel> *_mandatoryNodes, *_optionalNodes;
|
|
|
UIPageControl *_pageControl;
|
|
|
|
|
|
@@ -114,7 +114,7 @@
|
|
|
[self initTableViewAsDefaultStyle:_tableView];
|
|
|
_tableView.tableFooterView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, IPHONE_WIDTH, 30.0f)];
|
|
|
|
|
|
- [self setThingsDetailPopoverOptions];
|
|
|
+// [self setThingsDetailPopoverOptions];
|
|
|
|
|
|
[self initRefreshController];
|
|
|
[self setMoreBtnArray];
|
|
|
@@ -130,41 +130,41 @@
|
|
|
}
|
|
|
|
|
|
|
|
|
-- (void)setThingsDetailPopoverOptions {
|
|
|
- //set Popover Contents
|
|
|
- __weak typeof(self) weakSelf = self;
|
|
|
- _popooverOptionArray = [[NSMutableArray alloc] init];
|
|
|
-
|
|
|
- [_popooverOptionArray addObject:@{@"menuName" : NSLocalizedString(@"새로 고침",nil),
|
|
|
- @"iconName": @"img_bg_morepopup_icon_refresh",
|
|
|
- @"target": weakSelf,
|
|
|
- @"selector": [NSValue valueWithPointer:@selector(requestDeviceDetail:)]}];
|
|
|
-
|
|
|
- if ([JDFacade facade].loginUser.level > 10) {
|
|
|
- [_popooverOptionArray addObject:@{@"menuName" : NSLocalizedString(@"이름 변경", @"이름 변경"),
|
|
|
- @"iconName": @"img_bg_morepopup_icon_edit",
|
|
|
- @"target": weakSelf,
|
|
|
- @"selector": [NSValue valueWithPointer:@selector(modifyDeviceName)]}];
|
|
|
-
|
|
|
- }
|
|
|
-}
|
|
|
+//- (void)setThingsDetailPopoverOptions {
|
|
|
+// //set Popover Contents
|
|
|
+// __weak typeof(self) weakSelf = self;
|
|
|
+// _popooverOptionArray = [[NSMutableArray alloc] init];
|
|
|
+//
|
|
|
+// [_popooverOptionArray addObject:@{@"menuName" : NSLocalizedString(@"새로 고침",nil),
|
|
|
+// @"iconName": @"img_bg_morepopup_icon_refresh",
|
|
|
+// @"target": weakSelf,
|
|
|
+// @"selector": [NSValue valueWithPointer:@selector(requestDeviceDetail:)]}];
|
|
|
+//
|
|
|
+// if ([JDFacade facade].loginUser.level > 10) {
|
|
|
+// [_popooverOptionArray addObject:@{@"menuName" : NSLocalizedString(@"이름 변경", @"이름 변경"),
|
|
|
+// @"iconName": @"img_bg_morepopup_icon_edit",
|
|
|
+// @"target": weakSelf,
|
|
|
+// @"selector": [NSValue valueWithPointer:@selector(modifyDeviceName)]}];
|
|
|
+//
|
|
|
+// }
|
|
|
+//}
|
|
|
|
|
|
- (void)prepareViewDidLoad {
|
|
|
|
|
|
[self requestDeviceDetail:@YES];
|
|
|
}
|
|
|
|
|
|
-- (void)modifyDeviceName {
|
|
|
-
|
|
|
- _mpopup = [[ModifyDeviceNamePopupView alloc] initFromNib];
|
|
|
- _mpopup.txtDeviceName.text = _deviceDetail.deviceName;
|
|
|
-
|
|
|
- [_mpopup showWithCompletion:^(CustomAlertView *alertView, NSInteger buttonIndex) {
|
|
|
- if (buttonIndex == 0) {//OK
|
|
|
- [self requestDeviceUpdate];
|
|
|
- }
|
|
|
- }];
|
|
|
-}
|
|
|
+//- (void)modifyDeviceName {
|
|
|
+//
|
|
|
+// _mpopup = [[ModifyDeviceNamePopupView alloc] initFromNib];
|
|
|
+// _mpopup.txtDeviceName.text = _deviceDetail.deviceName;
|
|
|
+//
|
|
|
+// [_mpopup showWithCompletion:^(CustomAlertView *alertView, NSInteger buttonIndex) {
|
|
|
+// if (buttonIndex == 0) {//OK
|
|
|
+// [self requestDeviceUpdate];
|
|
|
+// }
|
|
|
+// }];
|
|
|
+//}
|
|
|
|
|
|
- (void)changeDeviceName:(NSString *)deviceName {
|
|
|
[self requestDeviceDetail:@YES];
|
|
|
@@ -179,7 +179,7 @@
|
|
|
} else {
|
|
|
_lblTitle.text = _deviceDetail.prdUserName;
|
|
|
}
|
|
|
-// _lblTitle.text = ![_deviceDetail.prdName isEqualToString:_deviceDetail.prdUserName] ? _deviceDetail.prdName : _deviceDetail.prdUserName;
|
|
|
+
|
|
|
|
|
|
if (![JDFacade facade].loginUser.isHomehubOnline) {
|
|
|
_lblTitle.text = @"홈허브 오프라인";
|
|
|
@@ -257,26 +257,26 @@
|
|
|
[_tableView reloadData];
|
|
|
}
|
|
|
|
|
|
-- (void)requestDeviceUpdate {
|
|
|
- //parameters
|
|
|
- NSDictionary *parameter = @{@"device_name": _mpopup.txtDeviceName.text};
|
|
|
-
|
|
|
- NSString *path = [NSString stringWithFormat:API_GET_DEVICE_UPDATE, _deviceDetail.deviceId];
|
|
|
-
|
|
|
- [[RequestHandler handler] sendAsyncPostRequestAPIPath:path parameters:parameter modelClass:[JDJSONModel class] completion:^(id responseObject) {
|
|
|
-
|
|
|
- _refDevice.deviceName = _deviceDetail.deviceName = _mpopup.txtDeviceName.text;
|
|
|
- [_tableView reloadData];
|
|
|
-
|
|
|
- //리스트를 다시 로드함.
|
|
|
- ThingsViewController *vc = [[JDFacade facade] viewControllerOnNaviationController:[ThingsViewController class]];
|
|
|
- [vc.collectionView reloadData];
|
|
|
-
|
|
|
- } failure:^(id errorObject) {
|
|
|
- JDErrorModel *error = (JDErrorModel *)errorObject;
|
|
|
- [[JDFacade facade] alert:error.errorMessage];
|
|
|
- }];
|
|
|
-}
|
|
|
+//- (void)requestDeviceUpdate {
|
|
|
+// //parameters
|
|
|
+// NSDictionary *parameter = @{@"device_name": _mpopup.txtDeviceName.text};
|
|
|
+//
|
|
|
+// NSString *path = [NSString stringWithFormat:API_GET_DEVICE_UPDATE, _deviceDetail.deviceId];
|
|
|
+//
|
|
|
+// [[RequestHandler handler] sendAsyncPostRequestAPIPath:path parameters:parameter modelClass:[JDJSONModel class] completion:^(id responseObject) {
|
|
|
+//
|
|
|
+// _refDevice.deviceName = _deviceDetail.deviceName = _mpopup.txtDeviceName.text;
|
|
|
+// [_tableView reloadData];
|
|
|
+//
|
|
|
+// //리스트를 다시 로드함.
|
|
|
+// ThingsViewController *vc = [[JDFacade facade] viewControllerOnNaviationController:[ThingsViewController class]];
|
|
|
+// [vc.collectionView reloadData];
|
|
|
+//
|
|
|
+// } failure:^(id errorObject) {
|
|
|
+// JDErrorModel *error = (JDErrorModel *)errorObject;
|
|
|
+// [[JDFacade facade] alert:error.errorMessage];
|
|
|
+// }];
|
|
|
+//}
|
|
|
|
|
|
- (void)requestDeleteDevice {
|
|
|
//parameters
|