private WBFMSystem()
        {
            InitializeComponent();
            UIBLL.CustomizeMove(this.PanelTopic, this.LabelTopic, this);

            try
            {
                //socket.Connect("192.168.2.34", 3340);
                socket.Connect("127.0.0.1", 3340);
                if (socket.Connected)
                {
                    this.LabelConnectInfo.Text = "连接到内网主机";
                    const int    BUFFER_SIZE = 1024;
                    byte[]       readBuff    = new byte[BUFFER_SIZE];
                    IAsyncResult count       = socket.BeginReceive(readBuff, 0, readBuff.Length, SocketFlags.None, new AsyncCallback(LabelConnectInfo_Update), readBuff);
                    string       res         = Encoding.UTF8.GetString(readBuff);
                }
            }
            catch
            {
                this.LabelConnectInfo.Text = "未连接到内网";
                //IPAddress iPAddress = IPAddress.Parse("127.0.0.1");
                //IPEndPoint endPoint = new IPEndPoint(iPAddress, 3389);
                //socket.BeginConnect(endPoint, new AsyncCallback(ConnectCallback1), null);
            }
        }
 private PlanManage()
 {
     InitializeComponent();
     UIBLL.CustomizeMove <Panel, Label>(this.PanelTopic, this.LabelTopic, this);
 }
 private void WBFMSystem_Activated(object sender, EventArgs e)
 {
     UIBLL.CustomizeMove <Panel, Label>(this.PanelTopic, this.LabelTopic, this);
 }
        private void WBFMSystem_Load(object sender, EventArgs e)
        {
            //if (this.LabelConnectInfo.Text == "未连接到内网")
            //{
            //    IPAddress iPAddress = IPAddress.Parse("127.0.0.1");
            //    IPEndPoint endPoint = new IPEndPoint(iPAddress, 3340);
            //    socket.Connect(endPoint);
            //    //socket.BeginConnect(endPoint, new AsyncCallback(ConnectCallback1), null);
            //    //socket.BeginConnect(endPoint, new AsyncCallback((ar) =>
            //    //{
            //    //    this.Invoke(new EventHandler(delegate
            //    //    {
            //    //        LabelConnectInfo.Text += "ReConnecting..";
            //    //    }));
            //    //}), null);
            //}

            //byte[] _deviceName = Encoding.UTF8.GetBytes(DeviceInfo.DeviceName());
            //socket.Send(_deviceName, 0, _deviceName.Length, SocketFlags.None);

            UIBLL.CustomizeMove <Panel, Label>(this.PanelTopic, this.LabelTopic, this);
            try
            {
                lPSerialPort = new SerialPort();

                //Type type = lPSerialPort.GetType();
                //FieldInfo fieldInfo = type.GetField("defaultBaudRate", BindingFlags.NonPublic | BindingFlags.Instance);
                //int a = (int)fieldInfo.GetValue(lPSerialPort);

                lPSerialPort.PortName = SPBLL.LPSerialPortName();
                lPSerialPort.Open();

                if (lPSerialPort.DsrHolding)
                {
                    this.LabelCurrentOperation.Text = "就绪";

                    //byte[] ms = new byte[1024];
                    byte[] Message = ComFormatPackage.ConstructCommandInfo(GETCommandNames.MAPRD);
                    lPSerialPort.Write(Message, 0, Message.Length);

                    //lPSerialPort.ReadTimeout = 1000;
                    //byte[] qew = new byte[1024];
                    //lPSerialPort.Read(qew, 0, qew.Length);

                    //byte[] qew2 = new byte[lPSerialPort.BytesToRead];
                    //lPSerialPort.Read(qew2, 0, qew2.Length);

                    lPSerialPort.DataReceived += BtnBoxOpen_Click;

                    //LPSerialPortTran lPSerialPortTran = new LPSerialPortTran(SystemSetting.GetLPSerialPort);
                    //lPSerialPortTran(lPSerialPort);
                }
                else
                {
                    this.LabelCurrentOperation.Text = "初始化失败!";
                    LogMessage logInfo = new LogMessage();
                    logInfo.OperationTime      = DateTime.Now;
                    logInfo.ExceptionInfo      = "初始化失败";
                    this.TextBoxErrorLog.Text += new LogFormat().ErrorFormat(logInfo);
                    MessageBox.Show("默认串口号错误!");
                }
            }
            catch
            {
            }
        }
 public Correction()
 {
     InitializeComponent();
     UIBLL.CustomizeMove <Panel, Label>(this.PanelMenu, this.LabelCorrect, this);
 }
 private void AlgorithmSetting_Load(object sender, EventArgs e)
 {
     UIBLL.CustomizeMove(this.PanelAlgorSettingTopic, this.LabelAlgorSettingTopic, this);
     //this.Height = 553 * _controlModel.Height / 1080;
     //this.Width = 440 * _controlModel.Width / 1902;
 }
Esempio n. 7
0
 private CalibrationSetting()
 {
     InitializeComponent();
     UIBLL.CustomizeMove <Panel, Label>(this.PanelTopic, this.LabelTopic, this);
 }
Esempio n. 8
0
 public DataManage()
 {
     InitializeComponent();
     UIBLL.CustomizeMove <Panel, Label>(this.PanelTopic, this.LabelTopic, this);
 }