Skip to content

Commit

Permalink
Merge pull request #84 from ehsteve/master
Browse files Browse the repository at this point in the history
Bringing upstream up to date
  • Loading branch information
ehsteve committed Sep 20, 2013
2 parents d7903fa + 26aa7a7 commit e5eb83e
Show file tree
Hide file tree
Showing 15 changed files with 428 additions and 404 deletions.
107 changes: 49 additions & 58 deletions HEROES SAS GSE/AppController.m
Original file line number Diff line number Diff line change
Expand Up @@ -135,34 +135,30 @@ -(void)awakeFromNib{
NumberInRangeFormatter *formatter;

formatter = [self.SAS1CPUTemperatureLabel formatter];
formatter.maximum = 90;
formatter.minimum = -20;
formatter.maximum = 70;
formatter.minimum = 5;
formatter = [self.SAS2CPUTemperatureLabel formatter];
formatter.maximum = 90;
formatter.minimum = -20;
formatter.maximum = 70;
formatter.minimum = 5;
formatter = [self.PYASFCameraTemperatureLabel formatter];
formatter.maximum = 90;
formatter.minimum = -20;
formatter.maximum = 55;
formatter.minimum = -25;
formatter = [self.PYASRCameraTemperatureLabel formatter];
formatter.maximum = 90;
formatter.minimum = -20;
formatter.maximum = 55;
formatter.minimum = -25;
formatter = [self.RASCameraTemperatureLabel formatter];
formatter.maximum = 90;
formatter.minimum = -20;
formatter.maximum = 55;
formatter.minimum = -25;

NumberInRangeFormatter *TemperatureFormatter = [[NumberInRangeFormatter alloc] init];
TemperatureFormatter.maximum = 100;
TemperatureFormatter.minimum = -20;

formatter = [self.SAS1CPUHeatSinkTemp formatter];
formatter.maximum = 100;
formatter.minimum = -20;
formatter.maximum = 70;
formatter.minimum = 5;
formatter = [self.SAS1CanTemp formatter];
formatter.maximum = 100;
formatter.minimum = -20;
formatter.maximum = 70;
formatter.minimum = 10;
formatter = [self.SAS1HDDTemp formatter];
formatter.maximum = 100;
formatter.minimum = -20;
formatter.maximum = 65;
formatter.minimum = 5;
formatter = [self.SAS1HeaterPlateTemp formatter];
formatter.maximum = 100;
formatter.minimum = -20;
Expand All @@ -174,14 +170,14 @@ -(void)awakeFromNib{
formatter.minimum = -20;

formatter = [self.SAS2CPUHeatSinkTemp formatter];
formatter.maximum = 100;
formatter.minimum = -20;
formatter.maximum = 70;
formatter.minimum = 5;
formatter = [self.SAS2CanTemp formatter];
formatter.maximum = 100;
formatter.minimum = -20;
formatter.maximum = 70;
formatter.minimum = 10;
formatter = [self.SAS2HDDTemp formatter];
formatter.maximum = 100;
formatter.minimum = -20;
formatter.maximum = 65;
formatter.minimum = 5;
formatter = [self.SAS2HeaterPlateTemp formatter];
formatter.maximum = 100;
formatter.minimum = -20;
Expand Down Expand Up @@ -213,32 +209,32 @@ -(void)awakeFromNib{
formatter.minimum = 75;

formatter = [self.SAS1V2p5Voltage formatter];
formatter.maximum = 2.5 * 1.20;
formatter.minimum = 2.5 * 0.80;
formatter.maximum = 2.5 * 1.10;
formatter.minimum = 2.5 * 0.90;
formatter = [self.SAS2V2p5Voltage formatter];
formatter.maximum = 2.5 * 1.20;
formatter.minimum = 2.5 * 0.80;
formatter.maximum = 2.5 * 1.10;
formatter.minimum = 2.5 * 0.90;

formatter = [self.SAS1V3p3Voltage formatter];
formatter.maximum = 3.3 * 1.20;
formatter.minimum = 3.3 * 0.80;
formatter.maximum = 3.3 * 1.10;
formatter.minimum = 3.3 * 0.90;
formatter = [self.SAS2V3p3Voltage formatter];
formatter.maximum = 3.3 * 1.20;
formatter.minimum = 3.3 * 0.80;
formatter.maximum = 3.3 * 1.10;
formatter.minimum = 3.3 * 0.90;

formatter = [self.SAS1V5Votlage formatter];
formatter.maximum = 5.0 * 1.20;
formatter.minimum = 5.0 * 0.80;
formatter.maximum = 5.0 * 1.10;
formatter.minimum = 5.0 * 0.90;
formatter = [self.SAS2V5Votlage formatter];
formatter.maximum = 5.0 * 1.20;
formatter.minimum = 5.0 * 0.80;
formatter.maximum = 5.0 * 1.10;
formatter.minimum = 5.0 * 0.90;

formatter = [self.SAS1V12Voltage formatter];
formatter.maximum = 12.0 * 1.20;
formatter.minimum = 12.0 * 0.80;
formatter.maximum = 12.0 * 1.10;
formatter.minimum = 12.0 * 0.90;
formatter = [self.SAS2V12Voltage formatter];
formatter.maximum = 12.0 * 1.20;
formatter.minimum = 12.0 * 0.80;
formatter.maximum = 12.0 * 1.10;
formatter.minimum = 12.0 * 0.90;

for (NSString *title in self.PlotWindowsAvailable) {
[self.TimeProfileMenu addItemWithTitle:title action:NULL keyEquivalent:@""];
Expand Down Expand Up @@ -601,6 +597,8 @@ - (void)mainThread_handleData:(NSNotification *)note
self.PYASFcameraView.fiducialPoints = [packet getFiducialPoints];
self.PYASFcameraView.fiducialIDs = [packet getFiducialIDs];
[self.PYASFcameraView setScreenCenter:[packet.screenCenter pointValue].x :[packet.screenCenter pointValue].y];
[self.PYASFcameraView setCalibratedScreenCenter: [packet.calibratedScreenCenter pointValue].x :[packet.calibratedScreenCenter pointValue].y];

self.PYASFcameraView.screenRadius = packet.screenRadius;
self.PYASFcameraView.clockingAngle = packet.clockingAngle;

Expand Down Expand Up @@ -733,6 +731,7 @@ - (void)mainThread_handleData:(NSNotification *)note
self.PYASRcameraView.chordCrossingPoints = [packet getChordPoints];
self.PYASRcameraView.fiducialPoints = [packet getFiducialPoints];
[self.PYASRcameraView setScreenCenter:[packet.screenCenter pointValue].x :[packet.screenCenter pointValue].y];
[self.PYASRcameraView setCalibratedScreenCenter: [packet.calibratedScreenCenter pointValue].x :[packet.calibratedScreenCenter pointValue].y];
self.PYASRcameraView.screenRadius = packet.screenRadius;
self.PYASRcameraView.clockingAngle = packet.clockingAngle;
self.PYASRcameraView.fiducialIDs = [packet getFiducialIDs];
Expand Down Expand Up @@ -885,39 +884,31 @@ - (IBAction)OpenWindow_WindowMenuItemAction:(NSMenuItem *)sender {
NSArray *objs = [NSArray arrayWithObjects:[self.timeSeriesCollection objectForKey:@"PYAS-F camera temperature"], [self.timeSeriesCollection objectForKey:@"PYAS-R camera temperature"], [self.timeSeriesCollection objectForKey:@"RAS camera temperature"] ,nil];
NSArray *keys = [NSArray arrayWithObjects:@"PYAS-F", @"PYAS-R", @"RAS", nil];
NSDictionary *data = [[NSDictionary alloc] initWithObjects:objs forKeys:keys];
PlotWindowController *newPlotWindow = [[PlotWindowController alloc] initWithData:data];
PlotWindowController *newPlotWindow = [[PlotWindowController alloc] initWithData:data name:@"Camera Temperatures"];
[newPlotWindow showWindow:self];
[self.PlotWindows setObject:newPlotWindow forKey:userChoice];
}
if ([userChoice isEqualToString:@"ctl X solution"]) {
NSDictionary *data = [[NSDictionary alloc] initWithObjectsAndKeys:
[self.timeSeriesCollection objectForKey:@"SAS1 ctl X solution"], @"PYAS-F",
[self.timeSeriesCollection objectForKey:@"SAS2 ctl X solution"] , @"PYAS-R", nil];
PlotWindowController *newPlotWindow = [[PlotWindowController alloc] initWithData:data];
PlotWindowController *newPlotWindow = [[PlotWindowController alloc] initWithData:data name:@"CTL X Solutions"];
[newPlotWindow showWindow:self];
[self.PlotWindows setObject:newPlotWindow forKey:userChoice];
}
if ([userChoice isEqualToString:@"ctl Y solution"]) {
NSDictionary *data = [[NSDictionary alloc] initWithObjectsAndKeys:
[self.timeSeriesCollection objectForKey:@"SAS1 ctl Y solution"], @"PYAS-F",
[self.timeSeriesCollection objectForKey:@"SAS2 ctl Y solution"] , @"PYAS-R", nil];
PlotWindowController *newPlotWindow = [[PlotWindowController alloc] initWithData:data];
PlotWindowController *newPlotWindow = [[PlotWindowController alloc] initWithData:data name:@"CTL Y Solutions"];
[newPlotWindow showWindow:self];
[self.PlotWindows setObject:newPlotWindow forKey:userChoice];
}
if ([userChoice isEqualToString:@"ctl R solution"]) {
NSDictionary *data = [[NSDictionary alloc] initWithObjectsAndKeys:
[self.timeSeriesCollection objectForKey:@"SAS1 ctl R solution"], @"PYAS-F",
[self.timeSeriesCollection objectForKey:@"SAS2 ctl R solution"] , @"PYAS-R", nil];
PlotWindowController *newPlotWindow = [[PlotWindowController alloc] initWithData:data];
[newPlotWindow showWindow:self];
[self.PlotWindows setObject:newPlotWindow forKey:userChoice];
}
if ([userChoice isEqualToString:@"cpu temperature"]) {
NSDictionary *data = [[NSDictionary alloc] initWithObjectsAndKeys:
[self.timeSeriesCollection objectForKey:@"SAS1 cpu temperature"], @"SAS-2",
[self.timeSeriesCollection objectForKey:@"SAS2 cpu temperature"] , @"SAS-1", nil];
PlotWindowController *newPlotWindow = [[PlotWindowController alloc] initWithData:data];
PlotWindowController *newPlotWindow = [[PlotWindowController alloc] initWithData:data name:@"CTL R Solutions"];
[newPlotWindow showWindow:self];
[self.PlotWindows setObject:newPlotWindow forKey:userChoice];
}
Expand All @@ -931,7 +922,7 @@ - (IBAction)OpenWindow_WindowMenuItemAction:(NSMenuItem *)sender {
[self.timeSeriesCollection objectForKey:@"SAS1 air temperature"] , @"air",
[self.timeSeriesCollection objectForKey:@"SAS1 rail temperature"] , @"rail",
nil];
PlotWindowController *newPlotWindow = [[PlotWindowController alloc] initWithData:data];
PlotWindowController *newPlotWindow = [[PlotWindowController alloc] initWithData:data name:@"SAS-1 Temperatures"];
[newPlotWindow showWindow:self];
[self.PlotWindows setObject:newPlotWindow forKey:userChoice];
}
Expand All @@ -945,7 +936,7 @@ - (IBAction)OpenWindow_WindowMenuItemAction:(NSMenuItem *)sender {
[self.timeSeriesCollection objectForKey:@"SAS2 air temperature"] , @"air",
[self.timeSeriesCollection objectForKey:@"SAS2 rail temperature"] , @"rail",
nil];
PlotWindowController *newPlotWindow = [[PlotWindowController alloc] initWithData:data];
PlotWindowController *newPlotWindow = [[PlotWindowController alloc] initWithData:data name:@"SAS-2 Temperatures"];
[newPlotWindow showWindow:self];
[self.PlotWindows setObject:newPlotWindow forKey:userChoice];
}
Expand All @@ -957,7 +948,7 @@ - (IBAction)OpenWindow_WindowMenuItemAction:(NSMenuItem *)sender {
[self.timeSeriesCollection objectForKey:@"SAS1 5.0V"] , @"5.0V",
[self.timeSeriesCollection objectForKey:@"SAS1 12.0V"] , @"12.0V",
nil];
PlotWindowController *newPlotWindow = [[PlotWindowController alloc] initWithData:data];
PlotWindowController *newPlotWindow = [[PlotWindowController alloc] initWithData:data name:@"SAS-1 Voltages"];
[newPlotWindow showWindow:self];
[self.PlotWindows setObject:newPlotWindow forKey:userChoice];
}
Expand All @@ -969,7 +960,7 @@ - (IBAction)OpenWindow_WindowMenuItemAction:(NSMenuItem *)sender {
[self.timeSeriesCollection objectForKey:@"SAS2 5.0V"] , @"5.0V",
[self.timeSeriesCollection objectForKey:@"SAS2 12.0V"] , @"12.0V",
nil];
PlotWindowController *newPlotWindow = [[PlotWindowController alloc] initWithData:data];
PlotWindowController *newPlotWindow = [[PlotWindowController alloc] initWithData:data name:@"SAS-2 Voltages"];
[newPlotWindow showWindow:self];
[self.PlotWindows setObject:newPlotWindow forKey:userChoice];
}
Expand Down
1 change: 1 addition & 0 deletions HEROES SAS GSE/CameraView.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,6 @@
- (void) draw;
- (void) setCircleCenter: (float)x :(float)y;
- (void) setScreenCenter: (float)x :(float)y;
- (void) setCalibratedScreenCenter: (float)x :(float)y;

