Example #1
0
        private void Form1_Load(object sender, EventArgs e)
        {
            //打开串口
            if (serialPort.open() && serialScanPort.open())
            {
                label2.Text            = "串口开启成功!";
                barHeaderItem1.Caption = "串口开启成功!";
            }
            else
            {
                label2.Text            = "串口开启失败!";
                barHeaderItem1.Caption = "串口开启失败!";
            }
            //界面初始化
            this.Text = "欢迎使用扭矩校验系统,当前登录: " + P_Con_User.CurrentUser.User_name;
            //this.timeLab.Text = "        " + DateTime.Now.Date.ToString("yyyy年MM月dd日");
            //this.userLab.Text = P_Con_User.CurrentUser.User_name;
            this.barStaticItem1.Caption = DateTime.Now.Date.ToString("yyyy年MM月dd日");
            techDgv.Visible             = false;

            //PLC连接
            string strMsg;

            s7help = new S7Help(this);
            s7help.SiemensS7NetConnect(HslCommunication.Profinet.Siemens.SiemensPLCS.S1200, out strMsg);
            barHeaderItem1.Caption += "; " + strMsg;
            label2.Text            += "-------" + strMsg;
            //Thread.Sleep(1000);
        }
 public ClickTorque(SerialPortHelper serialPort, S7Help s7Help, Main wnd)
 {
     this.serialPort = serialPort;
     this.wnd        = wnd;
     name            = "咔嗒扳手";
     this.s7Help     = s7Help;
     hybirdLock      = new HslCommunication.Core.SimpleHybirdLock();
 }
Example #3
0
 public DigitalTorque(SerialPortHelper serialPort, S7Help s7Help, Main wnd)
 {
     this.name            = "数显扳手";
     this.serialPort      = serialPort;
     this.wnd             = wnd;
     this.s7Help          = s7Help;
     hybirdLock           = new HslCommunication.Core.SimpleHybirdLock();
     manualWriteValueForm = new ManualWriteValueForm();
     manualWriteValueForm.Hide();
 }