添加获取QCFlagParam参数
This commit is contained in:
parent
36edd72930
commit
03eaf574e0
|
@ -1,11 +1,22 @@
|
|||
package org.jeecg.modules.entity.vo;
|
||||
|
||||
import lombok.Data;
|
||||
import org.jeecg.common.properties.ParameterProperties;
|
||||
import org.jeecg.modules.base.enums.StationDetailType;
|
||||
import org.jeecg.modules.entity.vo.QCFlagParmData.QCFlagParam;
|
||||
import org.jeecg.modules.entity.vo.QCFlagParmData.Rule;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.xml.bind.JAXBContext;
|
||||
import javax.xml.bind.Unmarshaller;
|
||||
import java.io.File;
|
||||
import java.io.Serializable;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
import static org.jeecg.modules.base.enums.StationDetailType.*;
|
||||
|
||||
@Data
|
||||
public class Sections implements Serializable {
|
||||
|
||||
|
@ -17,7 +28,17 @@ public class Sections implements Serializable {
|
|||
|
||||
private List<Double> airVolumeSections;
|
||||
|
||||
public Sections(){
|
||||
//region QC-Flag参数
|
||||
private List<Rule> collectionTimeRules;
|
||||
|
||||
private List<Rule> acquisitionTimeRules;
|
||||
|
||||
private List<Rule> xeVolumeRules;
|
||||
|
||||
private List<Rule> airVolumeRules;
|
||||
|
||||
//endregion
|
||||
public Sections() {
|
||||
collectionTimeSections = new LinkedList<>();
|
||||
collectionTimeSections.add(0.0);
|
||||
collectionTimeSections.add(6.0);
|
||||
|
@ -43,4 +64,34 @@ public class Sections implements Serializable {
|
|||
airVolumeSections.add(10.0);
|
||||
}
|
||||
|
||||
|
||||
public Sections(StationDetailType sectionsType,String pathname) {
|
||||
try {
|
||||
// 创建JAXB上下文
|
||||
JAXBContext context = JAXBContext.newInstance(QCFlagParam.class);
|
||||
// 创建Unmarshaller
|
||||
Unmarshaller unmarshaller = context.createUnmarshaller();
|
||||
|
||||
File file = new File(pathname);
|
||||
QCFlagParam config = (QCFlagParam) unmarshaller.unmarshal(file);
|
||||
switch (sectionsType) {
|
||||
case SAUNA:
|
||||
collectionTimeRules = config.sauna.getCollectionTime().getRules();
|
||||
acquisitionTimeRules = config.sauna.getAcquisitionTime().getRules();
|
||||
xeVolumeRules = config.sauna.getXeVolume().getRules();
|
||||
airVolumeRules = config.sauna.getAirVolume().getRules();
|
||||
break;
|
||||
case SAUNA2:
|
||||
collectionTimeRules = config.sauna2.getCollectionTime().getRules();
|
||||
acquisitionTimeRules = config.sauna2.getAcquisitionTime().getRules();
|
||||
xeVolumeRules = config.sauna2.getXeVolume().getRules();
|
||||
airVolumeRules = config.sauna2.getAirVolume().getRules();
|
||||
break;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user