@end
24 changes: 22 additions & 2 deletions HEROES SAS GSE/CameraView.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ @interface CameraView()
@property (nonatomic) float circleY;
@property (nonatomic) float screenX;
@property (nonatomic) float screenY;
@property (nonatomic) float calibratedScreenX;
@property (nonatomic) float calibratedScreenY;

// declaration of private methods as needed
- (void) prepareOpenGL;
Expand Down Expand Up @@ -57,6 +59,8 @@ @implementation CameraView
@synthesize screenY;
@synthesize clockingAngle;
@synthesize fiducialIDs = _fiducialIDs;
@synthesize calibratedScreenX;
@synthesize calibratedScreenY;

-(id) initWithFrame:(NSRect)frameRect
{
Expand All @@ -67,6 +71,8 @@ -(id) initWithFrame:(NSRect)frameRect
self.circleY = 0.0;
self.screenX = 500.0;
self.screenY = 500.0;
self.calibratedScreenX = 525.0;
self.calibratedScreenY = 525.0;
self.turnOnBkgImage = NO;
self.imageExists = NO;
self.mouseLocation = NSMakePoint(-1, -1);
Expand Down Expand Up @@ -95,6 +101,15 @@ - (void) setScreenCenter: (float)x :(float)y{
}
}

- (void) setCalibratedScreenCenter: (float)x :(float)y{
if ((x < [self.numberXPixels floatValue]) && (x > 0)) {
self.calibratedScreenX = x;
}
if ((y < [self.numberYPixels floatValue]) && (y > 0)) {
self.calibratedScreenY = y;
}
}

