RE: Bad Mapping Exceptions

Hi Bill,

You said to only construct ScalarMaps to DisplayRealTypes in one spatial
DisplayTupleType. I'm confused what this means since when I setup my
array of mappings passed to setMaps(), I only have 1 DisplayRealType
("mapTo") that the RealType ("mapFrom") gets mapped to. When you say not
to mix Display.XAxis with Display.Latitude, are you saying that both
XAxis and Latitude should not be a "mapTo" field in the same cell? What
do you mean by 1 spatial DisplayTupleType?


public void setCellMapping(int width, int height) throws VisADException,
RemoteException {
          int fields = theJgapAPI.field_count;            //used as arg
to getMappingForCell()
          int cell_number = (width + (4 * height));             //used
as arg to getMappingForCell()           
          ScalarMap[] theMaps = new ScalarMap[fields];   //array that
will be passed into setMaps()   
        Data[] myData = mySS.DisplayCells[width][height].getData();  
        Vector myVector = new Vector(theJgapAPI.field_count); //capacity
= 10 because there are 10 input fields in small.v5d
        int useless = DataUtility.getScalarTypes(myData, myVector,
false, true);  //will setup the myVector structure holding input fields
scalar types            
        for (int i = 0; i < fields; i++) {              
                int assignment
theJgapAPI.getMappingForCell(cell_number, i);
                DisplayRealType mapTo = mappings[assignment];
                RealType mapFrom = (RealType) myVector.get(i);

                theMaps[i] = new ScalarMap(mapFrom, mapTo);
}
                mySS.DisplayCells[width][height].setMaps(theMaps);

 }
                                
Thanks,
Michelle


Michelle Kam           (408) 742-2881
Lockheed Martin Space Systems Co. SSM/ATC/MSIS
B/153 O/L922 
1111 Lockheed Martin Way, Sunnyvale, CA 94089




-----Original Message-----
From: Bill Hibbard [mailto:billh@xxxxxxxxxxxxx]
Sent: Wednesday, July 09, 2003 11:51 AM
To: Kam, Michelle C
Subject: Re: Bad Mapping Exceptions


Hi Michelle,

> I'm trying to determine when the BadMappingExceptions occur before
they
> are thrown and then displayed in the spreadsheet. In the constructor
of
> ShadowRealTupleType.java, I'm trying to decipher why ("mapped to
> multiple" + " spatial DisplayTupleType-s: " + "ShadowRealTupleType")
is
> thrown. And why "mapped to multiple" +" spatial DisplayTupleType-s " +
> "(through CoordinateSystem.Reference): " + ShadowRealTupleType") is
also
> thrown. Would it be possible to detect these before throwing the
> exception and with only knowledge of the ScalarMaps?

Yes, make sure you only construct ScalarMaps to DisplayRealTypes
in one spatial DisplayTupleType. That is, for example, don't mix
Display.XAxis with Display.Latitude or DisplayCylRadius.

Good luck,
Bill


  • 2003 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the visad archives: