Skip to content

Commit 03164a9

Browse files
committed
V0.4 with Java 1.5
1 parent d903677 commit 03164a9

File tree

2,611 files changed

+307602
-790
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

2,611 files changed

+307602
-790
lines changed

Console/.gitignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/Console$ReaderThread$1.class
2+
/Console$ReaderThread.class
3+
/Console.class

Console/.svn/README.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
This is a Subversion working copy administrative directory.
2+
Visit http://subversion.tigris.org/ for more information.

Console/.svn/dir-wcprops

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
K 25
2+
svn:wc:ra_dav:version-url
3+
V 40
4+
/instru_geos/!svn/ver/2/jSeisCal/Console
5+
END
File renamed without changes.

Console/.svn/entries

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<wc-entries
3+
xmlns="svn:">
4+
<entry
5+
repos="https://svn.ipgp.fr/instru_geos"
6+
name=""
7+
revision="238"
8+
last-author="leroy"
9+
url="https://svn.ipgp.fr/instru_geos/jSeisCal/Console"
10+
uuid="308c3184-852a-42d4-b679-f66096868c1e"
11+
committed-rev="2"
12+
kind="dir"
13+
committed-date="2010-01-14T18:01:35.428086Z"/>
14+
<entry
15+
name="Console.java"
16+
checksum="842aa9429750b49deba4659c9e24b7c8"
17+
last-author="leroy"
18+
committed-rev="2"
19+
text-time="2010-01-14T18:01:35.000000Z"
20+
kind="file"
21+
committed-date="2010-01-14T18:01:35.428086Z"/>
22+
</wc-entries>

