| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111 |
- //
- // CommandClassControlDetailView.m
- // kneet
- //
- // Created by Jason Lee on 3/16/15.
- // Copyright (c) 2015 ntels. All rights reserved.
- //
- #import "JDObject.h"
- #import "RequestHandler.h"
- #import "JDJSONModel.h"
- #import "DeviceModel.h"
- #import "CustomLabel.h"
- #import "CommonUtil.h"
- #import "CustomButton.h"
- #import "CustomRadioGroup.h"
- #import "UIImageView+WebCache.h"
- #import "CommandClassControlDetailView.h"
- #import "CommandClassControlView.h"
- #import "CustomImageView.h"
- #define GRAPH_ANI_DUR 0.5f
- #define DEGREES(radians)((radians) * 180 / M_PI)
- #define RADIANS(degree)((degree) * M_PI / 180)
- #define kfControlDetailDefaultWidth 320.0f;
- #define kfControlDetailDefaultHeight 340.0f;
- typedef void(^NodeCommandCompletionBlock)(id result);
- typedef void(^NodeCommandFailureBlock)(id error);
- @implementation CommandClassControlDetailView
- + (CommandClassControlView *)viewForCommandClass:(CmdClsType)cmdClsType
- {
- CommandClassControlView *controlView = nil;
- for (UIView *view in [CommonUtil nibViews:@"CommandClassControlDetailView"]) {
- if (view.tag == cmdClsType) {
- controlView = (CommandClassControlView *)view;
-
- controlView.width = IPHONE_WIDTH;
- controlView.height = kfControlDetailDefaultHeight;
-
- break;
- }
- }
- if (!controlView) {//상위 부모에서 가져옴.
- controlView = [CommandClassControlView viewForCommandClass:cmdClsType];
- }
- return controlView;
- }
- @end
- @implementation CommandClassSwitchDetailView
- - (void)setLayoutUI {
-
- [super setLayoutUI];
-
- [self updateLayout];
- }
- - (IBAction)btnOnTouched:(id)sender {
-
- [self requestNodeCommand:self.parameterForNodeCommand requestValue:_requestValueForOn completionHandler:nil failureHandler:nil];
- }
- - (IBAction)btnOffTouched:(id)sender {
-
- [self requestNodeCommand:self.parameterForNodeCommand requestValue:_requestValueForOff completionHandler:nil failureHandler:nil];
- }
- - (void)updateLayout {
- [super updateLayout];
-
- _btnOn.selected = _isON;
- _btnOff.selected = !_btnOn.selected;
- }
- @end
- @implementation CommandClassValveDetailView
- @end
- #pragma mark - Sensors View
- @implementation CommandClassSensorBinaryDetailView
- @end
- @implementation CommandClassSensorMultiLevelDetailView
- @end
|