V5.0.0bug修复
This commit is contained in:
@@ -10,7 +10,9 @@
|
||||
#import "IfishHistroyVo.h"
|
||||
|
||||
#define Normal_heaterPh 499 //只有499才是正常流量
|
||||
#define Rect_Width 248.f
|
||||
#define Rect_Width kSizeFrom750(568)
|
||||
#define Origin_Left kSizeFrom750(72)
|
||||
#define Rect_Height kSizeFrom750(185)
|
||||
@interface IfishChatView()
|
||||
@property(nonatomic,strong)NSMutableArray*line1;
|
||||
@property(nonatomic,strong)UIView *lablesView;
|
||||
@@ -25,6 +27,7 @@ Strong NSMutableArray * heaterPhArray;//流量走势
|
||||
if (_numLable==nil) {
|
||||
_numLable=[[UILabel alloc]init];
|
||||
[self addSubview:_numLable];
|
||||
|
||||
}
|
||||
return _numLable;
|
||||
}
|
||||
@@ -40,13 +43,13 @@ Strong NSMutableArray * heaterPhArray;//流量走势
|
||||
// CGFloat gapW= 357*scale*0.1;
|
||||
for (int i=0; i<self.datas.count; i++) {
|
||||
IfishHistroyVo*vo=self.datas[i];
|
||||
CGFloat x=32 +([vo.heaterGatheringTime floatValue]/24)*Rect_Width;
|
||||
CGFloat x=Origin_Left +([vo.heaterGatheringTime floatValue]/24)*Rect_Width;
|
||||
if(vo.heaterWaterTemperature.integerValue>350){
|
||||
vo.heaterWaterTemperature=@"350";
|
||||
}else if(vo.heaterWaterTemperature.integerValue<250){
|
||||
continue;
|
||||
}
|
||||
CGFloat y=80*(1-((vo.heaterWaterTemperature.integerValue*0.1-25)/10))+19;//*-1*+158;
|
||||
CGFloat y=Rect_Height*(1-((vo.heaterWaterTemperature.integerValue*0.1-25)/10))+kSizeFrom750(43);//*-1*+158;
|
||||
CGPoint p1=CGPointMake(x, y);
|
||||
// NSLog(@"%f-------%f--%f-",y,vo.heaterWaterTemperature.integerValue*0.1,x);
|
||||
[_line1 addObject:NSStringFromCGPoint(p1)];
|
||||
@@ -66,10 +69,10 @@ Strong NSMutableArray * heaterPhArray;//流量走势
|
||||
_heaterPhArray = InitObject(NSMutableArray);
|
||||
//添加流量
|
||||
for (int i=0; i<23; i++) {
|
||||
CGFloat x=(i*(Rect_Width/24)+32);
|
||||
CGFloat y=104;
|
||||
CGFloat x=(i*(Rect_Width/24)+Origin_Left);
|
||||
CGFloat y=kSizeFrom750(236);
|
||||
UIView *lineView = [[UIView alloc] initWithFrame:RECT(x, y, Rect_Width/24, 1)];
|
||||
lineView.tag = i+1000;
|
||||
lineView.tag = i+100;
|
||||
[self addSubview:lineView];
|
||||
[_heaterPhArray addObject:lineView];
|
||||
}
|
||||
@@ -88,11 +91,11 @@ Strong NSMutableArray * heaterPhArray;//流量走势
|
||||
//如果有时间段的数据拿不到,则直接使用虚线
|
||||
if ([nextVo.heaterGatheringTime integerValue]-[vo.heaterGatheringTime integerValue]>1) {
|
||||
for (int i=[vo.heaterGatheringTime intValue]; i<[nextVo.heaterGatheringTime intValue]; i++) {
|
||||
UIView *emptyView = [self viewWithTag:i+1000];
|
||||
UIView *emptyView = [self viewWithTag:i+100];
|
||||
[self drawDashLine:emptyView lineLength:2 lineSpacing:1 lineColor:[UIColor redColor]];
|
||||
}
|
||||
}else{
|
||||
UIView *lineView = [self viewWithTag:[vo.heaterGatheringTime integerValue]+1000];
|
||||
UIView *lineView = [self viewWithTag:[vo.heaterGatheringTime integerValue]+100];
|
||||
if([vo.heaterPh integerValue]==Normal_heaterPh&&[nextVo.heaterPh integerValue]==Normal_heaterPh){//正常流量
|
||||
lineView.layer.backgroundColor = [UIColor greenColor].CGColor;
|
||||
|
||||
@@ -124,51 +127,7 @@ Strong NSMutableArray * heaterPhArray;//流量走势
|
||||
// [path closePath];//第五条线通过调用closePath方法得到的
|
||||
|
||||
[path stroke];//Draws line 根据坐标点连线
|
||||
//添加坐标点
|
||||
// for (int i=0; i<self.line1.count; i++) {
|
||||
//
|
||||
// NSString* p=self.line1[i];
|
||||
// CGPoint point=CGPointFromString(p);
|
||||
// UIBezierPath *path0 = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(point.x-1, point.y-1, 2, 2) cornerRadius:1];
|
||||
// [path0 stroke];
|
||||
// [path0 fill];
|
||||
//
|
||||
// }
|
||||
// UIColor *color1 = [UIColor greenColor];
|
||||
// [color1 set]; //设置线条颜色
|
||||
//
|
||||
// UIBezierPath* path1 = [UIBezierPath bezierPath];
|
||||
// path1.lineWidth = 1.0;
|
||||
//
|
||||
// path1.lineCapStyle = kCGLineCapRound; //线条拐角
|
||||
// path1.lineJoinStyle = kCGLineJoinRound; //终点处理
|
||||
// // Draw the lines
|
||||
// for (int i=0; i<self.line2.count; i++) {
|
||||
// NSString* p=self.line2[i];
|
||||
// if (i==0) {
|
||||
// [path1 moveToPoint:CGPointFromString(p)];//起点
|
||||
// }
|
||||
// [path1 addLineToPoint:CGPointFromString(p)];
|
||||
// }
|
||||
|
||||
// [path closePath];//第五条线通过调用closePath方法得到的
|
||||
|
||||
// [path stroke];//Draws line 根据坐标点连线
|
||||
// CGFloat dashPattern[] = {3,1};// 3实线,1空白
|
||||
|
||||
// [path1 setLineDash:dashPattern count:1 phase:1];
|
||||
// [path1 stroke];//颜色填充
|
||||
|
||||
//添加坐标点
|
||||
// for (int i=0; i<self.line1.count; i++) {
|
||||
//
|
||||
// NSString* p=self.line2[i];
|
||||
// CGPoint point=CGPointFromString(p);
|
||||
// UIBezierPath *path01 = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(point.x-1, point.y-1, 2, 2) cornerRadius:1];
|
||||
// [path01 stroke];
|
||||
// [path01 fill];
|
||||
//
|
||||
// }
|
||||
}
|
||||
/**
|
||||
** lineView: 需要绘制成虚线的view
|
||||
|
||||
Reference in New Issue
Block a user