Skip to content

Commit

Permalink
Autolykos+Zilliqa try fix 1
Browse files Browse the repository at this point in the history
  • Loading branch information
angelbbs committed Jun 28, 2021
1 parent 29b8738 commit bc7726b
Show file tree
Hide file tree
Showing 26 changed files with 645 additions and 392 deletions.
Binary file modified LatestBuild/nhmlffLatest.zip
Binary file not shown.
9 changes: 6 additions & 3 deletions NiceHashMiner/Algorithms/Algorithm.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Windows.Forms;
using NiceHashMiner.Devices;
using NiceHashMiner.Stats;
using NiceHashMiner.Switching;
Expand Down Expand Up @@ -40,7 +41,7 @@ public class Algorithm
/// <summary>
/// Used for miner ALGO flag parameter
/// </summary>
public readonly string MinerName;
public readonly string AlgorithmNameCustom;

#endregion

Expand Down Expand Up @@ -140,14 +141,14 @@ public class Algorithm

#endregion

public Algorithm(MinerBaseType minerBaseType, AlgorithmType niceHashID, string minerName = "", bool enabled = true)
public Algorithm(MinerBaseType minerBaseType, AlgorithmType niceHashID, string _AlgorithmNameCustom = "WOW!UnknownAlgo", bool enabled = true)
{
NiceHashID = niceHashID;
AlgorithmName = AlgorithmNiceHashNames.GetName(NiceHashID);
MinerBaseTypeName = Enum.GetName(typeof(MinerBaseType), minerBaseType);
AlgorithmStringID = MinerBaseTypeName + "_" + AlgorithmName;
MinerBaseType = minerBaseType;
MinerName = minerName;
AlgorithmNameCustom = _AlgorithmNameCustom;
ExtraLaunchParameters = "";
LessThreads = 0;
Enabled = enabled;
Expand Down Expand Up @@ -187,11 +188,13 @@ public virtual string CurPayingRate
get
{
var rate = International.GetText("BenchmarkRatioRateN_A");

if (BenchmarkSpeed > 0 && NHSmaData.TryGetPaying(NiceHashID, out var paying))
{
var payingRate = BenchmarkSpeed * paying * Mult;
rate = payingRate.ToString("F8");
}

return rate;
}
set
Expand Down
66 changes: 58 additions & 8 deletions NiceHashMiner/Algorithms/DualAlgorithm.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using NiceHashMiner.Switching;
using NiceHashMinerLegacy.Common.Enums;

Expand All @@ -25,7 +26,25 @@ public class DualAlgorithm : Algorithm
/// <summary>
/// AlgorithmType that uniquely identifies this choice of primary/secondary types
/// </summary>
public override AlgorithmType DualNiceHashID => Helpers.DualAlgoFromAlgos(NiceHashID, SecondaryNiceHashID);
//public override AlgorithmType DualNiceHashID => Helpers.DualAlgoFromAlgos(NiceHashID, SecondaryNiceHashID);
public override AlgorithmType DualNiceHashID
{
get
{
if (NiceHashID == AlgorithmType.Autolykos)
{
switch (SecondaryNiceHashID)
{
case AlgorithmType.DaggerHashimoto:
return AlgorithmType.AutolykosZil;
}
}

return NiceHashID;
}
}



#endregion

Expand Down Expand Up @@ -125,7 +144,7 @@ public SortedSet<int> AllIntensities
}

#endregion

public readonly string DualAlgorithmNameCustom;
#region Mining settings

/// <summary>
Expand Down Expand Up @@ -246,15 +265,15 @@ public override double PowerUsage
#endregion


