Commit 4a380d45 authored by Claes Sjöfors's avatar Claes Sjöfors

Java local charaters fix

parent cd44f1f8
......@@ -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 server");
System.out.println("IOException at server stream creation");
//errh.error("DataStream failed");
return new MhData(100,100);
}
......
......@@ -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);
......
......@@ -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__POAIUYTRQWERTYUIOPAAOL",
"QWERTYUIOPAAOLK"};
......
......@@ -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() +
"storlek på sub: " + subscriptions.size() +
"Tillgängligt minne: " + freeMem + " KB" +
"Totalt minne: " + totalMem + " KB");
System.out.println("Out of memory, size of thSub: " + thSub.size() +
"size 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 minne: " + freeMem +
"Totalt 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 minne
// Reduce subscription size to save memory
this.trimRefObjectList();
threadCount--;
setCurrentConnections(threadCount);
......
......@@ -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++)
{
......
......@@ -269,7 +269,7 @@ public class Mh
lastMhrEvent = evItem;
newAlarmArrived = true;
nrOfAlarmsArrived++; //behövs ej
nrOfAlarmsArrived++; // not needed
}
......
......@@ -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 receivemesstrd " + e.toString());
System.out.println("Exception i receive message thread " + 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 in 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)
{
......
......@@ -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] = '@';
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment