Skip to content

Commit

Permalink
1.5.6b
Browse files Browse the repository at this point in the history
  • Loading branch information
fabulouspanda committed Jan 7, 2014
1 parent fae11aa commit a8f68ca
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 56 deletions.
8 changes: 4 additions & 4 deletions MacMiner/AppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ - (void)mobilePost
}

NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init];
NSString *urlString = [NSString stringWithFormat:@"https://mobileminer.azurewebsites.net/api/MiningStatisticsInput?emailAddress=%@&applicationKey=%@&machineName=%@&apiKey=26efrOXrizmEF3", email, appID, machineName];
NSString *urlString = [NSString stringWithFormat:@"http://mobileminer.azurewebsites.net/api/MiningStatisticsInput?emailAddress=%@&applicationKey=%@&machineName=%@&apiKey=26efrOXrizmEF3", email, appID, machineName];
// NSLog(urlString);
[request setURL:[NSURL URLWithString:urlString]];
[request setHTTPMethod:@"POST"];
Expand Down Expand Up @@ -306,11 +306,11 @@ - (BOOL)theConnection:(NSURLConnection *)theConnection canAuthenticateAgainstPro
}

- (void)theConnection:(NSURLConnection *)theConnection didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge {
if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust])
// if ([challenge.protectionSpace.authenticationMethod isEqualToString:NSURLAuthenticationMethodServerTrust])
// if (... user allows connection despite bad certificate ...)
[challenge.sender useCredential:[NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust] forAuthenticationChallenge:challenge];
// [challenge.sender useCredential:[NSURLCredential credentialForTrust:challenge.protectionSpace.serverTrust] forAuthenticationChallenge:challenge];

// [challenge.sender continueWithoutCredentialForAuthenticationChallenge:challenge];
[challenge.sender continueWithoutCredentialForAuthenticationChallenge:challenge];
}

@end
76 changes: 25 additions & 51 deletions MacMiner/asicMiner.m
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ -(void)stopAsicMiner
{
// change the button's title back for the next search
[self.asicStartButton setTitle:@"Start"];
[self stopToggling];
// [self stopToggling];
// This stops the task and calls our callback (-processFinished)
[asicTask stopTask];
findRunning=NO;
Expand All @@ -88,7 +88,7 @@ - (IBAction)start:(id)sender
// change the button's title back for the next search
[self.asicStartButton setTitle:@"Start"];
self.asicStartButton.tag = 1;
[self stopToggling];
// [self stopToggling];
// This stops the task and calls our callback (-processFinished)
[asicTask stopTask];
findRunning=NO;
Expand Down Expand Up @@ -122,7 +122,7 @@ - (IBAction)start:(id)sender



self.prefs = [NSUserDefaults standardUserDefaults];


[self.prefs synchronize];

Expand Down Expand Up @@ -199,7 +199,6 @@ - (void)toggleLoopTimerFired:(NSTimer*)timer

if (self.asicAPIOutput.string.length >= 30) {

self.prefs = [NSUserDefaults standardUserDefaults];

[self.prefs synchronize];

Expand All @@ -222,9 +221,7 @@ - (void)toggleLoopTimerFired:(NSTimer*)timer

strCount += 1;
for (int i = 0; i < strCount; i++) {
NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];

[prefs synchronize];


NSString *pgaCount = [NSString stringWithFormat:@"GPU%d", i];
NSString *pgaAPIData = [self getDataBetweenFromString:self.asicAPIOutput.string leftString:pgaCount rightString:@")" leftOffset:0];
Expand Down Expand Up @@ -255,7 +252,7 @@ - (void)toggleLoopTimerFired:(NSTimer*)timer



NSString *apiPoolString = [prefs stringForKey:@"defaultPoolValue"];
NSString *apiPoolString = [self.prefs stringForKey:@"defaultPoolValue"];

NSString *pgaStats = [NSString stringWithFormat:@"{\"MinerName\":\"MacMiner\",\"CoinSymbol\":\"BTC\",\"CoinName\":\"Bitcoin\",\"Algorithm\":\"SHA-256\",\"Kind\":\"GPU\",\"Index\":0,\"Enabled\":true,\"Status\":\"%@\",\"Temperature\":%@,\"FanSpeed\":0,\"FanPercent\":0,\"GpuClock\":0,\"MemoryClock\":0,\"GpuVoltage\":0,\"GpuActivity\":0,\"PowerTune\":0,\"AverageHashrate\":%@,\"CurrentHashrate\":%@,\"AcceptedShares\":%@,\"RejectedShares\":%@,\"HardwareErrors\":%@,\"Utility\":%@,\"Intensity\":\"%@\",\"Name\":\"%@\",\"DeviceID\":0,\"PoolIndex\":0,\"RejectedSharesPercent\":0,\"HardwareErrorsPercent\":0,\"FullName\":\"%@\",\"PoolName\":\"%@\"}", apiStatus, @"0", apiHash5s, apiHashAv, apiAccepted, apiRejected, apiHWError, apiUtility, apiIntensity, pgaCount, apiName, apiPoolString];

Expand All @@ -271,7 +268,6 @@ - (void)toggleLoopTimerFired:(NSTimer*)timer
apiPoolString = nil;
apiName = nil;
pgaStats = nil;
prefs = nil;

}

Expand All @@ -285,11 +281,6 @@ - (void)toggleLoopTimerFired:(NSTimer*)timer



NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];

