|
@@ -23,6 +23,8 @@ public class TemperatureInfo implements Serializable {
|
|
|
private List<TemperatureComponentInfo> temperatureComponentInfos;
|
|
|
private int windturbineIndex;
|
|
|
|
|
|
+ private final List<String> order = Arrays.asList("风机信息", "主轴", "发电机", "齿轮箱", "变桨", "液压", "其他");
|
|
|
+
|
|
|
/**
|
|
|
* 是否排序
|
|
|
*/
|
|
@@ -144,9 +146,52 @@ public class TemperatureInfo implements Serializable {
|
|
|
temperatureComponentInfos.add(ntci);
|
|
|
}
|
|
|
tcim.get(ti.getComponent()).addTemperaturePoint(ti);
|
|
|
- isSorted = false;
|
|
|
+ isSorted = true;
|
|
|
}
|
|
|
|
|
|
+// Comparator<TemperatureComponentInfo> comparator = new Comparator<TemperatureComponentInfo>() {
|
|
|
+// @Override
|
|
|
+// public int compare(TemperatureComponentInfo t1, TemperatureComponentInfo t2) {
|
|
|
+// String name1 = t1.getName();
|
|
|
+// String name2 = t2.getName();
|
|
|
+//
|
|
|
+// int index1 = order.indexOf(name1);
|
|
|
+// int index2 = order.indexOf(name2);
|
|
|
+//
|
|
|
+// if (index1 == -1) {
|
|
|
+// return index2 == -1 ? 0 : 1;
|
|
|
+// } else if (index2 == -1) {
|
|
|
+// return -1;
|
|
|
+// } else {
|
|
|
+// return Integer.compare(index1, index2);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// };
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+// Comparator<Map<String, TemperatureComponentInfo>> comparator = new Comparator<Map<String, TemperatureComponentInfo>>() {
|
|
|
+// @Override
|
|
|
+// public int compare(Map<String, TemperatureComponentInfo> o1, Map<String, TemperatureComponentInfo> o2) {
|
|
|
+// String name1 = (String) o1.get("name");
|
|
|
+// Set<String> strings = o1.keySet();
|
|
|
+// String name2 = (String) o2.get("name");
|
|
|
+//
|
|
|
+// int index1 = order.indexOf(name1);
|
|
|
+// int index2 = order.indexOf(name2);
|
|
|
+//
|
|
|
+// // 如果某个名称不在顺序列表中,则将其放在最后
|
|
|
+// if (index1 == -1) {
|
|
|
+// return index2 == -1 ? 0 : 1;
|
|
|
+// } else if (index2 == -1) {
|
|
|
+// return -1;
|
|
|
+// } else {
|
|
|
+// return Integer.compare(index1, index2);
|
|
|
+// }
|
|
|
+// }
|
|
|
+// };
|
|
|
+
|
|
|
public List<TemperatureComponentInfo> getTemperatureComponentInfos() {
|
|
|
if (temperatureComponentInfos == null) {
|
|
|
temperatureComponentInfos = new ArrayList<>();
|