mark for pull
This commit is contained in:
@@ -1,6 +1,20 @@
|
||||
package com.cnbm.processInspection.graphAnalyzed;
|
||||
|
||||
import com.cnbm.basic.entity.ProductFeatures;
|
||||
import com.cnbm.common.spc.util.DataUtils;
|
||||
import com.cnbm.common.utils.DateUtils;
|
||||
import com.cnbm.influx.config.InfluxClient;
|
||||
import com.cnbm.influx.constant.Constant;
|
||||
import com.cnbm.influx.param.PageInfo;
|
||||
import com.cnbm.influx.param.QueryDataParam;
|
||||
import com.cnbm.influx.param.Range;
|
||||
import com.cnbm.influx.param.Tag;
|
||||
import com.cnbm.processInspection.controlCoefficientConstant.XBarSCoefficients;
|
||||
import com.influxdb.query.FluxRecord;
|
||||
import com.influxdb.query.FluxTable;
|
||||
|
||||
import java.time.Instant;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @Desc: ""
|
||||
@@ -27,8 +41,13 @@ public class MeanStandardDeviationGraph {
|
||||
private Integer sampleSize;
|
||||
private String argName;
|
||||
|
||||
MeanStandardDeviationGraph(Integer sampleSize){
|
||||
this.sampleSize = sampleSize;
|
||||
|
||||
MeanStandardDeviationGraph(ProductFeatures productFeatures) throws Exception {
|
||||
if(productFeatures.getSampleSize()==null || productFeatures.getName()==null){
|
||||
throw new Exception("ProductFeatures 参数异常");
|
||||
}
|
||||
|
||||
this.sampleSize = productFeatures.getSampleSize().intValue();
|
||||
this.as = XBarSCoefficients.getAS(sampleSize);
|
||||
this.bu = XBarSCoefficients.getBU(sampleSize);
|
||||
this.bl = XBarSCoefficients.getBU(sampleSize);
|
||||
@@ -41,6 +60,23 @@ public class MeanStandardDeviationGraph {
|
||||
* ①
|
||||
* */
|
||||
public void initialDate(){
|
||||
QueryDataParam queryDataParam = new QueryDataParam();
|
||||
queryDataParam.setBucket(Constant.bucket);
|
||||
queryDataParam.setMeasurement("Weight");
|
||||
queryDataParam.setDropedTagName("transationId");
|
||||
queryDataParam.setTag(new Tag("argName","LTWeight"));
|
||||
queryDataParam.setRange(new Range(DataUtils.getBeforeDate(10).toInstant(), Instant.now()));
|
||||
queryDataParam.setPageInfo(new PageInfo(1,10));
|
||||
List<FluxTable> query = InfluxClient.Client.query(queryDataParam);
|
||||
List<List<FluxTable>> lists = DataUtils.fixedGroup(query, sampleSize);
|
||||
|
||||
|
||||
for (FluxTable fluxTable : query) {
|
||||
List<FluxRecord> records = fluxTable.getRecords();
|
||||
for (FluxRecord fluxRecord : records) {
|
||||
System.out.println("value: " + fluxRecord.getValueByKey("_value"));
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user