[prefs synchronize];



NSString *pgaCount = [NSString stringWithFormat:@"PGA%d", i];

Expand Down Expand Up @@ -328,7 +319,7 @@ - (void)toggleLoopTimerFired:(NSTimer*)timer
[self.apiTableViewController addObject:[NSDictionary dictionaryWithObjectsAndKeys:pgaCount,@"name",apiStatus,@"status",mhs5S,@"uid",mhsAv,@"average",apiAccepted,@"accepted",apiRejected,@"rejected",apiHWError,@"error",apiTemp,@"temp",apiUtility,@"utility",apiDiff1,@"diff1",apiDiffAcc,@"diffaccepted",apiDiffRej,@"diffrejected",@" ",@"intensity",nil]];


NSString *apiPoolString = [prefs stringForKey:@"defaultPoolValue"];
NSString *apiPoolString = [self.prefs stringForKey:@"defaultPoolValue"];

NSString *pgaStats = [NSString stringWithFormat:@"{\"MinerName\":\"MacMiner\",\"CoinSymbol\":\"BTC\",\"CoinName\":\"Bitcoin\",\"Algorithm\":\"SHA-256\",\"Kind\":\"PGA\",\"Index\":%d,\"Enabled\":true,\"Status\":\"%@\",\"Temperature\":%@,\"FanSpeed\":0,\"FanPercent\":0,\"GpuClock\":0,\"MemoryClock\":0,\"GpuVoltage\":0,\"GpuActivity\":0,\"PowerTune\":0,\"AverageHashrate\":%@,\"CurrentHashrate\":%@,\"AcceptedShares\":%@,\"RejectedShares\":%@,\"HardwareErrors\":%@,\"Utility\":%@,\"Intensity\":\"0\",\"Name\":\"%@\",\"DeviceID\":0,\"PoolIndex\":0,\"RejectedSharesPercent\":0,\"HardwareErrorsPercent\":0,\"FullName\":\"%@\",\"PoolName\":\"%@\"}", i, apiStatus, apiTemp, apiHash5s, apiHashAv, apiAccepted, apiRejected, apiHWError, apiUtility, pgaCount, apiName, apiPoolString];

Expand All @@ -351,7 +342,7 @@ - (void)toggleLoopTimerFired:(NSTimer*)timer
[self.apiTableViewController addObject:[NSDictionary dictionaryWithObjectsAndKeys:pgaCount,@"name",apiStatus,@"status",mhs5S,@"uid",mhsAv,@"average",apiAccepted,@"accepted",apiRejected,@"rejected",apiHWError,@"error",apiTemp,@"temp",apiUtility,@"utility",apiDiff1,@"diff1",apiDiffAcc,@"diffaccepted",apiDiffRej,@"diffrejected",@" ",@"intensity",nil]];


