Commit 65fd969b 65fd969b722b2e2deaa810c913122e97ffb92494 by root

save

1 parent c7078924
...@@ -65,7 +65,7 @@ public class JPnlCurrent extends RoundedPanel3 { ...@@ -65,7 +65,7 @@ public class JPnlCurrent extends RoundedPanel3 {
65 private JPanel panel = new JPanel(); 65 private JPanel panel = new JPanel();
66 66
67 private int start = 0; 67 private int start = 0;
68 private int end = 6; 68 private int end = 9;
69 69
70 private List<MdlEvent> lstevent; 70 private List<MdlEvent> lstevent;
71 71
...@@ -117,13 +117,13 @@ public class JPnlCurrent extends RoundedPanel3 { ...@@ -117,13 +117,13 @@ public class JPnlCurrent extends RoundedPanel3 {
117 117
118 private void Up() throws Exception { 118 private void Up() throws Exception {
119 119
120 if (start - 6 <= 0) { 120 if (start - 9 <= 0) {
121 start = 0; 121 start = 0;
122 end = 6; 122 end = 9;
123 btnUp.setEnabled(false); 123 btnUp.setEnabled(false);
124 } else { 124 } else {
125 end = start; 125 end = start;
126 start = start - 6; 126 start = start - 9;
127 } 127 }
128 128
129 Update(); 129 Update();
...@@ -131,7 +131,7 @@ public class JPnlCurrent extends RoundedPanel3 { ...@@ -131,7 +131,7 @@ public class JPnlCurrent extends RoundedPanel3 {
131 131
132 private void Down() throws Exception { 132 private void Down() throws Exception {
133 133
134 if (end + 6 > lstevent.size()) { 134 if (end + 9 > lstevent.size()) {
135 start = end; 135 start = end;
136 end = lstevent.size(); 136 end = lstevent.size();
137 btnDown.setEnabled(false); 137 btnDown.setEnabled(false);
...@@ -139,7 +139,7 @@ public class JPnlCurrent extends RoundedPanel3 { ...@@ -139,7 +139,7 @@ public class JPnlCurrent extends RoundedPanel3 {
139 } else { 139 } else {
140 140
141 start = end; 141 start = end;
142 end += 6; 142 end += 9;
143 } 143 }
144 Update(); 144 Update();
145 } 145 }
...@@ -150,7 +150,7 @@ public class JPnlCurrent extends RoundedPanel3 { ...@@ -150,7 +150,7 @@ public class JPnlCurrent extends RoundedPanel3 {
150 this.setBackground(new Color(168, 181, 224)); 150 this.setBackground(new Color(168, 181, 224));
151 this.setLayout(null); 151 this.setLayout(null);
152 152
153 panel.setBounds(5, 5, 740, 300); 153 panel.setBounds(5, 5, 740, 370);
154 panel.setLayout(null); 154 panel.setLayout(null);
155 panel.setBackground(new Color(168, 181, 224)); 155 panel.setBackground(new Color(168, 181, 224));
156 156
...@@ -160,7 +160,7 @@ public class JPnlCurrent extends RoundedPanel3 { ...@@ -160,7 +160,7 @@ public class JPnlCurrent extends RoundedPanel3 {
160 160
161 ImageIcon imgUp = new ImageIcon(this.getClass().getResource("/top.png")); 161 ImageIcon imgUp = new ImageIcon(this.getClass().getResource("/top.png"));
162 btnUp.setIcon(imgUp); 162 btnUp.setIcon(imgUp);
163 btnUp.setBounds(5, 320, 370, 70); 163 btnUp.setBounds(5, 380, 370, 70);
164 btnUp.addActionListener(new ActionListener() { 164 btnUp.addActionListener(new ActionListener() {
165 public void actionPerformed(ActionEvent arg0) { 165 public void actionPerformed(ActionEvent arg0) {
166 SwingUtilities.invokeLater(new Runnable() { 166 SwingUtilities.invokeLater(new Runnable() {
...@@ -181,7 +181,7 @@ public class JPnlCurrent extends RoundedPanel3 { ...@@ -181,7 +181,7 @@ public class JPnlCurrent extends RoundedPanel3 {
181 181
182 ImageIcon imgDown = new ImageIcon(this.getClass().getResource("/bottom.png")); 182 ImageIcon imgDown = new ImageIcon(this.getClass().getResource("/bottom.png"));
183 btnDown.setIcon(imgDown); 183 btnDown.setIcon(imgDown);
184 btnDown.setBounds(385, 320, 370, 70); 184 btnDown.setBounds(385, 380, 370, 70);
185 btnDown.addActionListener(new ActionListener() { 185 btnDown.addActionListener(new ActionListener() {
186 public void actionPerformed(ActionEvent arg0) { 186 public void actionPerformed(ActionEvent arg0) {
187 187
......
...@@ -130,7 +130,7 @@ public class JPnlLog extends RoundedPanel3 { ...@@ -130,7 +130,7 @@ public class JPnlLog extends RoundedPanel3 {
130 this.setBackground(new Color(168, 181, 224)); 130 this.setBackground(new Color(168, 181, 224));
131 this.setLayout(null); 131 this.setLayout(null);
132 132
133 table.setBounds(5, 5, 760, 300); 133 table.setBounds(5, 5, 760, 370);
134 table.setDefaultRenderer(MdlEvent.class, new EventCellRenderer()); 134 table.setDefaultRenderer(MdlEvent.class, new EventCellRenderer());
135 table.setRowHeight(40); 135 table.setRowHeight(40);
136 table.setBackground(new Color(168, 181, 224)); 136 table.setBackground(new Color(168, 181, 224));
...@@ -141,7 +141,7 @@ public class JPnlLog extends RoundedPanel3 { ...@@ -141,7 +141,7 @@ public class JPnlLog extends RoundedPanel3 {
141 141
142 btnUp.setIcon(imgUp); 142 btnUp.setIcon(imgUp);
143 143
144 btnUp.setBounds(5, 320, 370, 70); 144 btnUp.setBounds(5, 380, 370, 70);
145 145
146 btnUp.addActionListener(new ActionListener() { 146 btnUp.addActionListener(new ActionListener() {
147 public void actionPerformed(ActionEvent arg0) { 147 public void actionPerformed(ActionEvent arg0) {
...@@ -158,7 +158,7 @@ public class JPnlLog extends RoundedPanel3 { ...@@ -158,7 +158,7 @@ public class JPnlLog extends RoundedPanel3 {
158 158
159 ImageIcon imgDown = new ImageIcon(getClass().getResource("/bottom.png")); 159 ImageIcon imgDown = new ImageIcon(getClass().getResource("/bottom.png"));
160 btnDown.setIcon(imgDown); 160 btnDown.setIcon(imgDown);
161 btnDown.setBounds(385, 320, 370, 70); 161 btnDown.setBounds(385, 380, 370, 70);
162 btnDown.addActionListener(new ActionListener() { 162 btnDown.addActionListener(new ActionListener() {
163 public void actionPerformed(ActionEvent arg0) { 163 public void actionPerformed(ActionEvent arg0) {
164 164
......
...@@ -3,9 +3,7 @@ package org.emercit.szs.model; ...@@ -3,9 +3,7 @@ package org.emercit.szs.model;
3 import java.text.SimpleDateFormat; 3 import java.text.SimpleDateFormat;
4 import java.util.Calendar; 4 import java.util.Calendar;
5 import java.util.Date; 5 import java.util.Date;
6
7 import javax.swing.ImageIcon; 6 import javax.swing.ImageIcon;
8
9 import java.awt.Color; 7 import java.awt.Color;
10 import java.awt.Image; 8 import java.awt.Image;
11 9
...@@ -57,41 +55,8 @@ public class MdlEvent { ...@@ -57,41 +55,8 @@ public class MdlEvent {
57 private int countsecsound = 0; 55 private int countsecsound = 0;
58 private boolean sound = false; // false -no sound 56 private boolean sound = false; // false -no sound
59 private boolean siren = false; // false- no siren 57 private boolean siren = false; // false- no siren
60
61
62 /*
63 * Текущее состояние
64 */
65 public MdlEvent(int id_agk, String name, int id_status) {
66 this.setIdAgk(id_agk);
67 this.setRiver(name);
68 this.setIdStatus(id_status);
69 }
70
71
72 /*
73 * Событие для подтверждения
74 */
75
76
77
78 public MdlEvent(int id,String name,
79 int id_agk,
80 String datetime,
81 int id_status,
82 String message) {
83
84 this.setId(id);
85 this.setIdAgk(id_agk);
86 this.setRiver(name);
87 this.setDateTime(datetime);
88 this.setIdStatus(id_status);
89
90
91 }
92
93 58
94 public MdlEvent(int id, int id_agk, String river, String datetime, 59 public MdlEvent(long id, int id_agk, String river, String datetime,
95 String value, int id_status, boolean repair, boolean opendoor, 60 String value, int id_status, boolean repair, boolean opendoor,
96 boolean veracity) { 61 boolean veracity) {
97 62
...@@ -301,7 +266,8 @@ public class MdlEvent { ...@@ -301,7 +266,8 @@ public class MdlEvent {
301 } 266 }
302 267
303 public String getTitleStatusForConfirm() { 268 public String getTitleStatusForConfirm() {
304 return this.titlestatusconfirm; 269 return "БСВ:" + String.valueOf(this.value) + " м. "
270 + this.titlestatusconfirm;
305 } 271 }
306 272
307 public String getStrImgStatus() { 273 public String getStrImgStatus() {
......
...@@ -5,9 +5,16 @@ import java.util.ArrayList; ...@@ -5,9 +5,16 @@ import java.util.ArrayList;
5 5
6 public class ModelResponse { 6 public class ModelResponse {
7 7
8 public String titlesubscriber;
9
10 public String titlecontact;
11
12 public boolean siren;
13
14 public boolean updateguid;
8 15
9 public List<EventAgk> lsteventagkconfirm; 16 public List<EventAgk> lsteventagkconfirm;
10 17
11 public List<EventAgk> lsteventagkstate; 18 public List<EventAgk> lsteventagkstate;
12 19
13 } 20 }
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -2,7 +2,7 @@ package org.emercit.szs.model; ...@@ -2,7 +2,7 @@ package org.emercit.szs.model;
2 2
3 public class SirenJNI { 3 public class SirenJNI {
4 static { 4 static {
5 System.loadLibrary("siren"); 5 // System.loadLibrary("siren");
6 6
7 } 7 }
8 8
......
...@@ -110,8 +110,6 @@ public class SZSTerminal { ...@@ -110,8 +110,6 @@ public class SZSTerminal {
110 // @Override 110 // @Override
111 public void run() { 111 public void run() {
112 112
113
114
115 Calendar calendar = Calendar.getInstance(); 113 Calendar calendar = Calendar.getInstance();
116 114
117 TimeZone.setDefault(TimeZone.getTimeZone("Europe/Moscow")); 115 TimeZone.setDefault(TimeZone.getTimeZone("Europe/Moscow"));
...@@ -124,6 +122,9 @@ public class SZSTerminal { ...@@ -124,6 +122,9 @@ public class SZSTerminal {
124 122
125 if (SData.INSTANCE.isConnect()){ 123 if (SData.INSTANCE.isConnect()){
126 124
125 //jpnlheader.setTitleSubscriver(SData.INSTANCE.getData().titlesubscriber);
126
127 jpnlcontacts.setTitleContact(SData.INSTANCE.getData().titlecontact);
127 128
128 /* 129 /*
129 * Текущее состояние датчиков 130 * Текущее состояние датчиков
...@@ -184,7 +185,7 @@ public class SZSTerminal { ...@@ -184,7 +185,7 @@ public class SZSTerminal {
184 eventagk.id_status, eventagk.repair, eventagk.opendoor, 185 eventagk.id_status, eventagk.repair, eventagk.opendoor,
185 eventagk.veracity); 186 eventagk.veracity);
186 187
187 ev.setSiren(mdl.siren); 188 ev.setSiren(mdl.siren);
188 189
189 190
190 dlgconfirm.setEvent(ev); 191 dlgconfirm.setEvent(ev);
...@@ -212,25 +213,13 @@ public class SZSTerminal { ...@@ -212,25 +213,13 @@ public class SZSTerminal {
212 213
213 214
214 215
215
216 PropertyConfigurator.configure("log4j.properties");
217
218
219
220
221
222
223 EventQueue.invokeLater(new Runnable() { 216 EventQueue.invokeLater(new Runnable() {
224 public void run() { 217 public void run() {
225 try { 218 try {
226 // siren.sirenOff(); 219 // siren.sirenOff();
227 220 } catch (Exception e) {
228 } catch (Exception e) {
229 221
230 } 222 }
231
232
233
234 mainFrame = new JFrame(); 223 mainFrame = new JFrame();
235 mainFrame.setSize(800, 600); 224 mainFrame.setSize(800, 600);
236 mainFrame.setUndecorated(false); 225 mainFrame.setUndecorated(false);
......