-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExptSummaryDialogController.m
More file actions
123 lines (70 loc) · 2.48 KB
/
ExptSummaryDialogController.m
File metadata and controls
123 lines (70 loc) · 2.48 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
//
// ExptSummaryDialogController.m
// Bartender
//
// Created by houpt on 5/27/17.
//
//
#import "ExptSummaryDialogController.h"
#import "BarExperiment.h"
#import "DailyData.h"
#import "BarDocument.h"
#import "BarSubject.h"
#import "BarItem.h"
#import "BarGroup.h"
#import "BarPhase.h"
#import "BarDirectories.h"
#import "DailyDataDocument.h"
@interface ExptSummaryDialogController ()
@end
@implementation ExptSummaryDialogController
- (id)initWithExperiment:(BarExperiment *)theExpt;
{
self = [super initWithWindowNibName:@"ExptSummaryDialog"];
if (self) {
// Initialization code here.
[self setTheExperiment:theExpt];
}
return self;
}
- (void)windowDidLoad
{
[super windowDidLoad];
// Implement this method to handle any initialization after your window controller's window has been loaded from its nib file.
itemButtons = [NSMutableArray arrayWithArray:@[item0,item1,item2,item3,item4,item5]];
[self populateDialog];
}
- (void)setTheExperiment:(BarExperiment *)newExpt {
// set the values in the new expt panel
// using the values in the given expt
theExperiment = newExpt;
}
-(void)populateDialog; // set up dialog after window loads
{
[exptName setStringValue:[theExperiment name]];
[exptCode setStringValue: [theExperiment code]];
NSUInteger numItems = [[theExperiment items] count];
if (numItems > 6) { numItems = 6;}
for (NSUInteger i=0; i < numItems; i++) {
BarItem *item = [[theExperiment items] objectAtIndex:i];
NSString *itemLabel = [NSString stringWithFormat:@"%@: %@", [item code],[item name] ];
[[itemButtons objectAtIndex:i] setStringValue:itemLabel];
}
for (NSUInteger i=numItems; i < 6; i++) {
[[itemButtons objectAtIndex:i] setVisible:NO];
}
}
- (IBAction)cancelButtonPressed:(id)sender {
// NOTE -- need to implement this as a real cancel button...
// user cancelled, so just close the window without exporting summary
NSLog(@"Expt Summary Dialog Cancel Button pressed");
[[self window] performClose:self];
}
- (IBAction)okButtonPressed:(id)sender {
// NOTE -- need to implement this as a real cancel button...
// user cancelled, so just close the window without exporting summary
NSLog(@"Expt Summary Dialog ok Button pressed");
[[self window] performClose:self];
// export the summary file
}
@end