Console/.svn/format

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
package Console;
2+
import java.awt.*;
3+
import java.io.*;
4+
import javax.swing.*;
5+
import javax.swing.border.LineBorder;
6+
import javax.swing.border.TitledBorder;
7+
8+
public class Console extends JPanel {
9+
/**
10+
*
11+
*/
12+
private static final long serialVersionUID = 1L;
13+
14+
PipedInputStream piOut;
15+
PipedInputStream piErr;
16+
PipedOutputStream poOut;
17+
PipedOutputStream poErr;
18+
JTextArea textArea = new JTextArea();
19+
20+
public Console() throws IOException {
21+
// Set up System.out
22+
piOut = new PipedInputStream();
23+
poOut = new PipedOutputStream(piOut);
24+
//System.setOut(new PrintStream(poOut, true));
25+
26+
// Set up System.err
27+
piErr = new PipedInputStream();
28+
poErr = new PipedOutputStream(piErr);
29+
//System.setErr(new PrintStream(poErr, true));
30+
31+
// Add a scrolling text area
32+
textArea.setEditable(false);
33+
textArea.setRows(10);
34+
textArea.setColumns(20);
35+
//textArea.setFont(new Font("SansSerif", Font.PLAIN, 8));
36+
/*textArea.setRows(5);
37+
textArea.setColumns(50);*/
38+
textArea.setLineWrap(true);
39+
40+
this.add(new JScrollPane(textArea), BorderLayout.CENTER);
41+
42+
// Create reader threads
43+
new ReaderThread(piOut).start();
44+
//new ReaderThread(piErr).start();
45+
setBorder(new TitledBorder(LineBorder.createGrayLineBorder(),"Console"));
46+
}
47+
48+
public void write(String str) {
49+
this.textArea.append(str+"\n");
50+
this.textArea.setCaretPosition(textArea.getDocument().getLength());
51+
}
52+
53+
class ReaderThread extends Thread {
54+
PipedInputStream pi;
55+
56+
ReaderThread(PipedInputStream pi) {
57+
this.pi = pi;
58+
}
59+
60+
public synchronized void run() {
61+
final byte[] buf = new byte[1024];
62+
try {
63+
while (true) {
64+
final int len = pi.read(buf);
65+
if (len == -1) {
66+
break;
67+
}
68+
SwingUtilities.invokeLater(new Runnable() {
69+
public void run() {
70+
textArea.append(new String(buf, 0, len));
71+
72+
// Make sure the last line is always visible
73+
textArea.setCaretPosition(textArea.getDocument().getLength());
74+
75+
// Keep the text area down to a certain character size
76+
/* int idealSize = 1000;
77+
int maxExcess = 500;
78+
int excess = textArea.getDocument().getLength() - idealSize;
79+
if (excess >= maxExcess) {
80+
textArea.replaceRange("", 0, excess);
81+
}*/
82+
}
83+
});
84+
}
85+
} catch (IOException e) {
86+
}
87+
}
88+
}
89+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
K 25
2+
svn:wc:ra_dav:version-url
3+
V 53
4+
/instru_geos/!svn/ver/2/jSeisCal/Console/Console.java
5+
END

DisplayChannel.java

+6-4
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ public DisplayChannel(DataChannel channel, int maxAge) {
102102
TimeSeriesCollection dataset = new TimeSeriesCollection();
103103
dataset.addSeries(this.chan);
104104

105-
domain.setAutoRange(true);
105+
//domain.setAutoRange(true);
106+
domain.setFixedAutoRange(30000);
106107

107108
range = new NumberAxis(channel.name);
108109
range.setAutoRange(true);
@@ -204,7 +205,8 @@ public void update(Observable arg0, Object arg1) {
204205
ms = ms - 300000;
205206
now2.setTime(ms);
206207
domain.setRange(now2, now);*/
207-
if (min<max) {
208+
range.setAutoRange(true);
209+
/*if (min<max) {
208210
if ((max>maxold) && (min<minold)) {
209211
maxold=max;
210212
minold=min;
@@ -222,10 +224,10 @@ public void update(Observable arg0, Object arg1) {
222224
range.setRange((double)minold, (double)(maxold));
223225
//System.out.println("range");
224226
}
225-
}
227+
} */
226228
}
227229
timer = (System.currentTimeMillis() - timer);
228-
System.out.println("ch : " + this.dc.name +" - timer : " + timer);
230+
//System.out.println("ch : " + this.dc.name +" - timer : " + timer);
229231

230232
}
231233

DisplayChannelPOS.java

+3-31
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,8 @@ public DisplayChannelPOS(DataChannel channel, int maxAge) {
154154
dataset.addSeries(chan);
155155
dataset.addSeries(mav);
156156

157-
domain.setAutoRange(true);
157+
//domain.setAutoRange(true);
158+
domain.setFixedAutoRange(30000);
158159

159160
range = new NumberAxis(channel.name);
160161
range.setAutoRange(true);
@@ -304,7 +305,7 @@ public void update(Observable arg0, Object arg1) {
304305

305306
chan.setNotify(false);
306307
mav.setNotify(false);
307-
if (offset > 0) {
308+
if (offset >= 0) {
308309
for (int k = 0; k < sr; k++) {
309310
ms = dc.times[offset + k];
310311
now.setTime(ms);
@@ -356,32 +357,6 @@ public void update(Observable arg0, Object arg1) {
356357

357358
}
358359

359-
// A finir !!
360-
/*domain.setAutoRange(false);
361-
Date now2 = new Date();
362-
ms = ms - 300000;
363-
now2.setTime(ms);
364-
domain.setRange(now2, now);*/
365-
if (min<max) {
366-
if ((max>maxold) && (min<minold)) {
367-
maxold=max;
368-
minold=min;
369-
range.setAutoRange(false);
370-
range.setRange((double)minold, (double)(maxold));
371-
//System.out.println("range");
372-
}else if (max>maxold) {
373-
maxold=max;
374-
range.setAutoRange(false);
375-
range.setRange((double)minold, (double)(maxold));
376-
//System.out.println("range");
377-
}else if (min<minold) {
378-
minold=min;
379-
range.setAutoRange(false);
380-
range.setRange((double)minold, (double)(maxold));
381-
//System.out.println("range");
382-
}
383-
}
384-
385360
int lenght = sr*10;
386361

387362
if (end > lenght) {
@@ -416,9 +391,6 @@ public void update(Observable arg0, Object arg1) {
416391
}
417392

418393
}
419-
//System.out.println("Max = " + maxi + " " + iMax + " - Min = " + mini + " " + iMin);
420-
421-
422394

423395
}
424396

META-INF/.svn/README.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
This is a Subversion working copy administrative directory.
2+
Visit http://subversion.tigris.org/ for more information.

META-INF/.svn/dir-wcprops

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
K 25
2+
svn:wc:ra_dav:version-url
3+
V 42
4+
/instru_geos/!svn/ver/19/jSeisCal/META-INF
5+
END

META-INF/.svn/empty-file

Whitespace-only changes.

META-INF/.svn/entries

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<wc-entries
3+
xmlns="svn:">
4+
<entry
5+
name=""
6+
repos="https://svn.ipgp.fr/instru_geos"
7+
revision="238"
8+
last-author="leroy"
9+
uuid="308c3184-852a-42d4-b679-f66096868c1e"
10+
url="https://svn.ipgp.fr/instru_geos/jSeisCal/META-INF"
11+
committed-rev="19"
12+
kind="dir"
13+
committed-date="2010-11-04T16:54:09.350805Z"/>
14+
<entry
15+
name="MANIFEST.MF"
16+
checksum="6e11a5a1f95142d33777b92b77c16f8a"
17+
last-author="leroy"
18+
text-time="2010-11-04T16:38:32.000000Z"
19+
committed-rev="19"
20+
kind="file"
21+
committed-date="2010-11-04T16:54:09.350000Z"/>
22+
</wc-entries>

META-INF/.svn/format

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Manifest-Version: 1.0
2+
Sealed: true
3+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
K 25
2+
svn:wc:ra_dav:version-url
3+
V 54
4+
/instru_geos/!svn/ver/19/jSeisCal/META-INF/MANIFEST.MF
5+
END

MetrozetClient.java

+2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public class MetrozetClient
3030
//clientSocket.setSoTimeout(500);
3131
//clientSocket.setSoLinger(false, 0);
3232
clientSocket.setKeepAlive(true);
33+
3334

3435
outToServer = new DataOutputStream(clientSocket.getOutputStream());
3536
sena = new SenaTCPListener(clientSocket, console);
@@ -53,6 +54,7 @@ public void stop() {
5354
public void send(String cmd) {
5455
command = cmd + "\r";
5556
if (clientSocket.isConnected()) {
57+
//if (clientSocket.isBound()) {
5658
try {
5759
outToServer.writeBytes(command);
5860
console.write(cmd);

SenaTCPListener.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,16 @@ public class SenaTCPListener implements Runnable {
2323
}
2424

2525
public void run() {
26-
while(true) {
26+
boolean cond=true;
27+
while(cond) {
2728
try {
2829
buffer = inFromServer.readLine();
2930
if (!buffer.startsWith("Ticks") && !buffer.startsWith("Seconds") && !buffer.equals("")) {
3031
System.out.println(buffer);
3132
console.write(buffer);
3233
}
3334
} catch (IOException e) {
35+
cond=false;
3436
// TODO Auto-generated catch block
3537
e.printStackTrace();
3638
}

TableBangs.java

-44
This file was deleted.

0 commit comments

Comments
 (0)