private void InitDgvCourtCombBox(ref UIDataGridView GridCtrl, Int32 iRowIndex, Int32 iColumnIndex) { string strVenueID = this.dgv_Scheduled.Rows[iRowIndex].Cells["F_VenueID"].Value.ToString();; System.Data.DataTable dt = GetCourtItemTable(strVenueID); (GridCtrl.Columns[iColumnIndex] as DGVCustomComboBoxColumn).FillComboBoxItems(dt, 1, 0); }
public static void addRow(ref UIDataGridView GPUStatusTable, ref UIDataGridView GPUOverClockTable) { try { szzminer_overclock.AMD.NvmlHelper nvmlHelper = new szzminer_overclock.AMD.NvmlHelper(); List <szzminer_overclock.AMD.NvmlHelper.NvGpu> gpus = nvmlHelper.GetGpus(); for (int i = 0; i < gpus.Count; i++) { GPUStatusTable.Rows.Add(); GPUOverClockTable.Rows.Add(); GPUStatusTable.Rows[i].Cells[2].Value = "0"; GPUStatusTable.Rows[i].Cells[3].Value = "0"; GPUStatusTable.Rows[i].Cells[4].Value = "0"; } } catch { } try { AdlHelper adl = new AdlHelper(); for (int i = 0; i < adl.ATIGpus.Count; i++) { GPUStatusTable.Rows.Add(); GPUOverClockTable.Rows.Add(); } } catch { } }
private void InitDgvSessionCombBox(ref UIDataGridView GridCtrl, Int32 iRowIndex, Int32 iColumnIndex) { string strDate = this.dgv_Scheduled.Rows[iRowIndex].Cells["Date"].Value.ToString(); System.Data.DataTable dt = GetSessionItemTable(strDate); (GridCtrl.Columns[iColumnIndex] as DGVCustomComboBoxColumn).FillComboBoxItems(dt, 1, 0); }
public static void getGPU(ref UIDataGridView GPUStatusTable, ref int totalPower) { int GPUCount = 0; try { szzminer_overclock.AMD.NvmlHelper nvmlHelper = new szzminer_overclock.AMD.NvmlHelper(); szzminer_overclock.AMD.NvapiHelper nvapiHelper = new szzminer_overclock.AMD.NvapiHelper(); List <szzminer_overclock.AMD.NvmlHelper.NvGpu> gpus = nvmlHelper.GetGpus(); uint coretemp = 0; uint memtemp = 0; for (int i = 0; i < gpus.Count; i++) { szzminer_overclock.AMD.OverClockRange overClockRange = nvapiHelper.GetClockRange(gpus[i].BusId); GPUStatusTable.Rows[GPUCount].Cells[0].Value = gpus[i].BusId; GPUStatusTable.Rows[GPUCount].Cells[1].Value = "NVIDIA " + gpus[i].Name + " " + gpus[i].TotalMemory / 1024 / 1000 / 1000 + "GB"; GPUStatusTable.Rows[GPUCount].Cells[5].Value = nvmlHelper.GetPowerUsage(i); nvapiHelper.GetCoreTemperature(gpus[i].BusId, out coretemp); nvapiHelper.GetMemTemperature(gpus[i].BusId, out memtemp); GPUStatusTable.Rows[GPUCount].Cells[6].Value = coretemp.ToString() + "/" + memtemp.ToString(); GPUStatusTable.Rows[GPUCount].Cells[7].Value = nvmlHelper.GetFanSpeed(i); GPUStatusTable.Rows[GPUCount].Cells[8].Value = nvmlHelper.GetCoreClock(i) + "Mhz"; GPUStatusTable.Rows[GPUCount].Cells[9].Value = nvmlHelper.GetMemoryClock(i) + "Mhz"; totalPower += Convert.ToInt32(GPUStatusTable.Rows[GPUCount].Cells[5].Value); GPUCount++; } } catch { //WriteLog("没有发现N卡"); } try { AdlHelper adl = new AdlHelper(); const ulong a = 1024 * 1024 * 1024; uint power = 0, fan = 0; int temp = 0; int memtemp = 0; int coreClock = 0, memoryClock = 0; for (int i = 0; i < adl.ATIGpus.Count; i++) { adl.GetPowerFanTemp(adl.ATIGpus[i].BusNumber, out power, out fan, out temp, out memtemp); adl.GetClockRange(adl.ATIGpus[i].BusNumber, out coreClock, out memoryClock); GPUStatusTable.Rows[GPUCount].Cells[0].Value = adl.ATIGpus[i].BusNumber; GPUStatusTable.Rows[GPUCount].Cells[1].Value = adl.ATIGpus[i].AdapterName + " " + ((adl.GetTotalMemory(adl.ATIGpus[i].AdapterIndex) + a - 1) / a).ToString() + "GB";; GPUStatusTable.Rows[GPUCount].Cells[5].Value = power; GPUStatusTable.Rows[GPUCount].Cells[6].Value = temp; GPUStatusTable.Rows[GPUCount].Cells[7].Value = fan; GPUStatusTable.Rows[GPUCount].Cells[8].Value = coreClock / 1000 + "Mhz"; GPUStatusTable.Rows[GPUCount].Cells[9].Value = memoryClock / 1000 + "Mhz"; totalPower += Convert.ToInt32(GPUStatusTable.Rows[GPUCount].Cells[5].Value); GPUCount++; } } catch { } }
/// <summary> /// 停止挖矿后表格内容归零 /// </summary> /// <param name="uIDataGridView"></param> public static void afterStopMiner(ref UIDataGridView uIDataGridView) { for (int i = 0; i < uIDataGridView.Rows.Count; i++) { uIDataGridView.Rows[i].Cells[2].Value = "0"; uIDataGridView.Rows[i].Cells[3].Value = "0"; uIDataGridView.Rows[i].Cells[4].Value = "0"; } }
private void Planlist_DoubleClick(object sender, EventArgs e) { if (sender.GetType().Name == "UIDataGridView") { UIDataGridView t = (UIDataGridView)sender; Thread thread; thread = new Thread(() => Planlist_DoubleClickWork2(Records[t.SelectedIndex], e)); thread.Start(); } }
public static void getOverclockGPU(ref UIDataGridView GPUOverClockTable) { int GPUCount = 0; try { szzminer_overclock.AMD.NvmlHelper nvmlHelper = new szzminer_overclock.AMD.NvmlHelper(); szzminer_overclock.AMD.NvapiHelper nvapiHelper = new szzminer_overclock.AMD.NvapiHelper(); List <szzminer_overclock.AMD.NvmlHelper.NvGpu> gpus = nvmlHelper.GetGpus(); for (int i = 0; i < gpus.Count; i++) { szzminer_overclock.AMD.OverClockRange overClockRange = nvapiHelper.GetClockRange(gpus[i].BusId); GPUOverClockTable.Rows[GPUCount].Cells[0].Value = gpus[i].BusId; GPUOverClockTable.Rows[GPUCount].Cells[1].Value = "NVIDIA " + gpus[i].Name + " " + gpus[i].TotalMemory / 1024 / 1000 / 1000 + "GB"; GPUOverClockTable.Rows[GPUCount].Cells[5].Value = "N/A"; GPUOverClockTable.Rows[GPUCount].Cells[7].Value = "N/A"; GPUCount++; } } catch { //WriteLog("没有发现N卡"); } try { AdlHelper adl = new AdlHelper(); const ulong a = 1024 * 1024 * 1024; for (int i = 0; i < adl.ATIGpus.Count; i++) { uint power, fan; int temp; int coreClock, memoryClock; adl.GetPowerFanTemp(adl.ATIGpus[i].BusNumber, out power, out fan, out temp); adl.GetClockRange(adl.ATIGpus[i].BusNumber, out coreClock, out memoryClock); GPUOverClockTable.Rows[GPUCount].Cells[0].Value = adl.ATIGpus[i].BusNumber; GPUOverClockTable.Rows[GPUCount].Cells[1].Value = adl.ATIGpus[i].AdapterName + " " + ((adl.GetTotalMemory(adl.ATIGpus[i].AdapterIndex) + a - 1) / a).ToString() + "GB";; GPUOverClockTable.Rows[GPUCount].Cells[2].Value = adl.ATIGpus[i].PowerDefault.ToString(); GPUOverClockTable.Rows[GPUCount].Cells[3].Value = adl.ATIGpus[i].TempLimitDefault.ToString(); GPUOverClockTable.Rows[GPUCount].Cells[4].Value = (adl.ATIGpus[i].coreClockSelf).ToString(); GPUOverClockTable.Rows[GPUCount].Cells[5].Value = adl.ATIGpus[i].CoreVolt; GPUOverClockTable.Rows[GPUCount].Cells[6].Value = (adl.ATIGpus[i].memoryClockSelf / 1000).ToString(); GPUOverClockTable.Rows[GPUCount].Cells[7].Value = adl.ATIGpus[i].MemoryVolt; GPUCount++; } } catch { } }
private static bool checkTableSelected(UIDataGridView MinerStatusTable) { int j = 0; for (; j < MinerStatusTable.Rows.Count; j++) { if (MinerStatusTable.Rows[j].Cells[2].Value == null) { continue; } if (MinerStatusTable.Rows[j].Cells[2].Value.ToString() == "True") { return(true); } } return(false); }
private void InitMovementTypeCombBox(ref UIDataGridView GridCtrl, Int32 iColumnIndex) { DataTable dtMovementType = new DataTable(); dtMovementType.Columns.Add("Value"); DataRow drMovementType; drMovementType = dtMovementType.NewRow(); drMovementType[0] = "M"; dtMovementType.Rows.Add(drMovementType); drMovementType = dtMovementType.NewRow(); drMovementType[0] = "C"; dtMovementType.Rows.Add(drMovementType); //往combobox添加item (GridCtrl.Columns[iColumnIndex] as DGVCustomComboBoxColumn).FillComboBoxItems(dtMovementType, 0, 0); dtMovementType.Dispose(); }
public DataGrid(RectangleF rect) : base(rect) { var random = new Random(); items = new List <MyDataRow>(); for (int i = 0; i <= 100; i++) { items.Add(new MyDataRow { PrimaryKey = i, ColumnA = "I am column a", ColumnB = random.NextDouble(), Description = "my random " + random.Next() + " row description", }); } gridView = new UIDataGridView(rect); gridView.Items = items.ToArray(); this.BackgroundColor = UIColor.White; this.AddSubview(gridView); }
public void InitFunctionCombBox(ref UIDataGridView dgv, int iColumnIndex, string strFunType) { if (GVAR.g_adoDataBase.DBConnect.State == System.Data.ConnectionState.Closed) { GVAR.g_adoDataBase.DBConnect.Open(); } try { #region DML Command Setup for Fill Function combo SqlCommand cmd = new SqlCommand("Proc_EQ_GetFunctions", GVAR.g_adoDataBase.DBConnect); cmd.CommandType = CommandType.StoredProcedure; SqlParameter cmdParameter0 = new SqlParameter("@DisciplineID", SqlDbType.Int); SqlParameter cmdParameter1 = new SqlParameter("@LanguageCode", SqlDbType.NVarChar, 3); SqlParameter cmdParameter2 = new SqlParameter("@CategoryCode", SqlDbType.NVarChar, 20); cmdParameter0.Value = m_iDisciplineID; cmdParameter1.Value = m_strLanguageCode; cmdParameter2.Value = strFunType; cmd.Parameters.Add(cmdParameter0); cmd.Parameters.Add(cmdParameter1); cmd.Parameters.Add(cmdParameter2); SqlDataReader dr = cmd.ExecuteReader(); #endregion DataTable table = new DataTable(); table.Columns.Add("F_FunctionLongName", typeof(string)); table.Columns.Add("F_FunctionID", typeof(int)); table.Rows.Add("", "-1"); table.Load(dr); (dgv.Columns[iColumnIndex] as DGVCustomComboBoxColumn).FillComboBoxItems(table, "F_FunctionLongName", "F_FunctionID"); dr.Close(); } catch (System.Exception e) { DevComponents.DotNetBar.MessageBoxEx.Show(e.Message); } }
public static bool updateMiner(UIDataGridView MinerStatusTable) { if (!checkTableSelected(MinerStatusTable)) { return(false); } var i = 0; for (; i < MinerStatusTable.Rows.Count; i++) { if (MinerStatusTable.Rows[i].Cells[2].Value == null) { continue; } if (MinerStatusTable.Rows[i].Cells[2].Value.ToString() == "True") { UDPHelper.Send("{\"function\":\"update\"}", MinerStatusTable.Rows[i].Cells[12].Value.ToString()); } } return(true); }
private void InitDgvVenueCombBox(ref UIDataGridView GridCtrl, Int32 iRowIndex, Int32 iColumnIndex) { System.Data.DataTable dt = GetVenueItemTable(); (GridCtrl.Columns[iColumnIndex] as DGVCustomComboBoxColumn).FillComboBoxItems(dt, 1, 0); }
public changeCoin(UIDataGridView Table) { InitializeComponent(); MinerStatusTable = Table; }