NSString *apiPoolString = [prefs stringForKey:@"defaultPoolValue"];
NSString *apiPoolString = [self.prefs stringForKey:@"defaultPoolValue"];

NSString *pgaStats = [NSString stringWithFormat:@"{\"MinerName\":\"MacMiner\",\"CoinSymbol\":\"BTC\",\"CoinName\":\"Bitcoin\",\"Algorithm\":\"SHA-256\",\"Kind\":\"PGA\",\"Index\":%d,\"Enabled\":true,\"Status\":\"%@\",\"Temperature\":%@,\"FanSpeed\":0,\"FanPercent\":0,\"GpuClock\":0,\"MemoryClock\":0,\"GpuVoltage\":0,\"GpuActivity\":0,\"PowerTune\":0,\"AverageHashrate\":%@,\"CurrentHashrate\":%@,\"AcceptedShares\":%@,\"RejectedShares\":%@,\"HardwareErrors\":%@,\"Utility\":%@,\"Intensity\":\"0\",\"Name\":\"%@\",\"DeviceID\":0,\"PoolIndex\":0,\"RejectedSharesPercent\":0,\"HardwareErrorsPercent\":0,\"FullName\":\"%@\",\"PoolName\":\"%@\"}", i, apiStatus, apiTemp, apiHash5s, apiHashAv, apiAccepted, apiRejected, apiHWError, apiUtility, pgaCount, apiName, apiPoolString];

Expand Down Expand Up @@ -385,7 +376,6 @@ - (void)toggleLoopTimerFired:(NSTimer*)timer
apiDiffAcc = nil;
apiDiffRej = nil;

prefs = nil;


}
Expand All @@ -399,9 +389,6 @@ - (void)toggleLoopTimerFired:(NSTimer*)timer

for (int i = 0; i >= 0; i++) {

NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];

[prefs synchronize];


NSString *pgaCount = [NSString stringWithFormat:@"ASC%d", i];
Expand Down Expand Up @@ -442,7 +429,7 @@ - (void)toggleLoopTimerFired:(NSTimer*)timer
[self.apiTableViewController addObject:[NSDictionary dictionaryWithObjectsAndKeys:pgaCount,@"name",apiStatus,@"status",mhs5S,@"uid",mhsAv,@"average",apiAccepted,@"accepted",apiRejected,@"rejected",apiHWError,@"error",apiTemp,@"temp",apiUtility,@"utility",apiDiff1,@"diff1",apiDiffAcc,@"diffaccepted",apiDiffRej,@"diffrejected",@" ",@"intensity",nil]];


NSString *apiPoolString = [prefs stringForKey:@"defaultPoolValue"];
NSString *apiPoolString = [self.prefs stringForKey:@"defaultPoolValue"];

NSString *pgaStats = [NSString stringWithFormat:@"{\"MinerName\":\"MacMiner\",\"CoinSymbol\":\"BTC\",\"CoinName\":\"Bitcoin\",\"Algorithm\":\"SHA-256\",\"Kind\":\"ASC\",\"Index\":%d,\"Enabled\":true,\"Status\":\"%@\",\"Temperature\":%@,\"FanSpeed\":0,\"FanPercent\":0,\"GpuClock\":0,\"MemoryClock\":0,\"GpuVoltage\":0,\"GpuActivity\":0,\"PowerTune\":0,\"AverageHashrate\":%@,\"CurrentHashrate\":%@,\"AcceptedShares\":%@,\"RejectedShares\":%@,\"HardwareErrors\":%@,\"Utility\":%@,\"Intensity\":\"0\",\"Name\":\"%@\",\"DeviceID\":0,\"PoolIndex\":0,\"RejectedSharesPercent\":0,\"HardwareErrorsPercent\":0,\"FullName\":\"%@\",\"PoolName\":\"%@\"}", i, apiStatus, apiTemp, apiHash5s, apiHashAv, apiAccepted, apiRejected, apiHWError, apiUtility, pgaCount, apiName, apiPoolString];

