Changeset 1098

Show
Ignore:
Timestamp:
07/15/09 13:37:20 (4 years ago)
Author:
buleth
Message:

initial import

Location:
trunk/mpdb-iphone/mpdb-iphone/Classes
Files:
8 modified

Legend:

Unmodified
Added
Removed
  • trunk/mpdb-iphone/mpdb-iphone/Classes/MapController.m

    r1097 r1098  
    111111        //before making a pin, make sure the annotation does not have the same lat and long a sample 
    112112        //if it does, move the pin slightly 
    113 /*      for(int w=0; w<[mySamples count]; w++) 
     113        for(int w=0; w<[mySamples count]; w++) 
    114114        { 
    115115                uniqueSamples *tempSample= [mySamples objectAtIndex:w]; 
    116                 if((tempSample.coordinate.latitude == maxLat)) 
    117                 { 
    118                         if(coord.latitude >= 0) 
    119                         { 
    120                                 coord.latitude+= .001; 
    121                         } 
    122                         else 
    123                         { 
    124                                 coord.latitude -= .001; 
    125                         } 
    126                         if(coord.longitude > 0) 
    127                         { 
    128                                 coord.longitude+= .001; 
    129                         } 
    130                         else 
    131                         { 
    132                                 coord.longitude-=.001; 
    133                         } 
    134                         annotation.coordinate= coord; 
    135                         break; 
    136                 } 
    137         }*/ 
    138          
    139         for(int z=0; z< 4; z++) 
     116                if(tempSample.coordinate.latitude == maxLat) 
     117                { 
     118                        maxLat+= .0001; 
     119                } 
     120                if(tempSample.coordinate.latitude== minLat) 
     121                { 
     122                        minLat-=.0001; 
     123                } 
     124                if(tempSample.coordinate.longitude== maxLong) 
     125                { 
     126                        maxLong+= .0001; 
     127                } 
     128                if(tempSample.coordinate.longitude == minLong) 
     129                { 
     130                        minLong-= .0001; 
     131                } 
     132        } 
     133                for(int z=0; z< 4; z++) 
    140134        { 
    141135                uniqueSamples *newGroup=[uniqueSamples new]; 
     
    240234         
    241235        SearchCriteriaController *viewController= [[SearchCriteriaController alloc] initWithNibName:@"SearchCriteriaSummary" bundle:nil]; 
    242         [viewController setData:originalData:mySamples:mapType]; 
     236        [viewController setData:originalData:mySamples:mapType:points]; 
    243237        [viewController setCurrentSearchData:currentRockTypes :currentMinerals :currentMetamorphicGrades :currentPublicStatus:region:myLocation]; 
    244238        self.criteriaController=viewController; 
  • trunk/mpdb-iphone/mpdb-iphone/Classes/MetamorphicGradeController.m

    r1097 r1098  
    4141{ 
    4242        SearchCriteriaController *viewController= [[SearchCriteriaController alloc] initWithNibName:@"SearchCriteriaSummary" bundle:nil]; 
    43         [viewController setData:original:modifiedLocations:mapType]; 
     43        [viewController setData:original:modifiedLocations:mapType:points]; 
    4444        [viewController setCurrentSearchData:currentRockTypes :currentMinerals :currentMetamorphicGrades :currentPublicStatus:region:myCoordinate]; 
    4545        self.criteriaController=viewController; 
     
    167167        gradeName= [myMetamorphicGrades objectAtIndex:row]; 
    168168} 
    169 -(void)setData:(NSMutableArray*)originalData: (NSMutableArray*)locations:(NSString*)type 
     169-(void)setData:(NSMutableArray*)originalData: (NSMutableArray*)locations:(NSString*)type:(NSMutableArray*)LatLongPoints 
    170170{ 
    171171        mapType=type; 
    172172        original=originalData; 
    173173        mylocations=locations; 
     174        points=LatLongPoints; 
    174175        bool added; 
    175176        int x, y, z, w; 
  • trunk/mpdb-iphone/mpdb-iphone/Classes/MineralsController.m

    r1097 r1098  
    6464{ 
    6565        SearchCriteriaController *viewController= [[SearchCriteriaController alloc] initWithNibName:@"SearchCriteriaSummary" bundle:nil]; 
    66         [viewController setData:original:modifiedLocations:mapType]; 
     66        [viewController setData:original:modifiedLocations:mapType:points]; 
    6767        [viewController setCurrentSearchData:currentRockTypes :currentMinerals :currentMetamorphicGrades :currentPublicStatus:region:myCoordinate]; 
    6868        self.criteriaController=viewController; 
     
    175175} 
    176176 
    177 -(void)setData:(NSMutableArray*)originalData: (NSMutableArray*)locations:(NSString*)type 
     177-(void)setData:(NSMutableArray*)originalData: (NSMutableArray*)locations:(NSString*)type:(NSMutableArray*)LatLongPoints 
    178178{ 
    179179        mapType=type; 
    180180        original=originalData; //pass the array with the original search results so the map can be reset 
    181181        myLocations=locations; 
     182        points= LatLongPoints; 
    182183 
    183184        //create an array containing the minerals that are in the remaining samples after some search criteria have been provided 
  • trunk/mpdb-iphone/mpdb-iphone/Classes/PublicStatusController.m

    r1097 r1098  
    3131{ 
    3232        SearchCriteriaController *viewController= [[SearchCriteriaController alloc] initWithNibName:@"SearchCriteriaSummary" bundle:nil]; 
    33         [viewController setData:original:modifiedLocations:mapType]; 
     33        [viewController setData:original:modifiedLocations:mapType:points]; 
    3434        [viewController setCurrentSearchData:currentRockTypes :currentMinerals :currentMetamorphicGrades :currentPublicStatus:region:myCoordinate]; 
    3535        self.criteriaController=viewController; 
     
    150150//the only array that needs to be passed is the one containing all the pin annotations since the  
    151151//public status string is a member of the annotation class 
    152 -(void)setData:(NSMutableArray*)originalData:(NSMutableArray*)locations:(NSString*)type 
     152-(void)setData:(NSMutableArray*)originalData:(NSMutableArray*)locations:(NSString*)type:(NSMutableArray*)LatLongPoints 
    153153{ 
    154154        mapType=type; 
     155        points=LatLongPoints; 
    155156        original=originalData; //we must pass the original search results so the map can be reset to its original values 
    156157        myLocations=locations; 
  • trunk/mpdb-iphone/mpdb-iphone/Classes/RockTypeController.m

    r1097 r1098  
    5555{ 
    5656        SearchCriteriaController *viewController= [[SearchCriteriaController alloc] initWithNibName:@"SearchCriteriaSummary" bundle:nil]; 
    57         [viewController setData:original:modifiedLocations:mapType]; 
     57        [viewController setData:original:modifiedLocations:mapType:points]; 
    5858        [viewController setCurrentSearchData:currentRockTypes :currentMinerals :currentMetamorphicGrades :currentPublicStatus:region:myCoordinate]; 
    5959        self.criteriaController=viewController; 
     
    160160//if the sample has the correct rock type, add it to the new array 
    161161//[modifiedLocations addObject:[myLocations objectAtIndex:x]]; 
    162 -(void)setData:(NSMutableArray*) originalData:(NSMutableArray*)locations:(NSString*)type 
     162-(void)setData:(NSMutableArray*) originalData:(NSMutableArray*)locations:(NSString*)type:(NSMutableArray*)LatLongPoints 
    163163{ 
    164164        mapType=type; 
     
    166166        myLocations=locations; 
    167167        myRockTypes=[[NSMutableArray alloc] init]; 
     168        points=LatLongPoints; 
    168169         
    169170        //initially add a blank line so the user is forced to move the scroll wheel 
  • trunk/mpdb-iphone/mpdb-iphone/Classes/SearchCriteriaController.m

    r1097 r1098  
    446446        //load the table containing the choices for search criteria so the user can add more 
    447447        TableController *viewController = [[TableController alloc] initWithNibName:@"TableView" bundle:nil]; 
    448         [viewController setData:original:remainingLocations:mapType]; 
     448        [viewController setData:original:remainingLocations:mapType:points]; 
    449449        [viewController setCurrentSearchData:currentRockTypes :currentMinerals :currentMetamorphicGrades :currentPublicStatus:region:myCoordinate]; 
    450450         self.tableController = viewController; 
     
    564564//this is the data of the annotations from the original search result and the current annotations that are left 
    565565//this information needs to be passed to the table controller where more search criteria can be added 
    566 -(void)setData:(NSMutableArray*)originalData:(NSMutableArray*)sampleLocations:(NSString*)type 
     566-(void)setData:(NSMutableArray*)originalData:(NSMutableArray*)sampleLocations:(NSString*)type:(NSMutableArray*)LatLongPoints 
    567567{ 
    568568        mapType=type; 
    569569        original=originalData; 
    570570        remainingLocations= sampleLocations; 
     571        points= LatLongPoints; 
     572         
    571573} 
    572574 
  • trunk/mpdb-iphone/mpdb-iphone/Classes/SingleImageView.m

    r1097 r1098  
    2424        [imageView setUserInteractionEnabled:YES]; 
    2525        //make a toolbar at the bottom of the view 
    26         NSMutableArray *buttons=[[NSMutableArray alloc] init]; 
     26        /*NSMutableArray *buttons=[[NSMutableArray alloc] init]; 
    2727        UIBarButtonItem *barButton=[[UIBarButtonItem alloc] initWithTitle:@"Add Image To My Library" style:UIBarButtonItemStyleBordered target:self action:@selector(addToLibrary)]; 
    2828        [buttons addObject:barButton]; 
     
    3131        toolbar.frame = toolBarFrame; 
    3232        toolbar.items=buttons;   
    33         [toolbar setBarStyle:1]; 
     33        [toolbar setBarStyle:1];*/ 
    3434        //CGRect rect= CGRectMake(0, 0, imageView.frame.size.width, imageView.frame.size.height); 
    3535        //scrollView.frame=rect;//[[UIScreen mainScreen] applicationFrame];  
  • trunk/mpdb-iphone/mpdb-iphone/Classes/TableController.m

    r1097 r1098  
    9393 
    9494        MetamorphicGradeController *viewController=[[MetamorphicGradeController alloc] initWithNibName:@"MetamorphicGradeView" bundle:nil]; 
    95         [viewController setData:original:locations:mapType]; 
     95        [viewController setData:original:locations:mapType:points]; 
    9696        [viewController setCurrentSearchData:currentRockTypes :currentMinerals :currentMetamorphicGrades :currentPublicStatus:region:myCoordinate]; 
    9797        self.metamorphicGradeController= viewController; 
     
    106106                RockTypeController *viewController = [[RockTypeController alloc] initWithNibName:@"RockTypeView" bundle:nil]; 
    107107        //all of the following values must be passed so they can be passed back to the map straight from the rock view 
    108         [viewController setData:original:locations:mapType]; 
     108        [viewController setData:original:locations:mapType:points]; 
    109109        [viewController setCurrentSearchData:currentRockTypes :currentMinerals :currentMetamorphicGrades :currentPublicStatus:region:myCoordinate]; 
    110110                self.rockTypeController = viewController; 
     
    117117{ 
    118118        PublicStatusController *viewController = [[PublicStatusController alloc] initWithNibName:@"PublicStatusView" bundle:nil]; 
    119         [viewController setData:original:locations:mapType]; 
     119        [viewController setData:original:locations:mapType:points]; 
    120120        [viewController setCurrentSearchData:currentRockTypes :currentMinerals :currentMetamorphicGrades :currentPublicStatus:region:myCoordinate]; 
    121121        self.publicStatusController=viewController; 
     
    211211 
    212212//set the various arrays in this controller with the information about the samples 
    213 -(void)setData:(NSMutableArray*)originalData:(NSMutableArray*)sampleLocations:(NSString*)type 
     213-(void)setData:(NSMutableArray*)originalData:(NSMutableArray*)sampleLocations:(NSString*)type:(NSMutableArray*)LatLongPoints 
    214214{ 
    215215        original=originalData; 
    216216        locations= sampleLocations; 
    217217        mapType=type; 
     218        points=LatLongPoints; 
    218219} 
    219220-(void)setCurrentSearchData:(NSMutableArray*)rocks:(NSMutableArray*)mins:(NSMutableArray*)metgrades:(NSMutableArray*)public:(NSString*)aregion:(CLLocationCoordinate2D)coord