Permalink
Browse files

Is able to show YAAMP balance with their different styles

Add "balancemode" to yaamp settings, from 0 to 4.
  • Loading branch information...
1 parent bc49714 commit 35822ae038d847d9ac496d05a2a7d58cfa906d50 @KBomba committed Feb 7, 2015
Showing with 23 additions and 1 deletion.
  1. +1 −0 MinerControl/MinerControl.conf
  2. +22 −1 MinerControl/Services/YaampService.cs
@@ -71,6 +71,7 @@
"yaamp": {
"account": "1PMj3nrVq5CH4TXdJSnHHLPdvcXinjG72y",
"pricemode": 1,
+ "balancemode": 0,
"sparam1": "-o stratum+tcp://yaamp.com",
"sparam2": "-p x",
"algos": [
@@ -21,6 +21,7 @@ public class YaampService : ServiceBase<YaampPriceEntry>
// }
private int _priceMode;
+ private int _balanceMode;
public YaampService()
{
@@ -34,6 +35,8 @@ public override void Initialize(IDictionary<string, object> data)
if (data.ContainsKey("pricemode"))
_priceMode = int.Parse(data["pricemode"].ToString());
+ if (data.ContainsKey("balancemode"))
+ _balanceMode = int.Parse(data["balancemode"].ToString());
var items = data["algos"] as object[];
foreach (object rawitem in items)
@@ -95,7 +98,25 @@ private void ProcessBalances(object jsonData)
lock (MiningEngine)
{
- Balance = data["unpaid"].ExtractDecimal();
+ switch (_balanceMode)
+ {
+ case 1:
+ Balance = data["balance"].ExtractDecimal();
+ break;
+ case 2:
+ Balance = data["unsold"].ExtractDecimal();
+ break;
+ case 3:
+ Balance = data["paid"].ExtractDecimal();
+ break;
+ case 4:
+ Balance = data["total"].ExtractDecimal();
+ break;
+ default:
+ Balance = data["unpaid"].ExtractDecimal();
+ break;
+ }
+
foreach (YaampPriceEntry entry in PriceEntries)
entry.AcceptSpeed = 0;

0 comments on commit 35822ae

Please sign in to comment.