led improvement & bump build

master
esterTion 2020-03-03 11:10:27 +08:00
parent 6861777cf6
commit be2f1d9add
3 changed files with 33 additions and 22 deletions

View File

@ -334,7 +334,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2; CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_TEAM = K9CP5766XY; DEVELOPMENT_TEAM = K9CP5766XY;
INFOPLIST_FILE = "Brokenithm-iOS/Info.plist"; INFOPLIST_FILE = "Brokenithm-iOS/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 8.0; IPHONEOS_DEPLOYMENT_TARGET = 8.0;
@ -342,7 +342,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.1; MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.estertion.brokenithm; PRODUCT_BUNDLE_IDENTIFIER = com.estertion.brokenithm;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";
@ -357,7 +357,7 @@
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_IDENTITY = "Apple Development"; CODE_SIGN_IDENTITY = "Apple Development";
CODE_SIGN_STYLE = Automatic; CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 2; CURRENT_PROJECT_VERSION = 3;
DEVELOPMENT_TEAM = K9CP5766XY; DEVELOPMENT_TEAM = K9CP5766XY;
INFOPLIST_FILE = "Brokenithm-iOS/Info.plist"; INFOPLIST_FILE = "Brokenithm-iOS/Info.plist";
IPHONEOS_DEPLOYMENT_TARGET = 8.0; IPHONEOS_DEPLOYMENT_TARGET = 8.0;
@ -365,7 +365,7 @@
"$(inherited)", "$(inherited)",
"@executable_path/Frameworks", "@executable_path/Frameworks",
); );
MARKETING_VERSION = 1.1; MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = com.estertion.brokenithm; PRODUCT_BUNDLE_IDENTIFIER = com.estertion.brokenithm;
PRODUCT_NAME = "$(TARGET_NAME)"; PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = ""; PROVISIONING_PROFILE_SPECIFIER = "";

View File

@ -17,11 +17,11 @@
</PostActions> </PostActions>
<BuildActionEntries> <BuildActionEntries>
<BuildActionEntry <BuildActionEntry
buildForTesting = "YES" buildForTesting = "NO"
buildForRunning = "YES" buildForRunning = "YES"
buildForProfiling = "YES" buildForProfiling = "NO"
buildForArchiving = "YES" buildForArchiving = "NO"
buildForAnalyzing = "YES"> buildForAnalyzing = "NO">
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "1968E72024086C2100784829" BlueprintIdentifier = "1968E72024086C2100784829"
@ -67,8 +67,7 @@
savedToolIdentifier = "" savedToolIdentifier = ""
useCustomWorkingDirectory = "NO" useCustomWorkingDirectory = "NO"
debugDocumentVersioning = "YES"> debugDocumentVersioning = "YES">
<BuildableProductRunnable <MacroExpansion>
runnableDebuggingMode = "0">
<BuildableReference <BuildableReference
BuildableIdentifier = "primary" BuildableIdentifier = "primary"
BlueprintIdentifier = "1968E72024086C2100784829" BlueprintIdentifier = "1968E72024086C2100784829"
@ -76,7 +75,7 @@
BlueprintName = "Brokenithm-iOS" BlueprintName = "Brokenithm-iOS"
ReferencedContainer = "container:Brokenithm-iOS.xcodeproj"> ReferencedContainer = "container:Brokenithm-iOS.xcodeproj">
</BuildableReference> </BuildableReference>
</BuildableProductRunnable> </MacroExpansion>
</ProfileAction> </ProfileAction>
<AnalyzeAction <AnalyzeAction
buildConfiguration = "Debug"> buildConfiguration = "Debug">

View File

