-
Notifications
You must be signed in to change notification settings - Fork 0
/
SelData.m
executable file
·204 lines (140 loc) · 3.63 KB
/
SelData.m
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
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
//
// SelData.m
// DynamicSelections
//
// Created by Peter Appel on 03/07/2008.
// Copyright 2008 __MyCompanyName__. All rights reserved.
//
#import "SelData.h"
@implementation SelData
- (id)init
{
if (self = [super init])
{
[self setNoOfPoints:0];
[self setCountOfSel:2];
[self setSel:[NSArray array]];
[self setMswd: 0.0];
}
return self;
}
- (int)countOfSel
{
return countOfSel;
}
- (void)setCountOfSel:(int)aCountOfSel
{
countOfSel = aCountOfSel;
}
- (int)noOfPoints
{
return noOfPoints;
}
- (void)setNoOfPoints:(int)aNoOfPoints
{
noOfPoints = aNoOfPoints;
}
- (NSArray *)sel {return sel;}
-(void)setSel:(NSArray *)aSel
{
if (sel != aSel)
{
[sel autorelease];
sel = [[NSArray alloc] initWithArray: aSel];
}
}
- (float)mswd {return mswd;}
- (void)setMswd:(float)x
{
mswd =x;
}
- (float)isoage { return isoage; }
- (void)setIsoage:(float)x
{
isoage = x;
}
- (float)isoageerr { return isoageerr; }
- (void)setIsoageerr:(float)x
{
isoageerr = x;
}
- (float)intersect { return intersect; }
- (void)setIntersect:(float)x
{
intersect = x;
}
- (float)intererr { return intererr; }
- (void)setIntererr:(float)x
{
intererr = x;
}
- (float)inclination { return inclination; }
- (void)setInclination:(float)x
{
inclination = x;
}
- (float)inclerr { return inclerr; }
- (void)setInclerr:(float)x
{
inclerr = x;
}
- (float)bestimate { return bestimate; }
- (void)setBestimate:(float)x
{
bestimate = x;
}
- (float)errbestimate { return errbestimate; }
- (void)setErrbestimate:(float)x
{
errbestimate = x;
}
- (float)chi2 { return chi2; }
- (void)setChi2:(float)x
{
chi2 = x;
}
- (void) dealloc
{
// [name release];
[super dealloc];
}
- (id)initWithCoder:(NSCoder *)coder
{
self=[super init];
// NSData *idData = [coder decodeObjectForKey:@"sel"];
// NSArray *newSel = [NSKeyedUnarchiver unarchiveObjectWithData:idData];
// [self coder decodeObjectForKey:@"sel"];
[self setSel:[coder decodeObjectForKey:@"sel"]];
[self setCountOfSel:[coder decodeIntForKey:@"countOfSel"]];
[self setNoOfPoints:[coder decodeIntForKey:@"noOfPoints"]];
[self setMswd:[coder decodeFloatForKey:@"mswd"]];
[self setIntersect:[coder decodeFloatForKey:@"intersect"]];
[self setIntererr:[coder decodeFloatForKey:@"intererr"]];
[self setInclination:[coder decodeFloatForKey:@"inclination"]];
[self setInclerr:[coder decodeFloatForKey:@"inclerr"]];
[self setIsoage:[coder decodeFloatForKey:@"isoage"]];
[self setIsoageerr:[coder decodeFloatForKey:@"isoageerr"]];
[self setBestimate:[coder decodeFloatForKey:@"bestimate"]];
[self setErrbestimate:[coder decodeFloatForKey:@"errbestimate"]];
[self setChi2:[coder decodeFloatForKey:@"chi2"]];
return self;
}
- (void)encodeWithCoder:(NSCoder *)encoder
{
// NSData *idData = [NSKeyedArchiver archivedDataWithRootObject:sel];
// [encoder encodeObject:idData forKey:@"sel"];
[encoder encodeObject:[self sel] forKey:@"sel"];
[encoder encodeInt:[self countOfSel] forKey:@"countOfSel"];
[encoder encodeInt:[self noOfPoints] forKey:@"noOfPoints"];
[encoder encodeFloat:[self mswd] forKey:@"mswd"];
[encoder encodeFloat:[self intersect] forKey:@"intersect"];
[encoder encodeFloat:[self intererr] forKey:@"intererr"];
[encoder encodeFloat:[self inclination] forKey:@"inclination"];
[encoder encodeFloat:[self inclerr] forKey:@"inclerr"];
[encoder encodeFloat:[self isoage] forKey:@"isoage"];
[encoder encodeFloat:[self isoageerr] forKey:@"isoageerr"];
[encoder encodeFloat:[self bestimate] forKey:@"bestimate"];
[encoder encodeFloat:[self errbestimate] forKey:@"errbestimate"];
[encoder encodeFloat:[self chi2] forKey:@"chi2"];
}
@end