Expand All @@ -466,7 +453,7 @@ - (void)toggleLoopTimerFired:(NSTimer*)timer
[self.apiTableViewController addObject:[NSDictionary dictionaryWithObjectsAndKeys:pgaCount,@"name",apiStatus,@"status",mhs5S,@"uid",mhsAv,@"average",apiAccepted,@"accepted",apiRejected,@"rejected",apiHWError,@"error",apiTemp,@"temp",apiUtility,@"utility",apiDiff1,@"diff1",apiDiffAcc,@"diffaccepted",apiDiffRej,@"diffrejected",@" ",@"intensity",nil]];


NSString *apiPoolString = [prefs stringForKey:@"defaultPoolValue"];
NSString *apiPoolString = [self.prefs stringForKey:@"defaultPoolValue"];

NSString *pgaStats = [NSString stringWithFormat:@"{\"MinerName\":\"MacMiner\",\"CoinSymbol\":\"BTC\",\"CoinName\":\"Bitcoin\",\"Algorithm\":\"SHA-256\",\"Kind\":\"ASC\",\"Index\":%d,\"Enabled\":true,\"Status\":\"%@\",\"Temperature\":%@,\"FanSpeed\":0,\"FanPercent\":0,\"GpuClock\":0,\"MemoryClock\":0,\"GpuVoltage\":0,\"GpuActivity\":0,\"PowerTune\":0,\"AverageHashrate\":%@,\"CurrentHashrate\":%@,\"AcceptedShares\":%@,\"RejectedShares\":%@,\"HardwareErrors\":%@,\"Utility\":%@,\"Intensity\":\"0\",\"Name\":\"%@\",\"DeviceID\":0,\"PoolIndex\":0,\"RejectedSharesPercent\":0,\"HardwareErrorsPercent\":0,\"FullName\":\"%@\",\"PoolName\":\"%@\"}", i, apiStatus, apiTemp, apiHash5s, apiHashAv, apiAccepted, apiRejected, apiHWError, apiUtility, pgaCount, apiName, apiPoolString];

Expand All @@ -486,9 +473,6 @@ - (void)toggleLoopTimerFired:(NSTimer*)timer
}




prefs = nil;
pgaCount = nil;
pgaAPIData = nil;
apiStatus = nil;
Expand Down Expand Up @@ -524,17 +508,17 @@ - (void)toggleLoopTimerFired:(NSTimer*)timer

}

self.prefs = nil;

}

- (void)toggleTimerFired:(NSTimer*)timer
{

NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];


[prefs synchronize];
[self.prefs synchronize];

NSString *speechSetting = [prefs objectForKey:@"enableSpeech"];
NSString *speechSetting = [self.prefs objectForKey:@"enableSpeech"];
if ([speechSetting isEqual: @"silence"]) {

}
Expand All @@ -544,7 +528,7 @@ - (void)toggleTimerFired:(NSTimer*)timer
[self.speechSynth startSpeakingString:@"Mining Stopped"];
}
speechSetting = nil;
prefs = nil;