public DualAlgorithm(MinerBaseType minerBaseType, AlgorithmType niceHashID, AlgorithmType secondaryNiceHashID)
public DualAlgorithm(MinerBaseType minerBaseType, AlgorithmType niceHashID, AlgorithmType secondaryNiceHashID, string _DualAlgorithmNameCustom = "WOW!UnknownDualAlgo")
: base(minerBaseType, niceHashID, "")
{
SecondaryNiceHashID = secondaryNiceHashID;

AlgorithmName = AlgorithmNiceHashNames.GetName(DualNiceHashID); // needed to add secondary
SecondaryAlgorithmName = AlgorithmNiceHashNames.GetName(secondaryNiceHashID);
AlgorithmStringID = MinerBaseTypeName + "_" + AlgorithmName;

DualAlgorithmNameCustom = _DualAlgorithmNameCustom;
SecondaryBenchmarkSpeed = 0.0d;

IntensitySpeeds = new Dictionary<int, double>();
Expand All @@ -277,7 +296,13 @@ public override string CurPayingRate
rate = payingRate.ToString("F8");
}

if (SecondaryBenchmarkSpeed > 0 && NHSmaData.TryGetPaying(SecondaryNiceHashID, out var secPaying))
if (NiceHashID == AlgorithmType.Autolykos && SecondaryNiceHashID == AlgorithmType.DaggerHashimoto && NHSmaData.TryGetPaying(SecondaryNiceHashID, out var secPaying2))//ZIL
{

payingRate += SecondaryBenchmarkSpeed * (secPaying2 / 30) * Mult;
rate = payingRate.ToString("F8");
}
else if (SecondaryBenchmarkSpeed > 0 && NHSmaData.TryGetPaying(SecondaryNiceHashID, out var secPaying))
{
payingRate += SecondaryBenchmarkSpeed * secPaying * Mult;
rate = payingRate.ToString("F8");
Expand All @@ -288,13 +313,29 @@ public override string CurPayingRate
}

public string SecondaryCurPayingRatio
{
get
{
var ratio = International.GetText("BenchmarkRatioRateN_A");
if (NiceHashID == AlgorithmType.Autolykos && SecondaryNiceHashID == AlgorithmType.DaggerHashimoto && NHSmaData.TryGetPaying(SecondaryNiceHashID, out var paying))//ZIL
{
ratio = (paying / 30).ToString("F8");
} else if (NHSmaData.TryGetPaying(SecondaryNiceHashID, out var paying2))
{
ratio = paying2.ToString("F8");
}

return ratio;
}
}
public string SecondaryCurPayingRatioZIL
{
get
{
var ratio = International.GetText("BenchmarkRatioRateN_A");
if (NHSmaData.TryGetPaying(SecondaryNiceHashID, out var paying))
{
ratio = paying.ToString("F8");
ratio = (paying / 30).ToString("F8");
}

return ratio;
Expand Down Expand Up @@ -323,9 +364,18 @@ public string SecondaryBenchmarkSpeedString()
public override void UpdateCurProfit(Dictionary<AlgorithmType, double> profits)
{
base.UpdateCurProfit(profits);
profits.TryGetValue(SecondaryNiceHashID, out var secPaying);
if (NiceHashID == AlgorithmType.Autolykos && SecondaryNiceHashID == AlgorithmType.DaggerHashimoto)//ZIL
{
profits.TryGetValue(SecondaryNiceHashID, out var secPaying2);
SecondaryCurNhmSmaDataVal = secPaying2 / 30;

SecondaryCurNhmSmaDataVal = secPaying;
}
else
{
profits.TryGetValue(SecondaryNiceHashID, out var secPaying);
SecondaryCurNhmSmaDataVal = secPaying;
}


IntensityUpToDate = false;

Expand Down
2 changes: 1 addition & 1 deletion NiceHashMiner/Configs/Data/AlgorithmConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public class AlgorithmConfig
public AlgorithmType NiceHashID = AlgorithmType.NONE;
public AlgorithmType SecondaryNiceHashID = AlgorithmType.NONE;
public MinerBaseType MinerBaseType = MinerBaseType.NONE;
public string MinerName = ""; // probably not needed
public string AlgorithmNameCustom = ""; // probably not needed
public double BenchmarkSpeed = 0;
public double SecondaryBenchmarkSpeed = 0;
public string ExtraLaunchParameters = "";
Expand Down
Loading

0 comments on commit bc7726b

Please sign in to comment.