public MonitorData() { for (int i = 0; i < 20; i++) { // mailbox 0#, 0x620 s0[i] = new DecodeRecCanData(2047, -2048, 20, 0, i + 1, "s0"); s1[i] = new DecodeRecCanData(4095, 0, 20, 0, i + 1, "s1"); s2[i] = new DecodeRecCanData(4095, 0, 20, 0, i + 1, "s2"); s3[i] = new DecodeRecCanData(4095, 0, 20, 0, i + 1, "s3"); u1[i] = new DecodeRecCanData(2047, 0, 400, 0, i + 1, "u0"); i1[i] = new DecodeRecCanData(1536, 0, 120, 0, i + 1, "i1"); i2[i] = new DecodeRecCanData(1536, 0, 120, 0, i + 1, "i2"); a0[i] = new DecodeRecCanData(2047, -2048, 50, -50, i + 1, "a0"); a1[i] = new DecodeRecCanData(4095, 0, 50, -50, i + 1, "a1"); a2[i] = new DecodeRecCanData(4095, 0, 50, -50, i + 1, "a2"); km1d[i] = new DecodeRecCanData(2047, -2048, 50, -50, i + 1, "km1d"); km1d[i] = new DecodeRecCanData(2047, -2048, 50, -50, i + 1, "km2d"); speed[i] = new DecodeRecCanData(2047, -2048, 50, -50, i + 1, "speed"); temp[i] = new DecodeRecCanData(2047, -2048, 50, -50, i + 1, "temp"); } this.tail = 0; this.head = 0; }
public DecodeRecCanData this[string data_name, int point_id] { get { DecodeRecCanData info = new DecodeRecCanData(); if (data_name == "S0") { info = s0[point_id - 1]; } else if (data_name == "S1") { info = s1[point_id - 1]; } else if (data_name == "S2") { info = s2[point_id - 1]; } else if (data_name == "S3") { info = s3[point_id - 1]; } else if (data_name == "A0") { info = a0[point_id - 1]; } else if (data_name == "A1") { info = a1[point_id - 1]; } else if (data_name == "A2") { info = a2[point_id - 1]; } else if (data_name == "U1") { info = u1[point_id - 1]; } else if (data_name == "I1") { info = i1[point_id - 1]; } else if (data_name == "Temp") { info = i1[point_id - 1]; } else if (data_name == "SPEED") { info = i1[point_id - 1]; } else if (data_name == "KM2D") { info = i1[point_id - 1]; } else { info = null; } return(info); } }
public DecodeRecCanData this[string arae_name] { get { DecodeRecCanData info = new DecodeRecCanData(); string[] str = arae_name.Split('-'); string data_name = str[1]; int point_id = Convert.ToInt32(str[0]); if (data_name == "S0") { info = s0[point_id - 1]; } else if (data_name == "S1") { info = s1[point_id - 1]; } else if (data_name == "S2") { info = s2[point_id - 1]; } else if (data_name == "S3") { info = s3[point_id - 1]; } else if (data_name == "A0") { info = a0[point_id - 1]; } else if (data_name == "A1") { info = a1[point_id - 1]; } else if (data_name == "A2") { info = a2[point_id - 1]; } else if (data_name == "U1") { info = u1[point_id - 1]; } else if (data_name == "I1") { info = i1[point_id - 1]; } else if (data_name == "Temp") { info = i1[point_id - 1]; } else if (data_name == "SPEED") { info = i1[point_id - 1]; } else if (data_name == "KM2D") { info = i1[point_id - 1]; } else { info = null; } return(info); } }