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 {
try
{
out
=
new
ObjectOutputStream
(
socket
.
getOutputStream
()
);
out
.
flush
();
//
varfö
r???
//
why
???
in
=
new
ObjectInputStream
(
socket
.
getInputStream
()
);
}
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");
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
engine
=
new
JopEngine
(
1000
,
this
);
session
=
new
JopSession
(
engine
,
(
Object
)
this
);
if
(
instance
!=
null
&&
instance
.
length
()
!=
0
)
{
// Substitutes for åäö because of mozilla...
instance
=
instance
.
replace
(
'\\'
,
'å
'
);
instance
=
instance
.
replace
(
'/'
,
'ä
'
);
instance
=
instance
.
replace
(
'@'
,
'ö
'
);
// Substitutes for
local char
because of mozilla...
instance
=
instance
.
replace
(
'\\'
,
(
char
)
229
);
instance
=
instance
.
replace
(
'/'
,
(
char
)
228
);
instance
=
instance
.
replace
(
'@'
,
(
char
)
246
);
System
.
out
.
println
(
"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
public
final
Object
[]
longValues
=
{
"A"
,
"Acknowledge"
,
"10-12-31 12:12:12.98"
,
"QWERTYUIOPAAOLK_JHGFDSAZXCVBNM__POIUYTRQWERTYUIOPAAOL"
,
"QWERTYUIOPAAOLK_JHGFDSAZXCVBNM__PO
A
IUYTRQWERTYUIOPAAOL"
,
"QWERTYUIOPAAOLK"
};
...
...
java/jpwr/rt/src/GdhServer.java
View file @
4a380d45
...
...
@@ -813,10 +813,10 @@ public class GdhServer
long
K
=
1024
;
long
freeMem
=
Runtime
.
getRuntime
().
freeMemory
()
/
K
;
long
totalMem
=
Runtime
.
getRuntime
().
totalMemory
()
/
K
;
System
.
out
.
println
(
"
Slut på minne, storlek
på thSub: "
+
thSub
.
size
()
+
"s
torlek p
å sub: "
+
subscriptions
.
size
()
+
"
Tillgängligt minn
e: "
+
freeMem
+
" KB"
+
"Total
t minne
: "
+
totalMem
+
" KB"
);
System
.
out
.
println
(
"
Out of memory, size of
thSub: "
+
thSub
.
size
()
+
"s
ize of
sub: "
+
subscriptions
.
size
()
+
"
Available memory
: "
+
freeMem
+
" KB"
+
"Total
memory
: "
+
totalMem
+
" KB"
);
}
catch
(
IOException
e
)
...
...
@@ -1806,9 +1806,9 @@ public class GdhServer
{
long
freeMem
=
Runtime
.
getRuntime
().
freeMemory
();
long
totalMem
=
Runtime
.
getRuntime
().
totalMemory
();
System
.
out
.
println
(
"
Slut på minne, storlek
på subcp: "
+
subscriptions
.
size
()
+
"
Tillgängligt minn
e: "
+
freeMem
+
"Total
t minne
: "
+
totalMem
);
System
.
out
.
println
(
"
Out of memory, size of
subcp: "
+
subscriptions
.
size
()
+
"
Available memory
: "
+
freeMem
+
"Total
memory
: "
+
totalMem
);
}
catch
(
IOException
e
)
{
...
...
@@ -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
();
threadCount
--;
setCurrentConnections
(
threadCount
);
...
...
java/jpwr/rt/src/GdhServerMonitor.java
View file @
4a380d45
...
...
@@ -189,7 +189,7 @@ public class GdhServerMonitor extends JFrame implements ActionListener
totalMem
=
totalMem
/
1024
;
labelMessage
.
setText
(
"Ledigt minne(av allokerat): "
+
freeMem
+
" Allokerat minne: "
+
totalMem
+
" Antal prenumerationer: "
+
nrOfSubscriptions
);
//
qqq behvs detta
???
//
is this needed
???
data
=
new
Object
[
size
][
5
];
for
(
int
i
=
0
;
i
<
size
;
i
++)
{
...
...
java/jpwr/rt/src/Mh.java
View file @
4a380d45
...
...
@@ -269,7 +269,7 @@ public class Mh
lastMhrEvent
=
evItem
;
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
maxConnections
=
cdhrMaxCon
.
value
;
maxAlarms
=
cdhrMaxAlarms
.
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
(
maxEvents
==
0
)
maxEvents
=
200
;
//currentConnectionsStr = cdhrString.str + ".CurrentConnections";
...
...
@@ -407,13 +407,12 @@ public class MhServer
//System.out.println("efter insertNewMess");
for
(
int
i
=
0
;
i
<
totalThreadCount
&&
i
<
mhThread
.
length
;
i
++)
{
//System.out.println("Nu skall sendMess anropas");
//det kan ju vara s att ngon klient har avslutats
// Some client may have been terminated
if
(
mhThread
[
i
]
==
null
)
{
if
(
log
)
{
System
.
out
.
println
(
"mhThread["
+
i
+
"]
r
null"
);
System
.
out
.
println
(
"mhThread["
+
i
+
"]
is
null"
);
}
continue
;
}
...
...
@@ -462,7 +461,7 @@ public class MhServer
catch
(
IOException
e
)
{
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"
);
threadCount
--;
//setCurrentConnections(threadCount);
...
...
@@ -494,7 +493,7 @@ public class MhServer
out
.
writeInt
(
nrOfEvents
);
if
(
log
)
{
System
.
out
.
println
(
"
Hndelsestorlek
: "
+
nrOfEvents
);
System
.
out
.
println
(
"
Event size
: "
+
nrOfEvents
);
}
if
(
nrOfEvents
>
0
)
{
...
...
@@ -515,22 +514,21 @@ public class MhServer
while
(
this
.
keepRunning
)
{
//hr skall vi ligga och vnta p meddelanden frn klienterna
//typ alarmkvittens och dylikt
// Wait for client messages, alarm ack and so
try
{
MhrsEventId
id
=
(
MhrsEventId
)
in
.
readObject
();
if
(
log
)
{
System
.
out
.
println
(
"
ftt meddelande
"
+
id
.
idx
+
" "
+
id
.
nix
+
" "
+
System
.
out
.
println
(
"
Message received
"
+
id
.
idx
+
" "
+
id
.
nix
+
" "
+
id
.
birthTime
);
}
PwrtStatus
sts
=
mh
.
outunitAck
(
id
);
}
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
;
}
Thread
.
sleep
(
3
);
...
...
@@ -538,8 +536,8 @@ public class MhServer
}
catch
(
Exception
e
)
{
System
.
out
.
println
(
"exception i run MhThread"
);
System
.
out
.
println
(
"
avslutar trden
"
);
System
.
out
.
println
(
"exception i
n
run MhThread"
);
System
.
out
.
println
(
"
Terminate thread
"
);
}
finally
{
...
...
@@ -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
)
{
...
...
java/jpwr/rt/src/RtUtilities.java
View file @
4a380d45
...
...
@@ -122,14 +122,14 @@ public class RtUtilities {
int
offs1
;
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
for
(
int
i
=
0
;
i
<
instance
.
length
();
i
++)
{
if
(
instanceBuff
[
i
]
==
''
||
instanceBuff
[
i
]
==
''
)
if
(
instanceBuff
[
i
]
==
229
||
instanceBuff
[
i
]
==
197
)
instanceBuff
[
i
]
=
'\\'
;
if
(
instanceBuff
[
i
]
==
''
||
instanceBuff
[
i
]
==
''
)
if
(
instanceBuff
[
i
]
==
228
||
instanceBuff
[
i
]
==
196
)
instanceBuff
[
i
]
=
'/'
;
if
(
instanceBuff
[
i
]
==
''
||
instanceBuff
[
i
]
==
''
)
if
(
instanceBuff
[
i
]
==
246
||
instanceBuff
[
i
]
==
214
)
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