.csusing System;

namespace SL200_RTLogViewer.lib
{
	// Token: 0x0200002F RID: 47
	public class CCC151
	{
		// Token: 0x0600014E RID: 334 RVA: 0x00024BF4 File Offset: 0x00022DF4
		public static CCC151Class SetData(byte[] data)
		{
			CCC151Class ccc151Class = new CCC151Class();
			ccc151Class.seq = Convert.ToInt32(data[0]);
			ccc151Class.nomalactive = ((data[1] & 64) > 0);
			ccc151Class.nomalactive = ((data[1] & 32) > 0);
			ccc151Class.systemactive = ((data[1] & 16) > 0);
			ccc151Class.drmclose = ((data[1] & 8) > 0);
			ccc151Class.recovery = ((data[1] & 4) > 0);
			ccc151Class.nomal = ((data[1] & 2) > 0);
			ccc151Class.tachodir = ((data[1] & 1) > 0);
			ccc151Class.doorcl = ((data[2] & 128) > 0);
			ccc151Class.doorop = ((data[2] & 64) > 0);
			ccc151Class.mcneu = ((data[2] & 32) > 0);
			ccc151Class.mceb = ((data[2] & 16) > 0);
			ccc151Class.rodfwd = ((data[2] & 1) > 0);
			bool flag = (data[2] & 14) == 0;
			if (flag)
			{
				ccc151Class.drvmode = "-";
			}
			else
			{
				bool flag2 = (data[2] & 14) == 1;
				if (flag2)
				{
					ccc151Class.drvmode = "FMC";
				}
				else
				{
					bool flag3 = (data[2] & 14) == 2;
					if (flag3)
					{
						ccc151Class.drvmode = "YARD";
					}
					else
					{
						bool flag4 = (data[2] & 14) == 3;
						if (flag4)
						{
							ccc151Class.drvmode = "MCS";
						}
						else
						{
							bool flag5 = (data[2] & 14) == 4;
							if (flag5)
							{
								ccc151Class.drvmode = "AUTO";
							}
							else
							{
								bool flag6 = (data[2] & 14) == 5;
								if (flag6)
								{
									ccc151Class.drvmode = "FA";
								}
							}
						}
					}
				}
			}
			ccc151Class.activeunit = ((data[3] & 128) > 0);
			ccc151Class.startbutton = ((data[3] & 64) > 0);
			ccc151Class.hcr = ((data[3] & 16) > 0);
			ccc151Class.tc2 = ((data[3] & 8) > 0);
			ccc151Class.tc1 = ((data[3] & 4) > 0);
			ccc151Class.psdcl = ((data[3] & 2) > 0);
			ccc151Class.psdop = ((data[3] & 1) > 0);
			ccc151Class.edl = ((data[4] & 16) > 0);
			ccc151Class.edr = ((data[4] & 8) > 0);
			ccc151Class.zvr = ((data[4] & 4) > 0);
			ccc151Class.fsb = ((data[4] & 2) > 0);
			ccc151Class.eb = ((data[4] & 1) > 0);
			ccc151Class.formno = Convert.ToInt32(data[5]);
			ccc151Class.trainno = Convert.ToString((int)data[6] << 8 | (int)data[7], 16);
			return ccc151Class;
		}
	}
}
