using System;

namespace SL200_RTLogViewer.lib
{
	// Token: 0x0200003D RID: 61
	public class TWCT320
	{
		// Token: 0x06000162 RID: 354 RVA: 0x0002867C File Offset: 0x0002687C
		public static TWCT320Class SetData(byte[] data)
		{
			TWCT320Class twct320Class = new TWCT320Class();
			twct320Class.seq = Convert.ToInt32(data[0]);
			string text = Convert.ToString((int)data[1] << 8 | (int)data[2], 16);
			twct320Class.trainNumber = text.Substring(3) + text.Substring(0, 3);
			twct320Class.destNumber = Convert.ToInt32(data[3]);
			twct320Class.formNumber = Convert.ToInt32(data[4]);
			twct320Class.dopr = ((data[5] & 128) > 0);
			twct320Class.zvr = ((data[5] & 64) > 0);
			twct320Class.pg3r = ((data[5] & 32) > 0);
			twct320Class.atocr = ((data[5] & 16) > 0);
			twct320Class.hcr = ((data[5] & 8) > 0);
			twct320Class.txen = ((data[5] & 4) > 0);
			bool flag = (data[5] & 3) == 0;
			if (flag)
			{
				twct320Class.trainR = 6;
			}
			else
			{
				bool flag2 = (data[5] & 3) == 1;
				if (flag2)
				{
					twct320Class.trainR = 8;
				}
				else
				{
					bool flag3 = (data[5] & 3) == 2;
					if (flag3)
					{
						twct320Class.trainR = 10;
					}
				}
			}
			twct320Class.oldnew = ((data[6] & 8) > 0);
			bool flag4 = (data[6] & 28) == 0;
			if (flag4)
			{
				twct320Class.drvmode = "Invalid";
			}
			else
			{
				bool flag5 = (data[6] & 28) == 1;
				if (flag5)
				{
					twct320Class.drvmode = "FMC";
				}
				else
				{
					bool flag6 = (data[6] & 28) == 2;
					if (flag6)
					{
						twct320Class.drvmode = "YARD";
					}
					else
					{
						bool flag7 = (data[6] & 28) == 3;
						if (flag7)
						{
							twct320Class.drvmode = "MCS";
						}
						else
						{
							bool flag8 = (data[6] & 28) == 4;
							if (flag8)
							{
								twct320Class.drvmode = "AUTO";
							}
							else
							{
								bool flag9 = (data[6] & 28) == 5;
								if (flag9)
								{
									twct320Class.drvmode = "FA";
								}
								else
								{
									twct320Class.drvmode = "None";
								}
							}
						}
					}
				}
			}
			return twct320Class;
		}
	}
}
