|
@@ -67,17 +67,32 @@ public class MainUI {
|
|
|
private JTable listAtmp;
|
|
|
private JTable listFrcs;
|
|
|
private JButton btnRequest;
|
|
|
+ private boolean isUpdatable;
|
|
|
+ private boolean isUpdateAtmp;
|
|
|
+ private boolean isUpdateFrcs;
|
|
|
|
|
|
public static MainUI getInstance() {
|
|
|
return _instance;
|
|
|
}
|
|
|
|
|
|
public void displaySystime() {
|
|
|
- lblSystime.setText(" " + SysUtils.getSysTimeStr() + " ");
|
|
|
+ String sysTime = SysUtils.getSysTimeStr();
|
|
|
+ lblSystime.setText(" " + sysTime + " ");
|
|
|
+ updateCommSttsTotal(sysTime);
|
|
|
+ }
|
|
|
+
|
|
|
+ private void updateCommSttsTotal(String sysTime) {
|
|
|
+ if (this.isUpdatable) {
|
|
|
+ if (this.isUpdateAtmp) {
|
|
|
+ updateAtmpPltnStts(sysTime);
|
|
|
+ }
|
|
|
+ if (this.isUpdateFrcs) {
|
|
|
+ updateFrcsPltnStts(sysTime);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public void displayResource() {
|
|
|
- //OperatingSystemMXBean osBean = (OperatingSystemMXBean)ManagementFactory.getOperatingSystemMXBean();
|
|
|
long memoryUsage = Math.round(((double) (osBean.getTotalPhysicalMemorySize() - osBean.getFreePhysicalMemorySize())) / (double) osBean.getTotalPhysicalMemorySize() * 100.0);
|
|
|
lblMemoryUsage.setText(String.valueOf(memoryUsage));
|
|
|
double cpuLoad = osBean.getSystemCpuLoad();
|
|
@@ -86,18 +101,14 @@ public class MainUI {
|
|
|
} else {
|
|
|
lblCpuRate.setText("---");
|
|
|
}
|
|
|
-// if (osBean instanceof com.sun.management.OperatingSystemMXBean) {
|
|
|
-// com.sun.management.OperatingSystemMXBean nativeOsBean = (com.sun.management.OperatingSystemMXBean)osBean;
|
|
|
-// log.error("CPU LOAD: {}", Math.ceil(nativeOsBean.getSystemCpuLoad() * 100.0));
|
|
|
-// }
|
|
|
-// else {
|
|
|
-// log.error("You're not using Oracle Java nor using the native library. You won't be able to read some native data");
|
|
|
-// }
|
|
|
}
|
|
|
|
|
|
public MainUI(JFrame jFrame) {
|
|
|
System.setProperty("awt.useSystemAAFontSettings", "false"); // AntiAliasing false
|
|
|
|
|
|
+ this.isUpdatable = false;
|
|
|
+ this.isUpdateAtmp = false;
|
|
|
+ this.isUpdateFrcs = false;
|
|
|
this.jFrame = jFrame;
|
|
|
if (_instance == null) {
|
|
|
_instance = this;
|
|
@@ -280,7 +291,7 @@ public class MainUI {
|
|
|
for (int ii = 0; ii < getColumnModel_.getColumnCount(); ii++) {
|
|
|
getColumnModel_.getColumn(ii).setCellRenderer(frcsCellRenderer);
|
|
|
}
|
|
|
-
|
|
|
+ this.isUpdatable = true;
|
|
|
}
|
|
|
|
|
|
public void LoadControllerInfo() {
|
|
@@ -302,7 +313,12 @@ public class MainUI {
|
|
|
initTblListUI(atmpList, frcsList);
|
|
|
}
|
|
|
|
|
|
- public void updateAtmpPltnStts(String sysTime) {
|
|
|
+ public boolean updateAtmpPltnStts(String sysTime) {
|
|
|
+ if (!this.isUpdatable) {
|
|
|
+ this.isUpdateAtmp = true;
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ this.isUpdateAtmp = false;
|
|
|
tabInfo.setTitleAt(0, "대기환경 - [" + sysTime + "]");
|
|
|
|
|
|
try {
|
|
@@ -314,9 +330,15 @@ public class MainUI {
|
|
|
log.error("Cast Atmp Error");
|
|
|
}
|
|
|
tabAtmp.repaint();
|
|
|
+ return true;
|
|
|
}
|
|
|
|
|
|
- public void updateFrcsPltnStts(String sysTime) {
|
|
|
+ public boolean updateFrcsPltnStts(String sysTime) {
|
|
|
+ if (!this.isUpdatable) {
|
|
|
+ this.isUpdateFrcs = true;
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ this.isUpdateFrcs = false;
|
|
|
tabInfo.setTitleAt(1, "동네예보 - [" + sysTime + "]");
|
|
|
|
|
|
try {
|
|
@@ -328,23 +350,7 @@ public class MainUI {
|
|
|
log.error("Cast Frcs Error");
|
|
|
}
|
|
|
tabFrcs.repaint();
|
|
|
- }
|
|
|
-
|
|
|
- public void updateCtlrStts(AtmpPltnVo obj) {
|
|
|
- if (this.atmpTableModel == null) {
|
|
|
- return;
|
|
|
- }
|
|
|
- for (int ii = 0; ii < this.atmpTableModel.getRowCount(); ii++) {
|
|
|
-// if (obj.getPIS_NMBR().equals(ctlrSttsTableModel.getValueAt(ii, 1).toString())) {
|
|
|
-// int modelRow = tblCtlrList.convertRowIndexToModel(ii);
|
|
|
-// this.ctlrSttsTableModel.setValue(obj, ii, modelRow);
|
|
|
-// break;
|
|
|
-// }
|
|
|
- }
|
|
|
- AtmpTableModel tableModel = (AtmpTableModel) listAtmp.getModel();
|
|
|
- if (tableModel != null) {
|
|
|
- tableModel.fireTableDataChanged();
|
|
|
- }
|
|
|
+ return true;
|
|
|
}
|
|
|
|
|
|
{
|