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
dea66014
...
dea66014f648bf743e90d9fff35ad7d0f3f265ec
authored
2015-08-13 18:29:46 +0300
by
root
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
save
1 parent
65fd969b
Show whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
83 additions
and
65 deletions
DevTools/repo/org/emercit/utilstools/1.51/utilstools-1.51.jar
DevTools/repo/org/emercit/utilstools/1.51/utilstools-1.51.jar.md5
DevTools/repo/org/emercit/utilstools/1.51/utilstools-1.51.jar.sha1
DevTools/repo/org/emercit/utilstools/1.51/utilstools-1.51.pom
DevTools/repo/org/emercit/utilstools/1.51/utilstools-1.51.pom.md5
DevTools/repo/org/emercit/utilstools/1.51/utilstools-1.51.pom.sha1
DevTools/repo/org/emercit/utilstools/maven-metadata.xml
DevTools/repo/org/emercit/utilstools/maven-metadata.xml.md5
DevTools/repo/org/emercit/utilstools/maven-metadata.xml.sha1
SzsBb/pom.xml
SzsBb/src/main/java/org/emercit/szs/components/DlgConfirm.java
SzsBb/src/main/java/org/emercit/szs/controldevtools/bean/CheckNotification.java
SzsBb/src/main/java/org/emercit/szs/controldevtools/bean/DevToolsBean.java
SzsBb/src/main/java/org/emercit/szs/controldevtools/bean/NotificationBB.java → SzsBb/src/main/java/org/emercit/szs/controldevtools/bean/Notification.java
SzsBb/src/main/java/org/emercit/szs/model/SirenJNI.java
SzsBb/src/main/java/org/emercit/szs/szsterminal/SZSTerminal.java
UtilsTools/src/main/java/org/emercit/utilstools/displaycalibrator/service/DCalibratorBB.java
DevTools/repo/org/emercit/utilstools/1.51/utilstools-1.51.jar
0 → 100644
View file @
dea6601
No preview for this file type
DevTools/repo/org/emercit/utilstools/1.51/utilstools-1.51.jar.md5
0 → 100644
View file @
dea6601
087fa2070e28be10c28c122711c04f39
\ No newline at end of file
DevTools/repo/org/emercit/utilstools/1.51/utilstools-1.51.jar.sha1
0 → 100644
View file @
dea6601
ce12addb2986cdd9ed6894c57828ee89a282e32e
\ No newline at end of file
DevTools/repo/org/emercit/utilstools/1.51/utilstools-1.51.pom
0 → 100644
View file @
dea6601
<?xml version="1.0" encoding="UTF-8"?>
<project
xsi:schemaLocation=
"http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
xmlns=
"http://maven.apache.org/POM/4.0.0"
xmlns:xsi=
"http://www.w3.org/2001/XMLSchema-instance"
>
<modelVersion>
4.0.0
</modelVersion>
<groupId>
org.emercit
</groupId>
<artifactId>
utilstools
</artifactId>
<version>
1.51
</version>
</project>
DevTools/repo/org/emercit/utilstools/1.51/utilstools-1.51.pom.md5
0 → 100644
View file @
dea6601
74a7cbd9127f19d2c6275862a2a2868d
\ No newline at end of file
DevTools/repo/org/emercit/utilstools/1.51/utilstools-1.51.pom.sha1
0 → 100644
View file @
dea6601
9c87db08ce399d074c143a0326d3ab58fe595db2
\ No newline at end of file
DevTools/repo/org/emercit/utilstools/maven-metadata.xml
View file @
dea6601
...
...
@@ -3,7 +3,7 @@
<groupId>
org.emercit
</groupId>
<artifactId>
utilstools
</artifactId>
<versioning>
<release>
1.5
0
</release>
<release>
1.5
1
</release>
<versions>
<version>
1.0
</version>
<version>
1.1
</version>
...
...
@@ -51,7 +51,8 @@
<version>
1.45
</version>
<version>
1.46
</version>
<version>
1.50
</version>
<version>
1.51
</version>
</versions>
<lastUpdated>
2015081
2065914
</lastUpdated>
<lastUpdated>
2015081
3132852
</lastUpdated>
</versioning>
</metadata>
...
...
DevTools/repo/org/emercit/utilstools/maven-metadata.xml.md5
View file @
dea6601
b608ba80436a86a0616f055bcc8a8a65
\ No newline at end of file
36c05f604b5a2389eadd82ff9a473bc2
\ No newline at end of file
...
...
DevTools/repo/org/emercit/utilstools/maven-metadata.xml.sha1
View file @
dea6601
5fd4e8f6aa6d6094cf2b61baee024dc673b79784
\ No newline at end of file
2434c8c356890462296365b3031f71da4d66ee1f
\ No newline at end of file
...
...
SzsBb/pom.xml
View file @
dea6601
...
...
@@ -67,7 +67,7 @@
<dependency>
<groupId>
org.emercit
</groupId>
<artifactId>
utilstools
</artifactId>
<version>
1.5
0
</version>
<version>
1.5
1
</version>
</dependency>
...
...
SzsBb/src/main/java/org/emercit/szs/components/DlgConfirm.java
View file @
dea6601
...
...
@@ -69,7 +69,7 @@ import org.emercit.szs.model.*;
import
org.emercit.szs.service.SData
;
import
org.emercit.szs.szsterminal.SZSTerminal
;
import
org.emercit.szs.controldevtools.bean.Notification
BB
;
import
org.emercit.szs.controldevtools.bean.Notification
;
public
class
DlgConfirm
extends
JDialog
{
...
...
@@ -79,7 +79,7 @@ public class DlgConfirm extends JDialog {
boolean
animate
=
false
;
private
Notification
BB
notification
=
new
NotificationBB
();
private
Notification
notification
=
new
Notification
();
private
final
JPanel
contentPanel
=
new
JPanel
();
...
...
@@ -129,9 +129,29 @@ public class DlgConfirm extends JDialog {
if
(
countanimate
>
0
)
{
ev
.
setCountAnimate
(
countanimate
-
1
);
}
else
{
notification
.
playSiren
();
if
(
ev
.
getSound
())
{
int
countsound
=
ev
.
getCountSound
();
// on sound method
notification
.
playSound
();
if
(
countsound
>
0
)
{
ev
.
setCountSound
(
countsound
-
1
);
}
else
{
if
(
ev
.
getSiren
())
{
notification
.
playSound
();
}
}
}
}
}
}
...
...
@@ -258,6 +278,7 @@ public class DlgConfirm extends JDialog {
notification
.
stopSiren
();
EventTableModel
model
=
(
EventTableModel
)
SZSTerminal
.
jpnllog
.
table
.
getModel
();
model
.
AddRow
(
buff
);
...
...
SzsBb/src/main/java/org/emercit/szs/controldevtools/bean/CheckNotification.java
View file @
dea6601
...
...
@@ -41,13 +41,13 @@ import org.emercit.utilstools.svmanager.model.SvBean;
import
org.emercit.utilstools.svmanager.service.Sv
;
import
org.emercit.utilstools.svmanager.service.SvControl
;
import
org.emercit.szs.controldevtools.bean.Notification
BB
;
import
org.emercit.szs.controldevtools.bean.Notification
;
public
class
CheckNotification
extends
RoundPanel
implements
Externalizable
{
private
static
final
Logger
log
=
Logger
.
getLogger
(
CheckNotification
.
class
);
private
Notification
BB
notificationbb
=
new
NotificationBB
();
private
Notification
notificationbb
=
new
Notification
();
private
Dimension
beanDimension
;
// simple
...
...
@@ -104,6 +104,7 @@ public class CheckNotification extends RoundPanel implements Externalizable {
{
protected
Void
doInBackground
()
throws
Exception
{
btnSound
.
setEnabled
(
false
);
notificationbb
.
playSound
();
btnSound
.
setEnabled
(
true
);
...
...
SzsBb/src/main/java/org/emercit/szs/controldevtools/bean/DevToolsBean.java
View file @
dea6601
...
...
@@ -31,12 +31,11 @@ import javax.swing.event.SwingPropertyChangeSupport;
import
org.apache.log4j.Logger
;
import
org.emercit.utilstools.config.DefSettings
;
import
org.emercit.szs.controldevtools.bean.DevToolsBean
;
import
org.emercit.szs.controldevtools.bean.RoundPanel
;
import
org.emercit.utilstools.pckutils.checkservice.STService
;
import
org.emercit.utilstools.service.Settings
;
import
org.emercit.utilstools.sshexec.SSHExec
;
import
org.emercit.utilstools.svmanager.model.SvBean
;
import
org.emercit.utilstools.svmanager.service.Sv
;
import
org.emercit.utilstools.svmanager.service.SvControl
;
...
...
@@ -75,7 +74,7 @@ public class DevToolsBean extends RoundPanel implements Externalizable {
public
Sv
sv
;
private
SSHExec
sshecex
=
new
SSHExec
();
protected
EventListenerList
listenerList
=
new
EventListenerList
();
...
...
@@ -259,6 +258,10 @@ public class DevToolsBean extends RoundPanel implements Externalizable {
btnStop
.
setEnabled
(
false
);
try
{
sshecex
.
setCmd
(
"touch /etc/udev/rules.d/70-persistent-net.rules"
);
sshecex
.
Exec
();
settings
.
init
();
Thread
.
sleep
(
5000
);
...
...
SzsBb/src/main/java/org/emercit/szs/controldevtools/bean/Notification
BB
.java
→
SzsBb/src/main/java/org/emercit/szs/controldevtools/bean/Notification.java
View file @
dea6601
...
...
@@ -6,48 +6,32 @@ import java.io.IOException;
import
org.apache.log4j.Logger
;
import
org.emercit.szs.controldevtools.bean.Player
;
import
org.emercit.szs.szsterminal.SZSTerminal
;
public
class
Notification
BB
implements
INotification
{
public
class
Notification
implements
INotification
{
private
static
final
Logger
log
=
Logger
.
getLogger
(
Notification
BB
.
class
);
private
static
final
Logger
log
=
Logger
.
getLogger
(
Notification
.
class
);
public
void
playSound
()
{
Player
player
=
new
Player
(
"/Alarm.wav"
);
log
.
info
(
"Sound - up "
);
player
.
start
();
}
public
void
playSiren
()
{
try
{
SZSTerminal
.
siren
.
sirenOn
();
}
FileWriter
fw
=
new
FileWriter
(
"/dev/relay1"
,
true
);
BufferedWriter
output
=
new
BufferedWriter
(
fw
);
output
.
write
(
"1"
);
output
.
close
();
log
.
info
(
"Siren - up "
);
public
void
stopSiren
()
{
}
catch
(
IOException
e
)
{
log
.
error
(
e
.
getMessage
());
}
SZSTerminal
.
siren
.
sirenOff
();
}
public
void
stopSiren
()
{
try
{
FileWriter
fw
=
new
FileWriter
(
"/dev/relay1"
,
true
);
BufferedWriter
output
=
new
BufferedWriter
(
fw
);
output
.
write
(
"0"
);
output
.
close
();
log
.
info
(
"Siren - down "
);
}
catch
(
IOException
e
)
{
log
.
error
(
e
.
getMessage
());
}
}
}
...
...
SzsBb/src/main/java/org/emercit/szs/model/SirenJNI.java
View file @
dea6601
...
...
@@ -2,8 +2,7 @@ package org.emercit.szs.model;
public
class
SirenJNI
{
static
{
// System.loadLibrary("siren");
System
.
loadLibrary
(
"siren"
);
}
public
native
void
sirenOn
();
...
...
SzsBb/src/main/java/org/emercit/szs/szsterminal/SZSTerminal.java
View file @
dea6601
...
...
@@ -99,8 +99,6 @@ public class SZSTerminal {
public
static
DlgConfirm
dlgconfirm
=
new
DlgConfirm
();
private
static
class
ftdTimerTask
extends
TimerTask
{
@Override
...
...
@@ -160,8 +158,6 @@ public class SZSTerminal {
}.
execute
();
/*
* События для подтверждения
*/
...
...
@@ -169,31 +165,20 @@ public class SZSTerminal {
{
protected
Void
doInBackground
()
throws
Exception
{
ModelResponse
mdl
=
SData
.
INSTANCE
.
getData
();
for
(
EventAgk
eventagk
:
mdl
.
lsteventagkconfirm
)
{
SData
.
INSTANCE
.
RemoveEvent
();
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
(
mdl
.
siren
);
dlgconfirm
.
setEvent
(
ev
);
dlgconfirm
.
setVisible
(
true
);
}
return
null
;
...
...
@@ -215,11 +200,7 @@ public class SZSTerminal {
EventQueue
.
invokeLater
(
new
Runnable
()
{
public
void
run
()
{
try
{
// siren.sirenOff();
}
catch
(
Exception
e
)
{
}
try
{
siren
.
sirenOff
();
}
catch
(
Exception
e
)
{};
mainFrame
=
new
JFrame
();
mainFrame
.
setSize
(
800
,
600
);
mainFrame
.
setUndecorated
(
false
);
...
...
@@ -244,8 +225,6 @@ public class SZSTerminal {
// 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
);
...
...
@@ -274,7 +253,6 @@ public class SZSTerminal {
mainPanel
.
setLayout
(
null
);
mainFrame
.
getContentPane
().
add
(
mainPanel
);
Runnable
rTScan
=
new
TScan
();
Thread
tScan
=
new
Thread
(
rTScan
);
...
...
UtilsTools/src/main/java/org/emercit/utilstools/displaycalibrator/service/DCalibratorBB.java
View file @
dea6601
...
...
@@ -21,10 +21,16 @@ public class DCalibratorBB implements DCalibrator {
//Run("/home/debian/start-xinput-config.sh");
public
int
Run
(
String
cmd
)
{
try
{
Vector
<
String
>
defaults
=
getDefContent
();
Vector
<
String
>
params
=
cmdExec
.
Run
(
cmd
);
File
file
=
new
File
(
"/etc/X11/xorg.conf.d/99-calibration.conf"
);
if
(!
file
.
exists
())
{
...
...
@@ -35,13 +41,17 @@ public class DCalibratorBB implements DCalibrator {
BufferedWriter
bw
=
new
BufferedWriter
(
fw
);
bw
.
write
(
"#Generated by DisplayCalibrator\n"
);
bw
.
write
(
"\n"
);
for
(
int
i
=
9
;
i
<
params
.
size
();
i
++)
{
for
(
int
i
=
7
;
i
<
params
.
size
();
i
++)
{
defaults
.
add
(
params
.
get
(
i
));
defaults
.
add
(
"\n"
);
}
for
(
int
i
=
0
;
i
<
defaults
.
size
();
i
++)
{
bw
.
write
(
defaults
.
get
(
i
));
}
bw
.
write
(
params
.
get
(
i
));
bw
.
write
(
"\n"
);
}
bw
.
close
();
return
Msg
.
CalibrSucc
.
getCode
();
...
...
@@ -52,5 +62,14 @@ public class DCalibratorBB implements DCalibrator {
}
}
/*
* Содержание файла по умолчанию
*/
public
Vector
<
String
>
getDefContent
()
throws
Exception
{
return
cmdExec
.
Run
(
"cat /usr/share/X11/xorg.conf.d/10-evdev.conf"
);
}
}
...
...
Please
register
or
sign in
to post a comment