твой_бот.ctx.send(твой_бот.get_emoji(айди эмодзи)
)try
{
var start = new DateTime(1899, 12, 30);
formsPlot1.Plot.Clear();
valuesX = DB.SelectDouble(ref conn, "CX");
valuesY = DB.SelectDouble(ref conn, "CY");
valuesZ = DB.SelectDouble(ref conn, "CZ");
dates = DB.SelectDouble(ref conn, "Date time");
double pointsPerDay = 24 * 60;
var sigX = formsPlot1.Plot.AddSignal(valuesX.ToArray(), pointsPerDay);
var sigY = formsPlot1.Plot.AddSignal(valuesY.ToArray(), pointsPerDay);
var sigZ = formsPlot1.Plot.AddSignal(valuesZ.ToArray(), pointsPerDay);
signalsX.Add(sigX);
signalsY.Add(sigY);
signalsZ.Add(sigZ);
if (isFirst)
{
sigX.Label = "X";
sigY.Label = "Y";
sigZ.Label = "Z";
isFirst = false;
}
for (int i = 0; i < valuesX.Count; i++)
{
sigX.OffsetX = dates[i];
sigY.OffsetX = dates[i];
sigZ.OffsetX = dates[i];
}
if (darkToolStripMenuItem.Checked)
{
darkToolStripMenuItem_Click(this, null);
}
else
{
lightToolStripMenuItem_Click(this, null);
}
}
catch { }
public static List<double> SelectDouble(ref MySqlConnection conn, string what = "CX")
{
try
{
switch (what)
{
case "Date time":
// SELECT `Date time` FROM `Var`
MySqlCommand cmd2 = new MySqlCommand("SELECT `Date time` FROM `Var`", conn);
MySqlDataReader reader2 = cmd2.ExecuteReader();
List<double> values2 = new List<double>();
while (reader2.Read())
{
var date = Convert.ToDateTime(reader2.GetString(0)).ToOADate();
values2.Add(date);
}
reader2.Close();
return values2;
case "CX":
// SELECT `CX` FROM `Var`
MySqlCommand cmd3 = new MySqlCommand("SELECT `CX` FROM `Var`", conn);
MySqlDataReader reader3 = cmd3.ExecuteReader();
List<double> values3 = new List<double>();
while (reader3.Read())
{
values3.Add(double.Parse(reader3.GetString(0)));
}
reader3.Close();
return values3;
case "CY":
// SELECT `CY` FROM `Var`
MySqlCommand cmd4 = new MySqlCommand("SELECT `CY` FROM `Var`", conn);
MySqlDataReader reader4 = cmd4.ExecuteReader();
List<double> values4 = new List<double>();
while (reader4.Read())
{
values4.Add(double.Parse(reader4.GetString(0)));
}
reader4.Close();
return values4;
case "CZ":
// SELECT `CZ` FROM `Var`
MySqlCommand cmd5 = new MySqlCommand("SELECT `CZ` FROM `Var`", conn);
MySqlDataReader reader5 = cmd5.ExecuteReader();
List<double> values5 = new List<double>();
while (reader5.Read())
{
values5.Add(double.Parse(reader5.GetString(0)));
}
reader5.Close();
return values5;
default:
throw new Exception("iinvalid value");
break;
}
}
catch (Exception ex)
{
MessageBox.Show(ex.Message);
return new List<double>();
}
}
listDates = DB.Select(ref conn, "Date time");
listX = DB.Select(ref conn, "CX");
listY = DB.Select(ref conn, "CY");
listZ = DB.Select(ref conn, "CZ");
for (int i = 0; i < listX.Count; i++)
{
valuesX.Add(double.Parse(listX[i]));
valuesY.Add(double.Parse(listY[i]));
valuesZ.Add(double.Parse(listZ[i]));
}
double samplesPerDay = (24 * 60);
var sig = formsPlot1.Plot.AddSignal(valuesX.ToArray(), sampleRate: samplesPerDay);
sig.OffsetX = start.ToOADate();
formsPlot1.Refresh();