-(void)setImageExists:(BOOL)imageExists{
_imageExists = imageExists;
}
Expand Down Expand Up @@ -148,6 +163,7 @@ - (void) drawOverlay
{
NSPoint sunCenter = NSMakePoint(self.circleX, self.circleY);
NSPoint screenCenter = NSMakePoint(self.screenX, self.screenY);
NSPoint calibratedScreenCenter = NSMakePoint(self.calibratedScreenX, self.calibratedScreenY);

// draw the Sun (circle and cross)
glColor3f(1.0f, 0.0f, 0.0f);
Expand All @@ -164,8 +180,12 @@ - (void) drawOverlay

// draw the screen center
glColor3f(0.7f, 0.7f, 0.7f);
[self drawACross:screenCenter :0.02];
[self drawACross:screenCenter :0.015];

// draw the CALIBRATED screen center
glColor3f(0.7f, 0.7f, 0.0f);
[self drawACross:calibratedScreenCenter :0.02];

// draw the screen outline
glColor3f(0.7f, 0.7f, 0.7f);
[self drawACircle:screenCenter :self.screenRadius];
Expand Down Expand Up @@ -491,7 +511,7 @@ - (void) cleanUp
// [denoise release];
// } // if

//[super cleanUp];
//[super clean];
} // cleanUp

@end

0 comments on commit e5eb83e

Please sign in to comment.