2021-09-25 05:22:19 +00:00
|
|
|
#include <string.h>
|
|
|
|
#include "ruamoko/qwaq/ui/tableview.h"
|
|
|
|
#include "ruamoko/qwaq/device/axisview.h"
|
|
|
|
#include "ruamoko/qwaq/device/nameview.h"
|
|
|
|
|
|
|
|
@implementation AxisView
|
|
|
|
|
|
|
|
-initWithAxis:(in_axisinfo_t *)axis
|
|
|
|
{
|
|
|
|
if (!(self = [super init])) {
|
|
|
|
return nil;
|
|
|
|
}
|
|
|
|
self.axis = axis;
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
+withAxis:(in_axisinfo_t *)axis
|
|
|
|
{
|
|
|
|
return [[[self alloc] initWithAxis:axis] retain];
|
|
|
|
}
|
|
|
|
|
|
|
|
-draw
|
|
|
|
{
|
|
|
|
[super draw];
|
2021-09-26 01:07:34 +00:00
|
|
|
[self mvprintf:{0, 0}, "%*d", xlen, axis.value];
|
2021-09-25 05:22:19 +00:00
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
-(int)rows
|
|
|
|
{
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
-(View *)viewAtRow:(int)row forColumn:(TableViewColumn *)column
|
|
|
|
{
|
|
|
|
if ([column name] == "axis") {
|
|
|
|
return [NameView withName:sprintf("%d", axis.axis)];
|
|
|
|
}
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|