LOGIN   :::   RECOVER PASS   :::   GET ACCOUNT    
Browse
  • Projects
  • Code (CVS)
  • Forums
  • News
  • Articles
  • Polls
  •  
    OpenCores
  • FAQ
  • CVS HowTo
  • Mission
  • Media
  • Tools
  • Sponsors
  • Mirrors
  • Logos
  • Contact us
  •  
    Tools
  • Search
      
  • Download Cores (CVSGet)
  •  
    More
  • Wishbone
  • Perlilog
  • EDA tools
  • OpenTech CD
  •  
    Navigation: All forums > Cvs-checkins > Message List > Message Post

    Message

    Reply | Reply all
    Date Prev | Date Next | Thread Prev | Thread Next Date Index | Thread Index

    From: cvs at opencores.org<cvs@o...>
    Date: Thu May 22 18:29:11 CEST 2008
    Subject: [cvs-checkins] MODIFIED: jop ...
    Top
    Date: 00/08/05 22:18:29

    Modified: jop/java/target/src/app/oebb Flash.java Gps.java Logic.java
    Main.java State.java Strecke.java
    Log:
    BG V 2.07


    Revision Changes Path
    1.16 jop/java/target/src/app/oebb/Flash.java

    http://www.opencores.org/cvsweb.shtml/jop/java/target/src/app/oebb/Flash.java.diff?r1=1.15&r2=1.16

    (In the diff below, changes in quantity of whitespace are not shown.)

    Index: Flash.java
    ===================================================================
    RCS file: /cvsroot/martin/jop/java/target/src/app/oebb/Flash.java,v
    retrieving revision 1.15
    retrieving revision 1.16
    diff -u -b -r1.15 -r1.16
    --- Flash.java 19 Apr 2008 20:59:46 -0000 1.15
    +++ Flash.java 22 May 2008 16:29:11 -0000 1.16
    @@ -474,7 +474,7 @@
    * in ES mode!
    *
    */
    - static boolean esStr() {
    + static boolean esStrNotUsedAnymore() {

    int i, j, k;
    int txtPtr = -1;



    1.19 jop/java/target/src/app/oebb/Gps.java

    http://www.opencores.org/cvsweb.shtml/jop/java/target/src/app/oebb/Gps.java.diff?r1=1.18&r2=1.19

    (In the diff below, changes in quantity of whitespace are not shown.)

    Index: Gps.java
    ===================================================================
    RCS file: /cvsroot/martin/jop/java/target/src/app/oebb/Gps.java,v
    retrieving revision 1.18
    retrieving revision 1.19
    diff -u -b -r1.18 -r1.19
    --- Gps.java 25 Apr 2008 22:14:47 -0000 1.18
    +++ Gps.java 22 May 2008 16:29:11 -0000 1.19
    @@ -13,6 +13,8 @@
    import ejip.*;
    import joprt.*;

    +import com.jopdesign.io.IOFactory;
    +import com.jopdesign.io.SysDevice;
    import com.jopdesign.sys.Const;
    import com.jopdesign.sys.Native;

    @@ -119,6 +121,23 @@
    */
    static StringBuffer lastRMC;

    + /**
    + * Time as integer in format hhmmss
    + */
    + private static int gpsTime;
    + /**
    + * us timestamp of last GGA message
    + */
    + private static int gpsTimestamp;
    + /**
    + * Date as integer in format ddmmyy
    + */
    + private static int gpsDate;
    +
    + private static Object timMutex = new Object();
    +
    + private static SysDevice sys;
    +
    /**
    * private because it's a singleton Thread.
    */
    @@ -152,6 +171,8 @@

    ser = serPort;

    + sys = IOFactory.getFactory().getSysDevice();
    +
    //
    // start my own thread
    //
    @@ -347,6 +368,20 @@
    }
    }

    + // get date
    + for (i=51; i<=56; ++i) {
    + rxBuf[i] -= '0';
    + }
    + i = rxBuf[51] * 100000;
    + i += rxBuf[52] * 10000;
    + i += rxBuf[53] * 1000;
    + i += rxBuf[54] * 100; + i += rxBuf[55] * 10; + i += rxBuf[56]; + synchronized (timMutex) { + gpsDate = i; + } + knt = 0; for (i=0; i<5; ++i) { val = rxBuf[41+i]; @@ -380,14 +415,19 @@ */ private static void process() { + int i, j, lat, lon; + int tmpTS = sys.uscntTimer; + synchronized (lastGGA) { lastGGA.setLength(0); for (i=0; i<rxCnt; ++i) { lastGGA.append((char) rxBuf[i]); } } + + // text is for info and lern mode j = 0; for (i=14; i<23; ++i) { text[j++]=rxBuf[i]; @@ -397,6 +437,22 @@ text[j++]=rxBuf[i]; } + // get time + for (i=7; i<=12; ++i) { + rxBuf[i] -= '0'; + } + + i = rxBuf[7] * 100000; + i += rxBuf[8] * 10000; + i += rxBuf[9] * 1000; + i += rxBuf[10] * 100; + i += rxBuf[11] * 10; + i += rxBuf[12]; + synchronized (timMutex) { + gpsTime = i; + gpsTimestamp = tmpTS; + } + for (i=14; i<40; ++i) { rxBuf[i] -= '0'; } @@ -680,6 +736,37 @@ } + /** + * @return date in ddmmyy + */ + public static int getDate() { + + int i; + synchronized (timMutex) { + i = gpsDate; + } + return i; + } + + + /** + * TODO: time and date format could be in the message format time + * + * @return time in hhmmssmmm + */ + public static int getTime() { + + int off = sys.uscntTimer; + int i; + synchronized (timMutex) { + off -= gpsTimestamp; + i = gpsTime; + } + off /= 1000; // in ms + return i*100 + off; + } + + /* how to copy a char buffer to a packet buffer would be nice method for Packet 1.25 jop/java/target/src/app/oebb/Logic.java http://www.opencores.org/cvsweb.shtml/jop/java/target/src/app/oebb/Logic.java.diff?r1=1.24&r2=1.25 (In the diff below, changes in quantity of whitespace are not shown.) Index: Logic.java =================================================================== RCS file: /cvsroot/martin/jop/java/target/src/app/oebb/Logic.java,v retrieving revision 1.24 retrieving revision 1.25 diff -u -b -r1.24 -r1.25 --- Logic.java 21 May 2008 21:45:38 -0000 1.24 +++ Logic.java 22 May 2008 16:29:11 -0000 1.25 @@ -717,9 +717,11 @@ for (i=0; i<cnt; ++i) { if (nr==Flash.getStrNr(i)) { Flash.loadStr(nr); - if (Flash.getIp()==0) { - Flash.esStr(); - } + Flash.loadStrNames(nr, 0, 0); + +// if (Flash.getIp()==0) { +// Flash.esStr(); +// } break; } } @@ -1541,7 +1543,7 @@ // question: when shall be do the esStr()? // is it necessary to do esStr() on ES Strecken befor findStr()? synchronized(this) { - Flash.esStr(); +// Flash.esStr(); Main.state.setPos(-1); // disable till Gps finds the new Melnr for the // changed Strecke @@ -1593,18 +1595,16 @@ Flash.Point p = Flash.getPoint(melnr); for (;;) { + if (p.station && melnr>=Main.state.getPos()) { + break; + } i = Flash.getNext(melnr); - i = Flash.getNext(i); if (i!=-1) { melnr = i; - if (melnr>=Main.state.getPos()) { - p = Flash.getPoint(melnr); - break; - } } else { - i = 0; break; } + p = Flash.getPoint(melnr); } while (loop()) { @@ -1625,24 +1625,59 @@ return; } - // display only the left point text + // TODO: the following is almost a copy from HB select + // just use different flags + boolean found = false; if (val==Keyboard.UP) { + while (!found) { i = Flash.getNext(melnr); - i = Flash.getNext(i); if (i!=-1) { melnr = i; p = Flash.getPoint(melnr); + if (p.station) { + found = true; + } + } else { + break; + } } } if (val==Keyboard.DOWN) { + while (!found) { i = Flash.getPrev(melnr); - i = Flash.getPrev(i); if (i!=-1) { melnr = i; p = Flash.getPoint(melnr); + if (p.station) { + found = true; + } + } else { + break; } } + } + + +// that's the old ES select with ES strecke change +// // display only the left point text +// +// if (val==Keyboard.UP) { +// i = Flash.getNext(melnr); +// i = Flash.getNext(i); +// if (i!=-1) { +// melnr = i; +// p = Flash.getPoint(melnr); +// } +// } +// if (val==Keyboard.DOWN) { +// i = Flash.getPrev(melnr); +// i = Flash.getPrev(i); +// if (i!=-1) { +// melnr = i; +// p = Flash.getPoint(melnr); +// } +// } if (val==Keyboard.E) { // The left point is the station 1.30 jop/java/target/src/app/oebb/Main.java http://www.opencores.org/cvsweb.shtml/jop/java/target/src/app/oebb/Main.java.diff?r1=1.29&r2=1.30 (In the diff below, changes in quantity of whitespace are not shown.) Index: Main.java =================================================================== RCS file: /cvsroot/martin/jop/java/target/src/app/oebb/Main.java,v retrieving revision 1.29 retrieving revision 1.30 diff -u -b -r1.29 -r1.30 --- Main.java 21 May 2008 21:45:38 -0000 1.29 +++ Main.java 22 May 2008 16:29:11 -0000 1.30 @@ -62,7 +62,7 @@ // SW version public static final int VER_MAJ = 2; - public static final int VER_MIN = 6; + public static final int VER_MIN = 7; private static final int STRECKE_PRIO = 1; private static final int STRECKE_PERIOD = 100000; 1.9 jop/java/target/src/app/oebb/State.java http://www.opencores.org/cvsweb.shtml/jop/java/target/src/app/oebb/State.java.diff?r1=1.8&r2=1.9 (In the diff below, changes in quantity of whitespace are not shown.) Index: State.java =================================================================== RCS file: /cvsroot/martin/jop/java/target/src/app/oebb/State.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -b -r1.8 -r1.9 --- State.java 25 Apr 2008 22:14:47 -0000 1.8 +++ State.java 22 May 2008 16:29:11 -0000 1.9 @@ -160,7 +160,7 @@ public State(LinkLayer link) { ipLink = link; - setTimestamp(2001, 1, 1, 0, 0, 0, 1); +// setTimestamp(2001, 1, 1, 0, 0, 0, 1); sendTimer = Timer.getTimeoutSec(SEND_PERIOD); stat = new int[5]; @@ -192,20 +192,29 @@ arr[off + 11] = gpsLong; } - public void setTimestamp(int year, int month, int day, int hour, - int minute, int second, int milli) { - - date = (year << 16) + (month << 8) + day; - time = (hour << (32 - 6)) + (minute << (32 - 12)) - + (second << (32 - 18)) + (milli << 32 - 28); - } +// public void setTimestamp(int year, int month, int day, int hour, +// int minute, int second, int milli) { +// +// date = (year << 16) + (month << 8) + day; +// time = (hour << (32 - 6)) + (minute << (32 - 12)) +// + (second << (32 - 18)) + (milli << 32 - 28); +// } +// +// public void setTimestamp(int date, int time) { +// +// this.date = date; +// this.time = time; +// // increment millis +// this.time += (1 << 32 - 28); +// } - public void setTimestamp(int date, int time) { + void setTimestamp() { - this.date = date; - this.time = time; - // increment millis - this.time += (1 << 32 - 28); + int d = Gps.getDate(); + int t = Gps.getTime(); + date = (((d%100) + 2000) << 16) + ((d/100%100) << 8) + d/10000%100; + time = (t/10000000%100 << (32 - 6)) + (t/100000%100 << (32 - 12)) + + (t/1000%100 << (32 - 18)) + (t%1000 << 32 - 28); } static int cnt; @@ -221,10 +230,11 @@ } // TODO: workaround for first connect - if (!contactZLB) { - ++cnt; - setTimestamp(2001, 1, 1, 0, 0, 0, cnt); - } +// if (!contactZLB) { +// ++cnt; +// setTimestamp(2001, 1, 1, 0, 0, 0, cnt); +// } + setTimestamp(); setUDPData(p.buf, Udp.DATA); p.len = (Udp.DATA + 12) << 2; @@ -291,7 +301,7 @@ Status.connOk = true; // just now - use the ZLB time for our message timing - setTimestamp(date, time); +// setTimestamp(date, time); int[] buf = p.buf; // extract data @@ -442,8 +452,10 @@ */ private void printMsg(Packet p) { int[] buf = p.buf; - Dbg.wr("seconds="); - Dbg.intVal((p.buf[Udp.DATA+2]>>14) & 0x3f); + Dbg.wr("time="); + Dbg.intVal(Gps.getTime()); +// Dbg.wr("seconds="); +// Dbg.intVal((p.buf[Udp.DATA+2]>>14) & 0x3f); Dbg.wr("strnr="); Dbg.intVal(buf[Udp.DATA+3]>>>20); Dbg.wr("zugnr="); 1.6 jop/java/target/src/app/oebb/Strecke.java http://www.opencores.org/cvsweb.shtml/jop/java/target/src/app/oebb/Strecke.java.diff?r1=1.5&r2=1.6 (In the diff below, changes in quantity of whitespace are not shown.) Index: Strecke.java =================================================================== RCS file: /cvsroot/martin/jop/java/target/src/app/oebb/Strecke.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -b -r1.5 -r1.6 --- Strecke.java 13 Mar 2008 17:25:19 -0000 1.5 +++ Strecke.java 22 May 2008 16:29:11 -0000 1.6 @@ -64,9 +64,11 @@ continue; } Flash.loadStr(nr); - if (Flash.getIp()==0) { - Flash.esStr(); - } + Flash.loadStrNames(nr, 0, 0); +// we changed ES mode to be like Hilsbetrieb +// if (Flash.getIp()==0) { +// Flash.esStr(); +// } Dbg.intVal(nr); @@ -100,9 +102,11 @@ if (foundCnt==1) { nr = Flash.getStrNr(foundIdx); Flash.loadStr(nr); - if (Flash.getIp()==0) { - Flash.esStr(); - } + Flash.loadStrNames(nr, 0, 0); + +// if (Flash.getIp()==0) { +// Flash.esStr(); +// } Dbg.wr("found: "); Dbg.intVal(nr); Dbg.wr("\n");

     
    Copyright (c) 1999 OPENCORES.ORG. All rights reserved.