diff --git a/HEROES SAS GSE/AppController.m b/HEROES SAS GSE/AppController.m index 2bd4f95..13db60f 100644 --- a/HEROES SAS GSE/AppController.m +++ b/HEROES SAS GSE/AppController.m @@ -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; @@ -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; @@ -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:@""]; @@ -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; @@ -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]; @@ -885,7 +884,7 @@ - (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]; } @@ -893,7 +892,7 @@ - (IBAction)OpenWindow_WindowMenuItemAction:(NSMenuItem *)sender { 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]; } @@ -901,7 +900,7 @@ - (IBAction)OpenWindow_WindowMenuItemAction:(NSMenuItem *)sender { 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]; } @@ -909,15 +908,7 @@ - (IBAction)OpenWindow_WindowMenuItemAction:(NSMenuItem *)sender { 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]; } @@ -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]; } @@ -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]; } @@ -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]; } @@ -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]; } diff --git a/HEROES SAS GSE/CameraView.h b/HEROES SAS GSE/CameraView.h index 8320f11..53cf4cc 100644 --- a/HEROES SAS GSE/CameraView.h +++ b/HEROES SAS GSE/CameraView.h @@ -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 diff --git a/HEROES SAS GSE/CameraView.m b/HEROES SAS GSE/CameraView.m index b104ac6..c1d2635 100644 --- a/HEROES SAS GSE/CameraView.m +++ b/HEROES SAS GSE/CameraView.m @@ -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; @@ -57,6 +59,8 @@ @implementation CameraView @synthesize screenY; @synthesize clockingAngle; @synthesize fiducialIDs = _fiducialIDs; +@synthesize calibratedScreenX; +@synthesize calibratedScreenY; -(id) initWithFrame:(NSRect)frameRect { @@ -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); @@ -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; } @@ -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); @@ -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]; @@ -491,7 +511,7 @@ - (void) cleanUp // [denoise release]; // } // if - //[super cleanUp]; + //[super clean]; } // cleanUp @end diff --git a/HEROES SAS GSE/ConsoleWindowController.xib b/HEROES SAS GSE/ConsoleWindowController.xib index e46e8e7..9275210 100644 --- a/HEROES SAS GSE/ConsoleWindowController.xib +++ b/HEROES SAS GSE/ConsoleWindowController.xib @@ -2,9 +2,9 @@ 1080 - 12E55 + 12D78 3084 - 1187.39 + 1187.37 626.00 com.apple.InterfaceBuilder.CocoaPlugin @@ -41,7 +41,7 @@ 15 2 - {{784, 131}, {882, 263}} + {{245, 901}, {760, 263}} 544735232 GSE Console NSWindow @@ -62,10 +62,10 @@ 2322 - {882, 229} + {730, 229} - + _NS:13 @@ -82,7 +82,7 @@ - 882 + 730 1 @@ -134,7 +134,7 @@ - {{1, 1}, {882, 229}} + {{1, 1}, {745, 229}} @@ -299,7 +299,7 @@ wGw 256 - {{867, 1}, {16, 229}} + {{746, 1}, {15, 229}} _NS:83 @@ -324,10 +324,10 @@ wGw 0.94565218687057495 - {{-1, -1}, {884, 231}} + {{-1, -1}, {762, 231}} - + _NS:9 133138 @@ -340,7 +340,7 @@ wGw 268 - {{728, 230}, {67, 32}} + {{606, 230}, {67, 32}} @@ -369,7 +369,7 @@ wGw 268 - {{795, 230}, {73, 32}} + {{673, 230}, {73, 32}} @@ -394,7 +394,7 @@ wGw 268 - {{573, 230}, {155, 32}} + {{451, 230}, {155, 32}} @@ -419,9 +419,10 @@ wGw 268 - {{441, 238}, {132, 18}} + {{319, 238}, {132, 18}} + _NS:9 YES @@ -448,12 +449,12 @@ wGw NO - {882, 263} + {760, 263} - + - {{0, 0}, {1280, 778}} + {{0, 0}, {2560, 1418}} {10000000000000, 10000000000000} YES diff --git a/HEROES SAS GSE/DataPacket.h b/HEROES SAS GSE/DataPacket.h index 5538f41..eead20c 100644 --- a/HEROES SAS GSE/DataPacket.h +++ b/HEROES SAS GSE/DataPacket.h @@ -23,6 +23,7 @@ @property (nonatomic) BOOL isSAS1; @property (nonatomic) BOOL isSAS2; @property (nonatomic) NSValue *screenCenter; +@property (nonatomic) NSValue *calibratedScreenCenter; @property (nonatomic) float screenRadius; @property (nonatomic) NSMutableArray *i2cTemperatures; @property (nonatomic) NSMutableArray *sbcVoltages; @@ -35,6 +36,7 @@ @property (nonatomic) NSString *aspectErrorCode; @property (nonatomic) float clockingAngle; @property (nonatomic) NSValue *screenCenterOffset; +@property (nonatomic) NSValue *calibratedScreenCenterOffset; -(NSString *) getframeTimeString; -(void) addChordPoint: (NSPoint) point :(int) index; diff --git a/HEROES SAS GSE/DataPacket.m b/HEROES SAS GSE/DataPacket.m index 69f8dc8..baadd0e 100644 --- a/HEROES SAS GSE/DataPacket.m +++ b/HEROES SAS GSE/DataPacket.m @@ -15,14 +15,14 @@ #define NUM_VOLTAGE_READINGS 5 //Calibrated parameters -#define CLOCKING_ANGLE_PYASF -33.26 -#define CENTER_X_PYASF 0 -#define CENTER_Y_PYASF 0 -#define TWIST_PYASF 180.0 -#define CLOCKING_ANGLE_PYASR -53.00 -#define CENTER_X_PYASR -210 -#define CENTER_Y_PYASR 56 -#define TWIST_PYASR 0.0 +#define CLOCKING_ANGLE_PYASF -32.425 //model is -33.26 +#define CENTER_X_PYASF 124.68 //mils +#define CENTER_Y_PYASF -74.64 //mils +#define TWIST_PYASF 180.0 //needs to be ~180 +#define CLOCKING_ANGLE_PYASR -52.175 //model is -53.26 +#define CENTER_X_PYASR -105.59 //mils +#define CENTER_Y_PYASR -48.64 //mils +#define TWIST_PYASR 0.0 //needs to be ~0 @interface DataPacket() @property (nonatomic, strong) NSMutableArray *chordPoints; @@ -59,6 +59,8 @@ @implementation DataPacket @synthesize aspectErrorCode; @synthesize clockingAngle; @synthesize screenCenterOffset; +@synthesize calibratedScreenCenter = _calibratedScreenCenter; +@synthesize calibratedScreenCenterOffset = _calibratedScreenCenterOffset; -(id)init{ self = [super init]; // call our super’s designated initializer @@ -135,6 +137,23 @@ - (NSValue *)screenCenter return _screenCenter; } +- (NSValue *)calibratedScreenCenter +{ + if (_calibratedScreenCenter == nil) { + _calibratedScreenCenter = [[NSValue alloc] init]; + } + return _calibratedScreenCenter; +} + +- (NSValue *)calibratedScreenCenterOffset +{ + if (_calibratedScreenCenterOffset == nil) { + _calibratedScreenCenterOffset = [[NSValue alloc] init]; + } + return _calibratedScreenCenterOffset; +} + + - (NSValue *)CTLCommand { if (_CTLCommand == nil) { @@ -175,19 +194,17 @@ -(void)setIsSAS1:(BOOL)isSAS1{ _isSAS2 = !isSAS1; if (isSAS1) { self.clockingAngle = CLOCKING_ANGLE_PYASF+TWIST_PYASF+180; + self.calibratedScreenCenterOffset = [NSValue valueWithPoint:NSMakePoint(CENTER_X_PYASF, CENTER_Y_PYASF)]; } else { self.clockingAngle = CLOCKING_ANGLE_PYASR+TWIST_PYASR+180; + self.calibratedScreenCenterOffset = [NSValue valueWithPoint:NSMakePoint(CENTER_X_PYASR, CENTER_Y_PYASR)]; } } -(void)setIsSAS2:(BOOL)isSAS2{ _isSAS2 = isSAS2; _isSAS1 = !isSAS2; - if (isSAS2) { - self.clockingAngle = CLOCKING_ANGLE_PYASR+TWIST_PYASR+180; - } else { - self.clockingAngle = CLOCKING_ANGLE_PYASF+TWIST_PYASF+180; - } + [self setIsSAS1:!isSAS2]; } @end diff --git a/HEROES SAS GSE/DataSeries.m b/HEROES SAS GSE/DataSeries.m index db01bea..f51f00c 100644 --- a/HEROES SAS GSE/DataSeries.m +++ b/HEROES SAS GSE/DataSeries.m @@ -8,7 +8,7 @@ #import "DataSeries.h" -#define MAX_CAPACITY 1000 +#define MAX_CAPACITY 100 @interface DataSeries() -(float)calculateAverage; diff --git a/HEROES SAS GSE/NumberInRangeFormatter.m b/HEROES SAS GSE/NumberInRangeFormatter.m index afa3d4a..e1d4fbb 100644 --- a/HEROES SAS GSE/NumberInRangeFormatter.m +++ b/HEROES SAS GSE/NumberInRangeFormatter.m @@ -58,16 +58,15 @@ - (NSAttributedString *)attributedStringForObjectValue:(id)anObject withDefaultA if ([[attrString string] floatValue] < self.minimum) { NSDictionary *firstAttributes = @{ - NSBackgroundColorAttributeName: [NSColor blueColor]}; + NSBackgroundColorAttributeName: [NSColor blueColor], NSForegroundColorAttributeName: [NSColor whiteColor]}; [attrString addAttributes:firstAttributes range:NSMakeRange(0, stringLength)]; } if ([[attrString string] floatValue] > self.maximum) { NSDictionary *firstAttributes = @{ - NSBackgroundColorAttributeName: [NSColor redColor]}; + NSBackgroundColorAttributeName: [NSColor redColor], NSForegroundColorAttributeName: [NSColor whiteColor]}; [attrString addAttributes:firstAttributes range:NSMakeRange(0, stringLength)]; } - return attrString; } diff --git a/HEROES SAS GSE/ParseDataOperation.m b/HEROES SAS GSE/ParseDataOperation.m index 3672037..aca5197 100644 --- a/HEROES SAS GSE/ParseDataOperation.m +++ b/HEROES SAS GSE/ParseDataOperation.m @@ -227,6 +227,7 @@ - (void)main dataPacket.screenCenter = [NSValue valueWithPoint:NSMakePoint(-x_intercept/x_slope, -y_intercept/y_slope)]; dataPacket.screenRadius = 0.5* ((3000.0/fabs(x_slope)) + (3000.0/fabs(y_slope))); + dataPacket.calibratedScreenCenter = [NSValue valueWithPoint:NSMakePoint((-x_intercept + dataPacket.calibratedScreenCenterOffset.pointValue.x)/x_slope, (-y_intercept + dataPacket.calibratedScreenCenterOffset.pointValue.y)/y_slope)]; uint8_t image_max; tm_packet >> image_max; diff --git a/HEROES SAS GSE/PlotWindowController.h b/HEROES SAS GSE/PlotWindowController.h index c3c0c63..dbba3fb 100644 --- a/HEROES SAS GSE/PlotWindowController.h +++ b/HEROES SAS GSE/PlotWindowController.h @@ -28,5 +28,5 @@ @property (nonatomic, strong) NSDictionary *data; -(void) update; -- (id)initWithData:(NSDictionary *)inputdata; +- (id)initWithData:(NSDictionary *)inputdata name:(NSString *)string; @end diff --git a/HEROES SAS GSE/PlotWindowController.m b/HEROES SAS GSE/PlotWindowController.m index f50741b..840c674 100644 --- a/HEROES SAS GSE/PlotWindowController.m +++ b/HEROES SAS GSE/PlotWindowController.m @@ -76,8 +76,9 @@ - (id)init{ return [super initWithWindowNibName:@"PlotWindowController"]; } -- (id)initWithData:(NSDictionary *)inputdata{ +- (id)initWithData:(NSDictionary *)inputdata name:(NSString *)string{ self = [self init]; + [self.MainWindow setTitle:string]; self.data = inputdata; return self; } @@ -134,7 +135,6 @@ - (void)windowDidLoad TimeSeries *currentData = [self.data objectForKey:key]; if (i == 0) { yAxis.title = currentData.name; - [self.MainWindow setTitle:currentData.name]; } // Create a plot that uses the data source method @@ -165,7 +165,7 @@ - (void)windowDidLoad self.hostView.hostedGraph = graph; [graph.defaultPlotSpace scaleToFitPlots:[graph allPlots]]; - [graph reloadData]; + [graph reloadDataIfNeeded]; [self update]; } #pragma mark - @@ -177,8 +177,8 @@ - (IBAction)TextFieldUpdated:(NSTextField *)sender { -(void)update{ if (self.data != nil) { - float ymin; - float ymax; + float ymin = 0; + float ymax = 100; // Axes CPTXYAxisSet *axisSet = (CPTXYAxisSet *)self.hostView.hostedGraph.axisSet; CPTXYAxis *yAxis = axisSet.yAxis; @@ -245,8 +245,7 @@ -(void)update{ -(NSNumber *)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordIndex:(NSUInteger)index { - NSString *plot_name = plot.identifier; - TimeSeries *currentData = [self.data objectForKey:plot_name]; + TimeSeries *currentData = [self.data objectForKey:plot.identifier]; if (fieldEnum == CPTScatterPlotFieldX) { NSTimeInterval x = [[[currentData time] objectAtIndex:index] timeIntervalSinceDate:self.earliestTime]; @@ -260,8 +259,7 @@ -(NSNumber *)numberForPlot:(CPTPlot *)plot field:(NSUInteger)fieldEnum recordInd -(NSUInteger)numberOfRecordsForPlot:(CPTPlot *)plot { - NSString *plot_name = plot.identifier; - TimeSeries *currentData = [self.data objectForKey:plot_name]; + TimeSeries *currentData = [self.data objectForKey:plot.identifier]; return [[currentData data] count]; } diff --git a/HEROES SAS GSE/PlotWindowController.xib b/HEROES SAS GSE/PlotWindowController.xib index 5aba1cc..22d3dd3 100644 --- a/HEROES SAS GSE/PlotWindowController.xib +++ b/HEROES SAS GSE/PlotWindowController.xib @@ -274,10 +274,11 @@ {{540, 12}, {106, 24}} + _NS:9 YES - 67108864 + 603979776 0 _NS:9 @@ -1230,6 +1231,14 @@ + + CPTGraphHostingView + NSView + + IBProjectSource + ./Classes/CPTGraphHostingView.h + + NSLayoutConstraint NSObject diff --git a/HEROES SAS GSE/TimeSeries.m b/HEROES SAS GSE/TimeSeries.m index 67faa3b..ac8f34d 100644 --- a/HEROES SAS GSE/TimeSeries.m +++ b/HEROES SAS GSE/TimeSeries.m @@ -9,7 +9,7 @@ #import "DataSeries.h" #import "TimeSeries.h" -#define MAX_CAPACITY 1000 +#define MAX_CAPACITY 100 @interface TimeSeries() @property (nonatomic, strong) NSMutableArray *mytime; diff --git a/HEROES SAS GSE/en.lproj/MainMenu.xib b/HEROES SAS GSE/en.lproj/MainMenu.xib index e966024..a1365a6 100644 --- a/HEROES SAS GSE/en.lproj/MainMenu.xib +++ b/HEROES SAS GSE/en.lproj/MainMenu.xib @@ -1326,8 +1326,8 @@ 7 2 - {{442, 488}, {1147, 941}} - 1949827072 + {{118, 423}, {1147, 941}} + 1954021376 HEROES SAS GSE NSWindow @@ -3789,7 +3789,6 @@ {{59, 22}, {56, 22}} - _NS:1535 {1000, 750} YES @@ -4232,7 +4231,7 @@ 268 - {{196, 62}, {40, 18}} + {{196, 61}, {40, 18}} @@ -4254,7 +4253,7 @@ 268 - {{18, 65}, {50, 17}} + {{15, 65}, {53, 17}} @@ -4275,7 +4274,7 @@ 268 - {{119, 64}, {72, 17}} + {{119, 63}, {72, 17}} @@ -4296,7 +4295,7 @@ 268 - {{196, 39}, {40, 17}} + {{196, 39}, {40, 16}} @@ -4336,31 +4335,10 @@ NO - - - 268 - {{18, 41}, {50, 16}} - - - - _NS:1535 - YES - - 68157504 - 272630784 - SAS-2 - - _NS:1535 - - - - - NO - 268 - {{241, 64}, {51, 17}} + {{241, 63}, {51, 17}} @@ -4381,10 +4359,9 @@ 268 - {{241, 39}, {51, 17}} + {{241, 38}, {51, 17}} - _NS:1535 YES @@ -4423,7 +4400,7 @@ 268 - {{74, 64}, {40, 23}} + {{74, 62}, {40, 23}} @@ -4433,7 +4410,7 @@ 268 - {{297, 61}, {40, 23}} + {{297, 59}, {40, 25}} @@ -4443,7 +4420,7 @@ 268 - {{297, 37}, {40, 23}} + {{297, 36}, {40, 24}} @@ -4463,7 +4440,7 @@ 268 - {{74, 36}, {40, 23}} + {{74, 35}, {40, 22}} @@ -4476,7 +4453,7 @@ {{425, 60}, {100, 26}} - + _NS:9 YES @@ -4557,7 +4534,7 @@ {{366, 39}, {158, 18}} - + _NS:9 YES @@ -4583,6 +4560,27 @@ NO + + + 268 + {{15, 38}, {43, 17}} + + + + _NS:1535 + YES + + 68157504 + 272630784 + SAS-2 + + _NS:1535 + + + + + NO + {{1, 1}, {540, 91}} @@ -13357,6 +13355,22 @@ 3487 + + + 4 + 0 + + 4 + 1 + + 0.0 + + 1000 + + 6 + 24 + 2 + 3 @@ -13405,28 +13419,12 @@ 29 3 - + - 10 - 0 - - 10 - 1 - - 0.0 - - 1000 - - 6 - 24 - 2 - - - - 4 + 3 0 - - 4 + + 3 1 0.0 @@ -13741,6 +13739,22 @@ 9 3 + + + 4 + 0 + + 4 + 1 + + 12 + + 1000 + + 3 + 9 + 3 + 5 @@ -13933,22 +13947,6 @@ 24 2 - - - 11 - 0 - - 11 - 1 - - 0.0 - - 1000 - - 6 - 24 - 2 - 5 @@ -13997,23 +13995,7 @@ 24 2 - - - 5 - 0 - - 5 - 1 - - 0.0 - - 1000 - - 6 - 24 - 2 - - + 3 0 @@ -14021,7 +14003,7 @@ 3 1 - 47 + 49 1000 @@ -14029,23 +14011,23 @@ 9 3 - + - 10 + 5 0 - - 10 + + 5 1 0.0 1000 - 9 - 40 + 6 + 24 2 - + 3 0 @@ -14053,7 +14035,7 @@ 3 1 - 19 + 21 1000 @@ -14061,28 +14043,12 @@ 9 3 - - - 4 - 0 - - 4 - 1 - - 61 - - 1000 - - 3 - 9 - 3 - - + - 4 + 10 0 - - 4 + + 10 1 0.0 @@ -14109,12 +14075,12 @@ 9 3 - - - 6 + + + 11 0 - - 6 + + 11 1 0.0 @@ -14125,12 +14091,12 @@ 24 2 - - - 5 + + + 10 0 - - 5 + + 10 1 0.0 @@ -14141,39 +14107,23 @@ 24 2 - - - 3 - 0 - - 4 - 1 - - 8 - - 1000 - - 6 - 24 - 3 - - - - 4 + + + 5 0 - - 4 + + 5 1 - 62 + 16 1000 - 3 - 5 + 8 + 29 3 - + 5 0 @@ -14181,16 +14131,15 @@ 5 1 - 19 + 16 1000 - 3 - 9 + 8 + 29 3 - @@ -14206,6 +14155,7 @@ + @@ -14224,7 +14174,7 @@ - + 7 0 @@ -14232,7 +14182,7 @@ 0 1 - 44 + 47 1000 @@ -14248,34 +14198,6 @@ - - 3519 - - - - - 3524 - - - - - - - - 3526 - - - - - 3534 - - - - - 3535 - - - 3538 @@ -14376,11 +14298,6 @@ - - 3633 - - - 3640 @@ -14552,6 +14469,22 @@ + + + 8 + 0 + + 0 + 1 + + 14 + + 1000 + + 3 + 9 + 1 + @@ -14588,11 +14521,6 @@ - - 3839 - - - 3872 @@ -14676,11 +14604,6 @@ - - 3968 - - - 3971 @@ -14827,11 +14750,6 @@ - - 4073 - - - 4082 @@ -14935,11 +14853,6 @@ - - 4293 - - - 4299 @@ -16568,11 +16481,6 @@ - - 5894 - - - 5708 @@ -17328,22 +17236,6 @@ - - - 8 - 0 - - 0 - 1 - - 14 - - 1000 - - 3 - 9 - 1 - @@ -17367,21 +17259,6 @@ - - 6339 - - - - - 6340 - - - - - 6341 - - - 6342 @@ -17868,23 +17745,81 @@ - 6468 - + 6476 + - 6469 - + 6479 + + + + + 6482 + + + + + 6483 + + + + + 6497 + + + + + 6498 + + + + + 6500 + + + + + 6506 + + + + + 6511 + + + + + 6514 + + + + - 6470 - + 6515 + + + + + 6518 + - 6471 - + 6519 + + + + + 6520 + + + + + 6521 + @@ -18360,22 +18295,18 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - - - - - + + + + - - - - - + + + - @@ -18388,6 +18319,7 @@ + @@ -18407,11 +18339,11 @@ - - + + com.apple.InterfaceBuilder.CocoaPlugin @@ -18421,18 +18353,12 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - - + + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -18456,7 +18382,6 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -18470,7 +18395,7 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - + com.apple.InterfaceBuilder.CocoaPlugin {{380, 496}, {480, 360}} @@ -18516,6 +18441,14 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + Green if clock sync is better than 1 ms + + @@ -18524,6 +18457,17 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + Green if clock sync is better than 1 ms + + + + + com.apple.InterfaceBuilder.CocoaPlugin @@ -18533,7 +18477,6 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -18562,7 +18505,6 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -18592,6 +18534,14 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + Green if receiving packets + + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -18601,11 +18551,26 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + Green if receiving packets + + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + Green if temperature is not 0 + + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -18613,6 +18578,14 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + Green if temperature is not 0 + + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -18620,6 +18593,14 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin + + ToolTip + + ToolTip + + Green if temperature is not 0 + + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -18644,7 +18625,6 @@ com.apple.InterfaceBuilder.CocoaPlugin NumberInRangeFormatter com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin NumberInRangeFormatter com.apple.InterfaceBuilder.CocoaPlugin NumberInRangeFormatter @@ -19166,7 +19146,7 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - + @@ -19184,7 +19164,6 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -19334,18 +19313,12 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - - - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -19447,10 +19420,22 @@ com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin - com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin + com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin com.apple.InterfaceBuilder.CocoaPlugin @@ -19473,7 +19458,7 @@ - 6471 + 6521 diff --git a/HEROES SAS GSE/lib/SAS-aspect b/HEROES SAS GSE/lib/SAS-aspect index ea31ebf..fd6da28 160000 --- a/HEROES SAS GSE/lib/SAS-aspect +++ b/HEROES SAS GSE/lib/SAS-aspect @@ -1 +1 @@ -Subproject commit ea31ebfa09aa66c0f14202a60373faa9a1b9574b +Subproject commit fd6da283dfcedb38b9151dfb2759754df37e17f1