Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
4a380d45
Commit
4a380d45
authored
Sep 10, 2015
by
Claes Sjöfors
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Java local charaters fix
parent
cd44f1f8
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
32 additions
and
34 deletions
+32
-34
java/jpwr/jop/src/HistSender.java
java/jpwr/jop/src/HistSender.java
+2
-2
java/jpwr/jop/src/JopApplet.java
java/jpwr/jop/src/JopApplet.java
+4
-4
java/jpwr/jop/src/MhTable.java
java/jpwr/jop/src/MhTable.java
+1
-1
java/jpwr/rt/src/GdhServer.java
java/jpwr/rt/src/GdhServer.java
+8
-8
java/jpwr/rt/src/GdhServerMonitor.java
java/jpwr/rt/src/GdhServerMonitor.java
+1
-1
java/jpwr/rt/src/Mh.java
java/jpwr/rt/src/Mh.java
+1
-1
java/jpwr/rt/src/MhServer.java
java/jpwr/rt/src/MhServer.java
+11
-13
java/jpwr/rt/src/RtUtilities.java
java/jpwr/rt/src/RtUtilities.java
+4
-4
No files found.
java/jpwr/jop/src/HistSender.java
View file @
4a380d45
...
@@ -102,11 +102,11 @@ public class HistSender {
...
@@ -102,11 +102,11 @@ public class HistSender {
try
{
try
{
out
=
new
ObjectOutputStream
(
socket
.
getOutputStream
()
);
out
=
new
ObjectOutputStream
(
socket
.
getOutputStream
()
);
out
.
flush
();
out
.
flush
();
//
varfö
r???
//
why
???
in
=
new
ObjectInputStream
(
socket
.
getInputStream
()
);
in
=
new
ObjectInputStream
(
socket
.
getInputStream
()
);
}
}
catch
(
Exception
e
)
{
catch
(
Exception
e
)
{
System
.
out
.
println
(
"IOException
vid skapande av strömmar mot serve
r"
);
System
.
out
.
println
(
"IOException
at server stream creation
"
);
//errh.error("DataStream failed");
//errh.error("DataStream failed");
return
new
MhData
(
100
,
100
);
return
new
MhData
(
100
,
100
);
}
}
...
...
java/jpwr/jop/src/JopApplet.java
View file @
4a380d45
...
@@ -65,10 +65,10 @@ public class JopApplet extends JApplet implements GdhApplIfc
...
@@ -65,10 +65,10 @@ public class JopApplet extends JApplet implements GdhApplIfc
engine
=
new
JopEngine
(
1000
,
this
);
engine
=
new
JopEngine
(
1000
,
this
);
session
=
new
JopSession
(
engine
,
(
Object
)
this
);
session
=
new
JopSession
(
engine
,
(
Object
)
this
);
if
(
instance
!=
null
&&
instance
.
length
()
!=
0
)
{
if
(
instance
!=
null
&&
instance
.
length
()
!=
0
)
{
// Substitutes for åäö because of mozilla...
// Substitutes for
local char
because of mozilla...
instance
=
instance
.
replace
(
'\\'
,
'å
'
);
instance
=
instance
.
replace
(
'\\'
,
(
char
)
229
);
instance
=
instance
.
replace
(
'/'
,
'ä
'
);
instance
=
instance
.
replace
(
'/'
,
(
char
)
228
);
instance
=
instance
.
replace
(
'@'
,
'ö
'
);
instance
=
instance
.
replace
(
'@'
,
(
char
)
246
);
System
.
out
.
println
(
"Parameter instance: "
+
instance
);
System
.
out
.
println
(
"Parameter instance: "
+
instance
);
engine
.
gdh
.
logString
(
"Parameter instance: "
+
instance
);
engine
.
gdh
.
logString
(
"Parameter instance: "
+
instance
);
...
...
java/jpwr/jop/src/MhTable.java
View file @
4a380d45
...
@@ -588,7 +588,7 @@ public class MhTable extends JPanel
...
@@ -588,7 +588,7 @@ public class MhTable extends JPanel
public
final
Object
[]
longValues
=
{
"A"
,
"Acknowledge"
,
public
final
Object
[]
longValues
=
{
"A"
,
"Acknowledge"
,
"10-12-31 12:12:12.98"
,
"10-12-31 12:12:12.98"
,
"QWERTYUIOPAAOLK_JHGFDSAZXCVBNM__POIUYTRQWERTYUIOPAAOL"
,
"QWERTYUIOPAAOLK_JHGFDSAZXCVBNM__PO
A
IUYTRQWERTYUIOPAAOL"
,
"QWERTYUIOPAAOLK"
};
"QWERTYUIOPAAOLK"
};
...
...
java/jpwr/rt/src/GdhServer.java
View file @
4a380d45
...
@@ -813,10 +813,10 @@ public class GdhServer
...
@@ -813,10 +813,10 @@ public class GdhServer
long
K
=
1024
;
long
K
=
1024
;
long
freeMem
=
Runtime
.
getRuntime
().
freeMemory
()
/
K
;
long
freeMem
=
Runtime
.
getRuntime
().
freeMemory
()
/
K
;
long
totalMem
=
Runtime
.
getRuntime
().
totalMemory
()
/
K
;
long
totalMem
=
Runtime
.
getRuntime
().
totalMemory
()
/
K
;
System
.
out
.
println
(
"
Slut på minne, storlek
på thSub: "
+
thSub
.
size
()
+
System
.
out
.
println
(
"
Out of memory, size of
thSub: "
+
thSub
.
size
()
+
"s
torlek p
å sub: "
+
subscriptions
.
size
()
+
"s
ize of
sub: "
+
subscriptions
.
size
()
+
"
Tillgängligt minn
e: "
+
freeMem
+
" KB"
+
"
Available memory
: "
+
freeMem
+
" KB"
+
"Total
t minne
: "
+
totalMem
+
" KB"
);
"Total
memory
: "
+
totalMem
+
" KB"
);
}
}
catch
(
IOException
e
)
catch
(
IOException
e
)
...
@@ -1806,9 +1806,9 @@ public class GdhServer
...
@@ -1806,9 +1806,9 @@ public class GdhServer
{
{
long
freeMem
=
Runtime
.
getRuntime
().
freeMemory
();
long
freeMem
=
Runtime
.
getRuntime
().
freeMemory
();
long
totalMem
=
Runtime
.
getRuntime
().
totalMemory
();
long
totalMem
=
Runtime
.
getRuntime
().
totalMemory
();
System
.
out
.
println
(
"
Slut på minne, storlek
på subcp: "
+
subscriptions
.
size
()
+
System
.
out
.
println
(
"
Out of memory, size of
subcp: "
+
subscriptions
.
size
()
+
"
Tillgängligt minn
e: "
+
freeMem
+
"
Available memory
: "
+
freeMem
+
"Total
t minne
: "
+
totalMem
);
"Total
memory
: "
+
totalMem
);
}
}
catch
(
IOException
e
)
catch
(
IOException
e
)
{
{
...
@@ -1975,7 +1975,7 @@ public class GdhServer
...
@@ -1975,7 +1975,7 @@ public class GdhServer
{
{
}
}
}
}
//
minska storleken på subscriptions för att spara min
ne
//
Reduce subscription size to save memory
this
.
trimRefObjectList
();
this
.
trimRefObjectList
();
threadCount
--;
threadCount
--;
setCurrentConnections
(
threadCount
);
setCurrentConnections
(
threadCount
);
...
...
java/jpwr/rt/src/GdhServerMonitor.java
View file @
4a380d45
...
@@ -189,7 +189,7 @@ public class GdhServerMonitor extends JFrame implements ActionListener
...
@@ -189,7 +189,7 @@ public class GdhServerMonitor extends JFrame implements ActionListener
totalMem
=
totalMem
/
1024
;
totalMem
=
totalMem
/
1024
;
labelMessage
.
setText
(
"Ledigt minne(av allokerat): "
+
freeMem
+
" Allokerat minne: "
+
totalMem
+
labelMessage
.
setText
(
"Ledigt minne(av allokerat): "
+
freeMem
+
" Allokerat minne: "
+
totalMem
+
" Antal prenumerationer: "
+
nrOfSubscriptions
);
" Antal prenumerationer: "
+
nrOfSubscriptions
);
//
qqq behvs detta
???
//
is this needed
???
data
=
new
Object
[
size
][
5
];
data
=
new
Object
[
size
][
5
];
for
(
int
i
=
0
;
i
<
size
;
i
++)
for
(
int
i
=
0
;
i
<
size
;
i
++)
{
{
...
...
java/jpwr/rt/src/Mh.java
View file @
4a380d45
...
@@ -269,7 +269,7 @@ public class Mh
...
@@ -269,7 +269,7 @@ public class Mh
lastMhrEvent
=
evItem
;
lastMhrEvent
=
evItem
;
newAlarmArrived
=
true
;
newAlarmArrived
=
true
;
nrOfAlarmsArrived
++;
//
behövs e
j
nrOfAlarmsArrived
++;
//
not needed
}
}
...
...
java/jpwr/rt/src/MhServer.java
View file @
4a380d45
...
@@ -182,7 +182,7 @@ public class MhServer
...
@@ -182,7 +182,7 @@ public class MhServer
maxConnections
=
cdhrMaxCon
.
value
;
maxConnections
=
cdhrMaxCon
.
value
;
maxAlarms
=
cdhrMaxAlarms
.
value
;
maxAlarms
=
cdhrMaxAlarms
.
value
;
maxEvents
=
cdhrMaxEvents
.
value
;
maxEvents
=
cdhrMaxEvents
.
value
;
//
pga bugg i proview, MaxNoOfAlarms syns ej i arbetsbnken
//
because if Proview bugg, MaxNoOfAlarms is not visible in wb
if
(
maxAlarms
==
0
)
maxAlarms
=
100
;
if
(
maxAlarms
==
0
)
maxAlarms
=
100
;
if
(
maxEvents
==
0
)
maxEvents
=
200
;
if
(
maxEvents
==
0
)
maxEvents
=
200
;
//currentConnectionsStr = cdhrString.str + ".CurrentConnections";
//currentConnectionsStr = cdhrString.str + ".CurrentConnections";
...
@@ -407,13 +407,12 @@ public class MhServer
...
@@ -407,13 +407,12 @@ public class MhServer
//System.out.println("efter insertNewMess");
//System.out.println("efter insertNewMess");
for
(
int
i
=
0
;
i
<
totalThreadCount
&&
i
<
mhThread
.
length
;
i
++)
for
(
int
i
=
0
;
i
<
totalThreadCount
&&
i
<
mhThread
.
length
;
i
++)
{
{
//System.out.println("Nu skall sendMess anropas");
// Some client may have been terminated
//det kan ju vara s att ngon klient har avslutats
if
(
mhThread
[
i
]
==
null
)
if
(
mhThread
[
i
]
==
null
)
{
{
if
(
log
)
if
(
log
)
{
{
System
.
out
.
println
(
"mhThread["
+
i
+
"]
r
null"
);
System
.
out
.
println
(
"mhThread["
+
i
+
"]
is
null"
);
}
}
continue
;
continue
;
}
}
...
@@ -462,7 +461,7 @@ public class MhServer
...
@@ -462,7 +461,7 @@ public class MhServer
catch
(
IOException
e
)
catch
(
IOException
e
)
{
{
this
.
keepRunning
=
false
;
this
.
keepRunning
=
false
;
System
.
out
.
println
(
"IOException
vid skapande av strmmar mot klient
"
);
System
.
out
.
println
(
"IOException
at client stream creation
"
);
errh
.
error
(
"DataStream failed"
);
errh
.
error
(
"DataStream failed"
);
threadCount
--;
threadCount
--;
//setCurrentConnections(threadCount);
//setCurrentConnections(threadCount);
...
@@ -494,7 +493,7 @@ public class MhServer
...
@@ -494,7 +493,7 @@ public class MhServer
out
.
writeInt
(
nrOfEvents
);
out
.
writeInt
(
nrOfEvents
);
if
(
log
)
if
(
log
)
{
{
System
.
out
.
println
(
"
Hndelsestorlek
: "
+
nrOfEvents
);
System
.
out
.
println
(
"
Event size
: "
+
nrOfEvents
);
}
}
if
(
nrOfEvents
>
0
)
if
(
nrOfEvents
>
0
)
{
{
...
@@ -515,22 +514,21 @@ public class MhServer
...
@@ -515,22 +514,21 @@ public class MhServer
while
(
this
.
keepRunning
)
while
(
this
.
keepRunning
)
{
{
//hr skall vi ligga och vnta p meddelanden frn klienterna
// Wait for client messages, alarm ack and so
//typ alarmkvittens och dylikt
try
try
{
{
MhrsEventId
id
=
(
MhrsEventId
)
in
.
readObject
();
MhrsEventId
id
=
(
MhrsEventId
)
in
.
readObject
();
if
(
log
)
if
(
log
)
{
{
System
.
out
.
println
(
"
ftt meddelande
"
+
id
.
idx
+
" "
+
id
.
nix
+
" "
+
System
.
out
.
println
(
"
Message received
"
+
id
.
idx
+
" "
+
id
.
nix
+
" "
+
id
.
birthTime
);
id
.
birthTime
);
}
}
PwrtStatus
sts
=
mh
.
outunitAck
(
id
);
PwrtStatus
sts
=
mh
.
outunitAck
(
id
);
}
}
catch
(
Exception
e
)
catch
(
Exception
e
)
{
{
System
.
out
.
println
(
"Exception i receive
messtr
d "
+
e
.
toString
());
System
.
out
.
println
(
"Exception i receive
message threa
d "
+
e
.
toString
());
this
.
keepRunning
=
false
;
this
.
keepRunning
=
false
;
}
}
Thread
.
sleep
(
3
);
Thread
.
sleep
(
3
);
...
@@ -538,8 +536,8 @@ public class MhServer
...
@@ -538,8 +536,8 @@ public class MhServer
}
}
catch
(
Exception
e
)
catch
(
Exception
e
)
{
{
System
.
out
.
println
(
"exception i run MhThread"
);
System
.
out
.
println
(
"exception i
n
run MhThread"
);
System
.
out
.
println
(
"
avslutar trden
"
);
System
.
out
.
println
(
"
Terminate thread
"
);
}
}
finally
finally
{
{
...
@@ -571,7 +569,7 @@ public class MhServer
...
@@ -571,7 +569,7 @@ public class MhServer
}
}
}
}
/**
/**
*
Anropas var gng ett nytt meddelande skall skickas till klienterna
*
Called every time a new message is sent to the clients
*/
*/
public
void
sendMess
(
MhrEvent
event
)
public
void
sendMess
(
MhrEvent
event
)
{
{
...
...
java/jpwr/rt/src/RtUtilities.java
View file @
4a380d45
...
@@ -122,14 +122,14 @@ public class RtUtilities {
...
@@ -122,14 +122,14 @@ public class RtUtilities {
int
offs1
;
int
offs1
;
int
offs2
;
int
offs2
;
// Replace in instance name because mozilla can't pass them as
// Replace
local char
in instance name because mozilla can't pass them as
// parameter
// parameter
for
(
int
i
=
0
;
i
<
instance
.
length
();
i
++)
{
for
(
int
i
=
0
;
i
<
instance
.
length
();
i
++)
{
if
(
instanceBuff
[
i
]
==
''
||
instanceBuff
[
i
]
==
''
)
if
(
instanceBuff
[
i
]
==
229
||
instanceBuff
[
i
]
==
197
)
instanceBuff
[
i
]
=
'\\'
;
instanceBuff
[
i
]
=
'\\'
;
if
(
instanceBuff
[
i
]
==
''
||
instanceBuff
[
i
]
==
''
)
if
(
instanceBuff
[
i
]
==
228
||
instanceBuff
[
i
]
==
196
)
instanceBuff
[
i
]
=
'/'
;
instanceBuff
[
i
]
=
'/'
;
if
(
instanceBuff
[
i
]
==
''
||
instanceBuff
[
i
]
==
''
)
if
(
instanceBuff
[
i
]
==
246
||
instanceBuff
[
i
]
==
214
)
instanceBuff
[
i
]
=
'@'
;
instanceBuff
[
i
]
=
'@'
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment