Skip to content

Commit

Permalink
add sub-labs to data structures
Browse files Browse the repository at this point in the history
and verify lab information
  • Loading branch information
cdzombak committed Feb 12, 2012
1 parent f4e3725 commit f1775b4
Show file tree
Hide file tree
Showing 3 changed files with 60 additions and 43 deletions.
86 changes: 49 additions & 37 deletions CAENLabStatus/DZCDataController.m
Original file line number Diff line number Diff line change
Expand Up @@ -230,47 +230,59 @@ - (NSSet *)labs
// based on view-source:http://labwatch.engin.umich.edu/labs/mobile.php
// and http://www.engin.umich.edu/caen/computers/search/alllabs.html

// Chrysler 273 (ELC) is not supported by the hostinfo API.
// http://www.engin.umich.edu/caen/computers/search/roomDetail/124

// I hate everything.

if (!_labs) {
_labs = [NSSet setWithObjects:
[[DZCLab alloc] initWithBuilding:@"PIERPONT" room:@"B505" humanName:@"Pierpont B505" hostCount:[NSNumber numberWithInt:26]],
[[DZCLab alloc] initWithBuilding:@"PIERPONT" room:@"B507" humanName:@"Pierpont B507" hostCount:[NSNumber numberWithInt:26]],
[[DZCLab alloc] initWithBuilding:@"PIERPONT" room:@"B521" humanName:@"Pierpont B521" hostCount:[NSNumber numberWithInt:22]],
[[DZCLab alloc] initWithBuilding:@"CSE" room:@"1695" humanName:@"CSE 1695" hostCount:[NSNumber numberWithInt:49]],
[[DZCLab alloc] initWithBuilding:@"CSE" room:@"1620" humanName:@"CSE 1620" hostCount:[NSNumber numberWithInt:43]],
[[DZCLab alloc] initWithBuilding:@"EECS" room:@"1230" humanName:@"EECS 1230" hostCount:[NSNumber numberWithInt:28]],
[[DZCLab alloc] initWithBuilding:@"EECS" room:@"2331" humanName:@"EECS 2331" hostCount:[NSNumber numberWithInt:19]],
[[DZCLab alloc] initWithBuilding:@"EECS" room:@"4440" humanName:@"EECS 4440" hostCount:[NSNumber numberWithInt:22]],
[[DZCLab alloc] initWithBuilding:@"GGBL" room:@"2304" humanName:@"GGBL 2304" hostCount:[NSNumber numberWithInt:19]],
[[DZCLab alloc] initWithBuilding:@"GGBL" room:@"2505" humanName:@"GGBL 2505" hostCount:[NSNumber numberWithInt:30]],
[[DZCLab alloc] initWithBuilding:@"IOE" room:@"G610" humanName:@"IOE G610" hostCount:[NSNumber numberWithInt:25]],
[[DZCLab alloc] initWithBuilding:@"COOLEY" room:@"1934" humanName:@"Cooley 1934" hostCount:[NSNumber numberWithInt:12]],
[[DZCLab alloc] initWithBuilding:@"FXB" room:@"B085" humanName:@"FXB B085" hostCount:[NSNumber numberWithInt:24]],
[[DZCLab alloc] initWithBuilding:@"LBME" room:@"1310" humanName:@"LBME 1310" hostCount:[NSNumber numberWithInt:25]],
[[DZCLab alloc] initWithBuilding:@"GFL" room:@"224" humanName:@"GFL/EPB 224" hostCount:[NSNumber numberWithInt:44]],
[[DZCLab alloc] initWithBuilding:@"NAME" room:@"134" humanName:@"NAME 134" hostCount:[NSNumber numberWithInt:20]],
[[DZCLab alloc] initWithBuilding:@"SRB" room:@"2230" humanName:@"SRB 2230" hostCount:[NSNumber numberWithInt:27]],
/*[[DZCLab alloc] initWithBuilding:@"DC" room:@"2E" humanName:@"Duderstadt 2E"],
[[DZCLab alloc] initWithBuilding:@"DC" room:@"2S" humanName:@"Duderstadt 2S"],
[[DZCLab alloc] initWithBuilding:@"DC" room:@"2SW" humanName:@"Duderstadt 2SW"],
[[DZCLab alloc] initWithBuilding:@"DC" room:@"3E" humanName:@"Duderstadt 3E"],
[[DZCLab alloc] initWithBuilding:@"DC" room:@"3EA" humanName:@"Duderstadt 3EA"],
[[DZCLab alloc] initWithBuilding:@"DC" room:@"3NE" humanName:@"Duderstadt 3NE"],
[[DZCLab alloc] initWithBuilding:@"DC" room:@"3S" humanName:@"Duderstadt 3S"],
[[DZCLab alloc] initWithBuilding:@"DC" room:@"3SW" humanName:@"Duderstadt 3SW"],
[[DZCLab alloc] initWithBuilding:@"DC" room:@"3WA" humanName:@"Duderstadt 3W"],
[[DZCLab alloc] initWithBuilding:@"DC" room:@"LLE" humanName:@"Duderstadt LLE"],
[[DZCLab alloc] initWithBuilding:@"DC" room:@"LLC" humanName:@"Duderstadt LLC"],*/
[[DZCLab alloc] initWithBuilding:@"DC" room:@"" humanName:@"Duderstadt Center (All)" hostCount:[NSNumber numberWithInt:345]],
[[DZCLab alloc] initWithBuilding:@"AH" room:@"" humanName:@"Angell Hall (Fishbowl)" hostCount:[NSNumber numberWithInt:20]],
// [[DZCLab alloc] initWithBuilding:@"RAC" room:@"108" humanName:@"???"], // no idea where this is
[[DZCLab alloc] initWithBuilding:@"SEB" room:@"3010" humanName:@"School of Ed 3010" hostCount:[NSNumber numberWithInt:12]],
[[DZCLab alloc] initWithBuilding:@"SHAPIRO" room:@"2054C" humanName:@"Ugli 2054C" hostCount:[NSNumber numberWithInt:10]],
[[DZCLab alloc] initWithBuilding:@"SHAPIRO" room:@"B100" humanName:@"Ugli Basement" hostCount:[NSNumber numberWithInt:24]],
[[DZCLab alloc] initWithBuilding:@"BAITS_COMAN" room:@"" humanName:@"Baits Coman (all)" hostCount:[NSNumber numberWithInt:4]], // rooms: 2300, 1000, 1209
[[DZCLab alloc] initWithBuilding:@"BURSLEY" room:@"2506" humanName:@"Bursley 2506" hostCount:[NSNumber numberWithInt:8]],
[[DZCLab alloc] initWithBuilding:@"MO-JO" room:@"163" humanName:@"MoJo 163" hostCount:[NSNumber numberWithInt:3]],
[[DZCLab alloc] initWithBuilding:@"PIERPONT" room:@"B505" humanName:@"Pierpont B505" hostCount:[NSNumber numberWithInt:26] subLabs:nil],
[[DZCLab alloc] initWithBuilding:@"PIERPONT" room:@"B507" humanName:@"Pierpont B507" hostCount:[NSNumber numberWithInt:26] subLabs:nil],
[[DZCLab alloc] initWithBuilding:@"PIERPONT" room:@"B521" humanName:@"Pierpont B521" hostCount:[NSNumber numberWithInt:22] subLabs:nil],
[[DZCLab alloc] initWithBuilding:@"CSE" room:@"1695" humanName:@"CSE 1695" hostCount:[NSNumber numberWithInt:49] subLabs:nil],
[[DZCLab alloc] initWithBuilding:@"CSE" room:@"1620" humanName:@"CSE 1620" hostCount:[NSNumber numberWithInt:43] subLabs:nil],
[[DZCLab alloc] initWithBuilding:@"EECS" room:@"1230" humanName:@"EECS 1230" hostCount:[NSNumber numberWithInt:28] subLabs:nil],
[[DZCLab alloc] initWithBuilding:@"EECS" room:@"2331" humanName:@"EECS 2331" hostCount:[NSNumber numberWithInt:19] subLabs:nil],
[[DZCLab alloc] initWithBuilding:@"EECS" room:@"4440" humanName:@"EECS 4440" hostCount:[NSNumber numberWithInt:22] subLabs:nil],
[[DZCLab alloc] initWithBuilding:@"GGBL" room:@"2304" humanName:@"GGBL 2304" hostCount:[NSNumber numberWithInt:19] subLabs:nil],
[[DZCLab alloc] initWithBuilding:@"GGBL" room:@"2505" humanName:@"GGBL 2505" hostCount:[NSNumber numberWithInt:30] subLabs:nil],
[[DZCLab alloc] initWithBuilding:@"IOE" room:@"G610" humanName:@"IOE G610" hostCount:[NSNumber numberWithInt:25] subLabs:nil],
[[DZCLab alloc] initWithBuilding:@"COOLEY" room:@"1934" humanName:@"Cooley 1934" hostCount:[NSNumber numberWithInt:12] subLabs:nil],
[[DZCLab alloc] initWithBuilding:@"FXB" room:@"B085" humanName:@"FXB B085" hostCount:[NSNumber numberWithInt:24] subLabs:nil],
[[DZCLab alloc] initWithBuilding:@"LBME" room:@"1310" humanName:@"LBME 1310" hostCount:[NSNumber numberWithInt:25] subLabs:nil],
[[DZCLab alloc] initWithBuilding:@"GFL" room:@"224" humanName:@"GFL/EPB 224" hostCount:[NSNumber numberWithInt:44] subLabs:nil],
[[DZCLab alloc] initWithBuilding:@"NAME" room:@"134" humanName:@"NAME 134" hostCount:[NSNumber numberWithInt:20] subLabs:nil],
[[DZCLab alloc] initWithBuilding:@"SRB" room:@"2230" humanName:@"SRB 2230" hostCount:[NSNumber numberWithInt:27] subLabs:nil],
[[DZCLab alloc] initWithBuilding:@"AH" room:@"" humanName:@"Angell Hall (Fishbowl)" hostCount:[NSNumber numberWithInt:20] subLabs:nil],
[[DZCLab alloc] initWithBuilding:@"RAC" room:@"108" humanName:@"Ross Academic Ctr 108" hostCount:[NSNumber numberWithInt:3] subLabs:nil],
[[DZCLab alloc] initWithBuilding:@"SEB" room:@"3010" humanName:@"School of Ed 3010" hostCount:[NSNumber numberWithInt:12] subLabs:nil],
[[DZCLab alloc] initWithBuilding:@"SHAPIRO" room:@"2054C" humanName:@"Ugli 2054C" hostCount:[NSNumber numberWithInt:10] subLabs:nil],
[[DZCLab alloc] initWithBuilding:@"SHAPIRO" room:@"B100" humanName:@"Ugli Basement" hostCount:[NSNumber numberWithInt:24] subLabs:nil],
[[DZCLab alloc] initWithBuilding:@"BURSLEY" room:@"2506" humanName:@"Bursley 2506" hostCount:[NSNumber numberWithInt:8] subLabs:nil],
[[DZCLab alloc] initWithBuilding:@"MO-JO" room:@"163" humanName:@"MoJo 163" hostCount:[NSNumber numberWithInt:3] subLabs:nil],
[[DZCLab alloc] initWithBuilding:@"BAITS_COMAN" room:@"" humanName:@"Baits (all)" hostCount:[NSNumber numberWithInt:4]
subLabs:[NSSet setWithObjects:
[[DZCLab alloc] initWithBuilding:@"BAITS_COMAN" room:@"2300" humanName:@"Baits I 2300" hostCount:[NSNumber numberWithInt:1] subLabs:nil],
[[DZCLab alloc] initWithBuilding:@"BAITS_COMAN" room:@"1000" humanName:@"Baits II 1000" hostCount:[NSNumber numberWithInt:2] subLabs:nil],
[[DZCLab alloc] initWithBuilding:@"BAITS_COMAN" room:@"1209" humanName:@"Baits II 1209" hostCount:[NSNumber numberWithInt:1] subLabs:nil],
nil]
],
[[DZCLab alloc] initWithBuilding:@"DC" room:@"" humanName:@"Duderstadt Center (All)" hostCount:[NSNumber numberWithInt:345]
subLabs:[NSSet setWithObjects:
[[DZCLab alloc] initWithBuilding:@"DC" room:@"2E" humanName:@"2nd Floor East" hostCount:[NSNumber numberWithInt:12] subLabs:nil],
[[DZCLab alloc] initWithBuilding:@"DC" room:@"2S" humanName:@"2nd Floor South" hostCount:[NSNumber numberWithInt:20] subLabs:nil],
[[DZCLab alloc] initWithBuilding:@"DC" room:@"2SW" humanName:@"2nd Floor SW" hostCount:[NSNumber numberWithInt:29] subLabs:nil],
[[DZCLab alloc] initWithBuilding:@"DC" room:@"3E" humanName:@"3rd Floor East" hostCount:[NSNumber numberWithInt:25] subLabs:nil],
[[DZCLab alloc] initWithBuilding:@"DC" room:@"3EA" humanName:@"3rd Floor East Alcove" hostCount:[NSNumber numberWithInt:22] subLabs:nil],
[[DZCLab alloc] initWithBuilding:@"DC" room:@"3NE" humanName:@"3rd Floor NE" hostCount:[NSNumber numberWithInt:90] subLabs:nil],
[[DZCLab alloc] initWithBuilding:@"DC" room:@"3S" humanName:@"3rd Floor South" hostCount:[NSNumber numberWithInt:24] subLabs:nil],
[[DZCLab alloc] initWithBuilding:@"DC" room:@"3SW" humanName:@"3rd Floor SW" hostCount:[NSNumber numberWithInt:90] subLabs:nil],
[[DZCLab alloc] initWithBuilding:@"DC" room:@"3WA" humanName:@"3rd Floor West Alcove" hostCount:[NSNumber numberWithInt:25] subLabs:nil],
[[DZCLab alloc] initWithBuilding:@"DC" room:@"LLE" humanName:@"Lower Level East" hostCount:[NSNumber numberWithInt:12] subLabs:nil],
[[DZCLab alloc] initWithBuilding:@"DC" room:@"LLC" humanName:@"Lower Level Center" hostCount:[NSNumber numberWithInt:12] subLabs:nil],
nil]
],
nil];
}
return _labs;
Expand Down
3 changes: 2 additions & 1 deletion CAENLabStatus/DZCLab.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@
@property (nonatomic, readonly, copy) NSString *room;
@property (nonatomic, readonly, copy) NSString *humanName;
@property (nonatomic, readonly, copy) NSNumber *hostCount;
@property (nonatomic, readonly, copy) NSSet *subLabs;

