CommandClassControlNodeView.h 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119
  1. //
  2. // CommandClassControlNodeView.h
  3. // kneet2
  4. //
  5. // Created by Jason Lee on 11/5/15.
  6. // Copyright © 2015 ntels. All rights reserved.
  7. //
  8. #import "JDObject.h"
  9. @class ItemSubModel;
  10. @class CustomButton;
  11. @class CustomLabel;
  12. @class CustomTextField;
  13. @protocol CommandClassControlNodeViewDelegate <NSObject>
  14. @optional
  15. - (void)didControlNodeAction:(id)sender;
  16. @end
  17. @interface CommandClassControlNodeView : UIView {
  18. @protected
  19. __weak ItemSubModel *_subItem;
  20. NSString *_cmdClsValue;
  21. BOOL _nodeEnable;
  22. }
  23. @property (weak, nonatomic) id <CommandClassControlNodeViewDelegate> delegate;
  24. @property (weak, nonatomic) ItemSubModel *subItem;
  25. @property (weak, nonatomic) CmdClsValueModel *selectedCmdClsValue;
  26. @property (assign, nonatomic) BOOL nodeEnable;
  27. + (CommandClassControlNodeView *)viewForCommandClass:(CmdClsType)cmdClsType;
  28. - (CGSize)sizeForIntrinsic;
  29. - (CGSize)sizeForIntrinsicForItemCount:(NSInteger)count;
  30. @end
  31. @interface CommandClassControlNodeValveView : CommandClassControlNodeView
  32. @property (weak, nonatomic) IBOutlet CustomButton *btnOpen;
  33. @property (weak, nonatomic) IBOutlet CustomButton *btnClose;
  34. @property (weak, nonatomic) IBOutlet NSLayoutConstraint *constraintBtnOpenWidth;
  35. @property (weak, nonatomic) IBOutlet NSLayoutConstraint *constraintBtnCloseWidth;
  36. @property (weak, nonatomic) IBOutlet NSLayoutConstraint *constraintBtnSpace;
  37. @property (weak, nonatomic) IBOutlet NSLayoutConstraint *constraintBtnSameWidth;
  38. - (IBAction)btnOpenTouched:(id)sender;
  39. - (IBAction)btnCloseTouched:(id)sender;
  40. @end
  41. @interface CommandClassControlNodeSwitchBinaryView : CommandClassControlNodeView
  42. @property (weak, nonatomic) IBOutlet CustomButton *btnOn;
  43. @property (weak, nonatomic) IBOutlet CustomButton *btnOff;
  44. @property (weak, nonatomic) IBOutlet NSLayoutConstraint *constraintBtnOnWidth;
  45. - (IBAction)btnOnTouched:(id)sender;
  46. - (IBAction)btnOffTouched:(id)sender;
  47. @end
  48. @interface CommandClassControlNodeSensorBinaryView : CommandClassControlNodeSwitchBinaryView
  49. @end
  50. @interface CommandClassControlNodeSwitchMultiLevelView : CommandClassControlNodeView
  51. @property (weak, nonatomic) IBOutlet CustomButton *btnMultiLevel;
  52. - (IBAction)btnMutilLevelTouched:(id)sender;
  53. @end
  54. @interface CommandClassControlNodeSensorMultiLevelView: CommandClassControlNodeSwitchMultiLevelView
  55. @end
  56. @interface CommandClassControlNodeBatteryView : CommandClassControlNodeSwitchMultiLevelView
  57. @property (weak, nonatomic) IBOutlet CustomTextField *txtInputBattery;
  58. @property (weak, nonatomic) IBOutlet CustomButton *btnBelow;
  59. @property (weak, nonatomic) IBOutlet CustomButton *btnAdove;
  60. @end
  61. @interface CommandClassControlNodeMeterView : CommandClassControlNodeSwitchMultiLevelView
  62. @end
  63. @interface CommandClassControlNodeElecPlugView : CommandClassControlNodeView
  64. @property (weak, nonatomic) IBOutlet CustomTextField *txtInputElectric;
  65. @property (weak, nonatomic) IBOutlet CustomButton *btnBelow;
  66. @property (weak, nonatomic) IBOutlet CustomButton *btnAdove;
  67. @end
  68. @interface CommandClassControlNodeTotalElecPlugView : CommandClassControlNodeView
  69. @property (weak, nonatomic) IBOutlet CustomTextField *txtInputElectric;
  70. @property (weak, nonatomic) IBOutlet CustomButton *btnBelow;
  71. @property (weak, nonatomic) IBOutlet CustomButton *btnAdove;
  72. @end
  73. @interface CommandClassControlNodeValveLockView : CommandClassControlNodeView
  74. @property (weak, nonatomic) IBOutlet CustomButton *btnLock;
  75. @end