Exemplo n.º 1
0
        private void revise_Click_1(object sender, EventArgs e)
        {
            string path = listSys5.Text; //用户设置的path

            try
            {
                if (Directory.Exists(path))
                { //如果存在
                    List <string> list = new List <string>();
                    for (int i = 0; i < 6; i++)
                    {
                        TextBoxX C = (TextBoxX)this.Controls.Find("listSys" + (i + 1), true)[0];
                        list.Add(C.Text.Trim());
                    }
                    if (SySetHeip.SysetInfo(list) > 0)
                    {
                        Common.Msg.Warning("修改成功");
                        SySetHeip.ConfigurationInfo(SySetHeip.GetSysConfig().Tables[0]);
                    }
                    else
                    {
                        Common.Msg.Warning("修改失败");
                    }
                }
                //不存在,用用户设置path创建路径
                DirectoryInfo di = Directory.CreateDirectory(path);
            }//创建不成功
            catch
            {
                Common.Msg.Warning("修改失败,请检查");
            }
        }
Exemplo n.º 2
0
        private void btnSet_Click(object sender, EventArgs e)
        {
            string path = SetCSV.Text; //用户设置的path

            try
            {
                if (Directory.Exists(path))
                { //如果存在
                    if (RefreshTime.Text != "" && SetCSV.Text != "")
                    {
                        int conn = SySetHeip.SysetInfo(RefreshTime.Text.Trim(), SetCSV.Text.Trim());
                        if (conn > 0)
                        {
                            Common.Msg.Warning("修改成功");
                            SySetHeip.ConfigurationInfo(SySetHeip.GetSysConfig().Tables[0]);
                        }
                        else
                        {
                            Common.Msg.Warning("修改失败");
                        }
                    }
                    else
                    {
                        Common.Msg.Warning("修改失败");
                    }
                }
                //不存在,用用户设置path创建路径
                DirectoryInfo di = Directory.CreateDirectory(path);
            }//创建不成功
            catch { Common.Msg.Warning("CSV保存路径不合法,请检查"); }
        }
Exemplo n.º 3
0
 void PlcToConnect()
 {
     try
     {
         SySetHeip.ConfigurationInfo(SySetHeip.GetSysConfig().Tables[0]); //查询系统配置文件
         SySetHeip.ConfigureMES(SySetHeip.GetSysConfigMES().Tables[0]);   //查询MES系统配置文件
         StocketInfo.StocketInfo s = new StocketInfo.StocketInfo();
         s.socket = SocketHelper.tcpConn(SySetHeip.Plc_ip.Trim(), 9094, 10);
         SocketHelper.socketList.Add(s);
     }
     catch { }
 }
Exemplo n.º 4
0
 private void logManager_Load(object sender, EventArgs e)
 {
     SySetHeip.ConfigurationInfo(SySetHeip.GetSysConfig().Tables[0]);
     RefreshTime.Text = SySetHeip.RefreshTimeInfo1.Trim();
     SetCSV.Text      = SySetHeip.SetCSVInfo1.Trim();
 }