static void Main(string[] args)
        {
            //TestSerialIOSwitch();
            //TestFile();
            //TestZProtocolProcess();
            //TestZDescribeProcess();
            ZDescribeProcess ZDescribeProcessObj = new ZDescribeProcess();
            ZDescribeProcessObj.LoadDescribesFile("ProtocolDescribe.txt");
            File fio = new File("Frame1.bin", "out1.bin");
            fio.Open();
            //DataCenter DC = new DataCenter(fio, ZDescribeProcessObj);
            //DC.OnNewData += new DataCenter.NewData(DC_OnNewData);
            //DC.Start();
            fio.ReadStream(6);
            fio.ReadStream(15);

            //DC.WriteFrame(1, 2, 0);
            //DataStruct ds = DC.GetData(1);
            //ds.Data[0] = "0";
            //ds.Data[1] = "1";
            //ds.Data[2] = "ff";
            //ds.Data[3] = "Z";
            //ds.Data[4] = "2.3";
            //DC.AddData(ds);
            //DC.Send();

            Console.ReadLine();
        }
        public MainForm()
        {
            InitializeComponent();
            FlowPlan.MouseWheel += new MouseEventHandler(flowLayoutPanel1_MouseWheel);

            ZDescribeProcessObj = new ZDescribeProcess();
            ZDescribeProcessObj.LoadDescribesFile("ProtocolDescribe.txt");
            WriteLine("Loaded " + ZDescribeProcessObj.ZPackageDescribeNum + " Protocol Describe Info");

            Blocks = new Dictionary<byte, DataBlock>(ZDescribeProcessObj.ZPackageDescribeNum);
            foreach (KeyValuePair<byte, ZBlockDescribe> z in ZDescribeProcessObj)
            {
                DataBlock dataBlock = Converter.CreateDataBlock(z.Value);
                Blocks.Add(z.Key, dataBlock);
                FlowPlan.Controls.Add(dataBlock);
                dataBlock.MouseClick += new MouseEventHandler(dataBlock_MouseClick);
                dataBlock.MouseDoubleClick += new MouseEventHandler(dataBlock_MouseDoubleClick);
            }

            //wcl_start
            FlowPlanMin.MouseWheel += new MouseEventHandler(flowLayoutPanel1_MouseWheelMin);
            ZDescribeProcessObjMin = new ZDescribeProcess();
            ZDescribeProcessObjMin.LoadDescribesFile("ProtocolDescribeMin.txt");
            WriteLine("Loaded " + ZDescribeProcessObjMin.ZPackageDescribeNum + " Protocol Describe Info");

            BlocksMin = new Dictionary<byte, DataBlock>(ZDescribeProcessObjMin.ZPackageDescribeNum);
            foreach (KeyValuePair<byte, ZBlockDescribe> zMin in ZDescribeProcessObjMin)
            {
                DataBlock dataBlockMin = Converter.CreateDataBlock(zMin.Value);
                BlocksMin.Add(zMin.Key, dataBlockMin);
                FlowPlanMin.Controls.Add(dataBlockMin);
            }
            //wcl_end

            InitPackages();
            WriteLine("Loaded " + Packages.Count + " Protocol Data");
            UpdatePackagelist();

            ToStop();
        }
Пример #3
0
        //wcl_end

        #region 初始化

        public MainForm()
        {
            InitializeComponent();
            FlowPlan.MouseWheel += new MouseEventHandler(flowLayoutPanel1_MouseWheel);

            ZDescribeProcessObj = new ZDescribeProcess();
            ZDescribeProcessObj.LoadDescribesFile("ProtocolDescribe.txt");
            WriteLine("Loaded " + ZDescribeProcessObj.ZPackageDescribeNum + " Protocol Describe Info");

            Blocks = new Dictionary <byte, DataBlock>(ZDescribeProcessObj.ZPackageDescribeNum);
            foreach (KeyValuePair <byte, ZBlockDescribe> z in ZDescribeProcessObj)
            {
                DataBlock dataBlock = Converter.CreateDataBlock(z.Value);
                Blocks.Add(z.Key, dataBlock);
                FlowPlan.Controls.Add(dataBlock);
                dataBlock.MouseClick       += new MouseEventHandler(dataBlock_MouseClick);
                dataBlock.MouseDoubleClick += new MouseEventHandler(dataBlock_MouseDoubleClick);
            }

            //wcl_start
            FlowPlanMin.MouseWheel += new MouseEventHandler(flowLayoutPanel1_MouseWheelMin);
            ZDescribeProcessObjMin  = new ZDescribeProcess();
            ZDescribeProcessObjMin.LoadDescribesFile("ProtocolDescribeMin.txt");
            WriteLine("Loaded " + ZDescribeProcessObjMin.ZPackageDescribeNum + " Protocol Describe Info");

            BlocksMin = new Dictionary <byte, DataBlock>(ZDescribeProcessObjMin.ZPackageDescribeNum);
            foreach (KeyValuePair <byte, ZBlockDescribe> zMin in ZDescribeProcessObjMin)
            {
                DataBlock dataBlockMin = Converter.CreateDataBlock(zMin.Value);
                BlocksMin.Add(zMin.Key, dataBlockMin);
                FlowPlanMin.Controls.Add(dataBlockMin);
            }
            //wcl_end

            InitPackages();
            WriteLine("Loaded " + Packages.Count + " Protocol Data");
            UpdatePackagelist();

            ToStop();
        }
 private static void TestZDescribeProcess()
 {
     ZDescribeProcess zDescribeProcess = new ZDescribeProcess();
     zDescribeProcess.LoadDescribesFile("ProtocolDescribe.txt");
     ZBlockDescribe zpd = zDescribeProcess.Lookup(0xc0);
 }