if ([self.megaHashLabel.stringValue isNotEqualTo:@"0"]) {
self.megaHashLabel.tag = 1;
Expand Down Expand Up @@ -611,15 +595,17 @@ - (void)toggleTimerFired:(NSTimer*)timer
- (void)taskTwoWrapper:(taskTwoWrapper *)taskTwoWrapper didProduceOutput:(NSString *)output
{

output = [output substringToIndex:[output length]-1];

if ([output rangeOfString:@"Reply was"].location != NSNotFound) {



if([output hasPrefix:@"R"] && [output hasSuffix:@")"]) {


self.asicAPIOutput.string = output;


}

}
output = nil;
Expand Down Expand Up @@ -674,11 +660,10 @@ - (void)startToggling
- (void)taskWrapper:(TaskWrapper *)taskWrapper didProduceOutput:(NSString *)output
{

NSUserDefaults *prefs = [NSUserDefaults standardUserDefaults];

[prefs synchronize];
[self.prefs synchronize];

NSString *speechSetting = [prefs objectForKey:@"enableSpeech"];
NSString *speechSetting = [self.prefs objectForKey:@"enableSpeech"];
if ([speechSetting isEqual: @"silence"]) {

}
Expand Down Expand Up @@ -713,10 +698,6 @@ - (void)taskWrapper:(TaskWrapper *)taskWrapper didProduceOutput:(NSString *)outp
}


self.prefs = [NSUserDefaults standardUserDefaults];

[self.prefs synchronize];


if ([[self.prefs objectForKey:@"showDockReading"] isEqualTo:@"hide"]) {
AppDelegate *appDelegate = (AppDelegate *)[[NSApplication sharedApplication] delegate];
Expand Down Expand Up @@ -754,7 +735,6 @@ - (void)taskWrapper:(TaskWrapper *)taskWrapper didProduceOutput:(NSString *)outp
self.asicOutputView.string = newOutput;
newOutput = nil;

self.prefs = [NSUserDefaults standardUserDefaults];

[self.prefs synchronize];

Expand All @@ -771,7 +751,6 @@ - (void)taskWrapper:(TaskWrapper *)taskWrapper didProduceOutput:(NSString *)outp
}

self.logLength = nil;
self.prefs = nil;

}

Expand Down Expand Up @@ -905,7 +884,7 @@ - (IBAction)addNetworkedMinerApply:(id)sender

// [self.prefs setObject:self.minerAddressesArray forKey:@"ipAddress"];

// [self.prefs synchronize];
[self.prefs synchronize];

[self.addNetworkedMinerWindow orderOut:sender];
}
Expand All @@ -932,7 +911,7 @@ -(void)awakeFromNib
asicTask=nil;


self.prefs = [NSUserDefaults standardUserDefaults];


// getting an NSString
NSString *asicOptionsString = [self.prefs stringForKey:@"asicOptionsValue"];
Expand All @@ -941,7 +920,7 @@ -(void)awakeFromNib
if (asicOptionsString != nil) {
[self.asicOptionsView setStringValue:asicOptionsString];
}
self.prefs = nil;

}

- (IBAction)asicMinerToggle:(id)sender {
Expand All @@ -967,7 +946,6 @@ - (IBAction)optionsToggle:(id)sender {
[self.asicOptionsButton setState:NSOnState];
[self.asicOptionsWindow orderFront:sender];

self.prefs = [NSUserDefaults standardUserDefaults];

[self.prefs synchronize];

Expand Down Expand Up @@ -1007,8 +985,6 @@ - (IBAction)optionsToggle:(id)sender {
cpuThreads = nil;


self.prefs = nil;

}


Expand All @@ -1018,8 +994,7 @@ - (IBAction)optionsToggle:(id)sender {


- (IBAction)optionsApply:(id)sender {

self.prefs = [NSUserDefaults standardUserDefaults];



if (self.asicNoGpuButton.state == NSOffState) {
Expand Down Expand Up @@ -1055,8 +1030,7 @@ - (IBAction)optionsApply:(id)sender {

[self.asicOptionsButton setState:NSOffState];
[self.asicOptionsWindow orderOut:sender];

self.prefs = nil;


}

Expand Down
2 changes: 1 addition & 1 deletion MacMiner/en.lproj/MainMenu.xib
Original file line number Diff line number Diff line change
Expand Up @@ -1305,7 +1305,7 @@
<outlet property="delegate" destination="1778" id="1798"/>
</connections>
</window>
<window title="Setup" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" releasedWhenClosed="NO" showsToolbarButton="NO" visibleAtLaunch="NO" animationBehavior="default" id="2469" customClass="NSPanel">
<window title="Pool Setup" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" oneShot="NO" releasedWhenClosed="NO" showsToolbarButton="NO" visibleAtLaunch="NO" animationBehavior="default" id="2469" customClass="NSPanel">
<windowStyleMask key="styleMask" titled="YES" utility="YES" HUD="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="972" y="477" width="679" height="526"/>
Expand Down

0 comments on commit a8f68ca

Please sign in to comment.