Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Дмитрий Корытько
/
hware
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
Commit
c7078924
...
c70789245d58c65ec28db5d75ed15a584dd39f41
authored
2015-08-13 11:05:23 +0300
by
root
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
save
1 parent
3f2ed6a9
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
161 additions
and
360 deletions
SzsBb/src/main/java/org/emercit/szs/model/EventAgk.java
SzsBb/src/main/java/org/emercit/szs/model/EventCellRenderer.java
SzsBb/src/main/java/org/emercit/szs/model/SirenJNI.java
SzsBb/src/main/java/org/emercit/szs/model/WebPost.java
SzsBb/src/main/java/org/emercit/szs/service/Gprs.java
SzsBb/src/main/java/org/emercit/szs/service/SData.java
SzsBb/src/main/java/org/emercit/szs/szsterminal/SZSTerminal.java
SzsBb/src/main/java/org/emercit/szs/model/EventAgk.java
View file @
c707892
...
...
@@ -2,11 +2,17 @@ package org.emercit.szs.model;
public
class
EventAgk
{
public
int
id
;
public
long
id
;
public
int
id_agk
;
public
String
name
;
public
String
message
;
public
String
river
;
public
String
datetime
;
public
String
value
;
public
int
id_status
;
// 0-norm, 1-nj-2, oj;
public
boolean
repair
;
// true -repair; false- no repair
public
boolean
opendoor
;
// true - open; false-close
public
boolean
veracity
;
// veracity -true, no veracity -false;
}
...
...
SzsBb/src/main/java/org/emercit/szs/model/EventCellRenderer.java
View file @
c707892
package
org
.
emercit
.
szs
.
model
;
import
java.awt.Color
;
import
java.awt.Component
;
import
java.awt.Font
;
...
...
SzsBb/src/main/java/org/emercit/szs/model/SirenJNI.java
0 → 100644
View file @
c707892
package
org
.
emercit
.
szs
.
model
;
public
class
SirenJNI
{
static
{
System
.
loadLibrary
(
"siren"
);
}
public
native
void
sirenOn
();
public
native
void
sirenOff
();
}
\ No newline at end of file
SzsBb/src/main/java/org/emercit/szs/model/WebPost.java
View file @
c707892
...
...
@@ -3,54 +3,17 @@ package org.emercit.szs.model;
import
java.io.*
;
import
java.net.*
;
import
java.io.BufferedOutputStream
;
import
java.io.BufferedReader
;
import
java.io.File
;
import
java.io.IOException
;
import
java.io.InputStreamReader
;
import
java.io.OutputStream
;
import
java.io.OutputStreamWriter
;
import
java.net.HttpURLConnection
;
import
java.net.InetSocketAddress
;
import
java.net.Proxy
;
import
java.net.URL
;
import
java.net.URLEncoder
;
import
java.util.Map
;
import
java.util.Map
;
import
org.json.simple.*
;
import
java.io.IOException
;
import
java.io.StringReader
;
import
javax.xml.parsers.DocumentBuilder
;
import
javax.xml.parsers.DocumentBuilderFactory
;
import
javax.xml.parsers.ParserConfigurationException
;
import
org.w3c.dom.Document
;
import
org.w3c.dom.NodeList
;
import
org.xml.sax.InputSource
;
import
org.xml.sax.SAXException
;
import
com.google.gson.*
;
import
org.apache.log4j.Logger
;
import
org.w3c.dom.Node
;
import
org.w3c.dom.NodeList
;
import
org.w3c.dom.Element
;
import
java.util.ArrayList
;
import
org.emercit.szs.model.Config
;
import
org.emercit.szs.service.Gprs
;
import
org.emercit.szs.service.SData
;
import
org.emercit.szs.model.MsgSzs
;
import
org.emercit.szs.szsterminal.SZSTerminal
;
public
class
WebPost
{
private
static
final
Logger
log
=
Logger
.
getLogger
(
WebPost
.
class
);
private
String
ip
;
...
...
@@ -59,8 +22,7 @@ public class WebPost {
private
String
gsm
;
private
Gprs
gprs
;
private
String
version
;
public
WebPost
()
{
...
...
@@ -68,7 +30,7 @@ public class WebPost {
this
.
guid
=
Config
.
devinfobean
.
getGuid
();
this
.
ip
=
Config
.
serverbean
.
getIp
()+
":"
+
Config
.
serverbean
.
getPort
();
this
.
gsm
=
Config
.
gsmbean
.
getOperator
();
this
.
gprs
=
new
Gprs
(
this
.
gsm
)
;
this
.
version
=
SZSTerminal
.
version
;
print
();
}
...
...
@@ -80,118 +42,73 @@ public class WebPost {
}
public
ModelResponse
Request
()
{
ModelResponse
md
=
new
ModelResponse
();
md
.
lsteventagkconfirm
=
new
ArrayList
<
EventAgk
>();
md
.
lsteventagkstate
=
new
ArrayList
<
EventAgk
>();
ModelResponse
md
=
null
;
StringBuilder
sb
=
new
StringBuilder
();
HttpURLConnection
urlConnection
=
null
;
BufferedReader
br
=
null
;
try
{
URL
url
=
new
URL
(
"http://"
+
this
.
ip
+
"/api/DataSzs/"
);
urlConnection
=
(
HttpURLConnection
)
url
.
openConnection
();
urlConnection
.
setDoOutput
(
true
);
urlConnection
.
setRequestMethod
(
"POST"
);
urlConnection
.
setRequestProperty
(
"Content-Type"
,
"application/json"
);
URL
url
=
new
URL
(
"http://"
+
ip
+
"/api/lss_info.php"
+
"?guid="
+
guid
);
urlConnection
.
setConnectTimeout
(
5000
);
urlConnection
.
setReadTimeout
(
10000
);
urlConnection
=
(
HttpURLConnection
)
url
.
openConnection
();
JSONObject
jsonParam
=
new
JSONObject
();
urlConnection
.
setDoOutput
(
true
);
urlConnection
.
setRequestMethod
(
"GET"
);
urlConnection
.
setRequestProperty
(
"Content-Type"
,
"application/xml
"
);
jsonParam
.
put
(
"RegKey"
,
this
.
guid
);
jsonParam
.
put
(
"SoftVersion"
,
this
.
version
);
jsonParam
.
put
(
"IDTeamViewer"
,
"
"
);
urlConnection
.
setConnectTimeout
(
45000
);
urlConnection
.
setReadTimeout
(
60000
);
OutputStreamWriter
out
=
new
OutputStreamWriter
(
urlConnection
.
getOutputStream
());
out
.
write
(
jsonParam
.
toString
());
out
.
close
();
urlConnection
.
connect
();
int
HttpResult
=
urlConnection
.
getResponseCode
();
if
(
HttpResult
==
HttpURLConnection
.
HTTP_OK
)
{
br
=
new
BufferedReader
(
new
InputStreamReader
(
urlConnection
.
getInputStream
(),
"utf-8"
));
String
line
=
null
;
InputStream
xml
=
urlConnection
.
getInputStream
();
DocumentBuilderFactory
dbf
=
DocumentBuilderFactory
.
newInstance
();
DocumentBuilder
db
=
dbf
.
newDocumentBuilder
();
Document
doc
=
db
.
parse
(
xml
);
SData
.
INSTANCE
.
setIsConnect
(
true
);
/*
* Неподтвержденные события
*/
NodeList
list
=
doc
.
getElementsByTagName
(
"alarmList"
);
Element
element
=
(
Element
)
list
.
item
(
0
);
NodeList
nl
=
element
.
getElementsByTagName
(
"alarm"
);
if
(
nl
!=
null
&&
nl
.
getLength
()
>
0
)
{
for
(
int
i
=
0
;
i
<
nl
.
getLength
();
i
++)
{
Element
el
=
(
Element
)
nl
.
item
(
i
);
try
{
EventAgk
event
=
new
EventAgk
();
event
.
id
=
Integer
.
valueOf
(
getTextValue
(
el
,
"id"
));
event
.
name
=
getTextValue
(
el
,
"name"
);
event
.
id_agk
=
Integer
.
valueOf
(
getTextValue
(
el
,
"guid"
));
event
.
datetime
=
getTextValue
(
el
,
"datetime"
);
event
.
id_status
=
Integer
.
valueOf
(
getTextValue
(
el
,
"status"
));
event
.
message
=
getTextValue
(
el
,
"message"
);
md
.
lsteventagkconfirm
.
add
(
event
);
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
());
}
}
while
((
line
=
br
.
readLine
())
!=
null
)
{
sb
.
append
(
line
+
"\n"
);
}
/*
* Текущее состояние станций
*/
list
=
doc
.
getElementsByTagName
(
"deviceList"
);
element
=
(
Element
)
list
.
item
(
0
);
nl
=
element
.
getElementsByTagName
(
"device"
);
if
(
nl
!=
null
&&
nl
.
getLength
()
>
0
)
{
for
(
int
i
=
0
;
i
<
nl
.
getLength
();
i
++)
{
br
.
close
();
Element
el
=
(
Element
)
nl
.
item
(
i
);
try
{
EventAgk
event
=
new
EventAgk
();
Gson
gson
=
new
Gson
();
event
.
name
=
getTextValue
(
el
,
"name"
);
event
.
id_agk
=
Integer
.
valueOf
(
getTextValue
(
el
,
"guid"
));
event
.
id_status
=
Integer
.
valueOf
(
getTextValue
(
el
,
"alarm"
));
md
=
gson
.
fromJson
(
sb
.
toString
(),
ModelResponse
.
class
);
md
.
lsteventagkstate
.
add
(
event
);
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
());
}
}
}
}
br
.
close
();
urlConnection
.
disconnect
();
SData
.
INSTANCE
.
setIsConnect
(
true
);
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
());
log
.
error
(
MsgSzs
.
connectServerError
);
gprs
.
Reconnect
(
);
SData
.
INSTANCE
.
setIsConnect
(
false
);
}
finally
{
...
...
@@ -205,65 +122,51 @@ public class WebPost {
}
}
catch
(
Exception
ex
)
{
log
.
error
(
ex
.
getMessage
());
log
.
error
(
MsgSzs
.
connectServerError
);
gprs
.
Reconnect
();
SData
.
INSTANCE
.
setIsConnect
(
false
);
}
}
return
md
;
}
private
String
getTextValue
(
Element
ele
,
String
tagName
)
{
String
textVal
=
null
;
NodeList
nl
=
ele
.
getElementsByTagName
(
tagName
);
if
(
nl
!=
null
&&
nl
.
getLength
()
>
0
)
{
Element
el
=
(
Element
)
nl
.
item
(
0
);
textVal
=
el
.
getFirstChild
().
getNodeValue
();
}
return
textVal
;
}
public
void
Confirm
(
long
alarm
)
{
public
void
Confirm
(
MdlEvent
event
)
{
HttpURLConnection
urlConnection
=
null
;
try
{
URL
url
=
new
URL
(
"http://"
+
ip
+
"/api/lss_confirm.php"
+
"?guid="
+
guid
+
"&alarm="
+
alarm
);
urlConnection
=
(
HttpURLConnection
)
url
.
openConnection
();
URL
url
=
new
URL
(
"http://"
+
this
.
ip
+
"/api/ConfirmLevelsRivers/"
);
urlConnection
=
(
HttpURLConnection
)
url
.
openConnection
();
urlConnection
.
setDoOutput
(
true
);
urlConnection
.
setRequestMethod
(
"
GE
T"
);
urlConnection
.
setRequestMethod
(
"
POS
T"
);
urlConnection
.
setRequestProperty
(
"Content-Type"
,
"application/json"
);
urlConnection
.
setConnectTimeout
(
5000
);
urlConnection
.
setReadTimeout
(
10000
);
urlConnection
.
connect
();
// Create JSONObject here
JSONObject
jsonParam
=
new
JSONObject
();
jsonParam
.
put
(
"RegKey"
,
this
.
guid
);
jsonParam
.
put
(
"id_agk"
,
event
.
getIdAgk
());
jsonParam
.
put
(
"id_webapi_message"
,
event
.
getId
());
OutputStreamWriter
out
=
new
OutputStreamWriter
(
urlConnection
.
getOutputStream
());
out
.
write
(
jsonParam
.
toString
());
out
.
close
();
int
HttpResult
=
urlConnection
.
getResponseCode
();
...
...
@@ -271,6 +174,7 @@ public class WebPost {
}
urlConnection
.
disconnect
();
}
catch
(
Exception
e
)
{
...
...
@@ -282,7 +186,9 @@ public class WebPost {
if
(
urlConnection
!=
null
)
{
urlConnection
.
disconnect
();
}
}
catch
(
Exception
ex
)
{
log
.
error
(
ex
.
getMessage
());
log
.
error
(
MsgSzs
.
connectServerError
);
...
...
@@ -294,3 +200,11 @@ public class WebPost {
}
...
...
SzsBb/src/main/java/org/emercit/szs/service/Gprs.java
deleted
100644 → 0
View file @
3f2ed6a
package
org
.
emercit
.
szs
.
service
;
import
java.io.File
;
import
java.io.FileInputStream
;
import
java.io.FileNotFoundException
;
import
java.io.FileOutputStream
;
import
java.io.IOException
;
import
java.io.InputStream
;
import
java.io.ObjectInputStream
;
import
java.io.ObjectOutputStream
;
import
org.apache.log4j.Logger
;
import
com.jcraft.jsch.Channel
;
import
com.jcraft.jsch.ChannelExec
;
import
com.jcraft.jsch.JSch
;
import
com.jcraft.jsch.Session
;
import
org.emercit.szs.model.MsgSzs
;
import
java.io.*
;
public
class
Gprs
{
static
final
Logger
logger
=
Logger
.
getLogger
(
Gprs
.
class
);
private
static
final
int
BUFFER_SIZE
=
10000
;
private
String
host
=
"127.0.0.1"
;
private
String
user
=
"debian"
;
private
String
password
=
"temppwd"
;
private
String
operator
;
public
Gprs
(
String
operator
){
this
.
operator
=
operator
;
}
public
void
Reconnect
()
{
try
{
logger
.
info
(
MsgSzs
.
downPpp
);
OffLine
();
Thread
.
sleep
(
3000
);
logger
.
info
(
MsgSzs
.
offGsm
);
OffGsm
();
Thread
.
sleep
(
3000
);
logger
.
info
(
MsgSzs
.
onGms
);
PowerGsm
();
Thread
.
sleep
(
60000
);
logger
.
info
(
MsgSzs
.
upPpp
);
OnLine
();
Thread
.
sleep
(
30000
);
}
catch
(
Exception
e
)
{
logger
.
error
(
e
.
getMessage
());
}
}
/*
* Подключение к интернету
*/
private
void
OnLine
()
{
ExecCmd
(
"pon "
+
this
.
operator
);
}
/*
* Отключение от интернета
*/
private
void
OffLine
()
{
ExecCmd
(
"poff "
+
this
.
operator
);
}
/*
* Включение Gsm терминала
*/
private
void
PowerGsm
()
{
ExecCmd
(
"echo 1 > /dev/gsm-modem-ctl"
);
}
/*
* Выключение GSM
*/
private
void
OffGsm
()
{
ExecCmd
(
"echo 0 > /dev/gsm-modem-ctl"
);
}
private
void
ExcCmd
(
String
value
)
{
ExecCmd
(
value
);
}
private
void
ExecCmd
(
String
cmd
)
{
try
{
java
.
util
.
Properties
config
=
new
java
.
util
.
Properties
();
config
.
put
(
"StrictHostKeyChecking"
,
"no"
);
JSch
jsch
=
new
JSch
();
Session
session
=
jsch
.
getSession
(
user
,
host
,
22
);
session
.
setPassword
(
password
);
session
.
setConfig
(
config
);
session
.
connect
();
Channel
channel
=
session
.
openChannel
(
"exec"
);
((
ChannelExec
)
channel
).
setCommand
(
"sudo -S -p '' "
+
cmd
);
InputStream
in
=
channel
.
getInputStream
();
OutputStream
out
=
channel
.
getOutputStream
();
((
ChannelExec
)
channel
).
setErrStream
(
System
.
err
);
channel
.
connect
();
out
.
write
((
password
+
"\n"
).
getBytes
());
out
.
flush
();
byte
[]
tmp
=
new
byte
[
1024
];
while
(
true
){
while
(
in
.
available
()>
0
){
int
i
=
in
.
read
(
tmp
,
0
,
1024
);
if
(
i
<
0
)
break
;
System
.
out
.
print
(
new
String
(
tmp
,
0
,
i
));
}
if
(
channel
.
isClosed
()){
break
;
}
try
{
Thread
.
sleep
(
1000
);}
catch
(
Exception
ee
){}
}
channel
.
disconnect
();
session
.
disconnect
();
}
catch
(
Exception
e
){
logger
.
error
(
e
.
getMessage
());
}
}
}
SzsBb/src/main/java/org/emercit/szs/service/SData.java
View file @
c707892
...
...
@@ -45,14 +45,10 @@ public enum SData {
*/
public
void
Confirm
(
MdlEvent
mdlevent
)
{
webpost
.
Confirm
(
mdlevent
.
getId
());
webpost
.
Confirm
(
mdlevent
);
this
.
IsOpenDialog
=
false
;
}
/*
* Связь с сервисом
*/
...
...
SzsBb/src/main/java/org/emercit/szs/szsterminal/SZSTerminal.java
View file @
c707892
...
...
@@ -60,6 +60,9 @@ import java.net.InetSocketAddress;
import
java.net.Proxy
;
import
java.net.URL
;
import
java.util.Scanner
;
import
org.emercit.szs.components.*
;
import
java.awt.Dialog.ModalExclusionType
;
import
java.awt.*
;
import
java.awt.event.*
;
...
...
@@ -70,36 +73,33 @@ import com.google.gson.Gson;
import
java.beans.*
;
import
org.emercit.szs.components.*
;
import
org.emercit.szs.model.*
;
import
org.emercit.szs.service.*
;
import
org.emercit.utilstools.devinfo.service.DevInfo
;
import
org.apache.log4j.Logger
;
import
org.apache.log4j.BasicConfigurator
;
import
org.apache.log4j.PropertyConfigurator
;
import
org.emercit.szs.model.Config
;
public
class
SZSTerminal
{
private
static
final
Logger
log
=
Logger
.
getLogger
(
SZSTerminal
.
class
);
private
static
String
version
=
"1.0.0.0"
;
public
static
final
String
version
=
"1.0.0.0"
;
private
static
JFrame
mainFrame
;
private
static
JPanel
mainPanel
;
public
static
JPnlHeader
jpnlheader
;
public
static
JPnlCurrent
pnlcurrent
;
public
static
JPnlLog
jpnllog
;
public
static
JPnlContacts
jpnlcontacts
;
public
static
JPnlControl
jpnlcontrol
;
public
static
JPnlCurrent
pnlcurrent
=
new
JPnlCurrent
();
public
static
JPnlLog
jpnllog
=
new
JPnlLog
();
public
static
JPnlContacts
jpnlcontacts
=
new
JPnlContacts
();
public
static
JPnlControl
jpnlcontrol
=
new
JPnlControl
();
public
static
SirenJNI
siren
=
new
SirenJNI
();
private
static
Timer
ftdTimerMain
=
new
Timer
();
public
static
DlgConfirm
dlgconfirm
;
public
static
DlgConfirm
dlgconfirm
=
new
DlgConfirm
();
public
static
JPnlHeader
jpnlheader
=
new
JPnlHeader
();
private
static
class
ftdTimerTask
extends
TimerTask
{
...
...
@@ -110,6 +110,8 @@ public class SZSTerminal {
// @Override
public
void
run
()
{
Calendar
calendar
=
Calendar
.
getInstance
();
TimeZone
.
setDefault
(
TimeZone
.
getTimeZone
(
"Europe/Moscow"
));
...
...
@@ -119,8 +121,10 @@ public class SZSTerminal {
Date
date
=
calendar
.
getTime
();
jpnlheader
.
UpdateTime
(
new
SimpleDateFormat
(
"dd.MM.yyyy HH:mm:ss"
).
format
(
new
Date
()));
if
(
SData
.
INSTANCE
.
isConnect
()){
/*
* Текущее состояние датчиков
*/
...
...
@@ -132,21 +136,31 @@ public class SZSTerminal {
List
<
MdlEvent
>
lstEvent
=
new
ArrayList
<
MdlEvent
>();
ModelResponse
mdl
=
SData
.
INSTANCE
.
getData
();
if
(
mdl
.
lsteventagkstate
.
size
()!=
0
)
{
for
(
EventAgk
eventagk
:
mdl
.
lsteventagkstate
)
{
MdlEvent
ev
=
new
MdlEvent
(
eventagk
.
id
,
eventagk
.
id_agk
,
eventagk
.
river
,
eventagk
.
datetime
,
eventagk
.
value
,
eventagk
.
id_status
,
eventagk
.
repair
,
eventagk
.
opendoor
,
eventagk
.
veracity
);
for
(
EventAgk
event:
mdl
.
lsteventagkstate
)
{
MdlEvent
ev
=
new
MdlEvent
(
event
.
id_agk
,
event
.
name
,
event
.
id_status
);
lstEvent
.
add
(
ev
);
}
pnlcurrent
.
setListEventCurrent
(
lstEvent
);
}
return
null
;
}
}.
execute
();
/*
* События для подтверждения
*/
...
...
@@ -165,25 +179,24 @@ public class SZSTerminal {
SData
.
INSTANCE
.
RemoveEvent
();
MdlEvent
ev
=
new
MdlEvent
(
eventagk
.
id
,
eventagk
.
name
,
eventagk
.
id_agk
,
eventagk
.
datetime
,
eventagk
.
id_status
,
eventagk
.
message
);
MdlEvent
ev
=
new
MdlEvent
(
eventagk
.
id
,
eventagk
.
id_agk
,
eventagk
.
river
,
eventagk
.
datetime
,
eventagk
.
value
,
eventagk
.
id_status
,
eventagk
.
repair
,
eventagk
.
opendoor
,
eventagk
.
veracity
);
ev
.
setSiren
(
true
);
ev
.
setCountAnimate
(
15
);
ev
.
setCountSound
(
2
);
ev
.
setSiren
(
mdl
.
siren
);
dlgconfirm
.
setEvent
(
ev
);
dlgconfirm
.
setVisible
(
true
);
}
return
null
;
}
}.
execute
();
...
...
@@ -197,72 +210,81 @@ public class SZSTerminal {
public
static
void
main
(
String
[]
args
)
{
PropertyConfigurator
.
configure
(
"log4j.properties"
);
EventQueue
.
invokeLater
(
new
Runnable
()
{
public
void
run
()
{
try
{
// siren.sirenOff();
}
catch
(
Exception
e
)
{
}
mainFrame
=
new
JFrame
();
mainFrame
.
setSize
(
800
,
5
00
);
mainFrame
.
setUndecorated
(
tru
e
);
mainFrame
.
setSize
(
800
,
6
00
);
mainFrame
.
setUndecorated
(
fals
e
);
mainFrame
.
setResizable
(
false
);
mainFrame
.
setVisible
(
true
);
mainPanel
=
new
JPanel
();
Toolkit
tk
=
Toolkit
.
getDefaultToolkit
();
int
xSize
=
((
int
)
tk
.
getScreenSize
().
getWidth
());
int
ySize
=
((
int
)
tk
.
getScreenSize
().
getHeight
());
// mainFrame.setSize(xSize,ySize);
//mainFrame.setSize(xSize,ySize);
mainPanel
.
setBackground
(
UIManager
.
getColor
(
"Separator.foreground"
));
mainPanel
.
setBounds
(
0
,
0
,
xSize
,
ySize
);
mainPanel
.
setBackground
(
UIManager
.
getColor
(
"Separator.foreground"
));
mainPanel
.
setBounds
(
0
,
0
,
xSize
,
ySize
);
jpnlheader
.
setBounds
(
10
,
5
,
780
,
40
);
jpnlheader
=
new
JPnlHeader
();
jpnlheader
.
setBounds
(
10
,
10
,
770
,
50
);
jpnlheader
.
setBackground
(
new
Color
(
168
,
181
,
224
));
mainPanel
.
add
(
jpnlheader
);
// pnlcurrent.setBounds(10, 70, 770, 470);
List
<
Event
>
lstevent
=
new
ArrayList
<
Event
>();
JTabbedPane
jtp
=
new
JTabbedPane
();
jtp
.
setFont
(
new
Font
(
"Tahoma"
,
Font
.
PLAIN
,
14
));
mainPanel
.
add
(
jtp
);
jtp
.
setBounds
(
10
,
50
,
780
,
45
0
);
jtp
.
setBounds
(
10
,
70
,
780
,
52
0
);
ImageIcon
imgJournal
=
new
ImageIcon
(
getClass
().
getResource
(
"/journal.png"
));
ImageIcon
imgCurrent
=
new
ImageIcon
(
getClass
().
getResource
(
"/current.png"
));
//
ImageIcon imgContact = new ImageIcon(getClass().getResource(
//
"/contacts.png"));
//
ImageIcon imgControl = new ImageIcon(getClass().getResource(
//
"/update.png"));
ImageIcon
imgContact
=
new
ImageIcon
(
getClass
().
getResource
(
"/contacts.png"
));
ImageIcon
imgControl
=
new
ImageIcon
(
getClass
().
getResource
(
"/update.png"
));
pnlcurrent
=
new
JPnlCurrent
();
jtp
.
addTab
(
"Текущее состояние"
,
imgCurrent
,
pnlcurrent
);
jpnllog
=
new
JPnlLog
();
jtp
.
addTab
(
"Журнал"
,
imgJournal
,
jpnllog
);
jpnlcontrol
=
new
JPnlControl
();
jtp
.
addTab
(
"Управление"
,
null
,
jpnlcontrol
);
jtp
.
addTab
(
"Контакты"
,
imgContact
,
jpnlcontacts
);
jtp
.
addTab
(
"Управление"
,
imgControl
,
jpnlcontrol
);
mainFrame
.
setAlwaysOnTop
(
true
);
dlgconfirm
=
new
DlgConfirm
();
mainPanel
.
setBackground
(
UIManager
.
getColor
(
"Separator.foreground"
));
jpnlheader
.
SetBlue
();
mainPanel
.
setLayout
(
null
);
mainFrame
.
getContentPane
().
add
(
mainPanel
);
log
.
info
(
"Запуск приложения CtrlPnl."
+
" Версия:"
+
version
);
log
.
info
(
Config
.
devinfobean
.
getDescription
());
Runnable
rTScan
=
new
TScan
();
...
...
@@ -271,12 +293,6 @@ public class SZSTerminal {
ftdTimerMain
.
schedule
(
new
ftdTimerTask
(),
0
,
1000
);
EventTableModel
model
=
(
EventTableModel
)
SZSTerminal
.
jpnllog
.
table
.
getModel
();
SZSTerminal
.
jpnllog
.
Upd
();
}
});
}
...
...
Please
register
or
sign in
to post a comment