Ignore:
Timestamp:
2014-01-19T14:52:39+01:00 (11 years ago)
Author:
malcolmh
Message:

new model structure

File:
1 edited

Legend:

Unmodified
Added
Removed
  • applications/editors/josm/plugins/smed2/src/s57/S57dat.java

    r30190 r30215  
    100100        private static ArrayList<S57subf> S57ddsc = new ArrayList<S57subf>(Arrays.asList(S57subf.ATLB, S57subf.ASET, S57subf.AUTH ));
    101101        private static ArrayList<S57subf> S57frid = new ArrayList<S57subf>(Arrays.asList(S57subf.RCNM, S57subf.RCID, S57subf.PRIM, S57subf.GRUP, S57subf.OBJL, S57subf.RVER, S57subf.RUIN ));
    102         private static ArrayList<S57subf> S57foid = new ArrayList<S57subf>(Arrays.asList(S57subf.AGEN, S57subf.FIDN, S57subf.FIDS ));
     102//      private static ArrayList<S57subf> S57foid = new ArrayList<S57subf>(Arrays.asList(S57subf.AGEN, S57subf.FIDN, S57subf.FIDS ));
     103        private static ArrayList<S57subf> S57foid = new ArrayList<S57subf>(Arrays.asList(S57subf.LNAM));
    103104        private static ArrayList<S57subf> S57attf = new ArrayList<S57subf>(Arrays.asList(S57subf.ATTL, S57subf.ATVL ));
    104105        private static ArrayList<S57subf> S57natf = new ArrayList<S57subf>(Arrays.asList(S57subf.ATTL, S57subf.ATVL ));
     
    140141        public static int rnum;
    141142       
    142         public static void setField(byte[] buf, int off, S57field fld, int len) {
    143                 buffer = buf;
    144                 offset = off;
    145                 maxoff = off + len - 1;
    146                 field = fld;
    147                 index = 0;
    148         }
    149        
    150         public static boolean more() {
    151                 return (offset < maxoff);
    152         }
    153        
    154         public static Object getSubf(byte[] buf, int off, S57field fld, S57subf subf) {
    155                 buffer = buf;
    156                 offset = off;
    157                 index = 0;
    158                 return getSubf(fld, subf);
    159         }
    160        
    161         public static Object getSubf(S57field fld, S57subf subf) {
    162                 field = fld;
    163                 index = 0;
    164                 return getSubf(subf);
    165         }
    166 
    167143        private static S57conv findSubf(S57subf subf) {
    168144                ArrayList<S57subf> subs = fields.get(field);
     
    188164        }
    189165       
     166        public static void setField(byte[] buf, int off, S57field fld, int len) {
     167                buffer = buf;
     168                offset = off;
     169                maxoff = off + len - 1;
     170                field = fld;
     171                index = 0;
     172        }
     173       
     174        public static boolean more() {
     175                return ((offset < maxoff) && (buffer[offset+1] != 0x1e));
     176        }
     177       
     178        public static Object getSubf(byte[] buf, int off, S57field fld, S57subf subf) {
     179                buffer = buf;
     180                offset = off;
     181                index = 0;
     182                return getSubf(fld, subf);
     183        }
     184       
     185        public static Object getSubf(S57field fld, S57subf subf) {
     186                field = fld;
     187                index = 0;
     188                return getSubf(subf);
     189        }
     190
    190191        public static Object getSubf(S57subf subf) {
    191192                S57conv conv = findSubf(subf);
     
    194195                        if (conv.asc == 0) {
    195196                                while (buffer[offset] != 0x1f) {
    196                                         str += buffer[offset++];
    197                                 }
     197                                        str += (char)(buffer[offset++]);
     198                                }
     199                                offset++;
    198200                        } else {
    199201                                str = new String(buffer, offset, conv.asc);
Note: See TracChangeset for help on using the changeset viewer.