|
|
@@ -238,6 +238,32 @@
|
|
|
else if(curUploadFileDataModel.curUploadStateType == uploadStateUploading){
|
|
|
[_upLoadStateButton setImage:[UIImage imageNamed:@"uploadFile_suspend"] forState:UIControlStateNormal];
|
|
|
_fileSpeedlabel.hidden = NO;
|
|
|
+
|
|
|
+ //
|
|
|
+ _fileSpeedlabel.text = @"";
|
|
|
+
|
|
|
+ if(curUploadFileDataModel.preTimeInterval <= 0){
|
|
|
+ _fileSpeedlabel.text = @"--";
|
|
|
+ }
|
|
|
+ else{
|
|
|
+ NSTimeInterval timers = curUploadFileDataModel.curTimeInterval - curUploadFileDataModel.preTimeInterval;
|
|
|
+
|
|
|
+ if(timers > 0){
|
|
|
+ long speed= 5*1024*1024 / timers;
|
|
|
+ NSString * speedStr = nil;
|
|
|
+ NSInteger speed_k = speed / (1024);
|
|
|
+ if(speed_k < 1024){
|
|
|
+ speedStr = [[NSString alloc] initWithFormat:@"%ldKB/s",speed_k];
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ speedStr = [[NSString alloc] initWithFormat:@"%.1fMB/s",speed_k/1024.0];
|
|
|
+ }
|
|
|
+
|
|
|
+ _fileSpeedlabel.text = speedStr;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ curUploadFileDataModel.preTimeInterval = curUploadFileDataModel.curTimeInterval;
|
|
|
}
|
|
|
else if(curUploadFileDataModel.curUploadStateType == uploadStateSuspend){
|
|
|
[_upLoadStateButton setImage:[UIImage imageNamed:@"uploadFile_start"] forState:UIControlStateNormal];
|
|
|
@@ -310,8 +336,6 @@
|
|
|
|
|
|
}
|
|
|
|
|
|
- //_fileSpeedlabel.text = @"--";
|
|
|
- _fileSpeedlabel.text = @"";
|
|
|
}
|
|
|
|
|
|
|