- (id)initWithBuilding:(NSString*)building room:(NSString*)room humanName:(NSString*)humanName hostCount:(NSNumber *)hostCount;
- (id)initWithBuilding:(NSString*)building room:(NSString*)room humanName:(NSString*)humanName hostCount:(NSNumber *)hostCount subLabs:(NSSet *)subLabs;

- (NSComparisonResult)compareHumanName:(DZCLab *)aLab;

Expand Down
14 changes: 9 additions & 5 deletions CAENLabStatus/DZCLab.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,27 @@ @interface DZCLab ()
@property (nonatomic, copy) NSString *room;
@property (nonatomic, copy) NSString *humanName;
@property (nonatomic, copy) NSNumber *hostCount;
@property (nonatomic, copy) NSSet *subLabs;

@end

@implementation DZCLab

@synthesize building = _building, room = _room, humanName = _humanName, hostCount = _hostCount;
@synthesize building = _building, room = _room, humanName = _humanName, hostCount = _hostCount, subLabs = _subLabs;

- (id)initWithBuilding:(NSString*)building
room:(NSString*)room
humanName:(NSString*)humanName
hostCount:(NSNumber *)hostCount
- (id)initWithBuilding:(NSString *)building
room:(NSString *)room
humanName:(NSString *)humanName
hostCount:(NSNumber *)hostCount
subLabs:(NSSet *)subLabs
{
self = [super init];
if (self) {
self.building = building;
self.room = room;
self.humanName = humanName;
self.hostCount = hostCount;
self.subLabs = subLabs;
}
return self;
}
Expand All @@ -34,6 +37,7 @@ - (void)dealloc
[_room release];
[_humanName release];
[_hostCount release];
[_subLabs release];

[super dealloc];
}
Expand Down

0 comments on commit f1775b4

Please sign in to comment.