public static AsicStandardStatsObject _Convert(string html, ParsingObject parsingObject) { AsicStandardStatsObject LasicColumn = new AsicStandardStatsObject(); List <string> listTableStats = ParsingTable.Pars(html, parsingObject.MainNameTable, parsingObject.MainTableParsingPattern); List <string> summaryTable = ParsingTable.Pars(html, parsingObject.AdditionalNameTable, parsingObject.AdditionalTableParsingPattern); if (IsOld(listTableStats[1])) { LasicColumn = GetOldData(LasicColumn, listTableStats); } else { LasicColumn = GetNewData(LasicColumn, listTableStats); } LasicColumn.HashrateAVG = listTableStats[listTableStats.Count - 1]; LasicColumn.DateTime = DateTime.Now.ToString(); LasicColumn.ElapsedTime = summaryTable[8 + 0]; return(LasicColumn); }
public static AsicStandardStatsObject _Convert(ParsingAuthorizationWeb.WebHtmlObject html, ParsingObject parsingObject) { AsicStandardStatsObject asicStandard = new AsicStandardStatsObject(); AsicStandardStatsObject webStandardStatsObject = default; try { webStandardStatsObject = WebConvert(html.HtmlWebSiteWebsite, parsingObject); } catch (Exception) { // ignored } if (webStandardStatsObject == default) { asicStandard = ApiConvert(html.ApiHtml); } else { asicStandard = webStandardStatsObject; } return(asicStandard); }
public Result SetDataBase(AsicStandardStatsObject statsObject, ref int percentageProgress) { MySQL mySql = new MySQL(); string connector = $"Server={Settings.DatabaseIP};port={Settings.Port};Database={Settings.DataBaseName};Uid={Settings.DatabaseUser};pwd={Settings.DatabasePass};charset=utf8"; return(mySql.SetAsicColumnData(connector, statsObject, Settings.NameTable, ref percentageProgress)); }
public static AsicStandardStatsObject ApiConvert(string html) { AsicStandardStatsObject asicStandard = new AsicStandardStatsObject(); var Json = ParsingData.ParsAPI(html); asicStandard = AsiCparsingMethods.GetApiData(asicStandard, Json); return(asicStandard); }
private async void SetAsicColumnTable(AntStatsCore.AsicStandardStatsObject asicColumn) { int maxI = 9; for (int i = 0; i < maxI; i++) { await Task.Delay(10); if (asicColumn.LasicAsicColumnStats[i].Status != null) { ColumnList.Status[i].Content = asicColumn.LasicAsicColumnStats[i].Status; } if (asicColumn.LasicAsicColumnStats[i].TempChip != null) { ColumnList.TempChip[i].Content = asicColumn.LasicAsicColumnStats[i].TempChip; } if (asicColumn.LasicAsicColumnStats[i].TempPCB != null) { ColumnList.TempPCB[i].Content = asicColumn.LasicAsicColumnStats[i].TempPCB; } if (asicColumn.LasicAsicColumnStats[i].HW != null) { ColumnList.HW[i].Content = asicColumn.LasicAsicColumnStats[i].HW; } if (asicColumn.LasicAsicColumnStats[i].GHRT != null) { ColumnList.GHRT[i].Content = asicColumn.LasicAsicColumnStats[i].GHRT; } if (asicColumn.LasicAsicColumnStats[i].GHideal != null) { ColumnList.GHideal[i].Content = asicColumn.LasicAsicColumnStats[i].GHideal; } if (asicColumn.LasicAsicColumnStats[i].Watts != null) { ColumnList.Watts[i].Content = asicColumn.LasicAsicColumnStats[i].Watts; } if (asicColumn.LasicAsicColumnStats[i].Frequency != null) { ColumnList.Frequency[i].Content = asicColumn.LasicAsicColumnStats[i].Frequency; } if (asicColumn.LasicAsicColumnStats[i].Chain != null) { ColumnList.Chain[i].Content = asicColumn.LasicAsicColumnStats[i].Chain; } } GetLabel("ElapsedTime").Content = asicColumn.ElapsedTime; GetLabel("DateTime").Content = asicColumn.DateTime; GetLabel("HashrateAvg").Content = asicColumn.HashrateAVG; }
static AsicStandardStatsObject GetNewData(AsicStandardStatsObject LasicColumn, List <string> listTableStats) { for (int i = 1; i < (int)listTableStats.Count / 10; i++) { try { AsicColumnClass asicColumn = new AsicColumnClass(); asicColumn.Chain = listTableStats[i * 10 + 3]; asicColumn.Frequency = listTableStats[i * 10 + 5]; asicColumn.Watts = listTableStats[i * 10 + 6]; asicColumn.GHideal = listTableStats[i * 10 + 7]; asicColumn.GHRT = listTableStats[i * 10 + 8]; asicColumn.HW = listTableStats[i * 10 + 9]; asicColumn.TempPCB = listTableStats[20]; asicColumn.TempChip = listTableStats[i * 10 + 11]; if (listTableStats[i * 10 + 12] == " oooooooo oooooooo oo" || listTableStats[i * 10 + 12] == "oooooooo oooooooo oo") { asicColumn.Status = listTableStats[i * 10 + 12] = "OK(o)"; } else { asicColumn.Status = listTableStats[i * 10 + 12] = "X"; } LasicColumn.LasicAsicColumnStats.Add(asicColumn); } catch (Exception) { // ignored } } return(LasicColumn); }