@ -34,8 +34,13 @@
self.airIOView = [[UIView alloc] initWithFrame:CGRectMake(0, offsetY, screenWidth, screenHeight*0.4)]; self.airIOView = [[UIView alloc] initWithFrame:CGRectMake(0, offsetY, screenWidth, screenHeight*0.4)];
offsetY += screenHeight*0.4; offsetY += screenHeight*0.4;
self.sliderIOView = [[UIView alloc] initWithFrame:CGRectMake(0, offsetY, screenWidth, sliderHeight)]; self.sliderIOView = [[UIView alloc] initWithFrame:CGRectMake(0, offsetY, screenWidth, sliderHeight)];
self.airIOView.layer.borderWidth = 1.0f;
self.airIOView.layer.borderColor = [UIColor whiteColor].CGColor;
self.sliderIOView.layer.borderWidth = 1.0f;
self.sliderIOView.layer.borderColor = [UIColor whiteColor].CGColor;
[self.view addSubview:self.airIOView]; [self.view addSubview:self.airIOView];
[self.view addSubview:self.sliderIOView]; [self.view addSubview:self.sliderIOView];
self.ledBackground = [CAGradientLayer layer]; self.ledBackground = [CAGradientLayer layer];
self.ledBackground.frame = CGRectMake(0, 0, screenWidth, sliderHeight); self.ledBackground.frame = CGRectMake(0, 0, screenWidth, sliderHeight);
[self.sliderIOView.layer addSublayer:self.ledBackground]; [self.sliderIOView.layer addSublayer:self.ledBackground];
@ -43,21 +48,26 @@
self.ledBackground.endPoint = CGPointMake(0,0); self.ledBackground.endPoint = CGPointMake(0,0);
{ {
float pointOffset = 0; float pointOffset = 0;
NSMutableArray *locations = [NSMutableArray arrayWithCapacity:33]; float gapSmall = 1.0/16/8, gapBig = 1.0/16*6/8;
for (int i=0; i<33; i++) { NSMutableArray *locations = [NSMutableArray arrayWithCapacity:49];
NSNumber *loc = [NSNumber numberWithFloat:pointOffset]; for (int i=0,off=-1; i<16; i++) {
locations[i] = loc; locations[++off] = [NSNumber numberWithFloat:pointOffset];
pointOffset += 1.0/32; pointOffset += gapSmall;
locations[++off] = [NSNumber numberWithFloat:pointOffset];
pointOffset += gapBig;
locations[++off] = [NSNumber numberWithFloat:pointOffset];
pointOffset += gapSmall;
} }
locations[48] = @1;
self.ledBackground.locations = locations; self.ledBackground.locations = locations;
} }
struct CGColor *whiteColor = [UIColor whiteColor].CGColor; struct CGColor *gridBorderColor = [UIColor colorWithWhite:1.0 alpha:0.2].CGColor;
float airOffset=0, airHeight = screenHeight*0.4/6; float airOffset=0, airHeight = screenHeight*0.4/6;
for (int i=0;i<6;i++) { for (int i=0;i<6;i++) {
UIView *airInput = [[UIView alloc] initWithFrame:CGRectMake(0, airOffset, screenWidth, airHeight)]; UIView *airInput = [[UIView alloc] initWithFrame:CGRectMake(0, airOffset, screenWidth, airHeight)];
airInput.layer.borderWidth = 1.0f; airInput.layer.borderWidth = 1.0f;
airInput.layer.borderColor = whiteColor; airInput.layer.borderColor = gridBorderColor;
airOffset += airHeight; airOffset += airHeight;
[self.airIOView addSubview:airInput]; [self.airIOView addSubview:airInput];
} }
@ -66,7 +76,7 @@
for (int i=0;i<16;i++) { for (int i=0;i<16;i++) {
UIView *sliderInput = [[UIView alloc] initWithFrame:CGRectMake(sliderOffset, 0, sliderWidth, sliderHeight)]; UIView *sliderInput = [[UIView alloc] initWithFrame:CGRectMake(sliderOffset, 0, sliderWidth, sliderHeight)];
sliderInput.layer.borderWidth = 1.0f; sliderInput.layer.borderWidth = 1.0f;
sliderInput.layer.borderColor = whiteColor; sliderInput.layer.borderColor = gridBorderColor;
sliderOffset += sliderWidth; sliderOffset += sliderWidth;
[self.sliderIOView addSubview:sliderInput]; [self.sliderIOView addSubview:sliderInput];
} }
@ -76,7 +86,7 @@
NSLog(@"server created"); NSLog(@"server created");
dispatch_async(dispatch_get_main_queue(), ^(){ dispatch_async(dispatch_get_main_queue(), ^(){
char ledDataChar[32*3] = {0,254,254,0,254,254,0,254,254,0,0,0,254,254,254,254,254,254,254,254,254,0,0,0,10,10,10,10,10,10,10,10,10,0,0,0,0,254,128,0,254,128,0,254,128,0,254,128,0,254,128,0,254,128,0,254,128,0,0,0,0,0,254,0,0,254,0,0,254,0,0,254,0,0,254,0,0,0,0,0,254,0,0,254,0,0,254,0,0,254,0,0,254,0,0,0}; char ledDataChar[32*3] = {0,254,254,254,254,254,0,254,254,0,0,0,254,254,254,254,254,254,254,254,254,0,0,0,10,10,10,10,10,10,10,10,10,0,0,0,0,254,128,0,254,128,0,254,128,0,254,128,0,254,128,0,254,128,0,254,128,0,0,0,0,0,254,0,0,254,0,0,254,0,0,254,0,0,254,0,0,0,0,0,254,0,0,254,0,0,254,0,0,254,0,0,254,0,0,0};
NSData *ledData = [NSData dataWithBytes:ledDataChar length:32*3]; NSData *ledData = [NSData dataWithBytes:ledDataChar length:32*3];
[self updateLed:ledData]; [self updateLed:ledData];
NSLog(@"displayed demo led"); NSLog(@"displayed demo led");
@ -88,13 +98,15 @@
NSMutableArray *colorArr = [NSMutableArray arrayWithCapacity:33]; NSMutableArray *colorArr = [NSMutableArray arrayWithCapacity:33];
colorArr[0] = (__bridge id)([UIColor colorWithWhite:0 alpha:0].CGColor); colorArr[0] = (__bridge id)([UIColor colorWithWhite:0 alpha:0].CGColor);
uint8_t *rgb = (uint8_t*)rgbData.bytes; uint8_t *rgb = (uint8_t*)rgbData.bytes;
for (int i=0; i<32; i++) { for (int i=0, off=0; i<32; i++) {
float r = rgb[i*3+1], g = rgb[i*3+2], b = rgb[i*3]; float r = rgb[i*3+1], g = rgb[i*3+2], b = rgb[i*3];
r /= 255.0; r /= 255.0;
g /= 255.0; g /= 255.0;
b /= 255.0; b /= 255.0;
UIColor *color = [UIColor colorWithRed:r green:g blue:b alpha:1]; UIColor *color = [UIColor colorWithRed:r green:g blue:b alpha:1];
colorArr[i+1] = (__bridge id)color.CGColor; colorArr[++off] = (__bridge id)color.CGColor;
off += (i+1)&1;
colorArr[off] = (__bridge id)color.CGColor;
} }
self.ledBackground.colors = colorArr; self.ledBackground.colors = colorArr;
[self.ledBackground setNeedsDisplay]; [self.ledBackground setNeedsDisplay];